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

@@ -130,7 +130,6 @@
(re-frame/enrich
(fn [db event]
(loading db form))))
(defn triggers-stop [form]
(re-frame/enrich
(fn [db event]

View File

@@ -2,6 +2,7 @@
(:require [bidi.bidi :as bidi]
[pushy.core :as pushy]
[auto-ap.routes :as routes]
[auto-ap.views.utils :as u]
[cemerick.url :refer [url]]
[re-frame.core :as re-frame]))
@@ -11,7 +12,7 @@
(defn- dispatch-route [matched-route]
(println "Matched route" matched-route)
(re-frame/dispatch [:auto-ap.events/set-active-page (:handler matched-route) (auto-ap.views.utils/query-params)]))
(re-frame/dispatch [:auto-ap.events/set-active-page (:handler matched-route) (u/query-params)]))
(def history (pushy/pushy dispatch-route parse-url))

View File

@@ -2,7 +2,8 @@
(:require [re-frame.core :as re-frame]
[auto-ap.utils :refer [by]]
[clojure.string :as str]
[goog.crypt.base64 :as base64]))
[goog.crypt.base64 :as base64]
[memsearch.core :as ms]))
(re-frame/reg-sub
::client
@@ -60,6 +61,17 @@
[]
accounts)))
(re-frame/reg-sub
::accounts-index
:<- [::accounts]
(fn [accounts]
(ms/text-index (map (fn [v] {:id (:id v)
:content (str (:numeric-code v) " " (:name v))})
accounts)
{:maintain-actual? true})))
(re-frame/reg-sub
::account
@@ -201,6 +213,15 @@
(filter #(not (:hidden %)) all-vendors))))
(re-frame/reg-sub
::searchable-vendors-index
:<- [::searchable-vendors]
(fn [searchable-vendors]
(ms/text-index (map (fn [v] {:id (:id v)
:content (:name v)})
searchable-vendors)
{:maintain-actual? true})))
(re-frame/reg-sub
::all-vendors
(fn [db]

View File

@@ -2,7 +2,6 @@
(:require
[clojure.spec.alpha :as s]
[auto-ap.entities.invoice :as invoice]
[auto-ap.views.components.typeahead :refer [typeahead]]
[auto-ap.views.utils :refer [bind-field ->$]]
[auto-ap.subs :as subs]
[re-frame.core :as re-frame]))

View File

@@ -2,7 +2,6 @@
(:require
[clojure.spec.alpha :as s]
[auto-ap.entities.invoice :as invoice]
[auto-ap.views.components.typeahead :refer [typeahead]]
[auto-ap.views.utils :refer [bind-field date-picker date->str local-now standard]]
[cljs-time.core :as t]
[re-frame.core :as re-frame]))

View File

@@ -4,7 +4,7 @@
[auto-ap.subs :as subs]
[auto-ap.utils :refer [by]]
[auto-ap.views.components.modal :as modal]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.pages.invoices.common :refer [invoice-read]]
[auto-ap.views.utils :refer [dispatch-event with-user]]
[clojure.string :as str]
@@ -124,10 +124,10 @@
[:tr
[:td.expandable [:div.control
(raw-field
[typeahead-entity {:matches chooseable-expense-accounts
:type "typeahead-entity"
:match->text (fn [x] (str (:numeric-code x) " - " (:name x)))
:field [:expense-accounts id :account]}])]]
[typeahead-v3 {:entities chooseable-expense-accounts
:type "typeahead-v3"
:entity->text (fn [x] (str (:numeric-code x) " - " (:name x)))
:field [:expense-accounts id :account]}])]]
(when multi-location?
[:td

View File

@@ -1,7 +1,7 @@
(ns auto-ap.views.components.expense-accounts-field
(:require [auto-ap.forms :as forms]
[auto-ap.subs :as subs]
[auto-ap.views.components.typeahead :refer [typeahead typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.components.money-field :refer [money-field]]
[auto-ap.views.utils :refer [bind-field dispatch-event ->$]]
[goog.string :as gstring]
@@ -162,14 +162,14 @@
[:div.control.is-fullwidth
[bind-field
^{:key (:id client)}
[typeahead-entity {:matches chooseable-expense-accounts
:match->text (fn [x ]
(str (:numeric-code x) " - " (:name x)))
:disabled disabled
:type "typeahead-entity"
:field [index :account]
:event [::expense-account-changed event expense-accounts max-value]
:subscription expense-accounts}]]]]
[typeahead-v3 {:entities chooseable-expense-accounts
:entity->text (fn [x ]
(str (:numeric-code x) " - " (:name x)))
:disabled disabled
:type "typeahead-v3"
:field [index :account]
:event [::expense-account-changed event expense-accounts max-value]
:subscription expense-accounts}]]]]
[:div.column.is-narrow
[:p.help "Location"]
[:div.control

View File

@@ -96,8 +96,8 @@
extended-last-page-button
[:span.mx-4 (Math/min (inc start) total) "-" end "/" total]
[:div.select
[:select {:value per-page :on-change (fn [e] (on-change {:start 0
:per-page (js/parseInt (.. e -target -value ))}))}
[:select {:value per-page :on-change (fn [^js/Event e] (on-change {:start 0
:per-page (js/parseInt (.-value ^js/HTMLOptionElement (.-target e )))}))}
[:option {:value 20 } "20 per page" ]
[:option {:value 50} "50 per page" ]
[:option {:value 100} "100 per page" ]

View File

@@ -4,7 +4,7 @@
[auto-ap.views.components.date-range-filter :refer [date-range-filter]]
[auto-ap.views.components.number-filter :refer [number-filter]]
[auto-ap.views.components.switch-field :refer [switch-field]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.pages.data-page :as data-page]
[auto-ap.views.utils :refer [active-when dispatch-event dispatch-value-change]]
[bidi.bidi :as bidi]
@@ -59,12 +59,12 @@
[:div
[:p.menu-label "Vendor"]
[:div
[typeahead-entity {:matches @(re-frame/subscribe [::subs/searchable-vendors])
:on-change #(re-frame/dispatch [::data-page/filter-changed data-page :vendor %])
:match->text :name
:type "typeahead-entity"
:value @(re-frame/subscribe [::data-page/filter data-page :vendor])
:include-keys [:name :id]}]]
[typeahead-v3 {:entities-by-id @(re-frame/subscribe [::subs/vendors-by-id])
:entity-index @(re-frame/subscribe [::subs/searchable-vendors-index])
:on-change #(re-frame/dispatch [::data-page/filter-changed data-page :vendor (some-> % (select-keys [:name :id]))])
:entity->text :name
:type "typeahead-v3"
:value @(re-frame/subscribe [::data-page/filter data-page :vendor])}]]
[:p.menu-label "Date Range"]
[:div
[date-range-filter

View File

@@ -2,7 +2,6 @@
(:require
[clojure.spec.alpha :as s]
[auto-ap.entities.invoice :as invoice]
[auto-ap.views.components.typeahead :refer [typeahead]]
[auto-ap.views.utils :refer [bind-field date-picker date->str local-now standard]]
[cljs-time.core :as t]
[re-frame.core :as re-frame]))

View File

@@ -3,238 +3,93 @@
[reagent.ratom :as ra]
[clojure.string :as str]
[clojure.set :as set]
#_[memsearch.core :as ms]
[memsearch.core :as ms]
[downshift :as ds :refer [useCombobox]]
[react]))
(set! *warn-on-infer* true)
;; TODO: This avoids the use of inferred externs by using aget. You could just use the ^js tag though
(defn state-reducer [state actions-and-changes]
(cond
(= (aget actions-and-changes "type") (aget (aget useCombobox "stateChangeTypes" ) "InputChange"))
(doto (aget actions-and-changes "changes") (aset "selectedItem" nil))
(and (= (aget actions-and-changes "type") (aget (aget useCombobox "stateChangeTypes") "InputBlur"))
(not (aget state "selectedItem")))
(doto (aget actions-and-changes "changes" ) (aset "inputValue" nil))
(defn get-valid-matches [matches not-found-description not-found-value text]
(let [valid-matches (take 15 (for [[[id t :as match] i] (map vector matches (range))
:when (str/includes? (or (some-> t .toLowerCase) "") (or (some-> text .toLowerCase) ""))]
match))
valid-matches (if (and not-found-description text)
(concat valid-matches [[:not-found (not-found-description text) (not-found-value text)]])
valid-matches)]
valid-matches))
:else
(aget actions-and-changes "changes")))
(defn typeahead [{:keys [matches on-change field text-field value class not-found-description
disabled not-found-value auto-focus]}]
(let [text (r/atom (or (second (first (filter #(= (first %) value) matches))) ""))
highlighted (r/atom nil)
selected (r/atom (first (first (filter #(= (first %) value) matches))))
]
(r/create-class
{:reagent-render (fn [{:keys [matches on-change disabled field text-field value class not-found-description]}]
(let [ select (fn [[id text-description text-value]]
(reset! selected id)
(reset! text text-description)
(when on-change
(if (= :not-found id)
(on-change nil text-description text-value)
(on-change id text-description (or text-value text-description)))))
text @text
valid-matches (get-valid-matches matches not-found-description not-found-value text)]
[:div.typeahead
(if disabled
(defn typeahead-v3-internal [{:keys [class style disabled entities entity->text entities-by-id entity-index on-change disabled value name auto-focus] :or {disabled false} :as i}]
(let [[items set-items] (react/useState (map clj->js entities))
[getLabelProps getMenuProps getComboboxProps getToggleButtonProps getInputProps getItemProps isOpen highlightedIndex selectItem selectedItem setInputValue]
(as-> (useCombobox (clj->js {:items items
:defaultHighlightedIndex 0
:defaultSelectedItem value
:onInputValueChange (fn [input]
(if entities-by-id
(->> (ms/text-search (aget input "inputValue") entity-index)
(sort-by (fn [[k v]]
(- (:score v))))
(map (fn [[x]]
(entities-by-id x)
))
(take 5)
clj->js
set-items)
^{:key (str "typeahead" text) } [:input.input {:disabled "disabled" :value text} ]
(if @selected
^{:key "typeahead"} [:div.input {:class class
:tab-index "0"
:on-key-up (fn [e]
(if (= 8 (.-keyCode e))
(do
(select [nil "" nil])
true)
false))}
[:div.control
[:div.tags.has-addons
[:span.tag text]
[:a.tag.is-delete {:on-click (fn []
(select [nil "" nil]))}]]]]
^{:key "typeahead"}
[:input.input {:type "text"
:class class
:value text
:auto-focus auto-focus
:on-blur (fn [e]
(cond @selected
nil
(#{"" nil} text)
nil
@highlighted
(do (select @highlighted)
true)
:else
(do (select [nil ""])
true)))
:on-key-down (fn [e]
(condp = (.-keyCode e)
; up
38 (do
(when-let [new-match (->> valid-matches
(take-while #(not= % @highlighted))
(last))]
(reset! highlighted new-match))
true)
;; dwon
40 (do
(when-let [new-match (->> valid-matches
(drop-while #(not= % @highlighted))
(drop 1)
(first))]
(reset! highlighted new-match))
true)
13 (do (.preventDefault e)
(when @highlighted
(select @highlighted)
false))
true))
:on-change (fn [e]
(let [new-matches (get-valid-matches matches not-found-description not-found-value (.. e -target -value))]
(reset! highlighted (first new-matches)))
(select [nil (.. e -target -value)]))}]))
(cond
(and (seq text)
(not @selected)
(seq valid-matches))
(let [[h] @highlighted]
[:div.typeahead-menu
[:ul
(for [[id t :as match] valid-matches]
^{:key id} [:li.typeahead-suggestion {:class (if (= id h)
"typeahead-highlighted")
:on-mouse-down #(do (select match))} t])]])
:else
nil)]))})))
(defn get-valid-entity-matches [matches not-found-description not-found-value text match->text]
(let [valid-matches (->> (for [[match i] (map vector matches (range))
:let [t (match->text match)
match-index (str/index-of (or (some-> t .toLowerCase) "") (or (some-> text .toLowerCase) ""))]
:when match-index]
[match match-index ])
(sort-by second)
(map first)
(take 10))
valid-matches (if (and not-found-description text)
(concat valid-matches [[:not-found (not-found-description text) (not-found-value text)]])
valid-matches)]
valid-matches))
(defn typeahead-entity [{:keys [matches on-change field value class not-found-description
disabled not-found-value auto-focus name include-keys]}]
(let [text (r/atom (or (second (first (filter #(= (first %) value) matches))) ""))
highlighted (r/atom nil)
]
(r/create-class
{:reagent-render (fn [{:keys [matches on-change disabled match->text field value class not-found-description include-keys style]}]
(let [select (fn [entity]
(when on-change
(if (= :not-found entity)
(on-change nil)
(on-change (cond-> entity
(and include-keys entity) (select-keys include-keys))))))
text-atom text
text (or (when value (match->text value)) @text)
valid-matches (get-valid-entity-matches matches not-found-description not-found-value text match->text)]
[:div.typeahead {:style style}
(if disabled
^{:key (str "typeahead" text) } [:input.input {:disabled "disabled" :value text} ]
(if value
^{:key "typeahead"} [:div.input {:class class
:tab-index "0"
:on-key-up (fn [e]
(if (= 8 (.-keyCode e))
(do
(select nil)
(reset! text-atom nil)
true)
false))}
[:div.control
[:div.tags.has-addons
[:span.tag text]
(when name
[:input {:type "hidden" :name name :value (:id @highlighted)}])
[:a.tag.is-delete {:on-click (fn []
(select nil)
(reset! text-atom nil)
(reset! highlighted nil))}]]]]
^{:key "typeahead"} [:input.input {:type "text"
:class class
:value text
:auto-focus auto-focus
:on-blur (fn [e]
(cond value
nil
(#{"" nil} text)
nil
@highlighted
(do (select @highlighted)
true)
:else
(do (select nil)
(reset! highlighted nil)
(reset! text-atom nil)
true)))
:on-key-down (fn [e]
(condp = (.-keyCode e)
; up
38 (do
(when-let [new-match (->> valid-matches
(take-while #(not= % @highlighted))
(last))]
(reset! highlighted new-match))
true)
;; dwon
40 (do
(when-let [new-match (->> valid-matches
(drop-while #(not= % @highlighted))
(drop 1)
(first))]
(reset! highlighted new-match))
true)
13 (do (.preventDefault e)
(when @highlighted
(select @highlighted)
false))
true))
:on-change (fn [e]
(let [new-matches (get-valid-entity-matches matches not-found-description not-found-value (.. e -target -value) match->text)]
(reset! highlighted (first new-matches)))
(reset! text-atom (.. e -target -value)))}]))
(cond
(and (seq text)
(not value)
(seq valid-matches))
(let [h @highlighted]
[:div.typeahead-menu
[:ul
(for [entity valid-matches]
(let [t (match->text entity)]
^{:key entity} [:li.typeahead-suggestion {:class (if (= entity h)
"typeahead-highlighted")
:on-mouse-over (fn [] (reset! highlighted entity))
:on-mouse-down #(do (select entity))} t]))]])
:else
nil)]))})))
(set-items (map clj->js (take 5 (filter (fn [x] (str/includes? (or (some-> (entity->text x) str/lower-case) "")
(or (some-> (aget input "inputValue") str/lower-case) "")))
entities))))))
:stateReducer state-reducer
:onSelectedItemChange (fn [z]
(when on-change
(on-change (js->clj (aget z "selectedItem") :keywordize-keys true))))})) $
(map #(aget $ %) ["getLabelProps" "getMenuProps" "getComboboxProps" "getToggleButtonProps" "getInputProps" "getItemProps" "isOpen" "highlightedIndex" "selectItem" "selectedItem" "setInputValue"]))]
[:<>
[:div.typeahead (assoc (js->clj (getComboboxProps))
:style style)
(if selectedItem
^{:key "typeahead"} [:div.input (assoc (js->clj (getInputProps #js {:disabled (if disabled
"disabled"
"")}))
:on-key-up (fn [e]
(when (= 8 (aget e "keyCode" ))
(selectItem nil)
(setInputValue nil)
(when on-change
(on-change nil))))
:class class
:tab-index "0")
[:div.control
[:div.tags.has-addons
[:span.tag (entity->text (js->clj selectedItem :keywordize-keys true))]
(when name
[:input {:type "hidden" :name name :value (:id (js->clj selectedItem :keywordize-keys true))}])
(when-not disabled
[:a.tag.is-delete {:on-click (fn []
(setInputValue nil)
(selectItem nil)
(when on-change
(on-change nil)))}])]]]
^{:key "typeahead"} [:input.input (js->clj
(getInputProps #js {:disabled (if disabled
"disabled"
"")
:autoFocus (if auto-focus
"autoFocus"
"")}))])
[:div {:class (if (and isOpen (seq items)) "typeahead-menu")}
[:ul (js->clj (getMenuProps))
(if (and isOpen (seq items))
(for [[index item] (map vector (range) (js->clj items :keywordize-keys true))]
^{:key item}
[:li.typeahead-suggestion (assoc (js->clj (getItemProps #js {:item item :index index}))
:class (if (= index highlightedIndex)
"typeahead-highlighted"))
(entity->text item)]))]]]]))
(defn typeahead-v3 [{:keys [class disabled entities entity->text entities-by-id entity-index on-change value ] :as props}]
[:div
[:f> typeahead-v3-internal props]])

View File

@@ -2,7 +2,7 @@
(:require [re-frame.core :as re-frame]
[auto-ap.views.utils :refer [dispatch-event horizontal-field bind-field with-user with-is-admin? active-when account->match-text]]
[auto-ap.views.components.address :refer [address-field]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.components.dropdown :refer [drop-down drop-down-contents]]
[auto-ap.events :as events]
[clj-fuzzy.metrics :refer [jaccard jaro-winkler]]
@@ -154,12 +154,12 @@
[:div.columns
[:div.column
[bind-field
[typeahead-entity {:matches clients
:match->text :name
:type "typeahead-entity"
:field [override-key i]
:event change-event
:subscription data}]]]
[typeahead-v3 {:entities clients
:entity->text :name
:type "typeahead-v3"
:field [override-key i]
:event change-event
:subscription data}]]]
[:div.column.is-1
[:a.button {:on-click (dispatch-event [::removed-override override-key i])} [:span.icon [:span.icon-remove]]]]]))])))
@@ -186,12 +186,12 @@
[:div.columns
[:div.column
[bind-field
[typeahead-entity {:matches clients
:match->text :name
:type "typeahead-entity"
:field [override-key i :client]
:event change-event
:subscription data}]]]
[typeahead-v3 {:entities clients
:entity->text :name
:type "typeahead-v3"
:field [override-key i :client]
:event change-event
:subscription data}]]]
[:div.column
[bind-field
(template
@@ -215,12 +215,12 @@
[:div.columns
[:div.column
[bind-field
[typeahead-entity {:matches clients
:match->text :name
:type "typeahead-entity"
:field [override-key i :client]
:event change-event
:subscription data}]]]
[typeahead-v3 {:entities clients
:entity->text :name
:type "typeahead-v3"
:field [override-key i :client]
:event change-event
:subscription data}]]]
[:div.column
[bind-field
(template
@@ -306,12 +306,12 @@
:override-key :account-overrides}
(fn [field client]
[typeahead-entity {:matches @(re-frame/subscribe [::subs/accounts client])
:match->text account->match-text
:field field
:type "typeahead-entity"
:event change-event
:subscription data}])]
[typeahead-v3 {:entities @(re-frame/subscribe [::subs/accounts client])
:entity->text account->match-text
:field field
:type "typeahead-v3"
:event change-event
:subscription data}])]
[:h2.subtitle "Address"]
[address-field {:field [:address]

View File

@@ -2,18 +2,6 @@
(:require
[clojure.spec.alpha :as s]
[auto-ap.entities.invoice :as invoice]
[auto-ap.views.components.typeahead :refer [typeahead]]
[auto-ap.views.utils :refer [bind-field]]))
(defn vendor-filter [{:keys [value on-change-event vendors]}]
[:div.field
[:div.control
[bind-field
[typeahead {:matches (map (fn [x] [(:id x) (:name x)]) vendors)
:type "typeahead"
:auto-focus true
:field [:vendor-id]
:text-field [:vendor-name]
:event on-change-event
:spec (s/nilable ::invoice/vendor-id)
:subscription value}]]]])

View File

@@ -3,7 +3,7 @@
[auto-ap.forms :as forms]
[auto-ap.subs :as subs]
[auto-ap.views.components.layouts :refer [side-bar]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.utils :refer [dispatch-event multi-field]]
[clojure.spec.alpha :as s]
[clojure.string :as str]
@@ -138,11 +138,11 @@
(field "Customizations"
[multi-field {:type "multi-field"
:field [:client-overrides]
:template [[typeahead-entity {:matches @(re-frame/subscribe [::subs/clients])
:style {:width "20em"}
:match->text :name
:type "typeahead"
:field [:client]}]
:template [[typeahead-v3 {:entities @(re-frame/subscribe [::subs/clients])
:style {:width "20em"}
:entity->text :name
:type "typeahead-v3"
:field [:client]}]
[:input.input {:type "text"
:style {:width "20em"}
:placeholder "Bubblegum"

View File

@@ -2,8 +2,7 @@
(:require
[re-frame.core :as re-frame]
[auto-ap.subs :as subs]
[auto-ap.views.utils :refer [active-when dispatch-value-change]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]))
[auto-ap.views.utils :refer [active-when dispatch-value-change]]))
(re-frame/reg-sub

View File

@@ -4,7 +4,7 @@
[auto-ap.subs :as subs]
[auto-ap.events :as events]
[auto-ap.views.components.address :refer [address-field]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.components.layouts :refer [side-bar]]
[auto-ap.views.utils
:refer
@@ -377,10 +377,10 @@
:type "text"
:field [:bank-accounts sort-order :yodlee-account-id]}]]
[field "Yodlee Account (new)"
[typeahead-entity {:matches @(re-frame/subscribe [::yodlee-accounts (:id new-client)])
:match->text (fn [m] (str (:name m) " - " (:number m)))
:type "typeahead"
:field [:bank-accounts sort-order :yodlee-account]}]]])
[typeahead-v3 {:entities @(re-frame/subscribe [::yodlee-accounts (:id new-client)])
:entity->text (fn [m] (str (:name m) " - " (:number m)))
:type "typeahead-v3"
:field [:bank-accounts sort-order :yodlee-account]}]]])
(when (#{:credit ":credit"} type )
[:div
@@ -405,10 +405,10 @@
:type "text"
:field [:bank-accounts sort-order :yodlee-account-id]}]]
[field "Yodlee Account (new)"
[typeahead-entity {:matches @(re-frame/subscribe [::yodlee-accounts (:id new-client)])
:match->text (fn [m] (str (:name m) " - " (:number m)))
:type "typeahead"
:field [:bank-accounts sort-order :yodlee-account]}]]])
[typeahead-v3 {:entities @(re-frame/subscribe [::yodlee-accounts (:id new-client)])
:entity->text (fn [m] (str (:name m) " - " (:number m)))
:type "typeahead-v3"
:field [:bank-accounts sort-order :yodlee-account]}]]])
[:div.field
[:label.label "Locations"]
[:div.control

View File

@@ -4,7 +4,7 @@
[auto-ap.subs :as subs]
[auto-ap.views.components.admin.side-bar :refer [admin-side-bar]]
[auto-ap.views.components.layouts :refer [side-bar-layout]]
[auto-ap.views.components.typeahead :refer [typeahead]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.utils :refer [bind-field dispatch-event]]
[re-frame.core :as re-frame]))
@@ -77,7 +77,7 @@
:venia/queries (map (fn [v ]
{:query/data [:upsert-vendor
{:vendor {:name v :default-account-id (-> db ::expense-accounts (get v) :default-account-id)}}
{:vendor {:name v :default-account-id (-> db ::expense-accounts (get v) :default-account-id :id)}}
[:id :name]]})
(get-in db [::excel-import :create-vendors]))}
@@ -138,11 +138,12 @@
[:p.control
[bind-field
[typeahead {:matches (map (fn [x] [(:id x) (:name x)]) chooseable-expense-accounts)
:type "typeahead"
:field [v :default-account-id]
:event change-event
:subscription data}]]]])])]
[typeahead-v3 {:entities chooseable-expense-accounts
:entity->text (fn [x ] (str (:numeric-code x) " - " (:name x)))
:type "typeahead-v3"
:field [v :default-account-id]
:event change-event
:subscription data}]]]])])]
[:div
[:button.button.is-pulled-right
{:on-click (dispatch-event [::create-vendors])

View File

@@ -8,7 +8,7 @@
[auto-ap.views.components.dropdown :refer [drop-down]]
[auto-ap.views.components.expense-accounts-field :as expense-accounts-field :refer [expense-accounts-field recalculate-amounts]]
[auto-ap.views.components.layouts :as layouts]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.pages.admin.rules.common :refer [default-read]]
[auto-ap.views.pages.admin.rules.results-modal :as results-modal]
[auto-ap.views.utils :refer [date->str date-picker dispatch-event standard with-user]]
@@ -180,7 +180,8 @@
[[:accounts] (expense-accounts-field/default-account (:accounts data)
@(re-frame/subscribe [::subs/vendor-default-account (:vendor data) value])
(:total data)
[])]
[])
[:bank-account] nil]
:else
[]))))
@@ -245,25 +246,29 @@
(field "Client"
[typeahead-entity {:matches @(re-frame/subscribe [::subs/clients])
:auto-focus true
:match->text :name
:type "typeahead-entity"
:field [:client]
:spec ::entity/client}])
[typeahead-v3 {:entities @(re-frame/subscribe [::subs/clients])
:auto-focus true
:entity->text :name
:type "typeahead-v3"
:field [:client]
:spec ::entity/client}])
(field "Bank account"
[typeahead-entity {:matches @(re-frame/subscribe [::subs/real-bank-accounts-for-client (:client data)])
:match->text :name
:type "typeahead-entity"
:field [:bank-account]
:spec ::entity/bank-account}])
(with-meta
(field "Bank account"
[typeahead-v3 {:entities @(re-frame/subscribe [::subs/real-bank-accounts-for-client (:client data)])
:entity->text :name
:type "typeahead-v3"
:field [:bank-account]
:spec ::entity/bank-account}])
;; TODO this forces unmounting when client changes, since it is an "uncontorlled" input
{:key (str "client-" (:id (:client data)))})
(field "Yodlee Merchant"
[typeahead-entity {:matches @(re-frame/subscribe [::subs/yodlee-merchants])
:match->text #(str (:name %) " - " (:yodlee-id %))
:type "typeahead-entity"
:field [:yodlee-merchant]}])
[typeahead-v3 {:entities @(re-frame/subscribe [::subs/yodlee-merchants])
:entity->text #(str (:name %) " - " (:yodlee-id %))
:type "typeahead-v3"
:field [:yodlee-merchant]}])
(field [:span "Description (" [:a {:href "https://regex101.com" :target "_new"} "regex tester"] ")" ]
[:input.input {:type "text"
@@ -315,11 +320,12 @@
[:h2.title.is-4 "Outcomes"]
(field "Assign Vendor"
[typeahead-entity {:matches @(re-frame/subscribe [::subs/all-vendors])
:match->text :name
:type "typeahead-entity"
:field [:vendor]
:spec ::entity/vendor}])
[typeahead-v3 {:entities-by-id @(re-frame/subscribe [::subs/vendors-by-id])
:entity-index @(re-frame/subscribe [::subs/searchable-vendors-index])
:entity->text :name
:type "typeahead-v3"
:field [:vendor]
:spec ::entity/vendor}])
(field nil
[expense-accounts-field {:type "expense-accounts"

View File

@@ -2,7 +2,7 @@
(:require
[re-frame.core :as re-frame]
[auto-ap.subs :as subs]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.pages.data-page :as data-page]))
@@ -10,10 +10,10 @@
[:div
[:p.menu-label "Vendor"]
[:div
[typeahead-entity {:matches @(re-frame/subscribe [::subs/vendors])
:on-change #(re-frame/dispatch [::data-page/filter-changed data-page :vendor %])
:match->text :name
:include-keys [:name :id]
:type "typeahead-entity"
:value @(re-frame/subscribe [::data-page/filter data-page :vendor])}]]])
[typeahead-v3 {:entities-by-id @(re-frame/subscribe [::subs/vendors-by-id])
:entity-index @(re-frame/subscribe [::subs/searchable-vendors-index])
:on-change #(re-frame/dispatch [::data-page/filter-changed data-page :vendor (some-> % (select-keys [:name :id]))])
:entity->text :name
:type "typeahead-v3"
:value @(re-frame/subscribe [::data-page/filter data-page :vendor])}]]])

View File

@@ -17,8 +17,6 @@
[auto-ap.views.utils :refer [login-url dispatch-value-change dispatch-event bind-field horizontal-field action-cell-width]]
[auto-ap.views.pages.admin.vendors.table :as table]
[auto-ap.views.pages.admin.vendors.merge-dialog :as merge-dialog]
[auto-ap.views.components.typeahead :refer [typeahead]]
[cljs.reader :as edn]
[auto-ap.routes :as routes]
[bidi.bidi :as bidi]

View File

@@ -3,7 +3,7 @@
[auto-ap.status :as status]
[auto-ap.subs :as subs]
[auto-ap.views.components.modal :as modal]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.utils :refer [dispatch-event]]
[re-frame.core :as re-frame]))
@@ -28,20 +28,22 @@
(form-inline {}
[:<>
(field "Form Vendor (will be deleted)"
[typeahead-entity {:matches @(re-frame/subscribe [::subs/vendors])
:type "typeahead-entity"
:auto-focus true
:match->text (fn [x]
(str (:name x) " (" (reduce + 0 (map :count (:usage x))) " usages)") )
:field [:from]}])
[typeahead-v3 {:entities-by-id @(re-frame/subscribe [::subs/vendors-by-id])
:entity-index @(re-frame/subscribe [::subs/searchable-vendors-index])
:type "typeahead-v3"
:auto-focus true
:entity->text (fn [x]
(str (:name x) " (" (reduce + 0 (map :count (:usage x))) " usages)") )
:field [:from]}])
(field "To Vendor"
[typeahead-entity {:matches @(re-frame/subscribe [::subs/vendors])
:type "typeahead-entity"
:match->text (fn [x]
(str (:name x) " (" (reduce + 0 (map :count (:usage x))) " usages)") )
:field [:to]}])])))
[typeahead-v3 {:entities-by-id @(re-frame/subscribe [::subs/vendors-by-id])
:entity-index @(re-frame/subscribe [::subs/searchable-vendors-index])
:type "typeahead-v3"
:entity->text (fn [x]
(str (:name x) " (" (reduce + 0 (map :count (:usage x))) " usages)") )
:field [:to]}])])))
(re-frame/reg-event-fx
::show

View File

@@ -2,8 +2,7 @@
(:require
[re-frame.core :as re-frame]
[auto-ap.subs :as subs]
[auto-ap.views.utils :refer [active-when dispatch-value-change]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]))
[auto-ap.views.utils :refer [active-when dispatch-value-change]]))
(re-frame/reg-sub
::specific-filters

View File

@@ -3,16 +3,20 @@
[auto-ap.subs :as subs]
[auto-ap.views.components.grid :as grid]
[auto-ap.views.components.layouts :refer [side-bar-layout]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.utils
:refer
[->$ date->str days-until dispatch-event local-now standard]]
[bidi.bidi :as bidi]
[cljs-time.coerce :as coerce]
[cljs-time.core :as t]
[clojure.string :as str]
[pushy.core :as pushy]
[re-frame.core :as re-frame]
[recharts]
[reagent.core :as r]))
[downshift :as ds :refer [useCombobox]]
[reagent.core :as r]
[react]))
(def pie-chart (r/adapt-react-class recharts/PieChart))
(def pie (r/adapt-react-class recharts/Pie))
@@ -296,9 +300,16 @@
(defn home-content []
(let [client-id (-> @(re-frame/subscribe [::subs/client]) :id)
vendors-by-id @(re-frame/subscribe [::subs/vendors-by-id])
vendors-index @(re-frame/subscribe [::subs/searchable-vendors-index])
accounts-by-id @(re-frame/subscribe [::subs/accounts-by-id])
accounts-index @(re-frame/subscribe [::subs/accounts-index])
chart-options @(re-frame/subscribe [::chart-options])]
^{:key client-id}
[side-bar-layout {:side-bar [:div]
[side-bar-layout {:side-bar [:div
]
:main [:div [:h1.title "Home"]
[:h1.title.is-4 "Top expense categories"]
(let [expense-categories @(re-frame/subscribe [::top-expense-categories])]

View File

@@ -10,7 +10,7 @@
[auto-ap.views.utils :refer [dispatch-event bind-field with-user]]
[auto-ap.utils :refer [by]]
[auto-ap.entities.vendors :as vendor]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.components.invoice-table :refer [invoice-table] :as invoice-table]
[cljs.reader :as edn]
[clojure.string :as str]
@@ -60,13 +60,14 @@
[:p.control
[:a.button.is-static "Force vendor"]]
[:div.control {:style {:width "400px"}}
[typeahead-entity {:matches @(re-frame/subscribe [::subs/vendors])
:match->text :name
:name "vendor"
:type "typeahead"
:on-change (fn [v]
(reset! vendor v))
:value @vendor}]]
[typeahead-v3 {:entities-by-id @(re-frame/subscribe [::subs/vendors-by-id])
:entity-index @(re-frame/subscribe [::subs/searchable-vendors-index])
:entity->text :name
:name "vendor"
:type "typeahead-v3"
:on-change (fn [v]
(reset! vendor v))
:value @vendor}]]
]
[:div.tile.notification
[:div.has-text-centered {:style {:padding "80px 0px" :width "100%"}}

View File

@@ -16,7 +16,7 @@
[auto-ap.views.components.modal :as modal]
[auto-ap.views.components.money-field :refer [money-field]]
[auto-ap.views.components.switch-field :refer [switch-field]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.pages.invoices.common :refer [invoice-read]]
[auto-ap.views.utils
:refer
@@ -348,22 +348,22 @@
(when-not @(re-frame/subscribe [::subs/client])
(field [:span "Client"
[:span.has-text-danger " *"]]
[typeahead-entity {:matches @(re-frame/subscribe [::subs/clients])
:match->text :name
:type "typeahead"
[typeahead-v3 {:entities @(re-frame/subscribe [::subs/clients])
:entity->text :name
:type "typeahead-v3"
:auto-focus (if @(re-frame/subscribe [::subs/client]) false true)
:field [:client]
:disabled exists?
:spec ::invoice/client}]))
(field [:span "Vendor"
[:span.has-text-danger " *"]]
[typeahead-entity {:matches @(re-frame/subscribe [::subs/vendors])
:match->text :name
:type "typeahead"
:disabled exists?
:auto-focus (if @(re-frame/subscribe [::subs/client]) true false)
:field [:vendor]}])
[typeahead-v3 {:entities-by-id @(re-frame/subscribe [::subs/vendors-by-id])
:entity-index @(re-frame/subscribe [::subs/searchable-vendors-index])
:entity->text :name
:type "typeahead-v3"
:disabled exists?
:auto-focus (if @(re-frame/subscribe [::subs/client]) true false)
:field [:vendor]}])
(field [:span "Date"
[:span.has-text-danger " *"]]

View File

@@ -4,7 +4,7 @@
[auto-ap.views.components.date-range-filter :refer [date-range-filter]]
[auto-ap.views.components.number-filter :refer [number-filter]]
[auto-ap.views.components.bank-account-filter :refer [bank-account-filter]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.pages.data-page :as data-page]
[auto-ap.views.utils :refer [active-when dispatch-value-change]]
[bidi.bidi :as bidi]
@@ -13,7 +13,8 @@
(defn ledger-side-bar [{:keys [data-page]}]
(let [ap @(re-frame/subscribe [::subs/active-page])
user @(re-frame/subscribe [::subs/user])
accounts @(re-frame/subscribe [::subs/accounts])]
accounts-by-id @(re-frame/subscribe [::subs/accounts-by-id])
accounts-index @(re-frame/subscribe [::subs/accounts-index])]
[:div
[:ul.menu-list
[:li.menu-item
@@ -56,21 +57,21 @@
[:p.menu-label "Financial Account"]
[:div
[typeahead-entity {:matches accounts
:match->text (fn [x ] (str (:numeric-code x) " - " (:name x)))
:include-keys [:name :id :numeric-code]
:type "typeahead-entity"
:on-change #(re-frame/dispatch [::data-page/filter-changed data-page :account %])
:value @(re-frame/subscribe [::data-page/filter data-page :account])}]]
[typeahead-v3 {:entities-by-id accounts-by-id
:entity-index accounts-index
:entity->text (fn [x ] (str (:numeric-code x) " - " (:name x)))
:type "typeahead-v3"
:on-change #(re-frame/dispatch [::data-page/filter-changed data-page :account (some-> % (select-keys [:name :id :numeric-code]))])
:value @(re-frame/subscribe [::data-page/filter data-page :account])}]]
[:p.menu-label "Vendor"]
[:div
[typeahead-entity {:matches @(re-frame/subscribe [::subs/searchable-vendors])
:on-change #(re-frame/dispatch [::data-page/filter-changed data-page :vendor %])
:include-keys [:name :id]
:match->text :name
:type "typeahead-entity"
:value @(re-frame/subscribe [::data-page/filter data-page :vendor])}]]
[typeahead-v3 {:entities-by-id @(re-frame/subscribe [::subs/vendors-by-id])
:entity-index @(re-frame/subscribe [::subs/searchable-vendors-index])
:on-change #(re-frame/dispatch [::data-page/filter-changed data-page :vendor (some-> % (select-keys [:name :id]))])
:entity->text :name
:type "typeahead-v3"
:value @(re-frame/subscribe [::data-page/filter data-page :vendor])}]]

View File

@@ -9,7 +9,6 @@
[auto-ap.views.components.sorter :refer [sorted-column]]
[auto-ap.views.components.date-range-filter :refer [date-range-filter]]
[auto-ap.views.components.layouts :refer [side-bar-layout]]
[auto-ap.views.components.typeahead :refer [typeahead]]
[auto-ap.views.components.paginator :refer [paginator]]
[auto-ap.views.components.sort-by-list :refer [sort-by-list]]
[auto-ap.events :as events]

View File

@@ -2,7 +2,7 @@
(:require [auto-ap.subs :as subs]
[auto-ap.views.components.date-range-filter :refer [date-range-filter]]
[auto-ap.views.components.number-filter :refer [number-filter]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.pages.data-page :as data-page]
[auto-ap.views.utils :refer [dispatch-event dispatch-value-change]]
[re-frame.core :as re-frame]))
@@ -14,12 +14,13 @@
[:div
[:p.menu-label "Vendor"]
[:div
[typeahead-entity {:matches @(re-frame/subscribe [::subs/searchable-vendors])
:on-change #(re-frame/dispatch [::data-page/filter-changed data-page :vendor %])
:include-keys [:name :id]
:match->text :name
:type "typeahead-entity"
:value @(re-frame/subscribe [::data-page/filter data-page :vendor])}]]
[typeahead-v3 {:entities-by-id @(re-frame/subscribe [::subs/vendors-by-id])
:entity-index @(re-frame/subscribe [::subs/searchable-vendors-index])
:on-change #(re-frame/dispatch [::data-page/filter-changed data-page :vendor (some-> % (select-keys [:name :id]))])
:include-keys [:name :id]
:entity->text :name
:type "typeahead-v3"
:value @(re-frame/subscribe [::data-page/filter data-page :vendor])}]]
[:p.menu-label "Date Range"]
[:div

View File

@@ -8,7 +8,7 @@
[auto-ap.views.components.expense-accounts-field :as expense-accounts-field :refer [expense-accounts-field recalculate-amounts]]
[auto-ap.views.components.layouts :as layouts]
[auto-ap.views.components.money-field :refer [money-field]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.status :as status]
[auto-ap.views.utils :refer [date->str date-picker dispatch-event standard with-user]]
[cljs-time.core :as c]
@@ -42,11 +42,11 @@
(when-not @(re-frame/subscribe [::subs/client])
(field [:span "Client"
[:span.has-text-danger " *"]]
[typeahead-entity {:matches @(re-frame/subscribe [::subs/clients])
:match->text :name
:type "typeahead"
:field [:client]
:disabled true}]))
[typeahead-v3 {:entities @(re-frame/subscribe [::subs/clients])
:entity->text :name
:type "typeahead-v3"
:field [:client]
:disabled true}]))
(field "Date"

View File

@@ -2,11 +2,9 @@
(:require [auto-ap.routes :as routes]
[auto-ap.subs :as subs]
[auto-ap.views.utils :refer [active-when dispatch-value-change]]
[auto-ap.views.components.vendor-filter :refer [vendor-filter]]
[auto-ap.views.components.date-range-filter :refer [date-range-filter]]
[auto-ap.views.components.number-filter :refer [number-filter]]
[auto-ap.views.components.bank-account-filter :refer [bank-account-filter]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[bidi.bidi :as bidi]
[re-frame.core :as re-frame]
[auto-ap.views.pages.data-page :as data-page]))

View File

@@ -9,7 +9,7 @@
:refer
[expense-accounts-field]]
[auto-ap.views.components.layouts :as layouts]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.pages.transactions.common :refer [transaction-read]]
[auto-ap.views.utils
:refer
@@ -406,13 +406,14 @@
[tab {:title "Details" :key :details}
[:div
(field "Vendor"
[typeahead-entity {:matches @(re-frame/subscribe [::subs/vendors])
:match->text :name
:type "typeahead-entity"
:auto-focus true
:field [:vendor]
:disabled (or (boolean (:payment data))
should-disable-for-client?)}])
[typeahead-v3 {:entities-by-id @(re-frame/subscribe [::subs/vendors-by-id])
:entity-index @(re-frame/subscribe [::subs/searchable-vendors-index])
:entity->text :name
:type "typeahead-v3"
:auto-focus true
:field [:vendor]
:disabled (or (boolean (:payment data))
should-disable-for-client?)}])
(field nil
[expense-accounts-field
{:type "expense-accounts"
@@ -437,10 +438,10 @@
:disabled should-disable-for-client?}])
(field "Forecasted-transaction"
[typeahead-entity {:matches @(re-frame/subscribe [::subs/forecasted-transactions-for-client (:id (:client data))])
:match->text :identifier
:type "typeahead-entity"
:field [:forecast-match]}])
[typeahead-v3 {:entities @(re-frame/subscribe [::subs/forecasted-transactions-for-client (:id (:client data))])
:entity->text :identifier
:type "typeahead-v3"
:field [:forecast-match]}])
(error-notification)
(when-not should-disable-for-client?
(submit-button "Save"))]]]]))])

View File

@@ -7,7 +7,7 @@
[auto-ap.views.components.date-range-filter :refer [date-range-filter]]
[auto-ap.views.components.number-filter :refer [number-filter]]
[auto-ap.views.components.switch-field :refer [switch-field]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.pages.data-page :as data-page]
[auto-ap.views.utils :refer [active-when dispatch-event dispatch-value-change ->$ account->match-text]]
[bidi.bidi :as bidi]
@@ -17,7 +17,8 @@
(let [ap @(re-frame/subscribe [::subs/active-page])
user @(re-frame/subscribe [::subs/user])
accounts @(re-frame/subscribe [::subs/accounts])
accounts @(re-frame/subscribe [::subs/accounts-by-id])
account-index @(re-frame/subscribe [::subs/accounts-index])
]
[:div
[:div [:p.menu-label "Type"]
@@ -64,20 +65,20 @@
[:p.menu-label "Financial Account"]
[:div
[typeahead-entity {:matches accounts
:match->text account->match-text
:include-keys [:name :id :numeric-code]
:type "typeahead-entity"
:on-change #(re-frame/dispatch [::data-page/filter-changed data-page :account %])
:value @(re-frame/subscribe [::data-page/filter data-page :account])}]]
[typeahead-v3 {:entities-by-id accounts
:entity-index account-index
:entity->text account->match-text
:type "typeahead-v3"
:on-change #(re-frame/dispatch [::data-page/filter-changed data-page :account (some-> % (select-keys [:name :id :numeric-code]))])
:value @(re-frame/subscribe [::data-page/filter data-page :account])}]]
[:p.menu-label "Vendor"]
[:div
[typeahead-entity {:matches @(re-frame/subscribe [::subs/searchable-vendors])
:on-change #(re-frame/dispatch [::data-page/filter-changed data-page :vendor %])
:include-keys [:name :id]
:match->text :name
:type "typeahead-entity"
[typeahead-v3 {:entities-by-id @(re-frame/subscribe [::subs/vendors-by-id])
:entity-index @(re-frame/subscribe [::subs/searchable-vendors-index])
:on-change #(re-frame/dispatch [::data-page/filter-changed data-page :vendor (some-> % (select-keys [:name :id]))])
:entity->text :name
:type "typeahead-v3"
:value @(re-frame/subscribe [::data-page/filter data-page :vendor])}]]

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)))))