diff --git a/Project.toml b/Project.toml index 56a3fdf1..8cd13944 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "StippleUI" uuid = "a3c5d34a-b254-4859-a8fa-b86abb7e84a3" authors = ["Adrian Salceanu "] -version = "0.7" +version = "0.8" [deps] Stipple = "4acbeb90-81a0-11ea-1966-bdaff8155998" @@ -10,8 +10,8 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" [compat] DataFrames = "0.20, 0.21, 0.22, 1.0" -Genie = "2" -Stipple = "0.13" +Genie = "2, 3" +Stipple = "0.14" julia = "1.3" [extras] diff --git a/src/API.jl b/src/API.jl index ec10687b..a2abe014 100644 --- a/src/API.jl +++ b/src/API.jl @@ -11,11 +11,9 @@ const ATTRIBUTES_MAPPINGS = Dict{String,String}( "bottomslots" => "bottom-slots", "checkedicon" => "checked-icon", "clearicon" => "clear-icon", - #"click" => "@click", "contentclass" => "content-class", "contentstyle" => "content-style", "darkpercentage" => "dark-percentage", - #"dashedwidth" =>":width", "definitions" => ":definitions", "dropnative" => "@drop.native", "dragonlyrange" => "drag-only-range", @@ -101,7 +99,7 @@ function attributes(kwargs::Vector{X}, k = mappings[string(k)] end - attr_key = string((isa(v, Symbol) && ! startswith(string(k), ":") && + attr_key = string((isa(v, Symbol) && ! startswith(string(k), ":") && ! ( startswith(string(k), "v-") || startswith(string(k), "v" * Genie.config.html_parser_char_dash) ) ? ":" : ""), "$k") |> Symbol attr_val = isa(v, Symbol) && ! startswith(string(k), ":") ? Stipple.julia_to_vue(v) : v diff --git a/src/Spinner.jl b/src/Spinner.jl index efb51197..8f6dd483 100644 --- a/src/Spinner.jl +++ b/src/Spinner.jl @@ -5,13 +5,11 @@ import Genie.Renderer.Html: HTMLString, normal_element export spinner -function __init__() - Genie.Renderer.Html.register_normal_element("q__spinner", context = @__MODULE__) +Genie.Renderer.Html.register_normal_element("q__spinner", context = @__MODULE__) - for spinner in ["audio", "ball", "bars", "box", "clock", "comment", "cube", "dots", "facebook", "gears", "grid", - "hearts", "hourglass", "infinity", "ios", "orbit", "oval", "pie", "puff", "radio", "rings", "tail"] - Genie.Renderer.Html.register_normal_element("q__spinner__$spinner", context = @__MODULE__) - end +for spinner in ["audio", "ball", "bars", "box", "clock", "comment", "cube", "dots", "facebook", "gears", "grid", + "hearts", "hourglass", "infinity", "ios", "orbit", "oval", "pie", "puff", "radio", "rings", "tail"] + Genie.Renderer.Html.register_normal_element("q__spinner__$spinner", context = @__MODULE__) end function spinner(spinner_type::Union{String,Symbol} = "", diff --git a/src/StippleUI.jl b/src/StippleUI.jl index b6c09333..fff74e87 100644 --- a/src/StippleUI.jl +++ b/src/StippleUI.jl @@ -109,7 +109,7 @@ If a symbol argument is supplied, `@click` sets this value to true. Modifers can be appended: ``` @click(:me, :native) -# "@click.native='me = true'" +# "v-on:click.native='me = true'" ``` """ macro click(expr, mode="") @@ -117,9 +117,9 @@ macro click(expr, mode="") x = $(esc(expr)) m = $(esc(mode)) if x isa Symbol - """@click$(m == "" ? "" : ".$m")='$x = true'""" + """v-on:click$(m == "" ? "" : ".$m")='$x = true'""" else - "@click='$(replace(x, "'" => raw"\'"))'" + "v-on:click='$(replace(x, "'" => raw"\'"))'" end end end