outstanding balance and addresses.

This commit is contained in:
Bryce Covert
2018-05-17 19:37:50 -07:00
parent 7b7275f7a4
commit e055a1e120
19 changed files with 351 additions and 98 deletions

View File

@@ -38,32 +38,35 @@
type))
(defmethod do-bind "select" [dom {:keys [field subscription event class value spec] :as keys} & rest]
(let [keys (assoc keys
:on-change (dispatch-value-change [event [field]])
(let [field (if (keyword? field) [field] field)
keys (assoc keys
:on-change (dispatch-value-change [event field])
:class (str class
(when (and spec (not (s/valid? spec (field subscription))))
(when (and spec (not (s/valid? spec (get-in subscription field))))
" is-danger")))
keys (dissoc keys :field :subscription :event :spec)]
(vec (concat [dom keys] rest))))
(defmethod do-bind "radio" [dom {:keys [field subscription event class value spec] :as keys} & rest]
(let [keys (assoc keys
:on-change (dispatch-value-change [event [field]])
:checked (= (field subscription) value)
(let [field (if (keyword? field) [field] field)
keys (assoc keys
:on-change (dispatch-value-change [event field])
:checked (= (get-in subscription field) value)
:class (str class
(when (and spec (not (s/valid? spec (field subscription))))
(when (and spec (not (s/valid? spec (get-in subscription field ))))
" is-danger")))
keys (dissoc keys :field :subscription :event :spec)]
(vec (concat [dom keys] rest))))
(defmethod do-bind :default [dom {:keys [field event subscription class spec] :as keys} & rest]
(let [keys (assoc keys
:on-change (dispatch-value-change [event [field]])
:value (field subscription)
(let [field (if (keyword? field) [field] field)
keys (assoc keys
:on-change (dispatch-value-change [event field])
:value (get-in subscription field)
:class (str class
(when (and spec (not (s/valid? spec (field subscription))))
(when (and spec (not (s/valid? spec (get-in subscription field))))
" is-danger")))
keys (dissoc keys :field :subscription :event :spec)]
(vec (concat [dom keys] rest))))