matcha-components 20.3.0 → 20.5.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,11 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, Output, Input, Component, ContentChildren, ElementRef, Renderer2, HostBinding, Inject, HostListener, ContentChild, Directive, forwardRef, Injectable, ChangeDetectionStrategy, TemplateRef, ViewChild, NgModule, createComponent } from '@angular/core';
2
+ import { EventEmitter, Output, Input, Component, ContentChildren, ElementRef, Renderer2, HostBinding, Inject, HostListener, ContentChild, Directive, forwardRef, ChangeDetectionStrategy, TemplateRef, ViewChild, Injectable, Optional, ViewEncapsulation, NgModule, createComponent } from '@angular/core';
3
3
  import { animation, style, animate, trigger, transition, useAnimation, state, query, stagger, animateChild, sequence, group } from '@angular/animations';
4
- import { Subscription, Subject, BehaviorSubject } from 'rxjs';
5
- import { debounceTime } from 'rxjs/operators';
4
+ import { Subscription, Subject, BehaviorSubject, fromEvent } from 'rxjs';
5
+ import { debounceTime, filter } from 'rxjs/operators';
6
6
  import * as i1 from '@angular/common';
7
7
  import { CommonModule } from '@angular/common';
8
- import * as i1$1 from '@angular/forms';
9
8
  import { FormControlName, NG_VALUE_ACCESSOR, NgControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
10
9
 
11
10
  const customAnimation = animation([
@@ -1234,6 +1233,94 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
1234
1233
  type: Output
1235
1234
  }] } });
1236
1235
 
1236
+ class MatchaDrawerComponent {
1237
+ get drawerClasses() {
1238
+ return `matcha-drawer matcha-drawer-${this.mode} matcha-drawer-${this.position} ${this.isOpen ? 'matcha-drawer-open' : 'matcha-drawer-closed'}`;
1239
+ }
1240
+ get drawerWidth() {
1241
+ return this.isOpen && this.mode === 'push' ? this.width : '0px';
1242
+ }
1243
+ constructor(elementRef, renderer) {
1244
+ this.elementRef = elementRef;
1245
+ this.renderer = renderer;
1246
+ this.isOpen = false;
1247
+ this.mode = 'push'; // push empurra o conteúdo, overlay sobrepõe
1248
+ this.position = 'left';
1249
+ this.width = '280px';
1250
+ this.isOpenChange = new EventEmitter();
1251
+ this.openChange = new EventEmitter();
1252
+ }
1253
+ ngOnInit() {
1254
+ this.renderer.addClass(this.elementRef.nativeElement, 'matcha-drawer');
1255
+ // Configurar classes utilitárias baseadas no modo
1256
+ if (this.mode === 'overlay') {
1257
+ this.renderer.addClass(this.elementRef.nativeElement, 'position-fixed');
1258
+ this.renderer.addClass(this.elementRef.nativeElement, 'place-top');
1259
+ this.renderer.addClass(this.elementRef.nativeElement, 'z-index-11'); // Aumentado para ficar acima do backdrop
1260
+ this.renderer.setStyle(this.elementRef.nativeElement, 'height', '100vh');
1261
+ }
1262
+ else {
1263
+ this.renderer.addClass(this.elementRef.nativeElement, 'position-relative');
1264
+ }
1265
+ // Configurar posição left/right
1266
+ if (this.position === 'left') {
1267
+ this.renderer.addClass(this.elementRef.nativeElement, 'place-left');
1268
+ }
1269
+ else {
1270
+ this.renderer.setStyle(this.elementRef.nativeElement, 'right', '0');
1271
+ }
1272
+ }
1273
+ ngOnDestroy() {
1274
+ // Cleanup se necessário
1275
+ }
1276
+ toggle() {
1277
+ this.isOpen = !this.isOpen;
1278
+ this.isOpenChange.emit(this.isOpen);
1279
+ this.openChange.emit(this.isOpen);
1280
+ }
1281
+ open() {
1282
+ if (!this.isOpen) {
1283
+ this.isOpen = true;
1284
+ this.isOpenChange.emit(this.isOpen);
1285
+ this.openChange.emit(this.isOpen);
1286
+ }
1287
+ }
1288
+ close() {
1289
+ if (this.isOpen) {
1290
+ this.isOpen = false;
1291
+ this.isOpenChange.emit(this.isOpen);
1292
+ this.openChange.emit(this.isOpen);
1293
+ }
1294
+ }
1295
+ get animationState() {
1296
+ return this.isOpen ? this.position : 'void';
1297
+ }
1298
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaDrawerComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
1299
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.1", type: MatchaDrawerComponent, isStandalone: false, selector: "matcha-drawer", inputs: { isOpen: "isOpen", mode: "mode", position: "position", width: "width" }, outputs: { isOpenChange: "isOpenChange", openChange: "openChange" }, host: { properties: { "class": "this.drawerClasses", "style.width": "this.drawerWidth" } }, ngImport: i0, template: "<!-- Backdrop para modo overlay (renderizado primeiro para ficar atr\u00E1s) -->\n<div *ngIf=\"mode === 'overlay' && isOpen\"\n class=\"matcha-drawer-backdrop position-fixed place-top place-left z-index-9 w-100-p h-100-p\"\n [@fadeInOut]=\"isOpen ? '1' : '0'\"\n (click)=\"close()\">\n</div>\n\n<!-- Drawer Content Container -->\n<div class=\"matcha-drawer-container\"\n [@slideIn]=\"animationState\"\n [class.matcha-drawer-overlay-mode]=\"mode === 'overlay'\"\n [class.matcha-drawer-push-mode]=\"mode === 'push'\"\n [style.width]=\"width\">\n\n <!-- Drawer Header (opcional) -->\n <div class=\"matcha-drawer-header\" *ngIf=\"isOpen\">\n <ng-content select=\"[slot=header]\"></ng-content>\n\n <!-- Close button quando em modo overlay -->\n <button *ngIf=\"mode === 'overlay'\"\n matcha-button\n icon\n size=\"small\"\n basic\n (click)=\"close()\"\n class=\"matcha-drawer-close-btn place-right\">\n <span class=\"i-matcha-close\"></span>\n </button>\n </div>\n\n <!-- Drawer Content -->\n <div class=\"matcha-drawer-content\" *ngIf=\"isOpen\">\n <ng-content></ng-content>\n </div>\n\n <!-- Drawer Footer (opcional) -->\n <div class=\"matcha-drawer-footer\" *ngIf=\"isOpen\">\n <ng-content select=\"[slot=footer]\"></ng-content>\n </div>\n</div>\n", styles: [":host{display:block;transition:width .3s cubic-bezier(.4,0,.2,1)}.matcha-drawer-container{height:100%;transition:transform .3s cubic-bezier(.4,0,.2,1)}.matcha-drawer-push-mode{background-color:var(--color-background);border-right:1px solid var(--color-divider)}.matcha-drawer-overlay-mode{background-color:var(--color-card);box-shadow:var(--elevation-4);border-radius:0 8px 8px 0;position:relative;z-index:11}.matcha-drawer-header{padding:16px;border-bottom:1px solid var(--color-divider);position:relative;z-index:1}.matcha-drawer-close-btn{position:absolute;top:8px;right:8px}.matcha-drawer-content{padding:16px;overflow-y:auto;max-height:calc(100vh - 100px);position:relative;z-index:1}.matcha-drawer-footer{padding:16px;border-top:1px solid var(--color-divider);margin-top:auto;position:relative;z-index:1}.matcha-drawer-backdrop{background-color:#00000052;cursor:pointer}:host(.matcha-drawer-right) .matcha-drawer-overlay-mode{border-radius:8px 0 0 8px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatchaButtonComponent, selector: "[matcha-button]", inputs: ["size", "size-xs", "size-sm", "size-md", "size-lg", "size-xl", "color", "basic", "outline", "alpha", "pill", "link", "icon"] }], animations: createAnimations }); }
1300
+ }
1301
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaDrawerComponent, decorators: [{
1302
+ type: Component,
1303
+ args: [{ selector: 'matcha-drawer', animations: createAnimations, standalone: false, template: "<!-- Backdrop para modo overlay (renderizado primeiro para ficar atr\u00E1s) -->\n<div *ngIf=\"mode === 'overlay' && isOpen\"\n class=\"matcha-drawer-backdrop position-fixed place-top place-left z-index-9 w-100-p h-100-p\"\n [@fadeInOut]=\"isOpen ? '1' : '0'\"\n (click)=\"close()\">\n</div>\n\n<!-- Drawer Content Container -->\n<div class=\"matcha-drawer-container\"\n [@slideIn]=\"animationState\"\n [class.matcha-drawer-overlay-mode]=\"mode === 'overlay'\"\n [class.matcha-drawer-push-mode]=\"mode === 'push'\"\n [style.width]=\"width\">\n\n <!-- Drawer Header (opcional) -->\n <div class=\"matcha-drawer-header\" *ngIf=\"isOpen\">\n <ng-content select=\"[slot=header]\"></ng-content>\n\n <!-- Close button quando em modo overlay -->\n <button *ngIf=\"mode === 'overlay'\"\n matcha-button\n icon\n size=\"small\"\n basic\n (click)=\"close()\"\n class=\"matcha-drawer-close-btn place-right\">\n <span class=\"i-matcha-close\"></span>\n </button>\n </div>\n\n <!-- Drawer Content -->\n <div class=\"matcha-drawer-content\" *ngIf=\"isOpen\">\n <ng-content></ng-content>\n </div>\n\n <!-- Drawer Footer (opcional) -->\n <div class=\"matcha-drawer-footer\" *ngIf=\"isOpen\">\n <ng-content select=\"[slot=footer]\"></ng-content>\n </div>\n</div>\n", styles: [":host{display:block;transition:width .3s cubic-bezier(.4,0,.2,1)}.matcha-drawer-container{height:100%;transition:transform .3s cubic-bezier(.4,0,.2,1)}.matcha-drawer-push-mode{background-color:var(--color-background);border-right:1px solid var(--color-divider)}.matcha-drawer-overlay-mode{background-color:var(--color-card);box-shadow:var(--elevation-4);border-radius:0 8px 8px 0;position:relative;z-index:11}.matcha-drawer-header{padding:16px;border-bottom:1px solid var(--color-divider);position:relative;z-index:1}.matcha-drawer-close-btn{position:absolute;top:8px;right:8px}.matcha-drawer-content{padding:16px;overflow-y:auto;max-height:calc(100vh - 100px);position:relative;z-index:1}.matcha-drawer-footer{padding:16px;border-top:1px solid var(--color-divider);margin-top:auto;position:relative;z-index:1}.matcha-drawer-backdrop{background-color:#00000052;cursor:pointer}:host(.matcha-drawer-right) .matcha-drawer-overlay-mode{border-radius:8px 0 0 8px}\n"] }]
1304
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { isOpen: [{
1305
+ type: Input
1306
+ }], mode: [{
1307
+ type: Input
1308
+ }], position: [{
1309
+ type: Input
1310
+ }], width: [{
1311
+ type: Input
1312
+ }], isOpenChange: [{
1313
+ type: Output
1314
+ }], openChange: [{
1315
+ type: Output
1316
+ }], drawerClasses: [{
1317
+ type: HostBinding,
1318
+ args: ['class']
1319
+ }], drawerWidth: [{
1320
+ type: HostBinding,
1321
+ args: ['style.width']
1322
+ }] } });
1323
+
1237
1324
  class MatchaIconComponent {
1238
1325
  constructor() {
1239
1326
  this.name = '';
@@ -2131,15 +2218,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
2131
2218
 
2132
2219
  class MatchaSpinnerComponent {
2133
2220
  set progress(value) {
2134
- this._progress = Number(value);
2221
+ this._progressValue = Number(value);
2135
2222
  }
2136
2223
  get progress() {
2137
- return this._progress;
2224
+ return this._progressValue;
2225
+ }
2226
+ get _progress() { return this.progress; }
2227
+ get _color() { return this.color; }
2228
+ get hostSize() {
2229
+ return this.size;
2138
2230
  }
2139
2231
  constructor(_elementRef, _renderer) {
2140
2232
  this._elementRef = _elementRef;
2141
2233
  this._renderer = _renderer;
2142
- this._progress = 0;
2234
+ this._progressValue = 0;
2143
2235
  this.color = 'accent';
2144
2236
  this.size = null;
2145
2237
  this.sizeXs = null;
@@ -2174,7 +2266,7 @@ class MatchaSpinnerComponent {
2174
2266
  return this.circumference - (progress / 100) * this.circumference;
2175
2267
  }
2176
2268
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaSpinnerComponent, deps: [{ token: ElementRef }, { token: Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
2177
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.1", type: MatchaSpinnerComponent, isStandalone: false, selector: "matcha-spinner", inputs: { progress: "progress", color: "color", size: "size", sizeXs: ["size-xs", "sizeXs"], sizeSm: ["size-sm", "sizeSm"], sizeMd: ["size-md", "sizeMd"], sizeLg: ["size-lg", "sizeLg"], sizeXl: ["size-xl", "sizeXl"] }, ngImport: i0, template: "<div\n class=\"matcha-spinner\"\n role=\"progressbar\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-valuenow]=\"progress\"\n>\n <svg [attr.viewBox]=\"'0 0 ' + diameter + ' ' + diameter\" class=\"spinner\">\n <circle\n class=\"spinner-placeholder\"\n [attr.cx]=\"center\"\n [attr.cy]=\"center\"\n [attr.r]=\"radius\"\n [attr.stroke-width]=\"strokeWidth\"\n stroke-linecap=\"round\"\n />\n <circle\n class=\"spinner-progress path\"\n [attr.cx]=\"center\"\n [attr.cy]=\"center\"\n [attr.r]=\"radius\"\n [attr.stroke-width]=\"strokeWidth\"\n [attr.stroke]=\"color\"\n [attr.stroke-dasharray]=\"circumference\"\n [attr.stroke-dashoffset]=\"dashOffset\"\n stroke-linecap=\"round\"\n />\n </svg>\n</div>\n", styles: [""] }); }
2269
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.1", type: MatchaSpinnerComponent, isStandalone: false, selector: "matcha-spinner", inputs: { progress: "progress", color: "color", size: "size", sizeXs: ["size-xs", "sizeXs"], sizeSm: ["size-sm", "sizeSm"], sizeMd: ["size-md", "sizeMd"], sizeLg: ["size-lg", "sizeLg"], sizeXl: ["size-xl", "sizeXl"] }, host: { properties: { "attr.progress": "this._progress", "attr.color": "this._color", "attr.size": "this.hostSize" } }, ngImport: i0, template: "<div\n class=\"matcha-spinner\"\n role=\"progressbar\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-valuenow]=\"progress\"\n>\n <svg [attr.viewBox]=\"'0 0 ' + diameter + ' ' + diameter\" class=\"spinner\">\n <circle\n class=\"spinner-placeholder\"\n [attr.cx]=\"center\"\n [attr.cy]=\"center\"\n [attr.r]=\"radius\"\n [attr.stroke-width]=\"strokeWidth\"\n stroke-linecap=\"round\"\n />\n <circle\n class=\"spinner-progress path\"\n [attr.cx]=\"center\"\n [attr.cy]=\"center\"\n [attr.r]=\"radius\"\n [attr.stroke-width]=\"strokeWidth\"\n [attr.stroke]=\"color\"\n [attr.stroke-dasharray]=\"circumference\"\n [attr.stroke-dashoffset]=\"dashOffset\"\n stroke-linecap=\"round\"\n />\n </svg>\n</div>\n", styles: [""] }); }
2178
2270
  }
2179
2271
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaSpinnerComponent, decorators: [{
2180
2272
  type: Component,
@@ -2187,11 +2279,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
2187
2279
  args: [Renderer2]
2188
2280
  }] }], propDecorators: { progress: [{
2189
2281
  type: Input
2282
+ }], _progress: [{
2283
+ type: HostBinding,
2284
+ args: ['attr.progress']
2190
2285
  }], color: [{
2191
2286
  type: Input
2287
+ }], _color: [{
2288
+ type: HostBinding,
2289
+ args: ['attr.color']
2192
2290
  }], size: [{
2193
2291
  type: Input,
2194
2292
  args: ['size']
2293
+ }], hostSize: [{
2294
+ type: HostBinding,
2295
+ args: ['attr.size']
2195
2296
  }], sizeXs: [{
2196
2297
  type: Input,
2197
2298
  args: ['size-xs']
@@ -2282,147 +2383,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
2282
2383
  type: Input
2283
2384
  }] } });
2284
2385
 
2285
- class MatchaOptionService {
2286
- constructor() {
2287
- this._optionsSubject = new BehaviorSubject([]);
2288
- this.options$ = this._optionsSubject.asObservable();
2289
- this._activeOptionSubject = new BehaviorSubject(0);
2290
- this.activeOption$ = this._activeOptionSubject.asObservable();
2291
- this._canShowOptionsSubject = new BehaviorSubject(false);
2292
- this.canShowOptions$ = this._canShowOptionsSubject.asObservable();
2293
- this._selectedOptionSubject = new Subject();
2294
- this.selectedOption$ = this._selectedOptionSubject.asObservable();
2295
- }
2296
- setSelectedOption(selectedOption) {
2297
- this._selectedOptionSubject.next(selectedOption);
2298
- }
2299
- getCanShowOptions() {
2300
- return this._canShowOptionsSubject.value;
2301
- }
2302
- setCanShowOptions(canShowOptions) {
2303
- this._canShowOptionsSubject.next(canShowOptions);
2304
- }
2305
- updateOptions(options) {
2306
- this._optionsSubject.next(options);
2307
- }
2308
- updateActiveOption(activeOption) {
2309
- this._activeOptionSubject.next(activeOption);
2310
- }
2311
- resetActiveOption() {
2312
- this.updateActiveOption(0);
2313
- const currentOptions = this._optionsSubject.value;
2314
- const activeOption = this._activeOptionSubject.value;
2315
- currentOptions.forEach((option, index) => {
2316
- index === activeOption ? option.setIsOptionActive(true, false) : option.setIsOptionActive(false, false);
2317
- });
2318
- return;
2319
- }
2320
- removeActiveOption() {
2321
- const currentOptions = this._optionsSubject.value;
2322
- currentOptions.forEach((option) => {
2323
- option.isOptionActive = false;
2324
- });
2325
- this.updateActiveOption(-1);
2326
- return;
2327
- }
2328
- changeActiveOption(stepsToMove) {
2329
- const currentOptions = this._optionsSubject.value;
2330
- const lastActiveOption = this._activeOptionSubject.value;
2331
- this.updateActiveOption(Math.max(0, Math.min(currentOptions.length - 1, lastActiveOption + stepsToMove)));
2332
- const currentActiveOption = this._activeOptionSubject.value;
2333
- currentOptions.forEach((option, index) => {
2334
- option.setIsOptionActive(index === currentActiveOption, false);
2335
- });
2336
- return;
2337
- }
2338
- selectActiveOption() {
2339
- const currentOptions = this._optionsSubject.value;
2340
- const activeOption = this._activeOptionSubject.value;
2341
- if (currentOptions[activeOption]) {
2342
- currentOptions[activeOption].selectOption();
2343
- }
2344
- }
2345
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaOptionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2346
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaOptionService, providedIn: 'root' }); }
2347
- }
2348
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaOptionService, decorators: [{
2349
- type: Injectable,
2350
- args: [{
2351
- providedIn: 'root',
2352
- }]
2353
- }], ctorParameters: () => [] });
2354
-
2355
- class MatchaOptionComponent {
2356
- constructor(changeDetectorRef, matchaOptionService) {
2357
- this.changeDetectorRef = changeDetectorRef;
2358
- this.matchaOptionService = matchaOptionService;
2359
- this.isOptionActive = false;
2360
- }
2361
- selectOption() {
2362
- this.matchaOptionService.setCanShowOptions(true);
2363
- this.matchaOptionService.setSelectedOption(this.value);
2364
- setTimeout(() => {
2365
- this.matchaOptionService.setCanShowOptions(false);
2366
- }, 300);
2367
- }
2368
- setIsOptionActive(isOptionActive, isMouseEvent) {
2369
- if (isMouseEvent) {
2370
- this.matchaOptionService.removeActiveOption();
2371
- }
2372
- this.isOptionActive = isOptionActive;
2373
- this.changeDetectorRef.detectChanges();
2374
- }
2375
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaOptionComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: MatchaOptionService }], target: i0.ɵɵFactoryTarget.Component }); }
2376
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.1", type: MatchaOptionComponent, isStandalone: false, selector: "matcha-option", inputs: { value: "value" }, ngImport: i0, template: "<span\n (click)=\"selectOption()\"\n (mouseenter)=\"setIsOptionActive(true, true)\"\n (mouseleave)=\"setIsOptionActive(false, true)\"\n [class.background-bg]=\"isOptionActive\"\n class=\"d-block py-8 cursor-pointer px-16 w-100-p\">\n <ng-content></ng-content>\n</span>\n", styles: [""] }); }
2377
- }
2378
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaOptionComponent, decorators: [{
2379
- type: Component,
2380
- args: [{ selector: 'matcha-option', standalone: false, template: "<span\n (click)=\"selectOption()\"\n (mouseenter)=\"setIsOptionActive(true, true)\"\n (mouseleave)=\"setIsOptionActive(false, true)\"\n [class.background-bg]=\"isOptionActive\"\n class=\"d-block py-8 cursor-pointer px-16 w-100-p\">\n <ng-content></ng-content>\n</span>\n" }]
2381
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: MatchaOptionService }], propDecorators: { value: [{
2382
- type: Input
2383
- }] } });
2384
-
2385
- class MatchaAutocompleteComponent {
2386
- constructor(changeDetectorRef, matchaOptionService) {
2387
- this.changeDetectorRef = changeDetectorRef;
2388
- this.matchaOptionService = matchaOptionService;
2389
- this.isDisplayAutocomplete = false;
2390
- this.activeOption = 0;
2391
- }
2392
- ngOnInit() {
2393
- this.matchaOptionService.canShowOptions$.subscribe((canShowOptions) => {
2394
- if (!canShowOptions) {
2395
- this.matchaOptionService.resetActiveOption();
2396
- }
2397
- this.isDisplayAutocomplete = canShowOptions;
2398
- });
2399
- }
2400
- ngAfterContentInit() {
2401
- const options = this.options.toArray();
2402
- if (options.length > 0) {
2403
- options[0].setIsOptionActive(true, false);
2404
- }
2405
- this.matchaOptionService.updateOptions(options);
2406
- this.options.changes.subscribe((newOptions) => {
2407
- this.matchaOptionService.updateOptions(newOptions.toArray());
2408
- this.matchaOptionService.resetActiveOption();
2409
- });
2410
- this.matchaOptionService.activeOption$.subscribe((currentActiveOption) => {
2411
- this.activeOption = currentActiveOption;
2412
- this.changeDetectorRef.detectChanges();
2413
- });
2414
- }
2415
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaAutocompleteComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: MatchaOptionService }], target: i0.ɵɵFactoryTarget.Component }); }
2416
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.1", type: MatchaAutocompleteComponent, isStandalone: false, selector: "matcha-autocomplete", queries: [{ propertyName: "options", predicate: MatchaOptionComponent }], ngImport: i0, template: "<ng-container *ngIf=\"isDisplayAutocomplete\">\n <div class=\"background-bg pt-24 position-absolute z-index-2 w-100-p\">\n <ul class=\"background-surface m-0 radius-8 elevation-z-1 p-0\">\n <ng-content></ng-content>\n </ul>\n </div>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
2417
- }
2418
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaAutocompleteComponent, decorators: [{
2419
- type: Component,
2420
- args: [{ selector: 'matcha-autocomplete', standalone: false, template: "<ng-container *ngIf=\"isDisplayAutocomplete\">\n <div class=\"background-bg pt-24 position-absolute z-index-2 w-100-p\">\n <ul class=\"background-surface m-0 radius-8 elevation-z-1 p-0\">\n <ng-content></ng-content>\n </ul>\n </div>\n</ng-container>\n" }]
2421
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: MatchaOptionService }], propDecorators: { options: [{
2422
- type: ContentChildren,
2423
- args: [MatchaOptionComponent]
2424
- }] } });
2425
-
2426
2386
  class MatchaSlideToggleComponent {
2427
2387
  set checked(value) {
2428
2388
  const newCheckedState = value === '' ? true : !!value;
@@ -3697,6 +3657,200 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
3697
3657
  args: [{ selector: 'matcha-page-layout', standalone: false, template: "<div class=\"page-layout carded fullwidth\">\n <!-- TOP BACKGROUND -->\n <div class=\"top-bg\"></div>\n <!--/ TOP BACKGROUND -->\n\n <!-- CENTER -->\n <div class=\"center pt-24 gap-16\">\n <!-- CONTENT CARD -->\n <div class=\"content-card flatten flex-column h-100-p\">\n <!-- CONTENT -->\n <div class=\"content flex-column h-100-p\">\n <div class=\"content-card card-flat flex-column h-100-p background-bg border-radius-0 pb-16\">\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n </div>\n</div>", styles: [":host{display:flex;flex-direction:column;width:100%}\n"] }]
3698
3658
  }] });
3699
3659
 
3660
+ /**
3661
+ * Token de injeção para MatchaOptionParent
3662
+ * Usado para injetar o componente pai no matcha-option
3663
+ */
3664
+ const MATCHA_OPTION_PARENT = Symbol('MatchaOptionParent');
3665
+
3666
+ class MatchaOptionComponent {
3667
+ constructor(parent, elRef) {
3668
+ this.parent = parent;
3669
+ this.elRef = elRef;
3670
+ this.disabled = false;
3671
+ this.selected = false;
3672
+ // ✅ EventEmitters para uso standalone
3673
+ this.optionClick = new EventEmitter();
3674
+ this.optionSelect = new EventEmitter();
3675
+ }
3676
+ onClick() {
3677
+ if (this.disabled)
3678
+ return;
3679
+ // ✅ Notifica o pai (se houver) - qualquer componente que implemente MatchaOptionParent
3680
+ this.parent?.selectOption(this);
3681
+ // ✅ Emite eventos para uso standalone
3682
+ this.optionClick.emit(this.value);
3683
+ this.optionSelect.emit(this);
3684
+ }
3685
+ onKeydown(ev) {
3686
+ if (ev.key === 'Enter' || ev.key === ' ') {
3687
+ ev.preventDefault();
3688
+ this.onClick();
3689
+ }
3690
+ }
3691
+ // Getter para acessar o elemento nativo (usado para scroll)
3692
+ get nativeElement() {
3693
+ return this.elRef.nativeElement;
3694
+ }
3695
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaOptionComponent, deps: [{ token: MATCHA_OPTION_PARENT, optional: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
3696
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.1", type: MatchaOptionComponent, isStandalone: false, selector: "matcha-option", inputs: { value: "value", disabled: "disabled" }, outputs: { optionClick: "optionClick", optionSelect: "optionSelect" }, host: { attributes: { "role": "option", "tabindex": "0" }, listeners: { "click": "onClick()", "keydown": "onKeydown($event)" }, properties: { "attr.aria-selected": "this.selected" }, classAttribute: "matcha-option" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true }); }
3697
+ }
3698
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaOptionComponent, decorators: [{
3699
+ type: Component,
3700
+ args: [{
3701
+ selector: 'matcha-option',
3702
+ template: `<ng-content></ng-content>`,
3703
+ host: {
3704
+ class: 'matcha-option',
3705
+ role: 'option',
3706
+ tabindex: '0'
3707
+ },
3708
+ standalone: false,
3709
+ }]
3710
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
3711
+ type: Optional
3712
+ }, {
3713
+ type: Inject,
3714
+ args: [MATCHA_OPTION_PARENT]
3715
+ }] }, { type: i0.ElementRef }], propDecorators: { value: [{
3716
+ type: Input
3717
+ }], disabled: [{
3718
+ type: Input
3719
+ }], selected: [{
3720
+ type: HostBinding,
3721
+ args: ['attr.aria-selected']
3722
+ }], optionClick: [{
3723
+ type: Output
3724
+ }], optionSelect: [{
3725
+ type: Output
3726
+ }], onClick: [{
3727
+ type: HostListener,
3728
+ args: ['click']
3729
+ }], onKeydown: [{
3730
+ type: HostListener,
3731
+ args: ['keydown', ['$event']]
3732
+ }] } });
3733
+
3734
+ class MatchaAutocompleteComponent {
3735
+ constructor(elRef, renderer, cdr) {
3736
+ this.elRef = elRef;
3737
+ this.renderer = renderer;
3738
+ this.cdr = cdr;
3739
+ this.open = false;
3740
+ this.panelStyle = {};
3741
+ this.activeIndex = -1;
3742
+ }
3743
+ ngAfterContentInit() {
3744
+ // quando options mudarem, resetamos estado relevante
3745
+ this.options.changes.subscribe(() => {
3746
+ if (this.open) {
3747
+ this.resetActive();
3748
+ this.cdr.detectChanges();
3749
+ }
3750
+ });
3751
+ }
3752
+ attachTo(input) {
3753
+ this.triggerElement = input;
3754
+ }
3755
+ openPanel() {
3756
+ if (!this.triggerElement)
3757
+ return;
3758
+ this.open = true;
3759
+ this.setPanelPosition();
3760
+ this.resetActive();
3761
+ }
3762
+ closePanel() {
3763
+ this.open = false;
3764
+ this.activeIndex = -1;
3765
+ this.updateSelectedStates();
3766
+ }
3767
+ togglePanel() {
3768
+ this.open ? this.closePanel() : this.openPanel();
3769
+ }
3770
+ setPanelPosition() {
3771
+ if (!this.triggerElement)
3772
+ return;
3773
+ const rect = this.triggerElement.getBoundingClientRect();
3774
+ const top = rect.bottom + window.scrollY;
3775
+ const left = rect.left + window.scrollX;
3776
+ this.panelStyle = {
3777
+ position: 'absolute',
3778
+ top: `${top}px`,
3779
+ left: `${left}px`,
3780
+ minWidth: `${rect.width}px`
3781
+ };
3782
+ }
3783
+ resetActive() {
3784
+ this.activeIndex = -1;
3785
+ this.updateSelectedStates();
3786
+ }
3787
+ updateSelectedStates() {
3788
+ const items = this.options.toArray();
3789
+ items.forEach((opt, i) => opt.selected = i === this.activeIndex);
3790
+ }
3791
+ highlightNext() {
3792
+ const length = this.options.length;
3793
+ if (!length)
3794
+ return;
3795
+ this.activeIndex = (this.activeIndex + 1) % length;
3796
+ this.updateSelectedStates();
3797
+ this.scrollToActive();
3798
+ }
3799
+ highlightPrevious() {
3800
+ const length = this.options.length;
3801
+ if (!length)
3802
+ return;
3803
+ this.activeIndex = (this.activeIndex - 1 + length) % length;
3804
+ this.updateSelectedStates();
3805
+ this.scrollToActive();
3806
+ }
3807
+ scrollToActive() {
3808
+ const opts = this.options.toArray();
3809
+ if (this.activeIndex < 0 || this.activeIndex >= opts.length)
3810
+ return;
3811
+ const host = opts[this.activeIndex].nativeElement;
3812
+ if (host && host.scrollIntoView) {
3813
+ host.scrollIntoView({ block: 'nearest' });
3814
+ }
3815
+ }
3816
+ selectActive() {
3817
+ if (this.activeIndex < 0)
3818
+ return;
3819
+ const opt = this.options.toArray()[this.activeIndex];
3820
+ if (opt?.disabled)
3821
+ return;
3822
+ this.selectOption(opt);
3823
+ }
3824
+ // chamado por matcha-option quando clicado
3825
+ selectOption(option) {
3826
+ this.options.forEach(o => o.selected = (o === option));
3827
+ // Fechamos painel automaticamente
3828
+ this.closePanel();
3829
+ // indireto: a directive pode ler o value via getSelectedValue()
3830
+ }
3831
+ getSelectedValue() {
3832
+ const selected = this.options.find(o => o.selected);
3833
+ return selected ? selected.value : undefined;
3834
+ }
3835
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaAutocompleteComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
3836
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.1", type: MatchaAutocompleteComponent, isStandalone: false, selector: "matcha-autocomplete", queries: [{ propertyName: "options", predicate: MatchaOptionComponent, descendants: true }], ngImport: i0, template: `
3837
+ <div class="matcha-autocomplete-panel" *ngIf="open" [ngStyle]="panelStyle" role="listbox">
3838
+ <ng-content></ng-content>
3839
+ </div>
3840
+ `, isInline: true, styles: [":host{position:absolute;z-index:1000;display:block}.matcha-autocomplete-panel{box-shadow:0 4px 10px #0000001f;border-radius:6px;background:#fff;max-height:280px;overflow:auto;min-width:160px;display:flex;flex-direction:column}.matcha-option{padding:8px 12px;cursor:pointer}.matcha-option[aria-selected=true]{background:#00000014}.matcha-option[disabled]{opacity:.5;cursor:default}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], encapsulation: i0.ViewEncapsulation.None }); }
3841
+ }
3842
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaAutocompleteComponent, decorators: [{
3843
+ type: Component,
3844
+ args: [{ selector: 'matcha-autocomplete', template: `
3845
+ <div class="matcha-autocomplete-panel" *ngIf="open" [ngStyle]="panelStyle" role="listbox">
3846
+ <ng-content></ng-content>
3847
+ </div>
3848
+ `, encapsulation: ViewEncapsulation.None, standalone: false, styles: [":host{position:absolute;z-index:1000;display:block}.matcha-autocomplete-panel{box-shadow:0 4px 10px #0000001f;border-radius:6px;background:#fff;max-height:280px;overflow:auto;min-width:160px;display:flex;flex-direction:column}.matcha-option{padding:8px 12px;cursor:pointer}.matcha-option[aria-selected=true]{background:#00000014}.matcha-option[disabled]{opacity:.5;cursor:default}\n"] }]
3849
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }], propDecorators: { options: [{
3850
+ type: ContentChildren,
3851
+ args: [MatchaOptionComponent, { descendants: true }]
3852
+ }] } });
3853
+
3700
3854
  class MatchaTooltipDirective {
3701
3855
  constructor(el, renderer) {
3702
3856
  this.el = el;
@@ -4448,98 +4602,168 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
4448
4602
  }]
4449
4603
  }] });
4450
4604
 
4451
- class MatchaOptionModule {
4452
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaOptionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4453
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.1", ngImport: i0, type: MatchaOptionModule, declarations: [MatchaOptionComponent], imports: [CommonModule], exports: [MatchaOptionComponent] }); }
4454
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaOptionModule, imports: [CommonModule] }); }
4455
- }
4456
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaOptionModule, decorators: [{
4457
- type: NgModule,
4458
- args: [{
4459
- declarations: [MatchaOptionComponent],
4460
- imports: [CommonModule],
4461
- exports: [MatchaOptionComponent],
4462
- }]
4463
- }] });
4464
-
4465
- class MatchaAutocompleteDirective {
4466
- displayAutocomplete() {
4467
- this.matchaOptionService.setCanShowOptions(true);
4605
+ class MatchaAutocompleteTriggerDirective {
4606
+ constructor(el) {
4607
+ this.el = el;
4608
+ this.subs = new Subscription();
4468
4609
  }
4469
- hideAutocomplete() {
4470
- setTimeout(() => {
4471
- const canShowAutocomplete = this.matchaOptionService.getCanShowOptions();
4472
- if (canShowAutocomplete) {
4473
- this.matchaOptionService.setCanShowOptions(false);
4474
- }
4475
- }, 300);
4610
+ ngAfterViewInit() {
4611
+ if (!this.panel) {
4612
+ throw new Error('Você precisa passar uma referência para <matcha-autocomplete> ex: [matchaAutocomplete]="auto"');
4613
+ }
4614
+ this.panel.attachTo(this.el.nativeElement);
4615
+ // close panel ao clicar fora
4616
+ const clickSub = fromEvent(document, 'click').pipe(filter((ev) => {
4617
+ const target = ev.target;
4618
+ return !this.el.nativeElement.contains(target) && !(this.panel?.elRef?.nativeElement?.contains?.(target));
4619
+ })).subscribe(() => this.panel.closePanel());
4620
+ this.subs.add(clickSub);
4476
4621
  }
4477
- onArrowDown(event) {
4478
- switch (event.key) {
4622
+ ngOnDestroy() {
4623
+ this.subs.unsubscribe();
4624
+ }
4625
+ writeValueToInput(value) {
4626
+ const input = this.el.nativeElement;
4627
+ input.value = value == null ? '' : value;
4628
+ // dispatch input event para Angular Forms
4629
+ const ev = new Event('input', { bubbles: true });
4630
+ input.dispatchEvent(ev);
4631
+ }
4632
+ onFocus() {
4633
+ // ao focar podemos abrir (ou não — depende do UX desejado)
4634
+ this.panel.openPanel();
4635
+ }
4636
+ onInput(e) {
4637
+ // se o usuário digitar, apenas reabre/posiciona painel. O filtro de opções geralmente é controlado pelo componente pai
4638
+ this.panel.setPanelPosition();
4639
+ if (!this.panel.open)
4640
+ this.panel.openPanel();
4641
+ }
4642
+ onKeydown(ev) {
4643
+ if (!this.panel)
4644
+ return;
4645
+ switch (ev.key) {
4479
4646
  case 'ArrowDown':
4480
- this.matchaOptionService.changeActiveOption(1);
4647
+ ev.preventDefault();
4648
+ this.panel.highlightNext();
4481
4649
  break;
4482
4650
  case 'ArrowUp':
4483
- this.matchaOptionService.changeActiveOption(-1);
4651
+ ev.preventDefault();
4652
+ this.panel.highlightPrevious();
4484
4653
  break;
4485
4654
  case 'Enter':
4486
- this.matchaOptionService.selectActiveOption();
4655
+ ev.preventDefault();
4656
+ this.panel.selectActive();
4657
+ // pega o value escolhido e escreve no input
4658
+ setTimeout(() => {
4659
+ const val = this.panel.getSelectedValue();
4660
+ if (val !== undefined)
4661
+ this.writeValueToInput(val);
4662
+ });
4487
4663
  break;
4488
- default:
4664
+ case 'Escape':
4665
+ ev.preventDefault();
4666
+ this.panel.closePanel();
4489
4667
  break;
4490
4668
  }
4491
4669
  }
4492
- constructor(ngControl, _elementRef, matchaOptionService) {
4493
- this.ngControl = ngControl;
4494
- this._elementRef = _elementRef;
4495
- this.matchaOptionService = matchaOptionService;
4496
- }
4497
- ngOnInit() {
4498
- this.matchaOptionService.selectedOption$.subscribe((option) => {
4499
- this._updateInputValue(option);
4500
- });
4501
- }
4502
- _updateInputValue(selectedOption) {
4503
- if (this.ngControl.control) {
4504
- this.ngControl.control.setValue(selectedOption);
4505
- this.ngControl.control.markAsDirty();
4506
- this.matchaOptionService.setCanShowOptions(false);
4507
- this._elementRef.nativeElement.blur();
4670
+ // Se uma opção for selecionada via click (o matcha-option notifica o pai que faz close),
4671
+ // lemos selectedValue e escrevemos no input. Como o selectOption do painel fecha imediatamente,
4672
+ // precisamos observar mudanças no DOM/QueryList ou checar logo após close.
4673
+ // Simples solução: observar clicks nas options via delegation:
4674
+ onDocClick(ev) {
4675
+ const target = ev.target;
4676
+ // if clicked inside an option that belongs to this panel
4677
+ if (!this.panel || !this.panel.open) {
4678
+ // se painel fechado, pode ter sido selecionado; então buscarmos selected value
4679
+ setTimeout(() => {
4680
+ const val = this.panel.getSelectedValue();
4681
+ if (val !== undefined)
4682
+ this.writeValueToInput(val);
4683
+ }, 10);
4508
4684
  }
4509
4685
  }
4510
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaAutocompleteDirective, deps: [{ token: i1$1.NgControl }, { token: i0.ElementRef }, { token: MatchaOptionService }], target: i0.ɵɵFactoryTarget.Directive }); }
4511
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.1", type: MatchaAutocompleteDirective, isStandalone: false, selector: "[matchaAutocomplete]", inputs: { matchaAutocomplete: "matchaAutocomplete" }, host: { listeners: { "focus": "displayAutocomplete()", "focusout": "hideAutocomplete()", "keydown": "onArrowDown($event)" } }, ngImport: i0 }); }
4686
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaAutocompleteTriggerDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
4687
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.1", type: MatchaAutocompleteTriggerDirective, isStandalone: false, selector: "[matchaAutocomplete]", inputs: { panel: ["matchaAutocomplete", "panel"] }, host: { listeners: { "focus": "onFocus()", "input": "onInput($event)", "keydown": "onKeydown($event)", "document:click": "onDocClick($event)" } }, ngImport: i0 }); }
4512
4688
  }
4513
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaAutocompleteDirective, decorators: [{
4689
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaAutocompleteTriggerDirective, decorators: [{
4514
4690
  type: Directive,
4515
4691
  args: [{
4516
4692
  selector: '[matchaAutocomplete]',
4517
4693
  standalone: false,
4518
4694
  }]
4519
- }], ctorParameters: () => [{ type: i1$1.NgControl }, { type: i0.ElementRef }, { type: MatchaOptionService }], propDecorators: { matchaAutocomplete: [{
4520
- type: Input
4521
- }], displayAutocomplete: [{
4695
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { panel: [{
4696
+ type: Input,
4697
+ args: ['matchaAutocomplete']
4698
+ }], onFocus: [{
4522
4699
  type: HostListener,
4523
4700
  args: ['focus']
4524
- }], hideAutocomplete: [{
4701
+ }], onInput: [{
4525
4702
  type: HostListener,
4526
- args: ['focusout']
4527
- }], onArrowDown: [{
4703
+ args: ['input', ['$event']]
4704
+ }], onKeydown: [{
4528
4705
  type: HostListener,
4529
4706
  args: ['keydown', ['$event']]
4707
+ }], onDocClick: [{
4708
+ type: HostListener,
4709
+ args: ['document:click', ['$event']]
4530
4710
  }] } });
4531
4711
 
4712
+ class MatchaOptionModule {
4713
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaOptionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4714
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.1", ngImport: i0, type: MatchaOptionModule, declarations: [MatchaOptionComponent], imports: [CommonModule], exports: [MatchaOptionComponent] }); }
4715
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaOptionModule, imports: [CommonModule] }); }
4716
+ }
4717
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaOptionModule, decorators: [{
4718
+ type: NgModule,
4719
+ args: [{
4720
+ declarations: [
4721
+ MatchaOptionComponent
4722
+ ],
4723
+ imports: [
4724
+ CommonModule
4725
+ ],
4726
+ exports: [
4727
+ MatchaOptionComponent
4728
+ ]
4729
+ }]
4730
+ }] });
4731
+
4532
4732
  class MatchaAutocompleteModule {
4533
4733
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaAutocompleteModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4534
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.1", ngImport: i0, type: MatchaAutocompleteModule, declarations: [MatchaAutocompleteComponent, MatchaAutocompleteDirective], imports: [CommonModule, FormsModule, MatchaOptionModule], exports: [MatchaAutocompleteComponent, MatchaAutocompleteDirective] }); }
4535
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaAutocompleteModule, imports: [CommonModule, FormsModule, MatchaOptionModule] }); }
4734
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.1", ngImport: i0, type: MatchaAutocompleteModule, declarations: [MatchaAutocompleteComponent,
4735
+ MatchaAutocompleteTriggerDirective], imports: [CommonModule,
4736
+ MatchaOptionModule], exports: [MatchaAutocompleteComponent,
4737
+ MatchaAutocompleteTriggerDirective,
4738
+ MatchaOptionModule // Re-exporta para conveniência
4739
+ ] }); }
4740
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaAutocompleteModule, providers: [
4741
+ // ✅ Provider para permitir injeção da interface MatchaOptionParent
4742
+ { provide: MATCHA_OPTION_PARENT, useExisting: MatchaAutocompleteComponent }
4743
+ ], imports: [CommonModule,
4744
+ MatchaOptionModule, MatchaOptionModule // Re-exporta para conveniência
4745
+ ] }); }
4536
4746
  }
4537
4747
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaAutocompleteModule, decorators: [{
4538
4748
  type: NgModule,
4539
4749
  args: [{
4540
- declarations: [MatchaAutocompleteComponent, MatchaAutocompleteDirective],
4541
- imports: [CommonModule, FormsModule, MatchaOptionModule],
4542
- exports: [MatchaAutocompleteComponent, MatchaAutocompleteDirective],
4750
+ declarations: [
4751
+ MatchaAutocompleteComponent,
4752
+ MatchaAutocompleteTriggerDirective
4753
+ ],
4754
+ imports: [
4755
+ CommonModule,
4756
+ MatchaOptionModule
4757
+ ],
4758
+ exports: [
4759
+ MatchaAutocompleteComponent,
4760
+ MatchaAutocompleteTriggerDirective,
4761
+ MatchaOptionModule // Re-exporta para conveniência
4762
+ ],
4763
+ providers: [
4764
+ // ✅ Provider para permitir injeção da interface MatchaOptionParent
4765
+ { provide: MATCHA_OPTION_PARENT, useExisting: MatchaAutocompleteComponent }
4766
+ ]
4543
4767
  }]
4544
4768
  }] });
4545
4769
 
@@ -5409,14 +5633,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
5409
5633
  }]
5410
5634
  }] });
5411
5635
 
5636
+ class MatchaDrawerModule {
5637
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaDrawerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
5638
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.1", ngImport: i0, type: MatchaDrawerModule, declarations: [MatchaDrawerComponent], imports: [CommonModule,
5639
+ MatchaButtonModule], exports: [MatchaDrawerComponent] }); }
5640
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaDrawerModule, imports: [CommonModule,
5641
+ MatchaButtonModule] }); }
5642
+ }
5643
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaDrawerModule, decorators: [{
5644
+ type: NgModule,
5645
+ args: [{
5646
+ declarations: [
5647
+ MatchaDrawerComponent
5648
+ ],
5649
+ imports: [
5650
+ CommonModule,
5651
+ MatchaButtonModule
5652
+ ],
5653
+ exports: [
5654
+ MatchaDrawerComponent
5655
+ ]
5656
+ }]
5657
+ }] });
5658
+
5412
5659
  class MatchaComponentsModule {
5413
5660
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
5414
5661
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.1", ngImport: i0, type: MatchaComponentsModule, declarations: [MatchaOverflowDraggableComponent], imports: [CommonModule,
5415
5662
  FormsModule,
5416
5663
  ReactiveFormsModule,
5417
5664
  MatchaAccordionModule,
5418
- MatchaOptionModule,
5419
5665
  MatchaAutocompleteModule,
5666
+ MatchaOptionModule,
5420
5667
  MatchaBadgeModule,
5421
5668
  MatchaButtonModule,
5422
5669
  MatchaButtonToggleModule,
@@ -5456,8 +5703,10 @@ class MatchaComponentsModule {
5456
5703
  MatchaDateModule,
5457
5704
  MatchaTimeModule,
5458
5705
  MatchaDropListModule,
5459
- MatchaPageLayoutModule], exports: [MatchaAccordionModule,
5706
+ MatchaPageLayoutModule,
5707
+ MatchaDrawerModule], exports: [MatchaAccordionModule,
5460
5708
  MatchaAutocompleteModule,
5709
+ MatchaOptionModule,
5461
5710
  MatchaBadgeModule,
5462
5711
  MatchaButtonModule,
5463
5712
  MatchaButtonToggleModule,
@@ -5478,7 +5727,6 @@ class MatchaComponentsModule {
5478
5727
  MatchaMasonryModule,
5479
5728
  MatchaMenuModule,
5480
5729
  MatchaModalModule,
5481
- MatchaOptionModule,
5482
5730
  MatchaPaginatorModule,
5483
5731
  MatchaProgressBarModule,
5484
5732
  MatchaRippleModule,
@@ -5498,13 +5746,14 @@ class MatchaComponentsModule {
5498
5746
  MatchaDateModule,
5499
5747
  MatchaTimeModule,
5500
5748
  MatchaDropListModule,
5501
- MatchaPageLayoutModule] }); }
5749
+ MatchaPageLayoutModule,
5750
+ MatchaDrawerModule] }); }
5502
5751
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaComponentsModule, imports: [CommonModule,
5503
5752
  FormsModule,
5504
5753
  ReactiveFormsModule,
5505
5754
  MatchaAccordionModule,
5506
- MatchaOptionModule,
5507
5755
  MatchaAutocompleteModule,
5756
+ MatchaOptionModule,
5508
5757
  MatchaBadgeModule,
5509
5758
  MatchaButtonModule,
5510
5759
  MatchaButtonToggleModule,
@@ -5544,8 +5793,10 @@ class MatchaComponentsModule {
5544
5793
  MatchaDateModule,
5545
5794
  MatchaTimeModule,
5546
5795
  MatchaDropListModule,
5547
- MatchaPageLayoutModule, MatchaAccordionModule,
5796
+ MatchaPageLayoutModule,
5797
+ MatchaDrawerModule, MatchaAccordionModule,
5548
5798
  MatchaAutocompleteModule,
5799
+ MatchaOptionModule,
5549
5800
  MatchaBadgeModule,
5550
5801
  MatchaButtonModule,
5551
5802
  MatchaButtonToggleModule,
@@ -5566,7 +5817,6 @@ class MatchaComponentsModule {
5566
5817
  MatchaMasonryModule,
5567
5818
  MatchaMenuModule,
5568
5819
  MatchaModalModule,
5569
- MatchaOptionModule,
5570
5820
  MatchaPaginatorModule,
5571
5821
  MatchaProgressBarModule,
5572
5822
  MatchaRippleModule,
@@ -5586,7 +5836,8 @@ class MatchaComponentsModule {
5586
5836
  MatchaDateModule,
5587
5837
  MatchaTimeModule,
5588
5838
  MatchaDropListModule,
5589
- MatchaPageLayoutModule] }); }
5839
+ MatchaPageLayoutModule,
5840
+ MatchaDrawerModule] }); }
5590
5841
  }
5591
5842
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MatchaComponentsModule, decorators: [{
5592
5843
  type: NgModule,
@@ -5597,8 +5848,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
5597
5848
  FormsModule,
5598
5849
  ReactiveFormsModule,
5599
5850
  MatchaAccordionModule,
5600
- MatchaOptionModule,
5601
5851
  MatchaAutocompleteModule,
5852
+ MatchaOptionModule,
5602
5853
  MatchaBadgeModule,
5603
5854
  MatchaButtonModule,
5604
5855
  MatchaButtonToggleModule,
@@ -5638,10 +5889,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
5638
5889
  MatchaDateModule,
5639
5890
  MatchaTimeModule,
5640
5891
  MatchaDropListModule,
5641
- MatchaPageLayoutModule
5892
+ MatchaPageLayoutModule,
5893
+ MatchaDrawerModule
5642
5894
  ],
5643
5895
  exports: [MatchaAccordionModule,
5644
5896
  MatchaAutocompleteModule,
5897
+ MatchaOptionModule,
5645
5898
  MatchaBadgeModule,
5646
5899
  MatchaButtonModule,
5647
5900
  MatchaButtonToggleModule,
@@ -5662,7 +5915,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
5662
5915
  MatchaMasonryModule,
5663
5916
  MatchaMenuModule,
5664
5917
  MatchaModalModule,
5665
- MatchaOptionModule,
5666
5918
  MatchaPaginatorModule,
5667
5919
  MatchaProgressBarModule,
5668
5920
  MatchaRippleModule,
@@ -5682,7 +5934,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
5682
5934
  MatchaDateModule,
5683
5935
  MatchaTimeModule,
5684
5936
  MatchaDropListModule,
5685
- MatchaPageLayoutModule
5937
+ MatchaPageLayoutModule,
5938
+ MatchaDrawerModule
5686
5939
  ],
5687
5940
  }]
5688
5941
  }] });
@@ -5750,5 +6003,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
5750
6003
  * Generated bundle index. Do not edit.
5751
6004
  */
5752
6005
 
5753
- export { MatchaAccordionComponent, MatchaAccordionContentComponent, MatchaAccordionHeaderComponent, MatchaAccordionItemComponent, MatchaAccordionModule, MatchaAutocompleteComponent, MatchaAutocompleteDirective, MatchaAutocompleteModule, 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, MatchaLazyloadComponent, MatchaLazyloadDataComponent, MatchaLazyloadModule, MatchaMasonryComponent, MatchaMasonryModule, MatchaMenuComponent, MatchaMenuModule, MatchaMenuTriggerForDirective, MatchaModalComponent, MatchaModalContentComponent, MatchaModalFooterComponent, MatchaModalHeaderComponent, MatchaModalModule, MatchaModalOptionsComponent, MatchaModalService, MatchaOptionComponent, MatchaOptionModule, MatchaOptionService, MatchaOverlayService, MatchaPageLayoutComponent, MatchaPageLayoutModule, MatchaPaginatorDirective, MatchaPaginatorModule, MatchaProgressBarDirective, MatchaProgressBarModule, MatchaRadioComponent, MatchaRadioModule, MatchaRippleDirective, MatchaRippleModule, MatchaSelectDirective, MatchaSelectModule, MatchaSidenavDirective, MatchaSidenavModule, MatchaSkeletonComponent, MatchaSkeletonModule, MatchaSlideToggleComponent, MatchaSlideToggleModule, MatchaSliderDirective, MatchaSliderModule, MatchaSnackBarDirective, MatchaSnackBarModule, MatchaSortHeaderDirective, MatchaSortHeaderModule, MatchaSpinComponent, MatchaSpinModule, MatchaSpinnerComponent, MatchaSpinnerModule, MatchaStepperComponent, MatchaStepperContentComponent, MatchaStepperControllerComponent, MatchaStepperModule, MatchaStepperStateService, MatchaTabItemComponent, MatchaTableDirective, MatchaTableModule, MatchaTabsComponent, MatchaTabsModule, MatchaTimeComponent, MatchaTimeModule, MatchaTitleComponent, MatchaTitleModule, MatchaToolbarButtonComponent, MatchaToolbarComponent, MatchaToolbarContentComponent, MatchaToolbarCustomButtonComponent, MatchaToolbarMainButtonComponent, MatchaToolbarModule, MatchaTooltipDirective, MatchaTooltipModule, NextStepDirective, PrevStepDirective, StepComponent, StepContentDirective };
6006
+ export { MATCHA_OPTION_PARENT, MatchaAccordionComponent, MatchaAccordionContentComponent, MatchaAccordionHeaderComponent, MatchaAccordionItemComponent, MatchaAccordionModule, MatchaAutocompleteComponent, MatchaAutocompleteModule, MatchaAutocompleteTriggerDirective, MatchaBadgeDirective, MatchaBadgeModule, MatchaButtonComponent, MatchaButtonModule, MatchaButtonToggleComponent, MatchaButtonToggleModule, MatchaCardComponent, MatchaCardModule, MatchaCheckboxComponent, MatchaCheckboxModule, MatchaChipsDirective, MatchaChipsModule, MatchaComponentsModule, MatchaDateComponent, MatchaDateModule, MatchaDatepickerDirective, MatchaDatepickerModule, MatchaDividerComponent, MatchaDividerModule, MatchaDragDirective, MatchaDragHandleDirective, MatchaDrawerComponent, MatchaDrawerModule, MatchaDropListComponent, MatchaDropListModule, MatchaElevationDirective, MatchaElevationModule, MatchaErrorComponent, MatchaFormFieldComponent, MatchaFormFieldModule, MatchaGridComponent, MatchaGridModule, MatchaHintTextComponent, MatchaHintTextModule, MatchaIconComponent, MatchaIconModule, MatchaInfiniteScrollComponent, MatchaInfiniteScrollDataComponent, MatchaInfiniteScrollModule, MatchaInputDirective, MatchaInputModule, MatchaLabelComponent, MatchaLazyloadComponent, MatchaLazyloadDataComponent, MatchaLazyloadModule, MatchaMasonryComponent, MatchaMasonryModule, MatchaMenuComponent, MatchaMenuModule, MatchaMenuTriggerForDirective, MatchaModalComponent, MatchaModalContentComponent, MatchaModalFooterComponent, MatchaModalHeaderComponent, MatchaModalModule, MatchaModalOptionsComponent, MatchaModalService, MatchaOptionComponent, MatchaOptionModule, MatchaOverlayService, MatchaPageLayoutComponent, MatchaPageLayoutModule, MatchaPaginatorDirective, MatchaPaginatorModule, MatchaProgressBarDirective, MatchaProgressBarModule, MatchaRadioComponent, MatchaRadioModule, MatchaRippleDirective, MatchaRippleModule, MatchaSelectDirective, MatchaSelectModule, MatchaSidenavDirective, MatchaSidenavModule, MatchaSkeletonComponent, MatchaSkeletonModule, MatchaSlideToggleComponent, MatchaSlideToggleModule, MatchaSliderDirective, MatchaSliderModule, MatchaSnackBarDirective, MatchaSnackBarModule, MatchaSortHeaderDirective, MatchaSortHeaderModule, MatchaSpinComponent, MatchaSpinModule, MatchaSpinnerComponent, MatchaSpinnerModule, MatchaStepperComponent, MatchaStepperContentComponent, MatchaStepperControllerComponent, MatchaStepperModule, MatchaStepperStateService, MatchaTabItemComponent, MatchaTableDirective, MatchaTableModule, MatchaTabsComponent, MatchaTabsModule, MatchaTimeComponent, MatchaTimeModule, MatchaTitleComponent, MatchaTitleModule, MatchaToolbarButtonComponent, MatchaToolbarComponent, MatchaToolbarContentComponent, MatchaToolbarCustomButtonComponent, MatchaToolbarMainButtonComponent, MatchaToolbarModule, MatchaTooltipDirective, MatchaTooltipModule, NextStepDirective, PrevStepDirective, StepComponent, StepContentDirective };
5754
6007
  //# sourceMappingURL=matcha-components.mjs.map