Major changes: - Replace Tailwind with SCSS using Bootstrap-compatible variables - Add Gulp build system for SCSS and JS compilation - Split JS into modular partials (_events, _filters, _preview, etc.) CSS fixes: - Fix preview popover visibility (remove conflicting modal.scss rule) - Fix search input max-width override for parent form styles - Add filter panel styling (toggle buttons, chips, values row) - Add group-body padding with negative margins on modifiers - Style filter-group-toggle with eye icon for preview JS additions: - Add showGroupPreviewPopover for group count badge clicks - Add showItemsPopover for rendering preview popover - Add renderPreviewItems for product list rendering - Add eye icon to filter toggle button generation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
491 lines
11 KiB
SCSS
491 lines
11 KiB
SCSS
/**
|
|
* Chips Component
|
|
* Entity chips, selection pills, tags
|
|
*/
|
|
|
|
@use '../variables' as *;
|
|
@use '../mixins' as *;
|
|
|
|
.target-conditions-trait,
|
|
.entity-selector-trait {
|
|
|
|
// Chips container
|
|
.entity-chips {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: $es-spacing-xs;
|
|
padding: $es-spacing-sm 0;
|
|
min-height: 32px;
|
|
|
|
&:empty {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
// Individual chip
|
|
.entity-chip {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.375rem;
|
|
padding: 0.25rem 0.5rem;
|
|
background: $es-slate-100;
|
|
color: $es-text-secondary;
|
|
font-size: $es-font-size-xs;
|
|
font-weight: $es-font-weight-medium;
|
|
border-radius: $es-radius-full;
|
|
max-width: 200px;
|
|
transition: all $es-transition-fast;
|
|
|
|
&:hover {
|
|
background: $es-slate-200;
|
|
}
|
|
|
|
// Chip with image
|
|
&.has-image {
|
|
padding-left: 0.25rem;
|
|
}
|
|
}
|
|
|
|
.chip-image {
|
|
width: 20px;
|
|
height: 20px;
|
|
object-fit: cover;
|
|
border-radius: 50%;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.chip-icon {
|
|
font-size: 12px;
|
|
color: $es-text-muted;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.chip-text,
|
|
.chip-name {
|
|
@include text-truncate;
|
|
}
|
|
|
|
.chip-remove {
|
|
@include button-reset;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 16px;
|
|
height: 16px;
|
|
margin-left: 0.125rem;
|
|
color: $es-text-muted;
|
|
border-radius: 50%;
|
|
flex-shrink: 0;
|
|
transition: all $es-transition-fast;
|
|
|
|
&:hover {
|
|
background: rgba(0, 0, 0, 0.1);
|
|
color: $es-danger;
|
|
}
|
|
|
|
i {
|
|
font-size: 10px;
|
|
}
|
|
}
|
|
|
|
// Chip variants
|
|
.entity-chip.chip-primary {
|
|
background: $es-primary-light;
|
|
color: $es-primary;
|
|
|
|
&:hover {
|
|
background: rgba($es-primary, 0.2);
|
|
}
|
|
}
|
|
|
|
.entity-chip.chip-success {
|
|
background: $es-success-light;
|
|
color: $es-success-dark;
|
|
|
|
&:hover {
|
|
background: rgba($es-success, 0.2);
|
|
}
|
|
}
|
|
|
|
.entity-chip.chip-danger {
|
|
background: $es-danger-light;
|
|
color: $es-danger;
|
|
|
|
&:hover {
|
|
background: rgba($es-danger, 0.2);
|
|
}
|
|
}
|
|
|
|
.entity-chip.chip-warning {
|
|
background: $es-warning-light;
|
|
color: darken($es-warning, 20%);
|
|
|
|
&:hover {
|
|
background: rgba($es-warning, 0.3);
|
|
}
|
|
}
|
|
|
|
// Chip loading state
|
|
.entity-chip.loading,
|
|
.entity-chip-loading {
|
|
opacity: 0.7;
|
|
|
|
.chip-remove {
|
|
display: none;
|
|
}
|
|
|
|
.chip-icon i {
|
|
animation: spin 0.6s linear infinite;
|
|
}
|
|
}
|
|
|
|
// Hidden chip (collapsed view)
|
|
.entity-chip.chip-hidden {
|
|
display: none;
|
|
}
|
|
|
|
// Chips expanded/collapsed states
|
|
.entity-chips.chips-collapsed,
|
|
.entity-chips.chips-expanded {
|
|
position: relative;
|
|
}
|
|
|
|
// Show more/less toggle
|
|
.chips-show-more-toggle {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.25rem;
|
|
padding: 0.25rem 0.5rem;
|
|
color: $es-primary;
|
|
font-size: $es-font-size-xs;
|
|
font-weight: $es-font-weight-medium;
|
|
cursor: pointer;
|
|
transition: color $es-transition-fast;
|
|
|
|
&:hover {
|
|
color: $es-primary-hover;
|
|
}
|
|
|
|
i {
|
|
font-size: 10px;
|
|
}
|
|
}
|
|
|
|
.chips-collapse-toggle,
|
|
.chips-expand-toggle {
|
|
// Specific variants inherit from .chips-show-more-toggle
|
|
}
|
|
|
|
// More chips indicator
|
|
.chips-more {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 0.25rem 0.5rem;
|
|
background: $es-slate-200;
|
|
color: $es-text-secondary;
|
|
font-size: $es-font-size-xs;
|
|
font-weight: $es-font-weight-semibold;
|
|
border-radius: $es-radius-full;
|
|
cursor: pointer;
|
|
transition: all $es-transition-fast;
|
|
|
|
&:hover {
|
|
background: $es-slate-300;
|
|
}
|
|
}
|
|
|
|
// Add chip button
|
|
.chip-add-btn {
|
|
@include button-reset;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.25rem;
|
|
padding: 0.25rem 0.5rem;
|
|
background: transparent;
|
|
color: $es-primary;
|
|
font-size: $es-font-size-xs;
|
|
font-weight: $es-font-weight-medium;
|
|
border: 1px dashed $es-primary;
|
|
border-radius: $es-radius-full;
|
|
transition: all $es-transition-fast;
|
|
|
|
&:hover {
|
|
background: $es-primary-light;
|
|
}
|
|
|
|
i {
|
|
font-size: 10px;
|
|
}
|
|
}
|
|
|
|
// Inline chips (compact mode)
|
|
.entity-chips.inline {
|
|
display: inline-flex;
|
|
padding: 0;
|
|
min-height: auto;
|
|
|
|
.entity-chip {
|
|
padding: 0.125rem 0.375rem;
|
|
font-size: 11px;
|
|
}
|
|
}
|
|
|
|
// Selected chips section in include/exclude
|
|
.selected-chips-container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: $es-spacing-xs;
|
|
}
|
|
|
|
.selected-chips-label {
|
|
font-size: $es-font-size-xs;
|
|
font-weight: $es-font-weight-medium;
|
|
color: $es-text-muted;
|
|
}
|
|
|
|
// Pattern chips (for name/reference patterns)
|
|
.entity-chip.chip-pattern {
|
|
background: #fef3c7;
|
|
color: #92400e;
|
|
font-family: monospace;
|
|
|
|
&:hover {
|
|
background: #fde68a;
|
|
}
|
|
|
|
.chip-icon {
|
|
color: #d97706;
|
|
}
|
|
}
|
|
|
|
// Range chips (price, quantity, etc.)
|
|
.entity-chip.chip-range,
|
|
.range-chip {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.375rem;
|
|
padding: 0.25rem 0.5rem;
|
|
background: $es-cyan-50;
|
|
color: $es-cyan-600;
|
|
font-size: $es-font-size-xs;
|
|
font-weight: $es-font-weight-medium;
|
|
border-radius: $es-radius-full;
|
|
transition: all $es-transition-fast;
|
|
|
|
&:hover {
|
|
background: $es-cyan-100;
|
|
}
|
|
}
|
|
|
|
.range-chip-text {
|
|
font-family: monospace;
|
|
}
|
|
|
|
.btn-remove-range {
|
|
@include button-reset;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 16px;
|
|
height: 16px;
|
|
color: $es-cyan-600;
|
|
border-radius: 50%;
|
|
transition: all $es-transition-fast;
|
|
|
|
&:hover {
|
|
background: rgba(0, 0, 0, 0.1);
|
|
color: $es-danger;
|
|
}
|
|
|
|
i {
|
|
font-size: 10px;
|
|
}
|
|
}
|
|
|
|
// Multi-range chips container
|
|
.multi-range-chips {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: $es-spacing-xs;
|
|
margin-bottom: $es-spacing-xs;
|
|
|
|
&:empty {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
// Pattern chips container
|
|
.pattern-chips {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: $es-spacing-xs;
|
|
padding: $es-spacing-sm 0;
|
|
min-height: 32px;
|
|
|
|
&:empty::before {
|
|
content: attr(data-placeholder);
|
|
color: $es-text-muted;
|
|
font-size: $es-font-size-xs;
|
|
font-style: italic;
|
|
}
|
|
}
|
|
|
|
// Pattern tag
|
|
.pattern-tag {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.25rem;
|
|
padding: 0.25rem 0.5rem;
|
|
background: #fef3c7;
|
|
color: #92400e;
|
|
font-size: $es-font-size-xs;
|
|
font-weight: $es-font-weight-medium;
|
|
border-radius: $es-radius-sm;
|
|
transition: all $es-transition-fast;
|
|
|
|
&:hover {
|
|
background: #fde68a;
|
|
}
|
|
|
|
&.case-sensitive {
|
|
.case-icon {
|
|
color: $es-success;
|
|
font-weight: $es-font-weight-bold;
|
|
}
|
|
}
|
|
|
|
&.draft-tag {
|
|
background: $es-white;
|
|
border: 1px solid $es-border-color;
|
|
padding: 0;
|
|
flex: 1;
|
|
min-width: 150px;
|
|
|
|
&:hover {
|
|
background: $es-white;
|
|
}
|
|
|
|
.pattern-input {
|
|
flex: 1;
|
|
min-width: 100px;
|
|
padding: 0.375rem;
|
|
border: 0;
|
|
background: transparent;
|
|
font-size: $es-font-size-sm;
|
|
font-family: inherit;
|
|
|
|
&:focus {
|
|
outline: none;
|
|
}
|
|
|
|
&::placeholder {
|
|
color: $es-text-muted;
|
|
font-style: italic;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.pattern-tag-text {
|
|
font-family: monospace;
|
|
max-width: 200px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.btn-toggle-case {
|
|
@include button-reset;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 24px;
|
|
height: 24px;
|
|
color: $es-text-muted;
|
|
border-radius: $es-radius-sm;
|
|
transition: all $es-transition-fast;
|
|
|
|
&:hover {
|
|
background: rgba(0, 0, 0, 0.1);
|
|
}
|
|
}
|
|
|
|
.case-icon {
|
|
font-size: 11px;
|
|
font-weight: $es-font-weight-semibold;
|
|
font-family: monospace;
|
|
}
|
|
|
|
.btn-remove-pattern {
|
|
@include button-reset;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 18px;
|
|
height: 18px;
|
|
color: #d97706;
|
|
border-radius: $es-radius-sm;
|
|
transition: all $es-transition-fast;
|
|
|
|
&:hover {
|
|
background: rgba(0, 0, 0, 0.1);
|
|
color: $es-danger;
|
|
}
|
|
|
|
i {
|
|
font-size: 10px;
|
|
}
|
|
}
|
|
|
|
.btn-add-pattern {
|
|
@include button-reset;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 28px;
|
|
height: 28px;
|
|
color: $es-primary;
|
|
border-radius: $es-radius-sm;
|
|
transition: all $es-transition-fast;
|
|
|
|
&:hover {
|
|
background: $es-primary-light;
|
|
}
|
|
|
|
i {
|
|
font-size: 12px;
|
|
}
|
|
}
|
|
|
|
// Pattern match count (in draft tag)
|
|
.pattern-match-count {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.25rem;
|
|
padding: 0 0.375rem;
|
|
color: $es-text-muted;
|
|
font-size: $es-font-size-xs;
|
|
cursor: pointer;
|
|
|
|
&.count-zero {
|
|
color: $es-warning;
|
|
}
|
|
|
|
&.count-found {
|
|
color: $es-success;
|
|
}
|
|
|
|
.count-value {
|
|
font-weight: $es-font-weight-semibold;
|
|
}
|
|
}
|
|
|
|
// Pattern input row
|
|
.pattern-input-row {
|
|
display: flex;
|
|
align-items: stretch;
|
|
gap: $es-spacing-xs;
|
|
}
|
|
}
|