@angular/material 21.0.0-next.9 → 21.0.0-rc.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.
- package/core/tokens/_classes.scss +1 -1
- package/core/tokens/m2/_md-sys-color.scss +17 -17
- package/fesm2022/_animation-chunk.mjs +10 -16
- package/fesm2022/_animation-chunk.mjs.map +1 -1
- package/fesm2022/_date-formats-chunk.mjs +68 -164
- package/fesm2022/_date-formats-chunk.mjs.map +1 -1
- package/fesm2022/_date-range-input-harness-chunk.mjs +284 -463
- package/fesm2022/_date-range-input-harness-chunk.mjs.map +1 -1
- package/fesm2022/_error-options-chunk.mjs +56 -19
- package/fesm2022/_error-options-chunk.mjs.map +1 -1
- package/fesm2022/_error-state-chunk.mjs +24 -31
- package/fesm2022/_error-state-chunk.mjs.map +1 -1
- package/fesm2022/_form-field-chunk.mjs +1224 -1017
- package/fesm2022/_form-field-chunk.mjs.map +1 -1
- package/fesm2022/_icon-button-chunk.mjs +243 -187
- package/fesm2022/_icon-button-chunk.mjs.map +1 -1
- package/fesm2022/_icon-registry-chunk.mjs +350 -575
- package/fesm2022/_icon-registry-chunk.mjs.map +1 -1
- package/fesm2022/_input-harness-chunk.mjs +56 -107
- package/fesm2022/_input-harness-chunk.mjs.map +1 -1
- package/fesm2022/_input-value-accessor-chunk.mjs +0 -6
- package/fesm2022/_input-value-accessor-chunk.mjs.map +1 -1
- package/fesm2022/_internal-form-field-chunk.mjs +59 -19
- package/fesm2022/_internal-form-field-chunk.mjs.map +1 -1
- package/fesm2022/_line-chunk.mjs +83 -43
- package/fesm2022/_line-chunk.mjs.map +1 -1
- package/fesm2022/_option-chunk.mjs +348 -311
- package/fesm2022/_option-chunk.mjs.map +1 -1
- package/fesm2022/_option-harness-chunk.mjs +23 -39
- package/fesm2022/_option-harness-chunk.mjs.map +1 -1
- package/fesm2022/_option-module-chunk.mjs +36 -10
- package/fesm2022/_option-module-chunk.mjs.map +1 -1
- package/fesm2022/_pseudo-checkbox-chunk.mjs +79 -44
- package/fesm2022/_pseudo-checkbox-chunk.mjs.map +1 -1
- package/fesm2022/_pseudo-checkbox-module-chunk.mjs +36 -10
- package/fesm2022/_pseudo-checkbox-module-chunk.mjs.map +1 -1
- package/fesm2022/_public-api-chunk.mjs +71 -134
- package/fesm2022/_public-api-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-chunk.mjs +504 -600
- package/fesm2022/_ripple-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-loader-chunk.mjs +120 -138
- package/fesm2022/_ripple-loader-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-module-chunk.mjs +36 -10
- package/fesm2022/_ripple-module-chunk.mjs.map +1 -1
- package/fesm2022/_structural-styles-chunk.mjs +37 -10
- package/fesm2022/_structural-styles-chunk.mjs.map +1 -1
- package/fesm2022/_tooltip-chunk.mjs +810 -888
- package/fesm2022/_tooltip-chunk.mjs.map +1 -1
- package/fesm2022/autocomplete-testing.mjs +62 -86
- package/fesm2022/autocomplete-testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs +965 -1126
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge-testing.mjs +38 -54
- package/fesm2022/badge-testing.mjs.map +1 -1
- package/fesm2022/badge.mjs +321 -272
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet-testing.mjs +10 -24
- package/fesm2022/bottom-sheet-testing.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +349 -344
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-testing.mjs +60 -94
- package/fesm2022/button-testing.mjs.map +1 -1
- package/fesm2022/button-toggle-testing.mjs +76 -125
- package/fesm2022/button-toggle-testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +752 -662
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +263 -158
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card-testing.mjs +19 -33
- package/fesm2022/card-testing.mjs.map +1 -1
- package/fesm2022/card.mjs +576 -272
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox-testing.mjs +71 -123
- package/fesm2022/checkbox-testing.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +515 -477
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips-testing.mjs +201 -344
- package/fesm2022/chips-testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +2552 -2289
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core-testing.mjs +14 -28
- package/fesm2022/core-testing.mjs.map +1 -1
- package/fesm2022/core.mjs +357 -328
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker-testing.mjs +15 -25
- package/fesm2022/datepicker-testing.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +4826 -4563
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog-testing.mjs +93 -129
- package/fesm2022/dialog-testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs +810 -829
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider-testing.mjs +10 -11
- package/fesm2022/divider-testing.mjs.map +1 -1
- package/fesm2022/divider.mjs +119 -43
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion-testing.mjs +74 -130
- package/fesm2022/expansion-testing.mjs.map +1 -1
- package/fesm2022/expansion.mjs +703 -515
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field-testing-control.mjs +16 -33
- package/fesm2022/form-field-testing-control.mjs.map +1 -1
- package/fesm2022/form-field-testing.mjs +118 -179
- package/fesm2022/form-field-testing.mjs.map +1 -1
- package/fesm2022/form-field.mjs +36 -10
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list-testing.mjs +65 -113
- package/fesm2022/grid-list-testing.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +559 -494
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon-testing.mjs +148 -127
- package/fesm2022/icon-testing.mjs.map +1 -1
- package/fesm2022/icon.mjs +325 -351
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/input-testing.mjs +59 -99
- package/fesm2022/input-testing.mjs.map +1 -1
- package/fesm2022/input.mjs +457 -520
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list-testing.mjs +251 -434
- package/fesm2022/list-testing.mjs.map +1 -1
- package/fesm2022/list.mjs +1522 -1204
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/material.mjs +0 -5
- package/fesm2022/material.mjs.map +1 -1
- package/fesm2022/menu-testing.mjs +159 -228
- package/fesm2022/menu-testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +1338 -1343
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator-testing.mjs +55 -79
- package/fesm2022/paginator-testing.mjs.map +1 -1
- package/fesm2022/paginator.mjs +381 -309
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar-testing.mjs +12 -21
- package/fesm2022/progress-bar-testing.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +224 -169
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner-testing.mjs +13 -23
- package/fesm2022/progress-spinner-testing.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +235 -160
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio-testing.mjs +133 -208
- package/fesm2022/radio-testing.mjs.map +1 -1
- package/fesm2022/radio.mjs +712 -679
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select-testing.mjs +83 -117
- package/fesm2022/select-testing.mjs.map +1 -1
- package/fesm2022/select.mjs +1116 -1246
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav-testing.mjs +54 -120
- package/fesm2022/sidenav-testing.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +1078 -995
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle-testing.mjs +57 -92
- package/fesm2022/slide-toggle-testing.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +369 -279
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider-testing.mjs +90 -138
- package/fesm2022/slider-testing.mjs.map +1 -1
- package/fesm2022/slider.mjs +1651 -1716
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar-testing.mjs +40 -87
- package/fesm2022/snack-bar-testing.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +763 -714
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort-testing.mjs +45 -66
- package/fesm2022/sort-testing.mjs.map +1 -1
- package/fesm2022/sort.mjs +419 -344
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper-testing.mjs +78 -154
- package/fesm2022/stepper-testing.mjs.map +1 -1
- package/fesm2022/stepper.mjs +790 -498
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table-testing.mjs +120 -213
- package/fesm2022/table-testing.mjs.map +1 -1
- package/fesm2022/table.mjs +1026 -684
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs-testing.mjs +125 -197
- package/fesm2022/tabs-testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +2351 -2028
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker-testing.mjs +113 -172
- package/fesm2022/timepicker-testing.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +1019 -826
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar-testing.mjs +16 -27
- package/fesm2022/toolbar-testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +163 -78
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip-testing.mjs +41 -52
- package/fesm2022/tooltip-testing.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +36 -10
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree-testing.mjs +86 -162
- package/fesm2022/tree-testing.mjs.map +1 -1
- package/fesm2022/tree.mjs +638 -466
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +2 -2
- package/schematics/ng-add/index.js +1 -1
- package/types/expansion.d.ts +4 -2
- package/types/menu-testing.d.ts +2 -0
- package/types/select.d.ts +1 -1
- package/types/timepicker.d.ts +1 -0
|
@@ -1,93 +1,46 @@
|
|
|
1
1
|
import { ContentContainerComponentHarness, HarnessPredicate, parallel } from '@angular/cdk/testing';
|
|
2
2
|
|
|
3
|
-
/** Harness for interacting with a mat-snack-bar in tests. */
|
|
4
3
|
class MatSnackBarHarness extends ContentContainerComponentHarness {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
* with custom content.
|
|
46
|
-
*/
|
|
47
|
-
async getActionDescription() {
|
|
48
|
-
await this._assertHasAction();
|
|
49
|
-
return (await this._getActionButton()).text();
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Dismisses the snack-bar by clicking the action button. Method cannot be used for snack-bar's
|
|
53
|
-
* without action or with custom content.
|
|
54
|
-
*/
|
|
55
|
-
async dismissWithAction() {
|
|
56
|
-
await this._assertHasAction();
|
|
57
|
-
await (await this._getActionButton()).click();
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Gets the message of the snack-bar. Method cannot be used for snack-bar's with custom content.
|
|
61
|
-
*/
|
|
62
|
-
async getMessage() {
|
|
63
|
-
return (await this.locatorFor(this._messageSelector)()).text();
|
|
64
|
-
}
|
|
65
|
-
/** Gets whether the snack-bar has been dismissed. */
|
|
66
|
-
async isDismissed() {
|
|
67
|
-
// We consider the snackbar dismissed if it's not in the DOM. We can assert that the
|
|
68
|
-
// element isn't in the DOM by seeing that its width and height are zero.
|
|
69
|
-
const host = await this.host();
|
|
70
|
-
const [exit, dimensions] = await parallel(() => [
|
|
71
|
-
// The snackbar container is marked with the "exit" attribute after it has been dismissed
|
|
72
|
-
// but before the animation has finished (after which it's removed from the DOM).
|
|
73
|
-
host.getAttribute('mat-exit'),
|
|
74
|
-
host.getDimensions(),
|
|
75
|
-
]);
|
|
76
|
-
return exit != null || (!!dimensions && dimensions.height === 0 && dimensions.width === 0);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Asserts that the current snack-bar has an action defined. Otherwise the
|
|
80
|
-
* promise will reject.
|
|
81
|
-
*/
|
|
82
|
-
async _assertHasAction() {
|
|
83
|
-
if (!(await this.hasAction())) {
|
|
84
|
-
throw Error('Method cannot be used for a snack-bar without an action.');
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
/** Gets the simple snack bar action button. */
|
|
88
|
-
async _getActionButton() {
|
|
89
|
-
return this.locatorForOptional(this._actionButtonSelector)();
|
|
90
|
-
}
|
|
4
|
+
static hostSelector = '.mat-mdc-snack-bar-container:not([mat-exit])';
|
|
5
|
+
_messageSelector = '.mdc-snackbar__label';
|
|
6
|
+
_actionButtonSelector = '.mat-mdc-snack-bar-action';
|
|
7
|
+
_snackBarLiveRegion = this.locatorFor('[aria-live]');
|
|
8
|
+
static with(options = {}) {
|
|
9
|
+
return new HarnessPredicate(MatSnackBarHarness, options);
|
|
10
|
+
}
|
|
11
|
+
async getRole() {
|
|
12
|
+
return (await this.host()).getAttribute('role');
|
|
13
|
+
}
|
|
14
|
+
async getAriaLive() {
|
|
15
|
+
return (await this._snackBarLiveRegion()).getAttribute('aria-live');
|
|
16
|
+
}
|
|
17
|
+
async hasAction() {
|
|
18
|
+
return (await this._getActionButton()) !== null;
|
|
19
|
+
}
|
|
20
|
+
async getActionDescription() {
|
|
21
|
+
await this._assertHasAction();
|
|
22
|
+
return (await this._getActionButton()).text();
|
|
23
|
+
}
|
|
24
|
+
async dismissWithAction() {
|
|
25
|
+
await this._assertHasAction();
|
|
26
|
+
await (await this._getActionButton()).click();
|
|
27
|
+
}
|
|
28
|
+
async getMessage() {
|
|
29
|
+
return (await this.locatorFor(this._messageSelector)()).text();
|
|
30
|
+
}
|
|
31
|
+
async isDismissed() {
|
|
32
|
+
const host = await this.host();
|
|
33
|
+
const [exit, dimensions] = await parallel(() => [host.getAttribute('mat-exit'), host.getDimensions()]);
|
|
34
|
+
return exit != null || !!dimensions && dimensions.height === 0 && dimensions.width === 0;
|
|
35
|
+
}
|
|
36
|
+
async _assertHasAction() {
|
|
37
|
+
if (!(await this.hasAction())) {
|
|
38
|
+
throw Error('Method cannot be used for a snack-bar without an action.');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async _getActionButton() {
|
|
42
|
+
return this.locatorForOptional(this._actionButtonSelector)();
|
|
43
|
+
}
|
|
91
44
|
}
|
|
92
45
|
|
|
93
46
|
export { MatSnackBarHarness };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snack-bar-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/snack-bar/testing/snack-bar-harness.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.dev/license\n */\n\nimport {ContentContainerComponentHarness, HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {AriaLivePoliteness} from '@angular/cdk/a11y';\nimport {SnackBarHarnessFilters} from './snack-bar-harness-filters';\n\n/** Harness for interacting with a mat-snack-bar in tests. */\nexport class MatSnackBarHarness extends ContentContainerComponentHarness<string> {\n // Developers can provide a custom component or template for the\n // snackbar. The canonical snack-bar parent is the \"MatSnackBarContainer\".\n /** The selector for the host element of a `MatSnackBar` instance. */\n static hostSelector = '.mat-mdc-snack-bar-container:not([mat-exit])';\n private _messageSelector = '.mdc-snackbar__label';\n private _actionButtonSelector = '.mat-mdc-snack-bar-action';\n\n private _snackBarLiveRegion = this.locatorFor('[aria-live]');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatSnackBarHarness` that meets\n * certain criteria.\n * @param options Options for filtering which snack bar instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: SnackBarHarnessFilters = {}): HarnessPredicate<MatSnackBarHarness> {\n return new HarnessPredicate(MatSnackBarHarness, options);\n }\n\n /**\n * Gets the role of the snack-bar. The role of a snack-bar is determined based\n * on the ARIA politeness specified in the snack-bar config.\n * @deprecated Use `getAriaLive` instead.\n * @breaking-change 13.0.0\n */\n async getRole(): Promise<'alert' | 'status' | null> {\n return (await this.host()).getAttribute('role') as Promise<'alert' | 'status' | null>;\n }\n\n /**\n * Gets the aria-live of the snack-bar's live region. The aria-live of a snack-bar is\n * determined based on the ARIA politeness specified in the snack-bar config.\n */\n async getAriaLive(): Promise<AriaLivePoliteness> {\n return (await this._snackBarLiveRegion()).getAttribute(\n 'aria-live',\n ) as Promise<AriaLivePoliteness>;\n }\n\n /**\n * Whether the snack-bar has an action. Method cannot be used for snack-bar's with custom content.\n */\n async hasAction(): Promise<boolean> {\n return (await this._getActionButton()) !== null;\n }\n\n /**\n * Gets the description of the snack-bar. Method cannot be used for snack-bar's without action or\n * with custom content.\n */\n async getActionDescription(): Promise<string> {\n await this._assertHasAction();\n return (await this._getActionButton())!.text();\n }\n\n /**\n * Dismisses the snack-bar by clicking the action button. Method cannot be used for snack-bar's\n * without action or with custom content.\n */\n async dismissWithAction(): Promise<void> {\n await this._assertHasAction();\n await (await this._getActionButton())!.click();\n }\n\n /**\n * Gets the message of the snack-bar. Method cannot be used for snack-bar's with custom content.\n */\n async getMessage(): Promise<string> {\n return (await this.locatorFor(this._messageSelector)()).text();\n }\n\n /** Gets whether the snack-bar has been dismissed. */\n async isDismissed(): Promise<boolean> {\n // We consider the snackbar dismissed if it's not in the DOM. We can assert that the\n // element isn't in the DOM by seeing that its width and height are zero.\n\n const host = await this.host();\n const [exit, dimensions] = await parallel(() => [\n // The snackbar container is marked with the \"exit\" attribute after it has been dismissed\n // but before the animation has finished (after which it's removed from the DOM).\n host.getAttribute('mat-exit'),\n host.getDimensions(),\n ]);\n\n return exit != null || (!!dimensions && dimensions.height === 0 && dimensions.width === 0);\n }\n\n /**\n * Asserts that the current snack-bar has an action defined. Otherwise the\n * promise will reject.\n */\n private async _assertHasAction(): Promise<void> {\n if (!(await this.hasAction())) {\n throw Error('Method cannot be used for a snack-bar without an action.');\n }\n }\n\n /** Gets the simple snack bar action button. */\n private async _getActionButton() {\n return this.locatorForOptional(this._actionButtonSelector)();\n }\n}\n"],"names":[
|
|
1
|
+
{"version":3,"file":"snack-bar-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/snack-bar/testing/snack-bar-harness.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.dev/license\n */\n\nimport {ContentContainerComponentHarness, HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {AriaLivePoliteness} from '@angular/cdk/a11y';\nimport {SnackBarHarnessFilters} from './snack-bar-harness-filters';\n\n/** Harness for interacting with a mat-snack-bar in tests. */\nexport class MatSnackBarHarness extends ContentContainerComponentHarness<string> {\n // Developers can provide a custom component or template for the\n // snackbar. The canonical snack-bar parent is the \"MatSnackBarContainer\".\n /** The selector for the host element of a `MatSnackBar` instance. */\n static hostSelector = '.mat-mdc-snack-bar-container:not([mat-exit])';\n private _messageSelector = '.mdc-snackbar__label';\n private _actionButtonSelector = '.mat-mdc-snack-bar-action';\n\n private _snackBarLiveRegion = this.locatorFor('[aria-live]');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatSnackBarHarness` that meets\n * certain criteria.\n * @param options Options for filtering which snack bar instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: SnackBarHarnessFilters = {}): HarnessPredicate<MatSnackBarHarness> {\n return new HarnessPredicate(MatSnackBarHarness, options);\n }\n\n /**\n * Gets the role of the snack-bar. The role of a snack-bar is determined based\n * on the ARIA politeness specified in the snack-bar config.\n * @deprecated Use `getAriaLive` instead.\n * @breaking-change 13.0.0\n */\n async getRole(): Promise<'alert' | 'status' | null> {\n return (await this.host()).getAttribute('role') as Promise<'alert' | 'status' | null>;\n }\n\n /**\n * Gets the aria-live of the snack-bar's live region. The aria-live of a snack-bar is\n * determined based on the ARIA politeness specified in the snack-bar config.\n */\n async getAriaLive(): Promise<AriaLivePoliteness> {\n return (await this._snackBarLiveRegion()).getAttribute(\n 'aria-live',\n ) as Promise<AriaLivePoliteness>;\n }\n\n /**\n * Whether the snack-bar has an action. Method cannot be used for snack-bar's with custom content.\n */\n async hasAction(): Promise<boolean> {\n return (await this._getActionButton()) !== null;\n }\n\n /**\n * Gets the description of the snack-bar. Method cannot be used for snack-bar's without action or\n * with custom content.\n */\n async getActionDescription(): Promise<string> {\n await this._assertHasAction();\n return (await this._getActionButton())!.text();\n }\n\n /**\n * Dismisses the snack-bar by clicking the action button. Method cannot be used for snack-bar's\n * without action or with custom content.\n */\n async dismissWithAction(): Promise<void> {\n await this._assertHasAction();\n await (await this._getActionButton())!.click();\n }\n\n /**\n * Gets the message of the snack-bar. Method cannot be used for snack-bar's with custom content.\n */\n async getMessage(): Promise<string> {\n return (await this.locatorFor(this._messageSelector)()).text();\n }\n\n /** Gets whether the snack-bar has been dismissed. */\n async isDismissed(): Promise<boolean> {\n // We consider the snackbar dismissed if it's not in the DOM. We can assert that the\n // element isn't in the DOM by seeing that its width and height are zero.\n\n const host = await this.host();\n const [exit, dimensions] = await parallel(() => [\n // The snackbar container is marked with the \"exit\" attribute after it has been dismissed\n // but before the animation has finished (after which it's removed from the DOM).\n host.getAttribute('mat-exit'),\n host.getDimensions(),\n ]);\n\n return exit != null || (!!dimensions && dimensions.height === 0 && dimensions.width === 0);\n }\n\n /**\n * Asserts that the current snack-bar has an action defined. Otherwise the\n * promise will reject.\n */\n private async _assertHasAction(): Promise<void> {\n if (!(await this.hasAction())) {\n throw Error('Method cannot be used for a snack-bar without an action.');\n }\n }\n\n /** Gets the simple snack bar action button. */\n private async _getActionButton() {\n return this.locatorForOptional(this._actionButtonSelector)();\n }\n}\n"],"names":["hostSelector","getRole","host","getAttribute","getAriaLive","_snackBarLiveRegion","hasAction","_getActionButton","getActionDescription","_assertHasAction","dismissWithAction","click","getMessage","locatorFor","_messageSelector","text","exit","dimensions","parallel"],"mappings":";;;AAiBE,EAAA,OAAAA,YAAA,GAAA,8CAAA;kBAE6B;;;;;;AA2B1B,EAAA,MAAAC,OAAA,GAAA;IAED,OAAAC,CAAAA,MAAAA,IAAAA,CAAAA,IAAA,IAAAC,YAAA,CAAA,MAAA,CAAA;;QASAC,WAAOA,GAAA;IACT,OAAA,CAAA,MAAA,IAAA,CAAAC,mBAAA,EAAA,EAAAF,YAAA,CAAA,WAAA,CAAA;AAEA;QAKEG,SAAA,GAAA;WACA,CAAA,MAAc,KAAAC,gBAAA,EAAA,MAAA,IAAA;;QAUhBC,oBAAAA,GAAA;AAEA,IAAA,MAAA,IAAA,CAAAC,gBAAA,EAAA;;AAGA;yBAMsFC,GAAA;cACX,CAAAD,gBAAA,EAAA;IAEzE,MAAAF,CAAAA,MAAAA,IAAAA,CAAAA,gBAAA,IAAAI,KAAA,EAAA;;AAMC,EAAA,MAAAC,UAAA,GAAA;WAEM,OAAA,IAAAC,CAAAA,UAAkB,CAAC,IAAAC,CAAAA,gBAAA,KAAAC,IAAA,EAAA;;;UAQ1Bb,IAAA,GAAY,MAAA,IAAA,CAAAA,IAAA,EAAA;AACV,IAAA,MAAA,CAAAc,IAAA,EAAAC,UAAW,CAAA,GAAA,MAA2DC,QAAA,CAAA,MAAA,CAKlEhB,IAAA,CAAAC,YAAsB,CAAA,UAAA,CAAA,sBAE9B,CAAA,CAAA;;;;;;;;;;;;;;;"}
|