css tweaks for select

This commit is contained in:
Tienson Qin
2023-07-04 19:19:09 +08:00
parent a37bb6664f
commit db94f4e638
2 changed files with 44 additions and 28 deletions

View File

@@ -402,34 +402,33 @@
v' (if (seq items) items [""])
v' (conj v' ::new-value-placeholder) ; new one
editor-id' (str editor-id (count v'))]
[:div.flex.flex-1.flex-col
[:div.flex.flex-1.flex-col
(for [[idx item] (medley/indexed v')]
(let [dom-id' (str dom-id "-" idx)
editor-id' (str editor-id idx)]
(rum/with-key
(multiple-value-item block property items item
(merge
opts
{:dom-id dom-id'
:editor-id editor-id'
:editor-args editor-args
:new-item? (= item ::new-value-placeholder)}))
dom-id')))
[:div.grid.gap-1
(for [[idx item] (medley/indexed v')]
(let [dom-id' (str dom-id "-" idx)
editor-id' (str editor-id idx)]
(rum/with-key
(multiple-value-item block property items item
(merge
opts
{:dom-id dom-id'
:editor-id editor-id'
:editor-args editor-args
:new-item? (= item ::new-value-placeholder)}))
dom-id')))
(let [fv (first v')]
(when (and fv
(or (and (string? fv) (not (string/blank? fv)))
(and (not (string? fv)) (some? fv))))
[:div.rounded-sm.ml-1
{:on-click (fn []
(set-editing! property (str editor-id (dec (count v'))) nil ""))}
[:div.flex.flex-row
[:div.block {:style {:height 20
:width 20}}
[:a.add-button-link.block {:title "Add another value"
:style {:margin-left -4}}
(ui/icon "circle-plus")]]]]))]])
(let [fv (first v')]
(when (and fv
(or (and (string? fv) (not (string/blank? fv)))
(and (not (string? fv)) (some? fv))))
[:div.rounded-sm.ml-1
{:on-click (fn []
(set-editing! property (str editor-id (dec (count v'))) nil ""))}
[:div.flex.flex-row
[:div.block {:style {:height 20
:width 20}}
[:a.add-button-link.block {:title "Add another value"
:style {:margin-left -4}}
(ui/icon "circle-plus")]]]]))])
:else
[:div.flex.flex-1.items-center.property-value-content
@@ -447,7 +446,7 @@
(when (or (seq properties) new-property?)
[:div.ls-properties-area
(when (seq properties)
[:div
[:div.grid.gap-1
(for [[prop-uuid-or-built-in-prop v] properties]
(let [v (get properties-text-values prop-uuid-or-built-in-prop v)]
(if (uuid? prop-uuid-or-built-in-prop)

View File

@@ -2,6 +2,23 @@
@apply px-1 rounded-sm;
cursor: text;
min-height: 24px;
.cp__select-main {
width: fit-content;
margin: 0;
}
.cp__select .input-wrap {
height: auto;
min-width: 14em;
}
.cp__select .input-wrap input {
border: none;
}
.cp__select-input {
padding: 0.5em 1em;
}
}
.property-value-content:hover {