mirror of https://github.com/logseq/logseq
enhance(ui): add the shui select for the schema types
parent
35c71c9ca4
commit
e71c4c8c50
|
@ -222,8 +222,9 @@
|
|||
:disabled false}
|
||||
(svg/help-circle))]
|
||||
[:div.flex.items-center.col-span-2
|
||||
(ui/select schema-types
|
||||
(fn [_e v]
|
||||
(shui/select
|
||||
{:on-value-change
|
||||
(fn [v]
|
||||
(let [type (keyword (string/lower-case v))
|
||||
update-schema-fn (apply comp
|
||||
#(assoc % :type type)
|
||||
|
@ -236,7 +237,18 @@
|
|||
#(dissoc % attr)))
|
||||
[:cardinality :classes :position]))]
|
||||
(swap! *property-schema update-schema-fn)
|
||||
(components-pu/update-property! property @*property-name @*property-schema))))
|
||||
(components-pu/update-property! property @*property-name @*property-schema)))
|
||||
:default-value :default}
|
||||
(shui/select-trigger
|
||||
{:class "!px-2 !py-0 !h-8"}
|
||||
(shui/select-value
|
||||
{:placeholder "Select a schema type"})
|
||||
(shui/tabler-icon "selector" {:class "opacity-30"}))
|
||||
(shui/select-content
|
||||
(shui/select-group
|
||||
(for [{:keys [label value disabled]} schema-types]
|
||||
(shui/select-item {:value value :disabled disabled} label)))))
|
||||
|
||||
(ui/tippy {:html "Changing the property type clears some property configurations."
|
||||
:class "tippy-hover ml-2"
|
||||
:interactive true
|
||||
|
|
Loading…
Reference in New Issue