Initial commit: prestashop-entity-selector
Forked from prestashop-target-conditions Renamed all references from target-conditions to entity-selector
This commit is contained in:
1
assets/css/admin/condition-traits.css
Normal file
1
assets/css/admin/condition-traits.css
Normal file
File diff suppressed because one or more lines are too long
588
assets/css/admin/entity-list-preview.css
Executable file
588
assets/css/admin/entity-list-preview.css
Executable file
@@ -0,0 +1,588 @@
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
6282
assets/css/admin/entity-selector.css
Normal file
6282
assets/css/admin/entity-selector.css
Normal file
File diff suppressed because it is too large
Load Diff
184
assets/css/admin/mpr-modal.css
Executable file
184
assets/css/admin/mpr-modal.css
Executable file
@@ -0,0 +1,184 @@
|
||||
/**
|
||||
* MPR Search Revolution - Universal Modal Styles
|
||||
* All admin modals use .mpr-sr-admin-modal class
|
||||
* Works on both Symfony pages (.show) and Legacy pages (.in)
|
||||
*/
|
||||
|
||||
.mpr-sr-admin-modal.show,
|
||||
.mpr-sr-admin-modal.in {
|
||||
display: flex !important;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal.show .modal-dialog,
|
||||
.mpr-sr-admin-modal.in .modal-dialog {
|
||||
transform: none !important;
|
||||
top: auto !important;
|
||||
margin: 0 auto !important;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-dialog {
|
||||
max-width: 480px;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-content {
|
||||
padding: 1.25rem;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-header,
|
||||
.mpr-sr-admin-modal .modal-body,
|
||||
.mpr-sr-admin-modal .modal-footer {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-header {
|
||||
margin-bottom: 1rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-header .modal-title {
|
||||
font-size: 1.125rem;
|
||||
font-weight: 600;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-header .modal-title i {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-header .close,
|
||||
.mpr-sr-admin-modal .modal-header .mpr-close-modal {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0;
|
||||
margin-left: auto;
|
||||
padding: 5px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: opacity 0.2s;
|
||||
line-height: 1;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-header .close:hover,
|
||||
.mpr-sr-admin-modal .modal-header .mpr-close-modal:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-body {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-body .body-title {
|
||||
font-size: 0.875rem;
|
||||
color: #6b7280;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-body .modal-amount {
|
||||
font-size: 2.5rem;
|
||||
font-weight: 600;
|
||||
margin-bottom: 1.25rem;
|
||||
color: #dc2626;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-body .tables-table {
|
||||
margin-bottom: 1rem;
|
||||
font-size: 0.875rem;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-body .tables-table thead th {
|
||||
background: #f8fafc;
|
||||
font-weight: 600;
|
||||
font-size: 0.75rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.025em;
|
||||
color: #64748b;
|
||||
padding: 0.5rem 0.75rem;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-body .tables-table tbody td {
|
||||
padding: 0.5rem 0.75rem;
|
||||
vertical-align: middle;
|
||||
border-color: #f1f5f9;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-footer {
|
||||
display: flex;
|
||||
padding-top: 1rem;
|
||||
gap: 0.75rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-footer .btn {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.625rem 1rem;
|
||||
font-weight: 500;
|
||||
border-radius: 6px;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-footer .btn i {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-footer .cancel-btn,
|
||||
.mpr-sr-admin-modal .modal-footer .btn-secondary {
|
||||
background: #f1f5f9;
|
||||
border: 1px solid #e2e8f0;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-footer .cancel-btn:hover,
|
||||
.mpr-sr-admin-modal .modal-footer .btn-secondary:hover {
|
||||
background: #e2e8f0;
|
||||
color: #475569;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-footer .confirm-btn,
|
||||
.mpr-sr-admin-modal .modal-footer .btn-primary {
|
||||
border: none;
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, #337ab7 0%, #286090 100%);
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-footer .confirm-btn:hover:not(:disabled),
|
||||
.mpr-sr-admin-modal .modal-footer .btn-primary:hover:not(:disabled) {
|
||||
transform: translateY(-1px);
|
||||
background: linear-gradient(135deg, #286090 0%, #204d74 100%);
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-footer .confirm-btn:disabled,
|
||||
.mpr-sr-admin-modal .modal-footer .btn-primary:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-footer .btn-danger {
|
||||
background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
|
||||
border: none;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.mpr-sr-admin-modal .modal-footer .btn-danger:hover:not(:disabled) {
|
||||
background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
5726
assets/css/admin/tailwind-input.css
Normal file
5726
assets/css/admin/tailwind-input.css
Normal file
File diff suppressed because it is too large
Load Diff
1
assets/css/admin/tailwind-output.css
Executable file
1
assets/css/admin/tailwind-output.css
Executable file
File diff suppressed because one or more lines are too long
1149
assets/js/admin/entity-list-preview.js
Executable file
1149
assets/js/admin/entity-list-preview.js
Executable file
File diff suppressed because it is too large
Load Diff
7951
assets/js/admin/entity-selector.js
Normal file
7951
assets/js/admin/entity-selector.js
Normal file
File diff suppressed because it is too large
Load Diff
515
assets/js/admin/modal.js
Executable file
515
assets/js/admin/modal.js
Executable file
@@ -0,0 +1,515 @@
|
||||
/**
|
||||
* MPR Express Checkout - Standardized Modal Helper
|
||||
*
|
||||
* Provides a consistent API for managing modals across the module.
|
||||
*
|
||||
* Usage:
|
||||
* const modal = new MPRModal('my-modal-id');
|
||||
* modal.show();
|
||||
* modal.setHeader('success', 'icon-check', 'Operation Complete');
|
||||
* modal.setBody('<p>Content here</p>');
|
||||
* modal.setFooter([
|
||||
* { type: 'cancel', label: 'Close' },
|
||||
* { type: 'primary', label: 'Continue', icon: 'arrow-right', onClick: () => {} }
|
||||
* ]);
|
||||
*/
|
||||
|
||||
class MPRModal {
|
||||
/**
|
||||
* @param {string} modalId - The modal element ID (without #)
|
||||
* @param {Object} options - Configuration options
|
||||
* @param {Function} options.onShow - Callback when modal is shown
|
||||
* @param {Function} options.onHide - Callback when modal is hidden
|
||||
* @param {Function} options.onCancel - Callback when cancel/close is clicked
|
||||
*/
|
||||
constructor(modalId, options = {}) {
|
||||
this.modalId = modalId;
|
||||
this.$modal = $(`#${modalId}`);
|
||||
this.$header = this.$modal.find('.mpr-modal-header');
|
||||
this.$title = this.$modal.find('.mpr-modal-title');
|
||||
this.$titleText = this.$modal.find('.mpr-modal-title-text');
|
||||
this.$titleIcon = this.$modal.find('.mpr-modal-icon');
|
||||
this.$body = this.$modal.find('.mpr-modal-body');
|
||||
this.$footer = this.$modal.find('.mpr-modal-footer');
|
||||
this.options = options;
|
||||
this.currentView = null;
|
||||
|
||||
this._bindEvents();
|
||||
}
|
||||
|
||||
/**
|
||||
* Bind modal events
|
||||
*/
|
||||
_bindEvents() {
|
||||
this.$modal.on('shown.bs.modal', () => {
|
||||
if (typeof this.options.onShow === 'function') {
|
||||
this.options.onShow();
|
||||
}
|
||||
});
|
||||
|
||||
this.$modal.on('hidden.bs.modal', () => {
|
||||
if (typeof this.options.onHide === 'function') {
|
||||
this.options.onHide();
|
||||
}
|
||||
});
|
||||
|
||||
this.$modal.on('click', '[data-dismiss="modal"]', () => {
|
||||
if (typeof this.options.onCancel === 'function') {
|
||||
this.options.onCancel();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the modal
|
||||
* @param {Object} options - Bootstrap modal options
|
||||
*/
|
||||
show(options = {}) {
|
||||
if (this.$modal.length === 0) {
|
||||
console.error('[MPRModal] Modal element not found');
|
||||
return;
|
||||
}
|
||||
|
||||
this.$modal.modal({
|
||||
backdrop: options.static ? 'static' : true,
|
||||
keyboard: !options.static,
|
||||
...options
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide the modal
|
||||
*/
|
||||
hide() {
|
||||
this.$modal.modal('hide');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set header appearance
|
||||
* @param {string} type - Header type: default, primary, success, warning, danger, dark
|
||||
* @param {string} icon - Icon class without prefix (e.g., 'shield' for icon-shield)
|
||||
* @param {string} title - Title text
|
||||
*/
|
||||
setHeader(type, icon, title) {
|
||||
// Remove all header type classes
|
||||
this.$header.removeClass(
|
||||
'mpr-modal-header-default mpr-modal-header-primary mpr-modal-header-success ' +
|
||||
'mpr-modal-header-warning mpr-modal-header-danger mpr-modal-header-dark'
|
||||
);
|
||||
this.$header.addClass(`mpr-modal-header-${type}`);
|
||||
|
||||
if (icon) {
|
||||
if (this.$titleIcon.length) {
|
||||
this.$titleIcon.attr('class', `mpr-icon icon-${icon} mpr-modal-icon`);
|
||||
} else {
|
||||
this.$title.prepend(`<i class="mpr-icon icon-${icon} mpr-modal-icon"></i>`);
|
||||
this.$titleIcon = this.$modal.find('.mpr-modal-icon');
|
||||
}
|
||||
}
|
||||
|
||||
if (title !== undefined) {
|
||||
this.$titleText.text(title);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set only the header type/color
|
||||
* @param {string} type - Header type: default, primary, success, warning, danger, dark
|
||||
*/
|
||||
setHeaderType(type) {
|
||||
this.$header.removeClass(
|
||||
'mpr-modal-header-default mpr-modal-header-primary mpr-modal-header-success ' +
|
||||
'mpr-modal-header-warning mpr-modal-header-danger mpr-modal-header-dark'
|
||||
);
|
||||
this.$header.addClass(`mpr-modal-header-${type}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the header title
|
||||
* @param {string} title - Title text
|
||||
*/
|
||||
setTitle(title) {
|
||||
this.$titleText.text(title);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the header icon
|
||||
* @param {string} icon - Icon class without prefix
|
||||
*/
|
||||
setIcon(icon) {
|
||||
if (this.$titleIcon.length) {
|
||||
this.$titleIcon.attr('class', `icon-${icon} mpr-modal-icon`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set modal size
|
||||
* @param {string} size - Size: sm, md, lg, xl, fullwidth
|
||||
*/
|
||||
setSize(size) {
|
||||
const $dialog = this.$modal.find('.modal-dialog');
|
||||
$dialog.removeClass('modal-sm modal-lg modal-xl modal-fullwidth');
|
||||
if (size === 'sm') {
|
||||
$dialog.addClass('modal-sm');
|
||||
} else if (size === 'lg') {
|
||||
$dialog.addClass('modal-lg');
|
||||
} else if (size === 'xl') {
|
||||
$dialog.addClass('modal-xl');
|
||||
} else if (size === 'fullwidth') {
|
||||
$dialog.addClass('modal-fullwidth');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set body content
|
||||
* @param {string} html - HTML content for the body
|
||||
*/
|
||||
setBody(html) {
|
||||
this.$body.html(html);
|
||||
}
|
||||
|
||||
/**
|
||||
* Append content to body
|
||||
* @param {string} html - HTML content to append
|
||||
*/
|
||||
appendBody(html) {
|
||||
this.$body.append(html);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set footer buttons
|
||||
* @param {Array} buttons - Array of button configurations
|
||||
* Each button: { type, label, icon, id, onClick, disabled, className, size }
|
||||
* type: 'cancel', 'primary', 'success', 'warning', 'danger', 'default', 'dark',
|
||||
* 'outline-primary', 'outline-danger', 'ghost'
|
||||
* size: 'sm', 'lg' (optional)
|
||||
*/
|
||||
setFooter(buttons) {
|
||||
this.$footer.empty();
|
||||
|
||||
buttons.forEach(btn => {
|
||||
const btnType = btn.type === 'cancel' ? 'default' : btn.type;
|
||||
let btnClass = `mpr-btn mpr-btn-${btnType}`;
|
||||
|
||||
if (btn.size) {
|
||||
btnClass += ` mpr-btn-${btn.size}`;
|
||||
}
|
||||
if (btn.className) {
|
||||
btnClass += ` ${btn.className}`;
|
||||
}
|
||||
|
||||
const $btn = $('<button>', {
|
||||
type: 'button',
|
||||
class: btnClass,
|
||||
id: btn.id || undefined,
|
||||
disabled: btn.disabled || false
|
||||
});
|
||||
|
||||
if (btn.type === 'cancel' || btn.dismiss) {
|
||||
$btn.attr('data-dismiss', 'modal');
|
||||
}
|
||||
|
||||
// Add icon - cancel buttons get 'close' icon by default if no icon specified
|
||||
const iconName = btn.icon || (btn.type === 'cancel' ? 'close' : null);
|
||||
if (iconName) {
|
||||
$btn.append(`<i class="mpr-icon icon-${iconName}"></i> `);
|
||||
}
|
||||
|
||||
// Support HTML in labels (for inline icons) or plain text
|
||||
if (btn.html) {
|
||||
$btn.append(btn.label);
|
||||
} else {
|
||||
$btn.append(document.createTextNode(btn.label));
|
||||
}
|
||||
|
||||
if (typeof btn.onClick === 'function') {
|
||||
$btn.on('click', btn.onClick);
|
||||
}
|
||||
|
||||
this.$footer.append($btn);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Set button loading state
|
||||
* @param {string} buttonId - Button ID
|
||||
* @param {boolean} loading - Loading state
|
||||
*/
|
||||
setButtonLoading(buttonId, loading) {
|
||||
const $btn = $(`#${buttonId}`);
|
||||
if (loading) {
|
||||
$btn.addClass('mpr-btn-loading').prop('disabled', true);
|
||||
} else {
|
||||
$btn.removeClass('mpr-btn-loading').prop('disabled', false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show footer
|
||||
*/
|
||||
showFooter() {
|
||||
this.$footer.removeClass('hidden');
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide footer
|
||||
*/
|
||||
hideFooter() {
|
||||
this.$footer.addClass('hidden');
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable/disable a footer button by ID
|
||||
* @param {string} buttonId - Button ID
|
||||
* @param {boolean} enabled - Enable or disable
|
||||
*/
|
||||
setButtonEnabled(buttonId, enabled) {
|
||||
$(`#${buttonId}`).prop('disabled', !enabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update button label
|
||||
* @param {string} buttonId - Button ID
|
||||
* @param {string} label - New label
|
||||
* @param {string} icon - Optional new icon
|
||||
*/
|
||||
setButtonLabel(buttonId, label, icon = null) {
|
||||
const $btn = $(`#${buttonId}`);
|
||||
$btn.empty();
|
||||
if (icon) {
|
||||
$btn.append(`<i class="mpr-icon icon-${icon}"></i> `);
|
||||
}
|
||||
$btn.append(document.createTextNode(label));
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch between views (for multi-step modals)
|
||||
* Views should have class 'mpr-modal-view' and a data-view attribute
|
||||
* @param {string} viewName - The view to show
|
||||
*/
|
||||
showView(viewName) {
|
||||
this.$body.find('.mpr-modal-view').removeClass('active');
|
||||
this.$body.find(`[data-view="${viewName}"]`).addClass('active');
|
||||
this.currentView = viewName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current view name
|
||||
* @returns {string|null}
|
||||
*/
|
||||
getCurrentView() {
|
||||
return this.currentView;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and show a simple confirmation modal
|
||||
* @param {Object} config - Configuration
|
||||
* @param {string} config.type - Header type
|
||||
* @param {string} config.icon - Header icon
|
||||
* @param {string} config.title - Title
|
||||
* @param {string} config.message - Body message (can be HTML)
|
||||
* @param {string} config.confirmLabel - Confirm button label
|
||||
* @param {string} config.confirmType - Confirm button type (primary, danger, etc.)
|
||||
* @param {string} config.cancelLabel - Cancel button label
|
||||
* @param {Function} config.onConfirm - Confirm callback
|
||||
* @param {Function} config.onCancel - Cancel callback
|
||||
*/
|
||||
confirm(config) {
|
||||
this.setHeader(
|
||||
config.type || 'primary',
|
||||
config.icon || 'question',
|
||||
config.title || 'Confirm'
|
||||
);
|
||||
|
||||
this.setBody(`
|
||||
<div class="mpr-modal-center">
|
||||
<p>${config.message}</p>
|
||||
</div>
|
||||
`);
|
||||
|
||||
this.setFooter([
|
||||
{
|
||||
type: 'cancel',
|
||||
label: config.cancelLabel || 'Cancel',
|
||||
onClick: config.onCancel
|
||||
},
|
||||
{
|
||||
type: config.confirmType || 'primary',
|
||||
label: config.confirmLabel || 'Confirm',
|
||||
icon: config.confirmIcon,
|
||||
onClick: () => {
|
||||
if (typeof config.onConfirm === 'function') {
|
||||
config.onConfirm();
|
||||
}
|
||||
if (config.autoClose !== false) {
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
||||
this.show({ static: config.static || false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a progress state
|
||||
* @param {Object} config - Configuration
|
||||
* @param {string} config.title - Progress title
|
||||
* @param {string} config.subtitle - Progress subtitle
|
||||
* @param {number} config.percent - Initial percentage (0-100)
|
||||
*/
|
||||
showProgress(config = {}) {
|
||||
const title = config.title || 'Processing...';
|
||||
const subtitle = config.subtitle || 'Please wait';
|
||||
const percent = config.percent || 0;
|
||||
|
||||
this.setBody(`
|
||||
<div class="mpr-modal-progress">
|
||||
<i class="icon-refresh mpr-modal-progress-icon"></i>
|
||||
<div class="mpr-modal-progress-title">${title}</div>
|
||||
<div class="mpr-modal-progress-subtitle">${subtitle}</div>
|
||||
<div class="mpr-modal-progress-bar-container">
|
||||
<div class="mpr-modal-progress-bar" style="width: ${percent}%"></div>
|
||||
</div>
|
||||
<div class="mpr-modal-progress-percent">${percent}%</div>
|
||||
<div class="mpr-modal-progress-current"></div>
|
||||
</div>
|
||||
`);
|
||||
|
||||
this.hideFooter();
|
||||
this.setHeaderType('primary');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update progress bar
|
||||
* @param {number} percent - Percentage (0-100)
|
||||
* @param {string} currentItem - Current item being processed
|
||||
*/
|
||||
updateProgress(percent, currentItem = '') {
|
||||
this.$body.find('.mpr-modal-progress-bar').css('width', `${percent}%`);
|
||||
this.$body.find('.mpr-modal-progress-percent').text(`${Math.round(percent)}%`);
|
||||
if (currentItem) {
|
||||
this.$body.find('.mpr-modal-progress-current').text(currentItem);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a result state
|
||||
* @param {Object} config - Configuration
|
||||
* @param {string} config.type - Result type: success, warning, danger, info
|
||||
* @param {string} config.icon - Icon (defaults based on type)
|
||||
* @param {string} config.title - Result title
|
||||
* @param {string} config.message - Result message
|
||||
* @param {string} config.closeLabel - Close button label
|
||||
* @param {Function} config.onClose - Close callback
|
||||
*/
|
||||
showResult(config) {
|
||||
const iconMap = {
|
||||
success: 'check-circle',
|
||||
warning: 'warning',
|
||||
danger: 'times-circle',
|
||||
info: 'info-circle'
|
||||
};
|
||||
|
||||
const icon = config.icon || iconMap[config.type] || 'info-circle';
|
||||
|
||||
this.setHeaderType(config.type === 'info' ? 'primary' : config.type);
|
||||
|
||||
this.setBody(`
|
||||
<div class="mpr-modal-result">
|
||||
<i class="icon-${icon} mpr-modal-result-icon result-${config.type}"></i>
|
||||
<div class="mpr-modal-result-title">${config.title}</div>
|
||||
<div class="mpr-modal-result-message">${config.message}</div>
|
||||
</div>
|
||||
`);
|
||||
|
||||
this.setFooter([
|
||||
{
|
||||
type: 'primary',
|
||||
label: config.closeLabel || 'Close',
|
||||
onClick: () => {
|
||||
if (typeof config.onClose === 'function') {
|
||||
config.onClose();
|
||||
}
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
||||
this.showFooter();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock modal (prevent closing)
|
||||
*/
|
||||
lock() {
|
||||
this.$modal.data('bs.modal').options.backdrop = 'static';
|
||||
this.$modal.data('bs.modal').options.keyboard = false;
|
||||
this.$modal.find('.mpr-modal-close').hide();
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlock modal (allow closing)
|
||||
*/
|
||||
unlock() {
|
||||
this.$modal.data('bs.modal').options.backdrop = true;
|
||||
this.$modal.data('bs.modal').options.keyboard = true;
|
||||
this.$modal.find('.mpr-modal-close').show();
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy the modal instance
|
||||
*/
|
||||
destroy() {
|
||||
this.$modal.modal('dispose');
|
||||
this.$modal.off();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Factory function to create modals dynamically
|
||||
* Creates the modal HTML and appends it to the body
|
||||
*
|
||||
* @param {Object} config - Modal configuration
|
||||
* @param {string} config.id - Modal ID
|
||||
* @param {string} config.size - Modal size: sm, md, lg, xl
|
||||
* @param {boolean} config.static - Static backdrop
|
||||
* @returns {MPRModal}
|
||||
*/
|
||||
MPRModal.create = function(config) {
|
||||
const id = config.id || 'mpr-modal-' + Date.now();
|
||||
const sizeClass = config.size === 'sm' ? 'modal-sm' :
|
||||
config.size === 'lg' ? 'modal-lg' :
|
||||
config.size === 'xl' ? 'modal-xl' :
|
||||
config.size === 'fullwidth' ? 'modal-fullwidth' : '';
|
||||
|
||||
const html = `
|
||||
<div class="modal fade mpr-modal" id="${id}" tabindex="-1" role="dialog"
|
||||
${config.static ? 'data-backdrop="static" data-keyboard="false"' : ''}>
|
||||
<div class="modal-dialog ${sizeClass}" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header mpr-modal-header mpr-modal-header-primary">
|
||||
<h5 class="modal-title mpr-modal-title">
|
||||
<i class="mpr-modal-icon"></i>
|
||||
<span class="mpr-modal-title-text"></span>
|
||||
</h5>
|
||||
<button type="button" class="close mpr-modal-close" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body mpr-modal-body"></div>
|
||||
<div class="modal-footer mpr-modal-footer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
$('body').append(html);
|
||||
|
||||
return new MPRModal(id, config);
|
||||
};
|
||||
|
||||
// Export for module systems if available
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
module.exports = MPRModal;
|
||||
}
|
||||
1100
assets/js/admin/schedule-conditions.js
Executable file
1100
assets/js/admin/schedule-conditions.js
Executable file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user