matcha-components 20.163.0 → 20.166.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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, Output, HostBinding, Input, Component, ContentChildren, ElementRef, Renderer2, Inject, ViewEncapsulation, ChangeDetectionStrategy, HostListener, ContentChild, Directive, forwardRef, ViewChild, InjectionToken, inject, Injectable, TemplateRef, Optional, NgModule, createComponent, Pipe, PLATFORM_ID } from '@angular/core';
2
+ import { InjectionToken, EventEmitter, Output, HostBinding, Input, Component, ContentChildren, ElementRef, Renderer2, Inject, ViewEncapsulation, ChangeDetectionStrategy, HostListener, ContentChild, Directive, forwardRef, ViewChild, inject, Injectable, TemplateRef, Optional, NgModule, createComponent, Pipe, PLATFORM_ID } from '@angular/core';
3
3
  import { animation, style, animate, trigger, transition, useAnimation, state, query, stagger, animateChild, sequence, group } from '@angular/animations';
4
4
  import { Subscription, Subject, BehaviorSubject, fromEvent, of } from 'rxjs';
5
5
  import { debounceTime, takeUntil, filter, startWith, map, distinctUntilChanged } from 'rxjs/operators';
@@ -13,7 +13,7 @@ import * as i1$1 from '@angular/common/http';
13
13
  * Token de injeção para MatchaOptionParent
14
14
  * Usado para injetar o componente pai no matcha-option
15
15
  */
16
- const MATCHA_OPTION_PARENT = Symbol('MatchaOptionParent');
16
+ const MATCHA_OPTION_PARENT = new InjectionToken('MatchaOptionParent');
17
17
 
18
18
  const customAnimation = animation([
19
19
  style({
@@ -3202,17 +3202,14 @@ class MatchaTabsComponent {
3202
3202
  }
3203
3203
  }
3204
3204
  handleKeyboardEvent(event) {
3205
+ // Ignorar se o evento vier de um input, textarea ou select
3206
+ const target = event.target;
3207
+ if (['INPUT', 'TEXTAREA', 'SELECT'].includes(target.tagName) || target.isContentEditable) {
3208
+ return;
3209
+ }
3205
3210
  const tabsArray = this.tabs.toArray();
3206
3211
  const currentIndex = tabsArray.findIndex(tab => tab.active);
3207
- if (event.key === 'ArrowRight') {
3208
- const nextIndex = (currentIndex + 1) % tabsArray.length;
3209
- this.selectTabByIndex(nextIndex);
3210
- }
3211
- else if (event.key === 'ArrowLeft') {
3212
- const prevIndex = (currentIndex - 1 + tabsArray.length) % tabsArray.length;
3213
- this.selectTabByIndex(prevIndex);
3214
- }
3215
- else if (event.key === 'Home') {
3212
+ if (event.key === 'Home') {
3216
3213
  this.selectTabByIndex(0);
3217
3214
  }
3218
3215
  else if (event.key === 'End') {
@@ -8507,18 +8504,11 @@ class MatchaOptionComponent {
8507
8504
  onClick() {
8508
8505
  if (this.disabled)
8509
8506
  return;
8510
- console.log('MatchaOption: Clique na opção', {
8511
- value: this.value,
8512
- parent: this.parent,
8513
- disabled: this.disabled
8514
- });
8515
8507
  // ✅ Notifica o pai (se houver) - qualquer componente que implemente MatchaOptionParent
8516
8508
  if (this.parent) {
8517
- console.log('MatchaOption: Usando parent.selectOption');
8518
8509
  this.parent.selectOption(this);
8519
8510
  }
8520
8511
  else {
8521
- console.log('MatchaOption: Usando fallback findParentAndSelect');
8522
8512
  // Fallback: busca o pai via DOM
8523
8513
  this.findParentAndSelect();
8524
8514
  }
@@ -8531,27 +8521,20 @@ class MatchaOptionComponent {
8531
8521
  const autocompleteEl = this.elRef.nativeElement.closest('matcha-autocomplete');
8532
8522
  const selectEl = this.elRef.nativeElement.closest('matcha-select');
8533
8523
  if (autocompleteEl) {
8534
- console.log('MatchaOption: Encontrou autocomplete element', autocompleteEl);
8535
8524
  // Dispara um evento customizado que o autocomplete pode escutar
8536
8525
  const event = new CustomEvent('matcha-option-selected', {
8537
8526
  detail: { option: this, value: this.value },
8538
8527
  bubbles: true
8539
8528
  });
8540
8529
  autocompleteEl.dispatchEvent(event);
8541
- console.log('MatchaOption: Evento customizado disparado', event);
8542
8530
  }
8543
8531
  else if (selectEl) {
8544
- console.log('MatchaOption: Encontrou select element', selectEl);
8545
8532
  // Dispara um evento customizado que o select pode escutar
8546
8533
  const event = new CustomEvent('matcha-option-selected', {
8547
8534
  detail: { option: this, value: this.value },
8548
8535
  bubbles: true
8549
8536
  });
8550
8537
  selectEl.dispatchEvent(event);
8551
- console.log('MatchaOption: Evento customizado disparado para select', event);
8552
- }
8553
- else {
8554
- console.log('MatchaOption: Não encontrou elemento pai (autocomplete ou select)');
8555
8538
  }
8556
8539
  }
8557
8540
  onKeydown(ev) {
@@ -8614,26 +8597,70 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
8614
8597
  }] } });
8615
8598
 
8616
8599
  class MatchaPanelComponent {
8617
- constructor(elRef, cdr) {
8600
+ constructor(elRef, renderer, cdr) {
8618
8601
  this.elRef = elRef;
8602
+ this.renderer = renderer;
8619
8603
  this.cdr = cdr;
8620
8604
  this.placement = 'auto';
8621
8605
  this.maxHeight = 280;
8622
8606
  this.minWidth = 160;
8623
8607
  this.offset = 4; // Espaçamento entre trigger e painel
8624
8608
  this.open = false;
8609
+ this.hasOverlay = true; // Mantido por compatibilidade, mas sem efeito visual de backdrop
8625
8610
  this.opened = new EventEmitter();
8626
8611
  this.closed = new EventEmitter();
8627
- this.panelStyle = {};
8612
+ // Estado de posicionamento
8613
+ this.panePosition = { top: 0, left: 0, width: 0, maxHeight: 280 };
8614
+ this.actualPlacement = 'bottom';
8615
+ this.isPositioned = false;
8628
8616
  this.destroy$ = new Subject();
8617
+ // Listener manual para scroll com capture: true
8618
+ // Atualização SÍNCRONA para eliminar "dancing/jitter" (efeito de atraso de 1 frame)
8619
+ this.scrollListener = (event) => {
8620
+ if (!this.open)
8621
+ return;
8622
+ this.updatePosition();
8623
+ };
8629
8624
  }
8630
8625
  ngOnInit() {
8631
- // Inicialização básica
8626
+ // Escutar evento global de fechamento de todos os painéis
8627
+ this.globalListener = this.renderer.listen('document', 'matcha-panel-open-global', (event) => {
8628
+ if (event.detail?.source !== this && this.open) {
8629
+ this.closePanel();
8630
+ }
8631
+ });
8632
+ // Escutar cliques fora do painel
8633
+ this.clickListener = this.renderer.listen('document', 'click', (event) => {
8634
+ if (!this.open)
8635
+ return;
8636
+ const target = event.target;
8637
+ // Verificar se clicou dentro do painel (via ViewChild pois *ngIf recria)
8638
+ const panelEl = this.panelRef?.nativeElement;
8639
+ const isInsidePanel = panelEl?.contains(target);
8640
+ const isInsideTrigger = this.triggerElement?.contains(target);
8641
+ if (!isInsidePanel && !isInsideTrigger) {
8642
+ this.closePanel();
8643
+ }
8644
+ });
8645
+ // Registrar listener de scroll com capture para detectar scroll em QUALQUER container
8646
+ window.addEventListener('scroll', this.scrollListener, true);
8632
8647
  }
8633
8648
  ngOnDestroy() {
8634
8649
  this.destroy$.next();
8635
8650
  this.destroy$.complete();
8636
- this.cleanupListeners();
8651
+ if (this.globalListener) {
8652
+ this.globalListener();
8653
+ }
8654
+ if (this.clickListener) {
8655
+ this.clickListener();
8656
+ }
8657
+ window.removeEventListener('scroll', this.scrollListener, true);
8658
+ // this.cleanupPortal(); // Removed
8659
+ }
8660
+ onWindowResize() {
8661
+ if (this.open) {
8662
+ this.closePanel();
8663
+ }
8637
8664
  }
8638
8665
  /**
8639
8666
  * Anexa o painel a um elemento trigger
@@ -8641,22 +8668,17 @@ class MatchaPanelComponent {
8641
8668
  attachTo(trigger) {
8642
8669
  this.triggerElement = trigger;
8643
8670
  }
8644
- ngAfterViewInit() {
8645
- // Aguarda a view ser inicializada antes de calcular posição
8646
- if (this.triggerElement && this.open) {
8647
- this.cdr.detectChanges();
8648
- this.updatePosition();
8649
- }
8650
- }
8651
- /**
8652
- * Lifecycle hook para detectar mudanças no triggerElement
8653
- */
8671
+ // ngAfterViewInit() { // Removed
8672
+ // // Garantir que o painel esteja no body desde o início para evitar clipping
8673
+ // if (this.panelRef) {
8674
+ // this.renderer.appendChild(document.body, this.panelRef.nativeElement);
8675
+ // }
8676
+ // if (this.triggerElement && this.open) {
8677
+ // this.updatePosition(); // Apenas atualiza posição se já nascer aberto
8678
+ // }
8679
+ // }
8654
8680
  ngOnChanges() {
8655
- // Só logar quando há mudanças significativas
8656
8681
  if (this.triggerElement && this.open) {
8657
- console.log('MatchaPanel: ngOnChanges - painel aberto, atualizando posição');
8658
- // Usar detectChanges para forçar a detecção de mudanças
8659
- this.cdr.detectChanges();
8660
8682
  this.updatePosition();
8661
8683
  }
8662
8684
  }
@@ -8665,27 +8687,38 @@ class MatchaPanelComponent {
8665
8687
  */
8666
8688
  openPanel() {
8667
8689
  if (!this.triggerElement) {
8668
- console.log('MatchaPanel: triggerElement não encontrado');
8669
8690
  return;
8670
8691
  }
8671
- // Força a detecção de mudanças antes de atualizar a posição
8692
+ this.open = true;
8693
+ this.isPositioned = false; // Oculta até calcular
8694
+ // Notificar outros painéis para fecharem
8695
+ const event = new CustomEvent('matcha-panel-open-global', {
8696
+ detail: { source: this }
8697
+ });
8698
+ document.dispatchEvent(event);
8699
+ // Forçar renderização (aguardar *ngIf)
8672
8700
  this.cdr.detectChanges();
8701
+ // Garantir que está no body (caso ngAfterViewInit não tenha rodado ou algo tenha removido)
8702
+ // if (this.panelRef && this.panelRef.nativeElement.parentNode !== document.body) { // Removed
8703
+ // this.renderer.appendChild(document.body, this.panelRef.nativeElement); // Removed
8704
+ // }
8705
+ // Calcular posição inicial
8673
8706
  this.updatePosition();
8674
- this.setupListeners();
8707
+ // Revelar painel
8708
+ this.isPositioned = true;
8675
8709
  this.opened.emit();
8676
8710
  }
8677
8711
  /**
8678
8712
  * Fecha o painel
8679
8713
  */
8680
8714
  closePanel() {
8681
- console.log('MatchaPanel: Fechando painel', {
8682
- open: this.open,
8683
- triggerElement: this.triggerElement,
8684
- stackTrace: new Error().stack
8685
- });
8686
- this.cleanupListeners();
8715
+ if (!this.open) {
8716
+ return;
8717
+ }
8718
+ this.open = false;
8719
+ this.isPositioned = false;
8720
+ // Scroll lock removido
8687
8721
  this.closed.emit();
8688
- // Forçar detecção de mudanças para garantir que o painel seja fechado
8689
8722
  this.cdr.detectChanges();
8690
8723
  }
8691
8724
  /**
@@ -8695,116 +8728,157 @@ class MatchaPanelComponent {
8695
8728
  this.open ? this.closePanel() : this.openPanel();
8696
8729
  }
8697
8730
  /**
8698
- * Atualiza a posição do painel (simplificado para absolute)
8731
+ * Atualiza a posição do painel
8732
+ */
8733
+ /**
8734
+ * Atualiza a posição do painel
8735
+ * @param sync Se true, atualiza imediatamente (usado no scroll). Se false/undefined, usa microtask (usado na abertura).
8699
8736
  */
8700
8737
  updatePosition() {
8701
- if (!this.triggerElement) {
8702
- console.log('MatchaPanel: updatePosition - triggerElement não encontrado');
8738
+ if (!this.triggerElement || !this.open) {
8703
8739
  return;
8704
8740
  }
8741
+ // const runUpdate = () => { // Removed runUpdate wrapper
8742
+ if (!this.triggerElement || !this.open)
8743
+ return;
8705
8744
  const position = this.calculatePosition();
8706
- this.panelStyle = {
8707
- // top: `${position.top}px`,
8708
- // left: `${position.left}px`,
8709
- // minWidth: `${position.width}px`,
8710
- top: 0,
8745
+ this.actualPlacement = position.actualPlacement;
8746
+ this.panePosition = {
8747
+ top: 0, // Resetar top/left para usar transform
8711
8748
  left: 0,
8712
- width: '100%',
8713
- maxHeight: `${position.maxHeight || this.maxHeight}px`,
8714
- zIndex: 1
8749
+ width: position.width,
8750
+ maxHeight: position.maxHeight || this.maxHeight
8715
8751
  };
8752
+ // Aplicação DIRETA no DOM usando TRANSFORM (GPU) para Zero-Lag
8753
+ if (this.paneRef) {
8754
+ const style = this.paneRef.nativeElement.style;
8755
+ // Usar translate3d força aceleração de hardware
8756
+ style.transform = `translate3d(${position.left}px, ${position.top}px, 0)`;
8757
+ style.width = `${position.width}px`;
8758
+ style.top = '0px';
8759
+ style.left = '0px';
8760
+ }
8761
+ // Detectar mudanças para atualizar classes (bindings)
8762
+ this.cdr.detectChanges();
8716
8763
  }
8717
8764
  /**
8718
- * Calcula a posição ideal do painel (simplificado para absolute)
8765
+ * Calcula a posição ideal do painel baseado no espaço disponível
8719
8766
  */
8720
8767
  calculatePosition() {
8721
- if (!this.triggerElement) {
8722
- return { top: 0, left: 0, width: this.minWidth };
8723
- }
8724
8768
  const rect = this.triggerElement.getBoundingClientRect();
8725
- const containerRect = this.triggerElement.offsetParent?.getBoundingClientRect() || { top: 0, left: 0 };
8769
+ const viewportHeight = window.innerHeight;
8770
+ const viewportWidth = window.innerWidth;
8771
+ const margin = 10;
8726
8772
  let top;
8727
8773
  let left;
8728
8774
  let width = Math.max(rect.width, this.minWidth);
8729
8775
  let maxHeight = this.maxHeight;
8730
- // Calcular posição horizontal (relativa ao container)
8731
- left = rect.left - containerRect.left;
8732
- // Calcular posição vertical (relativa ao container)
8733
- if (this.placement === 'top') {
8734
- // Posicionar acima
8735
- top = rect.top - containerRect.top - this.maxHeight - this.offset;
8776
+ let placement = 'bottom';
8777
+ let actualHeight = 0;
8778
+ // Determinar se deve abrir para cima ou para baixo
8779
+ const spaceBelow = viewportHeight - rect.bottom - margin;
8780
+ const spaceAbove = rect.top - margin;
8781
+ // Lógica de decisão de direção
8782
+ if (this.placement === 'top' || (this.placement === 'auto' && spaceBelow < Math.min(this.maxHeight, 100) && spaceAbove > spaceBelow)) {
8783
+ placement = 'top';
8784
+ maxHeight = Math.min(this.maxHeight, spaceAbove);
8785
+ // Medir altura real do conteúdo para evitar buraco (gap)
8786
+ // Se o conteúdo for menor que maxHeight, usamos a altura real
8787
+ const contentHeight = this.panelRef?.nativeElement.offsetHeight || maxHeight;
8788
+ actualHeight = Math.min(contentHeight, maxHeight);
8789
+ top = rect.top - actualHeight - this.offset;
8736
8790
  }
8737
8791
  else {
8738
- // Posicionar abaixo (padrão)
8739
- top = rect.bottom - containerRect.top + this.offset;
8792
+ placement = 'bottom';
8793
+ maxHeight = Math.min(this.maxHeight, spaceBelow);
8794
+ top = rect.bottom + this.offset;
8740
8795
  }
8741
- return { top, left, width, maxHeight };
8742
- }
8743
- /**
8744
- * Configura listeners para scroll e resize
8745
- */
8746
- setupListeners() {
8747
- // Com position absolute, não precisamos de listeners de scroll/resize
8748
- console.log('MatchaPanel: setupListeners - position absolute, sem listeners necessários');
8749
- }
8750
- /**
8751
- * Remove listeners
8752
- */
8753
- cleanupListeners() {
8754
- if (this.scrollListener) {
8755
- window.removeEventListener('scroll', this.scrollListener);
8756
- this.scrollListener = undefined;
8757
- }
8758
- if (this.resizeListener) {
8759
- window.removeEventListener('resize', this.resizeListener);
8760
- this.resizeListener = undefined;
8761
- }
8762
- }
8763
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaPanelComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
8764
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", type: MatchaPanelComponent, isStandalone: false, selector: "matcha-panel", inputs: { placement: "placement", maxHeight: "maxHeight", minWidth: "minWidth", offset: "offset", triggerElement: "triggerElement", open: "open" }, outputs: { opened: "opened", closed: "closed" }, viewQueries: [{ propertyName: "panelRef", first: true, predicate: ["panel"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
8765
- <div class="matcha-panel-container" style="position: relative;">
8766
- <ng-container *ngIf="open">
8767
- <!-- Painel -->
8768
- <div
8769
- #panel
8770
- class="matcha-panel"
8771
- [class.matcha-panel-top]="placement === 'top'"
8772
- [class.matcha-panel-bottom]="placement === 'bottom'"
8773
- [ngStyle]="panelStyle"
8774
- role="listbox"
8775
- [attr.aria-expanded]="open"
8776
- [attr.aria-hidden]="!open">
8777
- <ng-content></ng-content>
8796
+ // Posicionamento horizontal (tentar alinhar à esquerda do trigger)
8797
+ left = rect.left;
8798
+ // Garantir que não saia da tela horizontalmente
8799
+ if (left + width > viewportWidth - margin) {
8800
+ left = viewportWidth - width - margin;
8801
+ }
8802
+ if (left < margin) {
8803
+ left = margin;
8804
+ width = Math.min(width, viewportWidth - 2 * margin);
8805
+ }
8806
+ // Fallback de segurança se algo der errado nas medidas
8807
+ if (isNaN(top) || isNaN(left)) {
8808
+ top = 20;
8809
+ left = 20;
8810
+ }
8811
+ return { top, left, width, maxHeight, actualPlacement: placement };
8812
+ }
8813
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaPanelComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
8814
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", type: MatchaPanelComponent, isStandalone: false, selector: "matcha-panel", inputs: { placement: "placement", maxHeight: "maxHeight", minWidth: "minWidth", offset: "offset", triggerElement: "triggerElement", open: "open", hasOverlay: "hasOverlay" }, outputs: { opened: "opened", closed: "closed" }, host: { listeners: { "window:resize": "onWindowResize()" } }, viewQueries: [{ propertyName: "panelRef", first: true, predicate: ["panel"], descendants: true }, { propertyName: "paneRef", first: true, predicate: ["pane"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
8815
+ <!-- Container âncora (referência local) -->
8816
+ <div class="matcha-panel-anchor" style="display: none;"></div>
8817
+
8818
+ <!-- Estrutura Overlay Local (Material-Like) -->
8819
+ <!-- Carrega apenas quando aberto (*ngIf) e usa position: fixed para escapar do overflow -->
8820
+ <div *ngIf="open" class="matcha-panel-overlay">
8821
+ <!-- Pane de Posicionamento (Absolute dentro do Fixed) -->
8822
+ <div #pane class="matcha-panel-pane"
8823
+ [style.top.px]="panePosition.top"
8824
+ [style.left.px]="panePosition.left"
8825
+ [style.width.px]="panePosition.width"
8826
+ [style.visibility]="isPositioned ? 'visible' : 'hidden'">
8827
+
8828
+ <!-- Painel (Conteúdo scrollável) -->
8829
+ <div #panel
8830
+ class="matcha-panel"
8831
+ [class.matcha-panel-top]="actualPlacement === 'top'"
8832
+ [class.matcha-panel-bottom]="actualPlacement === 'bottom'"
8833
+ [class.matcha-panel-open]="open"
8834
+ [style.max-height.px]="panePosition.maxHeight"
8835
+ role="listbox"
8836
+ [attr.aria-expanded]="open"
8837
+ [attr.aria-hidden]="!open"
8838
+ (mousedown)="$event.stopPropagation()"> <!-- Impedir fechamento ao clicar no scroll/painel -->
8839
+ <ng-content></ng-content>
8840
+ </div>
8778
8841
  </div>
8779
- </ng-container>
8780
8842
  </div>
8781
- `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] }); }
8843
+ `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
8782
8844
  }
8783
8845
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaPanelComponent, decorators: [{
8784
8846
  type: Component,
8785
8847
  args: [{
8786
8848
  selector: 'matcha-panel',
8787
8849
  template: `
8788
- <div class="matcha-panel-container" style="position: relative;">
8789
- <ng-container *ngIf="open">
8790
- <!-- Painel -->
8791
- <div
8792
- #panel
8793
- class="matcha-panel"
8794
- [class.matcha-panel-top]="placement === 'top'"
8795
- [class.matcha-panel-bottom]="placement === 'bottom'"
8796
- [ngStyle]="panelStyle"
8797
- role="listbox"
8798
- [attr.aria-expanded]="open"
8799
- [attr.aria-hidden]="!open">
8800
- <ng-content></ng-content>
8850
+ <!-- Container âncora (referência local) -->
8851
+ <div class="matcha-panel-anchor" style="display: none;"></div>
8852
+
8853
+ <!-- Estrutura Overlay Local (Material-Like) -->
8854
+ <!-- Carrega apenas quando aberto (*ngIf) e usa position: fixed para escapar do overflow -->
8855
+ <div *ngIf="open" class="matcha-panel-overlay">
8856
+ <!-- Pane de Posicionamento (Absolute dentro do Fixed) -->
8857
+ <div #pane class="matcha-panel-pane"
8858
+ [style.top.px]="panePosition.top"
8859
+ [style.left.px]="panePosition.left"
8860
+ [style.width.px]="panePosition.width"
8861
+ [style.visibility]="isPositioned ? 'visible' : 'hidden'">
8862
+
8863
+ <!-- Painel (Conteúdo scrollável) -->
8864
+ <div #panel
8865
+ class="matcha-panel"
8866
+ [class.matcha-panel-top]="actualPlacement === 'top'"
8867
+ [class.matcha-panel-bottom]="actualPlacement === 'bottom'"
8868
+ [class.matcha-panel-open]="open"
8869
+ [style.max-height.px]="panePosition.maxHeight"
8870
+ role="listbox"
8871
+ [attr.aria-expanded]="open"
8872
+ [attr.aria-hidden]="!open"
8873
+ (mousedown)="$event.stopPropagation()"> <!-- Impedir fechamento ao clicar no scroll/painel -->
8874
+ <ng-content></ng-content>
8875
+ </div>
8801
8876
  </div>
8802
- </ng-container>
8803
8877
  </div>
8804
8878
  `,
8805
8879
  standalone: false
8806
8880
  }]
8807
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { placement: [{
8881
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }], propDecorators: { placement: [{
8808
8882
  type: Input
8809
8883
  }], maxHeight: [{
8810
8884
  type: Input
@@ -8816,6 +8890,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
8816
8890
  type: Input
8817
8891
  }], open: [{
8818
8892
  type: Input
8893
+ }], hasOverlay: [{
8894
+ type: Input
8819
8895
  }], opened: [{
8820
8896
  type: Output
8821
8897
  }], closed: [{
@@ -8823,6 +8899,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
8823
8899
  }], panelRef: [{
8824
8900
  type: ViewChild,
8825
8901
  args: ['panel', { static: false }]
8902
+ }], paneRef: [{
8903
+ type: ViewChild,
8904
+ args: ['pane', { static: false }]
8905
+ }], onWindowResize: [{
8906
+ type: HostListener,
8907
+ args: ['window:resize']
8826
8908
  }] } });
8827
8909
 
8828
8910
  class MatchaAutocompleteComponent {
@@ -8879,34 +8961,13 @@ class MatchaAutocompleteComponent {
8879
8961
  this.cdr.detectChanges();
8880
8962
  // Escuta eventos customizados das opções
8881
8963
  this.elRef.nativeElement.addEventListener('matcha-option-selected', (event) => {
8882
- console.log('MatchaAutocomplete: Evento matcha-option-selected recebido', event.detail);
8883
8964
  const { option, value } = event.detail;
8884
8965
  this.selectOption(option);
8885
8966
  });
8886
- // Escuta evento para fechar este painel quando outro for aberto
8887
- this.elRef.nativeElement.addEventListener('matcha-autocomplete-close', () => {
8888
- if (this.open) {
8889
- console.log('MatchaAutocomplete: Fechando painel por evento de outro autocomplete');
8890
- this.closePanel();
8891
- }
8892
- });
8893
8967
  }
8894
8968
  attachTo(input) {
8895
8969
  this.triggerElement = input;
8896
8970
  }
8897
- closeOtherPanels() {
8898
- // Buscar todos os outros autocompletes na página e fechá-los
8899
- const allAutocompletes = document.querySelectorAll('matcha-autocomplete');
8900
- allAutocompletes.forEach(autocompleteEl => {
8901
- if (autocompleteEl !== this.elRef.nativeElement) {
8902
- // Disparar evento para fechar outros painéis
8903
- const closeEvent = new CustomEvent('matcha-autocomplete-close', {
8904
- bubbles: true
8905
- });
8906
- autocompleteEl.dispatchEvent(closeEvent);
8907
- }
8908
- });
8909
- }
8910
8971
  notifyDirectiveOfSelection(data) {
8911
8972
  // Disparar evento customizado para notificar a diretiva sobre a seleção
8912
8973
  const selectionEvent = new CustomEvent('matcha-autocomplete-selection', {
@@ -8914,22 +8975,13 @@ class MatchaAutocompleteComponent {
8914
8975
  bubbles: true
8915
8976
  });
8916
8977
  this.elRef.nativeElement.dispatchEvent(selectionEvent);
8917
- console.log('MatchaAutocomplete: Evento de seleção disparado', data);
8918
8978
  }
8919
8979
  openPanel() {
8920
8980
  if (this.disabled)
8921
8981
  return;
8922
8982
  if (!this.triggerElement) {
8923
- console.log('MatchaAutocomplete: triggerElement não encontrado');
8924
8983
  return;
8925
8984
  }
8926
- console.log('MatchaAutocomplete: Abrindo painel', {
8927
- triggerElement: this.triggerElement,
8928
- panel: this.panel,
8929
- open: this.open
8930
- });
8931
- // Fechar outros painéis abertos antes de abrir este
8932
- this.closeOtherPanels();
8933
8985
  this.open = true;
8934
8986
  this.cdr.detectChanges(); // Força detecção de mudanças
8935
8987
  this.panel.attachTo(this.triggerElement);
@@ -8938,10 +8990,8 @@ class MatchaAutocompleteComponent {
8938
8990
  this.opened.emit();
8939
8991
  }
8940
8992
  closePanel() {
8941
- console.log('MatchaAutocomplete: Fechando painel', {
8942
- open: this.open,
8943
- stackTrace: new Error().stack
8944
- });
8993
+ if (!this.open)
8994
+ return;
8945
8995
  this.open = false;
8946
8996
  this.activeIndex = -1;
8947
8997
  this.updateSelectedStates();
@@ -8996,13 +9046,6 @@ class MatchaAutocompleteComponent {
8996
9046
  }
8997
9047
  // chamado por matcha-option quando clicado
8998
9048
  selectOption(option) {
8999
- console.log('MatchaAutocomplete: Opção selecionada', {
9000
- option,
9001
- value: option.value,
9002
- selected: option.selected,
9003
- optionsLength: this.options.length,
9004
- allOptions: this.options.toArray()
9005
- });
9006
9049
  // Armazenar o valor selecionado
9007
9050
  this.selectedValue = option.value;
9008
9051
  // Marcar a opção como selecionada diretamente
@@ -9013,12 +9056,6 @@ class MatchaAutocompleteComponent {
9013
9056
  o.selected = false;
9014
9057
  }
9015
9058
  });
9016
- console.log('MatchaAutocomplete: Após marcar seleção', {
9017
- selectedOption: option,
9018
- selected: option.selected,
9019
- selectedValue: this.selectedValue,
9020
- allOptions: this.options.toArray().map(o => ({ value: o.value, selected: o.selected }))
9021
- });
9022
9059
  // Notificar a diretiva sobre a seleção antes de fechar o painel
9023
9060
  // Passar tanto o valor quanto o texto de exibição
9024
9061
  const displayText = this.getDisplayValue(option.value);
@@ -9027,7 +9064,6 @@ class MatchaAutocompleteComponent {
9027
9064
  displayText: displayText
9028
9065
  });
9029
9066
  // Fechamos painel automaticamente
9030
- console.log('MatchaAutocomplete: Fechando painel após seleção');
9031
9067
  this.closePanel();
9032
9068
  // Forçar detecção de mudanças para garantir que o painel seja fechado
9033
9069
  this.cdr.detectChanges();
@@ -9036,11 +9072,6 @@ class MatchaAutocompleteComponent {
9036
9072
  getSelectedValue() {
9037
9073
  // Usar o valor armazenado se disponível, senão buscar na QueryList
9038
9074
  const value = this.selectedValue !== undefined ? this.selectedValue : this.options.find(o => o.selected)?.value;
9039
- console.log('MatchaAutocomplete: getSelectedValue chamado', {
9040
- selectedValue: this.selectedValue,
9041
- value,
9042
- allOptions: this.options.toArray().map(o => ({ value: o.value, selected: o.selected }))
9043
- });
9044
9075
  return value;
9045
9076
  }
9046
9077
  hasSelection() {
@@ -9095,11 +9126,21 @@ class MatchaAutocompleteComponent {
9095
9126
  return null;
9096
9127
  }
9097
9128
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaAutocompleteComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
9098
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", type: MatchaAutocompleteComponent, isStandalone: false, selector: "matcha-autocomplete", inputs: { placement: "placement", maxHeight: "maxHeight", minWidth: "minWidth", disabled: "disabled", autoSelectOnBlur: "autoSelectOnBlur", displayWith: "displayWith", displayProperty: "displayProperty", showClearButton: "showClearButton", clearButtonIcon: "clearButtonIcon", clearButtonAriaLabel: "clearButtonAriaLabel" }, outputs: { opened: "opened", closed: "closed", cleared: "cleared", autoSelected: "autoSelected" }, host: { properties: { "class.matcha-autocomplete-disabled": "this.hostDisabledClass", "attr.disabled": "this.hostDisabledAttr" } }, queries: [{ propertyName: "options", predicate: MatchaOptionComponent, descendants: true }], viewQueries: [{ propertyName: "panel", first: true, predicate: MatchaPanelComponent, descendants: true }], ngImport: i0, template: "<div class=\"matcha-autocomplete-container\">\n <matcha-panel\n #panel\n [open]=\"open\"\n [placement]=\"placement\"\n [maxHeight]=\"maxHeight\"\n [minWidth]=\"minWidth\"\n [triggerElement]=\"triggerElement\"\n (opened)=\"opened.emit()\"\n (closed)=\"closed.emit()\">\n <div class=\"matcha-panel-content flex-column\">\n <ng-content></ng-content>\n </div>\n </matcha-panel>\n</div>\n", dependencies: [{ kind: "component", type: MatchaPanelComponent, selector: "matcha-panel", inputs: ["placement", "maxHeight", "minWidth", "offset", "triggerElement", "open"], outputs: ["opened", "closed"] }], encapsulation: i0.ViewEncapsulation.None }); }
9129
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", type: MatchaAutocompleteComponent, isStandalone: false, selector: "matcha-autocomplete", inputs: { placement: "placement", maxHeight: "maxHeight", minWidth: "minWidth", disabled: "disabled", autoSelectOnBlur: "autoSelectOnBlur", displayWith: "displayWith", displayProperty: "displayProperty", showClearButton: "showClearButton", clearButtonIcon: "clearButtonIcon", clearButtonAriaLabel: "clearButtonAriaLabel" }, outputs: { opened: "opened", closed: "closed", cleared: "cleared", autoSelected: "autoSelected" }, host: { properties: { "class.matcha-autocomplete-disabled": "this.hostDisabledClass", "attr.disabled": "this.hostDisabledAttr" } }, providers: [
9130
+ {
9131
+ provide: MATCHA_OPTION_PARENT,
9132
+ useExisting: forwardRef(() => MatchaAutocompleteComponent)
9133
+ }
9134
+ ], queries: [{ propertyName: "options", predicate: MatchaOptionComponent, descendants: true }], viewQueries: [{ propertyName: "panel", first: true, predicate: MatchaPanelComponent, descendants: true }], ngImport: i0, template: "<div class=\"matcha-autocomplete-container\">\n <matcha-panel #panel [open]=\"open\" [placement]=\"placement\" [maxHeight]=\"maxHeight\" [minWidth]=\"minWidth\"\n [triggerElement]=\"triggerElement\" (opened)=\"opened.emit()\" (closed)=\"closePanel()\">\n <div class=\"matcha-panel-content flex-column\">\n <ng-content></ng-content>\n </div>\n </matcha-panel>\n</div>", dependencies: [{ kind: "component", type: MatchaPanelComponent, selector: "matcha-panel", inputs: ["placement", "maxHeight", "minWidth", "offset", "triggerElement", "open", "hasOverlay"], outputs: ["opened", "closed"] }], encapsulation: i0.ViewEncapsulation.None }); }
9099
9135
  }
9100
9136
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaAutocompleteComponent, decorators: [{
9101
9137
  type: Component,
9102
- args: [{ selector: 'matcha-autocomplete', encapsulation: ViewEncapsulation.None, standalone: false, template: "<div class=\"matcha-autocomplete-container\">\n <matcha-panel\n #panel\n [open]=\"open\"\n [placement]=\"placement\"\n [maxHeight]=\"maxHeight\"\n [minWidth]=\"minWidth\"\n [triggerElement]=\"triggerElement\"\n (opened)=\"opened.emit()\"\n (closed)=\"closed.emit()\">\n <div class=\"matcha-panel-content flex-column\">\n <ng-content></ng-content>\n </div>\n </matcha-panel>\n</div>\n" }]
9138
+ args: [{ selector: 'matcha-autocomplete', encapsulation: ViewEncapsulation.None, standalone: false, providers: [
9139
+ {
9140
+ provide: MATCHA_OPTION_PARENT,
9141
+ useExisting: forwardRef(() => MatchaAutocompleteComponent)
9142
+ }
9143
+ ], template: "<div class=\"matcha-autocomplete-container\">\n <matcha-panel #panel [open]=\"open\" [placement]=\"placement\" [maxHeight]=\"maxHeight\" [minWidth]=\"minWidth\"\n [triggerElement]=\"triggerElement\" (opened)=\"opened.emit()\" (closed)=\"closePanel()\">\n <div class=\"matcha-panel-content flex-column\">\n <ng-content></ng-content>\n </div>\n </matcha-panel>\n</div>" }]
9103
9144
  }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }], propDecorators: { options: [{
9104
9145
  type: ContentChildren,
9105
9146
  args: [MatchaOptionComponent, { descendants: true }]
@@ -9188,8 +9229,16 @@ class MatchaSelectComponent {
9188
9229
  this.isDisabledByForm = false;
9189
9230
  }
9190
9231
  ngAfterContentInit() {
9232
+ // Se já tivermos um valor (ex: via writeValue antes do init), buscamos o label agora que os options estão prontos
9233
+ if (this.selectedValue !== undefined && this.selectedValue !== null) {
9234
+ this.updateLabelFromValue(this.selectedValue);
9235
+ }
9191
9236
  // quando options mudarem, resetamos estado relevante
9192
9237
  this.options.changes.subscribe(() => {
9238
+ // Se tivermos um valor selecionado, atualizamos o label (útil para carregamento assíncrono de opções)
9239
+ if (this.selectedValue !== undefined && this.selectedValue !== null) {
9240
+ this.updateLabelFromValue(this.selectedValue);
9241
+ }
9193
9242
  if (this.open) {
9194
9243
  this.resetActive();
9195
9244
  this.cdr.detectChanges();
@@ -9211,20 +9260,6 @@ class MatchaSelectComponent {
9211
9260
  const { option, value } = event.detail;
9212
9261
  this.selectOption(option);
9213
9262
  });
9214
- // Escuta evento para fechar este painel quando outro for aberto
9215
- this.elRef.nativeElement.addEventListener('matcha-select-close', () => {
9216
- if (this.open) {
9217
- this.closePanel();
9218
- }
9219
- });
9220
- // Escuta click outside para fechar o painel
9221
- document.addEventListener('click', (event) => {
9222
- const target = event.target;
9223
- const isInsideSelect = this.elRef.nativeElement.contains(target);
9224
- if (!isInsideSelect && this.open) {
9225
- this.closePanel();
9226
- }
9227
- });
9228
9263
  }
9229
9264
  setupKeyboardNavigation() {
9230
9265
  if (!this.triggerElement)
@@ -9294,19 +9329,6 @@ class MatchaSelectComponent {
9294
9329
  this.closePanel();
9295
9330
  }
9296
9331
  }
9297
- closeOtherPanels() {
9298
- // Buscar todos os outros selects na página e fechá-los
9299
- const allSelects = document.querySelectorAll('matcha-select');
9300
- allSelects.forEach(selectEl => {
9301
- if (selectEl !== this.elRef.nativeElement) {
9302
- // Disparar evento para fechar outros painéis
9303
- const closeEvent = new CustomEvent('matcha-select-close', {
9304
- bubbles: true
9305
- });
9306
- selectEl.dispatchEvent(closeEvent);
9307
- }
9308
- });
9309
- }
9310
9332
  notifyDirectiveOfSelection(value) {
9311
9333
  // Disparar evento customizado para notificar a diretiva sobre a seleção
9312
9334
  const selectionEvent = new CustomEvent('matcha-select-selection', {
@@ -9334,8 +9356,6 @@ class MatchaSelectComponent {
9334
9356
  if (!this.triggerElement) {
9335
9357
  return;
9336
9358
  }
9337
- // Fechar outros painéis abertos antes de abrir este
9338
- this.closeOtherPanels();
9339
9359
  this.open = true;
9340
9360
  this.cdr.detectChanges(); // Força detecção de mudanças
9341
9361
  this.panel.attachTo(this.triggerElement);
@@ -9346,6 +9366,8 @@ class MatchaSelectComponent {
9346
9366
  this.opened.emit();
9347
9367
  }
9348
9368
  closePanel() {
9369
+ if (!this.open)
9370
+ return;
9349
9371
  this.open = false;
9350
9372
  this.activeIndex = -1;
9351
9373
  this.updateSelectedStates();
@@ -9496,6 +9518,15 @@ class MatchaSelectComponent {
9496
9518
  // Retorna o label armazenado ou placeholder
9497
9519
  return this.selectedLabel || '';
9498
9520
  }
9521
+ updateLabelFromValue(value) {
9522
+ if (this.options) {
9523
+ const selectedOption = this.options.find(o => o.value === value);
9524
+ if (selectedOption) {
9525
+ this.selectedLabel = selectedOption.getTextContent();
9526
+ this.cdr.detectChanges();
9527
+ }
9528
+ }
9529
+ }
9499
9530
  // Método para definir valor programaticamente
9500
9531
  setValue(value) {
9501
9532
  this.selectedValue = value;
@@ -9556,8 +9587,12 @@ class MatchaSelectComponent {
9556
9587
  provide: NG_VALUE_ACCESSOR,
9557
9588
  useExisting: forwardRef(() => MatchaSelectComponent),
9558
9589
  multi: true
9590
+ },
9591
+ {
9592
+ provide: MATCHA_OPTION_PARENT,
9593
+ useExisting: forwardRef(() => MatchaSelectComponent)
9559
9594
  }
9560
- ], queries: [{ propertyName: "options", predicate: MatchaOptionComponent, descendants: true }], viewQueries: [{ propertyName: "panel", first: true, predicate: MatchaPanelComponent, descendants: true }], ngImport: i0, template: "<div class=\"matcha-select-container\" [class.matcha-select-disabled]=\"isCurrentlyDisabled\">\n <div\n class=\"matcha-select-trigger\"\n [class.matcha-select-open]=\"open\"\n [class.matcha-select-disabled]=\"isCurrentlyDisabled\"\n (click)=\"onTriggerClick()\"\n [attr.tabindex]=\"isCurrentlyDisabled ? -1 : 0\"\n role=\"combobox\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-haspopup]=\"true\"\n [attr.aria-disabled]=\"isCurrentlyDisabled\">\n\n <span class=\"matcha-select-value\" [class.matcha-select-placeholder]=\"!selectedValue\">\n {{ getSelectedLabel() || placeholder }}\n </span>\n\n <span class=\"matcha-select-arrow\" [class.matcha-select-arrow-open]=\"open\">\n <span class=\"i-matcha-action_arrow_down\"></span>\n </span>\n </div>\n\n <matcha-panel\n #panel\n [placement]=\"placement\"\n [maxHeight]=\"maxHeight\"\n [minWidth]=\"minWidth\"\n [open]=\"open\">\n <ng-content></ng-content>\n </matcha-panel>\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: MatchaPanelComponent, selector: "matcha-panel", inputs: ["placement", "maxHeight", "minWidth", "offset", "triggerElement", "open"], outputs: ["opened", "closed"] }], encapsulation: i0.ViewEncapsulation.None }); }
9595
+ ], queries: [{ propertyName: "options", predicate: MatchaOptionComponent, descendants: true }], viewQueries: [{ propertyName: "panel", first: true, predicate: MatchaPanelComponent, descendants: true }], ngImport: i0, template: "<div class=\"matcha-select-container\" [class.matcha-select-disabled]=\"isCurrentlyDisabled\">\n <div class=\"matcha-select-trigger\" [class.matcha-select-open]=\"open\"\n [class.matcha-select-disabled]=\"isCurrentlyDisabled\" (click)=\"onTriggerClick()\"\n [attr.tabindex]=\"isCurrentlyDisabled ? -1 : 0\" role=\"combobox\" [attr.aria-expanded]=\"open\"\n [attr.aria-haspopup]=\"true\" [attr.aria-disabled]=\"isCurrentlyDisabled\">\n\n <span class=\"matcha-select-value\"\n [class.matcha-select-placeholder]=\"selectedValue === undefined || selectedValue === null || selectedValue === ''\">\n {{ getSelectedLabel() || placeholder }}\n </span>\n\n <span class=\"matcha-select-arrow\" [class.matcha-select-arrow-open]=\"open\">\n <span class=\"i-matcha-action_arrow_down\"></span>\n </span>\n </div>\n\n <matcha-panel #panel [placement]=\"placement\" [maxHeight]=\"maxHeight\" [minWidth]=\"minWidth\" [open]=\"open\"\n (closed)=\"closePanel()\">\n <ng-content></ng-content>\n </matcha-panel>\n</div>", styles: [""], dependencies: [{ kind: "component", type: MatchaPanelComponent, selector: "matcha-panel", inputs: ["placement", "maxHeight", "minWidth", "offset", "triggerElement", "open", "hasOverlay"], outputs: ["opened", "closed"] }], encapsulation: i0.ViewEncapsulation.None }); }
9561
9596
  }
9562
9597
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaSelectComponent, decorators: [{
9563
9598
  type: Component,
@@ -9566,8 +9601,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
9566
9601
  provide: NG_VALUE_ACCESSOR,
9567
9602
  useExisting: forwardRef(() => MatchaSelectComponent),
9568
9603
  multi: true
9604
+ },
9605
+ {
9606
+ provide: MATCHA_OPTION_PARENT,
9607
+ useExisting: forwardRef(() => MatchaSelectComponent)
9569
9608
  }
9570
- ], template: "<div class=\"matcha-select-container\" [class.matcha-select-disabled]=\"isCurrentlyDisabled\">\n <div\n class=\"matcha-select-trigger\"\n [class.matcha-select-open]=\"open\"\n [class.matcha-select-disabled]=\"isCurrentlyDisabled\"\n (click)=\"onTriggerClick()\"\n [attr.tabindex]=\"isCurrentlyDisabled ? -1 : 0\"\n role=\"combobox\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-haspopup]=\"true\"\n [attr.aria-disabled]=\"isCurrentlyDisabled\">\n\n <span class=\"matcha-select-value\" [class.matcha-select-placeholder]=\"!selectedValue\">\n {{ getSelectedLabel() || placeholder }}\n </span>\n\n <span class=\"matcha-select-arrow\" [class.matcha-select-arrow-open]=\"open\">\n <span class=\"i-matcha-action_arrow_down\"></span>\n </span>\n </div>\n\n <matcha-panel\n #panel\n [placement]=\"placement\"\n [maxHeight]=\"maxHeight\"\n [minWidth]=\"minWidth\"\n [open]=\"open\">\n <ng-content></ng-content>\n </matcha-panel>\n</div>\n" }]
9609
+ ], template: "<div class=\"matcha-select-container\" [class.matcha-select-disabled]=\"isCurrentlyDisabled\">\n <div class=\"matcha-select-trigger\" [class.matcha-select-open]=\"open\"\n [class.matcha-select-disabled]=\"isCurrentlyDisabled\" (click)=\"onTriggerClick()\"\n [attr.tabindex]=\"isCurrentlyDisabled ? -1 : 0\" role=\"combobox\" [attr.aria-expanded]=\"open\"\n [attr.aria-haspopup]=\"true\" [attr.aria-disabled]=\"isCurrentlyDisabled\">\n\n <span class=\"matcha-select-value\"\n [class.matcha-select-placeholder]=\"selectedValue === undefined || selectedValue === null || selectedValue === ''\">\n {{ getSelectedLabel() || placeholder }}\n </span>\n\n <span class=\"matcha-select-arrow\" [class.matcha-select-arrow-open]=\"open\">\n <span class=\"i-matcha-action_arrow_down\"></span>\n </span>\n </div>\n\n <matcha-panel #panel [placement]=\"placement\" [maxHeight]=\"maxHeight\" [minWidth]=\"minWidth\" [open]=\"open\"\n (closed)=\"closePanel()\">\n <ng-content></ng-content>\n </matcha-panel>\n</div>" }]
9571
9610
  }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }], propDecorators: { options: [{
9572
9611
  type: ContentChildren,
9573
9612
  args: [MatchaOptionComponent, { descendants: true }]