Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New versions #5

Open
wants to merge 3 commits into
base: transitions
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 66 additions & 6 deletions lib/src/hoplon/ui/attrs.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,28 @@
(-lookup [this key not-found]
(case key :r r :g g :b b :a a not-found))
IFn
(-invoke [this & args]
(apply assoc this args))
(-invoke [this k1 v1]
(assoc this k1 v1))
(-invoke [this k1 v1 k2 v2]
(assoc this k1 v1 k2 v2))
(-invoke [this k1 v1 k2 v2 k3 v3]
(assoc this k1 v1 k2 v2 k3 v3))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8 k9 v9]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8 k9 v9))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8 k9 v9 k10 v10]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8 k9 v9 k10 v10))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8 k9 v9 k10 v10 rest]
(apply assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8 k9 v9 k10 v10 rest))
IAttr
(-dom-attribute [this]
(.toString this)))
Expand All @@ -211,8 +231,28 @@
(-lookup [this key not-found]
(case key :h h :s s :l l :a a not-found))
IFn
(-invoke [this & args]
(apply assoc this args))
(-invoke [this k1 v1]
(assoc this k1 v1))
(-invoke [this k1 v1 k2 v2]
(assoc this k1 v1 k2 v2))
(-invoke [this k1 v1 k2 v2 k3 v3]
(assoc this k1 v1 k2 v2 k3 v3))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8 k9 v9]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8 k9 v9))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8 k9 v9 k10 v10]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8 k9 v9 k10 v10))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8 k9 v9 k10 v10 rest]
(apply assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8 k9 v9 k10 v10 rest))
IAttr
(-dom-attribute [this]
(.toString this)))
Expand Down Expand Up @@ -251,8 +291,28 @@
(let [v #(if (= key %1) val %2)]
(Shadow. (v :x x) (v :y y) (v :color color) (v :blur blur) (v :spread spread) (v :inset inset))))
IFn
(-invoke [this & args]
(apply assoc this args))
(-invoke [this k1 v1]
(assoc this k1 v1))
(-invoke [this k1 v1 k2 v2]
(assoc this k1 v1 k2 v2))
(-invoke [this k1 v1 k2 v2 k3 v3]
(assoc this k1 v1 k2 v2 k3 v3))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8 k9 v9]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8 k9 v9))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8 k9 v9 k10 v10]
(assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8 k9 v9 k10 v10))
(-invoke [this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8 k9 v9 k10 v10 rest]
(apply assoc this k1 v1 k2 v2 k3 v3 k4 v4 k5 v5 k6 v6 k7 v7 k8 v8 k9 v9 k10 v10 rest))
IAttr
(-dom-attribute [this]
(.toString this)))
Expand Down
6 changes: 3 additions & 3 deletions lib/src/hoplon/ui/elems.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
(-out [_] o)
(-mid [_] m)
(-in [_] i)
hoplon.core/INode
(node [e] o)
hoplon.core/ICustomElement
hoplon.core/IHoplonNode
(-node [e] o)
hoplon.core/IHoplonElement
(-append-child! [_ new-elem]
(hoplon.core/append-child! i new-elem))
(-insert-before! [_ new-elem old-elem]
Expand Down
4 changes: 3 additions & 1 deletion lib/src/hoplon/ui/utils.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
(:require
[clojure.string :refer [join lower-case split]]
[hoplon.core :refer [when-dom add-initfn! with-dom]]
[javelin.core :refer [with-let]]))
[javelin.core :refer [with-let]])
(:require-macros
[hoplon.ui.utils]))

;;; utils ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Expand Down