progress on updating users

This commit is contained in:
Bryce
2023-10-22 06:27:55 -07:00
parent 998d29690e
commit a6032e2be2
5 changed files with 109 additions and 105 deletions

View File

@@ -77,13 +77,12 @@ c.clearChoices();
(str (:url params) "?q="))
:value {:value ((:value-fn params first) (:value params)) :label ((:content-fn params second) (:value params))}
:search ""
:active 0
:elements (if (:value params)
:active -1
:elements (if ((:value-fn params first) (:value params))
[{:value ((:value-fn params first) (:value params)) :label ((:content-fn params second) (:value params))}]
[])})
:x-modelable "value.value"
:x-model (:x-model params)
}
:x-model (:x-model params)}
[:a {:class (-> (hh/add-class (or (:class params) "") default-input-classes)
(hh/add-class "cursor-pointer"))
"@click.prevent" "open = !open;"
@@ -100,16 +99,15 @@ c.clearChoices();
(dissoc :placeholder)
(dissoc :x-model)
(assoc
"x-ref" "hidden"
:type "hidden"
":value" "value.value"
:x-init (hiccup/raw (str "$watch('value', v => $dispatch('change')); "))))]
"x-ref" "hidden"
:type "hidden"
":value" "value.value"
:x-init (hiccup/raw (str "$watch('value', v => $dispatch('change')); "))))]
[:div.flex.w-full.justify-items-stretch
[:span.flex-grow.text-left {"x-text" "value.label"}]
[:div {:class "w-3 h-3 m-1 inline ml-1 justify-self-end text-gray-500 self-center"}
svg/drop-down]]]
[:ul.dropdown-contents {:class "absolute bg-gray-50 dark:bg-gray-600 rounded-lg shadow-lg py-1 w-max z-10 mt-1"
"@keydown.escape" "open = false; value = {value: '', label: '' }"
"x-transition:enter" "ease-[cubic-bezier(.3,2.3,.6,1)] duration-200"