matcha-components 20.178.0 → 20.180.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.
@@ -11498,6 +11498,88 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
11498
11498
  args: ['sticky-end']
11499
11499
  }] } });
11500
11500
 
11501
+ class MatchaMenuComponent {
11502
+ get maxHeight() { return this._maxHeight; }
11503
+ set maxHeight(value) { this._maxHeight = typeof value === 'string' ? parseInt(value, 10) : value; }
11504
+ get minWidth() { return this._minWidth; }
11505
+ set minWidth(value) { this._minWidth = typeof value === 'string' ? parseInt(value, 10) : value; }
11506
+ constructor(cdr) {
11507
+ this.cdr = cdr;
11508
+ this.placement = 'auto';
11509
+ this._maxHeight = 240;
11510
+ this._minWidth = 160;
11511
+ this.opened = new EventEmitter();
11512
+ this.closed = new EventEmitter();
11513
+ this.open = false;
11514
+ }
11515
+ openPanel(trigger) {
11516
+ this.triggerElement = trigger;
11517
+ this.open = true;
11518
+ this.cdr.detectChanges();
11519
+ this.panel.attachTo(this.triggerElement);
11520
+ this.panel.openPanel();
11521
+ this.opened.emit();
11522
+ }
11523
+ closePanel() {
11524
+ if (!this.open)
11525
+ return;
11526
+ this.open = false;
11527
+ this.panel.closePanel();
11528
+ this.closed.emit();
11529
+ this.cdr.detectChanges();
11530
+ }
11531
+ togglePanel(trigger) {
11532
+ this.open ? this.closePanel() : this.openPanel(trigger);
11533
+ }
11534
+ onContentClick(event) {
11535
+ // Se clicar em um botão ou item dentro do menu, fechamos o painel
11536
+ const target = event.target;
11537
+ if (target.closest('button') || target.closest('.matcha-menu-item') || target.closest('[matcha-button]')) {
11538
+ // Pequeno timeout para permitir que o evento de clique original seja processado antes de remover o elemento do DOM
11539
+ setTimeout(() => {
11540
+ this.closePanel();
11541
+ }, 100);
11542
+ }
11543
+ }
11544
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaMenuComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
11545
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", type: MatchaMenuComponent, isStandalone: false, selector: "matcha-menu", inputs: { placement: "placement", maxHeight: "maxHeight", minWidth: "minWidth" }, outputs: { opened: "opened", closed: "closed" }, viewQueries: [{ propertyName: "panel", first: true, predicate: MatchaPanelComponent, descendants: true }], exportAs: ["matchaMenu"], ngImport: i0, template: `
11546
+ <matcha-panel #panel [placement]="placement" [maxHeight]="maxHeight" [minWidth]="minWidth" [open]="open" (closed)="closePanel()">
11547
+ <div class="matcha-menu-content" (click)="onContentClick($event)">
11548
+ <ng-content></ng-content>
11549
+ </div>
11550
+ </matcha-panel>
11551
+ `, isInline: true, dependencies: [{ kind: "component", type: MatchaPanelComponent, selector: "matcha-panel", inputs: ["placement", "maxHeight", "minWidth", "offset", "triggerElement", "open", "hasOverlay"], outputs: ["opened", "closed"] }], encapsulation: i0.ViewEncapsulation.None }); }
11552
+ }
11553
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaMenuComponent, decorators: [{
11554
+ type: Component,
11555
+ args: [{
11556
+ selector: 'matcha-menu',
11557
+ template: `
11558
+ <matcha-panel #panel [placement]="placement" [maxHeight]="maxHeight" [minWidth]="minWidth" [open]="open" (closed)="closePanel()">
11559
+ <div class="matcha-menu-content" (click)="onContentClick($event)">
11560
+ <ng-content></ng-content>
11561
+ </div>
11562
+ </matcha-panel>
11563
+ `,
11564
+ exportAs: 'matchaMenu',
11565
+ encapsulation: ViewEncapsulation.None,
11566
+ standalone: false
11567
+ }]
11568
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { panel: [{
11569
+ type: ViewChild,
11570
+ args: [MatchaPanelComponent]
11571
+ }], placement: [{
11572
+ type: Input
11573
+ }], maxHeight: [{
11574
+ type: Input
11575
+ }], minWidth: [{
11576
+ type: Input
11577
+ }], opened: [{
11578
+ type: Output
11579
+ }], closed: [{
11580
+ type: Output
11581
+ }] } });
11582
+
11501
11583
  class MatchaTooltipDirective {
11502
11584
  get tooltipText() { return this._tooltipText; }
11503
11585
  set tooltipText(v) {
@@ -13220,6 +13302,125 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
13220
13302
  }]
13221
13303
  }] });
13222
13304
 
13305
+ class MatchaMenuTriggerDirective {
13306
+ constructor(el) {
13307
+ this.el = el;
13308
+ this.subs = new Subscription();
13309
+ }
13310
+ ngAfterViewInit() {
13311
+ if (!this.menu) {
13312
+ throw new Error('Você precisa passar uma referência para <matcha-menu> ex: [matchaMenuTriggerFor]="menu"');
13313
+ }
13314
+ // Lógica para fechar ao clicar fora
13315
+ const clickSub = fromEvent(document, 'click').pipe(filter((ev) => {
13316
+ const target = ev.target;
13317
+ const isInsideTrigger = this.el.nativeElement.contains(target);
13318
+ // O painel do menu está dentro de um overlay no body, então precisamos verificar se o clique foi fora dele também.
13319
+ // Como o MatchaMenuComponent gerencia o MatchaPanel, podemos confiar na lógica interna do MatchaPanel para fechar clicar fora,
13320
+ // mas aqui reforçamos para o trigger.
13321
+ return this.menu.open && !isInsideTrigger;
13322
+ })).subscribe(() => {
13323
+ // Apenas fechar se o clique não for dentro do painel (que é gerenciado pelo próprio MatchaPanel)
13324
+ // Mas o MatchaPanel já tem essa lógica.
13325
+ });
13326
+ this.subs.add(clickSub);
13327
+ }
13328
+ onClick(event) {
13329
+ event.preventDefault();
13330
+ event.stopPropagation();
13331
+ this.menu.togglePanel(this.el.nativeElement);
13332
+ }
13333
+ ngOnDestroy() {
13334
+ this.subs.unsubscribe();
13335
+ }
13336
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaMenuTriggerDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
13337
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.0", type: MatchaMenuTriggerDirective, isStandalone: false, selector: "[matchaMenuTriggerFor]", inputs: { menu: ["matchaMenuTriggerFor", "menu"] }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 }); }
13338
+ }
13339
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaMenuTriggerDirective, decorators: [{
13340
+ type: Directive,
13341
+ args: [{
13342
+ selector: '[matchaMenuTriggerFor]',
13343
+ standalone: false,
13344
+ }]
13345
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { menu: [{
13346
+ type: Input,
13347
+ args: ['matchaMenuTriggerFor']
13348
+ }], onClick: [{
13349
+ type: HostListener,
13350
+ args: ['click', ['$event']]
13351
+ }] } });
13352
+
13353
+ class MatchaMenuItemDirective {
13354
+ get matchaMenuItem() {
13355
+ return this._matchaMenuItem;
13356
+ }
13357
+ set matchaMenuItem(value) {
13358
+ this._matchaMenuItem = value === 'false' ? false : !!value;
13359
+ }
13360
+ constructor(el, renderer) {
13361
+ this.el = el;
13362
+ this.renderer = renderer;
13363
+ this._matchaMenuItem = false;
13364
+ }
13365
+ ngOnInit() {
13366
+ this.updateClass();
13367
+ }
13368
+ ngOnChanges() {
13369
+ this.updateClass();
13370
+ }
13371
+ updateClass() {
13372
+ if (this._matchaMenuItem) {
13373
+ this.renderer.addClass(this.el.nativeElement, 'matcha-menu-item');
13374
+ }
13375
+ else {
13376
+ this.renderer.removeClass(this.el.nativeElement, 'matcha-menu-item');
13377
+ }
13378
+ }
13379
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaMenuItemDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
13380
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.0", type: MatchaMenuItemDirective, isStandalone: false, selector: "[matcha-menu-item]", inputs: { matchaMenuItem: ["matcha-menu-item", "matchaMenuItem"] }, usesOnChanges: true, ngImport: i0 }); }
13381
+ }
13382
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaMenuItemDirective, decorators: [{
13383
+ type: Directive,
13384
+ args: [{
13385
+ selector: '[matcha-menu-item]',
13386
+ standalone: false
13387
+ }]
13388
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { matchaMenuItem: [{
13389
+ type: Input,
13390
+ args: ['matcha-menu-item']
13391
+ }] } });
13392
+
13393
+ class MatchaMenuModule {
13394
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
13395
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.0", ngImport: i0, type: MatchaMenuModule, declarations: [MatchaMenuComponent,
13396
+ MatchaMenuTriggerDirective,
13397
+ MatchaMenuItemDirective], imports: [CommonModule,
13398
+ MatchaPanelModule], exports: [MatchaMenuComponent,
13399
+ MatchaMenuTriggerDirective,
13400
+ MatchaMenuItemDirective] }); }
13401
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaMenuModule, imports: [CommonModule,
13402
+ MatchaPanelModule] }); }
13403
+ }
13404
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaMenuModule, decorators: [{
13405
+ type: NgModule,
13406
+ args: [{
13407
+ declarations: [
13408
+ MatchaMenuComponent,
13409
+ MatchaMenuTriggerDirective,
13410
+ MatchaMenuItemDirective
13411
+ ],
13412
+ imports: [
13413
+ CommonModule,
13414
+ MatchaPanelModule
13415
+ ],
13416
+ exports: [
13417
+ MatchaMenuComponent,
13418
+ MatchaMenuTriggerDirective,
13419
+ MatchaMenuItemDirective
13420
+ ]
13421
+ }]
13422
+ }] });
13423
+
13223
13424
  class MatchaSpinModule {
13224
13425
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaSpinModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
13225
13426
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.0", ngImport: i0, type: MatchaSpinModule, declarations: [MatchaSpinComponent], imports: [CommonModule], exports: [MatchaSpinComponent] }); }
@@ -13902,7 +14103,8 @@ class MatchaComponentsModule {
13902
14103
  MatchaDrawerModule,
13903
14104
  MatchaHighlightModule,
13904
14105
  MatchaMaskModule,
13905
- MatchaChipModule], exports: [MatchaAccordionModule,
14106
+ MatchaChipModule,
14107
+ MatchaMenuModule], exports: [MatchaAccordionModule,
13906
14108
  MatchaAutocompleteModule,
13907
14109
  MatchaOptionModule,
13908
14110
  MatchaPanelModule,
@@ -13940,7 +14142,8 @@ class MatchaComponentsModule {
13940
14142
  MatchaDrawerModule,
13941
14143
  MatchaHighlightModule,
13942
14144
  MatchaMaskModule,
13943
- MatchaChipModule] }); }
14145
+ MatchaChipModule,
14146
+ MatchaMenuModule] }); }
13944
14147
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaComponentsModule, imports: [CommonModule,
13945
14148
  FormsModule,
13946
14149
  ReactiveFormsModule,
@@ -13981,7 +14184,8 @@ class MatchaComponentsModule {
13981
14184
  MatchaDrawerModule,
13982
14185
  MatchaHighlightModule,
13983
14186
  MatchaMaskModule,
13984
- MatchaChipModule, MatchaAccordionModule,
14187
+ MatchaChipModule,
14188
+ MatchaMenuModule, MatchaAccordionModule,
13985
14189
  MatchaAutocompleteModule,
13986
14190
  MatchaOptionModule,
13987
14191
  MatchaPanelModule,
@@ -14019,7 +14223,8 @@ class MatchaComponentsModule {
14019
14223
  MatchaDrawerModule,
14020
14224
  MatchaHighlightModule,
14021
14225
  MatchaMaskModule,
14022
- MatchaChipModule] }); }
14226
+ MatchaChipModule,
14227
+ MatchaMenuModule] }); }
14023
14228
  }
14024
14229
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaComponentsModule, decorators: [{
14025
14230
  type: NgModule,
@@ -14066,7 +14271,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
14066
14271
  MatchaDrawerModule,
14067
14272
  MatchaHighlightModule,
14068
14273
  MatchaMaskModule,
14069
- MatchaChipModule
14274
+ MatchaChipModule,
14275
+ MatchaMenuModule
14070
14276
  ],
14071
14277
  exports: [MatchaAccordionModule,
14072
14278
  MatchaAutocompleteModule,
@@ -14106,7 +14312,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
14106
14312
  MatchaDrawerModule,
14107
14313
  MatchaHighlightModule,
14108
14314
  MatchaMaskModule,
14109
- MatchaChipModule
14315
+ MatchaChipModule,
14316
+ MatchaMenuModule
14110
14317
  ],
14111
14318
  }]
14112
14319
  }] });
@@ -14202,5 +14409,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
14202
14409
  * Generated bundle index. Do not edit.
14203
14410
  */
14204
14411
 
14205
- export { CopyButtonComponent, INITIAL_CONFIG, MATCHA_MASK_CONFIG, MATCHA_OPTION_PARENT, MatchaAccordionComponent, MatchaAccordionContentComponent, MatchaAccordionHeaderComponent, MatchaAccordionItemComponent, MatchaAccordionModule, MatchaAutocompleteComponent, MatchaAutocompleteModule, MatchaAutocompleteTriggerDirective, MatchaAvatarComponent, MatchaAvatarModule, MatchaBreakpointObservableModule, MatchaBreakpointObserver, MatchaButtonComponent, MatchaButtonModule, MatchaButtonToggleComponent, MatchaButtonToggleModule, MatchaCardComponent, MatchaCardModule, MatchaCheckboxComponent, MatchaCheckboxModule, MatchaChipComponent, MatchaChipListComponent, MatchaChipModule, MatchaComponentsModule, MatchaDateComponent, MatchaDateModule, MatchaDateRangeComponent, MatchaDateRangeModule, MatchaDividerComponent, MatchaDividerModule, MatchaDragDirective, MatchaDragHandleDirective, MatchaDrawerComponent, MatchaDrawerContainerComponent, MatchaDrawerContentComponent, MatchaDrawerModule, MatchaDropListComponent, MatchaDropListModule, MatchaElevationDirective, MatchaElevationModule, MatchaErrorComponent, MatchaFormFieldComponent, MatchaFormFieldModule, MatchaGridComponent, MatchaGridModule, MatchaHighlightComponent, MatchaHighlightModule, MatchaHintTextComponent, MatchaHintTextModule, MatchaIconComponent, MatchaIconModule, MatchaInfiniteScrollComponent, MatchaInfiniteScrollDataComponent, MatchaInfiniteScrollModule, MatchaInputPhoneComponent, MatchaInputPhoneModule, MatchaLabelComponent, MatchaLazyloadComponent, MatchaLazyloadDataComponent, MatchaLazyloadModule, MatchaMaskApplierService, MatchaMaskCompatibleDirective, MatchaMaskModule, MatchaMaskPipe, MatchaMaskService, MatchaMasonryComponent, MatchaMasonryModule, MatchaModalComponent, MatchaModalContentComponent, MatchaModalFooterComponent, MatchaModalHeaderComponent, MatchaModalModule, MatchaModalOptionsComponent, MatchaModalService, MatchaOptionComponent, MatchaOptionModule, MatchaOverlayService, MatchaPageLayoutComponent, MatchaPageLayoutModule, MatchaPaginatorComponent, MatchaPaginatorIntl, MatchaPaginatorModule, MatchaPanelComponent, MatchaPanelModule, MatchaRadioComponent, MatchaRadioGroupComponent, MatchaRadioModule, MatchaRippleDirective, MatchaRippleModule, MatchaSelectComponent, MatchaSelectModule, MatchaSelectTriggerDirective, MatchaSkeletonComponent, MatchaSkeletonModule, MatchaSlideToggleComponent, MatchaSlideToggleModule, MatchaSliderComponent, MatchaSliderModule, MatchaSpinComponent, MatchaSpinModule, MatchaSpinnerComponent, MatchaSpinnerModule, MatchaStepperComponent, MatchaStepperContentComponent, MatchaStepperControllerComponent, MatchaStepperModule, MatchaStepperStateService, MatchaTabItemComponent, MatchaTableComponent, MatchaTableModule, MatchaTabsComponent, MatchaTabsModule, MatchaTimeComponent, MatchaTimeModule, MatchaTitleComponent, MatchaTitleModule, MatchaToolbarButtonComponent, MatchaToolbarComponent, MatchaToolbarContentComponent, MatchaToolbarCustomButtonComponent, MatchaToolbarMainButtonComponent, MatchaToolbarModule, MatchaTooltipDirective, MatchaTooltipModule, NEW_CONFIG, NextStepDirective, PrevStepDirective, StepComponent, StepContentDirective, compatibleOptions, initialConfig, timeMasks, withoutValidation };
14412
+ export { CopyButtonComponent, INITIAL_CONFIG, MATCHA_MASK_CONFIG, MATCHA_OPTION_PARENT, MatchaAccordionComponent, MatchaAccordionContentComponent, MatchaAccordionHeaderComponent, MatchaAccordionItemComponent, MatchaAccordionModule, MatchaAutocompleteComponent, MatchaAutocompleteModule, MatchaAutocompleteTriggerDirective, MatchaAvatarComponent, MatchaAvatarModule, MatchaBreakpointObservableModule, MatchaBreakpointObserver, MatchaButtonComponent, MatchaButtonModule, MatchaButtonToggleComponent, MatchaButtonToggleModule, MatchaCardComponent, MatchaCardModule, MatchaCheckboxComponent, MatchaCheckboxModule, MatchaChipComponent, MatchaChipListComponent, MatchaChipModule, MatchaComponentsModule, MatchaDateComponent, MatchaDateModule, MatchaDateRangeComponent, MatchaDateRangeModule, MatchaDividerComponent, MatchaDividerModule, MatchaDragDirective, MatchaDragHandleDirective, MatchaDrawerComponent, MatchaDrawerContainerComponent, MatchaDrawerContentComponent, MatchaDrawerModule, MatchaDropListComponent, MatchaDropListModule, MatchaElevationDirective, MatchaElevationModule, MatchaErrorComponent, MatchaFormFieldComponent, MatchaFormFieldModule, MatchaGridComponent, MatchaGridModule, MatchaHighlightComponent, MatchaHighlightModule, MatchaHintTextComponent, MatchaHintTextModule, MatchaIconComponent, MatchaIconModule, MatchaInfiniteScrollComponent, MatchaInfiniteScrollDataComponent, MatchaInfiniteScrollModule, MatchaInputPhoneComponent, MatchaInputPhoneModule, MatchaLabelComponent, MatchaLazyloadComponent, MatchaLazyloadDataComponent, MatchaLazyloadModule, MatchaMaskApplierService, MatchaMaskCompatibleDirective, MatchaMaskModule, MatchaMaskPipe, MatchaMaskService, MatchaMasonryComponent, MatchaMasonryModule, MatchaMenuComponent, MatchaMenuItemDirective, MatchaMenuModule, MatchaMenuTriggerDirective, MatchaModalComponent, MatchaModalContentComponent, MatchaModalFooterComponent, MatchaModalHeaderComponent, MatchaModalModule, MatchaModalOptionsComponent, MatchaModalService, MatchaOptionComponent, MatchaOptionModule, MatchaOverlayService, MatchaPageLayoutComponent, MatchaPageLayoutModule, MatchaPaginatorComponent, MatchaPaginatorIntl, MatchaPaginatorModule, MatchaPanelComponent, MatchaPanelModule, MatchaRadioComponent, MatchaRadioGroupComponent, MatchaRadioModule, MatchaRippleDirective, MatchaRippleModule, MatchaSelectComponent, MatchaSelectModule, MatchaSelectTriggerDirective, MatchaSkeletonComponent, MatchaSkeletonModule, MatchaSlideToggleComponent, MatchaSlideToggleModule, MatchaSliderComponent, MatchaSliderModule, MatchaSpinComponent, MatchaSpinModule, MatchaSpinnerComponent, MatchaSpinnerModule, MatchaStepperComponent, MatchaStepperContentComponent, MatchaStepperControllerComponent, MatchaStepperModule, MatchaStepperStateService, MatchaTabItemComponent, MatchaTableComponent, MatchaTableModule, MatchaTabsComponent, MatchaTabsModule, MatchaTimeComponent, MatchaTimeModule, MatchaTitleComponent, MatchaTitleModule, MatchaToolbarButtonComponent, MatchaToolbarComponent, MatchaToolbarContentComponent, MatchaToolbarCustomButtonComponent, MatchaToolbarMainButtonComponent, MatchaToolbarModule, MatchaTooltipDirective, MatchaTooltipModule, NEW_CONFIG, NextStepDirective, PrevStepDirective, StepComponent, StepContentDirective, compatibleOptions, initialConfig, timeMasks, withoutValidation };
14206
14413
  //# sourceMappingURL=matcha-components.mjs.map