improved two major forms.

This commit is contained in:
2022-07-19 15:10:33 -07:00
parent 483e9ad311
commit 0baab4eaf0
14 changed files with 431 additions and 355 deletions

View File

@@ -157,13 +157,13 @@
(for [child children]
^{:key (:key (meta child))}
[transition
{:timeout 300
{:timeout 200
:exit true
:in true #_ (= current-stack- (:key (meta child)))}
(clj->js (fn [state]
(r/as-element
[:div {:style {
:transition "opacity 300ms ease-in-out"
:transition "opacity 150ms ease-in-out"
:opacity (cond
(= "entered" state)
1.0
@@ -264,17 +264,19 @@
[:span.icon [:span.icon-remove]]]])
]])]))))
(defmethod do-bind "select" [dom {:keys [field allow-nil? subscription event class spec] :as keys} & rest]
(let [field (if (keyword? field) [field] field)
event (if (keyword? event) [event] event)
keys (assoc keys
:on-change (dispatch-value-change (conj event field))
keys (assoc keys
:on-change (dispatch-value-change (conj event field))
:value (or (get-in subscription field) "")
:class (str class
(when (and spec (not (s/valid? spec (get-in subscription field))))
" is-danger")))
keys (dissoc keys :field :subscription :event :spec)
:value (or (get-in subscription field) "")
:class (str class
(when (and spec (not (s/valid? spec (get-in subscription field))))
" is-danger")))
keys (dissoc keys :field :subscription :event :spec)
options (if allow-nil?
(with-keys (conj rest [:option {:value nil}]))
(with-keys rest))]