Skip to content

Commit

Permalink
API improvements, adds ExpansionItem
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Salceanu committed Dec 17, 2021
1 parent f625f62 commit cacfc9d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 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.13.0"
version = "0.14.0"

[deps]
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Expand Down
6 changes: 6 additions & 0 deletions src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ const ATTRIBUTES_MAPPINGS = Dict{String,String}(
"defaultyearmonth" => "default-year-month",
"defaultview" => "default-view",
"definitions" => ":definitions",
"displayvalue" => "display-value",
"dropnative" => "@drop.native",
"dragonlyrange" => "drag-only-range",
"dragrange" => "drag-range",
"emitimmd" => "emit-immediately",
"errormessage" => "error-message",
"eventcolor" => "event-color",
"expandseparator" => "expand-separator",
"falsevalue" => "false-value",
"fieldname" => "v-model",
"fillmask" => "fill-mask",
Expand Down Expand Up @@ -53,11 +55,13 @@ const ATTRIBUTES_MAPPINGS = Dict{String,String}(
"lazyrules" => "lazy-rules",
"leftlabel" => "left-label",
"manualfocus" => "manual-focus",
"maxvalues" => "max-values",
"minheight" => "min-height",
"maxheight" => "max-height",
"multiline" => "multi-line",
"navmaxyearmonth" => "navigation-max-year-month",
"navminyearmonth" => "navigation-min-year-month",
"newvaluemode" => "new-value-mode",
"nobackdrop" => "no-backdrop-dismiss",
"nocaps" => "no-caps",
"noerrorfocus" => "no-error-focus",
Expand Down Expand Up @@ -92,6 +96,8 @@ const ATTRIBUTES_MAPPINGS = Dict{String,String}(
"truevalue" => "true-value",
"uncheckedicon" => "unchecked-icon",
"unmaskedvalue" => "unmasked-value",
"usechips" => "use-chips",
"useinput" => "use-input",
"vripple" => "v-ripple",
"yearsinmonthview" => "years-in-month-view"
);
Expand Down
19 changes: 19 additions & 0 deletions src/ExpansionItems.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module ExpansionItems

using Genie, Stipple, StippleUI, StippleUI.API
import Genie.Renderer.Html: HTMLString, normal_element, register_normal_element

export expansionitem

register_normal_element("q__expansion__item", context = @__MODULE__)

function expansionitem(args...;
wrap::Function = StippleUI.DEFAULT_WRAPPER,
kwargs...)

wrap() do
q__expansion__item(args...; attributes([kwargs...], StippleUI.API.ATTRIBUTES_MAPPINGS)...)
end
end

end
6 changes: 4 additions & 2 deletions src/StippleUI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const assets_config = Genie.Assets.AssetsConfig(package = "StippleUI.jl")

#===#

function theme(; twbpatch::Bool = true) :: String
function theme(; twbpatch::Bool = false) :: String
if ! Genie.Assets.external_assets(assets_config)
Genie.Router.route(Genie.Assets.asset_path(assets_config, :css, file="quasar.min")) do
Genie.Renderer.WebRenderable(
Expand All @@ -31,7 +31,7 @@ function theme(; twbpatch::Bool = true) :: String

string(
Stipple.Elements.stylesheet(Genie.Assets.asset_path(assets_config, :css, file="quasar.min")),
Stipple.Elements.stylesheet(Genie.Assets.asset_path(assets_config, :css, file="bootstrap-patch"))
(twbpatch ? Stipple.Elements.stylesheet(Genie.Assets.asset_path(assets_config, :css, file="bootstrap-patch")) : "")
)
end

Expand Down Expand Up @@ -66,6 +66,7 @@ include("DatePickers.jl")
include("Dialogs.jl")
include("Drawers.jl")
include("Editors.jl")
include("ExpansionItems.jl")
include("Forms.jl")
include("FormInputs.jl")
include("Headings.jl")
Expand Down Expand Up @@ -108,6 +109,7 @@ export quasar, quasar_pure, vue, vue_pure, xelem, xelem_pure, @click, csscolors
@reexport using .Dialogs
@reexport using .Drawers
@reexport using .Editors
@reexport using .ExpansionItems
@reexport using .Forms
@reexport using .FormInputs
@reexport using .Headings
Expand Down

0 comments on commit cacfc9d

Please sign in to comment.