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:
@@ -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
Reference in New Issue
Block a user