Skip to content

Commit

Permalink
allow for Symbol and Nothing in labels
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Jul 28, 2024
1 parent b7bbba2 commit 7ae42fd
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/Buttons.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ julia> btn("Connect to server!", color="green", textcolor="black", @click("btnCo
* `percentage::Union{Int, Float64}` - Percentage (0.0 < x < 100.0); To be used along 'loading' prop; Display a progress bar on the background ex. `23`
* `darkpercentage::Bool` - Progress bar on the background should have dark color; To be used along with 'percentage' and 'loading' props
2. Content
* `label::Union{String, Int}` - The text that will be shown on the button ex. `Button Label`
* `label::Union{String, Symbol, Nothing}` - The text that will be shown on the button ex. `Button Label`
* `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`
* `iconright::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`
* `nocaps::Bool` - Avoid turning label text into caps (which happens by default)
Expand Down
16 changes: 8 additions & 8 deletions src/FormInputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ julia> textfield("What's your name *", :name, name = "name", @if(:warin), :fille
* `debounce::Union{String, Int}` - Debounce amount (in milliseconds) when updating model ex. `0` `500`
* `maxlength::Union{String, Int}` - Specify a max length of model ex. `12`
"""
function textfield( label::Union{String,Symbol} = "",
function textfield( label::Union{String,Symbol,Nothing} = nothing,
fieldname::Union{Symbol,Nothing} = nothing,
args...;
content::Union{String,Vector,Function} = "",
Expand All @@ -109,7 +109,7 @@ textfield(content::Union{Vector,Function},
"""
numberfield( label::Union{String, Symbol} = "", fieldname::Union{Symbol,Nothing} = nothing, args...; content::Union{String,Vector,Function} = "", kwargs...)
"""
function numberfield( label::Union{String,Symbol} = "",
function numberfield( label::Union{String,Symbol,Nothing} = nothing,
fieldname::Union{Symbol,Nothing} = nothing,
args...;
content::Union{String,Vector,Function} = "",
Expand All @@ -123,9 +123,9 @@ function numberfield( label::Union{String,Symbol} = "",
end

"""
textarea(label::Union{String,Symbol} = "", fieldname::Union{Symbol,Nothing} = nothing, args...; content::Union{String,Vector,Function} = "", kwargs...)
textarea(label::Union{String,Symbol,Nothing} = nothing, fieldname::Union{Symbol,Nothing} = nothing, args...; content::Union{String,Vector,Function} = "", kwargs...)
"""
function textarea(label::Union{String,Symbol} = "",
function textarea(label::Union{String,Symbol,Nothing} = nothing,
fieldname::Union{Symbol,Nothing} = nothing,
args...;
content::Union{String,Vector,Function} = "",
Expand All @@ -134,9 +134,9 @@ function textarea(label::Union{String,Symbol} = "",
end

"""
filefield( label::Union{String, Symbol} = "", fieldname::Union{Symbol,Nothing} = nothing, args...; kwargs...)
filefield( label::Union{String, Symbol, Nothing} = nothing, fieldname::Union{Symbol,Nothing} = nothing, args...; kwargs...)
"""
function filefield( label::Union{String,Symbol} = "",
function filefield( label::Union{String,Symbol,Nothing} = nothing,
fieldname::Union{Symbol,Nothing} = nothing,
args...;
kwargs...)
Expand Down Expand Up @@ -165,7 +165,7 @@ In addition, keyword arguments can be passed to each of these components individ
datefield("Start date", :start_date, datepicker_props = Dict(:todaybtn => true, :nounset => true), textfield_props = Dict(:bgcolor => "green-1"))
```
"""
function datefield( label::Union{String,Symbol} = "",
function datefield( label::Union{String,Symbol,Nothing} = nothing,
fieldname::Union{Symbol,Nothing} = nothing;
icon_name::Union{Symbol,String,Nothing} = "event",
icon_class::Union{Symbol,String,Nothing} = "cursor-pointer",
Expand Down Expand Up @@ -198,7 +198,7 @@ In addition, keyword arguments can be passed to each of these components individ
`icon_props`, `popup_proxy_props` and `timepicker_props` keyword arguments.
"""
function timefield( label::Union{String,Symbol} = "",
function timefield( label::Union{String,Symbol,Nothing} = nothing,
fieldname::Union{Symbol,Nothing} = nothing;
icon_name::Union{Symbol,String,Nothing} = "alarm",
icon_class::Union{Symbol,String,Nothing} = "cursor-pointer",
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::Union{String,Symbol} = "",
function innerloader(label::Union{String,Symbol,Nothing} = nothing,
state::Union{Symbol,Nothing} = nothing,
args...;
kwargs...)
Expand Down
6 changes: 3 additions & 3 deletions src/Radios.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export radio
register_normal_element("q__radio", context = @__MODULE__)

"""
radio(label::AbstractString = "", fieldname::Union{Symbol,Nothing} = nothing, args...; kwargs...)
radio(label::Union{String, Symbol, Nothing} = nothing, fieldname::Union{Symbol,Nothing} = nothing, args...; kwargs...)
The `radio` component is another basic element for user input. You can use this to supply a way for the user to pick an option from multiple choices.
Expand Down Expand Up @@ -54,8 +54,8 @@ julia> radio("Polygon", :shape, val="polygon")
* `dark::Bool` - Notify the component that the background is a dark color
* `dense::Bool` - Dense mode; occupies less space
"""
function radio( label::AbstractString = "",
fieldname::Union{Symbol,Nothing} = nothing,
function radio( label::Union{String, Symbol, Nothing} = nothing,
fieldname::Union{Symbol, Nothing} = nothing,
args...;
val = nothing,
kwargs...)
Expand Down
2 changes: 1 addition & 1 deletion 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::Union{String,Symbol}` - A text label that will “float” up above the input field, once the field gets focus ex. `Username`
* `label::Union{String,Symbol,Nothing}` - 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
4 changes: 2 additions & 2 deletions src/Toggles.jl
Original file line number Diff line number Diff line change
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::Union{String,Symbol}` - Label to display along the component ex. `I agree to terms and conditions`
* `label::Union{String,Symbol,Nothing}` - 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::Union{String,Symbol} = "",
function toggle(label::Union{String,Symbol,Nothing} = nothing,
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 @@ -113,7 +113,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::Union{String,Symbol}` - Label for the uploader ex. `Upload photo here`
* `label::Union{String,Symbol,Nothing}` - 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 7ae42fd

Please sign in to comment.