Skip to content

Commit

Permalink
API improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Salceanu committed Jan 14, 2022
1 parent 35c3e69 commit 15a6740
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "StippleUI"
uuid = "a3c5d34a-b254-4859-a8fa-b86abb7e84a3"
authors = ["Adrian Salceanu <[email protected]>"]
version = "0.14.3"
version = "0.14.4"

[deps]
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Expand Down
4 changes: 2 additions & 2 deletions src/Badges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ outline::Bool = true
color::String = "blue"
textcolor::String = "teal-10"
"""
function badge( fieldname::Union{Symbol,Nothing} = nothing,
function badge( fieldname::Union{Symbol,String,Nothing} = nothing,
args...;
wrap::Function = StippleUI.DEFAULT_WRAPPER,
kwargs...) where {T<:Stipple.ReactiveModel}
wrap() do
q__badge(args...;
attributes(
[:fieldname => fieldname, kwargs...],
[(isa(fieldname, String) ? :label : :fieldname) => fieldname, kwargs...],
StippleUI.API.ATTRIBUTES_MAPPINGS
)...)
end
Expand Down
15 changes: 13 additions & 2 deletions src/Buttons.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ module Buttons
using Genie, Stipple, StippleUI, StippleUI.API
import Genie.Renderer.Html: HTMLString, normal_element, register_normal_element

export btn, btngroup, Btn
export btn, btngroup, btndropdown, Btn

register_normal_element("q__btn", context = @__MODULE__)
register_normal_element("q__btn__group", context = @__MODULE__)
register_normal_element("q__btn__dropdown", context = @__MODULE__)

function btn( label::String = "",
args...;
Expand Down Expand Up @@ -59,8 +60,18 @@ function btngroup(args...;
wrap::Function = StippleUI.DEFAULT_WRAPPER,
kwargs...)
wrap() do
Genie.Renderer.Html.q__btn__group(args...; kwargs...)
q__btn__group(args...; kwargs...)
end
end


function btndropdown(args...;
wrap::Function = StippleUI.DEFAULT_WRAPPER,
kwargs...)
wrap() do
q__btn__dropdown(args...; kwargs...)
end
end


end
2 changes: 1 addition & 1 deletion src/Dashboards.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function dashboard(elemid::Union{AbstractString,Symbol}, content::Union{String,V
end

function dashboard(model::M, args...; kwargs...) where {M<:ReactiveModel}
dashboard(vm(model), args...; channel = model.channel__, kwargs...)
dashboard(vm(model), args...; channel = getchannel(model), kwargs...)
end

end

2 comments on commit 15a6740

@essenciary
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/52431

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.14.4 -m "<description of version>" 15a6740f19577c2705ac913c3cef940543de77e7
git push origin v0.14.4

Please sign in to comment.