enhance(ui): shui select for the UI position select

pull/11102/head
charlie 2024-02-27 21:35:42 +08:00
parent 9fe1b9fba7
commit 270eb7e2da
1 changed files with 16 additions and 5 deletions

View File

@ -291,11 +291,22 @@
])]
[:div.grid.grid-cols-4.gap-1.items-center.leading-8
[:label.col-span-1 "UI position:"]
[:div.col-span-3
(ui/select choices
(fn [_e v]
[:div.col-span-2
(shui/select
(cond-> {:on-value-change (fn [v]
(swap! *property-schema assoc :position v)
(save-property-fn)))]]))
(save-property-fn))}
(string? position)
(assoc :default-value position))
(shui/select-trigger
{:class "!px-2 !py-0 !h-8"}
(shui/select-value
{:placeholder "Select a position mode"})
(shui/tabler-icon "selector" {:class "opacity-30"}))
(shui/select-content
(shui/select-group
(for [{:keys [label value]} choices]
(shui/select-item {:value value} label)))))]]))
(let [hide? (:hide? @*property-schema)]
[:div.grid.grid-cols-4.gap-1.items-center.leading-8