ngx-core-components 0.3.4 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/feedback/avatar/avatar.component.d.ts +37 -0
- package/feedback/countdown/countdown.component.d.ts +46 -0
- package/feedback/empty-state/empty-state.component.d.ts +14 -0
- package/feedback/public-api.d.ts +7 -0
- package/feedback/stat-card/stat-card.component.d.ts +18 -0
- package/fesm2022/ngx-core-components-feedback.mjs +789 -5
- package/fesm2022/ngx-core-components-feedback.mjs.map +1 -1
- package/fesm2022/ngx-core-components-inputs.mjs +611 -3
- package/fesm2022/ngx-core-components-inputs.mjs.map +1 -1
- package/fesm2022/ngx-core-components-layout.mjs +930 -2
- package/fesm2022/ngx-core-components-layout.mjs.map +1 -1
- package/fesm2022/ngx-core-components-navigation.mjs +162 -2
- package/fesm2022/ngx-core-components-navigation.mjs.map +1 -1
- package/fesm2022/ngx-core-components-views.mjs +1120 -2
- package/fesm2022/ngx-core-components-views.mjs.map +1 -1
- package/fesm2022/ngx-core-components.mjs +5 -5
- package/fesm2022/ngx-core-components.mjs.map +1 -1
- package/inputs/file-preview/file-preview.component.d.ts +61 -0
- package/inputs/public-api.d.ts +5 -0
- package/inputs/segmented-control/segmented-control.component.d.ts +20 -0
- package/inputs/tag-input/tag-input.component.d.ts +25 -0
- package/layout/carousel/carousel.component.d.ts +39 -0
- package/layout/dashboard-layout/dashboard-layout.component.d.ts +43 -0
- package/layout/dashboard-layout/models.d.ts +26 -0
- package/layout/drawer/drawer.component.d.ts +21 -0
- package/layout/public-api.d.ts +4 -0
- package/navigation/back-to-top/back-to-top.component.d.ts +15 -0
- package/navigation/public-api.d.ts +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +14 -6
- package/views/image-compare/image-compare.component.d.ts +26 -0
- package/views/key-value-list/key-value-list.component.d.ts +36 -0
- package/views/public-api.d.ts +7 -0
- package/views/scheduler/models.d.ts +18 -0
- package/views/scheduler/scheduler.component.d.ts +36 -0
- package/views/virtual-list/virtual-list.component.d.ts +42 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, computed, Component, signal, contentChildren, effect } from '@angular/core';
|
|
2
|
+
import { input, output, computed, Component, signal, contentChildren, effect, ChangeDetectionStrategy, untracked, model, HostListener } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
3
4
|
import { CommonModule } from '@angular/common';
|
|
4
5
|
|
|
5
6
|
class CardComponent {
|
|
@@ -445,6 +446,933 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
445
446
|
`, styles: [":host{display:flex;flex:1 1 auto;min-height:0}.ngx-splitter{display:flex;flex:1;overflow:hidden}.ngx-splitter.splitter-vertical{flex-direction:column}.split-pane{overflow:auto;min-width:0;min-height:0}.split-divider{flex:0 0 5px;background:var(--ngx-splitter-divider, #dee2e6);cursor:col-resize;display:flex;align-items:center;justify-content:center;transition:background .1s;position:relative}.splitter-vertical .split-divider{cursor:row-resize;height:5px;flex:0 0 5px}.split-divider:hover,.split-divider.dragging{background:var(--ngx-splitter-divider-hover, #1a73e8)}.split-divider-grip{width:3px;height:20px;background:#ffffff80;border-radius:2px}.splitter-vertical .split-divider-grip{width:20px;height:3px}\n"] }]
|
|
446
447
|
}], ctorParameters: () => [] });
|
|
447
448
|
|
|
449
|
+
class DashboardLayoutComponent {
|
|
450
|
+
// Inputs
|
|
451
|
+
items = input([]);
|
|
452
|
+
columns = input(12);
|
|
453
|
+
rowHeight = input('150px');
|
|
454
|
+
theme = input('light');
|
|
455
|
+
allowDragging = input(true);
|
|
456
|
+
allowResizing = input(true);
|
|
457
|
+
// Outputs
|
|
458
|
+
layoutChange = output();
|
|
459
|
+
panelAction = output();
|
|
460
|
+
// State Signals
|
|
461
|
+
itemsState = signal([]);
|
|
462
|
+
isDragging = signal(false);
|
|
463
|
+
activeDraggingId = signal(null);
|
|
464
|
+
dragPlaceholder = signal(null);
|
|
465
|
+
constructor() {
|
|
466
|
+
effect(() => {
|
|
467
|
+
this.itemsState.set(this.items());
|
|
468
|
+
}, { allowSignalWrites: true });
|
|
469
|
+
}
|
|
470
|
+
// Detect if any panel is currently maximized
|
|
471
|
+
hasMaximizedPanel = computed(() => {
|
|
472
|
+
return this.itemsState().some(it => it.maximized);
|
|
473
|
+
});
|
|
474
|
+
// Calculate dynamic rows needed in background grid
|
|
475
|
+
maxRows = computed(() => {
|
|
476
|
+
let max = 6;
|
|
477
|
+
for (const item of this.itemsState()) {
|
|
478
|
+
if (!item.maximized) {
|
|
479
|
+
const bottom = item.row + item.rowSpan;
|
|
480
|
+
if (bottom > max) {
|
|
481
|
+
max = bottom;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
return max + 2; // Always keep 2 empty grid rows buffer space
|
|
486
|
+
});
|
|
487
|
+
// Generate grid mapping cells
|
|
488
|
+
bgCells = computed(() => {
|
|
489
|
+
const cols = this.columns();
|
|
490
|
+
const rows = this.maxRows();
|
|
491
|
+
const cells = [];
|
|
492
|
+
for (let r = 0; r < rows; r++) {
|
|
493
|
+
for (let c = 0; c < cols; c++) {
|
|
494
|
+
cells.push({ key: `${r}-${c}`, col: c, row: r });
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
return cells;
|
|
498
|
+
});
|
|
499
|
+
// Helper colors mapping
|
|
500
|
+
getCategoryColor(cat) {
|
|
501
|
+
if (!cat)
|
|
502
|
+
return '#6366f1';
|
|
503
|
+
switch (cat.toLowerCase()) {
|
|
504
|
+
case 'chart': return '#3b82f6'; // Blue
|
|
505
|
+
case 'data': return '#10b981'; // Green
|
|
506
|
+
case 'feed': return '#f59e0b'; // Amber
|
|
507
|
+
case 'metric': return '#ec4899'; // Pink
|
|
508
|
+
case 'alert': return '#ef4444'; // Red
|
|
509
|
+
default: return '#8b5cf6'; // Violet
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
// Native HTML5 Drag events
|
|
513
|
+
onDragStart(event, item) {
|
|
514
|
+
if (!this.allowDragging() || item.draggable === false || item.maximized || item.collapsed)
|
|
515
|
+
return;
|
|
516
|
+
this.activeDraggingId.set(item.id);
|
|
517
|
+
this.isDragging.set(true);
|
|
518
|
+
if (event.dataTransfer) {
|
|
519
|
+
event.dataTransfer.setData('text/plain', item.id);
|
|
520
|
+
event.dataTransfer.effectAllowed = 'move';
|
|
521
|
+
}
|
|
522
|
+
// Set initial placeholder
|
|
523
|
+
this.dragPlaceholder.set({
|
|
524
|
+
col: item.col,
|
|
525
|
+
row: item.row,
|
|
526
|
+
colSpan: item.colSpan,
|
|
527
|
+
rowSpan: item.rowSpan
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
onDragEnd() {
|
|
531
|
+
this.isDragging.set(false);
|
|
532
|
+
this.activeDraggingId.set(null);
|
|
533
|
+
this.dragPlaceholder.set(null);
|
|
534
|
+
}
|
|
535
|
+
onDragOverGrid(event) {
|
|
536
|
+
event.preventDefault();
|
|
537
|
+
}
|
|
538
|
+
onDragOverCell(event) {
|
|
539
|
+
event.preventDefault();
|
|
540
|
+
}
|
|
541
|
+
onDragEnterCell(event, col, row) {
|
|
542
|
+
event.preventDefault();
|
|
543
|
+
const draggedId = this.activeDraggingId();
|
|
544
|
+
if (!draggedId)
|
|
545
|
+
return;
|
|
546
|
+
const items = this.itemsState();
|
|
547
|
+
const item = items.find(it => it.id === draggedId);
|
|
548
|
+
if (!item)
|
|
549
|
+
return;
|
|
550
|
+
// Calculate snapped coordinates based on boundaries
|
|
551
|
+
let targetCol = Math.max(0, Math.min(this.columns() - item.colSpan, col));
|
|
552
|
+
let targetRow = Math.max(0, row);
|
|
553
|
+
// Update placeholder
|
|
554
|
+
this.dragPlaceholder.set({
|
|
555
|
+
col: targetCol,
|
|
556
|
+
row: targetRow,
|
|
557
|
+
colSpan: item.colSpan,
|
|
558
|
+
rowSpan: item.rowSpan
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
onDrop(event) {
|
|
562
|
+
event.preventDefault();
|
|
563
|
+
const placeholder = this.dragPlaceholder();
|
|
564
|
+
const draggedId = this.activeDraggingId();
|
|
565
|
+
if (placeholder && draggedId) {
|
|
566
|
+
this.itemsState.update(items => {
|
|
567
|
+
return items.map(it => {
|
|
568
|
+
if (it.id === draggedId) {
|
|
569
|
+
return {
|
|
570
|
+
...it,
|
|
571
|
+
col: placeholder.col,
|
|
572
|
+
row: placeholder.row
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
return it;
|
|
576
|
+
});
|
|
577
|
+
});
|
|
578
|
+
this.layoutChange.emit({ items: this.itemsState() });
|
|
579
|
+
}
|
|
580
|
+
this.onDragEnd();
|
|
581
|
+
}
|
|
582
|
+
// Panel resizing handler
|
|
583
|
+
onResizeStart(event, item) {
|
|
584
|
+
event.preventDefault();
|
|
585
|
+
event.stopPropagation();
|
|
586
|
+
if (!this.allowResizing() || item.resizable === false || item.maximized || item.collapsed)
|
|
587
|
+
return;
|
|
588
|
+
const startX = event.pageX;
|
|
589
|
+
const startY = event.pageY;
|
|
590
|
+
const startColSpan = item.colSpan;
|
|
591
|
+
const startRowSpan = item.rowSpan;
|
|
592
|
+
// Find the enclosing element bounding boxes
|
|
593
|
+
const panelEl = event.target.closest('.dashboard-panel-card');
|
|
594
|
+
if (!panelEl)
|
|
595
|
+
return;
|
|
596
|
+
const startWidth = panelEl.clientWidth;
|
|
597
|
+
const startHeight = panelEl.clientHeight;
|
|
598
|
+
// Calculate approximate cell bounds
|
|
599
|
+
const colWidth = startWidth / startColSpan;
|
|
600
|
+
const rowHeight = startHeight / startRowSpan;
|
|
601
|
+
const onMouseMove = (moveEvent) => {
|
|
602
|
+
const deltaX = moveEvent.pageX - startX;
|
|
603
|
+
const deltaY = moveEvent.pageY - startY;
|
|
604
|
+
let newColSpan = Math.round((startWidth + deltaX) / colWidth);
|
|
605
|
+
newColSpan = Math.max(item.minColSpan || 1, Math.min(this.columns() - item.col, newColSpan));
|
|
606
|
+
if (item.maxColSpan) {
|
|
607
|
+
newColSpan = Math.min(item.maxColSpan, newColSpan);
|
|
608
|
+
}
|
|
609
|
+
let newRowSpan = Math.round((startHeight + deltaY) / rowHeight);
|
|
610
|
+
newRowSpan = Math.max(item.minRowSpan || 1, newRowSpan);
|
|
611
|
+
if (item.maxRowSpan) {
|
|
612
|
+
newRowSpan = Math.min(item.maxRowSpan, newRowSpan);
|
|
613
|
+
}
|
|
614
|
+
if (newColSpan !== item.colSpan || newRowSpan !== item.rowSpan) {
|
|
615
|
+
this.itemsState.update(items => {
|
|
616
|
+
return items.map(it => {
|
|
617
|
+
if (it.id === item.id) {
|
|
618
|
+
return { ...it, colSpan: newColSpan, rowSpan: newRowSpan };
|
|
619
|
+
}
|
|
620
|
+
return it;
|
|
621
|
+
});
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
const onMouseUp = () => {
|
|
626
|
+
document.removeEventListener('mousemove', onMouseMove);
|
|
627
|
+
document.removeEventListener('mouseup', onMouseUp);
|
|
628
|
+
this.layoutChange.emit({ items: this.itemsState() });
|
|
629
|
+
};
|
|
630
|
+
document.addEventListener('mousemove', onMouseMove);
|
|
631
|
+
document.addEventListener('mouseup', onMouseUp);
|
|
632
|
+
}
|
|
633
|
+
// Panel Control Actions
|
|
634
|
+
toggleCollapse(item) {
|
|
635
|
+
const collapsed = !item.collapsed;
|
|
636
|
+
this.itemsState.update(items => {
|
|
637
|
+
return items.map(it => {
|
|
638
|
+
if (it.id === item.id) {
|
|
639
|
+
return { ...it, collapsed };
|
|
640
|
+
}
|
|
641
|
+
return it;
|
|
642
|
+
});
|
|
643
|
+
});
|
|
644
|
+
this.panelAction.emit({
|
|
645
|
+
panelId: item.id,
|
|
646
|
+
action: collapsed ? 'minimize' : 'restore',
|
|
647
|
+
item: { ...item, collapsed }
|
|
648
|
+
});
|
|
649
|
+
this.layoutChange.emit({ items: this.itemsState() });
|
|
650
|
+
}
|
|
651
|
+
toggleMaximize(item) {
|
|
652
|
+
const maximized = !item.maximized;
|
|
653
|
+
this.itemsState.update(items => {
|
|
654
|
+
return items.map(it => {
|
|
655
|
+
if (it.id === item.id) {
|
|
656
|
+
return { ...it, maximized };
|
|
657
|
+
}
|
|
658
|
+
return it;
|
|
659
|
+
});
|
|
660
|
+
});
|
|
661
|
+
this.panelAction.emit({
|
|
662
|
+
panelId: item.id,
|
|
663
|
+
action: maximized ? 'maximize' : 'restore',
|
|
664
|
+
item: { ...item, maximized }
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
closePanel(item) {
|
|
668
|
+
this.itemsState.update(items => items.filter(it => it.id !== item.id));
|
|
669
|
+
this.panelAction.emit({
|
|
670
|
+
panelId: item.id,
|
|
671
|
+
action: 'close',
|
|
672
|
+
item
|
|
673
|
+
});
|
|
674
|
+
this.layoutChange.emit({ items: this.itemsState() });
|
|
675
|
+
}
|
|
676
|
+
emitPanelAction(item, action) {
|
|
677
|
+
this.panelAction.emit({
|
|
678
|
+
panelId: item.id,
|
|
679
|
+
action,
|
|
680
|
+
item
|
|
681
|
+
});
|
|
682
|
+
}
|
|
683
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DashboardLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
684
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: DashboardLayoutComponent, isStandalone: true, selector: "ngx-dashboard-layout", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, rowHeight: { classPropertyName: "rowHeight", publicName: "rowHeight", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, allowDragging: { classPropertyName: "allowDragging", publicName: "allowDragging", isSignal: true, isRequired: false, transformFunction: null }, allowResizing: { classPropertyName: "allowResizing", publicName: "allowResizing", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { layoutChange: "layoutChange", panelAction: "panelAction" }, ngImport: i0, template: `
|
|
685
|
+
<div
|
|
686
|
+
class="ngx-dashboard-wrapper"
|
|
687
|
+
[class.dark]="theme() === 'dark'"
|
|
688
|
+
[class.has-maximized]="hasMaximizedPanel()"
|
|
689
|
+
>
|
|
690
|
+
<div
|
|
691
|
+
class="ngx-dashboard-grid"
|
|
692
|
+
[style.grid-template-columns]="'repeat(' + columns() + ', 1fr)'"
|
|
693
|
+
[style.grid-auto-rows]="rowHeight()"
|
|
694
|
+
(dragover)="onDragOverGrid($event)"
|
|
695
|
+
(drop)="onDrop($event)"
|
|
696
|
+
>
|
|
697
|
+
<!-- Background grid cells for drop snapping guide -->
|
|
698
|
+
@if (isDragging()) {
|
|
699
|
+
<div class="grid-background-overlay">
|
|
700
|
+
@for (cell of bgCells(); track cell.key) {
|
|
701
|
+
<div
|
|
702
|
+
class="bg-cell-target"
|
|
703
|
+
[style.grid-column-start]="cell.col + 1"
|
|
704
|
+
[style.grid-row-start]="cell.row + 1"
|
|
705
|
+
(dragover)="onDragOverCell($event)"
|
|
706
|
+
(dragenter)="onDragEnterCell($event, cell.col, cell.row)"
|
|
707
|
+
></div>
|
|
708
|
+
}
|
|
709
|
+
</div>
|
|
710
|
+
|
|
711
|
+
<!-- Drop Position Placeholder -->
|
|
712
|
+
@if (dragPlaceholder(); as placeholder) {
|
|
713
|
+
<div
|
|
714
|
+
class="drag-placeholder-indicator"
|
|
715
|
+
[style.grid-column-start]="placeholder.col + 1"
|
|
716
|
+
[style.grid-column-end]="placeholder.col + 1 + placeholder.colSpan"
|
|
717
|
+
[style.grid-row-start]="placeholder.row + 1"
|
|
718
|
+
[style.grid-row-end]="placeholder.row + 1 + placeholder.rowSpan"
|
|
719
|
+
>
|
|
720
|
+
<div class="placeholder-inner"></div>
|
|
721
|
+
</div>
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
<!-- Active Dashboard Cards -->
|
|
726
|
+
@for (item of itemsState(); track item.id) {
|
|
727
|
+
<div
|
|
728
|
+
class="dashboard-panel-card"
|
|
729
|
+
[class.maximized]="item.maximized"
|
|
730
|
+
[class.collapsed]="item.collapsed"
|
|
731
|
+
[class.dragging-active]="activeDraggingId() === item.id"
|
|
732
|
+
[style.grid-column-start]="item.maximized ? 1 : item.col + 1"
|
|
733
|
+
[style.grid-column-end]="item.maximized ? columns() + 1 : item.col + 1 + item.colSpan"
|
|
734
|
+
[style.grid-row-start]="item.maximized ? 1 : item.row + 1"
|
|
735
|
+
[style.grid-row-end]="item.maximized ? 'span 4' : item.row + 1 + item.rowSpan"
|
|
736
|
+
[attr.draggable]="(allowDragging() && item.draggable !== false && !item.maximized && !item.collapsed) ? 'true' : 'false'"
|
|
737
|
+
(dragstart)="onDragStart($event, item)"
|
|
738
|
+
(dragend)="onDragEnd()"
|
|
739
|
+
>
|
|
740
|
+
<!-- Panel Header -->
|
|
741
|
+
<div
|
|
742
|
+
class="panel-header"
|
|
743
|
+
[class.draggable-handle]="allowDragging() && item.draggable !== false && !item.maximized && !item.collapsed"
|
|
744
|
+
>
|
|
745
|
+
<div class="panel-title-group">
|
|
746
|
+
<span class="panel-icon-dot" [style.background-color]="getCategoryColor(item.category)"></span>
|
|
747
|
+
<span class="panel-title" [title]="item.title">{{ item.title }}</span>
|
|
748
|
+
</div>
|
|
749
|
+
|
|
750
|
+
<div class="panel-actions" (click)="$event.stopPropagation()">
|
|
751
|
+
<!-- Settings Action -->
|
|
752
|
+
<button class="action-btn" (click)="emitPanelAction(item, 'settings')" title="Panel Settings">
|
|
753
|
+
⚙️
|
|
754
|
+
</button>
|
|
755
|
+
|
|
756
|
+
<!-- Minimize / Expand Toggle -->
|
|
757
|
+
<button class="action-btn" (click)="toggleCollapse(item)" [title]="item.collapsed ? 'Expand Content' : 'Collapse Content'">
|
|
758
|
+
{{ item.collapsed ? '▼' : '▲' }}
|
|
759
|
+
</button>
|
|
760
|
+
|
|
761
|
+
<!-- Maximize / Restore Toggle -->
|
|
762
|
+
<button class="action-btn" (click)="toggleMaximize(item)" [title]="item.maximized ? 'Restore View' : 'Maximize Panel'">
|
|
763
|
+
{{ item.maximized ? '🗗' : '🗖' }}
|
|
764
|
+
</button>
|
|
765
|
+
|
|
766
|
+
<!-- Close Panel -->
|
|
767
|
+
<button class="action-btn close-btn" (click)="closePanel(item)" title="Close Panel">
|
|
768
|
+
✕
|
|
769
|
+
</button>
|
|
770
|
+
</div>
|
|
771
|
+
</div>
|
|
772
|
+
|
|
773
|
+
<!-- Panel Body -->
|
|
774
|
+
<div class="panel-content-body">
|
|
775
|
+
<ng-content [select]="'[panel-id=' + item.id + ']'"></ng-content>
|
|
776
|
+
|
|
777
|
+
<!-- Fallback Content if no projection matches -->
|
|
778
|
+
<div class="fallback-placeholder">
|
|
779
|
+
<span class="fallback-icon">▦</span>
|
|
780
|
+
<h4>{{ item.title }}</h4>
|
|
781
|
+
<p>{{ item.description || 'Provide a matching projection container with attribute panel-id="' + item.id + '"' }}</p>
|
|
782
|
+
</div>
|
|
783
|
+
</div>
|
|
784
|
+
|
|
785
|
+
<!-- Resize Grip Handle -->
|
|
786
|
+
@if (allowResizing() && item.resizable !== false && !item.maximized && !item.collapsed) {
|
|
787
|
+
<div
|
|
788
|
+
class="resize-handle"
|
|
789
|
+
(mousedown)="onResizeStart($event, item)"
|
|
790
|
+
>
|
|
791
|
+
<svg width="10" height="10" viewBox="0 0 10 10">
|
|
792
|
+
<path d="M10,0 L0,10 M10,4 L4,10 M10,8 L8,10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" fill="none" opacity="0.3"></path>
|
|
793
|
+
</svg>
|
|
794
|
+
</div>
|
|
795
|
+
}
|
|
796
|
+
</div>
|
|
797
|
+
}
|
|
798
|
+
</div>
|
|
799
|
+
</div>
|
|
800
|
+
`, isInline: true, styles: [":host{display:block;width:100%;height:100%}.ngx-dashboard-wrapper{position:relative;width:100%;height:100%;background:var(--bg-primary, #f8fafc);padding:16px;box-sizing:border-box;overflow-y:auto;transition:background .3s ease}.ngx-dashboard-wrapper.dark{background:#0f172a}.ngx-dashboard-grid{position:relative;display:grid;gap:16px;width:100%;transition:all .3s cubic-bezier(.4,0,.2,1)}.grid-background-overlay{position:absolute;inset:0;display:grid;grid-template-columns:inherit;grid-auto-rows:inherit;gap:inherit;pointer-events:none;z-index:1}.bg-cell-target{border:1px dashed var(--border-color, #cbd5e1);border-radius:8px;background:#94a3b805;pointer-events:auto;box-sizing:border-box}.ngx-dashboard-wrapper.dark .bg-cell-target{border-color:#334155;background:#1e293b1a}.drag-placeholder-indicator{border-radius:12px;border:2px dashed var(--primary-color, #4f46e5);background:var(--primary-glow, rgba(79, 70, 229, .05));z-index:2;box-sizing:border-box;animation:pulsePlaceholder 1.5s infinite ease-in-out}@keyframes pulsePlaceholder{0%,to{opacity:.6}50%{opacity:.9}}.placeholder-inner{width:100%;height:100%}.dashboard-panel-card{position:relative;display:flex;flex-direction:column;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;box-shadow:var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, .05));overflow:hidden;z-index:3;transition:box-shadow .25s,transform .25s;box-sizing:border-box}.ngx-dashboard-wrapper.dark .dashboard-panel-card{background:#1e293b;border-color:#334155;box-shadow:0 4px 6px -1px #0003}.dashboard-panel-card:hover{box-shadow:var(--shadow-md, 0 4px 6px -1px rgba(0,0,0,.08))}.dashboard-panel-card.dragging-active{opacity:.4;border-style:dashed;border-color:var(--primary-color, #4f46e5)}.dashboard-panel-card.maximized{grid-column:1 / -1!important;grid-row:auto!important;min-height:500px;z-index:50;box-shadow:var(--shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, .15))}.ngx-dashboard-wrapper.has-maximized .dashboard-panel-card:not(.maximized){display:none!important}.dashboard-panel-card.collapsed{grid-row-end:span 1!important;height:fit-content!important;min-height:0!important}.dashboard-panel-card.collapsed .panel-content-body,.dashboard-panel-card.collapsed .resize-handle{display:none!important}.panel-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid var(--border-color, #e2e8f0);background:var(--border-light, #f8fafc);-webkit-user-select:none;user-select:none;gap:12px}.ngx-dashboard-wrapper.dark .panel-header{background:#1e293b;border-bottom-color:#334155}.panel-header.draggable-handle{cursor:grab}.panel-header.draggable-handle:active{cursor:grabbing}.panel-title-group{display:flex;align-items:center;gap:10px;min-width:0}.panel-icon-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.panel-title{font-size:13px;font-weight:700;color:var(--text-primary, #1e293b);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ngx-dashboard-wrapper.dark .panel-title{color:#f8fafc}.panel-actions{display:flex;align-items:center;gap:4px}.action-btn{background:none;border:none;cursor:pointer;font-size:11px;padding:4px;border-radius:4px;color:var(--text-secondary, #64748b);display:flex;align-items:center;justify-content:center;transition:all .15s}.action-btn:hover{background:var(--border-color, #cbd5e1);color:var(--text-primary, #0f172a)}.ngx-dashboard-wrapper.dark .action-btn:hover{background:#334155;color:#fff}.action-btn.close-btn:hover{background:#fca5a5;color:#991b1b}.panel-content-body{flex:1;position:relative;overflow:auto;box-sizing:border-box}.fallback-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px;text-align:center;color:var(--text-secondary, #64748b);font-family:var(--ngx-font-family, sans-serif);box-sizing:border-box}.ngx-dashboard-wrapper.dark .fallback-placeholder{color:#94a3b8}.fallback-icon{font-size:28px;margin-bottom:8px;opacity:.5}.fallback-placeholder h4{margin:0 0 4px;font-size:13px;font-weight:600}.fallback-placeholder p{margin:0;font-size:11px;line-height:1.4;max-width:250px}.panel-content-body:has([panel-id]) .fallback-placeholder{display:none!important}.resize-handle{position:absolute;right:2px;bottom:2px;width:14px;height:14px;cursor:nwse-resize;display:flex;align-items:flex-end;justify-content:flex-end;color:var(--text-secondary, #94a3b8);z-index:5}.resize-handle:hover{color:var(--primary-color, #4f46e5)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
801
|
+
}
|
|
802
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DashboardLayoutComponent, decorators: [{
|
|
803
|
+
type: Component,
|
|
804
|
+
args: [{ selector: 'ngx-dashboard-layout', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
805
|
+
<div
|
|
806
|
+
class="ngx-dashboard-wrapper"
|
|
807
|
+
[class.dark]="theme() === 'dark'"
|
|
808
|
+
[class.has-maximized]="hasMaximizedPanel()"
|
|
809
|
+
>
|
|
810
|
+
<div
|
|
811
|
+
class="ngx-dashboard-grid"
|
|
812
|
+
[style.grid-template-columns]="'repeat(' + columns() + ', 1fr)'"
|
|
813
|
+
[style.grid-auto-rows]="rowHeight()"
|
|
814
|
+
(dragover)="onDragOverGrid($event)"
|
|
815
|
+
(drop)="onDrop($event)"
|
|
816
|
+
>
|
|
817
|
+
<!-- Background grid cells for drop snapping guide -->
|
|
818
|
+
@if (isDragging()) {
|
|
819
|
+
<div class="grid-background-overlay">
|
|
820
|
+
@for (cell of bgCells(); track cell.key) {
|
|
821
|
+
<div
|
|
822
|
+
class="bg-cell-target"
|
|
823
|
+
[style.grid-column-start]="cell.col + 1"
|
|
824
|
+
[style.grid-row-start]="cell.row + 1"
|
|
825
|
+
(dragover)="onDragOverCell($event)"
|
|
826
|
+
(dragenter)="onDragEnterCell($event, cell.col, cell.row)"
|
|
827
|
+
></div>
|
|
828
|
+
}
|
|
829
|
+
</div>
|
|
830
|
+
|
|
831
|
+
<!-- Drop Position Placeholder -->
|
|
832
|
+
@if (dragPlaceholder(); as placeholder) {
|
|
833
|
+
<div
|
|
834
|
+
class="drag-placeholder-indicator"
|
|
835
|
+
[style.grid-column-start]="placeholder.col + 1"
|
|
836
|
+
[style.grid-column-end]="placeholder.col + 1 + placeholder.colSpan"
|
|
837
|
+
[style.grid-row-start]="placeholder.row + 1"
|
|
838
|
+
[style.grid-row-end]="placeholder.row + 1 + placeholder.rowSpan"
|
|
839
|
+
>
|
|
840
|
+
<div class="placeholder-inner"></div>
|
|
841
|
+
</div>
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
<!-- Active Dashboard Cards -->
|
|
846
|
+
@for (item of itemsState(); track item.id) {
|
|
847
|
+
<div
|
|
848
|
+
class="dashboard-panel-card"
|
|
849
|
+
[class.maximized]="item.maximized"
|
|
850
|
+
[class.collapsed]="item.collapsed"
|
|
851
|
+
[class.dragging-active]="activeDraggingId() === item.id"
|
|
852
|
+
[style.grid-column-start]="item.maximized ? 1 : item.col + 1"
|
|
853
|
+
[style.grid-column-end]="item.maximized ? columns() + 1 : item.col + 1 + item.colSpan"
|
|
854
|
+
[style.grid-row-start]="item.maximized ? 1 : item.row + 1"
|
|
855
|
+
[style.grid-row-end]="item.maximized ? 'span 4' : item.row + 1 + item.rowSpan"
|
|
856
|
+
[attr.draggable]="(allowDragging() && item.draggable !== false && !item.maximized && !item.collapsed) ? 'true' : 'false'"
|
|
857
|
+
(dragstart)="onDragStart($event, item)"
|
|
858
|
+
(dragend)="onDragEnd()"
|
|
859
|
+
>
|
|
860
|
+
<!-- Panel Header -->
|
|
861
|
+
<div
|
|
862
|
+
class="panel-header"
|
|
863
|
+
[class.draggable-handle]="allowDragging() && item.draggable !== false && !item.maximized && !item.collapsed"
|
|
864
|
+
>
|
|
865
|
+
<div class="panel-title-group">
|
|
866
|
+
<span class="panel-icon-dot" [style.background-color]="getCategoryColor(item.category)"></span>
|
|
867
|
+
<span class="panel-title" [title]="item.title">{{ item.title }}</span>
|
|
868
|
+
</div>
|
|
869
|
+
|
|
870
|
+
<div class="panel-actions" (click)="$event.stopPropagation()">
|
|
871
|
+
<!-- Settings Action -->
|
|
872
|
+
<button class="action-btn" (click)="emitPanelAction(item, 'settings')" title="Panel Settings">
|
|
873
|
+
⚙️
|
|
874
|
+
</button>
|
|
875
|
+
|
|
876
|
+
<!-- Minimize / Expand Toggle -->
|
|
877
|
+
<button class="action-btn" (click)="toggleCollapse(item)" [title]="item.collapsed ? 'Expand Content' : 'Collapse Content'">
|
|
878
|
+
{{ item.collapsed ? '▼' : '▲' }}
|
|
879
|
+
</button>
|
|
880
|
+
|
|
881
|
+
<!-- Maximize / Restore Toggle -->
|
|
882
|
+
<button class="action-btn" (click)="toggleMaximize(item)" [title]="item.maximized ? 'Restore View' : 'Maximize Panel'">
|
|
883
|
+
{{ item.maximized ? '🗗' : '🗖' }}
|
|
884
|
+
</button>
|
|
885
|
+
|
|
886
|
+
<!-- Close Panel -->
|
|
887
|
+
<button class="action-btn close-btn" (click)="closePanel(item)" title="Close Panel">
|
|
888
|
+
✕
|
|
889
|
+
</button>
|
|
890
|
+
</div>
|
|
891
|
+
</div>
|
|
892
|
+
|
|
893
|
+
<!-- Panel Body -->
|
|
894
|
+
<div class="panel-content-body">
|
|
895
|
+
<ng-content [select]="'[panel-id=' + item.id + ']'"></ng-content>
|
|
896
|
+
|
|
897
|
+
<!-- Fallback Content if no projection matches -->
|
|
898
|
+
<div class="fallback-placeholder">
|
|
899
|
+
<span class="fallback-icon">▦</span>
|
|
900
|
+
<h4>{{ item.title }}</h4>
|
|
901
|
+
<p>{{ item.description || 'Provide a matching projection container with attribute panel-id="' + item.id + '"' }}</p>
|
|
902
|
+
</div>
|
|
903
|
+
</div>
|
|
904
|
+
|
|
905
|
+
<!-- Resize Grip Handle -->
|
|
906
|
+
@if (allowResizing() && item.resizable !== false && !item.maximized && !item.collapsed) {
|
|
907
|
+
<div
|
|
908
|
+
class="resize-handle"
|
|
909
|
+
(mousedown)="onResizeStart($event, item)"
|
|
910
|
+
>
|
|
911
|
+
<svg width="10" height="10" viewBox="0 0 10 10">
|
|
912
|
+
<path d="M10,0 L0,10 M10,4 L4,10 M10,8 L8,10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" fill="none" opacity="0.3"></path>
|
|
913
|
+
</svg>
|
|
914
|
+
</div>
|
|
915
|
+
}
|
|
916
|
+
</div>
|
|
917
|
+
}
|
|
918
|
+
</div>
|
|
919
|
+
</div>
|
|
920
|
+
`, styles: [":host{display:block;width:100%;height:100%}.ngx-dashboard-wrapper{position:relative;width:100%;height:100%;background:var(--bg-primary, #f8fafc);padding:16px;box-sizing:border-box;overflow-y:auto;transition:background .3s ease}.ngx-dashboard-wrapper.dark{background:#0f172a}.ngx-dashboard-grid{position:relative;display:grid;gap:16px;width:100%;transition:all .3s cubic-bezier(.4,0,.2,1)}.grid-background-overlay{position:absolute;inset:0;display:grid;grid-template-columns:inherit;grid-auto-rows:inherit;gap:inherit;pointer-events:none;z-index:1}.bg-cell-target{border:1px dashed var(--border-color, #cbd5e1);border-radius:8px;background:#94a3b805;pointer-events:auto;box-sizing:border-box}.ngx-dashboard-wrapper.dark .bg-cell-target{border-color:#334155;background:#1e293b1a}.drag-placeholder-indicator{border-radius:12px;border:2px dashed var(--primary-color, #4f46e5);background:var(--primary-glow, rgba(79, 70, 229, .05));z-index:2;box-sizing:border-box;animation:pulsePlaceholder 1.5s infinite ease-in-out}@keyframes pulsePlaceholder{0%,to{opacity:.6}50%{opacity:.9}}.placeholder-inner{width:100%;height:100%}.dashboard-panel-card{position:relative;display:flex;flex-direction:column;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;box-shadow:var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, .05));overflow:hidden;z-index:3;transition:box-shadow .25s,transform .25s;box-sizing:border-box}.ngx-dashboard-wrapper.dark .dashboard-panel-card{background:#1e293b;border-color:#334155;box-shadow:0 4px 6px -1px #0003}.dashboard-panel-card:hover{box-shadow:var(--shadow-md, 0 4px 6px -1px rgba(0,0,0,.08))}.dashboard-panel-card.dragging-active{opacity:.4;border-style:dashed;border-color:var(--primary-color, #4f46e5)}.dashboard-panel-card.maximized{grid-column:1 / -1!important;grid-row:auto!important;min-height:500px;z-index:50;box-shadow:var(--shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, .15))}.ngx-dashboard-wrapper.has-maximized .dashboard-panel-card:not(.maximized){display:none!important}.dashboard-panel-card.collapsed{grid-row-end:span 1!important;height:fit-content!important;min-height:0!important}.dashboard-panel-card.collapsed .panel-content-body,.dashboard-panel-card.collapsed .resize-handle{display:none!important}.panel-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid var(--border-color, #e2e8f0);background:var(--border-light, #f8fafc);-webkit-user-select:none;user-select:none;gap:12px}.ngx-dashboard-wrapper.dark .panel-header{background:#1e293b;border-bottom-color:#334155}.panel-header.draggable-handle{cursor:grab}.panel-header.draggable-handle:active{cursor:grabbing}.panel-title-group{display:flex;align-items:center;gap:10px;min-width:0}.panel-icon-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.panel-title{font-size:13px;font-weight:700;color:var(--text-primary, #1e293b);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ngx-dashboard-wrapper.dark .panel-title{color:#f8fafc}.panel-actions{display:flex;align-items:center;gap:4px}.action-btn{background:none;border:none;cursor:pointer;font-size:11px;padding:4px;border-radius:4px;color:var(--text-secondary, #64748b);display:flex;align-items:center;justify-content:center;transition:all .15s}.action-btn:hover{background:var(--border-color, #cbd5e1);color:var(--text-primary, #0f172a)}.ngx-dashboard-wrapper.dark .action-btn:hover{background:#334155;color:#fff}.action-btn.close-btn:hover{background:#fca5a5;color:#991b1b}.panel-content-body{flex:1;position:relative;overflow:auto;box-sizing:border-box}.fallback-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px;text-align:center;color:var(--text-secondary, #64748b);font-family:var(--ngx-font-family, sans-serif);box-sizing:border-box}.ngx-dashboard-wrapper.dark .fallback-placeholder{color:#94a3b8}.fallback-icon{font-size:28px;margin-bottom:8px;opacity:.5}.fallback-placeholder h4{margin:0 0 4px;font-size:13px;font-weight:600}.fallback-placeholder p{margin:0;font-size:11px;line-height:1.4;max-width:250px}.panel-content-body:has([panel-id]) .fallback-placeholder{display:none!important}.resize-handle{position:absolute;right:2px;bottom:2px;width:14px;height:14px;cursor:nwse-resize;display:flex;align-items:flex-end;justify-content:flex-end;color:var(--text-secondary, #94a3b8);z-index:5}.resize-handle:hover{color:var(--primary-color, #4f46e5)}\n"] }]
|
|
921
|
+
}], ctorParameters: () => [] });
|
|
922
|
+
|
|
923
|
+
class CarouselComponent {
|
|
924
|
+
// Inputs
|
|
925
|
+
items = input([]);
|
|
926
|
+
autoplay = input(true);
|
|
927
|
+
interval = input(5000);
|
|
928
|
+
transition = input('slide');
|
|
929
|
+
theme = input('light');
|
|
930
|
+
showIndicators = input(true);
|
|
931
|
+
showControls = input(true);
|
|
932
|
+
itemTemplate = input(null);
|
|
933
|
+
id = input('ngx-carousel-' + Math.random().toString(36).substring(2, 9));
|
|
934
|
+
// Outputs
|
|
935
|
+
slideChange = output();
|
|
936
|
+
// State Signals
|
|
937
|
+
activeIndex = signal(0);
|
|
938
|
+
lastActiveIndex = signal(-1);
|
|
939
|
+
navDirection = signal('next');
|
|
940
|
+
constructor() {
|
|
941
|
+
effect(() => {
|
|
942
|
+
// Clamp index on item changes
|
|
943
|
+
const total = this.items().length;
|
|
944
|
+
if (this.activeIndex() >= total) {
|
|
945
|
+
this.activeIndex.set(total > 0 ? total - 1 : 0);
|
|
946
|
+
}
|
|
947
|
+
}, { allowSignalWrites: true });
|
|
948
|
+
effect(() => {
|
|
949
|
+
// React to autoplay and interval updates
|
|
950
|
+
this.autoplay();
|
|
951
|
+
this.interval();
|
|
952
|
+
untracked(() => {
|
|
953
|
+
this.resetAutoplay();
|
|
954
|
+
});
|
|
955
|
+
});
|
|
956
|
+
}
|
|
957
|
+
autoplayTimer = null;
|
|
958
|
+
touchStartX = 0;
|
|
959
|
+
ngOnInit() {
|
|
960
|
+
this.startAutoplay();
|
|
961
|
+
}
|
|
962
|
+
ngOnDestroy() {
|
|
963
|
+
this.stopAutoplay();
|
|
964
|
+
}
|
|
965
|
+
goToSlide(index) {
|
|
966
|
+
if (index === this.activeIndex() || this.items().length <= 1)
|
|
967
|
+
return;
|
|
968
|
+
this.lastActiveIndex.set(this.activeIndex());
|
|
969
|
+
this.navDirection.set(index > this.activeIndex() ? 'next' : 'prev');
|
|
970
|
+
this.activeIndex.set(index);
|
|
971
|
+
this.slideChange.emit({
|
|
972
|
+
index: index,
|
|
973
|
+
item: this.items()[index],
|
|
974
|
+
});
|
|
975
|
+
this.resetAutoplay();
|
|
976
|
+
}
|
|
977
|
+
nextSlide() {
|
|
978
|
+
const total = this.items().length;
|
|
979
|
+
if (total <= 1)
|
|
980
|
+
return;
|
|
981
|
+
const nextIdx = (this.activeIndex() + 1) % total;
|
|
982
|
+
this.goToSlide(nextIdx);
|
|
983
|
+
}
|
|
984
|
+
prevSlide() {
|
|
985
|
+
const total = this.items().length;
|
|
986
|
+
if (total <= 1)
|
|
987
|
+
return;
|
|
988
|
+
const prevIdx = (this.activeIndex() - 1 + total) % total;
|
|
989
|
+
this.goToSlide(prevIdx);
|
|
990
|
+
}
|
|
991
|
+
onKeyDown(event) {
|
|
992
|
+
if (event.key === 'ArrowRight') {
|
|
993
|
+
this.nextSlide();
|
|
994
|
+
event.preventDefault();
|
|
995
|
+
}
|
|
996
|
+
else if (event.key === 'ArrowLeft') {
|
|
997
|
+
this.prevSlide();
|
|
998
|
+
event.preventDefault();
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
// Touch Swipe Handlers
|
|
1002
|
+
onTouchStart(event) {
|
|
1003
|
+
this.touchStartX = event.touches[0].clientX;
|
|
1004
|
+
}
|
|
1005
|
+
onTouchEnd(event) {
|
|
1006
|
+
const touchEndX = event.changedTouches[0].clientX;
|
|
1007
|
+
const diff = touchEndX - this.touchStartX;
|
|
1008
|
+
// Minimum swipe threshold (50px)
|
|
1009
|
+
if (Math.abs(diff) > 50) {
|
|
1010
|
+
if (diff > 0) {
|
|
1011
|
+
this.prevSlide(); // Swiped right -> go to previous
|
|
1012
|
+
}
|
|
1013
|
+
else {
|
|
1014
|
+
this.nextSlide(); // Swiped left -> go to next
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
// Autoplay Logic
|
|
1019
|
+
onMouseEnter() {
|
|
1020
|
+
this.stopAutoplay();
|
|
1021
|
+
}
|
|
1022
|
+
onMouseLeave() {
|
|
1023
|
+
this.startAutoplay();
|
|
1024
|
+
}
|
|
1025
|
+
startAutoplay() {
|
|
1026
|
+
if (!this.autoplay() || this.items().length <= 1)
|
|
1027
|
+
return;
|
|
1028
|
+
this.stopAutoplay();
|
|
1029
|
+
this.autoplayTimer = setInterval(() => {
|
|
1030
|
+
this.nextSlide();
|
|
1031
|
+
}, this.interval());
|
|
1032
|
+
}
|
|
1033
|
+
stopAutoplay() {
|
|
1034
|
+
if (this.autoplayTimer) {
|
|
1035
|
+
clearInterval(this.autoplayTimer);
|
|
1036
|
+
this.autoplayTimer = null;
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
resetAutoplay() {
|
|
1040
|
+
this.stopAutoplay();
|
|
1041
|
+
this.startAutoplay();
|
|
1042
|
+
}
|
|
1043
|
+
// Helper to dynamically calculate classes per slide to trigger CSS animations
|
|
1044
|
+
getSlideClass(index) {
|
|
1045
|
+
const active = this.activeIndex();
|
|
1046
|
+
const last = this.lastActiveIndex();
|
|
1047
|
+
const transitionType = this.transition();
|
|
1048
|
+
if (index === active) {
|
|
1049
|
+
if (last === -1)
|
|
1050
|
+
return 'active';
|
|
1051
|
+
const direction = this.navDirection();
|
|
1052
|
+
return `active transition-${transitionType} active-from-${direction === 'next' ? 'right' : 'left'}`;
|
|
1053
|
+
}
|
|
1054
|
+
if (index === last) {
|
|
1055
|
+
const direction = this.navDirection();
|
|
1056
|
+
return `transition-${transitionType} exit-to-${direction === 'next' ? 'left' : 'right'}`;
|
|
1057
|
+
}
|
|
1058
|
+
return '';
|
|
1059
|
+
}
|
|
1060
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: CarouselComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1061
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: CarouselComponent, isStandalone: true, selector: "ngx-carousel", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, autoplay: { classPropertyName: "autoplay", publicName: "autoplay", isSignal: true, isRequired: false, transformFunction: null }, interval: { classPropertyName: "interval", publicName: "interval", isSignal: true, isRequired: false, transformFunction: null }, transition: { classPropertyName: "transition", publicName: "transition", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, showIndicators: { classPropertyName: "showIndicators", publicName: "showIndicators", isSignal: true, isRequired: false, transformFunction: null }, showControls: { classPropertyName: "showControls", publicName: "showControls", isSignal: true, isRequired: false, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { slideChange: "slideChange" }, ngImport: i0, template: `
|
|
1062
|
+
<div
|
|
1063
|
+
class="ngx-carousel"
|
|
1064
|
+
[class.dark]="theme() === 'dark'"
|
|
1065
|
+
[attr.id]="id()"
|
|
1066
|
+
(keydown)="onKeyDown($event)"
|
|
1067
|
+
tabindex="0"
|
|
1068
|
+
(mouseenter)="onMouseEnter()"
|
|
1069
|
+
(mouseleave)="onMouseLeave()"
|
|
1070
|
+
>
|
|
1071
|
+
<div
|
|
1072
|
+
class="ngx-carousel__stage"
|
|
1073
|
+
(touchstart)="onTouchStart($event)"
|
|
1074
|
+
(touchend)="onTouchEnd($event)"
|
|
1075
|
+
>
|
|
1076
|
+
@for (item of items(); track $index) {
|
|
1077
|
+
<div
|
|
1078
|
+
class="ngx-carousel__slide"
|
|
1079
|
+
[class]="getSlideClass($index)"
|
|
1080
|
+
>
|
|
1081
|
+
@if (itemTemplate()) {
|
|
1082
|
+
<ng-container *ngTemplateOutlet="itemTemplate()!; context: { $implicit: item, index: $index }"></ng-container>
|
|
1083
|
+
} @else {
|
|
1084
|
+
<!-- Default Image layout -->
|
|
1085
|
+
<img [src]="item.url" [alt]="item.title || 'Slide ' + ($index + 1)" class="ngx-carousel__img" />
|
|
1086
|
+
@if (item.title || item.caption) {
|
|
1087
|
+
<div class="ngx-carousel__caption-card">
|
|
1088
|
+
@if (item.title) {
|
|
1089
|
+
<h3 class="ngx-carousel__caption-title">{{ item.title }}</h3>
|
|
1090
|
+
}
|
|
1091
|
+
@if (item.caption) {
|
|
1092
|
+
<p class="ngx-carousel__caption-desc">{{ item.caption }}</p>
|
|
1093
|
+
}
|
|
1094
|
+
</div>
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
</div>
|
|
1098
|
+
}
|
|
1099
|
+
</div>
|
|
1100
|
+
|
|
1101
|
+
<!-- Controls -->
|
|
1102
|
+
@if (showControls() && items().length > 1) {
|
|
1103
|
+
<button
|
|
1104
|
+
class="ngx-carousel__control prev"
|
|
1105
|
+
(click)="prevSlide()"
|
|
1106
|
+
aria-label="Previous slide"
|
|
1107
|
+
>
|
|
1108
|
+
<svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2.5">
|
|
1109
|
+
<polyline points="15 18 9 12 15 6" />
|
|
1110
|
+
</svg>
|
|
1111
|
+
</button>
|
|
1112
|
+
<button
|
|
1113
|
+
class="ngx-carousel__control next"
|
|
1114
|
+
(click)="nextSlide()"
|
|
1115
|
+
aria-label="Next slide"
|
|
1116
|
+
>
|
|
1117
|
+
<svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2.5">
|
|
1118
|
+
<polyline points="9 18 15 12 9 6" />
|
|
1119
|
+
</svg>
|
|
1120
|
+
</button>
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
<!-- Indicators -->
|
|
1124
|
+
@if (showIndicators() && items().length > 1) {
|
|
1125
|
+
<div class="ngx-carousel__indicators">
|
|
1126
|
+
@for (item of items(); track $index) {
|
|
1127
|
+
<button
|
|
1128
|
+
class="ngx-carousel__indicator"
|
|
1129
|
+
[class.active]="$index === activeIndex()"
|
|
1130
|
+
(click)="goToSlide($index)"
|
|
1131
|
+
[attr.aria-label]="'Go to slide ' + ($index + 1)"
|
|
1132
|
+
></button>
|
|
1133
|
+
}
|
|
1134
|
+
</div>
|
|
1135
|
+
}
|
|
1136
|
+
</div>
|
|
1137
|
+
`, isInline: true, styles: [":host{display:block;width:100%}.ngx-carousel{position:relative;width:100%;border-radius:16px;overflow:hidden;outline:none;background:#f1f5f9;box-shadow:0 10px 25px -5px #0000000d,0 8px 10px -6px #0000000d;font-family:var(--ngx-font-family, system-ui, sans-serif);transition:box-shadow .3s ease}.ngx-carousel.dark{background:#0f172a}.ngx-carousel:focus-visible{box-shadow:0 0 0 3px var(--primary-color, #3b82f6)}.ngx-carousel__stage{position:relative;width:100%;height:400px;overflow:hidden}.ngx-carousel__slide{position:absolute;top:0;left:0;width:100%;height:100%;visibility:hidden;opacity:0;overflow:hidden;display:flex;align-items:center;justify-content:center}.ngx-carousel__slide.active{visibility:visible;opacity:1;transform:translate(0);z-index:2}.ngx-carousel__img{width:100%;height:100%;object-fit:cover;-webkit-user-select:none;user-select:none;pointer-events:none}.ngx-carousel__caption-card{position:absolute;bottom:24px;left:24px;right:24px;padding:16px 20px;border-radius:12px;background:#ffffffa6;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid rgba(255,255,255,.4);box-shadow:0 10px 15px -3px #0000000d,0 4px 6px -4px #0000000d;z-index:5;max-width:480px;animation:captionEntrance .6s cubic-bezier(.16,1,.3,1) forwards;transform:translateY(10px);opacity:0}.dark .ngx-carousel__caption-card{background:#0f172aa6;border-color:#ffffff14}.ngx-carousel__caption-title{margin:0 0 4px;font-size:16px;font-weight:700;color:#0f172a}.dark .ngx-carousel__caption-title{color:#f8fafc}.ngx-carousel__caption-desc{margin:0;font-size:13px;line-height:1.4;color:#334155}.dark .ngx-carousel__caption-desc{color:#cbd5e1}@keyframes captionEntrance{to{transform:translateY(0);opacity:1}}.ngx-carousel__control{position:absolute;top:50%;transform:translateY(-50%) scale(.9);width:42px;height:42px;border-radius:50%;background:#fff9;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:1px solid rgba(255,255,255,.4);color:#0f172a;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:10;transition:all .25s cubic-bezier(.4,0,.2,1);opacity:0}.dark .ngx-carousel__control{background:#0f172a99;border-color:#ffffff14;color:#cbd5e1}.ngx-carousel:hover .ngx-carousel__control{opacity:1;transform:translateY(-50%) scale(1)}.ngx-carousel__control:hover{background:#ffffffd9;transform:translateY(-50%) scale(1.08)!important;box-shadow:0 4px 12px #0000001a}.ngx-carousel__control.prev{left:16px}.ngx-carousel__control.next{right:16px}.ngx-carousel__indicators{position:absolute;bottom:24px;left:50%;transform:translate(-50%);display:flex;gap:8px;z-index:10;background:#ffffff73;padding:6px 10px;border-radius:20px;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);border:1px solid rgba(255,255,255,.2)}.dark .ngx-carousel__indicators{background:#0f172a73;border-color:#ffffff0d}.ngx-carousel__indicator{width:8px;height:8px;border-radius:50%;border:none;background:#00000040;cursor:pointer;transition:all .2s ease;padding:0}.dark .ngx-carousel__indicator{background:#ffffff40}.ngx-carousel__indicator.active{background:var(--primary-color, #3b82f6);width:18px;border-radius:4px}.ngx-carousel__slide.transition-slide.active-from-right{animation:slideInRight .5s cubic-bezier(.25,1,.5,1) forwards;z-index:3}.ngx-carousel__slide.transition-slide.active-from-left{animation:slideInLeft .5s cubic-bezier(.25,1,.5,1) forwards;z-index:3}.ngx-carousel__slide.transition-slide.exit-to-right{animation:slideOutRight .5s cubic-bezier(.25,1,.5,1) forwards;visibility:visible;z-index:1}.ngx-carousel__slide.transition-slide.exit-to-left{animation:slideOutLeft .5s cubic-bezier(.25,1,.5,1) forwards;visibility:visible;z-index:1}@keyframes slideInRight{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes slideInLeft{0%{transform:translate(-100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes slideOutRight{0%{transform:translate(0);opacity:1}to{transform:translate(100%);opacity:0}}@keyframes slideOutLeft{0%{transform:translate(0);opacity:1}to{transform:translate(-100%);opacity:0}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1138
|
+
}
|
|
1139
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: CarouselComponent, decorators: [{
|
|
1140
|
+
type: Component,
|
|
1141
|
+
args: [{ selector: 'ngx-carousel', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1142
|
+
<div
|
|
1143
|
+
class="ngx-carousel"
|
|
1144
|
+
[class.dark]="theme() === 'dark'"
|
|
1145
|
+
[attr.id]="id()"
|
|
1146
|
+
(keydown)="onKeyDown($event)"
|
|
1147
|
+
tabindex="0"
|
|
1148
|
+
(mouseenter)="onMouseEnter()"
|
|
1149
|
+
(mouseleave)="onMouseLeave()"
|
|
1150
|
+
>
|
|
1151
|
+
<div
|
|
1152
|
+
class="ngx-carousel__stage"
|
|
1153
|
+
(touchstart)="onTouchStart($event)"
|
|
1154
|
+
(touchend)="onTouchEnd($event)"
|
|
1155
|
+
>
|
|
1156
|
+
@for (item of items(); track $index) {
|
|
1157
|
+
<div
|
|
1158
|
+
class="ngx-carousel__slide"
|
|
1159
|
+
[class]="getSlideClass($index)"
|
|
1160
|
+
>
|
|
1161
|
+
@if (itemTemplate()) {
|
|
1162
|
+
<ng-container *ngTemplateOutlet="itemTemplate()!; context: { $implicit: item, index: $index }"></ng-container>
|
|
1163
|
+
} @else {
|
|
1164
|
+
<!-- Default Image layout -->
|
|
1165
|
+
<img [src]="item.url" [alt]="item.title || 'Slide ' + ($index + 1)" class="ngx-carousel__img" />
|
|
1166
|
+
@if (item.title || item.caption) {
|
|
1167
|
+
<div class="ngx-carousel__caption-card">
|
|
1168
|
+
@if (item.title) {
|
|
1169
|
+
<h3 class="ngx-carousel__caption-title">{{ item.title }}</h3>
|
|
1170
|
+
}
|
|
1171
|
+
@if (item.caption) {
|
|
1172
|
+
<p class="ngx-carousel__caption-desc">{{ item.caption }}</p>
|
|
1173
|
+
}
|
|
1174
|
+
</div>
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
</div>
|
|
1178
|
+
}
|
|
1179
|
+
</div>
|
|
1180
|
+
|
|
1181
|
+
<!-- Controls -->
|
|
1182
|
+
@if (showControls() && items().length > 1) {
|
|
1183
|
+
<button
|
|
1184
|
+
class="ngx-carousel__control prev"
|
|
1185
|
+
(click)="prevSlide()"
|
|
1186
|
+
aria-label="Previous slide"
|
|
1187
|
+
>
|
|
1188
|
+
<svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2.5">
|
|
1189
|
+
<polyline points="15 18 9 12 15 6" />
|
|
1190
|
+
</svg>
|
|
1191
|
+
</button>
|
|
1192
|
+
<button
|
|
1193
|
+
class="ngx-carousel__control next"
|
|
1194
|
+
(click)="nextSlide()"
|
|
1195
|
+
aria-label="Next slide"
|
|
1196
|
+
>
|
|
1197
|
+
<svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2.5">
|
|
1198
|
+
<polyline points="9 18 15 12 9 6" />
|
|
1199
|
+
</svg>
|
|
1200
|
+
</button>
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
<!-- Indicators -->
|
|
1204
|
+
@if (showIndicators() && items().length > 1) {
|
|
1205
|
+
<div class="ngx-carousel__indicators">
|
|
1206
|
+
@for (item of items(); track $index) {
|
|
1207
|
+
<button
|
|
1208
|
+
class="ngx-carousel__indicator"
|
|
1209
|
+
[class.active]="$index === activeIndex()"
|
|
1210
|
+
(click)="goToSlide($index)"
|
|
1211
|
+
[attr.aria-label]="'Go to slide ' + ($index + 1)"
|
|
1212
|
+
></button>
|
|
1213
|
+
}
|
|
1214
|
+
</div>
|
|
1215
|
+
}
|
|
1216
|
+
</div>
|
|
1217
|
+
`, styles: [":host{display:block;width:100%}.ngx-carousel{position:relative;width:100%;border-radius:16px;overflow:hidden;outline:none;background:#f1f5f9;box-shadow:0 10px 25px -5px #0000000d,0 8px 10px -6px #0000000d;font-family:var(--ngx-font-family, system-ui, sans-serif);transition:box-shadow .3s ease}.ngx-carousel.dark{background:#0f172a}.ngx-carousel:focus-visible{box-shadow:0 0 0 3px var(--primary-color, #3b82f6)}.ngx-carousel__stage{position:relative;width:100%;height:400px;overflow:hidden}.ngx-carousel__slide{position:absolute;top:0;left:0;width:100%;height:100%;visibility:hidden;opacity:0;overflow:hidden;display:flex;align-items:center;justify-content:center}.ngx-carousel__slide.active{visibility:visible;opacity:1;transform:translate(0);z-index:2}.ngx-carousel__img{width:100%;height:100%;object-fit:cover;-webkit-user-select:none;user-select:none;pointer-events:none}.ngx-carousel__caption-card{position:absolute;bottom:24px;left:24px;right:24px;padding:16px 20px;border-radius:12px;background:#ffffffa6;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid rgba(255,255,255,.4);box-shadow:0 10px 15px -3px #0000000d,0 4px 6px -4px #0000000d;z-index:5;max-width:480px;animation:captionEntrance .6s cubic-bezier(.16,1,.3,1) forwards;transform:translateY(10px);opacity:0}.dark .ngx-carousel__caption-card{background:#0f172aa6;border-color:#ffffff14}.ngx-carousel__caption-title{margin:0 0 4px;font-size:16px;font-weight:700;color:#0f172a}.dark .ngx-carousel__caption-title{color:#f8fafc}.ngx-carousel__caption-desc{margin:0;font-size:13px;line-height:1.4;color:#334155}.dark .ngx-carousel__caption-desc{color:#cbd5e1}@keyframes captionEntrance{to{transform:translateY(0);opacity:1}}.ngx-carousel__control{position:absolute;top:50%;transform:translateY(-50%) scale(.9);width:42px;height:42px;border-radius:50%;background:#fff9;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:1px solid rgba(255,255,255,.4);color:#0f172a;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:10;transition:all .25s cubic-bezier(.4,0,.2,1);opacity:0}.dark .ngx-carousel__control{background:#0f172a99;border-color:#ffffff14;color:#cbd5e1}.ngx-carousel:hover .ngx-carousel__control{opacity:1;transform:translateY(-50%) scale(1)}.ngx-carousel__control:hover{background:#ffffffd9;transform:translateY(-50%) scale(1.08)!important;box-shadow:0 4px 12px #0000001a}.ngx-carousel__control.prev{left:16px}.ngx-carousel__control.next{right:16px}.ngx-carousel__indicators{position:absolute;bottom:24px;left:50%;transform:translate(-50%);display:flex;gap:8px;z-index:10;background:#ffffff73;padding:6px 10px;border-radius:20px;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);border:1px solid rgba(255,255,255,.2)}.dark .ngx-carousel__indicators{background:#0f172a73;border-color:#ffffff0d}.ngx-carousel__indicator{width:8px;height:8px;border-radius:50%;border:none;background:#00000040;cursor:pointer;transition:all .2s ease;padding:0}.dark .ngx-carousel__indicator{background:#ffffff40}.ngx-carousel__indicator.active{background:var(--primary-color, #3b82f6);width:18px;border-radius:4px}.ngx-carousel__slide.transition-slide.active-from-right{animation:slideInRight .5s cubic-bezier(.25,1,.5,1) forwards;z-index:3}.ngx-carousel__slide.transition-slide.active-from-left{animation:slideInLeft .5s cubic-bezier(.25,1,.5,1) forwards;z-index:3}.ngx-carousel__slide.transition-slide.exit-to-right{animation:slideOutRight .5s cubic-bezier(.25,1,.5,1) forwards;visibility:visible;z-index:1}.ngx-carousel__slide.transition-slide.exit-to-left{animation:slideOutLeft .5s cubic-bezier(.25,1,.5,1) forwards;visibility:visible;z-index:1}@keyframes slideInRight{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes slideInLeft{0%{transform:translate(-100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes slideOutRight{0%{transform:translate(0);opacity:1}to{transform:translate(100%);opacity:0}}@keyframes slideOutLeft{0%{transform:translate(0);opacity:1}to{transform:translate(-100%);opacity:0}}\n"] }]
|
|
1218
|
+
}], ctorParameters: () => [] });
|
|
1219
|
+
|
|
1220
|
+
class DrawerComponent {
|
|
1221
|
+
// Inputs
|
|
1222
|
+
isOpen = model(false); // Signal-based model for two-way binding
|
|
1223
|
+
position = input('right');
|
|
1224
|
+
size = input('380px');
|
|
1225
|
+
closeOnBackdrop = input(true);
|
|
1226
|
+
closeOnEscape = input(true);
|
|
1227
|
+
theme = input('light');
|
|
1228
|
+
title = input('');
|
|
1229
|
+
// Outputs
|
|
1230
|
+
close = output();
|
|
1231
|
+
constructor() {
|
|
1232
|
+
effect(() => {
|
|
1233
|
+
if (this.isOpen()) {
|
|
1234
|
+
document.body.style.overflow = 'hidden';
|
|
1235
|
+
}
|
|
1236
|
+
else {
|
|
1237
|
+
document.body.style.overflow = '';
|
|
1238
|
+
}
|
|
1239
|
+
});
|
|
1240
|
+
}
|
|
1241
|
+
ngOnDestroy() {
|
|
1242
|
+
document.body.style.overflow = '';
|
|
1243
|
+
}
|
|
1244
|
+
// Helper Computeds
|
|
1245
|
+
isHorizontal = computed(() => {
|
|
1246
|
+
const pos = this.position();
|
|
1247
|
+
return pos === 'left' || pos === 'right';
|
|
1248
|
+
});
|
|
1249
|
+
isVertical = computed(() => {
|
|
1250
|
+
const pos = this.position();
|
|
1251
|
+
return pos === 'top' || pos === 'bottom';
|
|
1252
|
+
});
|
|
1253
|
+
closeDrawer() {
|
|
1254
|
+
this.close.emit();
|
|
1255
|
+
this.isOpen.set(false);
|
|
1256
|
+
}
|
|
1257
|
+
onBackdropClick() {
|
|
1258
|
+
if (this.closeOnBackdrop()) {
|
|
1259
|
+
this.closeDrawer();
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
onEscapeKey(event) {
|
|
1263
|
+
if (this.isOpen() && this.closeOnEscape()) {
|
|
1264
|
+
this.closeDrawer();
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1268
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.20", type: DrawerComponent, isStandalone: true, selector: "ngx-drawer", inputs: { isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, closeOnBackdrop: { classPropertyName: "closeOnBackdrop", publicName: "closeOnBackdrop", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange", close: "close" }, host: { listeners: { "document:keydown.escape": "onEscapeKey($event)" } }, ngImport: i0, template: `
|
|
1269
|
+
<div
|
|
1270
|
+
class="ngx-drawer-container"
|
|
1271
|
+
[class.open]="isOpen()"
|
|
1272
|
+
[class.dark]="theme() === 'dark'"
|
|
1273
|
+
[attr.aria-hidden]="!isOpen()"
|
|
1274
|
+
>
|
|
1275
|
+
<!-- Backdrop Blur Overlay -->
|
|
1276
|
+
<div class="ngx-drawer-backdrop" (click)="onBackdropClick()"></div>
|
|
1277
|
+
|
|
1278
|
+
<!-- Main Slider Panel -->
|
|
1279
|
+
<div
|
|
1280
|
+
class="ngx-drawer-panel"
|
|
1281
|
+
[class]="position()"
|
|
1282
|
+
[style.width]="isHorizontal() ? size() : '100%'"
|
|
1283
|
+
[style.height]="isVertical() ? size() : '100%'"
|
|
1284
|
+
role="dialog"
|
|
1285
|
+
aria-modal="true"
|
|
1286
|
+
>
|
|
1287
|
+
<!-- Header Section -->
|
|
1288
|
+
<div class="ngx-drawer-header">
|
|
1289
|
+
<ng-content select="[drawer-header]">
|
|
1290
|
+
<div class="ngx-drawer-header-default">
|
|
1291
|
+
<h2 class="ngx-drawer-title">{{ title() }}</h2>
|
|
1292
|
+
<button
|
|
1293
|
+
class="ngx-drawer-close-btn"
|
|
1294
|
+
(click)="closeDrawer()"
|
|
1295
|
+
aria-label="Close drawer"
|
|
1296
|
+
>
|
|
1297
|
+
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2">
|
|
1298
|
+
<line x1="18" y1="6" x2="6" y2="18" />
|
|
1299
|
+
<line x1="6" y1="6" x2="18" y2="18" />
|
|
1300
|
+
</svg>
|
|
1301
|
+
</button>
|
|
1302
|
+
</div>
|
|
1303
|
+
</ng-content>
|
|
1304
|
+
</div>
|
|
1305
|
+
|
|
1306
|
+
<!-- Body Section -->
|
|
1307
|
+
<div class="ngx-drawer-body">
|
|
1308
|
+
<ng-content></ng-content>
|
|
1309
|
+
</div>
|
|
1310
|
+
|
|
1311
|
+
<!-- Footer Section -->
|
|
1312
|
+
<div class="ngx-drawer-footer">
|
|
1313
|
+
<ng-content select="[drawer-footer]"></ng-content>
|
|
1314
|
+
</div>
|
|
1315
|
+
</div>
|
|
1316
|
+
</div>
|
|
1317
|
+
`, isInline: true, styles: [".ngx-drawer-container{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:1000;visibility:hidden;pointer-events:none;transition:visibility .28s ease;font-family:var(--ngx-font-family, system-ui, sans-serif)}.ngx-drawer-container.open{visibility:visible;pointer-events:auto}.ngx-drawer-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;background:#0f172a40;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);opacity:0;transition:opacity .28s ease}.ngx-drawer-container.open .ngx-drawer-backdrop{opacity:1}.ngx-drawer-panel{position:absolute;background:#ffffffd9;backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid rgba(255,255,255,.5);box-shadow:0 20px 25px -5px #0000001a,0 10px 10px -5px #0000000a;display:flex;flex-direction:column;transition:transform .32s cubic-bezier(.16,1,.3,1);box-sizing:border-box;z-index:1001}.ngx-drawer-panel.left{top:0;left:0;height:100%;transform:translate(-100%);border-right-width:1.5px}.ngx-drawer-panel.right{top:0;right:0;height:100%;transform:translate(100%);border-left-width:1.5px}.ngx-drawer-panel.top{top:0;left:0;width:100%;transform:translateY(-100%);border-bottom-width:1.5px}.ngx-drawer-panel.bottom{bottom:0;left:0;width:100%;transform:translateY(100%);border-top-width:1.5px}.ngx-drawer-container.open .ngx-drawer-panel.left,.ngx-drawer-container.open .ngx-drawer-panel.right{transform:translate(0)}.ngx-drawer-container.open .ngx-drawer-panel.top,.ngx-drawer-container.open .ngx-drawer-panel.bottom{transform:translateY(0)}.ngx-drawer-container.dark .ngx-drawer-panel{background:#1e2030e0;border-color:#ffffff14;color:#f8fafc;box-shadow:0 20px 25px -5px #0000004d}.ngx-drawer-header{padding:18px 24px;border-bottom:1px solid rgba(0,0,0,.06)}.ngx-drawer-container.dark .ngx-drawer-header{border-bottom-color:#ffffff0f}.ngx-drawer-header-default{display:flex;align-items:center;justify-content:space-between;width:100%}.ngx-drawer-title{margin:0;font-size:16px;font-weight:700;color:#0f172a}.ngx-drawer-container.dark .ngx-drawer-title{color:#f1f5f9}.ngx-drawer-close-btn{width:32px;height:32px;border-radius:50%;border:none;background:#00000008;color:#64748b;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s ease;padding:0}.ngx-drawer-close-btn:hover{background:#00000014;color:#0f172a}.ngx-drawer-container.dark .ngx-drawer-close-btn{background:#ffffff0d;color:#94a3b8}.ngx-drawer-container.dark .ngx-drawer-close-btn:hover{background:#ffffff1a;color:#f1f5f9}.ngx-drawer-body{padding:24px;flex-grow:1;overflow-y:auto}.ngx-drawer-footer{padding:16px 24px;border-top:1px solid rgba(0,0,0,.06);background:#00000003}.ngx-drawer-container.dark .ngx-drawer-footer{border-top-color:#ffffff0f;background:#ffffff03}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1318
|
+
}
|
|
1319
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DrawerComponent, decorators: [{
|
|
1320
|
+
type: Component,
|
|
1321
|
+
args: [{ selector: 'ngx-drawer', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1322
|
+
<div
|
|
1323
|
+
class="ngx-drawer-container"
|
|
1324
|
+
[class.open]="isOpen()"
|
|
1325
|
+
[class.dark]="theme() === 'dark'"
|
|
1326
|
+
[attr.aria-hidden]="!isOpen()"
|
|
1327
|
+
>
|
|
1328
|
+
<!-- Backdrop Blur Overlay -->
|
|
1329
|
+
<div class="ngx-drawer-backdrop" (click)="onBackdropClick()"></div>
|
|
1330
|
+
|
|
1331
|
+
<!-- Main Slider Panel -->
|
|
1332
|
+
<div
|
|
1333
|
+
class="ngx-drawer-panel"
|
|
1334
|
+
[class]="position()"
|
|
1335
|
+
[style.width]="isHorizontal() ? size() : '100%'"
|
|
1336
|
+
[style.height]="isVertical() ? size() : '100%'"
|
|
1337
|
+
role="dialog"
|
|
1338
|
+
aria-modal="true"
|
|
1339
|
+
>
|
|
1340
|
+
<!-- Header Section -->
|
|
1341
|
+
<div class="ngx-drawer-header">
|
|
1342
|
+
<ng-content select="[drawer-header]">
|
|
1343
|
+
<div class="ngx-drawer-header-default">
|
|
1344
|
+
<h2 class="ngx-drawer-title">{{ title() }}</h2>
|
|
1345
|
+
<button
|
|
1346
|
+
class="ngx-drawer-close-btn"
|
|
1347
|
+
(click)="closeDrawer()"
|
|
1348
|
+
aria-label="Close drawer"
|
|
1349
|
+
>
|
|
1350
|
+
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2">
|
|
1351
|
+
<line x1="18" y1="6" x2="6" y2="18" />
|
|
1352
|
+
<line x1="6" y1="6" x2="18" y2="18" />
|
|
1353
|
+
</svg>
|
|
1354
|
+
</button>
|
|
1355
|
+
</div>
|
|
1356
|
+
</ng-content>
|
|
1357
|
+
</div>
|
|
1358
|
+
|
|
1359
|
+
<!-- Body Section -->
|
|
1360
|
+
<div class="ngx-drawer-body">
|
|
1361
|
+
<ng-content></ng-content>
|
|
1362
|
+
</div>
|
|
1363
|
+
|
|
1364
|
+
<!-- Footer Section -->
|
|
1365
|
+
<div class="ngx-drawer-footer">
|
|
1366
|
+
<ng-content select="[drawer-footer]"></ng-content>
|
|
1367
|
+
</div>
|
|
1368
|
+
</div>
|
|
1369
|
+
</div>
|
|
1370
|
+
`, styles: [".ngx-drawer-container{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:1000;visibility:hidden;pointer-events:none;transition:visibility .28s ease;font-family:var(--ngx-font-family, system-ui, sans-serif)}.ngx-drawer-container.open{visibility:visible;pointer-events:auto}.ngx-drawer-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;background:#0f172a40;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);opacity:0;transition:opacity .28s ease}.ngx-drawer-container.open .ngx-drawer-backdrop{opacity:1}.ngx-drawer-panel{position:absolute;background:#ffffffd9;backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid rgba(255,255,255,.5);box-shadow:0 20px 25px -5px #0000001a,0 10px 10px -5px #0000000a;display:flex;flex-direction:column;transition:transform .32s cubic-bezier(.16,1,.3,1);box-sizing:border-box;z-index:1001}.ngx-drawer-panel.left{top:0;left:0;height:100%;transform:translate(-100%);border-right-width:1.5px}.ngx-drawer-panel.right{top:0;right:0;height:100%;transform:translate(100%);border-left-width:1.5px}.ngx-drawer-panel.top{top:0;left:0;width:100%;transform:translateY(-100%);border-bottom-width:1.5px}.ngx-drawer-panel.bottom{bottom:0;left:0;width:100%;transform:translateY(100%);border-top-width:1.5px}.ngx-drawer-container.open .ngx-drawer-panel.left,.ngx-drawer-container.open .ngx-drawer-panel.right{transform:translate(0)}.ngx-drawer-container.open .ngx-drawer-panel.top,.ngx-drawer-container.open .ngx-drawer-panel.bottom{transform:translateY(0)}.ngx-drawer-container.dark .ngx-drawer-panel{background:#1e2030e0;border-color:#ffffff14;color:#f8fafc;box-shadow:0 20px 25px -5px #0000004d}.ngx-drawer-header{padding:18px 24px;border-bottom:1px solid rgba(0,0,0,.06)}.ngx-drawer-container.dark .ngx-drawer-header{border-bottom-color:#ffffff0f}.ngx-drawer-header-default{display:flex;align-items:center;justify-content:space-between;width:100%}.ngx-drawer-title{margin:0;font-size:16px;font-weight:700;color:#0f172a}.ngx-drawer-container.dark .ngx-drawer-title{color:#f1f5f9}.ngx-drawer-close-btn{width:32px;height:32px;border-radius:50%;border:none;background:#00000008;color:#64748b;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s ease;padding:0}.ngx-drawer-close-btn:hover{background:#00000014;color:#0f172a}.ngx-drawer-container.dark .ngx-drawer-close-btn{background:#ffffff0d;color:#94a3b8}.ngx-drawer-container.dark .ngx-drawer-close-btn:hover{background:#ffffff1a;color:#f1f5f9}.ngx-drawer-body{padding:24px;flex-grow:1;overflow-y:auto}.ngx-drawer-footer{padding:16px 24px;border-top:1px solid rgba(0,0,0,.06);background:#00000003}.ngx-drawer-container.dark .ngx-drawer-footer{border-top-color:#ffffff0f;background:#ffffff03}\n"] }]
|
|
1371
|
+
}], ctorParameters: () => [], propDecorators: { onEscapeKey: [{
|
|
1372
|
+
type: HostListener,
|
|
1373
|
+
args: ['document:keydown.escape', ['$event']]
|
|
1374
|
+
}] } });
|
|
1375
|
+
|
|
448
1376
|
/*
|
|
449
1377
|
* Public API Surface — secondary entry point: ngx-core-components/layout
|
|
450
1378
|
*/
|
|
@@ -453,5 +1381,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
453
1381
|
* Generated bundle index. Do not edit.
|
|
454
1382
|
*/
|
|
455
1383
|
|
|
456
|
-
export { AccordionComponent, CardComponent, SplitterComponent, StepperComponent, TabComponent, TabStripComponent };
|
|
1384
|
+
export { AccordionComponent, CardComponent, CarouselComponent, DashboardLayoutComponent, DrawerComponent, SplitterComponent, StepperComponent, TabComponent, TabStripComponent };
|
|
457
1385
|
//# sourceMappingURL=ngx-core-components-layout.mjs.map
|