@angular/material 13.2.3 → 13.2.6
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/autocomplete/autocomplete-trigger.d.ts +1 -0
- package/button-toggle/_button-toggle-theme.scss +14 -2
- package/checkbox/_checkbox-theme.scss +1 -1
- package/core/theming/_theming.scss +9 -0
- package/dialog/dialog-config.d.ts +2 -0
- package/dialog/dialog-container.d.ts +1 -4
- package/dialog/dialog.d.ts +12 -6
- package/dialog/testing/dialog-opener.d.ts +33 -0
- package/dialog/testing/public-api.d.ts +1 -0
- package/esm2020/autocomplete/autocomplete-trigger.mjs +19 -6
- package/esm2020/bottom-sheet/bottom-sheet-animations.mjs +10 -4
- package/esm2020/button/button.mjs +3 -3
- package/esm2020/button-toggle/button-toggle.mjs +2 -2
- package/esm2020/checkbox/checkbox.mjs +4 -2
- package/esm2020/core/version.mjs +1 -1
- package/esm2020/datepicker/calendar.mjs +9 -9
- package/esm2020/datepicker/datepicker-input-base.mjs +9 -4
- package/esm2020/dialog/dialog-animations.mjs +10 -4
- package/esm2020/dialog/dialog-config.mjs +3 -1
- package/esm2020/dialog/dialog-container.mjs +14 -14
- package/esm2020/dialog/dialog.mjs +15 -31
- package/esm2020/dialog/testing/dialog-opener.mjs +67 -0
- package/esm2020/dialog/testing/public-api.mjs +2 -1
- package/esm2020/expansion/expansion-panel.mjs +3 -3
- package/esm2020/form-field/form-field.mjs +3 -3
- package/esm2020/menu/menu-item.mjs +5 -1
- package/esm2020/menu/menu.mjs +17 -1
- package/esm2020/progress-spinner/progress-spinner-module.mjs +5 -5
- package/esm2020/progress-spinner/progress-spinner.mjs +8 -48
- package/esm2020/progress-spinner/public-api.mjs +10 -2
- package/esm2020/radio/radio.mjs +3 -3
- package/esm2020/select/select.mjs +14 -4
- package/esm2020/sidenav/drawer.mjs +3 -3
- package/esm2020/sidenav/sidenav.mjs +3 -3
- package/esm2020/slide-toggle/slide-toggle.mjs +3 -2
- package/esm2020/sort/sort-header.mjs +4 -4
- package/esm2020/tabs/tab-body.mjs +3 -3
- package/esm2020/tabs/tab-header.mjs +3 -3
- package/esm2020/tooltip/testing/tooltip-harness.mjs +12 -7
- package/esm2020/tooltip/tooltip.mjs +117 -42
- package/fesm2015/autocomplete.mjs +19 -6
- package/fesm2015/autocomplete.mjs.map +1 -1
- package/fesm2015/bottom-sheet.mjs +9 -3
- package/fesm2015/bottom-sheet.mjs.map +1 -1
- package/fesm2015/button-toggle.mjs +2 -2
- package/fesm2015/button.mjs +2 -2
- package/fesm2015/button.mjs.map +1 -1
- package/fesm2015/checkbox.mjs +3 -1
- package/fesm2015/checkbox.mjs.map +1 -1
- package/fesm2015/core.mjs +1 -1
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/datepicker.mjs +15 -10
- package/fesm2015/datepicker.mjs.map +1 -1
- package/fesm2015/dialog/testing.mjs +65 -2
- package/fesm2015/dialog/testing.mjs.map +1 -1
- package/fesm2015/dialog.mjs +38 -46
- package/fesm2015/dialog.mjs.map +1 -1
- package/fesm2015/expansion.mjs +2 -2
- package/fesm2015/expansion.mjs.map +1 -1
- package/fesm2015/form-field.mjs +2 -2
- package/fesm2015/form-field.mjs.map +1 -1
- package/fesm2015/menu.mjs +21 -0
- package/fesm2015/menu.mjs.map +1 -1
- package/fesm2015/progress-spinner.mjs +22 -57
- package/fesm2015/progress-spinner.mjs.map +1 -1
- package/fesm2015/radio.mjs +2 -2
- package/fesm2015/radio.mjs.map +1 -1
- package/fesm2015/select.mjs +13 -3
- package/fesm2015/select.mjs.map +1 -1
- package/fesm2015/sidenav.mjs +4 -4
- package/fesm2015/sidenav.mjs.map +1 -1
- package/fesm2015/slide-toggle.mjs +2 -1
- package/fesm2015/slide-toggle.mjs.map +1 -1
- package/fesm2015/sort.mjs +3 -3
- package/fesm2015/sort.mjs.map +1 -1
- package/fesm2015/tabs.mjs +4 -4
- package/fesm2015/tabs.mjs.map +1 -1
- package/fesm2015/tooltip/testing.mjs +11 -8
- package/fesm2015/tooltip/testing.mjs.map +1 -1
- package/fesm2015/tooltip.mjs +141 -66
- package/fesm2015/tooltip.mjs.map +1 -1
- package/fesm2020/autocomplete.mjs +19 -6
- package/fesm2020/autocomplete.mjs.map +1 -1
- package/fesm2020/bottom-sheet.mjs +9 -3
- package/fesm2020/bottom-sheet.mjs.map +1 -1
- package/fesm2020/button-toggle.mjs +2 -2
- package/fesm2020/button.mjs +2 -2
- package/fesm2020/button.mjs.map +1 -1
- package/fesm2020/checkbox.mjs +3 -1
- package/fesm2020/checkbox.mjs.map +1 -1
- package/fesm2020/core.mjs +1 -1
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/datepicker.mjs +15 -10
- package/fesm2020/datepicker.mjs.map +1 -1
- package/fesm2020/dialog/testing.mjs +65 -1
- package/fesm2020/dialog/testing.mjs.map +1 -1
- package/fesm2020/dialog.mjs +38 -46
- package/fesm2020/dialog.mjs.map +1 -1
- package/fesm2020/expansion.mjs +2 -2
- package/fesm2020/expansion.mjs.map +1 -1
- package/fesm2020/form-field.mjs +2 -2
- package/fesm2020/form-field.mjs.map +1 -1
- package/fesm2020/menu.mjs +20 -0
- package/fesm2020/menu.mjs.map +1 -1
- package/fesm2020/progress-spinner.mjs +22 -55
- package/fesm2020/progress-spinner.mjs.map +1 -1
- package/fesm2020/radio.mjs +2 -2
- package/fesm2020/radio.mjs.map +1 -1
- package/fesm2020/select.mjs +13 -3
- package/fesm2020/select.mjs.map +1 -1
- package/fesm2020/sidenav.mjs +4 -4
- package/fesm2020/sidenav.mjs.map +1 -1
- package/fesm2020/slide-toggle.mjs +2 -1
- package/fesm2020/slide-toggle.mjs.map +1 -1
- package/fesm2020/sort.mjs +3 -3
- package/fesm2020/sort.mjs.map +1 -1
- package/fesm2020/tabs.mjs +4 -4
- package/fesm2020/tabs.mjs.map +1 -1
- package/fesm2020/tooltip/testing.mjs +11 -6
- package/fesm2020/tooltip/testing.mjs.map +1 -1
- package/fesm2020/tooltip.mjs +134 -58
- package/fesm2020/tooltip.mjs.map +1 -1
- package/menu/menu-item.d.ts +3 -2
- package/package.json +2 -2
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/progress-spinner/progress-spinner-module.d.ts +1 -1
- package/progress-spinner/progress-spinner.d.ts +1 -18
- package/progress-spinner/public-api.d.ts +8 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/select/select.d.ts +5 -0
- package/tooltip/testing/tooltip-harness.d.ts +6 -0
- package/tooltip/tooltip.d.ts +36 -8
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ContentContainerComponentHarness, TestKey, HarnessPredicate } from '@angular/cdk/testing';
|
|
2
|
+
import { __decorate, __metadata } from 'tslib';
|
|
3
|
+
import { Directive, Component, ChangeDetectionStrategy, ViewEncapsulation, NgModule } from '@angular/core';
|
|
4
|
+
import { _MatDialogBase, MatDialog, MatDialogModule } from '@angular/material/dialog';
|
|
5
|
+
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
|
2
6
|
|
|
3
7
|
/**
|
|
4
8
|
* @license
|
|
@@ -90,6 +94,66 @@ MatDialogHarness.hostSelector = '.mat-dialog-container';
|
|
|
90
94
|
* found in the LICENSE file at https://angular.io/license
|
|
91
95
|
*/
|
|
92
96
|
|
|
97
|
+
/**
|
|
98
|
+
* @license
|
|
99
|
+
* Copyright Google LLC All Rights Reserved.
|
|
100
|
+
*
|
|
101
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
102
|
+
* found in the LICENSE file at https://angular.io/license
|
|
103
|
+
*/
|
|
104
|
+
var _MatTestDialogOpenerBase_1, MatTestDialogOpener_1;
|
|
105
|
+
/** Base class for a component that immediately opens a dialog when created. */
|
|
106
|
+
let _MatTestDialogOpenerBase = _MatTestDialogOpenerBase_1 = class _MatTestDialogOpenerBase {
|
|
107
|
+
constructor(dialog) {
|
|
108
|
+
this.dialog = dialog;
|
|
109
|
+
if (!_MatTestDialogOpenerBase_1.component) {
|
|
110
|
+
throw new Error(`MatTestDialogOpener does not have a component provided.`);
|
|
111
|
+
}
|
|
112
|
+
this.dialogRef = this.dialog.open(_MatTestDialogOpenerBase_1.component, _MatTestDialogOpenerBase_1.config || {});
|
|
113
|
+
this._afterClosedSubscription = this.dialogRef.afterClosed().subscribe(result => {
|
|
114
|
+
this.closedResult = result;
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
ngOnDestroy() {
|
|
118
|
+
this._afterClosedSubscription.unsubscribe();
|
|
119
|
+
_MatTestDialogOpenerBase_1.component = undefined;
|
|
120
|
+
_MatTestDialogOpenerBase_1.config = undefined;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
_MatTestDialogOpenerBase = _MatTestDialogOpenerBase_1 = __decorate([
|
|
124
|
+
Directive(),
|
|
125
|
+
__metadata("design:paramtypes", [_MatDialogBase])
|
|
126
|
+
], _MatTestDialogOpenerBase);
|
|
127
|
+
/** Test component that immediately opens a dialog when created. */
|
|
128
|
+
let MatTestDialogOpener = MatTestDialogOpener_1 = class MatTestDialogOpener extends _MatTestDialogOpenerBase {
|
|
129
|
+
constructor(dialog) {
|
|
130
|
+
super(dialog);
|
|
131
|
+
}
|
|
132
|
+
/** Static method that prepares this class to open the provided component. */
|
|
133
|
+
static withComponent(component, config) {
|
|
134
|
+
_MatTestDialogOpenerBase.component = component;
|
|
135
|
+
_MatTestDialogOpenerBase.config = config;
|
|
136
|
+
return MatTestDialogOpener_1;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
MatTestDialogOpener = MatTestDialogOpener_1 = __decorate([
|
|
140
|
+
Component({
|
|
141
|
+
selector: 'mat-test-dialog-opener',
|
|
142
|
+
template: '',
|
|
143
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
144
|
+
encapsulation: ViewEncapsulation.None,
|
|
145
|
+
}),
|
|
146
|
+
__metadata("design:paramtypes", [MatDialog])
|
|
147
|
+
], MatTestDialogOpener);
|
|
148
|
+
let MatTestDialogOpenerModule = class MatTestDialogOpenerModule {
|
|
149
|
+
};
|
|
150
|
+
MatTestDialogOpenerModule = __decorate([
|
|
151
|
+
NgModule({
|
|
152
|
+
declarations: [MatTestDialogOpener],
|
|
153
|
+
imports: [MatDialogModule, NoopAnimationsModule],
|
|
154
|
+
})
|
|
155
|
+
], MatTestDialogOpenerModule);
|
|
156
|
+
|
|
93
157
|
/**
|
|
94
158
|
* @license
|
|
95
159
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -106,5 +170,5 @@ MatDialogHarness.hostSelector = '.mat-dialog-container';
|
|
|
106
170
|
* found in the LICENSE file at https://angular.io/license
|
|
107
171
|
*/
|
|
108
172
|
|
|
109
|
-
export { MatDialogHarness, _MatDialogHarnessBase };
|
|
173
|
+
export { MatDialogHarness, MatTestDialogOpener, MatTestDialogOpenerModule, _MatDialogHarnessBase, _MatTestDialogOpenerBase };
|
|
110
174
|
//# sourceMappingURL=testing.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.mjs","sources":["../../../../../../../src/material/dialog/testing/dialog-harness.ts","../../../../../../../src/material/dialog/testing/dialog-harness-filters.ts","../../../../../../../src/material/dialog/testing/public-api.ts","../../../../../../../src/material/dialog/testing/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ContentContainerComponentHarness, HarnessPredicate, TestKey} from '@angular/cdk/testing';\nimport {DialogRole} from '@angular/material/dialog';\nimport {DialogHarnessFilters} from './dialog-harness-filters';\n\n/** Selectors for different sections of the mat-dialog that can contain user content. */\nexport const enum MatDialogSection {\n TITLE = '.mat-dialog-title',\n CONTENT = '.mat-dialog-content',\n ACTIONS = '.mat-dialog-actions',\n}\n\n/** Base class for the `MatDialogHarness` implementation. */\nexport class _MatDialogHarnessBase\n // @breaking-change 14.0.0 change generic type to MatDialogSection.\n extends ContentContainerComponentHarness<MatDialogSection | string>\n{\n protected _title = this.locatorForOptional(MatDialogSection.TITLE);\n protected _content = this.locatorForOptional(MatDialogSection.CONTENT);\n protected _actions = this.locatorForOptional(MatDialogSection.ACTIONS);\n\n /** Gets the id of the dialog. */\n async getId(): Promise<string | null> {\n const id = await (await this.host()).getAttribute('id');\n // In case no id has been specified, the \"id\" property always returns\n // an empty string. To make this method more explicit, we return null.\n return id !== '' ? id : null;\n }\n\n /** Gets the role of the dialog. */\n async getRole(): Promise<DialogRole | null> {\n return (await this.host()).getAttribute('role') as Promise<DialogRole | null>;\n }\n\n /** Gets the value of the dialog's \"aria-label\" attribute. */\n async getAriaLabel(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-label');\n }\n\n /** Gets the value of the dialog's \"aria-labelledby\" attribute. */\n async getAriaLabelledby(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-labelledby');\n }\n\n /** Gets the value of the dialog's \"aria-describedby\" attribute. */\n async getAriaDescribedby(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-describedby');\n }\n\n /**\n * Closes the dialog by pressing escape.\n *\n * Note: this method does nothing if `disableClose` has been set to `true` for the dialog.\n */\n async close(): Promise<void> {\n await (await this.host()).sendKeys(TestKey.ESCAPE);\n }\n\n /** Gets te dialog's text. */\n async getText() {\n return (await this.host()).text();\n }\n\n /** Gets the dialog's title text. This only works if the dialog is using mat-dialog-title. */\n async getTitleText() {\n return (await this._title())?.text() ?? '';\n }\n\n /** Gets the dialog's content text. This only works if the dialog is using mat-dialog-content. */\n async getContentText() {\n return (await this._content())?.text() ?? '';\n }\n\n /** Gets the dialog's actions text. This only works if the dialog is using mat-dialog-actions. */\n async getActionsText() {\n return (await this._actions())?.text() ?? '';\n }\n}\n\n/** Harness for interacting with a standard `MatDialog` in tests. */\nexport class MatDialogHarness extends _MatDialogHarnessBase {\n // Developers can provide a custom component or template for the\n // dialog. The canonical dialog parent is the \"MatDialogContainer\".\n /** The selector for the host element of a `MatDialog` instance. */\n static hostSelector = '.mat-dialog-container';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatDialogHarness` that meets\n * certain criteria.\n * @param options Options for filtering which dialog instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: DialogHarnessFilters = {}): HarnessPredicate<MatDialogHarness> {\n return new HarnessPredicate(MatDialogHarness, options);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BaseHarnessFilters} from '@angular/cdk/testing';\n\n/** A set of criteria that can be used to filter a list of `MatDialogHarness` instances. */\nexport interface DialogHarnessFilters extends BaseHarnessFilters {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './dialog-harness';\nexport * from './dialog-harness-filters';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;;;AAmBA;MACa,qBAAqB;AAChC;AACA,SAAQ,gCAA2D;IAFrE;;QAIY,WAAM,GAAG,IAAI,CAAC,kBAAkB,iCAAwB,CAAC;QACzD,aAAQ,GAAG,IAAI,CAAC,kBAAkB,qCAA0B,CAAC;QAC7D,aAAQ,GAAG,IAAI,CAAC,kBAAkB,qCAA0B,CAAC;KA0DxE;;IAvDC,MAAM,KAAK;QACT,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;;;QAGxD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;KAC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AA;;;;;;;;ACAA;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"testing.mjs","sources":["../../../../../../../src/material/dialog/testing/dialog-harness.ts","../../../../../../../src/material/dialog/testing/dialog-harness-filters.ts","../../../../../../../src/material/dialog/testing/dialog-opener.ts","../../../../../../../src/material/dialog/testing/public-api.ts","../../../../../../../src/material/dialog/testing/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ContentContainerComponentHarness, HarnessPredicate, TestKey} from '@angular/cdk/testing';\nimport {DialogRole} from '@angular/material/dialog';\nimport {DialogHarnessFilters} from './dialog-harness-filters';\n\n/** Selectors for different sections of the mat-dialog that can contain user content. */\nexport const enum MatDialogSection {\n TITLE = '.mat-dialog-title',\n CONTENT = '.mat-dialog-content',\n ACTIONS = '.mat-dialog-actions',\n}\n\n/** Base class for the `MatDialogHarness` implementation. */\nexport class _MatDialogHarnessBase\n // @breaking-change 14.0.0 change generic type to MatDialogSection.\n extends ContentContainerComponentHarness<MatDialogSection | string>\n{\n protected _title = this.locatorForOptional(MatDialogSection.TITLE);\n protected _content = this.locatorForOptional(MatDialogSection.CONTENT);\n protected _actions = this.locatorForOptional(MatDialogSection.ACTIONS);\n\n /** Gets the id of the dialog. */\n async getId(): Promise<string | null> {\n const id = await (await this.host()).getAttribute('id');\n // In case no id has been specified, the \"id\" property always returns\n // an empty string. To make this method more explicit, we return null.\n return id !== '' ? id : null;\n }\n\n /** Gets the role of the dialog. */\n async getRole(): Promise<DialogRole | null> {\n return (await this.host()).getAttribute('role') as Promise<DialogRole | null>;\n }\n\n /** Gets the value of the dialog's \"aria-label\" attribute. */\n async getAriaLabel(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-label');\n }\n\n /** Gets the value of the dialog's \"aria-labelledby\" attribute. */\n async getAriaLabelledby(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-labelledby');\n }\n\n /** Gets the value of the dialog's \"aria-describedby\" attribute. */\n async getAriaDescribedby(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-describedby');\n }\n\n /**\n * Closes the dialog by pressing escape.\n *\n * Note: this method does nothing if `disableClose` has been set to `true` for the dialog.\n */\n async close(): Promise<void> {\n await (await this.host()).sendKeys(TestKey.ESCAPE);\n }\n\n /** Gets te dialog's text. */\n async getText() {\n return (await this.host()).text();\n }\n\n /** Gets the dialog's title text. This only works if the dialog is using mat-dialog-title. */\n async getTitleText() {\n return (await this._title())?.text() ?? '';\n }\n\n /** Gets the dialog's content text. This only works if the dialog is using mat-dialog-content. */\n async getContentText() {\n return (await this._content())?.text() ?? '';\n }\n\n /** Gets the dialog's actions text. This only works if the dialog is using mat-dialog-actions. */\n async getActionsText() {\n return (await this._actions())?.text() ?? '';\n }\n}\n\n/** Harness for interacting with a standard `MatDialog` in tests. */\nexport class MatDialogHarness extends _MatDialogHarnessBase {\n // Developers can provide a custom component or template for the\n // dialog. The canonical dialog parent is the \"MatDialogContainer\".\n /** The selector for the host element of a `MatDialog` instance. */\n static hostSelector = '.mat-dialog-container';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatDialogHarness` that meets\n * certain criteria.\n * @param options Options for filtering which dialog instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: DialogHarnessFilters = {}): HarnessPredicate<MatDialogHarness> {\n return new HarnessPredicate(MatDialogHarness, options);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BaseHarnessFilters} from '@angular/cdk/testing';\n\n/** A set of criteria that can be used to filter a list of `MatDialogHarness` instances. */\nexport interface DialogHarnessFilters extends BaseHarnessFilters {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ComponentType} from '@angular/cdk/overlay';\nimport {\n ChangeDetectionStrategy,\n Directive,\n Component,\n NgModule,\n OnDestroy,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n _MatDialogBase,\n _MatDialogContainerBase,\n MatDialog,\n MatDialogConfig,\n MatDialogContainer,\n MatDialogModule,\n MatDialogRef,\n} from '@angular/material/dialog';\nimport {Subscription} from 'rxjs';\nimport {NoopAnimationsModule} from '@angular/platform-browser/animations';\n\n/** Base class for a component that immediately opens a dialog when created. */\n@Directive()\nexport class _MatTestDialogOpenerBase<C extends _MatDialogContainerBase, T, R>\n implements OnDestroy\n{\n /** Component that should be opened with the MatDialog `open` method. */\n protected static component: ComponentType<unknown> | undefined;\n\n /** Config that should be provided to the MatDialog `open` method. */\n protected static config: MatDialogConfig | undefined;\n\n /** MatDialogRef returned from the MatDialog `open` method. */\n dialogRef: MatDialogRef<T, R>;\n\n /** Data passed to the `MatDialog` close method. */\n closedResult: R | undefined;\n\n private readonly _afterClosedSubscription: Subscription;\n\n constructor(public dialog: _MatDialogBase<C>) {\n if (!_MatTestDialogOpenerBase.component) {\n throw new Error(`MatTestDialogOpener does not have a component provided.`);\n }\n\n this.dialogRef = this.dialog.open<T, R>(\n _MatTestDialogOpenerBase.component as ComponentType<T>,\n _MatTestDialogOpenerBase.config || {},\n );\n this._afterClosedSubscription = this.dialogRef.afterClosed().subscribe(result => {\n this.closedResult = result;\n });\n }\n\n ngOnDestroy() {\n this._afterClosedSubscription.unsubscribe();\n _MatTestDialogOpenerBase.component = undefined;\n _MatTestDialogOpenerBase.config = undefined;\n }\n}\n\n/** Test component that immediately opens a dialog when created. */\n@Component({\n selector: 'mat-test-dialog-opener',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class MatTestDialogOpener<T = unknown, R = unknown> extends _MatTestDialogOpenerBase<\n MatDialogContainer,\n T,\n R\n> {\n constructor(dialog: MatDialog) {\n super(dialog);\n }\n\n /** Static method that prepares this class to open the provided component. */\n static withComponent<T = unknown, R = unknown>(\n component: ComponentType<T>,\n config?: MatDialogConfig,\n ) {\n _MatTestDialogOpenerBase.component = component;\n _MatTestDialogOpenerBase.config = config;\n return MatTestDialogOpener as ComponentType<MatTestDialogOpener<T, R>>;\n }\n}\n\n@NgModule({\n declarations: [MatTestDialogOpener],\n imports: [MatDialogModule, NoopAnimationsModule],\n})\nexport class MatTestDialogOpenerModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './dialog-harness';\nexport * from './dialog-harness-filters';\nexport * from './dialog-opener';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;AAmBA;MACa,qBAAqB;AAChC;AACA,SAAQ,gCAA2D;IAFrE;;QAIY,WAAM,GAAG,IAAI,CAAC,kBAAkB,iCAAwB,CAAC;QACzD,aAAQ,GAAG,IAAI,CAAC,kBAAkB,qCAA0B,CAAC;QAC7D,aAAQ,GAAG,IAAI,CAAC,kBAAkB,qCAA0B,CAAC;KA0DxE;;IAvDC,MAAM,KAAK;QACT,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;;;QAGxD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;KAC9B;;IAGD,MAAM,OAAO;QACX,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,MAAM,CAA+B,CAAC;KAC/E;;IAGD,MAAM,YAAY;QAChB,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;KACvD;;IAGD,MAAM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;;;ACAA;;;;;;;;;;"}
|
package/fesm2020/dialog.mjs
CHANGED
|
@@ -8,11 +8,11 @@ import { MatCommonModule } from '@angular/material/core';
|
|
|
8
8
|
import { Directionality } from '@angular/cdk/bidi';
|
|
9
9
|
import * as i2 from '@angular/common';
|
|
10
10
|
import { DOCUMENT } from '@angular/common';
|
|
11
|
-
import { Subject, defer,
|
|
11
|
+
import { Subject, defer, of } from 'rxjs';
|
|
12
12
|
import { filter, take, startWith } from 'rxjs/operators';
|
|
13
13
|
import * as i1 from '@angular/cdk/a11y';
|
|
14
14
|
import { _getFocusedElementPierceShadowDom } from '@angular/cdk/platform';
|
|
15
|
-
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
15
|
+
import { trigger, state, style, transition, group, animate, query, animateChild } from '@angular/animations';
|
|
16
16
|
import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
|
|
17
17
|
import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
|
|
18
18
|
|
|
@@ -63,6 +63,8 @@ class MatDialogConfig {
|
|
|
63
63
|
* previously-focused element, after it's closed.
|
|
64
64
|
*/
|
|
65
65
|
this.restoreFocus = true;
|
|
66
|
+
/** Whether to wait for the opening animation to finish before trapping focus. */
|
|
67
|
+
this.delayFocusTrap = true;
|
|
66
68
|
/**
|
|
67
69
|
* Whether the dialog should close when the user goes backwards/forwards in history.
|
|
68
70
|
* Note that this usually doesn't include clicking on links (unless the user is using
|
|
@@ -92,8 +94,14 @@ const matDialogAnimations = {
|
|
|
92
94
|
// decimate the animation performance. Leaving it as `none` solves both issues.
|
|
93
95
|
state('void, exit', style({ opacity: 0, transform: 'scale(0.7)' })),
|
|
94
96
|
state('enter', style({ transform: 'none' })),
|
|
95
|
-
transition('* => enter',
|
|
96
|
-
|
|
97
|
+
transition('* => enter', group([
|
|
98
|
+
animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({ transform: 'none', opacity: 1 })),
|
|
99
|
+
query('@*', animateChild(), { optional: true }),
|
|
100
|
+
])),
|
|
101
|
+
transition('* => void, * => exit', group([
|
|
102
|
+
animate('75ms cubic-bezier(0.4, 0.0, 0.2, 1)', style({ opacity: 0 })),
|
|
103
|
+
query('@*', animateChild(), { optional: true }),
|
|
104
|
+
])),
|
|
97
105
|
]),
|
|
98
106
|
};
|
|
99
107
|
|
|
@@ -148,10 +156,12 @@ class _MatDialogContainerBase extends BasePortalOutlet {
|
|
|
148
156
|
}
|
|
149
157
|
/** Initializes the dialog container with the attached content. */
|
|
150
158
|
_initializeWithAttachedContent() {
|
|
151
|
-
this.
|
|
159
|
+
this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
|
|
152
160
|
// Save the previously focused element. This element will be re-focused
|
|
153
161
|
// when the dialog closes.
|
|
154
|
-
this.
|
|
162
|
+
if (this._document) {
|
|
163
|
+
this._elementFocusedBeforeDialogWasOpened = _getFocusedElementPierceShadowDom();
|
|
164
|
+
}
|
|
155
165
|
}
|
|
156
166
|
/**
|
|
157
167
|
* Attach a ComponentPortal as content to this dialog container.
|
|
@@ -276,16 +286,6 @@ class _MatDialogContainerBase extends BasePortalOutlet {
|
|
|
276
286
|
this._focusTrap.destroy();
|
|
277
287
|
}
|
|
278
288
|
}
|
|
279
|
-
/** Sets up the focus trap. */
|
|
280
|
-
_setupFocusTrap() {
|
|
281
|
-
this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
|
|
282
|
-
}
|
|
283
|
-
/** Captures the element that was focused before the dialog was opened. */
|
|
284
|
-
_capturePreviouslyFocusedElement() {
|
|
285
|
-
if (this._document) {
|
|
286
|
-
this._elementFocusedBeforeDialogWasOpened = _getFocusedElementPierceShadowDom();
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
289
|
/** Focuses the dialog container. */
|
|
290
290
|
_focusDialogContainer() {
|
|
291
291
|
// Note that there is no focus method when rendering on the server.
|
|
@@ -327,7 +327,9 @@ class MatDialogContainer extends _MatDialogContainerBase {
|
|
|
327
327
|
/** Callback, invoked whenever an animation on the host completes. */
|
|
328
328
|
_onAnimationDone({ toState, totalTime }) {
|
|
329
329
|
if (toState === 'enter') {
|
|
330
|
-
this.
|
|
330
|
+
if (this._config.delayFocusTrap) {
|
|
331
|
+
this._trapFocus();
|
|
332
|
+
}
|
|
331
333
|
this._animationStateChanged.next({ state: 'opened', totalTime });
|
|
332
334
|
}
|
|
333
335
|
else if (toState === 'exit') {
|
|
@@ -351,6 +353,12 @@ class MatDialogContainer extends _MatDialogContainerBase {
|
|
|
351
353
|
// view container is using OnPush change detection.
|
|
352
354
|
this._changeDetectorRef.markForCheck();
|
|
353
355
|
}
|
|
356
|
+
_initializeWithAttachedContent() {
|
|
357
|
+
super._initializeWithAttachedContent();
|
|
358
|
+
if (!this._config.delayFocusTrap) {
|
|
359
|
+
this._trapFocus();
|
|
360
|
+
}
|
|
361
|
+
}
|
|
354
362
|
}
|
|
355
363
|
MatDialogContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: MatDialogContainer, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
356
364
|
MatDialogContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.0", type: MatDialogContainer, selector: "mat-dialog-container", host: { attributes: { "tabindex": "-1", "aria-modal": "true" }, listeners: { "@dialogContainer.start": "_onAnimationStart($event)", "@dialogContainer.done": "_onAnimationDone($event)" }, properties: { "id": "_id", "attr.role": "_config.role", "attr.aria-labelledby": "_config.ariaLabel ? null : _ariaLabelledBy", "attr.aria-label": "_config.ariaLabel", "attr.aria-describedby": "_config.ariaDescribedBy || null", "@dialogContainer": "_state" }, classAttribute: "mat-dialog-container" }, usesInheritance: true, ngImport: i0, template: "<ng-template cdkPortalOutlet></ng-template>\n", styles: [".mat-dialog-container{display:block;padding:24px;border-radius:4px;box-sizing:border-box;overflow:auto;outline:0;width:100%;height:100%;min-height:inherit;max-height:inherit}.cdk-high-contrast-active .mat-dialog-container{outline:solid 1px}.mat-dialog-content{display:block;margin:0 -24px;padding:0 24px;max-height:65vh;overflow:auto;-webkit-overflow-scrolling:touch}.mat-dialog-title{margin:0 0 20px;display:block}.mat-dialog-actions{padding:8px 0;display:flex;flex-wrap:wrap;min-height:52px;align-items:center;box-sizing:content-box;margin-bottom:-24px}.mat-dialog-actions[align=end]{justify-content:flex-end}.mat-dialog-actions[align=center]{justify-content:center}.mat-dialog-actions .mat-button-base+.mat-button-base,.mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"], directives: [{ type: i3.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], animations: [matDialogAnimations.dialogContainer], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
|
|
@@ -601,7 +609,12 @@ const MAT_DIALOG_SCROLL_STRATEGY_PROVIDER = {
|
|
|
601
609
|
* for arbitrary dialog refs and dialog container components.
|
|
602
610
|
*/
|
|
603
611
|
class _MatDialogBase {
|
|
604
|
-
constructor(_overlay, _injector, _defaultOptions, _parentDialog, _overlayContainer, scrollStrategy, _dialogRefConstructor, _dialogContainerType, _dialogDataToken,
|
|
612
|
+
constructor(_overlay, _injector, _defaultOptions, _parentDialog, _overlayContainer, scrollStrategy, _dialogRefConstructor, _dialogContainerType, _dialogDataToken,
|
|
613
|
+
/**
|
|
614
|
+
* @deprecated No longer used. To be removed.
|
|
615
|
+
* @breaking-change 14.0.0
|
|
616
|
+
*/
|
|
617
|
+
_animationMode) {
|
|
605
618
|
this._overlay = _overlay;
|
|
606
619
|
this._injector = _injector;
|
|
607
620
|
this._defaultOptions = _defaultOptions;
|
|
@@ -610,12 +623,10 @@ class _MatDialogBase {
|
|
|
610
623
|
this._dialogRefConstructor = _dialogRefConstructor;
|
|
611
624
|
this._dialogContainerType = _dialogContainerType;
|
|
612
625
|
this._dialogDataToken = _dialogDataToken;
|
|
613
|
-
this._animationMode = _animationMode;
|
|
614
626
|
this._openDialogsAtThisLevel = [];
|
|
615
627
|
this._afterAllClosedAtThisLevel = new Subject();
|
|
616
628
|
this._afterOpenedAtThisLevel = new Subject();
|
|
617
629
|
this._ariaHiddenElements = new Map();
|
|
618
|
-
this._dialogAnimatingOpen = false;
|
|
619
630
|
// TODO (jelbourn): tighten the typing right-hand side of this expression.
|
|
620
631
|
/**
|
|
621
632
|
* Stream that emits when all open dialog have finished closing.
|
|
@@ -645,29 +656,9 @@ class _MatDialogBase {
|
|
|
645
656
|
(typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
646
657
|
throw Error(`Dialog with id "${config.id}" exists already. The dialog id must be unique.`);
|
|
647
658
|
}
|
|
648
|
-
// If there is a dialog that is currently animating open, return the MatDialogRef of that dialog
|
|
649
|
-
if (this._dialogAnimatingOpen) {
|
|
650
|
-
return this._lastDialogRef;
|
|
651
|
-
}
|
|
652
659
|
const overlayRef = this._createOverlay(config);
|
|
653
660
|
const dialogContainer = this._attachDialogContainer(overlayRef, config);
|
|
654
|
-
if (this._animationMode !== 'NoopAnimations') {
|
|
655
|
-
const animationStateSubscription = dialogContainer._animationStateChanged.subscribe(dialogAnimationEvent => {
|
|
656
|
-
if (dialogAnimationEvent.state === 'opening') {
|
|
657
|
-
this._dialogAnimatingOpen = true;
|
|
658
|
-
}
|
|
659
|
-
if (dialogAnimationEvent.state === 'opened') {
|
|
660
|
-
this._dialogAnimatingOpen = false;
|
|
661
|
-
animationStateSubscription.unsubscribe();
|
|
662
|
-
}
|
|
663
|
-
});
|
|
664
|
-
if (!this._animationStateSubscriptions) {
|
|
665
|
-
this._animationStateSubscriptions = new Subscription();
|
|
666
|
-
}
|
|
667
|
-
this._animationStateSubscriptions.add(animationStateSubscription);
|
|
668
|
-
}
|
|
669
661
|
const dialogRef = this._attachDialogContent(componentOrTemplateRef, dialogContainer, overlayRef, config);
|
|
670
|
-
this._lastDialogRef = dialogRef;
|
|
671
662
|
// If this is the first dialog that we're opening, hide all the non-overlay content.
|
|
672
663
|
if (!this.openDialogs.length) {
|
|
673
664
|
this._hideNonDialogContentFromAssistiveTechnology();
|
|
@@ -698,10 +689,6 @@ class _MatDialogBase {
|
|
|
698
689
|
this._closeDialogs(this._openDialogsAtThisLevel);
|
|
699
690
|
this._afterAllClosedAtThisLevel.complete();
|
|
700
691
|
this._afterOpenedAtThisLevel.complete();
|
|
701
|
-
// Clean up any subscriptions to dialogs that never finished opening.
|
|
702
|
-
if (this._animationStateSubscriptions) {
|
|
703
|
-
this._animationStateSubscriptions.unsubscribe();
|
|
704
|
-
}
|
|
705
692
|
}
|
|
706
693
|
/**
|
|
707
694
|
* Creates the overlay into which the dialog will be loaded.
|
|
@@ -772,7 +759,7 @@ class _MatDialogBase {
|
|
|
772
759
|
}
|
|
773
760
|
else {
|
|
774
761
|
const injector = this._createInjector(config, dialogRef, dialogContainer);
|
|
775
|
-
const contentRef = dialogContainer.attachComponentPortal(new ComponentPortal(componentOrTemplateRef, config.viewContainerRef, injector));
|
|
762
|
+
const contentRef = dialogContainer.attachComponentPortal(new ComponentPortal(componentOrTemplateRef, config.viewContainerRef, injector, config.componentFactoryResolver));
|
|
776
763
|
dialogRef.componentInstance = contentRef.instance;
|
|
777
764
|
}
|
|
778
765
|
dialogRef.updateSize(config.width, config.height).updatePosition(config.position);
|
|
@@ -877,7 +864,12 @@ class MatDialog extends _MatDialogBase {
|
|
|
877
864
|
* @deprecated `_location` parameter to be removed.
|
|
878
865
|
* @breaking-change 10.0.0
|
|
879
866
|
*/
|
|
880
|
-
location, defaultOptions, scrollStrategy, parentDialog, overlayContainer,
|
|
867
|
+
location, defaultOptions, scrollStrategy, parentDialog, overlayContainer,
|
|
868
|
+
/**
|
|
869
|
+
* @deprecated No longer used. To be removed.
|
|
870
|
+
* @breaking-change 14.0.0
|
|
871
|
+
*/
|
|
872
|
+
animationMode) {
|
|
881
873
|
super(overlay, injector, defaultOptions, parentDialog, overlayContainer, scrollStrategy, MatDialogRef, MatDialogContainer, MAT_DIALOG_DATA, animationMode);
|
|
882
874
|
}
|
|
883
875
|
}
|