@ng-matero/extensions 19.2.1 → 19.3.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.
Files changed (57) hide show
  1. package/checkbox-group/checkbox-group.d.ts +3 -3
  2. package/colorpicker/colorpicker-animations.d.ts +3 -2
  3. package/colorpicker/colorpicker-content.scss +31 -0
  4. package/colorpicker/colorpicker.d.ts +21 -4
  5. package/core/tokens/m2/mtx/_select.scss +1 -0
  6. package/core/tokens/m3/mtx/_select.scss +4 -0
  7. package/datetimepicker/calendar.d.ts +0 -3
  8. package/datetimepicker/datetimepicker-animations.d.ts +5 -4
  9. package/datetimepicker/datetimepicker-content.scss +48 -1
  10. package/datetimepicker/datetimepicker.d.ts +22 -6
  11. package/datetimepicker/month-view.d.ts +0 -3
  12. package/drawer/drawer-animations.d.ts +6 -3
  13. package/drawer/drawer-container.d.ts +7 -4
  14. package/drawer/drawer-container.scss +55 -8
  15. package/fesm2022/mtxAlert.mjs +7 -7
  16. package/fesm2022/mtxButton.mjs +7 -7
  17. package/fesm2022/mtxCheckboxGroup.mjs +9 -7
  18. package/fesm2022/mtxCheckboxGroup.mjs.map +1 -1
  19. package/fesm2022/mtxColorpicker.mjs +137 -48
  20. package/fesm2022/mtxColorpicker.mjs.map +1 -1
  21. package/fesm2022/mtxColumnResize.mjs +40 -40
  22. package/fesm2022/mtxCore.mjs +21 -21
  23. package/fesm2022/mtxDatetimepicker.mjs +302 -156
  24. package/fesm2022/mtxDatetimepicker.mjs.map +1 -1
  25. package/fesm2022/mtxDialog.mjs +10 -10
  26. package/fesm2022/mtxDrawer.mjs +118 -46
  27. package/fesm2022/mtxDrawer.mjs.map +1 -1
  28. package/fesm2022/mtxGrid.mjs +87 -86
  29. package/fesm2022/mtxGrid.mjs.map +1 -1
  30. package/fesm2022/mtxLoader.mjs +7 -7
  31. package/fesm2022/mtxPhotoviewer.mjs +7 -7
  32. package/fesm2022/mtxPopover.mjs +220 -143
  33. package/fesm2022/mtxPopover.mjs.map +1 -1
  34. package/fesm2022/mtxProgress.mjs +7 -7
  35. package/fesm2022/mtxSelect.mjs +53 -53
  36. package/fesm2022/mtxSelect.mjs.map +1 -1
  37. package/fesm2022/mtxSplit.mjs +10 -10
  38. package/fesm2022/mtxTooltip.mjs +103 -54
  39. package/fesm2022/mtxTooltip.mjs.map +1 -1
  40. package/grid/column-menu.d.ts +3 -1
  41. package/grid/grid.d.ts +6 -1
  42. package/grid/grid.scss +18 -4
  43. package/grid/interfaces.d.ts +2 -0
  44. package/package.json +9 -10
  45. package/popover/popover-animations.d.ts +9 -12
  46. package/popover/popover-trigger.d.ts +11 -2
  47. package/popover/popover.d.ts +14 -9
  48. package/popover/popover.scss +40 -0
  49. package/prebuilt-themes/deeppurple-amber.css +1 -1
  50. package/prebuilt-themes/indigo-pink.css +1 -1
  51. package/prebuilt-themes/pink-bluegrey.css +1 -1
  52. package/prebuilt-themes/purple-green.css +1 -1
  53. package/select/select.scss +22 -33
  54. package/split/split.d.ts +3 -3
  55. package/tooltip/tooltip-animations.d.ts +3 -2
  56. package/tooltip/tooltip.d.ts +19 -11
  57. package/tooltip/tooltip.scss +1 -1
@@ -1,38 +1,13 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Directive, Inject, inject, ChangeDetectorRef, ElementRef, NgZone, EventEmitter, booleanAttribute, TemplateRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, ViewChild, ContentChild, ViewContainerRef, NgModule } from '@angular/core';
2
+ import { InjectionToken, Directive, Inject, inject, Injector, ChangeDetectorRef, ElementRef, NgZone, EventEmitter, ANIMATION_MODULE_TYPE, booleanAttribute, TemplateRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, ViewChild, ContentChild, ViewContainerRef, NgModule } from '@angular/core';
3
3
  import { DOCUMENT, CommonModule } from '@angular/common';
4
4
  import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
5
5
  import { CdkTrapFocus, FocusMonitor, isFakeMousedownFromScreenReader, A11yModule } from '@angular/cdk/a11y';
6
6
  import { ESCAPE, hasModifierKey, ENTER, SPACE } from '@angular/cdk/keycodes';
7
7
  import { Subject, Subscription, of, merge } from 'rxjs';
8
- import { trigger, state, style, transition, animate } from '@angular/animations';
9
8
  import { TemplatePortal, DomPortalOutlet } from '@angular/cdk/portal';
10
9
  import { Directionality } from '@angular/cdk/bidi';
11
- import { filter, take, takeUntil } from 'rxjs/operators';
12
-
13
- /**
14
- * Below are all the animations for the mtx-popover component.
15
- * Animation duration and timing values are based on AngularJS Material.
16
- */
17
- /**
18
- * This animation controls the popover panel's entry and exit from the page.
19
- *
20
- * When the popover panel is added to the DOM, it scales in and fades in its border.
21
- *
22
- * When the popover panel is removed from the DOM, it simply fades out after a brief
23
- * delay to display the ripple.
24
- */
25
- const transformPopover = trigger('transformPopover', [
26
- state('void', style({
27
- opacity: 0,
28
- transform: 'scale(0.8)',
29
- })),
30
- transition('void => enter', animate('120ms cubic-bezier(0, 0, 0.2, 1)', style({
31
- opacity: 1,
32
- transform: 'scale(1)',
33
- }))),
34
- transition('* => void', animate('100ms 25ms linear', style({ opacity: 0 }))),
35
- ]);
10
+ import { filter, take } from 'rxjs/operators';
36
11
 
37
12
  /**
38
13
  * Injection token that can be used to reference instances of `MtxPopoverContent`. It serves
@@ -95,10 +70,10 @@ class _MtxPopoverContentBase {
95
70
  this._outlet.dispose();
96
71
  }
97
72
  }
98
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: _MtxPopoverContentBase, deps: [{ token: i0.TemplateRef }, { token: i0.ComponentFactoryResolver }, { token: i0.ApplicationRef }, { token: i0.Injector }, { token: i0.ViewContainerRef }, { token: DOCUMENT }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
99
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.6", type: _MtxPopoverContentBase, isStandalone: true, ngImport: i0 }); }
73
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: _MtxPopoverContentBase, deps: [{ token: i0.TemplateRef }, { token: i0.ComponentFactoryResolver }, { token: i0.ApplicationRef }, { token: i0.Injector }, { token: i0.ViewContainerRef }, { token: DOCUMENT }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
74
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: _MtxPopoverContentBase, isStandalone: true, ngImport: i0 }); }
100
75
  }
101
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: _MtxPopoverContentBase, decorators: [{
76
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: _MtxPopoverContentBase, decorators: [{
102
77
  type: Directive
103
78
  }], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i0.ComponentFactoryResolver }, { type: i0.ApplicationRef }, { type: i0.Injector }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
104
79
  type: Inject,
@@ -108,10 +83,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
108
83
  * Popover content that will be rendered lazily once the popover is opened.
109
84
  */
110
85
  class MtxPopoverContent extends _MtxPopoverContentBase {
111
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: MtxPopoverContent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
112
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.6", type: MtxPopoverContent, isStandalone: true, selector: "ng-template[mtxPopoverContent]", providers: [{ provide: MTX_POPOVER_CONTENT, useExisting: MtxPopoverContent }], usesInheritance: true, ngImport: i0 }); }
86
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: MtxPopoverContent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
87
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: MtxPopoverContent, isStandalone: true, selector: "ng-template[mtxPopoverContent]", providers: [{ provide: MTX_POPOVER_CONTENT, useExisting: MtxPopoverContent }], usesInheritance: true, ngImport: i0 }); }
113
88
  }
114
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: MtxPopoverContent, decorators: [{
89
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: MtxPopoverContent, decorators: [{
115
90
  type: Directive,
116
91
  args: [{
117
92
  selector: 'ng-template[mtxPopoverContent]',
@@ -151,21 +126,83 @@ const MTX_POPOVER_DEFAULT_OPTIONS = new InjectionToken('mtx-popover-default-opti
151
126
  providedIn: 'root',
152
127
  factory: MTX_POPOVER_DEFAULT_OPTIONS_FACTORY,
153
128
  });
154
- /** @docs-private */
129
+ /**
130
+ * @docs-private
131
+ * @deprecated No longer used, will be removed.
132
+ * @breaking-change 21.0.0
133
+ */
155
134
  function MTX_POPOVER_DEFAULT_OPTIONS_FACTORY() {
156
135
  return {
157
136
  backdropClass: 'cdk-overlay-transparent-backdrop',
158
137
  };
159
138
  }
160
139
  let popoverPanelUid = 0;
140
+ /** Name of the enter animation `@keyframes`. */
141
+ const ENTER_ANIMATION = '_mtx-popover-enter';
142
+ /** Name of the exit animation `@keyframes`. */
143
+ const EXIT_ANIMATION = '_mtx-popover-exit';
161
144
  class MtxPopover {
145
+ /** Popover's position. */
146
+ get position() {
147
+ return this._position;
148
+ }
149
+ set position(value) {
150
+ if (!['before', 'after', 'above', 'below'].includes(value[0])) {
151
+ throwMtxPopoverInvalidPositionStart();
152
+ }
153
+ if (!['before', 'after', 'above', 'below', 'center'].includes(value[1])) {
154
+ throwMtxPopoverInvalidPositionEnd();
155
+ }
156
+ this._position = value;
157
+ this.setPositionClasses();
158
+ }
159
+ /**
160
+ * This method takes classes set on the host mtx-popover element and applies them on the
161
+ * popover template that displays in the overlay container. Otherwise, it's difficult
162
+ * to style the containing popover from outside the component.
163
+ * @param classes list of class names
164
+ */
165
+ set panelClass(classes) {
166
+ const previousPanelClass = this._previousPanelClass;
167
+ const newClassList = { ...this._classList };
168
+ if (previousPanelClass && previousPanelClass.length) {
169
+ previousPanelClass.split(' ').forEach((className) => {
170
+ newClassList[className] = false;
171
+ });
172
+ }
173
+ this._previousPanelClass = classes;
174
+ if (classes && classes.length) {
175
+ classes.split(' ').forEach((className) => {
176
+ newClassList[className] = true;
177
+ });
178
+ this._elementRef.nativeElement.className = '';
179
+ this.setPositionClasses();
180
+ }
181
+ this._classList = newClassList;
182
+ }
183
+ /**
184
+ * This method takes classes set on the host mtx-popover element and applies them on the
185
+ * popover template that displays in the overlay container. Otherwise, it's difficult
186
+ * to style the containing popover from outside the component.
187
+ * @deprecated Use `panelClass` instead.
188
+ * @breaking-change 8.0.0
189
+ */
190
+ get classList() {
191
+ return this.panelClass;
192
+ }
193
+ set classList(classes) {
194
+ this.panelClass = classes;
195
+ }
162
196
  constructor() {
197
+ this._injector = inject(Injector);
163
198
  this._changeDetectorRef = inject(ChangeDetectorRef);
164
199
  this._elementRef = inject(ElementRef);
165
200
  this._unusedNgZone = inject(NgZone);
166
201
  this._defaultOptions = inject(MTX_POPOVER_DEFAULT_OPTIONS);
167
202
  this._elevationPrefix = 'mat-elevation-z';
168
203
  this._baseElevation = null;
204
+ /** Whether animations are currently disabled. */
205
+ this._animationsDisabled = false;
169
206
  /** Config object to be passed into the popover's class. */
170
207
  this._classList = {};
171
208
  /** Current state of the panel animation. */
@@ -214,63 +251,15 @@ class MtxPopover {
214
251
  /** Event emitted when the popover is closed. */
215
252
  this.closed = new EventEmitter();
216
253
  this.panelId = `mtx-popover-panel-${popoverPanelUid++}`;
217
- }
218
- /** Popover's position. */
219
- get position() {
220
- return this._position;
221
- }
222
- set position(value) {
223
- if (!['before', 'after', 'above', 'below'].includes(value[0])) {
224
- throwMtxPopoverInvalidPositionStart();
225
- }
226
- if (!['before', 'after', 'above', 'below', 'center'].includes(value[1])) {
227
- throwMtxPopoverInvalidPositionEnd();
228
- }
229
- this._position = value;
230
- this.setPositionClasses();
231
- }
232
- /**
233
- * This method takes classes set on the host mtx-popover element and applies them on the
234
- * popover template that displays in the overlay container. Otherwise, it's difficult
235
- * to style the containing popover from outside the component.
236
- * @param classes list of class names
237
- */
238
- set panelClass(classes) {
239
- const previousPanelClass = this._previousPanelClass;
240
- const newClassList = { ...this._classList };
241
- if (previousPanelClass && previousPanelClass.length) {
242
- previousPanelClass.split(' ').forEach((className) => {
243
- newClassList[className] = false;
244
- });
245
- }
246
- this._previousPanelClass = classes;
247
- if (classes && classes.length) {
248
- classes.split(' ').forEach((className) => {
249
- newClassList[className] = true;
250
- });
251
- this._elementRef.nativeElement.className = '';
252
- this.setPositionClasses();
253
- }
254
- this._classList = newClassList;
255
- }
256
- /**
257
- * This method takes classes set on the host mtx-popover element and applies them on the
258
- * popover template that displays in the overlay container. Otherwise, it's difficult
259
- * to style the containing popover from outside the component.
260
- * @deprecated Use `panelClass` instead.
261
- * @breaking-change 8.0.0
262
- */
263
- get classList() {
264
- return this.panelClass;
265
- }
266
- set classList(classes) {
267
- this.panelClass = classes;
254
+ this._animationsDisabled =
255
+ inject(ANIMATION_MODULE_TYPE, { optional: true }) === 'NoopAnimations';
268
256
  }
269
257
  ngOnInit() {
270
258
  this.setPositionClasses();
271
259
  }
272
260
  ngOnDestroy() {
273
261
  this.closed.complete();
262
+ clearTimeout(this._exitFallbackTimeout);
274
263
  }
275
264
  /** Handle a keyboard event from the popover, delegating to the appropriate action. */
276
265
  _handleKeydown(event) {
@@ -377,31 +366,49 @@ class MtxPopover {
377
366
  this._classList = newClassList;
378
367
  }
379
368
  }
380
- /** Starts the enter animation. */
381
- _startAnimation() {
382
- // @breaking-change 8.0.0 Combine with _resetAnimation.
383
- this._panelAnimationState = 'enter';
384
- }
385
- /** Resets the panel animation to its initial state. */
386
- _resetAnimation() {
387
- // @breaking-change 8.0.0 Combine with _startAnimation.
388
- this._panelAnimationState = 'void';
389
- }
390
369
  /** Callback that is invoked when the panel animation completes. */
391
- _onAnimationDone(event) {
392
- this._animationDone.next(event);
393
- this._isAnimating = false;
370
+ _onAnimationDone(state) {
371
+ const isExit = state === EXIT_ANIMATION;
372
+ if (isExit || state === ENTER_ANIMATION) {
373
+ if (isExit) {
374
+ clearTimeout(this._exitFallbackTimeout);
375
+ this._exitFallbackTimeout = undefined;
376
+ }
377
+ this._animationDone.next(isExit ? 'void' : 'enter');
378
+ this._isAnimating = false;
379
+ }
394
380
  }
395
- _onAnimationStart(event) {
396
- this._isAnimating = true;
381
+ _onAnimationStart(state) {
382
+ if (state === ENTER_ANIMATION || state === EXIT_ANIMATION) {
383
+ this._isAnimating = true;
384
+ }
397
385
  }
398
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: MtxPopover, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
399
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.6", type: MtxPopover, isStandalone: true, selector: "mtx-popover", inputs: { backdropClass: "backdropClass", ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"], ariaDescribedby: ["aria-describedby", "ariaDescribedby"], triggerEvent: "triggerEvent", enterDelay: "enterDelay", leaveDelay: "leaveDelay", position: "position", xOffset: "xOffset", yOffset: "yOffset", arrowWidth: "arrowWidth", arrowHeight: "arrowHeight", arrowOffsetX: "arrowOffsetX", arrowOffsetY: "arrowOffsetY", hideArrow: ["hideArrow", "hideArrow", booleanAttribute], closeOnPanelClick: ["closeOnPanelClick", "closeOnPanelClick", booleanAttribute], closeOnBackdropClick: ["closeOnBackdropClick", "closeOnBackdropClick", booleanAttribute], focusTrapEnabled: ["focusTrapEnabled", "focusTrapEnabled", booleanAttribute], focusTrapAutoCaptureEnabled: ["focusTrapAutoCaptureEnabled", "focusTrapAutoCaptureEnabled", booleanAttribute], hasBackdrop: ["hasBackdrop", "hasBackdrop", booleanAttribute], panelClass: ["class", "panelClass"], classList: "classList" }, outputs: { closed: "closed" }, queries: [{ propertyName: "lazyContent", first: true, predicate: MTX_POPOVER_CONTENT, descendants: true }], viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], exportAs: ["mtxPopover"], ngImport: i0, template: "<ng-template>\n <!-- eslint-disable @angular-eslint/template/mouse-events-have-key-events -->\n <div\n [id]=\"panelId\"\n class=\"mtx-popover-panel\"\n [class]=\"_classList\"\n [class.mtx-popover-panel-without-arrow]=\"hideArrow\"\n (keydown)=\"_handleKeydown($event)\"\n (click)=\"_handleClick()\"\n (mouseover)=\"_handleMouseOver()\"\n (mouseleave)=\"_handleMouseLeave()\"\n [@transformPopover]=\"_panelAnimationState\"\n (@transformPopover.start)=\"_onAnimationStart($event)\"\n (@transformPopover.done)=\"_onAnimationDone($event)\"\n tabindex=\"-1\"\n role=\"dialog\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledby || null\"\n [attr.aria-describedby]=\"ariaDescribedby || null\"\n [cdkTrapFocus]=\"focusTrapEnabled\"\n [cdkTrapFocusAutoCapture]=\"focusTrapAutoCaptureEnabled\"\n >\n <div class=\"mtx-popover-content\">\n <ng-content></ng-content>\n </div>\n @if (!hideArrow) {\n <div class=\"mtx-popover-direction-arrow\" [style]=\"arrowStyles\"></div>\n }\n </div>\n</ng-template>\n", styles: [".mtx-popover-panel{position:relative;max-height:calc(100vh - 48px);padding:8px;font-size:inherit;outline:0;border-radius:var(--mtx-popover-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mtx-popover-background-color, var(--mat-sys-surface-container));color:var(--mtx-popover-text-color, var(--mat-sys-on-surface))}.mtx-popover-panel[class*=mtx-popover-below]{margin-top:calc(.5em + 2px)}.mtx-popover-panel[class*=mtx-popover-above]{margin-bottom:calc(.5em + 2px)}.mtx-popover-panel[class*=mtx-popover-before]{margin-right:calc(.5em + 2px)}[dir=rtl] .mtx-popover-panel[class*=mtx-popover-before]{margin-right:auto;margin-left:calc(.5em + 2px)}.mtx-popover-panel[class*=mtx-popover-after]{margin-left:calc(.5em + 2px)}[dir=rtl] .mtx-popover-panel[class*=mtx-popover-after]{margin-left:auto;margin-right:calc(.5em + 2px)}.mtx-popover-panel.mtx-popover-panel-without-arrow{margin:0}.mtx-popover-direction-arrow{position:absolute}.mtx-popover-direction-arrow:before,.mtx-popover-direction-arrow:after{position:absolute;display:inline-block;content:\"\";border-width:.5em;border-style:solid}.mtx-popover-direction-arrow:before{border-color:var(--mtx-popover-outline-color, var(--mat-sys-surface-container))}.mtx-popover-direction-arrow:after{border-width:calc(.5em - 1px);border-color:var(--mtx-popover-background-color, var(--mat-sys-surface-container))}[class*=mtx-popover-below] .mtx-popover-direction-arrow,[class*=mtx-popover-above] .mtx-popover-direction-arrow{width:1em}[class*=mtx-popover-below] .mtx-popover-direction-arrow:before,[class*=mtx-popover-below] .mtx-popover-direction-arrow:after,[class*=mtx-popover-above] .mtx-popover-direction-arrow:before,[class*=mtx-popover-above] .mtx-popover-direction-arrow:after{border-left-color:transparent;border-right-color:transparent}[class*=mtx-popover-below] .mtx-popover-direction-arrow:after,[class*=mtx-popover-above] .mtx-popover-direction-arrow:after{left:1px}[dir=rtl] [class*=mtx-popover-below] .mtx-popover-direction-arrow:after,[dir=rtl] [class*=mtx-popover-above] .mtx-popover-direction-arrow:after{right:1px;left:auto}[class*=mtx-popover-below] .mtx-popover-direction-arrow{top:0}[class*=mtx-popover-below] .mtx-popover-direction-arrow:before,[class*=mtx-popover-below] .mtx-popover-direction-arrow:after{bottom:0;border-top-width:0}[class*=mtx-popover-above] .mtx-popover-direction-arrow{bottom:0}[class*=mtx-popover-above] .mtx-popover-direction-arrow:before,[class*=mtx-popover-above] .mtx-popover-direction-arrow:after{top:0;border-bottom-width:0}[class*=mtx-popover-before] .mtx-popover-direction-arrow,[class*=mtx-popover-after] .mtx-popover-direction-arrow{height:1em}[class*=mtx-popover-before] .mtx-popover-direction-arrow:before,[class*=mtx-popover-before] .mtx-popover-direction-arrow:after,[class*=mtx-popover-after] .mtx-popover-direction-arrow:before,[class*=mtx-popover-after] .mtx-popover-direction-arrow:after{border-top-color:transparent;border-bottom-color:transparent}[class*=mtx-popover-before] .mtx-popover-direction-arrow:after,[class*=mtx-popover-after] .mtx-popover-direction-arrow:after{top:1px}[class*=mtx-popover-before] .mtx-popover-direction-arrow{right:0}[class*=mtx-popover-before] .mtx-popover-direction-arrow:before,[class*=mtx-popover-before] .mtx-popover-direction-arrow:after{left:0;border-right-width:0}[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow{right:auto;left:0}[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow:before,[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow:after{left:auto;right:0;border-left-width:0}[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow:before{border-right-width:.5em}[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow:after{border-right-width:calc(.5em - 1px)}[class*=mtx-popover-after] .mtx-popover-direction-arrow{left:0}[class*=mtx-popover-after] .mtx-popover-direction-arrow:before,[class*=mtx-popover-after] .mtx-popover-direction-arrow:after{right:0;border-left-width:0}[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow{left:auto;right:0}[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow:before,[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow:after{right:auto;left:0;border-right-width:0}[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow:before{border-left-width:.5em}[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow:after{border-left-width:calc(.5em - 1px)}\n"], dependencies: [{ kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], animations: [transformPopover], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
386
+ _setIsOpen(isOpen) {
387
+ this._panelAnimationState = isOpen ? 'enter' : 'void';
388
+ if (isOpen) {
389
+ //
390
+ }
391
+ else if (!this._animationsDisabled) {
392
+ // Some apps do `* { animation: none !important; }` in tests which will prevent the
393
+ // `animationend` event from firing. Since the exit animation is loading-bearing for
394
+ // removing the content from the DOM, add a fallback timer.
395
+ this._exitFallbackTimeout = setTimeout(() => this._onAnimationDone(EXIT_ANIMATION), 200);
396
+ }
397
+ // Animation events won't fire when animations are disabled so we simulate them.
398
+ if (this._animationsDisabled) {
399
+ setTimeout(() => {
400
+ this._onAnimationDone(isOpen ? ENTER_ANIMATION : EXIT_ANIMATION);
401
+ });
402
+ }
403
+ this._changeDetectorRef.markForCheck();
404
+ }
405
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: MtxPopover, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
406
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: MtxPopover, isStandalone: true, selector: "mtx-popover", inputs: { backdropClass: "backdropClass", ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"], ariaDescribedby: ["aria-describedby", "ariaDescribedby"], triggerEvent: "triggerEvent", enterDelay: "enterDelay", leaveDelay: "leaveDelay", position: "position", xOffset: "xOffset", yOffset: "yOffset", arrowWidth: "arrowWidth", arrowHeight: "arrowHeight", arrowOffsetX: "arrowOffsetX", arrowOffsetY: "arrowOffsetY", hideArrow: ["hideArrow", "hideArrow", booleanAttribute], closeOnPanelClick: ["closeOnPanelClick", "closeOnPanelClick", booleanAttribute], closeOnBackdropClick: ["closeOnBackdropClick", "closeOnBackdropClick", booleanAttribute], focusTrapEnabled: ["focusTrapEnabled", "focusTrapEnabled", booleanAttribute], focusTrapAutoCaptureEnabled: ["focusTrapAutoCaptureEnabled", "focusTrapAutoCaptureEnabled", booleanAttribute], hasBackdrop: ["hasBackdrop", "hasBackdrop", booleanAttribute], panelClass: ["class", "panelClass"], classList: "classList" }, outputs: { closed: "closed" }, queries: [{ propertyName: "lazyContent", first: true, predicate: MTX_POPOVER_CONTENT, descendants: true }], viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], exportAs: ["mtxPopover"], ngImport: i0, template: "<ng-template>\n <!-- eslint-disable @angular-eslint/template/mouse-events-have-key-events -->\n <div\n [id]=\"panelId\"\n class=\"mtx-popover-panel\"\n [class]=\"_classList\"\n [class.mtx-popover-panel-animations-disabled]=\"_animationsDisabled\"\n [class.mtx-popover-panel-exit-animation]=\"_panelAnimationState === 'void'\"\n [class.mtx-popover-panel-animating]=\"_isAnimating\"\n [class.mtx-popover-panel-without-arrow]=\"hideArrow\"\n (keydown)=\"_handleKeydown($event)\"\n (click)=\"_handleClick()\"\n (mouseover)=\"_handleMouseOver()\"\n (mouseleave)=\"_handleMouseLeave()\"\n tabindex=\"-1\"\n role=\"dialog\"\n (animationstart)=\"_onAnimationStart($event.animationName)\"\n (animationend)=\"_onAnimationDone($event.animationName)\"\n (animationcancel)=\"_onAnimationDone($event.animationName)\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledby || null\"\n [attr.aria-describedby]=\"ariaDescribedby || null\"\n [cdkTrapFocus]=\"focusTrapEnabled\"\n [cdkTrapFocusAutoCapture]=\"focusTrapAutoCaptureEnabled\"\n >\n <div class=\"mtx-popover-content\">\n <ng-content></ng-content>\n </div>\n @if (!hideArrow) {\n <div class=\"mtx-popover-direction-arrow\" [style]=\"arrowStyles\"></div>\n }\n </div>\n</ng-template>\n", styles: ["@keyframes _mtx-popover-enter{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}@keyframes _mtx-popover-exit{0%{opacity:1}to{opacity:0}}.mtx-popover-panel{position:relative;max-height:calc(100vh - 48px);padding:8px;font-size:inherit;outline:0;animation:_mtx-popover-enter .12s cubic-bezier(0,0,.2,1);border-radius:var(--mtx-popover-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mtx-popover-background-color, var(--mat-sys-surface-container));color:var(--mtx-popover-text-color, var(--mat-sys-on-surface))}.mtx-popover-panel.mtx-popover-panel-exit-animation{animation:_mtx-popover-exit .1s 25ms linear forwards}.mtx-popover-panel.mtx-popover-panel-animations-disabled{animation:none}.mtx-popover-panel.mtx-popover-panel-animating{pointer-events:none}.mtx-popover-panel[class*=mtx-popover-below]{margin-top:calc(.5em + 2px)}.mtx-popover-panel[class*=mtx-popover-above]{margin-bottom:calc(.5em + 2px)}.mtx-popover-panel[class*=mtx-popover-before]{margin-right:calc(.5em + 2px)}[dir=rtl] .mtx-popover-panel[class*=mtx-popover-before]{margin-right:auto;margin-left:calc(.5em + 2px)}.mtx-popover-panel[class*=mtx-popover-after]{margin-left:calc(.5em + 2px)}[dir=rtl] .mtx-popover-panel[class*=mtx-popover-after]{margin-left:auto;margin-right:calc(.5em + 2px)}.mtx-popover-panel.mtx-popover-panel-without-arrow{margin:0}.mtx-popover-direction-arrow{position:absolute}.mtx-popover-direction-arrow:before,.mtx-popover-direction-arrow:after{position:absolute;display:inline-block;content:\"\";border-width:.5em;border-style:solid}.mtx-popover-direction-arrow:before{border-color:var(--mtx-popover-outline-color, var(--mat-sys-surface-container))}.mtx-popover-direction-arrow:after{border-width:calc(.5em - 1px);border-color:var(--mtx-popover-background-color, var(--mat-sys-surface-container))}[class*=mtx-popover-below] .mtx-popover-direction-arrow,[class*=mtx-popover-above] .mtx-popover-direction-arrow{width:1em}[class*=mtx-popover-below] .mtx-popover-direction-arrow:before,[class*=mtx-popover-below] .mtx-popover-direction-arrow:after,[class*=mtx-popover-above] .mtx-popover-direction-arrow:before,[class*=mtx-popover-above] .mtx-popover-direction-arrow:after{border-left-color:transparent;border-right-color:transparent}[class*=mtx-popover-below] .mtx-popover-direction-arrow:after,[class*=mtx-popover-above] .mtx-popover-direction-arrow:after{left:1px}[dir=rtl] [class*=mtx-popover-below] .mtx-popover-direction-arrow:after,[dir=rtl] [class*=mtx-popover-above] .mtx-popover-direction-arrow:after{right:1px;left:auto}[class*=mtx-popover-below] .mtx-popover-direction-arrow{top:0}[class*=mtx-popover-below] .mtx-popover-direction-arrow:before,[class*=mtx-popover-below] .mtx-popover-direction-arrow:after{bottom:0;border-top-width:0}[class*=mtx-popover-above] .mtx-popover-direction-arrow{bottom:0}[class*=mtx-popover-above] .mtx-popover-direction-arrow:before,[class*=mtx-popover-above] .mtx-popover-direction-arrow:after{top:0;border-bottom-width:0}[class*=mtx-popover-before] .mtx-popover-direction-arrow,[class*=mtx-popover-after] .mtx-popover-direction-arrow{height:1em}[class*=mtx-popover-before] .mtx-popover-direction-arrow:before,[class*=mtx-popover-before] .mtx-popover-direction-arrow:after,[class*=mtx-popover-after] .mtx-popover-direction-arrow:before,[class*=mtx-popover-after] .mtx-popover-direction-arrow:after{border-top-color:transparent;border-bottom-color:transparent}[class*=mtx-popover-before] .mtx-popover-direction-arrow:after,[class*=mtx-popover-after] .mtx-popover-direction-arrow:after{top:1px}[class*=mtx-popover-before] .mtx-popover-direction-arrow{right:0}[class*=mtx-popover-before] .mtx-popover-direction-arrow:before,[class*=mtx-popover-before] .mtx-popover-direction-arrow:after{left:0;border-right-width:0}[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow{right:auto;left:0}[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow:before,[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow:after{left:auto;right:0;border-left-width:0}[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow:before{border-right-width:.5em}[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow:after{border-right-width:calc(.5em - 1px)}[class*=mtx-popover-after] .mtx-popover-direction-arrow{left:0}[class*=mtx-popover-after] .mtx-popover-direction-arrow:before,[class*=mtx-popover-after] .mtx-popover-direction-arrow:after{right:0;border-left-width:0}[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow{left:auto;right:0}[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow:before,[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow:after{right:auto;left:0;border-right-width:0}[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow:before{border-left-width:.5em}[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow:after{border-left-width:calc(.5em - 1px)}\n"], dependencies: [{ kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
400
407
  }
401
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: MtxPopover, decorators: [{
408
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: MtxPopover, decorators: [{
402
409
  type: Component,
403
- args: [{ selector: 'mtx-popover', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, animations: [transformPopover], exportAs: 'mtxPopover', imports: [CdkTrapFocus], template: "<ng-template>\n <!-- eslint-disable @angular-eslint/template/mouse-events-have-key-events -->\n <div\n [id]=\"panelId\"\n class=\"mtx-popover-panel\"\n [class]=\"_classList\"\n [class.mtx-popover-panel-without-arrow]=\"hideArrow\"\n (keydown)=\"_handleKeydown($event)\"\n (click)=\"_handleClick()\"\n (mouseover)=\"_handleMouseOver()\"\n (mouseleave)=\"_handleMouseLeave()\"\n [@transformPopover]=\"_panelAnimationState\"\n (@transformPopover.start)=\"_onAnimationStart($event)\"\n (@transformPopover.done)=\"_onAnimationDone($event)\"\n tabindex=\"-1\"\n role=\"dialog\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledby || null\"\n [attr.aria-describedby]=\"ariaDescribedby || null\"\n [cdkTrapFocus]=\"focusTrapEnabled\"\n [cdkTrapFocusAutoCapture]=\"focusTrapAutoCaptureEnabled\"\n >\n <div class=\"mtx-popover-content\">\n <ng-content></ng-content>\n </div>\n @if (!hideArrow) {\n <div class=\"mtx-popover-direction-arrow\" [style]=\"arrowStyles\"></div>\n }\n </div>\n</ng-template>\n", styles: [".mtx-popover-panel{position:relative;max-height:calc(100vh - 48px);padding:8px;font-size:inherit;outline:0;border-radius:var(--mtx-popover-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mtx-popover-background-color, var(--mat-sys-surface-container));color:var(--mtx-popover-text-color, var(--mat-sys-on-surface))}.mtx-popover-panel[class*=mtx-popover-below]{margin-top:calc(.5em + 2px)}.mtx-popover-panel[class*=mtx-popover-above]{margin-bottom:calc(.5em + 2px)}.mtx-popover-panel[class*=mtx-popover-before]{margin-right:calc(.5em + 2px)}[dir=rtl] .mtx-popover-panel[class*=mtx-popover-before]{margin-right:auto;margin-left:calc(.5em + 2px)}.mtx-popover-panel[class*=mtx-popover-after]{margin-left:calc(.5em + 2px)}[dir=rtl] .mtx-popover-panel[class*=mtx-popover-after]{margin-left:auto;margin-right:calc(.5em + 2px)}.mtx-popover-panel.mtx-popover-panel-without-arrow{margin:0}.mtx-popover-direction-arrow{position:absolute}.mtx-popover-direction-arrow:before,.mtx-popover-direction-arrow:after{position:absolute;display:inline-block;content:\"\";border-width:.5em;border-style:solid}.mtx-popover-direction-arrow:before{border-color:var(--mtx-popover-outline-color, var(--mat-sys-surface-container))}.mtx-popover-direction-arrow:after{border-width:calc(.5em - 1px);border-color:var(--mtx-popover-background-color, var(--mat-sys-surface-container))}[class*=mtx-popover-below] .mtx-popover-direction-arrow,[class*=mtx-popover-above] .mtx-popover-direction-arrow{width:1em}[class*=mtx-popover-below] .mtx-popover-direction-arrow:before,[class*=mtx-popover-below] .mtx-popover-direction-arrow:after,[class*=mtx-popover-above] .mtx-popover-direction-arrow:before,[class*=mtx-popover-above] .mtx-popover-direction-arrow:after{border-left-color:transparent;border-right-color:transparent}[class*=mtx-popover-below] .mtx-popover-direction-arrow:after,[class*=mtx-popover-above] .mtx-popover-direction-arrow:after{left:1px}[dir=rtl] [class*=mtx-popover-below] .mtx-popover-direction-arrow:after,[dir=rtl] [class*=mtx-popover-above] .mtx-popover-direction-arrow:after{right:1px;left:auto}[class*=mtx-popover-below] .mtx-popover-direction-arrow{top:0}[class*=mtx-popover-below] .mtx-popover-direction-arrow:before,[class*=mtx-popover-below] .mtx-popover-direction-arrow:after{bottom:0;border-top-width:0}[class*=mtx-popover-above] .mtx-popover-direction-arrow{bottom:0}[class*=mtx-popover-above] .mtx-popover-direction-arrow:before,[class*=mtx-popover-above] .mtx-popover-direction-arrow:after{top:0;border-bottom-width:0}[class*=mtx-popover-before] .mtx-popover-direction-arrow,[class*=mtx-popover-after] .mtx-popover-direction-arrow{height:1em}[class*=mtx-popover-before] .mtx-popover-direction-arrow:before,[class*=mtx-popover-before] .mtx-popover-direction-arrow:after,[class*=mtx-popover-after] .mtx-popover-direction-arrow:before,[class*=mtx-popover-after] .mtx-popover-direction-arrow:after{border-top-color:transparent;border-bottom-color:transparent}[class*=mtx-popover-before] .mtx-popover-direction-arrow:after,[class*=mtx-popover-after] .mtx-popover-direction-arrow:after{top:1px}[class*=mtx-popover-before] .mtx-popover-direction-arrow{right:0}[class*=mtx-popover-before] .mtx-popover-direction-arrow:before,[class*=mtx-popover-before] .mtx-popover-direction-arrow:after{left:0;border-right-width:0}[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow{right:auto;left:0}[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow:before,[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow:after{left:auto;right:0;border-left-width:0}[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow:before{border-right-width:.5em}[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow:after{border-right-width:calc(.5em - 1px)}[class*=mtx-popover-after] .mtx-popover-direction-arrow{left:0}[class*=mtx-popover-after] .mtx-popover-direction-arrow:before,[class*=mtx-popover-after] .mtx-popover-direction-arrow:after{right:0;border-left-width:0}[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow{left:auto;right:0}[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow:before,[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow:after{right:auto;left:0;border-right-width:0}[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow:before{border-left-width:.5em}[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow:after{border-left-width:calc(.5em - 1px)}\n"] }]
404
- }], propDecorators: { backdropClass: [{
410
+ args: [{ selector: 'mtx-popover', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'mtxPopover', imports: [CdkTrapFocus], template: "<ng-template>\n <!-- eslint-disable @angular-eslint/template/mouse-events-have-key-events -->\n <div\n [id]=\"panelId\"\n class=\"mtx-popover-panel\"\n [class]=\"_classList\"\n [class.mtx-popover-panel-animations-disabled]=\"_animationsDisabled\"\n [class.mtx-popover-panel-exit-animation]=\"_panelAnimationState === 'void'\"\n [class.mtx-popover-panel-animating]=\"_isAnimating\"\n [class.mtx-popover-panel-without-arrow]=\"hideArrow\"\n (keydown)=\"_handleKeydown($event)\"\n (click)=\"_handleClick()\"\n (mouseover)=\"_handleMouseOver()\"\n (mouseleave)=\"_handleMouseLeave()\"\n tabindex=\"-1\"\n role=\"dialog\"\n (animationstart)=\"_onAnimationStart($event.animationName)\"\n (animationend)=\"_onAnimationDone($event.animationName)\"\n (animationcancel)=\"_onAnimationDone($event.animationName)\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledby || null\"\n [attr.aria-describedby]=\"ariaDescribedby || null\"\n [cdkTrapFocus]=\"focusTrapEnabled\"\n [cdkTrapFocusAutoCapture]=\"focusTrapAutoCaptureEnabled\"\n >\n <div class=\"mtx-popover-content\">\n <ng-content></ng-content>\n </div>\n @if (!hideArrow) {\n <div class=\"mtx-popover-direction-arrow\" [style]=\"arrowStyles\"></div>\n }\n </div>\n</ng-template>\n", styles: ["@keyframes _mtx-popover-enter{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}@keyframes _mtx-popover-exit{0%{opacity:1}to{opacity:0}}.mtx-popover-panel{position:relative;max-height:calc(100vh - 48px);padding:8px;font-size:inherit;outline:0;animation:_mtx-popover-enter .12s cubic-bezier(0,0,.2,1);border-radius:var(--mtx-popover-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mtx-popover-background-color, var(--mat-sys-surface-container));color:var(--mtx-popover-text-color, var(--mat-sys-on-surface))}.mtx-popover-panel.mtx-popover-panel-exit-animation{animation:_mtx-popover-exit .1s 25ms linear forwards}.mtx-popover-panel.mtx-popover-panel-animations-disabled{animation:none}.mtx-popover-panel.mtx-popover-panel-animating{pointer-events:none}.mtx-popover-panel[class*=mtx-popover-below]{margin-top:calc(.5em + 2px)}.mtx-popover-panel[class*=mtx-popover-above]{margin-bottom:calc(.5em + 2px)}.mtx-popover-panel[class*=mtx-popover-before]{margin-right:calc(.5em + 2px)}[dir=rtl] .mtx-popover-panel[class*=mtx-popover-before]{margin-right:auto;margin-left:calc(.5em + 2px)}.mtx-popover-panel[class*=mtx-popover-after]{margin-left:calc(.5em + 2px)}[dir=rtl] .mtx-popover-panel[class*=mtx-popover-after]{margin-left:auto;margin-right:calc(.5em + 2px)}.mtx-popover-panel.mtx-popover-panel-without-arrow{margin:0}.mtx-popover-direction-arrow{position:absolute}.mtx-popover-direction-arrow:before,.mtx-popover-direction-arrow:after{position:absolute;display:inline-block;content:\"\";border-width:.5em;border-style:solid}.mtx-popover-direction-arrow:before{border-color:var(--mtx-popover-outline-color, var(--mat-sys-surface-container))}.mtx-popover-direction-arrow:after{border-width:calc(.5em - 1px);border-color:var(--mtx-popover-background-color, var(--mat-sys-surface-container))}[class*=mtx-popover-below] .mtx-popover-direction-arrow,[class*=mtx-popover-above] .mtx-popover-direction-arrow{width:1em}[class*=mtx-popover-below] .mtx-popover-direction-arrow:before,[class*=mtx-popover-below] .mtx-popover-direction-arrow:after,[class*=mtx-popover-above] .mtx-popover-direction-arrow:before,[class*=mtx-popover-above] .mtx-popover-direction-arrow:after{border-left-color:transparent;border-right-color:transparent}[class*=mtx-popover-below] .mtx-popover-direction-arrow:after,[class*=mtx-popover-above] .mtx-popover-direction-arrow:after{left:1px}[dir=rtl] [class*=mtx-popover-below] .mtx-popover-direction-arrow:after,[dir=rtl] [class*=mtx-popover-above] .mtx-popover-direction-arrow:after{right:1px;left:auto}[class*=mtx-popover-below] .mtx-popover-direction-arrow{top:0}[class*=mtx-popover-below] .mtx-popover-direction-arrow:before,[class*=mtx-popover-below] .mtx-popover-direction-arrow:after{bottom:0;border-top-width:0}[class*=mtx-popover-above] .mtx-popover-direction-arrow{bottom:0}[class*=mtx-popover-above] .mtx-popover-direction-arrow:before,[class*=mtx-popover-above] .mtx-popover-direction-arrow:after{top:0;border-bottom-width:0}[class*=mtx-popover-before] .mtx-popover-direction-arrow,[class*=mtx-popover-after] .mtx-popover-direction-arrow{height:1em}[class*=mtx-popover-before] .mtx-popover-direction-arrow:before,[class*=mtx-popover-before] .mtx-popover-direction-arrow:after,[class*=mtx-popover-after] .mtx-popover-direction-arrow:before,[class*=mtx-popover-after] .mtx-popover-direction-arrow:after{border-top-color:transparent;border-bottom-color:transparent}[class*=mtx-popover-before] .mtx-popover-direction-arrow:after,[class*=mtx-popover-after] .mtx-popover-direction-arrow:after{top:1px}[class*=mtx-popover-before] .mtx-popover-direction-arrow{right:0}[class*=mtx-popover-before] .mtx-popover-direction-arrow:before,[class*=mtx-popover-before] .mtx-popover-direction-arrow:after{left:0;border-right-width:0}[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow{right:auto;left:0}[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow:before,[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow:after{left:auto;right:0;border-left-width:0}[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow:before{border-right-width:.5em}[dir=rtl] [class*=mtx-popover-before] .mtx-popover-direction-arrow:after{border-right-width:calc(.5em - 1px)}[class*=mtx-popover-after] .mtx-popover-direction-arrow{left:0}[class*=mtx-popover-after] .mtx-popover-direction-arrow:before,[class*=mtx-popover-after] .mtx-popover-direction-arrow:after{right:0;border-left-width:0}[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow{left:auto;right:0}[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow:before,[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow:after{right:auto;left:0;border-right-width:0}[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow:before{border-left-width:.5em}[dir=rtl] [class*=mtx-popover-after] .mtx-popover-direction-arrow:after{border-left-width:calc(.5em - 1px)}\n"] }]
411
+ }], ctorParameters: () => [], propDecorators: { backdropClass: [{
405
412
  type: Input
406
413
  }], ariaLabel: [{
407
414
  type: Input,
@@ -473,11 +480,19 @@ const MTX_POPOVER_SCROLL_STRATEGY = new InjectionToken('mtx-popover-scroll-strat
473
480
  return () => overlay.scrollStrategies.reposition();
474
481
  },
475
482
  });
476
- /** @docs-private */
483
+ /**
484
+ * @docs-private
485
+ * @deprecated No longer used, will be removed.
486
+ * @breaking-change 21.0.0
487
+ */
477
488
  function MTX_POPOVER_SCROLL_STRATEGY_FACTORY(overlay) {
478
489
  return () => overlay.scrollStrategies.reposition();
479
490
  }
480
- /** @docs-private */
491
+ /**
492
+ * @docs-private
493
+ * @deprecated No longer used, will be removed.
494
+ * @breaking-change 21.0.0
495
+ */
481
496
  const MTX_POPOVER_SCROLL_STRATEGY_FACTORY_PROVIDER = {
482
497
  provide: MTX_POPOVER_SCROLL_STRATEGY,
483
498
  deps: [Overlay],
@@ -531,14 +546,15 @@ class MtxPopoverTrigger {
531
546
  this._setCurrentConfig();
532
547
  }
533
548
  ngOnDestroy() {
534
- if (this._overlayRef) {
535
- this._overlayRef.dispose();
536
- this._overlayRef = null;
537
- }
538
549
  this._halt = true;
539
550
  this._positionSubscription.unsubscribe();
551
+ this._pendingRemoval?.unsubscribe();
540
552
  this._popoverCloseSubscription.unsubscribe();
541
553
  this._closingActionsSubscription.unsubscribe();
554
+ if (this._overlayRef) {
555
+ this._overlayRef.dispose();
556
+ this._overlayRef = null;
557
+ }
542
558
  }
543
559
  _setCurrentConfig() {
544
560
  if (this.triggerEvent) {
@@ -614,6 +630,7 @@ class MtxPopoverTrigger {
614
630
  return;
615
631
  }
616
632
  this._checkPopover();
633
+ this._pendingRemoval?.unsubscribe();
617
634
  const overlayRef = this._createOverlay();
618
635
  const overlayConfig = overlayRef.getConfig();
619
636
  this._setPosition(overlayConfig.positionStrategy);
@@ -627,7 +644,7 @@ class MtxPopoverTrigger {
627
644
  this._closingActionsSubscription = this._popoverClosingActions().subscribe(() => this.closePopover());
628
645
  this._initPopover();
629
646
  if (this.popover instanceof MtxPopover) {
630
- this.popover._startAnimation();
647
+ this.popover._setIsOpen(true);
631
648
  }
632
649
  }
633
650
  /** Closes the popover. */
@@ -648,7 +665,8 @@ class MtxPopoverTrigger {
648
665
  }
649
666
  /** Removes the popover from the DOM. */
650
667
  _destroyPopover(reason) {
651
- if (!this._overlayRef || !this.popoverOpen) {
668
+ const overlayRef = this._overlayRef;
669
+ if (!overlayRef || !this.popoverOpen) {
652
670
  return;
653
671
  }
654
672
  // Clear the timeout for hover event.
@@ -658,30 +676,23 @@ class MtxPopoverTrigger {
658
676
  }
659
677
  const popover = this.popover;
660
678
  this._closingActionsSubscription.unsubscribe();
661
- this._overlayRef.detach();
662
- this._openedBy = undefined;
679
+ this._pendingRemoval?.unsubscribe();
680
+ overlayRef.detach();
681
+ // Note that we don't wait for the animation to finish if another trigger took
682
+ // over the popover, because the panel will end up empty which looks glitchy.
663
683
  if (popover instanceof MtxPopover) {
664
- popover._resetAnimation();
665
- if (popover.lazyContent) {
666
- // Wait for the exit animation to finish before detaching the content.
667
- popover._animationDone
668
- .pipe(filter(event => event.toState === 'void'), take(1),
669
- // Interrupt if the content got re-attached.
670
- takeUntil(popover.lazyContent._attached))
671
- .subscribe({
672
- next: () => popover.lazyContent.detach(),
673
- // No matter whether the content got re-attached, reset the popover.
674
- complete: () => this._setIsPopoverOpen(false),
675
- });
676
- }
677
- else {
678
- this._setIsPopoverOpen(false);
679
- }
684
+ // Wait for the exit animation to finish before detaching the content.
685
+ this._pendingRemoval = popover._animationDone
686
+ .pipe(filter(event => event === 'void'), take(1))
687
+ .subscribe(() => {
688
+ popover.lazyContent?.detach();
689
+ });
680
690
  }
681
691
  else {
682
- this._setIsPopoverOpen(false);
683
692
  popover.lazyContent?.detach();
684
693
  }
694
+ this._openedBy = undefined;
695
+ this._setIsPopoverOpen(false);
685
696
  }
686
697
  /**
687
698
  * This method sets the popover state to open.
@@ -889,10 +900,10 @@ class MtxPopoverTrigger {
889
900
  }
890
901
  return this._portal;
891
902
  }
892
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: MtxPopoverTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
893
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.6", type: MtxPopoverTrigger, isStandalone: true, selector: "[mtx-popover-trigger-for], [mtxPopoverTriggerFor]", inputs: { popover: ["mtxPopoverTriggerFor", "popover"], popoverData: ["mtxPopoverTriggerData", "popoverData"], targetElement: ["mtxPopoverTargetAt", "targetElement"], triggerEvent: ["mtxPopoverTriggerOn", "triggerEvent"] }, outputs: { popoverOpened: "popoverOpened", popoverClosed: "popoverClosed" }, host: { attributes: { "aria-haspopup": "true" }, listeners: { "click": "_handleClick($event)", "mouseenter": "_handleMouseEnter($event)", "mouseleave": "_handleMouseLeave($event)", "mousedown": "_handleMousedown($event)", "keydown": "_handleKeydown($event)" }, properties: { "attr.aria-expanded": "popoverOpen", "attr.aria-controls": "popoverOpen ? popover.panelId : null" } }, exportAs: ["mtxPopoverTrigger"], ngImport: i0 }); }
903
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: MtxPopoverTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
904
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: MtxPopoverTrigger, isStandalone: true, selector: "[mtx-popover-trigger-for], [mtxPopoverTriggerFor]", inputs: { popover: ["mtxPopoverTriggerFor", "popover"], popoverData: ["mtxPopoverTriggerData", "popoverData"], targetElement: ["mtxPopoverTargetAt", "targetElement"], triggerEvent: ["mtxPopoverTriggerOn", "triggerEvent"] }, outputs: { popoverOpened: "popoverOpened", popoverClosed: "popoverClosed" }, host: { attributes: { "aria-haspopup": "true" }, listeners: { "click": "_handleClick($event)", "mouseenter": "_handleMouseEnter($event)", "mouseleave": "_handleMouseLeave($event)", "mousedown": "_handleMousedown($event)", "keydown": "_handleKeydown($event)" }, properties: { "attr.aria-expanded": "popoverOpen", "attr.aria-controls": "popoverOpen ? popover.panelId : null" } }, exportAs: ["mtxPopoverTrigger"], ngImport: i0 }); }
894
905
  }
895
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: MtxPopoverTrigger, decorators: [{
906
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: MtxPopoverTrigger, decorators: [{
896
907
  type: Directive,
897
908
  args: [{
898
909
  selector: '[mtx-popover-trigger-for], [mtxPopoverTriggerFor]',
@@ -930,10 +941,10 @@ class MtxPopoverTarget {
930
941
  constructor() {
931
942
  this.elementRef = inject(ElementRef);
932
943
  }
933
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: MtxPopoverTarget, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
934
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.6", type: MtxPopoverTarget, isStandalone: true, selector: "mtx-popover-target, [mtxPopoverTarget]", exportAs: ["mtxPopoverTarget"], ngImport: i0 }); }
944
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: MtxPopoverTarget, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
945
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: MtxPopoverTarget, isStandalone: true, selector: "mtx-popover-target, [mtxPopoverTarget]", exportAs: ["mtxPopoverTarget"], ngImport: i0 }); }
935
946
  }
936
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: MtxPopoverTarget, decorators: [{
947
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: MtxPopoverTarget, decorators: [{
937
948
  type: Directive,
938
949
  args: [{
939
950
  selector: 'mtx-popover-target, [mtxPopoverTarget]',
@@ -942,19 +953,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
942
953
  }] });
943
954
 
944
955
  class MtxPopoverModule {
945
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: MtxPopoverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
946
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.6", ngImport: i0, type: MtxPopoverModule, imports: [CommonModule,
956
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: MtxPopoverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
957
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.2", ngImport: i0, type: MtxPopoverModule, imports: [CommonModule,
947
958
  OverlayModule,
948
959
  A11yModule,
949
960
  MtxPopover,
950
961
  MtxPopoverTrigger,
951
962
  MtxPopoverTarget,
952
963
  MtxPopoverContent], exports: [MtxPopover, MtxPopoverTrigger, MtxPopoverTarget, MtxPopoverContent] }); }
953
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: MtxPopoverModule, providers: [MTX_POPOVER_SCROLL_STRATEGY_FACTORY_PROVIDER], imports: [CommonModule,
964
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: MtxPopoverModule, providers: [MTX_POPOVER_SCROLL_STRATEGY_FACTORY_PROVIDER], imports: [CommonModule,
954
965
  OverlayModule,
955
966
  A11yModule] }); }
956
967
  }
957
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: MtxPopoverModule, decorators: [{
968
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: MtxPopoverModule, decorators: [{
958
969
  type: NgModule,
959
970
  args: [{
960
971
  imports: [
@@ -971,9 +982,75 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
971
982
  }]
972
983
  }] });
973
984
 
985
+ /**
986
+ * Animations used by the mtx-popover component.
987
+ * Animation duration and timing values are based on:
988
+ * https://material.io/guidelines/components/menus.html#menus-usage
989
+ * @docs-private
990
+ * @deprecated No longer used, will be removed.
991
+ * @breaking-change 21.0.0
992
+ */
993
+ const mtxPopoverAnimations = {
994
+ // Represents:
995
+ // transformPopover: trigger('transformPopover', [
996
+ // state(
997
+ // 'void',
998
+ // style({
999
+ // opacity: 0,
1000
+ // transform: 'scale(0.8)',
1001
+ // })
1002
+ // ),
1003
+ // transition(
1004
+ // 'void => enter',
1005
+ // animate(
1006
+ // '120ms cubic-bezier(0, 0, 0.2, 1)',
1007
+ // style({
1008
+ // opacity: 1,
1009
+ // transform: 'scale(1)',
1010
+ // })
1011
+ // )
1012
+ // ),
1013
+ // transition('* => void', animate('100ms 25ms linear', style({ opacity: 0 }))),
1014
+ // ]),
1015
+ /** Controls the animation of a popover component's transformation. */
1016
+ transformPopover: {
1017
+ type: 7,
1018
+ name: 'transformPopover',
1019
+ definitions: [
1020
+ {
1021
+ type: 0,
1022
+ name: 'void',
1023
+ styles: { type: 6, styles: { opacity: 0, transform: 'scale(0.8)' }, offset: null },
1024
+ options: null,
1025
+ },
1026
+ {
1027
+ type: 1,
1028
+ expr: 'void => enter',
1029
+ animation: {
1030
+ type: 4,
1031
+ styles: { type: 6, styles: { opacity: 1, transform: 'scale(1)' }, offset: null },
1032
+ timings: '120ms cubic-bezier(0, 0, 0.2, 1)',
1033
+ },
1034
+ options: null,
1035
+ },
1036
+ {
1037
+ type: 1,
1038
+ expr: '* => void',
1039
+ animation: {
1040
+ type: 4,
1041
+ styles: { type: 6, styles: { opacity: 0 }, offset: null },
1042
+ timings: '100ms 25ms linear',
1043
+ },
1044
+ options: null,
1045
+ },
1046
+ ],
1047
+ options: {},
1048
+ },
1049
+ };
1050
+
974
1051
  /**
975
1052
  * Generated bundle index. Do not edit.
976
1053
  */
977
1054
 
978
- export { MTX_POPOVER_CONTENT, MTX_POPOVER_DEFAULT_OPTIONS, MTX_POPOVER_DEFAULT_OPTIONS_FACTORY, MTX_POPOVER_SCROLL_STRATEGY, MTX_POPOVER_SCROLL_STRATEGY_FACTORY, MTX_POPOVER_SCROLL_STRATEGY_FACTORY_PROVIDER, MtxPopover, MtxPopoverContent, MtxPopoverModule, MtxPopoverTarget, MtxPopoverTrigger, _MtxPopoverContentBase, transformPopover };
1055
+ export { MTX_POPOVER_CONTENT, MTX_POPOVER_DEFAULT_OPTIONS, MTX_POPOVER_DEFAULT_OPTIONS_FACTORY, MTX_POPOVER_SCROLL_STRATEGY, MTX_POPOVER_SCROLL_STRATEGY_FACTORY, MTX_POPOVER_SCROLL_STRATEGY_FACTORY_PROVIDER, MtxPopover, MtxPopoverContent, MtxPopoverModule, MtxPopoverTarget, MtxPopoverTrigger, _MtxPopoverContentBase, mtxPopoverAnimations };
979
1056
  //# sourceMappingURL=mtxPopover.mjs.map