@angular/material 19.0.1 → 19.0.3
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.
- package/expansion/index.d.ts +9 -8
- package/fesm2022/button-toggle.mjs +28 -17
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/core.mjs +3 -3
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/expansion.mjs +89 -82
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/menu.mjs +41 -56
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator.mjs +31 -22
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/select.mjs +15 -4
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sort.mjs +86 -198
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/tabs.mjs +1 -0
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +42 -27
- package/fesm2022/timepicker.mjs.map +1 -1
- package/menu/index.d.ts +6 -0
- package/package.json +2 -2
- package/paginator/index.d.ts +8 -0
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/theme-color/index_bundled.js +2 -2
- package/schematics/ng-update/index_bundled.js +50 -41
- package/schematics/ng-update/index_bundled.js.map +2 -2
- package/select/index.d.ts +15 -2
- package/sort/index.d.ts +15 -48
- package/timepicker/index.d.ts +3 -0
package/fesm2022/expansion.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { CdkAccordionItem, CdkAccordion, CdkAccordionModule } from '@angular/cdk/accordion';
|
|
2
2
|
import { TemplatePortal, CdkPortalOutlet, PortalModule } from '@angular/cdk/portal';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { InjectionToken, inject, TemplateRef, Directive, ViewContainerRef, ANIMATION_MODULE_TYPE, EventEmitter, booleanAttribute, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, ContentChild, ViewChild,
|
|
4
|
+
import { InjectionToken, inject, TemplateRef, Directive, ViewContainerRef, ANIMATION_MODULE_TYPE, NgZone, ElementRef, EventEmitter, booleanAttribute, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, ContentChild, ViewChild, ChangeDetectorRef, HostAttributeToken, numberAttribute, QueryList, ContentChildren, NgModule } from '@angular/core';
|
|
5
5
|
import { _StructuralStylesLoader, MatCommonModule } from '@angular/material/core';
|
|
6
6
|
import { _IdGenerator, FocusMonitor, FocusKeyManager } from '@angular/cdk/a11y';
|
|
7
7
|
import { startWith, filter, take } from 'rxjs/operators';
|
|
8
8
|
import { ENTER, hasModifierKey, SPACE } from '@angular/cdk/keycodes';
|
|
9
9
|
import { Subject, Subscription, EMPTY, merge } from 'rxjs';
|
|
10
|
-
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
11
10
|
import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
|
|
12
11
|
import { DOCUMENT } from '@angular/common';
|
|
13
12
|
import { _CdkPrivateStyleLoader } from '@angular/cdk/private';
|
|
13
|
+
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Token used to provide a `MatAccordion` to `MatExpansionPanel`.
|
|
@@ -18,49 +18,6 @@ import { _CdkPrivateStyleLoader } from '@angular/cdk/private';
|
|
|
18
18
|
*/
|
|
19
19
|
const MAT_ACCORDION = new InjectionToken('MAT_ACCORDION');
|
|
20
20
|
|
|
21
|
-
/** Time and timing curve for expansion panel animations. */
|
|
22
|
-
// Note: Keep this in sync with the Sass variable for the panel header animation.
|
|
23
|
-
const EXPANSION_PANEL_ANIMATION_TIMING = '225ms cubic-bezier(0.4,0.0,0.2,1)';
|
|
24
|
-
/**
|
|
25
|
-
* Animations used by the Material expansion panel.
|
|
26
|
-
*
|
|
27
|
-
* A bug in angular animation's `state` when ViewContainers are moved using ViewContainerRef.move()
|
|
28
|
-
* causes the animation state of moved components to become `void` upon exit, and not update again
|
|
29
|
-
* upon reentry into the DOM. This can lead a to situation for the expansion panel where the state
|
|
30
|
-
* of the panel is `expanded` or `collapsed` but the animation state is `void`.
|
|
31
|
-
*
|
|
32
|
-
* To correctly handle animating to the next state, we animate between `void` and `collapsed` which
|
|
33
|
-
* are defined to have the same styles. Since angular animates from the current styles to the
|
|
34
|
-
* destination state's style definition, in situations where we are moving from `void`'s styles to
|
|
35
|
-
* `collapsed` this acts a noop since no style values change.
|
|
36
|
-
*
|
|
37
|
-
* In the case where angular's animation state is out of sync with the expansion panel's state, the
|
|
38
|
-
* expansion panel being `expanded` and angular animations being `void`, the animation from the
|
|
39
|
-
* `expanded`'s effective styles (though in a `void` animation state) to the collapsed state will
|
|
40
|
-
* occur as expected.
|
|
41
|
-
*
|
|
42
|
-
* Angular Bug: https://github.com/angular/angular/issues/18847
|
|
43
|
-
*
|
|
44
|
-
* @docs-private
|
|
45
|
-
*/
|
|
46
|
-
const matExpansionAnimations = {
|
|
47
|
-
/** Animation that rotates the indicator arrow. */
|
|
48
|
-
indicatorRotate: trigger('indicatorRotate', [
|
|
49
|
-
state('collapsed, void', style({ transform: 'rotate(0deg)' })),
|
|
50
|
-
state('expanded', style({ transform: 'rotate(180deg)' })),
|
|
51
|
-
transition('expanded <=> collapsed, void => collapsed', animate(EXPANSION_PANEL_ANIMATION_TIMING)),
|
|
52
|
-
]),
|
|
53
|
-
/** Animation that expands and collapses the panel content. */
|
|
54
|
-
bodyExpansion: trigger('bodyExpansion', [
|
|
55
|
-
state('collapsed, void', style({ height: '0px', visibility: 'hidden' })),
|
|
56
|
-
// Clear the `visibility` while open, otherwise the content will be visible when placed in
|
|
57
|
-
// a parent that's `visibility: hidden`, because `visibility` doesn't apply to descendants
|
|
58
|
-
// that have a `visibility` of their own (see #27436).
|
|
59
|
-
state('expanded', style({ height: '*', visibility: '' })),
|
|
60
|
-
transition('expanded <=> collapsed, void => collapsed', animate(EXPANSION_PANEL_ANIMATION_TIMING)),
|
|
61
|
-
]),
|
|
62
|
-
};
|
|
63
|
-
|
|
64
21
|
/**
|
|
65
22
|
* Token used to provide a `MatExpansionPanel` to `MatExpansionPanelContent`.
|
|
66
23
|
* Used to avoid circular imports between `MatExpansionPanel` and `MatExpansionPanelContent`.
|
|
@@ -96,9 +53,10 @@ const MAT_EXPANSION_PANEL_DEFAULT_OPTIONS = new InjectionToken('MAT_EXPANSION_PA
|
|
|
96
53
|
*/
|
|
97
54
|
class MatExpansionPanel extends CdkAccordionItem {
|
|
98
55
|
_viewContainerRef = inject(ViewContainerRef);
|
|
99
|
-
|
|
100
|
-
_animationsDisabled;
|
|
56
|
+
_animationsDisabled = inject(ANIMATION_MODULE_TYPE, { optional: true }) === 'NoopAnimations';
|
|
101
57
|
_document = inject(DOCUMENT);
|
|
58
|
+
_ngZone = inject(NgZone);
|
|
59
|
+
_elementRef = inject(ElementRef);
|
|
102
60
|
/** Whether the toggle indicator should be hidden. */
|
|
103
61
|
get hideToggle() {
|
|
104
62
|
return this._hideToggle || (this.accordion && this.accordion.hideToggle);
|
|
@@ -127,6 +85,8 @@ class MatExpansionPanel extends CdkAccordionItem {
|
|
|
127
85
|
_lazyContent;
|
|
128
86
|
/** Element containing the panel's user-provided content. */
|
|
129
87
|
_body;
|
|
88
|
+
/** Element wrapping the panel body. */
|
|
89
|
+
_bodyWrapper;
|
|
130
90
|
/** Portal holding the user's content. */
|
|
131
91
|
_portal;
|
|
132
92
|
/** ID for the associated header element. Used for a11y labelling. */
|
|
@@ -135,7 +95,6 @@ class MatExpansionPanel extends CdkAccordionItem {
|
|
|
135
95
|
super();
|
|
136
96
|
const defaultOptions = inject(MAT_EXPANSION_PANEL_DEFAULT_OPTIONS, { optional: true });
|
|
137
97
|
this._expansionDispatcher = inject(UniqueSelectionDispatcher);
|
|
138
|
-
this._animationsDisabled = this._animationMode === 'NoopAnimations';
|
|
139
98
|
if (defaultOptions) {
|
|
140
99
|
this.hideToggle = defaultOptions.hideToggle;
|
|
141
100
|
}
|
|
@@ -172,12 +131,14 @@ class MatExpansionPanel extends CdkAccordionItem {
|
|
|
172
131
|
this._portal = new TemplatePortal(this._lazyContent._template, this._viewContainerRef);
|
|
173
132
|
});
|
|
174
133
|
}
|
|
134
|
+
this._setupAnimationEvents();
|
|
175
135
|
}
|
|
176
136
|
ngOnChanges(changes) {
|
|
177
137
|
this._inputChanges.next(changes);
|
|
178
138
|
}
|
|
179
139
|
ngOnDestroy() {
|
|
180
140
|
super.ngOnDestroy();
|
|
141
|
+
this._bodyWrapper?.nativeElement.removeEventListener('transitionend', this._transitionEndListener);
|
|
181
142
|
this._inputChanges.complete();
|
|
182
143
|
}
|
|
183
144
|
/** Checks whether the expansion panel's content contains the currently-focused element. */
|
|
@@ -189,41 +150,46 @@ class MatExpansionPanel extends CdkAccordionItem {
|
|
|
189
150
|
}
|
|
190
151
|
return false;
|
|
191
152
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
153
|
+
_transitionEndListener = ({ target, propertyName }) => {
|
|
154
|
+
if (target === this._bodyWrapper?.nativeElement && propertyName === 'grid-template-rows') {
|
|
155
|
+
this._ngZone.run(() => {
|
|
156
|
+
if (this.expanded) {
|
|
157
|
+
this.afterExpand.emit();
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
this.afterCollapse.emit();
|
|
161
|
+
}
|
|
162
|
+
});
|
|
199
163
|
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
164
|
+
};
|
|
165
|
+
_setupAnimationEvents() {
|
|
166
|
+
// This method is defined separately, because we need to
|
|
167
|
+
// disable this logic in some internal components.
|
|
168
|
+
this._ngZone.runOutsideAngular(() => {
|
|
169
|
+
if (this._animationsDisabled) {
|
|
170
|
+
this.opened.subscribe(() => this._ngZone.run(() => this.afterExpand.emit()));
|
|
171
|
+
this.closed.subscribe(() => this._ngZone.run(() => this.afterCollapse.emit()));
|
|
206
172
|
}
|
|
207
|
-
else
|
|
208
|
-
|
|
173
|
+
else {
|
|
174
|
+
setTimeout(() => {
|
|
175
|
+
const element = this._elementRef.nativeElement;
|
|
176
|
+
element.addEventListener('transitionend', this._transitionEndListener);
|
|
177
|
+
element.classList.add('mat-expansion-panel-animations-enabled');
|
|
178
|
+
}, 200);
|
|
209
179
|
}
|
|
210
|
-
|
|
211
|
-
if (!this._animationsDisabled && this._body) {
|
|
212
|
-
this._body.nativeElement.removeAttribute('inert');
|
|
213
|
-
}
|
|
214
|
-
}
|
|
180
|
+
});
|
|
215
181
|
}
|
|
216
182
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: MatExpansionPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
217
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.0.0", type: MatExpansionPanel, isStandalone: true, selector: "mat-expansion-panel", inputs: { hideToggle: ["hideToggle", "hideToggle", booleanAttribute], togglePosition: "togglePosition" }, outputs: { afterExpand: "afterExpand", afterCollapse: "afterCollapse" }, host: { properties: { "class.mat-expanded": "expanded", "class.
|
|
183
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.0.0", type: MatExpansionPanel, isStandalone: true, selector: "mat-expansion-panel", inputs: { hideToggle: ["hideToggle", "hideToggle", booleanAttribute], togglePosition: "togglePosition" }, outputs: { afterExpand: "afterExpand", afterCollapse: "afterCollapse" }, host: { properties: { "class.mat-expanded": "expanded", "class.mat-expansion-panel-spacing": "_hasSpacing()" }, classAttribute: "mat-expansion-panel" }, providers: [
|
|
218
184
|
// Provide MatAccordion as undefined to prevent nested expansion panels from registering
|
|
219
185
|
// to the same accordion.
|
|
220
186
|
{ provide: MAT_ACCORDION, useValue: undefined },
|
|
221
187
|
{ provide: MAT_EXPANSION_PANEL, useExisting: MatExpansionPanel },
|
|
222
|
-
], queries: [{ propertyName: "_lazyContent", first: true, predicate: MatExpansionPanelContent, descendants: true }], viewQueries: [{ propertyName: "_body", first: true, predicate: ["body"], descendants: true }], exportAs: ["matExpansionPanel"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-content select=\"mat-expansion-panel-header\"></ng-content>\n<div class=\"mat-expansion-panel-content\"
|
|
188
|
+
], queries: [{ propertyName: "_lazyContent", first: true, predicate: MatExpansionPanelContent, descendants: true }], viewQueries: [{ propertyName: "_body", first: true, predicate: ["body"], descendants: true }, { propertyName: "_bodyWrapper", first: true, predicate: ["bodyWrapper"], descendants: true }], exportAs: ["matExpansionPanel"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-content select=\"mat-expansion-panel-header\"></ng-content>\n<div class=\"mat-expansion-panel-content-wrapper\" [attr.inert]=\"expanded ? null : ''\" #bodyWrapper>\n <div class=\"mat-expansion-panel-content\"\n role=\"region\"\n [attr.aria-labelledby]=\"_headerId\"\n [id]=\"id\"\n #body>\n <div class=\"mat-expansion-panel-body\">\n <ng-content></ng-content>\n <ng-template [cdkPortalOutlet]=\"_portal\"></ng-template>\n </div>\n <ng-content select=\"mat-action-row\"></ng-content>\n </div>\n</div>\n", styles: [".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;overflow:hidden;position:relative;background:var(--mat-expansion-container-background-color, var(--mat-sys-surface));color:var(--mat-expansion-container-text-color, var(--mat-sys-on-surface));border-radius:var(--mat-expansion-container-shape, 12px)}.mat-expansion-panel.mat-expansion-panel-animations-enabled{transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:var(--mat-expansion-container-shape, 12px);border-top-left-radius:var(--mat-expansion-container-shape, 12px)}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:var(--mat-expansion-container-shape, 12px);border-bottom-left-radius:var(--mat-expansion-container-shape, 12px)}@media(forced-colors: active){.mat-expansion-panel{outline:solid 1px}}.mat-expansion-panel-content-wrapper{display:grid;grid-template-rows:0fr;grid-template-columns:100%}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content-wrapper{transition:grid-template-rows 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{grid-template-rows:1fr}@supports not (grid-template-rows: 0fr){.mat-expansion-panel-content-wrapper{height:0}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{height:auto}}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible;min-height:0;visibility:hidden;font-family:var(--mat-expansion-container-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-expansion-container-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-expansion-container-text-weight, var(--mat-sys-body-large-weight));line-height:var(--mat-expansion-container-text-line-height, var(--mat-sys-body-large-line-height));letter-spacing:var(--mat-expansion-container-text-tracking, var(--mat-sys-body-large-tracking))}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content{transition:visibility 190ms linear}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper>.mat-expansion-panel-content{visibility:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px;border-top-color:var(--mat-expansion-actions-divider-color, var(--mat-sys-outline))}.mat-action-row .mat-button-base,.mat-action-row .mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row .mat-button-base,[dir=rtl] .mat-action-row .mat-mdc-button-base{margin-left:0;margin-right:8px}"], dependencies: [{ kind: "directive", type: CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
223
189
|
}
|
|
224
190
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: MatExpansionPanel, decorators: [{
|
|
225
191
|
type: Component,
|
|
226
|
-
args: [{ selector: 'mat-expansion-panel', exportAs: 'matExpansionPanel', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
192
|
+
args: [{ selector: 'mat-expansion-panel', exportAs: 'matExpansionPanel', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
227
193
|
// Provide MatAccordion as undefined to prevent nested expansion panels from registering
|
|
228
194
|
// to the same accordion.
|
|
229
195
|
{ provide: MAT_ACCORDION, useValue: undefined },
|
|
@@ -231,9 +197,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
231
197
|
], host: {
|
|
232
198
|
'class': 'mat-expansion-panel',
|
|
233
199
|
'[class.mat-expanded]': 'expanded',
|
|
234
|
-
'[class._mat-animation-noopable]': '_animationsDisabled',
|
|
235
200
|
'[class.mat-expansion-panel-spacing]': '_hasSpacing()',
|
|
236
|
-
}, imports: [CdkPortalOutlet], template: "<ng-content select=\"mat-expansion-panel-header\"></ng-content>\n<div class=\"mat-expansion-panel-content\"
|
|
201
|
+
}, imports: [CdkPortalOutlet], template: "<ng-content select=\"mat-expansion-panel-header\"></ng-content>\n<div class=\"mat-expansion-panel-content-wrapper\" [attr.inert]=\"expanded ? null : ''\" #bodyWrapper>\n <div class=\"mat-expansion-panel-content\"\n role=\"region\"\n [attr.aria-labelledby]=\"_headerId\"\n [id]=\"id\"\n #body>\n <div class=\"mat-expansion-panel-body\">\n <ng-content></ng-content>\n <ng-template [cdkPortalOutlet]=\"_portal\"></ng-template>\n </div>\n <ng-content select=\"mat-action-row\"></ng-content>\n </div>\n</div>\n", styles: [".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;overflow:hidden;position:relative;background:var(--mat-expansion-container-background-color, var(--mat-sys-surface));color:var(--mat-expansion-container-text-color, var(--mat-sys-on-surface));border-radius:var(--mat-expansion-container-shape, 12px)}.mat-expansion-panel.mat-expansion-panel-animations-enabled{transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:var(--mat-expansion-container-shape, 12px);border-top-left-radius:var(--mat-expansion-container-shape, 12px)}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:var(--mat-expansion-container-shape, 12px);border-bottom-left-radius:var(--mat-expansion-container-shape, 12px)}@media(forced-colors: active){.mat-expansion-panel{outline:solid 1px}}.mat-expansion-panel-content-wrapper{display:grid;grid-template-rows:0fr;grid-template-columns:100%}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content-wrapper{transition:grid-template-rows 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{grid-template-rows:1fr}@supports not (grid-template-rows: 0fr){.mat-expansion-panel-content-wrapper{height:0}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{height:auto}}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible;min-height:0;visibility:hidden;font-family:var(--mat-expansion-container-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-expansion-container-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-expansion-container-text-weight, var(--mat-sys-body-large-weight));line-height:var(--mat-expansion-container-text-line-height, var(--mat-sys-body-large-line-height));letter-spacing:var(--mat-expansion-container-text-tracking, var(--mat-sys-body-large-tracking))}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content{transition:visibility 190ms linear}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper>.mat-expansion-panel-content{visibility:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px;border-top-color:var(--mat-expansion-actions-divider-color, var(--mat-sys-outline))}.mat-action-row .mat-button-base,.mat-action-row .mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row .mat-button-base,[dir=rtl] .mat-action-row .mat-mdc-button-base{margin-left:0;margin-right:8px}"] }]
|
|
237
202
|
}], ctorParameters: () => [], propDecorators: { hideToggle: [{
|
|
238
203
|
type: Input,
|
|
239
204
|
args: [{ transform: booleanAttribute }]
|
|
@@ -249,11 +214,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
249
214
|
}], _body: [{
|
|
250
215
|
type: ViewChild,
|
|
251
216
|
args: ['body']
|
|
217
|
+
}], _bodyWrapper: [{
|
|
218
|
+
type: ViewChild,
|
|
219
|
+
args: ['bodyWrapper']
|
|
252
220
|
}] } });
|
|
253
|
-
/** Checks whether an animation is the initial setup animation. */
|
|
254
|
-
function isInitialAnimation(event) {
|
|
255
|
-
return event.fromState === 'void';
|
|
256
|
-
}
|
|
257
221
|
/**
|
|
258
222
|
* Actions of a `<mat-expansion-panel>`.
|
|
259
223
|
*/
|
|
@@ -279,7 +243,6 @@ class MatExpansionPanelHeader {
|
|
|
279
243
|
_element = inject(ElementRef);
|
|
280
244
|
_focusMonitor = inject(FocusMonitor);
|
|
281
245
|
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
282
|
-
_animationMode = inject(ANIMATION_MODULE_TYPE, { optional: true });
|
|
283
246
|
_parentChangeSubscription = Subscription.EMPTY;
|
|
284
247
|
constructor() {
|
|
285
248
|
inject(_CdkPrivateStyleLoader).load(_StructuralStylesLoader);
|
|
@@ -400,11 +363,11 @@ class MatExpansionPanelHeader {
|
|
|
400
363
|
this._focusMonitor.stopMonitoring(this._element);
|
|
401
364
|
}
|
|
402
365
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: MatExpansionPanelHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
403
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: MatExpansionPanelHeader, isStandalone: true, selector: "mat-expansion-panel-header", inputs: { expandedHeight: "expandedHeight", collapsedHeight: "collapsedHeight", tabIndex: ["tabIndex", "tabIndex", (value) => (value == null ? 0 : numberAttribute(value))] }, host: { attributes: { "role": "button" }, listeners: { "click": "_toggle()", "keydown": "_keydown($event)" }, properties: { "attr.id": "panel._headerId", "attr.tabindex": "disabled ? -1 : tabIndex", "attr.aria-controls": "_getPanelId()", "attr.aria-expanded": "_isExpanded()", "attr.aria-disabled": "panel.disabled", "class.mat-expanded": "_isExpanded()", "class.mat-expansion-toggle-indicator-after": "_getTogglePosition() === 'after'", "class.mat-expansion-toggle-indicator-before": "_getTogglePosition() === 'before'", "
|
|
366
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: MatExpansionPanelHeader, isStandalone: true, selector: "mat-expansion-panel-header", inputs: { expandedHeight: "expandedHeight", collapsedHeight: "collapsedHeight", tabIndex: ["tabIndex", "tabIndex", (value) => (value == null ? 0 : numberAttribute(value))] }, host: { attributes: { "role": "button" }, listeners: { "click": "_toggle()", "keydown": "_keydown($event)" }, properties: { "attr.id": "panel._headerId", "attr.tabindex": "disabled ? -1 : tabIndex", "attr.aria-controls": "_getPanelId()", "attr.aria-expanded": "_isExpanded()", "attr.aria-disabled": "panel.disabled", "class.mat-expanded": "_isExpanded()", "class.mat-expansion-toggle-indicator-after": "_getTogglePosition() === 'after'", "class.mat-expansion-toggle-indicator-before": "_getTogglePosition() === 'before'", "style.height": "_getHeaderHeight()" }, classAttribute: "mat-expansion-panel-header mat-focus-indicator" }, ngImport: i0, template: "<span class=\"mat-content\" [class.mat-content-hide-toggle]=\"!_showToggle()\">\n <ng-content select=\"mat-panel-title\"></ng-content>\n <ng-content select=\"mat-panel-description\"></ng-content>\n <ng-content></ng-content>\n</span>\n\n@if (_showToggle()) {\n <span class=\"mat-expansion-indicator\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 -960 960 960\"\n aria-hidden=\"true\"\n focusable=\"false\">\n <path d=\"M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z\"/>\n </svg>\n </span>\n}\n", styles: [".mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;height:var(--mat-expansion-header-collapsed-state-height, 48px);font-family:var(--mat-expansion-header-text-font, var(--mat-sys-title-medium-font));font-size:var(--mat-expansion-header-text-size, var(--mat-sys-title-medium-size));font-weight:var(--mat-expansion-header-text-weight, var(--mat-sys-title-medium-weight));line-height:var(--mat-expansion-header-text-line-height, var(--mat-sys-title-medium-line-height));letter-spacing:var(--mat-expansion-header-text-tracking, var(--mat-sys-title-medium-tracking))}.mat-expansion-panel-animations-enabled .mat-expansion-panel-header{transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header.mat-expanded{height:var(--mat-expansion-header-expanded-state-height, 64px)}.mat-expansion-panel-header[aria-disabled=true]{color:var(--mat-expansion-header-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--mat-expansion-header-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}@media(hover: none){.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--mat-expansion-container-background-color, var(--mat-sys-surface))}}.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]).cdk-keyboard-focused,.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]).cdk-program-focused{background:var(--mat-expansion-header-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-content.mat-content-hide-toggle{margin-right:8px}[dir=rtl] .mat-content.mat-content-hide-toggle{margin-right:0;margin-left:8px}.mat-expansion-toggle-indicator-before .mat-content.mat-content-hide-toggle{margin-left:24px;margin-right:0}[dir=rtl] .mat-expansion-toggle-indicator-before .mat-content.mat-content-hide-toggle{margin-right:24px;margin-left:0}.mat-expansion-panel-header-title{color:var(--mat-expansion-header-text-color, var(--mat-sys-on-surface))}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;flex-basis:0;margin-right:16px;align-items:center}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header[aria-disabled=true] .mat-expansion-panel-header-title,.mat-expansion-panel-header[aria-disabled=true] .mat-expansion-panel-header-description{color:inherit}.mat-expansion-panel-header-description{flex-grow:2;color:var(--mat-expansion-header-description-color, var(--mat-sys-on-surface-variant))}.mat-expansion-panel-animations-enabled .mat-expansion-indicator{transition:transform 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header.mat-expanded .mat-expansion-indicator{transform:rotate(180deg)}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:\"\";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle;color:var(--mat-expansion-header-indicator-color, var(--mat-sys-on-surface-variant));display:var(--mat-expansion-legacy-header-indicator-display, none)}.mat-expansion-indicator svg{width:24px;height:24px;margin:0 -8px;vertical-align:middle;fill:var(--mat-expansion-header-indicator-color, var(--mat-sys-on-surface-variant));display:var(--mat-expansion-header-indicator-display, inline-block)}@media(forced-colors: active){.mat-expansion-panel-content{border-top:1px solid;border-top-left-radius:0;border-top-right-radius:0}}"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
404
367
|
}
|
|
405
368
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: MatExpansionPanelHeader, decorators: [{
|
|
406
369
|
type: Component,
|
|
407
|
-
args: [{ selector: 'mat-expansion-panel-header', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
370
|
+
args: [{ selector: 'mat-expansion-panel-header', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
408
371
|
'class': 'mat-expansion-panel-header mat-focus-indicator',
|
|
409
372
|
'role': 'button',
|
|
410
373
|
'[attr.id]': 'panel._headerId',
|
|
@@ -415,11 +378,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
415
378
|
'[class.mat-expanded]': '_isExpanded()',
|
|
416
379
|
'[class.mat-expansion-toggle-indicator-after]': `_getTogglePosition() === 'after'`,
|
|
417
380
|
'[class.mat-expansion-toggle-indicator-before]': `_getTogglePosition() === 'before'`,
|
|
418
|
-
'[class._mat-animation-noopable]': '_animationMode === "NoopAnimations"',
|
|
419
381
|
'[style.height]': '_getHeaderHeight()',
|
|
420
382
|
'(click)': '_toggle()',
|
|
421
383
|
'(keydown)': '_keydown($event)',
|
|
422
|
-
}, template: "<span class=\"mat-content\" [class.mat-content-hide-toggle]=\"!_showToggle()\">\n <ng-content select=\"mat-panel-title\"></ng-content>\n <ng-content select=\"mat-panel-description\"></ng-content>\n <ng-content></ng-content>\n</span>\n\n@if (_showToggle()) {\n <span
|
|
384
|
+
}, template: "<span class=\"mat-content\" [class.mat-content-hide-toggle]=\"!_showToggle()\">\n <ng-content select=\"mat-panel-title\"></ng-content>\n <ng-content select=\"mat-panel-description\"></ng-content>\n <ng-content></ng-content>\n</span>\n\n@if (_showToggle()) {\n <span class=\"mat-expansion-indicator\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 -960 960 960\"\n aria-hidden=\"true\"\n focusable=\"false\">\n <path d=\"M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z\"/>\n </svg>\n </span>\n}\n", styles: [".mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;height:var(--mat-expansion-header-collapsed-state-height, 48px);font-family:var(--mat-expansion-header-text-font, var(--mat-sys-title-medium-font));font-size:var(--mat-expansion-header-text-size, var(--mat-sys-title-medium-size));font-weight:var(--mat-expansion-header-text-weight, var(--mat-sys-title-medium-weight));line-height:var(--mat-expansion-header-text-line-height, var(--mat-sys-title-medium-line-height));letter-spacing:var(--mat-expansion-header-text-tracking, var(--mat-sys-title-medium-tracking))}.mat-expansion-panel-animations-enabled .mat-expansion-panel-header{transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header.mat-expanded{height:var(--mat-expansion-header-expanded-state-height, 64px)}.mat-expansion-panel-header[aria-disabled=true]{color:var(--mat-expansion-header-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--mat-expansion-header-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}@media(hover: none){.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--mat-expansion-container-background-color, var(--mat-sys-surface))}}.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]).cdk-keyboard-focused,.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]).cdk-program-focused{background:var(--mat-expansion-header-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-content.mat-content-hide-toggle{margin-right:8px}[dir=rtl] .mat-content.mat-content-hide-toggle{margin-right:0;margin-left:8px}.mat-expansion-toggle-indicator-before .mat-content.mat-content-hide-toggle{margin-left:24px;margin-right:0}[dir=rtl] .mat-expansion-toggle-indicator-before .mat-content.mat-content-hide-toggle{margin-right:24px;margin-left:0}.mat-expansion-panel-header-title{color:var(--mat-expansion-header-text-color, var(--mat-sys-on-surface))}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;flex-basis:0;margin-right:16px;align-items:center}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header[aria-disabled=true] .mat-expansion-panel-header-title,.mat-expansion-panel-header[aria-disabled=true] .mat-expansion-panel-header-description{color:inherit}.mat-expansion-panel-header-description{flex-grow:2;color:var(--mat-expansion-header-description-color, var(--mat-sys-on-surface-variant))}.mat-expansion-panel-animations-enabled .mat-expansion-indicator{transition:transform 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header.mat-expanded .mat-expansion-indicator{transform:rotate(180deg)}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:\"\";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle;color:var(--mat-expansion-header-indicator-color, var(--mat-sys-on-surface-variant));display:var(--mat-expansion-legacy-header-indicator-display, none)}.mat-expansion-indicator svg{width:24px;height:24px;margin:0 -8px;vertical-align:middle;fill:var(--mat-expansion-header-indicator-color, var(--mat-sys-on-surface-variant));display:var(--mat-expansion-header-indicator-display, inline-block)}@media(forced-colors: active){.mat-expansion-panel-content{border-top:1px solid;border-top-left-radius:0;border-top-right-radius:0}}"] }]
|
|
423
385
|
}], ctorParameters: () => [], propDecorators: { expandedHeight: [{
|
|
424
386
|
type: Input
|
|
425
387
|
}], collapsedHeight: [{
|
|
@@ -593,6 +555,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
593
555
|
}]
|
|
594
556
|
}] });
|
|
595
557
|
|
|
558
|
+
/** Time and timing curve for expansion panel animations. */
|
|
559
|
+
// Note: Keep this in sync with the Sass variable for the panel header animation.
|
|
560
|
+
const EXPANSION_PANEL_ANIMATION_TIMING = '225ms cubic-bezier(0.4,0.0,0.2,1)';
|
|
561
|
+
/**
|
|
562
|
+
* Animations used by the Material expansion panel.
|
|
563
|
+
*
|
|
564
|
+
* A bug in angular animation's `state` when ViewContainers are moved using ViewContainerRef.move()
|
|
565
|
+
* causes the animation state of moved components to become `void` upon exit, and not update again
|
|
566
|
+
* upon reentry into the DOM. This can lead a to situation for the expansion panel where the state
|
|
567
|
+
* of the panel is `expanded` or `collapsed` but the animation state is `void`.
|
|
568
|
+
*
|
|
569
|
+
* To correctly handle animating to the next state, we animate between `void` and `collapsed` which
|
|
570
|
+
* are defined to have the same styles. Since angular animates from the current styles to the
|
|
571
|
+
* destination state's style definition, in situations where we are moving from `void`'s styles to
|
|
572
|
+
* `collapsed` this acts a noop since no style values change.
|
|
573
|
+
*
|
|
574
|
+
* In the case where angular's animation state is out of sync with the expansion panel's state, the
|
|
575
|
+
* expansion panel being `expanded` and angular animations being `void`, the animation from the
|
|
576
|
+
* `expanded`'s effective styles (though in a `void` animation state) to the collapsed state will
|
|
577
|
+
* occur as expected.
|
|
578
|
+
*
|
|
579
|
+
* Angular Bug: https://github.com/angular/angular/issues/18847
|
|
580
|
+
*
|
|
581
|
+
* @docs-private
|
|
582
|
+
* @deprecated No longer being used, to be removed.
|
|
583
|
+
* @breaking-change 21.0.0
|
|
584
|
+
*/
|
|
585
|
+
const matExpansionAnimations = {
|
|
586
|
+
/** Animation that rotates the indicator arrow. */
|
|
587
|
+
indicatorRotate: trigger('indicatorRotate', [
|
|
588
|
+
state('collapsed, void', style({ transform: 'rotate(0deg)' })),
|
|
589
|
+
state('expanded', style({ transform: 'rotate(180deg)' })),
|
|
590
|
+
transition('expanded <=> collapsed, void => collapsed', animate(EXPANSION_PANEL_ANIMATION_TIMING)),
|
|
591
|
+
]),
|
|
592
|
+
/** Animation that expands and collapses the panel content. */
|
|
593
|
+
bodyExpansion: trigger('bodyExpansion', [
|
|
594
|
+
state('collapsed, void', style({ height: '0px', visibility: 'hidden' })),
|
|
595
|
+
// Clear the `visibility` while open, otherwise the content will be visible when placed in
|
|
596
|
+
// a parent that's `visibility: hidden`, because `visibility` doesn't apply to descendants
|
|
597
|
+
// that have a `visibility` of their own (see #27436).
|
|
598
|
+
state('expanded', style({ height: '*', visibility: '' })),
|
|
599
|
+
transition('expanded <=> collapsed, void => collapsed', animate(EXPANSION_PANEL_ANIMATION_TIMING)),
|
|
600
|
+
]),
|
|
601
|
+
};
|
|
602
|
+
|
|
596
603
|
/**
|
|
597
604
|
* Generated bundle index. Do not edit.
|
|
598
605
|
*/
|