matcha-components 20.63.0 → 20.65.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.
@@ -9647,6 +9647,24 @@ class MatchaChipComponent {
9647
9647
  /** Evento emitido quando o chip é destruído */
9648
9648
  this.destroyed = new EventEmitter();
9649
9649
  }
9650
+ ngAfterViewInit() {
9651
+ this._setupChipRemoveDirective();
9652
+ }
9653
+ _setupChipRemoveDirective() {
9654
+ // Usa event delegation para capturar cliques em elementos com matchaChipRemove
9655
+ this._elementRef.nativeElement.addEventListener('click', (event) => {
9656
+ const target = event.target;
9657
+ if (target && target.hasAttribute('matchaChipRemove')) {
9658
+ event.stopPropagation();
9659
+ if (this.removable && !this.disabled) {
9660
+ this.remove();
9661
+ }
9662
+ }
9663
+ });
9664
+ }
9665
+ hasCustomRemoveIcon() {
9666
+ return this._elementRef.nativeElement.querySelector('[matchaChipRemove]') !== null;
9667
+ }
9650
9668
  /** Manipula o clique no chip */
9651
9669
  _handleClick(event) {
9652
9670
  if (this.disabled) {
@@ -9699,11 +9717,11 @@ class MatchaChipComponent {
9699
9717
  this.destroyed.emit(this);
9700
9718
  }
9701
9719
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: MatchaChipComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
9702
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.7", type: MatchaChipComponent, isStandalone: false, selector: "matcha-chip", inputs: { color: "color", selected: "selected", selectable: "selectable", removable: "removable", disabled: "disabled", value: "value" }, outputs: { selectedChange: "selectedChange", removed: "removed", destroyed: "destroyed" }, host: { listeners: { "click": "_handleClick($event)", "keydown": "_handleKeydown($event)" }, properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "<span class=\"matcha-chip-content fs-14 fw-700 lh-20 color-label\">\n <ng-content></ng-content>\n</span>\n<ng-container *ngIf=\"removable\">\n <matcha-divider direction=\"vertical\" gap=\"0\"></matcha-divider>\n <button \n\n type=\"button\"\n class=\"matcha-chip-remove d-flex align-items-center justify-content-center w-20 h-20 min-w-20 radius-full cursor-pointer border-0 background-transparent p-0 m-0\"\n [disabled]=\"disabled\"\n (click)=\"remove(); $event.stopPropagation()\"\n tabindex=\"-1\"\n aria-label=\"Remove\">\n <matcha-icon name=\"close\" class=\"fs-14\" color=\"label\"></matcha-icon>\n </button>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatchaDividerComponent, selector: "matcha-divider", inputs: ["gap", "gap-sm", "gap-md", "gap-lg", "gap-xl", "direction"] }, { kind: "component", type: MatchaIconComponent, selector: "matcha-icon", inputs: ["name", "size", "color", "class", "loading"] }] }); }
9720
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.7", type: MatchaChipComponent, isStandalone: false, selector: "matcha-chip", inputs: { color: "color", selected: "selected", selectable: "selectable", removable: "removable", disabled: "disabled", value: "value" }, outputs: { selectedChange: "selectedChange", removed: "removed", destroyed: "destroyed" }, host: { listeners: { "click": "_handleClick($event)", "keydown": "_handleKeydown($event)" }, properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "<span class=\"matcha-chip-content fs-14 fw-700 lh-20 color-label\">\n <ng-content></ng-content>\n</span>\n<ng-container *ngIf=\"removable && !hasCustomRemoveIcon()\">\n <matcha-divider direction=\"vertical\" gap=\"0\"></matcha-divider>\n <button \n type=\"button\"\n class=\"matcha-chip-remove d-flex align-items-center justify-content-center w-20 h-20 min-w-20 radius-full cursor-pointer border-0 background-transparent p-0 m-0\"\n [disabled]=\"disabled\"\n (click)=\"remove(); $event.stopPropagation()\"\n tabindex=\"-1\"\n aria-label=\"Remove\">\n <matcha-icon name=\"close\" class=\"fs-14\" color=\"label\"></matcha-icon>\n </button>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatchaDividerComponent, selector: "matcha-divider", inputs: ["gap", "gap-sm", "gap-md", "gap-lg", "gap-xl", "direction"] }, { kind: "component", type: MatchaIconComponent, selector: "matcha-icon", inputs: ["name", "size", "color", "class", "loading"] }] }); }
9703
9721
  }
9704
9722
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: MatchaChipComponent, decorators: [{
9705
9723
  type: Component,
9706
- args: [{ selector: 'matcha-chip', standalone: false, template: "<span class=\"matcha-chip-content fs-14 fw-700 lh-20 color-label\">\n <ng-content></ng-content>\n</span>\n<ng-container *ngIf=\"removable\">\n <matcha-divider direction=\"vertical\" gap=\"0\"></matcha-divider>\n <button \n\n type=\"button\"\n class=\"matcha-chip-remove d-flex align-items-center justify-content-center w-20 h-20 min-w-20 radius-full cursor-pointer border-0 background-transparent p-0 m-0\"\n [disabled]=\"disabled\"\n (click)=\"remove(); $event.stopPropagation()\"\n tabindex=\"-1\"\n aria-label=\"Remove\">\n <matcha-icon name=\"close\" class=\"fs-14\" color=\"label\"></matcha-icon>\n </button>\n</ng-container>\n" }]
9724
+ args: [{ selector: 'matcha-chip', standalone: false, template: "<span class=\"matcha-chip-content fs-14 fw-700 lh-20 color-label\">\n <ng-content></ng-content>\n</span>\n<ng-container *ngIf=\"removable && !hasCustomRemoveIcon()\">\n <matcha-divider direction=\"vertical\" gap=\"0\"></matcha-divider>\n <button \n type=\"button\"\n class=\"matcha-chip-remove d-flex align-items-center justify-content-center w-20 h-20 min-w-20 radius-full cursor-pointer border-0 background-transparent p-0 m-0\"\n [disabled]=\"disabled\"\n (click)=\"remove(); $event.stopPropagation()\"\n tabindex=\"-1\"\n aria-label=\"Remove\">\n <matcha-icon name=\"close\" class=\"fs-14\" color=\"label\"></matcha-icon>\n </button>\n</ng-container>\n" }]
9707
9725
  }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { color: [{
9708
9726
  type: Input
9709
9727
  }], selected: [{
@@ -9827,8 +9845,6 @@ class MatchaChipListComponent {
9827
9845
  }
9828
9846
  /** Manipula a remoção de um chip */
9829
9847
  _onChipRemoved(chip, index) {
9830
- // Emite evento de remoção para o componente pai gerenciar
9831
- // O componente pai deve remover o item do array para que o *ngFor re-renderize
9832
9848
  this._updateValue();
9833
9849
  }
9834
9850
  /** Atualiza o valor baseado nos chips selecionados */