Skip to content

Commit

Permalink
add Symbol option to labels
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Nov 7, 2022
1 parent 95502a4 commit 5f29310
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/BigNumbers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export bignumber
register_normal_element("st__big__number", context = @__MODULE__)

"""
bignumber(label::String = "", number::Union{Symbol,Number,Nothing} = nothing, args...; kwargs...)
bignumber(label::Union{String,Symbol} = "", number::Union{Symbol,Number,Nothing} = nothing, args...; kwargs...)
Renders a Big Number UI element.
Expand Down
8 changes: 4 additions & 4 deletions src/Buttons.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ julia> btn("Connect to server!", color="green", textcolor="black", @click("btnCo
* `dense::Bool` - Dense mode; occupies less space
* `round::Bool` - Makes a circle shaped button
"""
function btn( label::String = "",
function btn( label::Union{String,Symbol} = "",
args...;
content::Union{String,Vector,Function} = "",
kwargs...)
Expand All @@ -82,14 +82,14 @@ function btn( label::String = "",
end

function btn( content::Union{Function,Vector},
label::String = "",
label::Union{String,Symbol} = "",
args...;
kwargs...)
btn(label, args...; content = content, kwargs...)
end

function btn( args...;
label::String = "",
label::Union{String,Symbol} = "",
content::Union{String,Vector,Function} = "",
kwargs...)
btn(label, args...; content = content, kwargs...)
Expand All @@ -103,7 +103,7 @@ mutable struct Btn
content
kwargs

Btn(label::String = "",
Btn(label::Union{String,Symbol} = "",
args...;
content::Union{String,Vector,Function} = "",
kwargs...) = new(fieldname, args, mask, kwargs)
Expand Down
6 changes: 3 additions & 3 deletions src/Checkboxes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export checkbox
register_normal_element("q__checkbox", context = @__MODULE__)

"""
checkbox(label::String = "", fieldname::Union{Symbol,Nothing} = nothing, args...; kwargs...)
checkbox(label::Union{String,Symbol} = "", fieldname::Union{Symbol,Nothing} = nothing, args...; kwargs...)
The `checkbox` component is another basic element for user input. You can use this to supply a way for the user to toggle an option.
Expand Down Expand Up @@ -43,7 +43,7 @@ julia> checkbox(label = "Apples", fieldname = :valone, dense = true, size = "xl"
2. General
* `tabindex::Union{Int, String}` - Tabindex HTML attribute value
3. Label
* `label::String` - Label to display along the component
* `label::Union{String,Symbol}` - Label to display along the component
* `leftlabel::Bool` - Label (if any specified) should be displayed on the left side of the component
4. Model
* `fieldname::Symbol` - Model of the component
Expand All @@ -58,7 +58,7 @@ julia> checkbox(label = "Apples", fieldname = :valone, dense = true, size = "xl"
* `dark::Bool` - Notify the component that the background is a dark color
* `dense::Bool` - Dense mode; occupies less space
"""
function checkbox(label::String = "",
function checkbox(label::Union{String,Symbol} = "",
fieldname::Union{Symbol,Nothing} = nothing,
args...; kwargs...)

Expand Down
2 changes: 1 addition & 1 deletion src/ExpansionItems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ julia> list(bordered=true, class="rounded-borders", [
* `icon::String` - Icon name following Quasar convention; Make sure you have the icon library installed unless you are using 'img:' prefix; If 'none' (String) is used as value then no icon is rendered (but screen real estate will still be used for it) ex. `map` `ion-add` `img:https://cdn.quasar.dev/logo/svg/quasar-logo.svg` `img:path/to/some_image.png`
* `expandicon::String` - Icon name following Quasar convention; Make sure you have the icon library installed unless you are using 'img:' prefix; If 'none' (String) is used as value then no icon is rendered (but screen real estate will still be used for it) ex. `map` `ion-add` `img:https://cdn.quasar.dev/logo/svg/quasar-logo.svg` `img:path/to/some_image.png`
* `expandedicon::String` - Expand icon name (following Quasar convention) for when `expansionitem` is expanded; When used, it also disables the rotation animation of the expand icon; Make sure you have the icon library installed unless you are using 'img:' prefix ex. `map` `ion-add` `img:https://cdn.quasar.dev/logo/svg/quasar-logo.svg` `img:path/to/some_image.png`
* `label::String` - Header label
* `label::Union{String,Symbol}` - Header label
* `labellines::Union{Int, String}` - Apply ellipsis when there's not enough space to render on the specified number of lines; If more than one line specified, then it will only work on webkit browsers because it uses the '-webkit-line-clamp' CSS property! ex. `labellines="2"` `1` `2`
* `caption::String` - Header sub-label (unless using 'header' slot) ex. `Unread message: 5`
* `captionlines::Union{Int, String}` - Apply ellipsis when there's not enough space to render on the specified number of lines; If more than one line specified, then it will only work on webkit browsers because it uses the '-webkit-line-clamp' CSS property! ex. `labellines="2"` `1` `2`
Expand Down
4 changes: 2 additions & 2 deletions src/FormInputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ julia> textfield("What's your name *", :name, name = "name", @iif(:warin), :fill
3. Content
* `errormessage::String` - Validation error message (gets displayed only if 'error' is set to 'true') ex. `Username must have at least 5 characters`
* `noerroricon::Bool` - Hide error icon when there is an error
* `label::String` - A text label that will “float” up above the input field, once the field gets focus ex. `Username`
* `label::Union{String,Symbol}` - A text label that will “float” up above the input field, once the field gets focus ex. `Username`
* `stacklabel::Bool` - Label will be always shown above the field regardless of field content (if any)
* `hint::String` - Helper (hint) text which gets placed below your wrapped form component ex. `Fill in between 3 and 12 characters`
* `hidehint::Bool` - Hide the helper (hint) text when field doesn't have focus
Expand Down Expand Up @@ -123,7 +123,7 @@ function numberfield( label::Union{String, Symbol} = "",
end

"""
textarea(label::String = "", fieldname::Union{Symbol,Nothing} = nothing, args...; content::Union{String,Vector,Function} = "", kwargs...)
textarea(label::Union{String,Symbol} = "", fieldname::Union{Symbol,Nothing} = nothing, args...; content::Union{String,Vector,Function} = "", kwargs...)
"""
function textarea(label::Union{String, Symbol} = "",
fieldname::Union{Symbol,Nothing} = nothing,
Expand Down
2 changes: 1 addition & 1 deletion src/InnerLoaders.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export innerloader

register_normal_element("q__inner__loading", context = @__MODULE__)

function innerloader(label::String = "",
function innerloader(label::Union{String,Symbol} = "",
state::Union{Symbol,Nothing} = nothing,
args...;
kwargs...)
Expand Down
4 changes: 2 additions & 2 deletions src/Selects.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ julia> select(:model, options= :networks, useinput=true, multiple=true, clearabl
* `tablecolspan::Union{Int, String}` - The number of columns in the table (you need this if you use table-layout: fixed) ex. `tablecolspan="12"`
* `errormessage::String` - Validation error message (gets displayed only if 'error' is set to 'true') ex. `Username must have at least 5 characters`
* `noerroricon::Bool` - Hide error icon when there is an error
* `label::String` - A text label that will “float” up above the input field, once the field gets focus ex. `Username`
* `label::Union{String,Symbol}` - A text label that will “float” up above the input field, once the field gets focus ex. `Username`
* `stacklabel::Bool` - Label will be always shown above the field regardless of field content (if any)
* `hint::String` - Helper (hint) text which gets placed below your wrapped form component ex. `Fill in between 3 and 12 characters`
* `hidehint::Bool` - Hide the helper (hint) text when field doesn't have focus
Expand All @@ -77,7 +77,7 @@ julia> select(:model, options= :networks, useinput=true, multiple=true, clearabl
5. Options
* `options::Vector` - Available options that the user can select from. For best performance freeze the list of options ex. `options=[ 'BMW', 'Samsung Phone' ]`
* `optionvalue::String` - Property of option which holds the 'value'; If using a function then for best performance, reference it from your scope and do not define it inline ex. `optionvalue=modelNumber` `optionvalue="(item) => item === null ? null : item.modelNumber"`
* `optionlabel::String` - Property of option which holds the 'label'; If using a function then for best performance, reference it from your scope and do not define it inline ex. `optionlabel=itemName` `optionlabel="(item) => item === null ? null : item.itemName"`
* `optionlabel::Union{String,Symbol}` - Property of option which holds the 'label'; If using a function then for best performance, reference it from your scope and do not define it inline ex. `optionlabel=itemName` `optionlabel="(item) => item === null ? null : item.itemName"`
* `optiondisable::String` - Property of option which tells it's disabled; The value of the property must be a Boolean; If using a function then for best performance, reference it from your scope and do not define it inline ex. `optiondisable=cannotSelect` `optiondisable="(item) => item === null ? null : item.cannotSelect"`
* `optionsdense::Bool` - Dense mode for options list; occupies less space
* `optionsdark::Bool` - Options menu will be colored with a dark color
Expand Down
6 changes: 3 additions & 3 deletions src/Toggles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export toggle
register_normal_element("q__toggle", context = @__MODULE__)

"""
toggle(label::String, fieldname::Union{Symbol,Nothing}, args...; kwargs...)
toggle(label::Union{String,Symbol}, fieldname::Union{Symbol,Nothing}, args...; kwargs...)
The `toggle` component is another basic element for user input. You can use this for turning settings, features or true/false inputs on and off.
Expand Down Expand Up @@ -53,7 +53,7 @@ julia> toggle("Red", color="red", :selection, val="red")
* `uncheckedicon::String` - The icon to be used when the toggle is off ex. `visibility-off`
* `indeterminateicon::String` - The icon to be used when the model is indeterminate ex. `help`
5. Label
* `label::String` - Label to display along the component ex. `I agree to terms and conditions`
* `label::Union{String,Symbol}` - Label to display along the component ex. `I agree to terms and conditions`
* `leftlabel::Bool` - Label (if any specified) should be displayed on the left side of the component
6. Model
* `val::Union{Bool, Int, Float64, String, Vector}` - Works when model ('value') is Array. It tells the component which value should add/remove when ticked/unticked ex. `car`
Expand All @@ -68,7 +68,7 @@ julia> toggle("Red", color="red", :selection, val="red")
* `dense::Bool` - Dense mode; occupies less space
* `iconcolor` - Override default icon color (for truthy state only); Color name for component from the [Color Palette](https://quasar.dev/style/color-palette) ex. `primary` `teal-10`
"""
function toggle(label::String = "",
function toggle(label::Union{String,Symbol} = "",
fieldname::Union{Symbol,Nothing} = nothing,
args...;
kwargs...)
Expand Down
2 changes: 1 addition & 1 deletion src/Uploaders.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ julia> uploader(label="Upload Image", autoupload=true, multiple=true, method="PO
* `autoupload::Bool` - Upload files immediately when added
* `hideuploadbtn::Bool` - Don't show the upload button
2. Content
* `label::String` - Label for the uploader ex. `Upload photo here`
* `label::Union{String,Symbol}` - Label for the uploader ex. `Upload photo here`
* `nothumbnails::Bool` - Don't display thumbnails for image files
3. State
* `disable::Bool` - Put component in disabled mode
Expand Down

0 comments on commit 5f29310

Please sign in to comment.