alpine for dropdown.

This commit is contained in:
2023-10-20 17:52:15 -07:00
parent 8684a68471
commit ffcc43ba5e
8 changed files with 215 additions and 49 deletions

View File

@@ -95,7 +95,7 @@
selected-client-id)
:client/bank-accounts
(filter (fn [{:keys [bank-account/name]}]
(str/includes? (str/upper-case name)
(str/includes? (or (some-> name str/upper-case) "")
(or (some-> query-params
(get "q")
str/upper-case)
@@ -108,15 +108,14 @@
(defn bank-account-typeahead* [{:keys [client-id name value]}]
(if client-id
(com/typeahead {:name name
:class "w-96"
:placeholder "Search..."
:url (bidi/path-for ssr-routes/only-routes :bank-account-search
:db/id client-id)
:id (str "form-bank-account-search")
:value value
:value-fn (some-fn :db/id identity)
:content-fn (some-fn :bank-account/name #(pull-attr (dc/db conn) :bank-account/name %))})
(com/typeahead-2 {:name name
:class "w-96"
:placeholder "Search..."
:url (bidi/path-for ssr-routes/only-routes :bank-account-search
:db/id client-id)
:value value
:value-fn (some-fn :db/id identity)
:content-fn (some-fn :bank-account/name #(pull-attr (dc/db conn) :bank-account/name %))})
[:span.text-xs.text-gray-500 "Please select a client before selecting a bank account."
[:input {:type "hidden"
:name name}]]))