From cacfc9d5ffde6117f7847408be06f883e5465746 Mon Sep 17 00:00:00 2001 From: Adrian Salceanu Date: Fri, 17 Dec 2021 14:52:37 +0100 Subject: [PATCH] API improvements, adds ExpansionItem --- Project.toml | 2 +- src/API.jl | 6 ++++++ src/ExpansionItems.jl | 19 +++++++++++++++++++ src/StippleUI.jl | 6 ++++-- 4 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 src/ExpansionItems.jl diff --git a/Project.toml b/Project.toml index eddaa3a6..26993a96 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "StippleUI" uuid = "a3c5d34a-b254-4859-a8fa-b86abb7e84a3" authors = ["Adrian Salceanu "] -version = "0.13.0" +version = "0.14.0" [deps] Colors = "5ae59095-9a9b-59fe-a467-6f913c188581" diff --git a/src/API.jl b/src/API.jl index fc825ed4..1a2883c2 100644 --- a/src/API.jl +++ b/src/API.jl @@ -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", @@ -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", @@ -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" ); diff --git a/src/ExpansionItems.jl b/src/ExpansionItems.jl new file mode 100644 index 00000000..28c6ffea --- /dev/null +++ b/src/ExpansionItems.jl @@ -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 diff --git a/src/StippleUI.jl b/src/StippleUI.jl index 5d14a118..8bb2133e 100644 --- a/src/StippleUI.jl +++ b/src/StippleUI.jl @@ -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( @@ -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 @@ -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") @@ -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