Refactor: create shared entity-item base, remove duplicate CSS

- Add _entity-item.scss shared component for chips and list items
- Refactor _list-preview.scss to use shared patterns
- Delete entity-list-preview.css (duplicate hardcoded styles)
- All preview styling now comes from SCSS build only

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-02 09:01:15 +01:00
parent 334e62e157
commit cd714d8400
6 changed files with 786 additions and 929 deletions

View File

@@ -1,588 +0,0 @@
/**
* Target Conditions List Preview Styles
*/
/* Trigger in list */
.target-preview-trigger {
cursor: pointer;
display: inline-flex;
gap: 4px;
transition: opacity 0.15s;
}
.target-preview-trigger:hover {
opacity: 0.8;
}
.target-preview-trigger .badge {
cursor: pointer;
}
/* Backdrop */
.target-list-preview-backdrop {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 10500;
background: transparent;
}
/* Popover container */
.target-list-preview-popover {
position: fixed;
z-index: 10501;
width: 380px;
height: 500px;
max-height: calc(100vh - 100px);
background: #fff;
border-radius: 8px;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.1);
overflow: hidden;
display: flex;
flex-direction: column;
}
/* Header */
.target-list-preview-popover .preview-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
background: #f8f9fa;
border-bottom: 1px solid #e9ecef;
flex-shrink: 0;
}
.target-list-preview-popover .preview-title {
font-weight: 600;
font-size: 13px;
color: #333;
}
.target-list-preview-popover .preview-close {
background: none;
border: none;
padding: 4px 8px;
cursor: pointer;
color: #666;
font-size: 14px;
line-height: 1;
border-radius: 4px;
transition: all 0.15s;
}
.target-list-preview-popover .preview-close:hover {
background: #e9ecef;
color: #333;
}
/* Tabs */
.target-list-preview-popover .preview-tabs {
display: flex;
flex-wrap: wrap;
gap: 4px;
padding: 8px 12px;
background: #f8f9fa;
border-bottom: 1px solid #e9ecef;
flex-shrink: 0;
max-height: 120px;
overflow-y: auto;
}
.target-list-preview-popover .preview-tab {
flex: 0 0 auto;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 4px;
padding: 4px 8px;
background: #fff;
border: 1px solid #dee2e6;
border-radius: 4px;
font-size: 11px;
font-weight: 500;
color: #666;
cursor: pointer;
transition: all 0.15s;
white-space: nowrap;
}
.target-list-preview-popover .preview-tab:hover {
background: #f8f9fa;
border-color: #adb5bd;
}
.target-list-preview-popover .preview-tab.active {
background: #337ab7;
border-color: #337ab7;
color: #fff;
}
.target-list-preview-popover .preview-tab i {
font-size: 10px;
}
/* Filter bar */
.target-list-preview-popover .preview-filter {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
background: #fff;
border-bottom: 1px solid #e9ecef;
flex-shrink: 0;
}
.target-list-preview-popover .preview-filter i {
color: #adb5bd;
font-size: 12px;
}
.target-list-preview-popover .preview-filter-input {
flex: 1;
border: none;
outline: none;
font-size: 13px;
color: #333;
background: transparent;
}
.target-list-preview-popover .preview-filter-input::placeholder {
color: #adb5bd;
}
/* Content containers */
.target-list-preview-popover .preview-contents {
flex: 1 1 0;
overflow: hidden;
min-height: 0;
display: flex;
flex-direction: column;
}
.target-list-preview-popover .preview-content {
display: none;
flex-direction: column;
flex: 1 1 0;
min-height: 0;
overflow: hidden;
}
.target-list-preview-popover .preview-content.active {
display: flex;
}
/* Loading state */
.target-list-preview-popover .preview-loading {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 40px 20px;
color: #666;
font-size: 13px;
}
.target-list-preview-popover .preview-loading i {
font-size: 16px;
color: #337ab7;
}
/* Empty state */
.target-list-preview-popover .preview-empty,
.target-list-preview-popover .preview-empty-inline {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 40px 20px;
color: #999;
font-size: 13px;
}
.target-list-preview-popover .preview-empty i,
.target-list-preview-popover .preview-empty-inline i {
font-size: 16px;
}
/* Error state */
.target-list-preview-popover .preview-error,
.target-list-preview-popover .preview-error-inline {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 40px 20px;
color: #dc3545;
font-size: 13px;
}
.target-list-preview-popover .preview-error i,
.target-list-preview-popover .preview-error-inline i {
font-size: 16px;
}
/* Items list */
.target-list-preview-popover .preview-items {
padding: 8px;
flex: 1 1 0;
overflow-y: auto;
min-height: 0;
}
.target-list-preview-popover .preview-item {
display: flex;
align-items: center;
gap: 10px;
padding: 8px;
border-radius: 6px;
transition: background 0.15s;
}
.target-list-preview-popover .preview-item:hover {
background: #f8f9fa;
}
.target-list-preview-popover .preview-item-image {
width: 40px;
height: 40px;
object-fit: cover;
border-radius: 4px;
background: #f8f9fa;
flex-shrink: 0;
}
.target-list-preview-popover .preview-item-no-image {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
background: #f1f3f5;
border-radius: 4px;
color: #adb5bd;
font-size: 16px;
flex-shrink: 0;
}
.target-list-preview-popover .preview-item-info {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 2px;
}
.target-list-preview-popover .preview-item-name {
font-size: 13px;
font-weight: 500;
color: #333;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.target-list-preview-popover .preview-item-ref {
font-size: 11px;
color: #999;
}
.target-list-preview-popover .preview-item-price {
font-size: 12px;
font-weight: 600;
color: #28a745;
}
/* Footer with load more */
.target-list-preview-popover .preview-footer {
padding: 8px 12px;
background: #f8f9fa;
border-top: 1px solid #e9ecef;
flex-shrink: 0;
}
.target-list-preview-popover .load-more-controls {
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
}
.target-list-preview-popover .load-more-label {
font-size: 12px;
color: #666;
}
.target-list-preview-popover .load-more-select {
padding: 4px 6px;
background: #fff;
border: 1px solid #dee2e6;
border-radius: 4px;
font-size: 12px;
color: #333;
cursor: pointer;
min-width: 70px;
}
.target-list-preview-popover .load-more-select:hover {
border-color: #337ab7;
}
.target-list-preview-popover .load-more-select:focus {
outline: none;
border-color: #337ab7;
box-shadow: 0 0 0 2px rgba(51, 122, 183, 0.2);
}
.target-list-preview-popover .load-more-of {
font-size: 12px;
color: #666;
}
.target-list-preview-popover .load-more-of .remaining-count {
font-weight: 600;
color: #333;
}
.target-list-preview-popover .btn-load-more {
display: inline-flex;
align-items: center;
justify-content: center;
width: 26px;
height: 26px;
padding: 0;
background: #337ab7;
border: none;
border-radius: 4px;
color: #fff;
cursor: pointer;
transition: background 0.15s;
}
.target-list-preview-popover .btn-load-more:hover {
background: #286090;
}
.target-list-preview-popover .btn-load-more i {
font-size: 11px;
}
.target-list-preview-popover .loading-text,
.target-list-preview-popover .error-text {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 12px;
color: #666;
}
.target-list-preview-popover .error-text {
color: #dc3545;
}
.target-list-preview-popover .loading-text i {
color: #337ab7;
}
/* Rules summary */
.target-list-preview-popover .preview-rules {
padding: 8px 12px;
background: #f8f9fa;
border-bottom: 1px solid #e9ecef;
flex-shrink: 0;
max-height: 140px;
overflow-y: auto;
}
.target-list-preview-popover .preview-rule-group {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 4px;
padding: 6px 0;
border-bottom: 1px dashed #dee2e6;
}
.target-list-preview-popover .preview-rule-group:last-child {
border-bottom: none;
padding-bottom: 0;
}
.target-list-preview-popover .preview-rule-group:first-child {
padding-top: 0;
}
.target-list-preview-popover .preview-group-label {
font-size: 10px;
color: #6c757d;
font-weight: 600;
text-transform: uppercase;
margin-right: 4px;
flex-shrink: 0;
}
.target-list-preview-popover .preview-rule {
display: inline-flex;
align-items: center;
gap: 3px;
padding: 2px 6px;
border-radius: 3px;
font-size: 10px;
font-weight: 500;
cursor: help;
transition: transform 0.1s, box-shadow 0.1s;
}
.target-list-preview-popover .preview-rule:hover {
transform: scale(1.05);
box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.target-list-preview-popover .preview-rule.include {
background: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
}
.target-list-preview-popover .preview-rule.exclude {
background: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
}
.target-list-preview-popover .preview-rule .rule-icon {
font-size: 8px;
}
.target-list-preview-popover .preview-rule .rule-icon i {
vertical-align: middle;
}
.target-list-preview-popover .preview-rule .rule-text {
white-space: nowrap;
}
/* Rule detail popup - appended to body */
.rule-detail-popup {
position: fixed;
min-width: 200px;
max-width: 300px;
max-height: 200px;
overflow-y: auto;
background: #fff;
border: 1px solid #dee2e6;
border-radius: 6px;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
z-index: 10600;
padding: 8px;
}
.rule-detail-loading,
.rule-detail-error,
.rule-detail-info {
font-size: 12px;
color: #666;
text-align: center;
padding: 8px;
}
.rule-detail-info strong {
display: block;
margin-bottom: 4px;
}
.rule-detail-error {
color: #dc3545;
}
.rule-detail-list {
display: flex;
flex-direction: column;
gap: 4px;
}
.rule-detail-item {
display: flex;
align-items: center;
gap: 8px;
padding: 4px;
border-radius: 4px;
font-size: 12px;
color: #333;
}
.rule-detail-item:hover {
background: #f8f9fa;
}
.rule-detail-img {
width: 24px;
height: 24px;
object-fit: cover;
border-radius: 3px;
flex-shrink: 0;
}
.rule-detail-icon {
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
background: #f1f3f5;
border-radius: 3px;
color: #6c757d;
font-size: 12px;
flex-shrink: 0;
}
/* Drag and Resize */
.target-list-preview-popover .preview-header {
cursor: move;
user-select: none;
}
.target-list-preview-popover .preview-header .preview-close {
cursor: pointer;
}
.target-list-preview-popover .popover-resize-handle {
position: absolute;
bottom: 0;
right: 0;
width: 16px;
height: 16px;
cursor: se-resize;
background: linear-gradient(135deg, transparent 50%, #adb5bd 50%, #adb5bd 60%, transparent 60%, transparent 70%, #adb5bd 70%, #adb5bd 80%, transparent 80%);
border-radius: 0 0 8px 0;
opacity: 0.6;
transition: opacity 0.15s;
}
.target-list-preview-popover .popover-resize-handle:hover {
opacity: 1;
}
.target-list-preview-popover.dragging {
cursor: move;
opacity: 0.95;
box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.15);
}
.target-list-preview-popover.resizing {
cursor: se-resize;
opacity: 0.95;
}
.target-list-preview-popover.dragging *,
.target-list-preview-popover.resizing * {
user-select: none;
pointer-events: none;
}
.target-list-preview-popover.dragging .preview-header,
.target-list-preview-popover.resizing .popover-resize-handle {
pointer-events: auto;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,516 @@
/**
* Entity Item - Shared Base Component
* Unified styling for entity items in chips, lists, and previews
*
* Variants:
* - .entity-item (base) - default list-row style
* - .entity-item.chip-style - pill/chip style (compact)
* - .entity-item.card-style - card/grid style
*/
@use '../variables' as *;
@use '../mixins' as *;
// =============================================================================
// Entity Item Sizing
// =============================================================================
$entity-item-image-sm: 20px;
$entity-item-image-md: 32px;
$entity-item-image-lg: 48px;
// =============================================================================
// Base Entity Item (list-row layout)
// =============================================================================
.entity-item {
display: flex;
align-items: center;
gap: $es-spacing-sm;
padding: $es-spacing-sm;
background: $es-white;
border-radius: $es-radius-sm;
transition: background $es-transition-fast;
&:hover {
background: $es-bg-hover;
}
// Clickable variant
&.clickable {
cursor: pointer;
}
// Selected state
&.selected {
background: $es-primary-light;
}
}
// -----------------------------------------------------------------------------
// Entity Item Image
// -----------------------------------------------------------------------------
.entity-item-image {
flex-shrink: 0;
width: $entity-item-image-md;
height: $entity-item-image-md;
object-fit: cover;
border-radius: $es-radius-sm;
background: $es-slate-100;
}
// Size variants
.entity-item-image--sm {
width: $entity-item-image-sm;
height: $entity-item-image-sm;
border-radius: 50%;
}
.entity-item-image--lg {
width: $entity-item-image-lg;
height: $entity-item-image-lg;
}
// No-image placeholder
.entity-item-no-image {
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
width: $entity-item-image-md;
height: $entity-item-image-md;
background: $es-slate-100;
color: $es-text-muted;
border-radius: $es-radius-sm;
font-size: $es-font-size-sm;
&--sm {
width: $entity-item-image-sm;
height: $entity-item-image-sm;
font-size: 10px;
border-radius: 50%;
}
}
// -----------------------------------------------------------------------------
// Entity Item Info (name + meta)
// -----------------------------------------------------------------------------
.entity-item-info {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 0.125rem;
}
.entity-item-name {
font-size: $es-font-size-sm;
font-weight: $es-font-weight-medium;
color: $es-text-primary;
@include text-truncate;
}
.entity-item-meta {
font-size: $es-font-size-xs;
color: $es-text-muted;
@include text-truncate;
}
// -----------------------------------------------------------------------------
// Entity Item Badge/Price (right side)
// -----------------------------------------------------------------------------
.entity-item-badge {
flex-shrink: 0;
padding: 0.125rem 0.5rem;
font-size: $es-font-size-xs;
font-weight: $es-font-weight-medium;
background: $es-slate-100;
color: $es-text-muted;
border-radius: $es-radius-sm;
}
.entity-item-price {
flex-shrink: 0;
font-size: $es-font-size-sm;
font-weight: $es-font-weight-semibold;
color: $es-primary;
}
// -----------------------------------------------------------------------------
// Entity Item Actions (remove button, etc.)
// -----------------------------------------------------------------------------
.entity-item-action {
@include button-reset;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 20px;
height: 20px;
color: $es-text-muted;
border-radius: 50%;
transition: all $es-transition-fast;
&:hover {
background: rgba(0, 0, 0, 0.1);
color: $es-danger;
}
i {
font-size: 10px;
}
}
// =============================================================================
// Chip Style Variant (compact pill)
// =============================================================================
.entity-item.chip-style {
display: inline-flex;
gap: 0.375rem;
padding: 0.25rem 0.5rem;
background: $es-slate-100;
border-radius: $es-radius-full;
&:hover {
background: $es-slate-200;
}
.entity-item-image {
width: $entity-item-image-sm;
height: $entity-item-image-sm;
border-radius: 50%;
}
.entity-item-no-image {
width: $entity-item-image-sm;
height: $entity-item-image-sm;
font-size: 10px;
border-radius: 50%;
}
.entity-item-info {
flex-direction: row;
align-items: center;
gap: 0.25rem;
}
.entity-item-name {
font-size: $es-font-size-xs;
}
.entity-item-meta {
display: none;
}
.entity-item-action {
width: 16px;
height: 16px;
margin-left: 0.125rem;
}
}
// =============================================================================
// List Style Variant (bordered rows)
// =============================================================================
.entity-item.list-style {
padding: $es-spacing-sm 0;
background: transparent;
border-bottom: 1px solid $es-border-color;
border-radius: 0;
&:last-child {
border-bottom: none;
}
&:hover {
background: $es-bg-hover;
}
}
// =============================================================================
// Entity Item Container (wrapper for multiple items)
// =============================================================================
.entity-items-container {
display: flex;
flex-direction: column;
background: $es-slate-50;
border: 1px solid $es-border-color;
border-radius: $es-radius-md;
overflow: hidden;
}
// Toolbar (filter, sort, count, clear)
.entity-items-toolbar {
display: none;
align-items: center;
flex-wrap: nowrap;
gap: $es-spacing-sm;
padding: $es-spacing-sm $es-spacing-md;
padding-bottom: 0;
background: transparent;
&.has-items {
display: flex;
}
}
// Filter input
.entity-items-filter {
all: unset;
display: block;
flex: 1 1 auto;
min-width: 80px;
width: auto;
height: auto;
padding: 0.2rem 0.5rem 0.2rem 1.5rem;
background: $es-white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 0.375rem center;
background-size: 10px;
border: 1px solid $es-slate-300;
border-radius: $es-radius-sm;
font-size: 11px;
line-height: 1.4;
color: $es-text-primary;
box-sizing: border-box;
transition: all $es-transition-fast;
&::placeholder {
color: $es-text-muted;
font-size: 11px;
}
&:focus {
outline: none;
border-color: $es-primary;
box-shadow: 0 0 0 2px rgba($es-primary, 0.1);
}
}
// Sort dropdown
.entity-items-sort {
all: unset;
flex: 0 0 auto;
padding: 0.2rem 1.25rem 0.2rem 0.5rem;
border: 1px solid $es-border-color;
border-radius: $es-radius-sm;
background: $es-white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%23666' d='M0 2l4 4 4-4z'/%3E%3C/svg%3E") no-repeat right 0.375rem center;
background-size: 8px;
font-size: 10px;
line-height: 1.4;
color: $es-text-secondary;
cursor: pointer;
box-sizing: border-box;
white-space: nowrap;
&:hover {
border-color: $es-primary;
}
&:focus {
outline: none;
border-color: $es-primary;
box-shadow: 0 0 0 2px rgba($es-primary, 0.1);
}
}
// Count badge
.entity-items-count {
display: inline-flex;
align-items: center;
flex-shrink: 0;
gap: 0.125rem;
padding: 0.2rem 0.5rem;
background: $es-slate-200;
color: $es-text-secondary;
font-size: 10px;
font-weight: $es-font-weight-semibold;
border-radius: $es-radius-sm;
white-space: nowrap;
line-height: 1.4;
&.has-filter {
background: $es-cyan-100;
color: $es-cyan-700;
}
}
// Clear button
.entity-items-clear {
@include button-reset;
display: inline-flex;
align-items: center;
flex-shrink: 0;
gap: 0.25rem;
padding: 0.2rem 0.5rem;
color: $es-danger;
font-size: 10px;
font-weight: $es-font-weight-medium;
background: rgba($es-danger, 0.1);
border-radius: $es-radius-sm;
transition: all $es-transition-fast;
white-space: nowrap;
line-height: 1.4;
&:hover {
background: $es-danger;
color: $es-white;
}
i {
font-size: 9px;
flex-shrink: 0;
}
}
// Items list area
.entity-items-list {
display: flex;
flex-wrap: wrap;
gap: $es-spacing-xs;
padding: $es-spacing-sm $es-spacing-md $es-spacing-md;
min-height: 40px;
max-height: 300px;
overflow-y: auto;
@include custom-scrollbar;
&:empty {
display: none;
}
// List layout (vertical)
&.list-layout {
flex-direction: column;
flex-wrap: nowrap;
gap: 0;
padding: $es-spacing-sm;
}
}
// Load more section
.entity-items-load-more {
display: flex;
align-items: center;
justify-content: center;
gap: $es-spacing-sm;
padding: $es-spacing-sm $es-spacing-md;
background: transparent;
border-top: 1px dashed $es-border-color;
.load-more-label {
font-size: $es-font-size-xs;
color: $es-text-muted;
}
.load-more-select {
appearance: none;
padding: 0.25rem 1.75rem 0.25rem 0.5rem;
border: 1px solid $es-border-color;
border-radius: $es-radius-sm;
background: $es-white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%23666' d='M0 2l4 4 4-4z'/%3E%3C/svg%3E") no-repeat right 0.5rem center;
background-size: 8px;
font-size: $es-font-size-xs;
font-weight: $es-font-weight-medium;
color: $es-primary;
cursor: pointer;
transition: all $es-transition-fast;
height: auto;
min-height: 0;
line-height: 1.3;
&:hover {
border-color: $es-primary;
background-color: $es-primary-light;
}
&:focus {
outline: none;
border-color: $es-primary;
box-shadow: 0 0 0 2px rgba($es-primary, 0.1);
}
}
.load-more-remaining {
font-size: $es-font-size-xs;
color: $es-text-muted;
.remaining-count {
font-weight: $es-font-weight-semibold;
color: $es-text-secondary;
}
}
.btn-load-more {
display: flex;
align-items: center;
justify-content: center;
padding: $es-spacing-xs;
margin: 0;
border: none;
color: $es-primary;
background: $es-primary-light;
border-radius: $es-radius-sm;
cursor: pointer;
transition: all $es-transition-fast;
font: inherit;
i {
font-size: 14px;
}
&:hover {
background: rgba($es-primary, 0.2);
}
&.loading {
cursor: wait;
i {
animation: spin 0.6s linear infinite;
}
}
}
}
// =============================================================================
// Empty & Loading States
// =============================================================================
.entity-items-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: $es-spacing-sm;
padding: $es-spacing-xl;
text-align: center;
color: $es-text-muted;
i {
font-size: 2rem;
opacity: 0.5;
}
p {
margin: 0;
font-size: $es-font-size-sm;
}
}
.entity-items-loading {
display: flex;
align-items: center;
justify-content: center;
padding: $es-spacing-xl;
color: $es-text-muted;
i {
font-size: 20px;
animation: spin 0.6s linear infinite;
}
}

View File

@@ -1,20 +1,24 @@
/**
* List Preview Component
* Entity list display in modals and popovers
* Popover and modal views for entity preview
*
* Uses shared entity-item base for item styling.
* This file only contains popover/modal container styles.
*/
@use '../variables' as *;
@use '../mixins' as *;
// =============================================================================
// Preview Popover (floating popover attached to badges)
// Preview Popover Container
// =============================================================================
.target-preview-popover {
.target-preview-popover,
.target-list-preview-popover {
position: absolute;
z-index: 10000;
min-width: 280px;
max-width: 400px;
min-width: 320px;
max-width: 480px;
background: $es-white;
border: 1px solid $es-border-color;
border-radius: $es-radius-lg;
@@ -44,7 +48,31 @@
border-bottom: 6px solid $es-white;
}
.preview-header {
// Positioned to the right - arrow on left
&.position-right {
&::before,
&::after {
left: 20px;
transform: none;
}
}
// Positioned to the left - arrow on right
&.position-left {
&::before,
&::after {
left: auto;
right: 20px;
transform: none;
}
}
}
// =============================================================================
// Preview Header
// =============================================================================
.preview-header {
display: flex;
align-items: center;
justify-content: space-between;
@@ -52,7 +80,7 @@
background: $es-bg-header;
border-bottom: 1px solid $es-border-color;
.preview-count {
.preview-title {
font-size: $es-font-size-sm;
font-weight: $es-font-weight-semibold;
color: $es-text-primary;
@@ -63,8 +91,8 @@
display: flex;
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
width: 24px;
height: 24px;
color: $es-text-muted;
border-radius: $es-radius-sm;
transition: all $es-transition-fast;
@@ -74,86 +102,209 @@
color: $es-text-primary;
}
}
}
}
.preview-list {
max-height: 300px;
overflow-y: auto;
@include custom-scrollbar;
padding: $es-spacing-sm;
// =============================================================================
// Preview Tabs (entity type switcher)
// =============================================================================
.preview-tabs {
display: flex;
flex-direction: column;
gap: $es-spacing-xs;
position: relative;
flex-wrap: wrap;
gap: 0;
padding: 0;
background: $es-slate-50;
border-bottom: 1px solid $es-border-color;
}
// Loading overlay for AJAX filtering
&.filtering {
pointer-events: none;
opacity: 0.6;
}
.filter-loading-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
.preview-tab {
display: flex;
align-items: center;
justify-content: center;
background: rgba($es-white, 0.7);
z-index: 10;
gap: 0.375rem;
padding: 0.5rem 0.75rem;
background: transparent;
border: 0;
border-bottom: 2px solid transparent;
margin-bottom: -1px;
color: $es-text-muted;
font-size: $es-font-size-xs;
font-weight: $es-font-weight-medium;
cursor: pointer;
transition: all $es-transition-fast;
white-space: nowrap;
&:hover {
background: $es-slate-100;
color: $es-text-secondary;
}
&.active {
background: $es-white;
border-bottom-color: $es-primary;
color: $es-primary;
}
i {
font-size: 20px;
color: $es-primary;
animation: spin 0.6s linear infinite;
}
}
font-size: 12px;
}
}
// Filter input section
.preview-filter {
padding: $es-spacing-sm;
// =============================================================================
// Preview Filter
// =============================================================================
.preview-filter {
display: flex;
align-items: center;
gap: $es-spacing-sm;
padding: $es-spacing-sm $es-spacing-md;
background: $es-white;
border-bottom: 1px solid $es-border-color;
.preview-filter-input {
width: 100%;
padding: $es-spacing-xs $es-spacing-sm;
font-size: $es-font-size-xs;
line-height: 1.4;
color: $es-text-primary;
background-color: $es-white;
border: 1px solid $es-border-color;
border-radius: $es-radius-sm;
box-sizing: border-box;
&:focus {
border-color: $es-primary;
outline: none;
i {
color: $es-text-muted;
font-size: 12px;
}
.preview-filter-input {
all: unset;
flex: 1;
padding: 0.25rem 0;
font-size: $es-font-size-xs;
color: $es-text-primary;
box-sizing: border-box;
&::placeholder {
color: $es-text-muted;
}
}
}
// =============================================================================
// Preview Contents (tabbed content areas)
// =============================================================================
.preview-contents {
max-height: 350px;
overflow: hidden;
}
.preview-content {
display: none;
max-height: 350px;
overflow-y: auto;
@include custom-scrollbar;
&.active {
display: block;
}
}
// =============================================================================
// Preview Items Container
// =============================================================================
.preview-items {
display: flex;
flex-direction: column;
padding: $es-spacing-xs $es-spacing-sm;
}
// =============================================================================
// Preview Item - Uses entity-item patterns
// Maps legacy classes to shared styling
// =============================================================================
.preview-item {
display: flex;
align-items: center;
gap: $es-spacing-sm;
padding: $es-spacing-sm;
background: $es-white;
border-radius: $es-radius-sm;
transition: background $es-transition-fast;
&:hover {
background: $es-bg-hover;
}
.preview-footer {
// Clickable items
&[data-id] {
cursor: pointer;
}
}
// Image - matches chip image sizing for consistency
.preview-item-image {
flex-shrink: 0;
width: 32px;
height: 32px;
object-fit: cover;
border-radius: $es-radius-sm;
background: $es-slate-100;
}
// No-image placeholder
.preview-item-no-image {
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 32px;
height: 32px;
background: $es-slate-100;
color: $es-text-muted;
border-radius: $es-radius-sm;
font-size: $es-font-size-sm;
}
// Info container
.preview-item-info {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 0.125rem;
}
// Name
.preview-item-name {
font-size: $es-font-size-sm;
font-weight: $es-font-weight-medium;
color: $es-text-primary;
@include text-truncate;
}
// Meta/ref (category, email, etc.)
.preview-item-ref,
.preview-item-meta {
font-size: $es-font-size-xs;
color: $es-text-muted;
@include text-truncate;
}
// Price badge
.preview-item-price {
flex-shrink: 0;
padding: 0.25rem 0.5rem;
font-size: $es-font-size-xs;
font-weight: $es-font-weight-semibold;
color: $es-primary;
background: $es-primary-light;
border-radius: $es-radius-sm;
}
// =============================================================================
// Preview Footer (load more)
// =============================================================================
.preview-footer {
padding: $es-spacing-sm $es-spacing-md;
background: $es-slate-50;
border-top: 1px solid $es-border-color;
}
.preview-more-info {
font-size: $es-font-size-xs;
color: $es-text-muted;
font-weight: $es-font-weight-medium;
text-align: center;
}
}
// Load more controls (select dropdown style)
.load-more-controls {
.load-more-controls {
display: flex;
align-items: center;
justify-content: center;
@@ -166,10 +317,31 @@
}
.load-more-select {
@include input-base;
padding: 0.25rem 0.5rem;
appearance: none;
padding: 0.25rem 1.75rem 0.25rem 0.5rem;
border: 1px solid $es-border-color;
border-radius: $es-radius-sm;
background: $es-white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%23666' d='M0 2l4 4 4-4z'/%3E%3C/svg%3E") no-repeat right 0.5rem center;
background-size: 8px;
font-size: $es-font-size-xs;
min-width: 70px;
font-weight: $es-font-weight-medium;
color: $es-primary;
cursor: pointer;
transition: all $es-transition-fast;
height: auto;
min-height: 0;
line-height: 1.3;
&:hover {
border-color: $es-primary;
background-color: $es-primary-light;
}
&:focus {
outline: none;
border-color: $es-primary;
box-shadow: 0 0 0 2px rgba($es-primary, 0.1);
}
}
.load-more-of {
@@ -189,7 +361,7 @@
margin: 0;
border: none;
color: $es-primary;
background: $es-primary-light !important;
background: $es-primary-light;
border-radius: $es-radius-sm;
cursor: pointer;
transition: all $es-transition-fast;
@@ -200,7 +372,7 @@
}
&:hover {
background: rgba($es-primary, 0.2) !important;
background: rgba($es-primary, 0.2);
}
&.loading {
@@ -211,135 +383,12 @@
}
}
}
}
}
// =============================================================================
// Preview List Container
// Preview States
// =============================================================================
// Preview list container
.entity-list-preview {
display: flex;
flex-direction: column;
gap: $es-spacing-xs;
}
// Preview item (list-style with bottom border divider)
.preview-item {
display: flex;
align-items: center;
gap: $es-spacing-sm;
padding: $es-spacing-sm 0;
background: $es-white;
border: none;
border-bottom: 1px solid $es-border-color;
border-radius: 0;
transition: background $es-transition-fast;
&:last-child {
border-bottom: none;
}
&:hover {
background: $es-bg-hover;
}
}
.preview-item-image {
flex-shrink: 0;
width: 36px;
height: 36px;
object-fit: cover;
border-radius: $es-radius-sm;
background: $es-slate-100;
}
.preview-item-icon {
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 36px;
height: 36px;
background: $es-slate-100;
color: $es-text-muted;
border-radius: $es-radius-sm;
font-size: $es-font-size-base;
}
.preview-item-info {
flex: 1;
min-width: 0;
}
.preview-item-name {
font-size: $es-font-size-sm;
font-weight: $es-font-weight-medium;
color: $es-text-primary;
@include text-truncate;
}
.preview-item-meta {
font-size: $es-font-size-xs;
color: $es-text-muted;
@include text-truncate;
}
.preview-item-badge {
@include badge($es-slate-100, $es-text-muted);
flex-shrink: 0;
}
.preview-item-price {
font-size: $es-font-size-sm;
font-weight: $es-font-weight-semibold;
color: $es-primary;
flex-shrink: 0;
}
// Preview grid layout
.entity-list-preview.grid-layout {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
gap: $es-spacing-sm;
.preview-item {
flex-direction: column;
text-align: center;
padding: $es-spacing-md;
}
.preview-item-image {
width: 60px;
height: 60px;
}
.preview-item-info {
width: 100%;
}
}
// Compact list layout
.entity-list-preview.compact {
gap: 0;
.preview-item {
border-radius: 0;
border-bottom: none;
&:first-child {
border-radius: $es-radius-md $es-radius-md 0 0;
}
&:last-child {
border-radius: 0 0 $es-radius-md $es-radius-md;
border-bottom: 1px solid $es-border-color;
}
}
}
// Preview empty state
.preview-empty {
display: flex;
flex-direction: column;
@@ -361,7 +410,6 @@
}
}
// Preview loading state
.preview-loading {
display: flex;
align-items: center;
@@ -369,133 +417,13 @@
padding: $es-spacing-xl;
color: $es-text-muted;
.spinner {
width: 24px;
height: 24px;
border: 3px solid $es-slate-200;
border-top-color: $es-primary;
border-radius: 50%;
animation: spin 0.8s linear infinite;
i {
font-size: 20px;
color: $es-primary;
animation: spin 0.6s linear infinite;
}
}
// Preview pagination
.preview-pagination {
display: flex;
align-items: center;
justify-content: center;
gap: $es-spacing-xs;
padding: $es-spacing-md 0;
}
.preview-page-btn {
@include button-reset;
display: flex;
align-items: center;
justify-content: center;
min-width: 28px;
height: 28px;
padding: 0 $es-spacing-sm;
font-size: $es-font-size-xs;
font-weight: $es-font-weight-medium;
color: $es-text-secondary;
background: $es-white;
border: 1px solid $es-border-color;
border-radius: $es-radius-sm;
transition: all $es-transition-fast;
&:hover:not(:disabled) {
background: $es-bg-hover;
border-color: $es-slate-300;
}
&.active {
background: $es-primary;
border-color: $es-primary;
color: $es-white;
}
&:disabled {
opacity: 0.5;
cursor: not-allowed;
}
}
// Preview summary
.preview-summary {
display: flex;
align-items: center;
justify-content: space-between;
padding: $es-spacing-sm $es-spacing-md;
background: $es-bg-header;
border-top: 1px solid $es-border-color;
font-size: $es-font-size-xs;
color: $es-text-muted;
}
.preview-count {
font-weight: $es-font-weight-medium;
strong {
color: $es-text-primary;
}
}
// Preview filters in modal
.preview-filters {
display: flex;
flex-wrap: wrap;
gap: $es-spacing-sm;
padding: $es-spacing-sm $es-spacing-md;
background: $es-slate-50;
border-bottom: 1px solid $es-border-color;
}
.preview-filter-chip {
@include chip;
}
.preview-search {
@include input-base;
flex: 1;
min-width: 150px;
padding: 0.375rem $es-spacing-sm;
font-size: $es-font-size-xs;
}
// Scrollable preview list
.preview-list-scrollable {
max-height: 400px;
overflow-y: auto;
@include custom-scrollbar;
}
// Mini preview (inline)
.entity-mini-preview {
display: inline-flex;
align-items: center;
gap: 0.375rem;
padding: 0.25rem 0.5rem;
background: $es-slate-50;
border-radius: $es-radius-sm;
font-size: $es-font-size-xs;
img {
width: 16px;
height: 16px;
object-fit: cover;
border-radius: 2px;
}
.mini-preview-name {
color: $es-text-primary;
font-weight: $es-font-weight-medium;
@include text-truncate;
max-width: 100px;
}
}
// =============================================================================
// Total Summary Popover (header total badge click)
// =============================================================================

View File

@@ -16,6 +16,7 @@
// Components
@use 'components/entity-selector';
@use 'components/entity-item'; // Shared base for chips and list items
@use 'components/dropdown';
@use 'components/chips';
@use 'components/groups';