enhance(ui): polish property dropdown editor

This commit is contained in:
charlie
2025-02-27 11:42:31 +08:00
parent 1de94faa90
commit 40f84e1dde
4 changed files with 18 additions and 14 deletions

View File

@@ -354,10 +354,14 @@ a.control-link {
}
.inner-wrap {
@apply flex items-center w-full justify-between gap-1 flex-wrap;
@apply flex items-center w-full justify-between gap-1 flex-nowrap;
> .property-setting-title {
@apply flex items-center gap-1 font-normal opacity-90;
@apply flex items-center gap-1 font-normal opacity-90 overflow-hidden;
> span {
@apply whitespace-nowrap text-ellipsis overflow-hidden;
}
}
> label {

View File

@@ -290,7 +290,7 @@
[:div.property-setting-title
(some-> icon (name) (shui/tabler-icon {:size 14
:style {:margin-top "-1"}}))
[:span title]]
[:span {:title title} title]]
(cond
(fn? desc)
(desc)
@@ -462,13 +462,14 @@
[choices]
(let [select-cp (fn [opts]
(shui/select
opts
(shui/select-trigger
(shui/select-value {:placeholder "Select a choice"}))
(shui/select-content
(map (fn [choice]
(shui/select-item {:key (str (:db/id choice))
:value (:db/id choice)} (:block/title choice))) choices))))
opts
(shui/select-trigger
{:class "h-8"}
(shui/select-value {:placeholder "Select a choice"}))
(shui/select-content
(map (fn [choice]
(shui/select-item {:key (str (:db/id choice))
:value (:db/id choice)} (:block/title choice))) choices))))
checked-choice (some (fn [choice] (when (true? (:logseq.property/choice-checkbox-state choice)) choice)) choices)
unchecked-choice (some (fn [choice] (when (false? (:logseq.property/choice-checkbox-state choice)) choice)) choices)]
[:div.flex.flex-col.gap-4.text-sm.p-2