Adding more filters, for fun.

This commit is contained in:
BC
2019-01-27 09:52:06 -08:00
parent 35710bbcbf
commit 152cad487e
5 changed files with 68 additions and 9 deletions

View File

@@ -0,0 +1,19 @@
(ns auto-ap.views.components.bank-account-filter
(: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 bank-account-filter [{:keys [value on-change-event bank-accounts]}]
[:div.field
[:div.control
[bind-field
[typeahead {:matches (map (fn [x] [(:id x) (:name x)]) bank-accounts)
:type "typeahead"
:auto-focus true
:field [:id]
:text-field [:name]
:event on-change-event
:spec (s/nilable ::invoice/vendor-id)
:subscription value}]]]])