balance sheet fast

This commit is contained in:
2024-10-22 23:06:39 -07:00
parent 12baf70d5c
commit 8ab9267e45
2 changed files with 22 additions and 19 deletions

View File

@@ -224,7 +224,7 @@
(let [errors (seq (fc/field-errors))] (let [errors (seq (fc/field-errors))]
(cond errors (cond errors
[:div [:div
{} { "x-tooltip" "{content: ()=>$refs.tt.innerHTML , allowHTML: true}"}
[:div.w-8.h-8.rounded-full.p-2.flex.items-start {:class [:div.w-8.h-8.rounded-full.p-2.flex.items-start {:class
(if (seq (filter (if (seq (filter
(fn [[_ status]] (fn [[_ status]]
@@ -234,9 +234,10 @@
"bg-red-50 text-red-300" "bg-red-50 text-red-300"
"bg-yellow-100 text-yellow-600")} "bg-yellow-100 text-yellow-600")}
svg/alert] svg/alert]
[:ul [:template {:x-ref "tt"}
(for [[m] errors] [:ul
[:li m])]] (for [[m] errors]
[:li m])]]]
:else :else
nil))]))))} nil))]))))}

View File

@@ -319,7 +319,7 @@
(when (:coerce? (m/properties schema)) (when (:coerce? (m/properties schema))
(fn [data] (fn [data]
(cond (cond
(vector? data) (vector? data)
data data
(sequential? data) (sequential? data)
data data
@@ -363,20 +363,22 @@
(mt2/transformer (mt2/transformer
{:decoders {:map {:compile (fn [x g] {:decoders {:map {:compile (fn [x g]
(fn [value] (fn [value]
(let [specified-keys (set (keys value))] (if (map? value)
(reduce (let [ specified-keys (set (keys value))]
(fn [value [k params]] (reduce
(cond (and (:unspecified/fn params) (fn [value [k params]]
(not (get specified-keys k))) (cond (and (:unspecified/fn params)
(assoc value k ((:unspecified/fn params))) (not (get specified-keys k)))
(and (:unspecified/value params) (assoc value k ((:unspecified/fn params)))
(not (get specified-keys k))) (and (:unspecified/value params)
(assoc value k (:unspecified/value params)) (not (get specified-keys k)))
:else (assoc value k (:unspecified/value params))
value :else
)) value
value ))
(m/children x)))))}}})) value
(m/children x)))
value)))}}}))
(def main-transformer (def main-transformer
(mt2/transformer (mt2/transformer