percentage-based splitting.
This commit is contained in:
@@ -156,6 +156,23 @@
|
||||
|
||||
(into [dom keys] (with-keys rest))))
|
||||
|
||||
(defmethod do-bind "number" [dom {:keys [field precision event subscription class spec] :as keys :or {precision 2}} & rest]
|
||||
(let [field (if (keyword? field) [field] field)
|
||||
event (if (keyword? event) [event] event)
|
||||
keys (assoc keys
|
||||
:on-change (fn [e]
|
||||
(.preventDefault e)
|
||||
(re-frame/dispatch (-> event
|
||||
(conj field)
|
||||
(conj (js/parseFloat (.. e -target -value))))))
|
||||
:value (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)]
|
||||
(into [dom keys] (with-keys rest))))
|
||||
|
||||
(defmethod do-bind :default [dom {:keys [field event subscription class spec] :as keys} & rest]
|
||||
(let [field (if (keyword? field) [field] field)
|
||||
event (if (keyword? event) [event] event)
|
||||
|
||||
Reference in New Issue
Block a user