addressed all compilation errors.

This commit is contained in:
2021-05-27 22:04:30 -07:00
parent 766715cdde
commit bcdc181f86
36 changed files with 2497 additions and 448 deletions

View File

@@ -6,13 +6,13 @@
[clojure.spec.alpha :as s]
[cljs-time.coerce :as c]
[cljs-time.core :as time]
[auto-ap.events :as events]
[auto-ap.subs :as subs]
[cljs-time.format :as format]
[goog.i18n.NumberFormat.Format]
[cljs-time.core :as t]
[clojure.string :as str]
[goog.crypt.base64 :as base64]
[cljs.tools.reader.edn :as edn]
[reagent.core :as r])
(:import
(goog.i18n NumberFormat)
@@ -100,6 +100,9 @@
e
(date->str (time/from-default-time-zone (c/from-date e)) standard))))))
;; TODO inline on-changes causes each field to be rerendered each time. When we fix this
;; let's make sure that we find away not to trigger a re-render for every component any time any form field
;; changes
(defmulti do-bind (fn [a {:keys [type] :as x}]
type))
@@ -277,6 +280,21 @@
keys (dissoc keys :field :subscription :event :spec)]
(into [dom keys] (with-keys rest))))
(defmethod do-bind "typeahead-v3" [dom {:keys [field event text-event subscription class spec match->text] :as keys} & rest]
(let [field (if (keyword? field) [field] field)
event (if (keyword? event) [event] event)
keys (assoc keys
:on-change (fn [selected]
(re-frame/dispatch (conj (conj event field) selected))
#_(when text-field
(re-frame/dispatch (conj (conj (or text-event event) text-field) text-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 "date" [dom {:keys [field event subscription class spec] :as keys} & rest]
(let [field (if (keyword? field) [field] field)
event (if (keyword? event) [event] event)
@@ -448,7 +466,7 @@
(defn query-params []
(reduce-kv
(fn [result k v]
(assoc result (keyword k) (cljs.tools.reader.edn/read-string v)))
(assoc result (keyword k) (edn/read-string v)))
{}
(:query (cemerick.url/url (.-location js/window)))))