mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-21 01:23:40 +00:00
feat(filters): add searchable creatable value inputs
Build a theme-aligned combobox on the shared reka-ui primitives. Rank stored keys before bilingual descriptions, allow validated custom values, and preserve unconfirmed multi-value drafts instead of silently committing them.
This commit is contained in:
1 parent
a3e9ab26a7
commit
2ebce8495d
4 files changed
+653
-1
No files matched your search
@@ -795,6 +795,232 @@
|
||||
grid-area: name;
|
||||
}
|
||||
|
||||
/* ---- Filter combobox (FilterCombobox.vue; its popover is portaled, so not scoped) ---- */
|
||||
.filter-combo {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
.filter-combo-anchor {
|
||||
display: flex;
|
||||
min-height: 2.25rem;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
border-radius: 0.5rem;
|
||||
background: rgb(var(--wh-surface));
|
||||
padding: 0 0.375rem 0 0.75rem;
|
||||
box-shadow:
|
||||
inset 0 0 0 1px rgb(var(--wh-border-strong)),
|
||||
0 1px 2px rgb(0 0 0 / 0.05);
|
||||
cursor: text;
|
||||
transition: box-shadow 150ms ease;
|
||||
}
|
||||
.filter-combo-anchor:focus-within {
|
||||
box-shadow: inset 0 0 0 2px rgb(var(--wh-accent));
|
||||
}
|
||||
.filter-combo-anchor.is-invalid {
|
||||
box-shadow: inset 0 0 0 1px rgb(var(--wh-bad));
|
||||
}
|
||||
.filter-combo-anchor.is-invalid:focus-within {
|
||||
box-shadow: inset 0 0 0 2px rgb(var(--wh-bad));
|
||||
}
|
||||
.filter-combo-anchor.is-multi {
|
||||
flex-wrap: wrap;
|
||||
padding: 0.25rem 0.375rem 0.25rem 0.375rem;
|
||||
}
|
||||
.filter-combo-chip {
|
||||
display: inline-flex;
|
||||
max-width: 100%;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
border-radius: 0.375rem;
|
||||
background: rgb(var(--wh-accent-dim));
|
||||
padding: 0.125rem 0.25rem 0.125rem 0.5rem;
|
||||
color: rgb(var(--wh-accent-text));
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.72rem;
|
||||
font-weight: 500;
|
||||
line-height: 1.25rem;
|
||||
}
|
||||
.filter-combo-chip.is-invalid {
|
||||
background: rgb(var(--wh-bad-dim));
|
||||
color: rgb(var(--wh-bad));
|
||||
text-decoration: line-through;
|
||||
text-decoration-color: rgb(var(--wh-bad) / 0.6);
|
||||
}
|
||||
.filter-combo-chip.is-invalid .filter-combo-chip-x {
|
||||
color: rgb(var(--wh-bad));
|
||||
}
|
||||
.filter-combo-chip-text {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.filter-combo-chip-x {
|
||||
display: grid;
|
||||
flex: none;
|
||||
width: 1.125rem;
|
||||
height: 1.125rem;
|
||||
place-items: center;
|
||||
border-radius: 9999px;
|
||||
color: rgb(var(--wh-accent));
|
||||
cursor: pointer;
|
||||
}
|
||||
.filter-combo-chip-x:hover {
|
||||
background: rgb(var(--wh-accent) / 0.15);
|
||||
}
|
||||
.filter-combo-chip-x:focus-visible {
|
||||
outline: 2px solid rgb(var(--wh-accent));
|
||||
outline-offset: 1px;
|
||||
}
|
||||
.filter-combo-input {
|
||||
min-width: 4rem;
|
||||
flex: 1 1 4rem;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
padding: 0.375rem 0;
|
||||
color: rgb(var(--wh-text));
|
||||
font-size: 0.8125rem;
|
||||
outline: none;
|
||||
}
|
||||
.filter-combo-anchor.is-multi .filter-combo-input {
|
||||
padding-left: 0.375rem;
|
||||
}
|
||||
.filter-combo-input.is-mono {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
.filter-combo-input::placeholder {
|
||||
color: rgb(var(--wh-faint));
|
||||
}
|
||||
.filter-combo-trigger {
|
||||
display: grid;
|
||||
flex: none;
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
place-items: center;
|
||||
border-radius: 0.375rem;
|
||||
color: rgb(var(--wh-faint));
|
||||
}
|
||||
.filter-combo-trigger:hover {
|
||||
color: rgb(var(--wh-text));
|
||||
}
|
||||
.filter-combo-error {
|
||||
margin: 0.3rem 0 0;
|
||||
color: rgb(var(--wh-bad));
|
||||
font-size: 0.72rem;
|
||||
}
|
||||
.filter-combo-pending {
|
||||
margin: 0.3rem 0 0;
|
||||
color: rgb(var(--wh-warn));
|
||||
font-size: 0.72rem;
|
||||
}
|
||||
.filter-combo-content {
|
||||
z-index: 55;
|
||||
width: max(var(--reka-combobox-trigger-width), 17rem);
|
||||
max-width: calc(100vw - 1rem);
|
||||
overflow: hidden;
|
||||
border-radius: 0.5rem;
|
||||
background: rgb(var(--wh-surface));
|
||||
box-shadow:
|
||||
inset 0 0 0 1px rgb(var(--wh-border)),
|
||||
0 4px 6px -1px rgb(0 0 0 / 0.1),
|
||||
0 2px 4px -2px rgb(0 0 0 / 0.1);
|
||||
color: rgb(var(--wh-text));
|
||||
}
|
||||
.filter-combo-content[data-state="open"] {
|
||||
animation: filter-combo-in 120ms ease-out;
|
||||
}
|
||||
@keyframes filter-combo-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
}
|
||||
.filter-combo-viewport {
|
||||
max-height: min(18rem, var(--reka-combobox-content-available-height, 18rem));
|
||||
overflow-y: auto;
|
||||
padding: 0.25rem;
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
.filter-combo-group {
|
||||
padding: 0.5rem 0.625rem 0.25rem;
|
||||
color: rgb(var(--wh-faint));
|
||||
font-size: 0.65rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.filter-combo-item {
|
||||
position: relative;
|
||||
display: flex;
|
||||
min-height: 2rem;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
border-radius: 0.375rem;
|
||||
padding: 0.375rem 2rem 0.375rem 0.625rem;
|
||||
font-size: 0.8125rem;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
.filter-combo-item[data-highlighted] {
|
||||
background: rgb(var(--wh-surface-3));
|
||||
}
|
||||
.filter-combo-item-value {
|
||||
flex: none;
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
.filter-combo-item-hint {
|
||||
min-width: 0;
|
||||
flex: 1 1 auto;
|
||||
overflow: hidden;
|
||||
color: rgb(var(--wh-muted));
|
||||
font-size: 0.75rem;
|
||||
text-align: right;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.filter-combo-item-check {
|
||||
position: absolute;
|
||||
right: 0.5rem;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
color: rgb(var(--wh-accent));
|
||||
}
|
||||
.filter-combo-item.is-create {
|
||||
color: rgb(var(--wh-accent));
|
||||
font-weight: 600;
|
||||
}
|
||||
.filter-combo-item-create {
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.filter-combo-note {
|
||||
margin: 0;
|
||||
padding: 0.75rem 0.625rem;
|
||||
color: rgb(var(--wh-faint));
|
||||
font-size: 0.75rem;
|
||||
text-align: center;
|
||||
}
|
||||
.filter-combo-note.is-error {
|
||||
color: rgb(var(--wh-bad));
|
||||
text-align: left;
|
||||
}
|
||||
@media (pointer: coarse) {
|
||||
.filter-combo-item {
|
||||
min-height: 2.5rem;
|
||||
}
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.filter-combo-content[data-state="open"] {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
|
||||
.node-editor {
|
||||
@apply mb-1;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user