matcha-components 19.110.0 → 19.112.0

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.
@@ -1887,6 +1887,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
1887
1887
  args: ['size']
1888
1888
  }] } });
1889
1889
 
1890
+ class MatchaSkeletonComponent {
1891
+ constructor() {
1892
+ this.amount = 3;
1893
+ this.grid = 3;
1894
+ this.height = 100;
1895
+ this.model = 'empty';
1896
+ this.gap = 16;
1897
+ }
1898
+ get classes() {
1899
+ // if string parse to int
1900
+ this.amount = typeof this.amount === 'string' ? parseInt(this.amount) : this.amount;
1901
+ this.grid = typeof this.grid === 'string' ? parseInt(this.grid) : this.grid;
1902
+ let classes = `gap-${this.gap} `;
1903
+ this.amount > 1 ? classes += `grid-sm-${this.grid - 1} ` : classes;
1904
+ this.amount > 2 ? classes += `grid-md-${this.grid} ` : classes;
1905
+ return classes;
1906
+ }
1907
+ get heightClass() {
1908
+ return `h-${this.height}`;
1909
+ }
1910
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaSkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1911
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: MatchaSkeletonComponent, isStandalone: false, selector: "matcha-skeleton", inputs: { amount: "amount", grid: "grid", height: "height", model: "model", gap: "gap" }, ngImport: i0, template: "<ng-content></ng-content>\n<!-- CARD SKELETON -->\n<div [class]=\"classes\" *ngIf=\"model !== 'table'\">\n <div class=\"skeleton-animated-background flex-column--force p-0 radius-8 user-select-none\" *ngFor=\"let i of [].constructor(amount)\">\n <ng-container *ngIf=\"model === 'profile'\"><span class=\"h8 title p-16 m-0\"> <span class=\"radius-full background-surface-alpha h-48 w-48\"></span>&nbsp;</span></ng-container>\n\n <div [class]=\"'h-'+ height + ' flex-column--force p-16 background-bg-alpha'\"></div>\n\n <ng-container *ngIf=\"model === 'profile'\">\n <div class=\"flex-column--force\">\n <div class=\"flex-column--force p-16 gap-16\">\n <div class=\"w-100-p h-16 background-surface-alpha radius-full\"></div>\n <div class=\"w-100-p h-16 background-surface-alpha radius-full\"></div>\n </div>\n </div>\n </ng-container>\n </div>\n</div>\n<!-- CARD SKELETON -->\n\n<!-- TABLE SKELETON -->\n<div class=\"skeleton-animated-background w-100-p mr-16 flex-column--force p-0 radius-8 user-select-none\" *ngIf=\"model === 'table'\">\n\n <div class=\"flex-column--force h-64 background-surface-alpha\">\n <ng-container>&nbsp;</ng-container>\n </div>\n\n <ng-container *ngFor=\"let i of [].constructor(amount)\">\n <div class=\"grid-4 h-80 px-16 gap-16 flex-align-center--force\">\n <div class=\"w-100-p flex-row--force gap-16\">\n <div class=\"min-h-48 min-w-48 h-48 w-48 background-surface-alpha radius-full\"></div>\n <div class=\"w-100-p flex-column--force flex-center--force gap-16\">\n <div class=\"h-16 w-60-p background-surface-alpha radius-full\"></div>\n <div class=\"h-16 w-100-p background-surface-alpha radius-full\"></div>\n </div>\n </div>\n <div class=\"h-16 w-100-p flex-column--force background-surface-alpha radius-full\"></div>\n <div class=\"w-100-p flex-row--force gap-16\">\n <div class=\"w-100-p flex-column--force flex-center--force gap-16\">\n <div class=\"h-16 w-60-p background-surface-alpha radius-full\"></div>\n <div class=\"h-16 w-100-p background-surface-alpha radius-full\"></div>\n </div>\n </div>\n <div class=\"h-16 w-100-p flex-column--force background-surface-alpha radius-full\"></div>\n </div>\n\n <div class=\"grid-4 h-80 px-16 gap-16 flex-align-center--force background-bg-alpha\">\n <div class=\"w-100-p flex-row--force gap-16\">\n <div class=\"min-h-48 min-w-48 h-48 w-48 background-surface-alpha radius-full\"></div>\n <div class=\"w-100-p flex-column--force flex-center--force gap-16\">\n <div class=\"h-16 w-100-p background-surface-alpha radius-full\"></div>\n <div class=\"h-16 w-30-p background-surface-alpha radius-full\"></div>\n </div>\n </div>\n <div class=\"h-16 w-100-p flex-column--force background-surface-alpha radius-full\"></div>\n <div class=\"w-100-p flex-row--force gap-16\">\n <div class=\"w-100-p flex-column--force flex-center--force gap-16\">\n <div class=\"h-16 w-60-p background-surface-alpha radius-full\"></div>\n <div class=\"h-16 w-100-p background-surface-alpha radius-full\"></div>\n </div>\n </div>\n <div class=\"h-16 w-100-p flex-column--force background-surface-alpha radius-full\"></div>\n </div>\n\n </ng-container>\n\n</div>\n<!-- TABLE SKELETON -->", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
1912
+ }
1913
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaSkeletonComponent, decorators: [{
1914
+ type: Component,
1915
+ args: [{ selector: 'matcha-skeleton', standalone: false, template: "<ng-content></ng-content>\n<!-- CARD SKELETON -->\n<div [class]=\"classes\" *ngIf=\"model !== 'table'\">\n <div class=\"skeleton-animated-background flex-column--force p-0 radius-8 user-select-none\" *ngFor=\"let i of [].constructor(amount)\">\n <ng-container *ngIf=\"model === 'profile'\"><span class=\"h8 title p-16 m-0\"> <span class=\"radius-full background-surface-alpha h-48 w-48\"></span>&nbsp;</span></ng-container>\n\n <div [class]=\"'h-'+ height + ' flex-column--force p-16 background-bg-alpha'\"></div>\n\n <ng-container *ngIf=\"model === 'profile'\">\n <div class=\"flex-column--force\">\n <div class=\"flex-column--force p-16 gap-16\">\n <div class=\"w-100-p h-16 background-surface-alpha radius-full\"></div>\n <div class=\"w-100-p h-16 background-surface-alpha radius-full\"></div>\n </div>\n </div>\n </ng-container>\n </div>\n</div>\n<!-- CARD SKELETON -->\n\n<!-- TABLE SKELETON -->\n<div class=\"skeleton-animated-background w-100-p mr-16 flex-column--force p-0 radius-8 user-select-none\" *ngIf=\"model === 'table'\">\n\n <div class=\"flex-column--force h-64 background-surface-alpha\">\n <ng-container>&nbsp;</ng-container>\n </div>\n\n <ng-container *ngFor=\"let i of [].constructor(amount)\">\n <div class=\"grid-4 h-80 px-16 gap-16 flex-align-center--force\">\n <div class=\"w-100-p flex-row--force gap-16\">\n <div class=\"min-h-48 min-w-48 h-48 w-48 background-surface-alpha radius-full\"></div>\n <div class=\"w-100-p flex-column--force flex-center--force gap-16\">\n <div class=\"h-16 w-60-p background-surface-alpha radius-full\"></div>\n <div class=\"h-16 w-100-p background-surface-alpha radius-full\"></div>\n </div>\n </div>\n <div class=\"h-16 w-100-p flex-column--force background-surface-alpha radius-full\"></div>\n <div class=\"w-100-p flex-row--force gap-16\">\n <div class=\"w-100-p flex-column--force flex-center--force gap-16\">\n <div class=\"h-16 w-60-p background-surface-alpha radius-full\"></div>\n <div class=\"h-16 w-100-p background-surface-alpha radius-full\"></div>\n </div>\n </div>\n <div class=\"h-16 w-100-p flex-column--force background-surface-alpha radius-full\"></div>\n </div>\n\n <div class=\"grid-4 h-80 px-16 gap-16 flex-align-center--force background-bg-alpha\">\n <div class=\"w-100-p flex-row--force gap-16\">\n <div class=\"min-h-48 min-w-48 h-48 w-48 background-surface-alpha radius-full\"></div>\n <div class=\"w-100-p flex-column--force flex-center--force gap-16\">\n <div class=\"h-16 w-100-p background-surface-alpha radius-full\"></div>\n <div class=\"h-16 w-30-p background-surface-alpha radius-full\"></div>\n </div>\n </div>\n <div class=\"h-16 w-100-p flex-column--force background-surface-alpha radius-full\"></div>\n <div class=\"w-100-p flex-row--force gap-16\">\n <div class=\"w-100-p flex-column--force flex-center--force gap-16\">\n <div class=\"h-16 w-60-p background-surface-alpha radius-full\"></div>\n <div class=\"h-16 w-100-p background-surface-alpha radius-full\"></div>\n </div>\n </div>\n <div class=\"h-16 w-100-p flex-column--force background-surface-alpha radius-full\"></div>\n </div>\n\n </ng-container>\n\n</div>\n<!-- TABLE SKELETON -->" }]
1916
+ }], propDecorators: { amount: [{
1917
+ type: Input
1918
+ }], grid: [{
1919
+ type: Input
1920
+ }], height: [{
1921
+ type: Input
1922
+ }], model: [{
1923
+ type: Input
1924
+ }], gap: [{
1925
+ type: Input
1926
+ }] } });
1927
+
1890
1928
  class MatchaSlideToggleComponent {
1891
1929
  set checked(value) {
1892
1930
  const newCheckedState = value === '' ? true : !!value;
@@ -2134,11 +2172,11 @@ class MatchaTabsComponent {
2134
2172
  }
2135
2173
  }
2136
2174
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2137
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: MatchaTabsComponent, isStandalone: false, selector: "matcha-tabs", inputs: { activeTabIndex: "activeTabIndex" }, outputs: { tabSelected: "tabSelected" }, host: { listeners: { "keydown": "handleKeyboardEvent($event)" } }, queries: [{ propertyName: "tabs", predicate: MatchaTabItemComponent }], ngImport: i0, template: "<div class=\"flex-column gap-24 w-100-p\">\n <nav class=\"button-group grid-2 grid-sm-3 grid-md-6 gap-8 list-style-none pl-0\" role=\"tablist\">\n <button *ngFor=\"let tab of tabs; let i = index\" (click)=\"selectTabByIndex(i)\" \n [attr.aria-selected]=\"tab.active\" \n [attr.aria-controls]=\"'tab-content-' + i\" \n [ngClass]=\"{'active': tab.active}\"\n class=\"\n border-color-{{tab.active?'accent':'surface'}} background-surface\n cursor-pointer w-100-p b-2 radius-8 p-8 flex-column flex-align-center gap-4 flex-space-between\"\n role=\"tab\"\n tabindex=\"{{tab.active ? 0 : -1}}\">\n <matcha-icon [name]=\"tab.icon\" color=\"accent\" size=\"md\"></matcha-icon>\n <span class=\"text-label fw-900 fs-14 lh-16 line-clamp-2\">\n {{ tab.title }}\n </span>\n </button>\n </nav>\n\n <div>\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: MatchaIconComponent, selector: "matcha-icon", inputs: ["name", "size", "color", "class", "loading"] }], animations: [...createAnimations] }); }
2175
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: MatchaTabsComponent, isStandalone: false, selector: "matcha-tabs", inputs: { activeTabIndex: "activeTabIndex" }, outputs: { tabSelected: "tabSelected" }, host: { listeners: { "keydown": "handleKeyboardEvent($event)" } }, queries: [{ propertyName: "tabs", predicate: MatchaTabItemComponent }], ngImport: i0, template: "<div class=\"flex-column gap-24 w-100-p\">\n <nav class=\"button-group overflow-auto w-100-p flex-row gap-8 list-style-none pl-0 pb-4\" role=\"tablist\">\n <button *ngFor=\"let tab of tabs; let i = index\" (click)=\"selectTabByIndex(i)\" \n [attr.aria-selected]=\"tab.active\" \n [attr.aria-controls]=\"'tab-content-' + i\" \n [ngClass]=\"{'active': tab.active}\"\n class=\"\n border-color-{{tab.active?'accent':'surface'}} background-surface\n cursor-pointer w-100-p min-w-88 b-2 radius-8 p-8 flex-column flex-align-center gap-4 flex-space-between\"\n role=\"tab\"\n tabindex=\"{{tab.active ? 0 : -1}}\">\n <matcha-icon [name]=\"tab.icon\" color=\"accent\" size=\"md\"></matcha-icon>\n <span class=\"text-label fw-900 fs-14 lh-16 line-clamp-2\">\n {{ tab.title }}\n </span>\n </button>\n </nav>\n\n <div>\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: MatchaIconComponent, selector: "matcha-icon", inputs: ["name", "size", "color", "class", "loading"] }], animations: [...createAnimations] }); }
2138
2176
  }
2139
2177
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaTabsComponent, decorators: [{
2140
2178
  type: Component,
2141
- args: [{ selector: 'matcha-tabs', animations: [...createAnimations], standalone: false, template: "<div class=\"flex-column gap-24 w-100-p\">\n <nav class=\"button-group grid-2 grid-sm-3 grid-md-6 gap-8 list-style-none pl-0\" role=\"tablist\">\n <button *ngFor=\"let tab of tabs; let i = index\" (click)=\"selectTabByIndex(i)\" \n [attr.aria-selected]=\"tab.active\" \n [attr.aria-controls]=\"'tab-content-' + i\" \n [ngClass]=\"{'active': tab.active}\"\n class=\"\n border-color-{{tab.active?'accent':'surface'}} background-surface\n cursor-pointer w-100-p b-2 radius-8 p-8 flex-column flex-align-center gap-4 flex-space-between\"\n role=\"tab\"\n tabindex=\"{{tab.active ? 0 : -1}}\">\n <matcha-icon [name]=\"tab.icon\" color=\"accent\" size=\"md\"></matcha-icon>\n <span class=\"text-label fw-900 fs-14 lh-16 line-clamp-2\">\n {{ tab.title }}\n </span>\n </button>\n </nav>\n\n <div>\n <ng-content></ng-content>\n </div>\n</div>\n" }]
2179
+ args: [{ selector: 'matcha-tabs', animations: [...createAnimations], standalone: false, template: "<div class=\"flex-column gap-24 w-100-p\">\n <nav class=\"button-group overflow-auto w-100-p flex-row gap-8 list-style-none pl-0 pb-4\" role=\"tablist\">\n <button *ngFor=\"let tab of tabs; let i = index\" (click)=\"selectTabByIndex(i)\" \n [attr.aria-selected]=\"tab.active\" \n [attr.aria-controls]=\"'tab-content-' + i\" \n [ngClass]=\"{'active': tab.active}\"\n class=\"\n border-color-{{tab.active?'accent':'surface'}} background-surface\n cursor-pointer w-100-p min-w-88 b-2 radius-8 p-8 flex-column flex-align-center gap-4 flex-space-between\"\n role=\"tab\"\n tabindex=\"{{tab.active ? 0 : -1}}\">\n <matcha-icon [name]=\"tab.icon\" color=\"accent\" size=\"md\"></matcha-icon>\n <span class=\"text-label fw-900 fs-14 lh-16 line-clamp-2\">\n {{ tab.title }}\n </span>\n </button>\n </nav>\n\n <div>\n <ng-content></ng-content>\n </div>\n</div>\n" }]
2142
2180
  }], propDecorators: { tabs: [{
2143
2181
  type: ContentChildren,
2144
2182
  args: [MatchaTabItemComponent]
@@ -2468,6 +2506,658 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
2468
2506
  type: Input
2469
2507
  }] } });
2470
2508
 
2509
+ class MatchaDropListService {
2510
+ constructor() {
2511
+ this.dropZones = new Map();
2512
+ }
2513
+ registerDropZone(element, component) {
2514
+ this.dropZones.set(element, component);
2515
+ }
2516
+ unregisterDropZone(element) {
2517
+ this.dropZones.delete(element);
2518
+ }
2519
+ findDropZone(element) {
2520
+ while (element) {
2521
+ if (this.dropZones.has(element)) {
2522
+ return this.dropZones.get(element);
2523
+ }
2524
+ element = element.parentElement;
2525
+ }
2526
+ return null;
2527
+ }
2528
+ getAllDropZones() {
2529
+ return Array.from(this.dropZones.values());
2530
+ }
2531
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaDropListService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2532
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaDropListService, providedIn: 'root' }); }
2533
+ }
2534
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaDropListService, decorators: [{
2535
+ type: Injectable,
2536
+ args: [{
2537
+ providedIn: 'root'
2538
+ }]
2539
+ }] });
2540
+
2541
+ class MatchaDragDirective {
2542
+ get dragItemClass() {
2543
+ return true;
2544
+ }
2545
+ get dragDisabledClass() {
2546
+ return this.matchaDragDisabled;
2547
+ }
2548
+ constructor(elementRef, renderer, ngZone, dropListService) {
2549
+ this.elementRef = elementRef;
2550
+ this.renderer = renderer;
2551
+ this.ngZone = ngZone;
2552
+ this.dropListService = dropListService;
2553
+ this.matchaDragDisabled = false;
2554
+ this.listeners = [];
2555
+ this.isDragging = false;
2556
+ // Touch/Mobile support
2557
+ this.touchStartPosition = { x: 0, y: 0 };
2558
+ this.touchCurrentPosition = { x: 0, y: 0 };
2559
+ this.touchDragThreshold = 10; // pixels
2560
+ this.isTouchDragging = false;
2561
+ }
2562
+ ngOnInit() {
2563
+ this.setupDragEvents();
2564
+ }
2565
+ ngOnDestroy() {
2566
+ this.cleanupListeners();
2567
+ this.cleanupTouchDrag();
2568
+ }
2569
+ setDropList(dropList) {
2570
+ this.dropList = dropList;
2571
+ }
2572
+ setDragHandle(handle) {
2573
+ this.dragHandle = handle;
2574
+ this.setupDragEvents(); // Re-setup when handle is set
2575
+ }
2576
+ setupDragEvents() {
2577
+ if (this.matchaDragDisabled)
2578
+ return;
2579
+ this.cleanupListeners();
2580
+ const element = this.elementRef.nativeElement;
2581
+ const dragSource = this.dragHandle || element;
2582
+ // Configurar draggable para desktop
2583
+ if (this.dragHandle) {
2584
+ this.renderer.setAttribute(element, 'draggable', 'false');
2585
+ this.renderer.setAttribute(this.dragHandle, 'draggable', 'true');
2586
+ }
2587
+ else {
2588
+ this.renderer.setAttribute(element, 'draggable', 'true');
2589
+ }
2590
+ // Configurar touch-action para mobile
2591
+ this.renderer.setStyle(dragSource, 'touch-action', 'none');
2592
+ this.renderer.setStyle(dragSource, 'user-select', 'none');
2593
+ this.renderer.setStyle(dragSource, '-webkit-user-select', 'none');
2594
+ this.ngZone.runOutsideAngular(() => {
2595
+ // Desktop drag events
2596
+ this.listeners.push(this.renderer.listen(dragSource, 'dragstart', (event) => {
2597
+ if (this.matchaDragDisabled)
2598
+ return;
2599
+ this.onDragStart(event);
2600
+ }));
2601
+ this.listeners.push(this.renderer.listen(dragSource, 'dragend', () => {
2602
+ this.onDragEnd();
2603
+ }));
2604
+ this.listeners.push(this.renderer.listen(element, 'dragover', (event) => {
2605
+ event.preventDefault();
2606
+ }));
2607
+ // Mobile/Touch events
2608
+ this.listeners.push(this.renderer.listen(dragSource, 'touchstart', (event) => {
2609
+ if (this.matchaDragDisabled)
2610
+ return;
2611
+ this.onTouchStart(event);
2612
+ }));
2613
+ this.listeners.push(this.renderer.listen(dragSource, 'touchmove', (event) => {
2614
+ if (this.matchaDragDisabled)
2615
+ return;
2616
+ this.onTouchMove(event);
2617
+ }));
2618
+ this.listeners.push(this.renderer.listen(dragSource, 'touchend', (event) => {
2619
+ if (this.matchaDragDisabled)
2620
+ return;
2621
+ this.onTouchEnd(event);
2622
+ }));
2623
+ this.listeners.push(this.renderer.listen(dragSource, 'touchcancel', (event) => {
2624
+ if (this.matchaDragDisabled)
2625
+ return;
2626
+ this.onTouchCancel(event);
2627
+ }));
2628
+ });
2629
+ }
2630
+ // Desktop drag methods
2631
+ onDragStart(event) {
2632
+ this.isDragging = true;
2633
+ this.renderer.addClass(this.elementRef.nativeElement, 'matcha-drag-dragging');
2634
+ const dataTransfer = event.dataTransfer;
2635
+ if (dataTransfer) {
2636
+ dataTransfer.effectAllowed = 'move';
2637
+ dataTransfer.setData('text/plain', '');
2638
+ this.createDragImage(dataTransfer, this.elementRef.nativeElement, event);
2639
+ }
2640
+ if (this.dropList) {
2641
+ this.ngZone.run(() => {
2642
+ this.dropList.onDragStart(this, event);
2643
+ });
2644
+ }
2645
+ }
2646
+ onDragEnd() {
2647
+ this.isDragging = false;
2648
+ this.renderer.removeClass(this.elementRef.nativeElement, 'matcha-drag-dragging');
2649
+ if (this.dropList) {
2650
+ this.ngZone.run(() => {
2651
+ this.dropList.onDragEnd();
2652
+ });
2653
+ }
2654
+ }
2655
+ // Touch/Mobile drag methods
2656
+ onTouchStart(event) {
2657
+ const touch = event.touches[0];
2658
+ if (!touch)
2659
+ return;
2660
+ this.touchIdentifier = touch.identifier;
2661
+ this.touchStartPosition = { x: touch.clientX, y: touch.clientY };
2662
+ this.touchCurrentPosition = { x: touch.clientX, y: touch.clientY };
2663
+ this.isTouchDragging = false;
2664
+ // Prevenir scroll enquanto toca
2665
+ event.preventDefault();
2666
+ }
2667
+ onTouchMove(event) {
2668
+ if (this.touchIdentifier === undefined)
2669
+ return;
2670
+ const touch = this.findTouch(event.touches, this.touchIdentifier);
2671
+ if (!touch)
2672
+ return;
2673
+ this.touchCurrentPosition = { x: touch.clientX, y: touch.clientY };
2674
+ const deltaX = Math.abs(touch.clientX - this.touchStartPosition.x);
2675
+ const deltaY = Math.abs(touch.clientY - this.touchStartPosition.y);
2676
+ const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
2677
+ if (!this.isTouchDragging && distance > this.touchDragThreshold) {
2678
+ // Iniciar drag
2679
+ this.isTouchDragging = true;
2680
+ this.startTouchDrag(touch);
2681
+ }
2682
+ if (this.isTouchDragging) {
2683
+ this.updateTouchDrag(touch);
2684
+ event.preventDefault();
2685
+ }
2686
+ }
2687
+ onTouchEnd(event) {
2688
+ if (this.touchIdentifier === undefined)
2689
+ return;
2690
+ const touch = this.findTouch(event.changedTouches, this.touchIdentifier);
2691
+ if (!touch)
2692
+ return;
2693
+ if (this.isTouchDragging) {
2694
+ this.endTouchDrag(touch);
2695
+ }
2696
+ this.resetTouchState();
2697
+ }
2698
+ onTouchCancel(event) {
2699
+ if (this.isTouchDragging) {
2700
+ this.cancelTouchDrag();
2701
+ }
2702
+ this.resetTouchState();
2703
+ }
2704
+ startTouchDrag(touch) {
2705
+ this.isDragging = true;
2706
+ this.renderer.addClass(this.elementRef.nativeElement, 'matcha-drag-dragging');
2707
+ // Criar preview visual do drag
2708
+ this.createTouchDragPreview();
2709
+ if (this.dropList) {
2710
+ this.ngZone.run(() => {
2711
+ // Simular DragEvent para compatibilidade
2712
+ const fakeEvent = this.createFakeDragEvent('dragstart', touch);
2713
+ this.dropList.onDragStart(this, fakeEvent);
2714
+ });
2715
+ }
2716
+ }
2717
+ updateTouchDrag(touch) {
2718
+ if (this.dragPreview) {
2719
+ // Atualizar posição do preview
2720
+ this.renderer.setStyle(this.dragPreview, 'left', `${touch.clientX - 50}px`);
2721
+ this.renderer.setStyle(this.dragPreview, 'top', `${touch.clientY - 25}px`);
2722
+ }
2723
+ // Verificar drop zones
2724
+ this.checkDropZones(touch);
2725
+ }
2726
+ endTouchDrag(touch) {
2727
+ // Encontrar elemento sob o touch
2728
+ const elementBelow = document.elementFromPoint(touch.clientX, touch.clientY);
2729
+ const dropZone = this.findDropZone(elementBelow);
2730
+ if (dropZone && this.dropList) {
2731
+ this.ngZone.run(() => {
2732
+ // Simular drop event
2733
+ const fakeEvent = this.createFakeDragEvent('drop', touch);
2734
+ dropZone.handleTouchDrop(fakeEvent, this);
2735
+ });
2736
+ }
2737
+ this.cleanupTouchDrag();
2738
+ }
2739
+ cancelTouchDrag() {
2740
+ this.cleanupTouchDrag();
2741
+ }
2742
+ createTouchDragPreview() {
2743
+ const element = this.elementRef.nativeElement;
2744
+ const rect = element.getBoundingClientRect();
2745
+ // Criar clone do elemento para preview
2746
+ this.dragPreview = element.cloneNode(true);
2747
+ // Estilizar preview
2748
+ this.renderer.setStyle(this.dragPreview, 'position', 'fixed');
2749
+ this.renderer.setStyle(this.dragPreview, 'z-index', '9999');
2750
+ this.renderer.setStyle(this.dragPreview, 'pointer-events', 'none');
2751
+ this.renderer.setStyle(this.dragPreview, 'width', `${rect.width}px`);
2752
+ this.renderer.setStyle(this.dragPreview, 'height', `${rect.height}px`);
2753
+ this.renderer.setStyle(this.dragPreview, 'opacity', '0.8');
2754
+ this.renderer.setStyle(this.dragPreview, 'transform', 'rotate(5deg)');
2755
+ this.renderer.setStyle(this.dragPreview, 'box-shadow', '0 8px 25px rgba(0,0,0,0.3)');
2756
+ // Adicionar ao DOM
2757
+ document.body.appendChild(this.dragPreview);
2758
+ }
2759
+ checkDropZones(touch) {
2760
+ const elementBelow = document.elementFromPoint(touch.clientX, touch.clientY);
2761
+ const dropZone = this.findDropZone(elementBelow);
2762
+ // Notificar drop zones sobre o drag over
2763
+ if (dropZone && this.dropList) {
2764
+ this.ngZone.run(() => {
2765
+ const fakeEvent = this.createFakeDragEvent('dragover', touch);
2766
+ dropZone.handleTouchDragOver(fakeEvent);
2767
+ });
2768
+ }
2769
+ }
2770
+ findDropZone(element) {
2771
+ return this.dropListService.findDropZone(element);
2772
+ }
2773
+ findAngularComponent(element) {
2774
+ // Método mantido para compatibilidade, mas agora usa o serviço
2775
+ return this.dropListService.findDropZone(element);
2776
+ }
2777
+ createFakeDragEvent(type, touch) {
2778
+ return {
2779
+ type,
2780
+ clientX: touch.clientX,
2781
+ clientY: touch.clientY,
2782
+ preventDefault: () => { },
2783
+ dataTransfer: {
2784
+ effectAllowed: 'move',
2785
+ dropEffect: 'move',
2786
+ setData: () => { },
2787
+ getData: () => '',
2788
+ setDragImage: () => { }
2789
+ }
2790
+ };
2791
+ }
2792
+ findTouch(touches, identifier) {
2793
+ for (let i = 0; i < touches.length; i++) {
2794
+ if (touches[i].identifier === identifier) {
2795
+ return touches[i];
2796
+ }
2797
+ }
2798
+ return null;
2799
+ }
2800
+ resetTouchState() {
2801
+ this.touchIdentifier = undefined;
2802
+ this.isTouchDragging = false;
2803
+ this.isDragging = false;
2804
+ this.renderer.removeClass(this.elementRef.nativeElement, 'matcha-drag-dragging');
2805
+ if (this.dropList) {
2806
+ this.ngZone.run(() => {
2807
+ this.dropList.onDragEnd();
2808
+ });
2809
+ }
2810
+ }
2811
+ cleanupTouchDrag() {
2812
+ if (this.dragPreview) {
2813
+ document.body.removeChild(this.dragPreview);
2814
+ this.dragPreview = undefined;
2815
+ }
2816
+ }
2817
+ createDragImage(dataTransfer, element, event) {
2818
+ try {
2819
+ const rect = element.getBoundingClientRect();
2820
+ const offsetX = event.clientX - rect.left;
2821
+ const offsetY = event.clientY - rect.top;
2822
+ dataTransfer.setDragImage(element, offsetX, offsetY);
2823
+ }
2824
+ catch (error) {
2825
+ console.warn('Erro ao configurar drag image:', error);
2826
+ }
2827
+ }
2828
+ cleanupListeners() {
2829
+ this.listeners.forEach(cleanup => cleanup());
2830
+ this.listeners = [];
2831
+ }
2832
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaDragDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: MatchaDropListService }], target: i0.ɵɵFactoryTarget.Directive }); }
2833
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: MatchaDragDirective, isStandalone: false, selector: "[matchaDrag]", inputs: { matchaDragData: "matchaDragData", matchaDragDisabled: "matchaDragDisabled" }, host: { properties: { "class.matcha-drag-item": "this.dragItemClass", "class.matcha-drag-disabled": "this.dragDisabledClass" } }, ngImport: i0 }); }
2834
+ }
2835
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaDragDirective, decorators: [{
2836
+ type: Directive,
2837
+ args: [{
2838
+ selector: '[matchaDrag]',
2839
+ standalone: false
2840
+ }]
2841
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: MatchaDropListService }], propDecorators: { matchaDragData: [{
2842
+ type: Input
2843
+ }], matchaDragDisabled: [{
2844
+ type: Input
2845
+ }], dragItemClass: [{
2846
+ type: HostBinding,
2847
+ args: ['class.matcha-drag-item']
2848
+ }], dragDisabledClass: [{
2849
+ type: HostBinding,
2850
+ args: ['class.matcha-drag-disabled']
2851
+ }] } });
2852
+
2853
+ class MatchaDropListComponent {
2854
+ get dropListClass() {
2855
+ return true;
2856
+ }
2857
+ constructor(elementRef, renderer, dropListService) {
2858
+ this.elementRef = elementRef;
2859
+ this.renderer = renderer;
2860
+ this.dropListService = dropListService;
2861
+ this.matchaDropListData = [];
2862
+ this.matchaDropListDisabled = false;
2863
+ this.matchaDropListConnectedTo = [];
2864
+ this.matchaDropListSortingDisabled = false;
2865
+ this.matchaDropListDropped = new EventEmitter();
2866
+ this.dragStartIndex = -1;
2867
+ // Estado visual
2868
+ this.isReceivingDrag = false;
2869
+ this.showDropIndicator = false;
2870
+ this.dropIndicatorPosition = 0;
2871
+ this.canAcceptDrop = true; // Controla se pode aceitar o drop atual
2872
+ this.calculatedDropIndex = 0; // Armazenar o índice calculado durante o dragover
2873
+ }
2874
+ ngOnInit() {
2875
+ this.setupDropZone();
2876
+ // Registrar este drop zone no serviço
2877
+ this.dropListService.registerDropZone(this.elementRef.nativeElement, this);
2878
+ }
2879
+ ngAfterContentInit() {
2880
+ // Configurar referência do drop list para cada item drag
2881
+ this.dragItems.forEach(dragItem => {
2882
+ dragItem.setDropList(this);
2883
+ });
2884
+ // Monitorar mudanças nos itens drag
2885
+ this.dragItems.changes.subscribe(() => {
2886
+ this.dragItems.forEach(dragItem => {
2887
+ dragItem.setDropList(this);
2888
+ });
2889
+ });
2890
+ }
2891
+ ngOnDestroy() {
2892
+ // Desregistrar do serviço
2893
+ this.dropListService.unregisterDropZone(this.elementRef.nativeElement);
2894
+ // Cleanup automático via renderer
2895
+ }
2896
+ setupDropZone() {
2897
+ const element = this.elementRef.nativeElement;
2898
+ this.renderer.listen(element, 'dragover', (event) => {
2899
+ event.preventDefault();
2900
+ // Só mostrar efeitos visuais se o item vem de outro container
2901
+ if (this.currentDragItem && this.sourceContainer !== this) {
2902
+ this.isReceivingDrag = true;
2903
+ }
2904
+ // Verificar se pode aceitar o drop
2905
+ this.canAcceptDrop = this.canAcceptCurrentDrop();
2906
+ if (this.canAcceptDrop) {
2907
+ event.dataTransfer.dropEffect = 'move';
2908
+ // Mostrar linha indicadora
2909
+ this.updateDropIndicator(event);
2910
+ }
2911
+ else {
2912
+ event.dataTransfer.dropEffect = 'none';
2913
+ this.showDropIndicator = false;
2914
+ }
2915
+ });
2916
+ this.renderer.listen(element, 'dragenter', (event) => {
2917
+ event.preventDefault();
2918
+ // Só mostrar efeitos visuais se o item vem de outro container
2919
+ if (this.currentDragItem && this.sourceContainer !== this) {
2920
+ this.isReceivingDrag = true;
2921
+ }
2922
+ });
2923
+ this.renderer.listen(element, 'dragleave', (event) => {
2924
+ const rect = element.getBoundingClientRect();
2925
+ const x = event.clientX;
2926
+ const y = event.clientY;
2927
+ // Verificar se realmente saiu do container
2928
+ if (x < rect.left || x > rect.right || y < rect.top || y > rect.bottom) {
2929
+ this.isReceivingDrag = false;
2930
+ this.showDropIndicator = false;
2931
+ }
2932
+ });
2933
+ this.renderer.listen(element, 'drop', (event) => {
2934
+ event.preventDefault();
2935
+ this.handleDrop(event);
2936
+ });
2937
+ }
2938
+ updateDropIndicator(event) {
2939
+ if (!this.currentDragItem)
2940
+ return;
2941
+ const containerRect = this.elementRef.nativeElement.getBoundingClientRect();
2942
+ const y = event.clientY - containerRect.top;
2943
+ const dragItemElements = this.dragItems.toArray().map(item => item.elementRef.nativeElement);
2944
+ let indicatorY = 0;
2945
+ let dropIndex = 0;
2946
+ let found = false;
2947
+ for (let i = 0; i < dragItemElements.length; i++) {
2948
+ const itemRect = dragItemElements[i].getBoundingClientRect();
2949
+ const itemY = itemRect.top - containerRect.top;
2950
+ const itemHeight = itemRect.height;
2951
+ const itemCenter = itemY + itemHeight / 2;
2952
+ if (y < itemCenter) {
2953
+ indicatorY = itemY;
2954
+ dropIndex = i;
2955
+ found = true;
2956
+ break;
2957
+ }
2958
+ }
2959
+ if (!found && dragItemElements.length > 0) {
2960
+ // Posicionar no final da lista
2961
+ const lastItem = dragItemElements[dragItemElements.length - 1];
2962
+ const lastRect = lastItem.getBoundingClientRect();
2963
+ indicatorY = lastRect.bottom - containerRect.top;
2964
+ dropIndex = dragItemElements.length;
2965
+ }
2966
+ // Armazenar tanto a posição visual quanto o índice calculado
2967
+ this.dropIndicatorPosition = indicatorY;
2968
+ this.calculatedDropIndex = dropIndex;
2969
+ this.showDropIndicator = true;
2970
+ }
2971
+ // Métodos chamados pelo directive
2972
+ onDragStart(dragItem, event) {
2973
+ if (this.matchaDropListDisabled)
2974
+ return;
2975
+ this.currentDragItem = dragItem;
2976
+ this.sourceContainer = this;
2977
+ this.dragStartIndex = this.getDragItemIndex(dragItem);
2978
+ // Notificar containers conectados
2979
+ this.matchaDropListConnectedTo.forEach(container => {
2980
+ container.notifyDragStart(dragItem, this);
2981
+ });
2982
+ }
2983
+ onDragEnd() {
2984
+ this.currentDragItem = undefined;
2985
+ this.sourceContainer = undefined;
2986
+ this.dragStartIndex = -1;
2987
+ this.isReceivingDrag = false;
2988
+ this.showDropIndicator = false;
2989
+ this.calculatedDropIndex = 0;
2990
+ // Notificar containers conectados
2991
+ this.matchaDropListConnectedTo.forEach(container => {
2992
+ container.notifyDragEnd();
2993
+ });
2994
+ }
2995
+ handleDrop(event) {
2996
+ if (!this.currentDragItem || this.matchaDropListDisabled)
2997
+ return;
2998
+ // Verificar se pode aceitar o drop
2999
+ if (!this.canAcceptCurrentDrop()) {
3000
+ this.showDropIndicator = false;
3001
+ this.isReceivingDrag = false;
3002
+ return;
3003
+ }
3004
+ this.showDropIndicator = false;
3005
+ this.isReceivingDrag = false;
3006
+ // Usar o índice já calculado durante o dragover ao invés de recalcular
3007
+ const dropIndex = this.calculatedDropIndex;
3008
+ if (this.sourceContainer === this) {
3009
+ // Drop na mesma lista - reordenar
3010
+ if (!this.matchaDropListSortingDisabled && dropIndex !== this.dragStartIndex) {
3011
+ this.reorderItems(this.dragStartIndex, dropIndex);
3012
+ }
3013
+ }
3014
+ else if (this.sourceContainer) {
3015
+ // Drop entre listas - transferir
3016
+ this.transferItem(this.currentDragItem, this.sourceContainer, this, dropIndex);
3017
+ }
3018
+ }
3019
+ reorderItems(fromIndex, toIndex) {
3020
+ const newData = [...this.matchaDropListData];
3021
+ const item = newData[fromIndex];
3022
+ // Remover item da posição original
3023
+ newData.splice(fromIndex, 1);
3024
+ // Calcular nova posição
3025
+ const insertIndex = toIndex > fromIndex ? toIndex - 1 : toIndex;
3026
+ // Inserir na nova posição
3027
+ newData.splice(insertIndex, 0, item);
3028
+ this.matchaDropListData = newData;
3029
+ // Emitir evento
3030
+ this.matchaDropListDropped.emit({
3031
+ previousIndex: fromIndex,
3032
+ currentIndex: insertIndex,
3033
+ item,
3034
+ container: this,
3035
+ data: this.matchaDropListData
3036
+ });
3037
+ }
3038
+ transferItem(dragItem, sourceContainer, targetContainer, targetIndex) {
3039
+ const item = dragItem.matchaDragData;
3040
+ const sourceIndex = sourceContainer.dragStartIndex;
3041
+ // Remover do container origem
3042
+ const sourceData = [...sourceContainer.matchaDropListData];
3043
+ sourceData.splice(sourceIndex, 1);
3044
+ sourceContainer.matchaDropListData = sourceData;
3045
+ // Adicionar ao container destino
3046
+ const targetData = [...targetContainer.matchaDropListData];
3047
+ targetData.splice(targetIndex, 0, item);
3048
+ targetContainer.matchaDropListData = targetData;
3049
+ // Emitir eventos
3050
+ targetContainer.matchaDropListDropped.emit({
3051
+ previousIndex: sourceIndex,
3052
+ currentIndex: targetIndex,
3053
+ item,
3054
+ container: targetContainer,
3055
+ previousContainer: sourceContainer,
3056
+ data: targetContainer.matchaDropListData
3057
+ });
3058
+ sourceContainer.matchaDropListDropped.emit({
3059
+ previousIndex: sourceIndex,
3060
+ currentIndex: -1,
3061
+ item,
3062
+ container: sourceContainer,
3063
+ data: sourceContainer.matchaDropListData
3064
+ });
3065
+ }
3066
+ getDragItemIndex(dragItem) {
3067
+ return this.dragItems.toArray().indexOf(dragItem);
3068
+ }
3069
+ // Métodos para comunicação entre containers conectados
3070
+ notifyDragStart(dragItem, sourceContainer) {
3071
+ this.currentDragItem = dragItem;
3072
+ this.sourceContainer = sourceContainer;
3073
+ this.dragStartIndex = sourceContainer.getDragItemIndex(dragItem);
3074
+ }
3075
+ notifyDragEnd() {
3076
+ this.currentDragItem = undefined;
3077
+ this.sourceContainer = undefined;
3078
+ this.dragStartIndex = -1;
3079
+ this.isReceivingDrag = false;
3080
+ this.showDropIndicator = false;
3081
+ this.calculatedDropIndex = 0;
3082
+ }
3083
+ canAcceptCurrentDrop() {
3084
+ if (!this.currentDragItem || !this.sourceContainer) {
3085
+ return false;
3086
+ }
3087
+ if (this.matchaDropListAcceptPredicate) {
3088
+ const sourceContainer = this.sourceContainer;
3089
+ const targetContainer = this;
3090
+ const item = this.currentDragItem.matchaDragData;
3091
+ return this.matchaDropListAcceptPredicate(item, sourceContainer, targetContainer);
3092
+ }
3093
+ return true;
3094
+ }
3095
+ // Métodos para suporte touch/mobile
3096
+ handleTouchDragOver(event) {
3097
+ // Só mostrar efeitos visuais se o item vem de outro container
3098
+ if (this.currentDragItem && this.sourceContainer !== this) {
3099
+ this.isReceivingDrag = true;
3100
+ }
3101
+ // Verificar se pode aceitar o drop
3102
+ this.canAcceptDrop = this.canAcceptCurrentDrop();
3103
+ if (this.canAcceptDrop) {
3104
+ // Mostrar linha indicadora
3105
+ this.updateDropIndicator(event);
3106
+ }
3107
+ else {
3108
+ this.showDropIndicator = false;
3109
+ }
3110
+ }
3111
+ handleTouchDrop(event, dragItem) {
3112
+ if (!this.currentDragItem || this.matchaDropListDisabled)
3113
+ return;
3114
+ // Verificar se pode aceitar o drop
3115
+ if (!this.canAcceptCurrentDrop()) {
3116
+ this.showDropIndicator = false;
3117
+ this.isReceivingDrag = false;
3118
+ return;
3119
+ }
3120
+ this.showDropIndicator = false;
3121
+ this.isReceivingDrag = false;
3122
+ // Usar o índice já calculado durante o dragover
3123
+ const dropIndex = this.calculatedDropIndex;
3124
+ if (this.sourceContainer === this) {
3125
+ // Drop na mesma lista - reordenar
3126
+ if (!this.matchaDropListSortingDisabled && dropIndex !== this.dragStartIndex) {
3127
+ this.reorderItems(this.dragStartIndex, dropIndex);
3128
+ }
3129
+ }
3130
+ else if (this.sourceContainer) {
3131
+ // Drop entre listas - transferir
3132
+ this.transferItem(this.currentDragItem, this.sourceContainer, this, dropIndex);
3133
+ }
3134
+ }
3135
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaDropListComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: MatchaDropListService }], target: i0.ɵɵFactoryTarget.Component }); }
3136
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: MatchaDropListComponent, isStandalone: false, selector: "matcha-drop-list", inputs: { matchaDropListData: "matchaDropListData", matchaDropListDisabled: "matchaDropListDisabled", matchaDropListConnectedTo: "matchaDropListConnectedTo", matchaDropListSortingDisabled: "matchaDropListSortingDisabled", matchaDropListAcceptPredicate: "matchaDropListAcceptPredicate" }, outputs: { matchaDropListDropped: "matchaDropListDropped" }, host: { properties: { "class.matcha-drop-list": "this.dropListClass" } }, queries: [{ propertyName: "dragItems", predicate: MatchaDragDirective }], ngImport: i0, template: "<div class=\"matcha-drop-list-container\"\n [class.matcha-drop-list-receiving]=\"isReceivingDrag\"\n [class.matcha-drop-list-disabled]=\"matchaDropListDisabled\"\n [class.matcha-drop-list-can-accept]=\"isReceivingDrag && canAcceptDrop\"\n [class.matcha-drop-list-cannot-accept]=\"isReceivingDrag && !canAcceptDrop\">\n <ng-content></ng-content>\n\n <!-- Linha indicadora de drop -->\n <div class=\"matcha-drop-indicator\"\n [class.active]=\"showDropIndicator && canAcceptDrop\"\n [style.top.px]=\"dropIndicatorPosition\">\n </div>\n\n <!-- Placeholder para lista vazia -->\n <div *ngIf=\"isReceivingDrag && dragItems.length === 0\"\n class=\"matcha-drop-list-placeholder\">\n <div class=\"matcha-drop-list-empty-placeholder\"\n [class.can-accept]=\"canAcceptDrop\"\n [class.cannot-accept]=\"!canAcceptDrop\">\n <span [class.i-matcha-action_sign_success]=\"canAcceptDrop\"\n [class.i-matcha-action_sign_error]=\"!canAcceptDrop\"\n [class.color-green]=\"canAcceptDrop\"\n [class.color-red]=\"!canAcceptDrop\"\n class=\"i-size-lg\"></span>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
3137
+ }
3138
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaDropListComponent, decorators: [{
3139
+ type: Component,
3140
+ args: [{ selector: 'matcha-drop-list', standalone: false, template: "<div class=\"matcha-drop-list-container\"\n [class.matcha-drop-list-receiving]=\"isReceivingDrag\"\n [class.matcha-drop-list-disabled]=\"matchaDropListDisabled\"\n [class.matcha-drop-list-can-accept]=\"isReceivingDrag && canAcceptDrop\"\n [class.matcha-drop-list-cannot-accept]=\"isReceivingDrag && !canAcceptDrop\">\n <ng-content></ng-content>\n\n <!-- Linha indicadora de drop -->\n <div class=\"matcha-drop-indicator\"\n [class.active]=\"showDropIndicator && canAcceptDrop\"\n [style.top.px]=\"dropIndicatorPosition\">\n </div>\n\n <!-- Placeholder para lista vazia -->\n <div *ngIf=\"isReceivingDrag && dragItems.length === 0\"\n class=\"matcha-drop-list-placeholder\">\n <div class=\"matcha-drop-list-empty-placeholder\"\n [class.can-accept]=\"canAcceptDrop\"\n [class.cannot-accept]=\"!canAcceptDrop\">\n <span [class.i-matcha-action_sign_success]=\"canAcceptDrop\"\n [class.i-matcha-action_sign_error]=\"!canAcceptDrop\"\n [class.color-green]=\"canAcceptDrop\"\n [class.color-red]=\"!canAcceptDrop\"\n class=\"i-size-lg\"></span>\n </div>\n </div>\n</div>\n" }]
3141
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: MatchaDropListService }], propDecorators: { matchaDropListData: [{
3142
+ type: Input
3143
+ }], matchaDropListDisabled: [{
3144
+ type: Input
3145
+ }], matchaDropListConnectedTo: [{
3146
+ type: Input
3147
+ }], matchaDropListSortingDisabled: [{
3148
+ type: Input
3149
+ }], matchaDropListAcceptPredicate: [{
3150
+ type: Input
3151
+ }], matchaDropListDropped: [{
3152
+ type: Output
3153
+ }], dragItems: [{
3154
+ type: ContentChildren,
3155
+ args: [MatchaDragDirective]
3156
+ }], dropListClass: [{
3157
+ type: HostBinding,
3158
+ args: ['class.matcha-drop-list']
3159
+ }] } });
3160
+
2471
3161
  class MatchaTooltipDirective {
2472
3162
  constructor(el, renderer) {
2473
3163
  this.el = el;
@@ -3867,38 +4557,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
3867
4557
  }]
3868
4558
  }] });
3869
4559
 
3870
- class MatchaTreeDirective {
3871
- constructor(_elementRef, _renderer) {
3872
- this._elementRef = _elementRef;
3873
- this._renderer = _renderer;
3874
- //this._elementRef.nativeElement.style.backgroundColor = 'grey';
3875
- this._renderer.addClass(this._elementRef.nativeElement, 'matcha-tree');
3876
- }
3877
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaTreeDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
3878
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: MatchaTreeDirective, isStandalone: false, selector: "[matchaTree]", ngImport: i0 }); }
3879
- }
3880
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaTreeDirective, decorators: [{
3881
- type: Directive,
3882
- args: [{
3883
- selector: '[matchaTree]',
3884
- standalone: false
3885
- }]
3886
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }] });
3887
-
3888
- class MatchaTreeModule {
3889
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaTreeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3890
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.8", ngImport: i0, type: MatchaTreeModule, declarations: [MatchaTreeDirective], imports: [CommonModule], exports: [MatchaTreeDirective] }); }
3891
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaTreeModule, imports: [CommonModule] }); }
3892
- }
3893
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaTreeModule, decorators: [{
3894
- type: NgModule,
3895
- args: [{
3896
- declarations: [MatchaTreeDirective],
3897
- imports: [CommonModule],
3898
- exports: [MatchaTreeDirective],
3899
- }]
3900
- }] });
3901
-
3902
4560
  class MatchaDateModule {
3903
4561
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3904
4562
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.8", ngImport: i0, type: MatchaDateModule, declarations: [MatchaDateComponent], imports: [CommonModule,
@@ -4020,6 +4678,64 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
4020
4678
  }]
4021
4679
  }] });
4022
4680
 
4681
+ class MatchaDragHandleDirective {
4682
+ get dragHandleClass() {
4683
+ return true;
4684
+ }
4685
+ constructor(elementRef, dragDirective) {
4686
+ this.elementRef = elementRef;
4687
+ this.dragDirective = dragDirective;
4688
+ }
4689
+ ngOnInit() {
4690
+ this.dragDirective.setDragHandle(this.elementRef.nativeElement);
4691
+ }
4692
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaDragHandleDirective, deps: [{ token: i0.ElementRef }, { token: MatchaDragDirective }], target: i0.ɵɵFactoryTarget.Directive }); }
4693
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: MatchaDragHandleDirective, isStandalone: false, selector: "[matchaDragHandle]", host: { properties: { "class.matcha-drag-handle": "this.dragHandleClass" } }, ngImport: i0 }); }
4694
+ }
4695
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaDragHandleDirective, decorators: [{
4696
+ type: Directive,
4697
+ args: [{
4698
+ selector: '[matchaDragHandle]',
4699
+ standalone: false
4700
+ }]
4701
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: MatchaDragDirective }], propDecorators: { dragHandleClass: [{
4702
+ type: HostBinding,
4703
+ args: ['class.matcha-drag-handle']
4704
+ }] } });
4705
+
4706
+ class MatchaDropListModule {
4707
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaDropListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4708
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.8", ngImport: i0, type: MatchaDropListModule, declarations: [MatchaDropListComponent,
4709
+ MatchaDragDirective,
4710
+ MatchaDragHandleDirective], imports: [CommonModule], exports: [MatchaDropListComponent,
4711
+ MatchaDragDirective,
4712
+ MatchaDragHandleDirective] }); }
4713
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaDropListModule, providers: [
4714
+ MatchaDropListService
4715
+ ], imports: [CommonModule] }); }
4716
+ }
4717
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaDropListModule, decorators: [{
4718
+ type: NgModule,
4719
+ args: [{
4720
+ declarations: [
4721
+ MatchaDropListComponent,
4722
+ MatchaDragDirective,
4723
+ MatchaDragHandleDirective
4724
+ ],
4725
+ imports: [
4726
+ CommonModule
4727
+ ],
4728
+ exports: [
4729
+ MatchaDropListComponent,
4730
+ MatchaDragDirective,
4731
+ MatchaDragHandleDirective
4732
+ ],
4733
+ providers: [
4734
+ MatchaDropListService
4735
+ ]
4736
+ }]
4737
+ }] });
4738
+
4023
4739
  // import { MatchaInputPhoneModule } from './matcha-input-phone/input-phone.module';
4024
4740
  class MatchaComponentsModule {
4025
4741
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
@@ -4063,9 +4779,9 @@ class MatchaComponentsModule {
4063
4779
  MatchaTabsModule,
4064
4780
  MatchaTitleModule,
4065
4781
  MatchaTooltipModule,
4066
- MatchaTreeModule,
4067
4782
  MatchaDateModule,
4068
- MatchaTimeModule], exports: [MatchaAccordionModule,
4783
+ MatchaTimeModule,
4784
+ MatchaDropListModule], exports: [MatchaAccordionModule,
4069
4785
  //MatchaAutocompleteModule,
4070
4786
  MatchaBadgeModule,
4071
4787
  MatchaButtonModule,
@@ -4102,9 +4818,9 @@ class MatchaComponentsModule {
4102
4818
  MatchaTabsModule,
4103
4819
  MatchaTitleModule,
4104
4820
  MatchaTooltipModule,
4105
- MatchaTreeModule,
4106
4821
  MatchaDateModule,
4107
- MatchaTimeModule] }); }
4822
+ MatchaTimeModule,
4823
+ MatchaDropListModule] }); }
4108
4824
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaComponentsModule, imports: [CommonModule,
4109
4825
  FormsModule,
4110
4826
  ReactiveFormsModule,
@@ -4145,9 +4861,9 @@ class MatchaComponentsModule {
4145
4861
  MatchaTabsModule,
4146
4862
  MatchaTitleModule,
4147
4863
  MatchaTooltipModule,
4148
- MatchaTreeModule,
4149
4864
  MatchaDateModule,
4150
- MatchaTimeModule, MatchaAccordionModule,
4865
+ MatchaTimeModule,
4866
+ MatchaDropListModule, MatchaAccordionModule,
4151
4867
  //MatchaAutocompleteModule,
4152
4868
  MatchaBadgeModule,
4153
4869
  MatchaButtonModule,
@@ -4184,9 +4900,9 @@ class MatchaComponentsModule {
4184
4900
  MatchaTabsModule,
4185
4901
  MatchaTitleModule,
4186
4902
  MatchaTooltipModule,
4187
- MatchaTreeModule,
4188
4903
  MatchaDateModule,
4189
- MatchaTimeModule] }); }
4904
+ MatchaTimeModule,
4905
+ MatchaDropListModule] }); }
4190
4906
  }
4191
4907
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaComponentsModule, decorators: [{
4192
4908
  type: NgModule,
@@ -4233,9 +4949,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
4233
4949
  MatchaTabsModule,
4234
4950
  MatchaTitleModule,
4235
4951
  MatchaTooltipModule,
4236
- MatchaTreeModule,
4237
4952
  MatchaDateModule,
4238
4953
  MatchaTimeModule,
4954
+ MatchaDropListModule
4239
4955
  ],
4240
4956
  exports: [MatchaAccordionModule,
4241
4957
  //MatchaAutocompleteModule,
@@ -4274,10 +4990,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
4274
4990
  MatchaTabsModule,
4275
4991
  MatchaTitleModule,
4276
4992
  MatchaTooltipModule,
4277
- MatchaTreeModule,
4278
4993
  MatchaDateModule,
4279
4994
  MatchaTimeModule,
4995
+ MatchaDropListModule,
4996
+ ],
4997
+ }]
4998
+ }] });
4999
+
5000
+ class MatchaSkeletonModule {
5001
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaSkeletonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
5002
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.8", ngImport: i0, type: MatchaSkeletonModule, declarations: [MatchaSkeletonComponent], imports: [CommonModule], exports: [MatchaSkeletonComponent] }); }
5003
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaSkeletonModule, imports: [CommonModule] }); }
5004
+ }
5005
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: MatchaSkeletonModule, decorators: [{
5006
+ type: NgModule,
5007
+ args: [{
5008
+ declarations: [MatchaSkeletonComponent],
5009
+ imports: [
5010
+ CommonModule
4280
5011
  ],
5012
+ exports: [MatchaSkeletonComponent],
4281
5013
  }]
4282
5014
  }] });
4283
5015
 
@@ -4328,5 +5060,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
4328
5060
  * Generated bundle index. Do not edit.
4329
5061
  */
4330
5062
 
4331
- export { MatchaAccordionComponent, MatchaAccordionContentComponent, MatchaAccordionHeaderComponent, MatchaAccordionItemComponent, MatchaAccordionModule, MatchaBadgeDirective, MatchaBadgeModule, MatchaButtonComponent, MatchaButtonModule, MatchaButtonToggleComponent, MatchaButtonToggleModule, MatchaCardComponent, MatchaCardModule, MatchaCheckboxComponent, MatchaCheckboxModule, MatchaChipsDirective, MatchaChipsModule, MatchaComponentsModule, MatchaDateComponent, MatchaDateModule, MatchaDatepickerDirective, MatchaDatepickerModule, MatchaDividerComponent, MatchaDividerModule, MatchaElevationDirective, MatchaElevationModule, MatchaErrorComponent, MatchaFormFieldComponent, MatchaFormFieldModule, MatchaGridComponent, MatchaGridModule, MatchaHintTextComponent, MatchaHintTextModule, MatchaIconComponent, MatchaIconModule, MatchaInfiniteScrollComponent, MatchaInfiniteScrollDataComponent, MatchaInfiniteScrollModule, MatchaInputDirective, MatchaInputModule, MatchaLabelComponent, MatchaMasonryComponent, MatchaMasonryModule, MatchaMenuComponent, MatchaMenuModule, MatchaMenuTriggerForDirective, MatchaModalComponent, MatchaModalContentComponent, MatchaModalFooterComponent, MatchaModalHeaderComponent, MatchaModalModule, MatchaModalOptionsComponent, MatchaModalService, MatchaOverlayService, MatchaPaginatorDirective, MatchaPaginatorModule, MatchaProgressBarDirective, MatchaProgressBarModule, MatchaRadioButtonDirective, MatchaRadioButtonModule, MatchaRippleDirective, MatchaRippleModule, MatchaSelectDirective, MatchaSelectModule, MatchaSidenavDirective, MatchaSidenavModule, MatchaSlideToggleComponent, MatchaSlideToggleModule, MatchaSliderDirective, MatchaSliderModule, MatchaSnackBarDirective, MatchaSnackBarModule, MatchaSortHeaderDirective, MatchaSortHeaderModule, MatchaSpinComponent, MatchaSpinModule, MatchaStepperComponent, MatchaStepperContentComponent, MatchaStepperControllerComponent, MatchaStepperModule, MatchaTabItemComponent, MatchaTableDirective, MatchaTableModule, MatchaTabsComponent, MatchaTabsModule, MatchaTimeComponent, MatchaTimeModule, MatchaTitleComponent, MatchaTitleModule, MatchaToolbarButtonComponent, MatchaToolbarComponent, MatchaToolbarContentComponent, MatchaToolbarCustomButtonComponent, MatchaToolbarMainButtonComponent, MatchaToolbarModule, MatchaTooltipDirective, MatchaTooltipModule, MatchaTreeDirective, MatchaTreeModule, NextStepDirective, PrevStepDirective, StepComponent, StepContentDirective };
5063
+ export { MatchaAccordionComponent, MatchaAccordionContentComponent, MatchaAccordionHeaderComponent, MatchaAccordionItemComponent, MatchaAccordionModule, MatchaBadgeDirective, MatchaBadgeModule, MatchaButtonComponent, MatchaButtonModule, MatchaButtonToggleComponent, MatchaButtonToggleModule, MatchaCardComponent, MatchaCardModule, MatchaCheckboxComponent, MatchaCheckboxModule, MatchaChipsDirective, MatchaChipsModule, MatchaComponentsModule, MatchaDateComponent, MatchaDateModule, MatchaDatepickerDirective, MatchaDatepickerModule, MatchaDividerComponent, MatchaDividerModule, MatchaDragDirective, MatchaDragHandleDirective, MatchaDropListComponent, MatchaDropListModule, MatchaElevationDirective, MatchaElevationModule, MatchaErrorComponent, MatchaFormFieldComponent, MatchaFormFieldModule, MatchaGridComponent, MatchaGridModule, MatchaHintTextComponent, MatchaHintTextModule, MatchaIconComponent, MatchaIconModule, MatchaInfiniteScrollComponent, MatchaInfiniteScrollDataComponent, MatchaInfiniteScrollModule, MatchaInputDirective, MatchaInputModule, MatchaLabelComponent, MatchaMasonryComponent, MatchaMasonryModule, MatchaMenuComponent, MatchaMenuModule, MatchaMenuTriggerForDirective, MatchaModalComponent, MatchaModalContentComponent, MatchaModalFooterComponent, MatchaModalHeaderComponent, MatchaModalModule, MatchaModalOptionsComponent, MatchaModalService, MatchaOverlayService, MatchaPaginatorDirective, MatchaPaginatorModule, MatchaProgressBarDirective, MatchaProgressBarModule, MatchaRadioButtonDirective, MatchaRadioButtonModule, MatchaRippleDirective, MatchaRippleModule, MatchaSelectDirective, MatchaSelectModule, MatchaSidenavDirective, MatchaSidenavModule, MatchaSkeletonComponent, MatchaSkeletonModule, MatchaSlideToggleComponent, MatchaSlideToggleModule, MatchaSliderDirective, MatchaSliderModule, MatchaSnackBarDirective, MatchaSnackBarModule, MatchaSortHeaderDirective, MatchaSortHeaderModule, MatchaSpinComponent, MatchaSpinModule, MatchaStepperComponent, MatchaStepperContentComponent, MatchaStepperControllerComponent, MatchaStepperModule, MatchaTabItemComponent, MatchaTableDirective, MatchaTableModule, MatchaTabsComponent, MatchaTabsModule, MatchaTimeComponent, MatchaTimeModule, MatchaTitleComponent, MatchaTitleModule, MatchaToolbarButtonComponent, MatchaToolbarComponent, MatchaToolbarContentComponent, MatchaToolbarCustomButtonComponent, MatchaToolbarMainButtonComponent, MatchaToolbarModule, MatchaTooltipDirective, MatchaTooltipModule, NextStepDirective, PrevStepDirective, StepComponent, StepContentDirective };
4332
5064
  //# sourceMappingURL=matcha-components.mjs.map