Skip to content

Commit

Permalink
Spinner, fixes, Genie v3
Browse files Browse the repository at this point in the history
  • Loading branch information
essenciary committed Aug 15, 2021
1 parent bb956c3 commit b08fbbb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
6 changes: 3 additions & 3 deletions 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.7"
version = "0.8"

[deps]
Stipple = "4acbeb90-81a0-11ea-1966-bdaff8155998"
Expand All @@ -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]
Expand Down
4 changes: 1 addition & 3 deletions src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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

Expand Down
10 changes: 4 additions & 6 deletions src/Spinner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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} = "",
Expand Down
6 changes: 3 additions & 3 deletions src/StippleUI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,17 @@ 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="")
quote
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
Expand Down

2 comments on commit b08fbbb

@essenciary
Copy link
Member Author

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/42922

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.8.0 -m "<description of version>" b08fbbb1789db8f68f6efb479f98d4bfea208c6d
git push origin v0.8.0

Please sign in to comment.