@angular/material 19.0.0-next.9 → 19.0.0-rc.1
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-theme.scss +8 -4
- package/autocomplete/index.d.ts +5 -6
- package/badge/_badge-theme.scss +10 -6
- package/badge/index.d.ts +1 -2
- package/bottom-sheet/_bottom-sheet-theme.scss +8 -4
- package/button/_button-theme.scss +10 -6
- package/button/_fab-theme.scss +10 -6
- package/button/_icon-button-theme.scss +8 -4
- package/button/index.d.ts +1 -1
- package/button-toggle/_button-toggle-theme.scss +11 -6
- package/button-toggle/index.d.ts +2 -1
- package/card/_card-theme.scss +8 -4
- package/card/index.d.ts +2 -3
- package/checkbox/_checkbox-theme.scss +10 -6
- package/chips/_chips-theme.scss +10 -6
- package/core/_core-theme.scss +4 -7
- package/core/_core.scss +2 -5
- package/core/m2/_theming.scss +2 -1
- package/core/option/_optgroup-theme.scss +8 -4
- package/core/option/_option-theme.scss +10 -6
- package/core/ripple/_ripple-theme.scss +8 -4
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +10 -6
- package/core/theming/_config-validation.scss +4 -4
- package/core/theming/_definition.scss +12 -2
- package/core/theming/_theming.scss +2 -1
- package/core/tokens/_m3-system.scss +55 -39
- package/core/tokens/_m3-tokens.scss +3 -3
- package/core/tokens/_token-definition.scss +4 -3
- package/core/tokens/m2/mat/_badge.scss +1 -1
- package/core/tokens/m2/mat/_datepicker.scss +1 -1
- package/core/tokens/m2/mat/_menu.scss +5 -3
- package/core/tokens/m2/mat/_sort.scss +1 -1
- package/core/tokens/m3/mat/_menu.scss +6 -3
- package/core/tokens/m3/mdc/_filled-text-field.scss +9 -11
- package/datepicker/_datepicker-theme.scss +10 -6
- package/datepicker/index.d.ts +36 -37
- package/dialog/_dialog-theme.scss +8 -4
- package/dialog/index.d.ts +1 -0
- package/divider/_divider-theme.scss +8 -4
- package/expansion/_expansion-theme.scss +8 -4
- package/fesm2022/autocomplete/testing.mjs +2 -5
- package/fesm2022/autocomplete/testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs +225 -151
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge/testing.mjs +2 -5
- package/fesm2022/badge/testing.mjs.map +1 -1
- package/fesm2022/badge.mjs +45 -36
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet/testing.mjs +1 -1
- package/fesm2022/bottom-sheet/testing.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +79 -57
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button/testing.mjs +2 -2
- package/fesm2022/button/testing.mjs.map +1 -1
- package/fesm2022/button-toggle/testing.mjs +4 -7
- package/fesm2022/button-toggle/testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +84 -47
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +98 -71
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card/testing.mjs +3 -6
- package/fesm2022/card/testing.mjs.map +1 -1
- package/fesm2022/card.mjs +53 -55
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox/testing.mjs +4 -7
- package/fesm2022/checkbox/testing.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +105 -63
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips/testing.mjs +11 -14
- package/fesm2022/chips/testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +317 -268
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core/testing.mjs +5 -11
- package/fesm2022/core/testing.mjs.map +1 -1
- package/fesm2022/core.mjs +237 -187
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker/testing.mjs +13 -22
- package/fesm2022/datepicker/testing.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +821 -568
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog/testing.mjs +15 -9
- package/fesm2022/dialog/testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs +221 -153
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider/testing.mjs +1 -1
- package/fesm2022/divider/testing.mjs.map +1 -1
- package/fesm2022/divider.mjs +9 -11
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion/testing.mjs +7 -10
- package/fesm2022/expansion/testing.mjs.map +1 -1
- package/fesm2022/expansion.mjs +85 -76
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field/testing.mjs +12 -15
- package/fesm2022/form-field/testing.mjs.map +1 -1
- package/fesm2022/form-field.mjs +179 -126
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list/testing.mjs +11 -17
- package/fesm2022/grid-list/testing.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +72 -50
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon/testing.mjs +8 -8
- package/fesm2022/icon/testing.mjs.map +1 -1
- package/fesm2022/icon.mjs +65 -45
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/input/testing.mjs +3 -3
- package/fesm2022/input/testing.mjs.map +1 -1
- package/fesm2022/input.mjs +104 -72
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list/testing.mjs +21 -38
- package/fesm2022/list/testing.mjs.map +1 -1
- package/fesm2022/list.mjs +191 -180
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/menu/testing.mjs +3 -6
- package/fesm2022/menu/testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +178 -168
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator/testing.mjs +10 -13
- package/fesm2022/paginator/testing.mjs.map +1 -1
- package/fesm2022/paginator.mjs +84 -59
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar/testing.mjs +1 -1
- package/fesm2022/progress-bar/testing.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +35 -34
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner/testing.mjs +1 -1
- package/fesm2022/progress-spinner/testing.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +27 -13
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio/testing.mjs +6 -12
- package/fesm2022/radio/testing.mjs.map +1 -1
- package/fesm2022/radio.mjs +123 -88
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select/testing.mjs +6 -9
- package/fesm2022/select/testing.mjs.map +1 -1
- package/fesm2022/select.mjs +220 -182
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav/testing.mjs +6 -6
- package/fesm2022/sidenav/testing.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +132 -119
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle/testing.mjs +3 -6
- package/fesm2022/slide-toggle/testing.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +78 -49
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider/testing.mjs +2 -2
- package/fesm2022/slider/testing.mjs.map +1 -1
- package/fesm2022/slider.mjs +260 -190
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar/testing.mjs +4 -7
- package/fesm2022/snack-bar/testing.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +141 -107
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort/testing.mjs +3 -6
- package/fesm2022/sort/testing.mjs.map +1 -1
- package/fesm2022/sort.mjs +93 -72
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper/testing.mjs +4 -4
- package/fesm2022/stepper/testing.mjs.map +1 -1
- package/fesm2022/stepper.mjs +143 -105
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table/testing.mjs +13 -25
- package/fesm2022/table/testing.mjs.map +1 -1
- package/fesm2022/table.mjs +182 -177
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs/testing.mjs +5 -5
- package/fesm2022/tabs/testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +326 -247
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker/testing.mjs +7 -16
- package/fesm2022/timepicker/testing.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +157 -153
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar/testing.mjs +2 -5
- package/fesm2022/toolbar/testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +25 -15
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip/testing.mjs +6 -9
- package/fesm2022/tooltip/testing.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +96 -72
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree/testing.mjs +3 -6
- package/fesm2022/tree/testing.mjs.map +1 -1
- package/fesm2022/tree.mjs +56 -54
- package/fesm2022/tree.mjs.map +1 -1
- package/form-field/_form-field-theme.scss +9 -5
- package/form-field/index.d.ts +9 -9
- package/grid-list/_grid-list-theme.scss +8 -4
- package/icon/_icon-theme.scss +10 -6
- package/input/_input-theme.scss +8 -4
- package/list/_list-theme.scss +8 -4
- package/list/index.d.ts +20 -21
- package/menu/_menu-theme.scss +8 -4
- package/menu/index.d.ts +15 -17
- package/package.json +2 -2
- package/paginator/_paginator-theme.scss +8 -4
- package/prebuilt-themes/azure-blue.css +1 -1
- package/prebuilt-themes/cyan-orange.css +1 -1
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/magenta-violet.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/prebuilt-themes/rose-red.css +1 -1
- package/progress-bar/_progress-bar-theme.scss +11 -9
- package/progress-spinner/_progress-spinner-theme.scss +11 -9
- package/progress-spinner/index.d.ts +3 -4
- package/radio/_radio-theme.scss +10 -6
- package/radio/index.d.ts +2 -3
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-add/theming/create-custom-theme.js +1 -6
- package/schematics/ng-add/theming/create-custom-theme.mjs +1 -6
- package/schematics/ng-generate/theme-color/index_bundled.js +35 -9
- package/schematics/ng-generate/theme-color/index_bundled.js.map +2 -2
- package/schematics/ng-update/index_bundled.js +6 -1
- package/schematics/ng-update/index_bundled.js.map +1 -1
- package/select/_select-theme.scss +10 -6
- package/select/index.d.ts +7 -7
- package/sidenav/_sidenav-theme.scss +8 -4
- package/slide-toggle/_slide-toggle-theme.scss +10 -6
- package/slider/_slider-theme.scss +10 -6
- package/snack-bar/_snack-bar-theme.scss +10 -6
- package/sort/_sort-theme.scss +8 -4
- package/stepper/_stepper-theme.scss +10 -6
- package/stepper/index.d.ts +14 -15
- package/table/_table-theme.scss +8 -4
- package/tabs/_tabs-theme.scss +10 -6
- package/timepicker/_timepicker-theme.scss +10 -6
- package/toolbar/_toolbar-theme.scss +10 -6
- package/tooltip/_tooltip-theme.scss +8 -4
- package/tooltip/index.d.ts +5 -6
- package/tree/_tree-theme.scss +8 -4
|
@@ -2,16 +2,13 @@ import { ContentContainerComponentHarness, HarnessPredicate, parallel } from '@a
|
|
|
2
2
|
|
|
3
3
|
/** Harness for interacting with a mat-snack-bar in tests. */
|
|
4
4
|
class MatSnackBarHarness extends ContentContainerComponentHarness {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this._messageSelector = '.mdc-snackbar__label';
|
|
8
|
-
this._actionButtonSelector = '.mat-mdc-snack-bar-action';
|
|
9
|
-
this._snackBarLiveRegion = this.locatorFor('[aria-live]');
|
|
10
|
-
}
|
|
11
5
|
// Developers can provide a custom component or template for the
|
|
12
6
|
// snackbar. The canonical snack-bar parent is the "MatSnackBarContainer".
|
|
13
7
|
/** The selector for the host element of a `MatSnackBar` instance. */
|
|
14
|
-
static
|
|
8
|
+
static hostSelector = '.mat-mdc-snack-bar-container:not([mat-exit])';
|
|
9
|
+
_messageSelector = '.mdc-snackbar__label';
|
|
10
|
+
_actionButtonSelector = '.mat-mdc-snack-bar-action';
|
|
11
|
+
_snackBarLiveRegion = this.locatorFor('[aria-live]');
|
|
15
12
|
/**
|
|
16
13
|
* Gets a `HarnessPredicate` that can be used to search for a `MatSnackBarHarness` that meets
|
|
17
14
|
* certain criteria.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.mjs","sources":["../../../../../../../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":[],"mappings":";;AAYA;AACM,MAAO,kBAAmB,SAAQ,gCAAwC,CAAA
|
|
1
|
+
{"version":3,"file":"testing.mjs","sources":["../../../../../../../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":[],"mappings":";;AAYA;AACM,MAAO,kBAAmB,SAAQ,gCAAwC,CAAA;;;;AAI9E,IAAA,OAAO,YAAY,GAAG,8CAA8C,CAAC;IAC7D,gBAAgB,GAAG,sBAAsB,CAAC;IAC1C,qBAAqB,GAAG,2BAA2B,CAAC;AAEpD,IAAA,mBAAmB,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAE7D;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CAAC,OAAA,GAAkC,EAAE,EAAA;AAC9C,QAAA,OAAO,IAAI,gBAAgB,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;KAC1D;AAED;;;;;AAKG;AACH,IAAA,MAAM,OAAO,GAAA;AACX,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,MAAM,CAAuC,CAAC;KACvF;AAED;;;AAGG;AACH,IAAA,MAAM,WAAW,GAAA;AACf,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,mBAAmB,EAAE,EAAE,YAAY,CACpD,WAAW,CACmB,CAAC;KAClC;AAED;;AAEG;AACH,IAAA,MAAM,SAAS,GAAA;QACb,OAAO,CAAC,MAAM,IAAI,CAAC,gBAAgB,EAAE,MAAM,IAAI,CAAC;KACjD;AAED;;;AAGG;AACH,IAAA,MAAM,oBAAoB,GAAA;AACxB,QAAA,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC9B,OAAO,CAAC,MAAM,IAAI,CAAC,gBAAgB,EAAE,EAAG,IAAI,EAAE,CAAC;KAChD;AAED;;;AAGG;AACH,IAAA,MAAM,iBAAiB,GAAA;AACrB,QAAA,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC9B,MAAM,CAAC,MAAM,IAAI,CAAC,gBAAgB,EAAE,EAAG,KAAK,EAAE,CAAC;KAChD;AAED;;AAEG;AACH,IAAA,MAAM,UAAU,GAAA;AACd,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC;KAChE;;AAGD,IAAA,MAAM,WAAW,GAAA;;;AAIf,QAAA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAC/B,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,GAAG,MAAM,QAAQ,CAAC,MAAM;;;AAG9C,YAAA,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;YAC7B,IAAI,CAAC,aAAa,EAAE;AACrB,SAAA,CAAC,CAAC;QAEH,OAAO,IAAI,IAAI,IAAI,KAAK,CAAC,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC;KAC5F;AAED;;;AAGG;AACK,IAAA,MAAM,gBAAgB,GAAA;QAC5B,IAAI,EAAE,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,EAAE;AAC7B,YAAA,MAAM,KAAK,CAAC,0DAA0D,CAAC,CAAC;SACzE;KACF;;AAGO,IAAA,MAAM,gBAAgB,GAAA;QAC5B,OAAO,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,qBAAqB,CAAC,EAAE,CAAC;KAC9D;;;;;"}
|
package/fesm2022/snack-bar.mjs
CHANGED
|
@@ -5,8 +5,8 @@ import { Subject } from 'rxjs';
|
|
|
5
5
|
import { DOCUMENT } from '@angular/common';
|
|
6
6
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
7
7
|
import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, TemplatePortal, PortalModule } from '@angular/cdk/portal';
|
|
8
|
+
import { _IdGenerator, LiveAnnouncer } from '@angular/cdk/a11y';
|
|
8
9
|
import { Platform } from '@angular/cdk/platform';
|
|
9
|
-
import { LiveAnnouncer } from '@angular/cdk/a11y';
|
|
10
10
|
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
|
11
11
|
import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
12
12
|
import { takeUntil } from 'rxjs/operators';
|
|
@@ -18,16 +18,29 @@ const MAX_TIMEOUT = Math.pow(2, 31) - 1;
|
|
|
18
18
|
* Reference to a snack bar dispatched from the snack bar service.
|
|
19
19
|
*/
|
|
20
20
|
class MatSnackBarRef {
|
|
21
|
+
_overlayRef;
|
|
22
|
+
/** The instance of the component making up the content of the snack bar. */
|
|
23
|
+
instance;
|
|
24
|
+
/**
|
|
25
|
+
* The instance of the component making up the content of the snack bar.
|
|
26
|
+
* @docs-private
|
|
27
|
+
*/
|
|
28
|
+
containerInstance;
|
|
29
|
+
/** Subject for notifying the user that the snack bar has been dismissed. */
|
|
30
|
+
_afterDismissed = new Subject();
|
|
31
|
+
/** Subject for notifying the user that the snack bar has opened and appeared. */
|
|
32
|
+
_afterOpened = new Subject();
|
|
33
|
+
/** Subject for notifying the user that the snack bar action was called. */
|
|
34
|
+
_onAction = new Subject();
|
|
35
|
+
/**
|
|
36
|
+
* Timeout ID for the duration setTimeout call. Used to clear the timeout if the snackbar is
|
|
37
|
+
* dismissed before the duration passes.
|
|
38
|
+
*/
|
|
39
|
+
_durationTimeoutId;
|
|
40
|
+
/** Whether the snack bar was dismissed using the action button. */
|
|
41
|
+
_dismissedByAction = false;
|
|
21
42
|
constructor(containerInstance, _overlayRef) {
|
|
22
43
|
this._overlayRef = _overlayRef;
|
|
23
|
-
/** Subject for notifying the user that the snack bar has been dismissed. */
|
|
24
|
-
this._afterDismissed = new Subject();
|
|
25
|
-
/** Subject for notifying the user that the snack bar has opened and appeared. */
|
|
26
|
-
this._afterOpened = new Subject();
|
|
27
|
-
/** Subject for notifying the user that the snack bar action was called. */
|
|
28
|
-
this._onAction = new Subject();
|
|
29
|
-
/** Whether the snack bar was dismissed using the action button. */
|
|
30
|
-
this._dismissedByAction = false;
|
|
31
44
|
this.containerInstance = containerInstance;
|
|
32
45
|
containerInstance._onExit.subscribe(() => this._finishDismiss());
|
|
33
46
|
}
|
|
@@ -99,31 +112,38 @@ const MAT_SNACK_BAR_DATA = new InjectionToken('MatSnackBarData');
|
|
|
99
112
|
* Configuration used when opening a snack-bar.
|
|
100
113
|
*/
|
|
101
114
|
class MatSnackBarConfig {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
/** The politeness level for the MatAriaLiveAnnouncer announcement. */
|
|
116
|
+
politeness = 'assertive';
|
|
117
|
+
/**
|
|
118
|
+
* Message to be announced by the LiveAnnouncer. When opening a snackbar without a custom
|
|
119
|
+
* component or template, the announcement message will default to the specified message.
|
|
120
|
+
*/
|
|
121
|
+
announcementMessage = '';
|
|
122
|
+
/**
|
|
123
|
+
* The view container that serves as the parent for the snackbar for the purposes of dependency
|
|
124
|
+
* injection. Note: this does not affect where the snackbar is inserted in the DOM.
|
|
125
|
+
*/
|
|
126
|
+
viewContainerRef;
|
|
127
|
+
/** The length of time in milliseconds to wait before automatically dismissing the snack bar. */
|
|
128
|
+
duration = 0;
|
|
129
|
+
/** Extra CSS classes to be added to the snack bar container. */
|
|
130
|
+
panelClass;
|
|
131
|
+
/** Text layout direction for the snack bar. */
|
|
132
|
+
direction;
|
|
133
|
+
/** Data being injected into the child component. */
|
|
134
|
+
data = null;
|
|
135
|
+
/** The horizontal position to place the snack bar. */
|
|
136
|
+
horizontalPosition = 'center';
|
|
137
|
+
/** The vertical position to place the snack bar. */
|
|
138
|
+
verticalPosition = 'bottom';
|
|
119
139
|
}
|
|
120
140
|
|
|
121
141
|
/** Directive that should be applied to the text element to be rendered in the snack bar. */
|
|
122
142
|
class MatSnackBarLabel {
|
|
123
|
-
static
|
|
124
|
-
static
|
|
143
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: MatSnackBarLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
144
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.0", type: MatSnackBarLabel, isStandalone: true, selector: "[matSnackBarLabel]", host: { classAttribute: "mat-mdc-snack-bar-label mdc-snackbar__label" }, ngImport: i0 });
|
|
125
145
|
}
|
|
126
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: MatSnackBarLabel, decorators: [{
|
|
127
147
|
type: Directive,
|
|
128
148
|
args: [{
|
|
129
149
|
selector: `[matSnackBarLabel]`,
|
|
@@ -134,10 +154,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
|
|
|
134
154
|
}] });
|
|
135
155
|
/** Directive that should be applied to the element containing the snack bar's action buttons. */
|
|
136
156
|
class MatSnackBarActions {
|
|
137
|
-
static
|
|
138
|
-
static
|
|
157
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: MatSnackBarActions, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
158
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.0", type: MatSnackBarActions, isStandalone: true, selector: "[matSnackBarActions]", host: { classAttribute: "mat-mdc-snack-bar-actions mdc-snackbar__actions" }, ngImport: i0 });
|
|
139
159
|
}
|
|
140
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
160
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: MatSnackBarActions, decorators: [{
|
|
141
161
|
type: Directive,
|
|
142
162
|
args: [{
|
|
143
163
|
selector: `[matSnackBarActions]`,
|
|
@@ -148,10 +168,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
|
|
|
148
168
|
}] });
|
|
149
169
|
/** Directive that should be applied to each of the snack bar's action buttons. */
|
|
150
170
|
class MatSnackBarAction {
|
|
151
|
-
static
|
|
152
|
-
static
|
|
171
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: MatSnackBarAction, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
172
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-rc.0", type: MatSnackBarAction, isStandalone: true, selector: "[matSnackBarAction]", host: { classAttribute: "mat-mdc-snack-bar-action mdc-snackbar__action" }, ngImport: i0 });
|
|
153
173
|
}
|
|
154
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
174
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: MatSnackBarAction, decorators: [{
|
|
155
175
|
type: Directive,
|
|
156
176
|
args: [{
|
|
157
177
|
selector: `[matSnackBarAction]`,
|
|
@@ -162,10 +182,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
|
|
|
162
182
|
}] });
|
|
163
183
|
|
|
164
184
|
class SimpleSnackBar {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
185
|
+
snackBarRef = inject(MatSnackBarRef);
|
|
186
|
+
data = inject(MAT_SNACK_BAR_DATA);
|
|
187
|
+
constructor() { }
|
|
169
188
|
/** Performs the action on the snack bar. */
|
|
170
189
|
action() {
|
|
171
190
|
this.snackBarRef.dismissWithAction();
|
|
@@ -174,10 +193,10 @@ class SimpleSnackBar {
|
|
|
174
193
|
get hasAction() {
|
|
175
194
|
return !!this.data.action;
|
|
176
195
|
}
|
|
177
|
-
static
|
|
178
|
-
static
|
|
196
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: SimpleSnackBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
197
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0-rc.0", type: SimpleSnackBar, isStandalone: true, selector: "simple-snack-bar", host: { classAttribute: "mat-mdc-simple-snack-bar" }, exportAs: ["matSnackBar"], ngImport: i0, template: "<div matSnackBarLabel>\n {{data.message}}\n</div>\n\n@if (hasAction) {\n <div matSnackBarActions>\n <button mat-button matSnackBarAction (click)=\"action()\">\n {{data.action}}\n </button>\n </div>\n}\n", styles: [".mat-mdc-simple-snack-bar{display:flex}"], dependencies: [{ kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: MatSnackBarLabel, selector: "[matSnackBarLabel]" }, { kind: "directive", type: MatSnackBarActions, selector: "[matSnackBarActions]" }, { kind: "directive", type: MatSnackBarAction, selector: "[matSnackBarAction]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
179
198
|
}
|
|
180
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
199
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: SimpleSnackBar, decorators: [{
|
|
181
200
|
type: Component,
|
|
182
201
|
args: [{ selector: 'simple-snack-bar', exportAs: 'matSnackBar', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButton, MatSnackBarLabel, MatSnackBarActions, MatSnackBarAction], host: {
|
|
183
202
|
'class': 'mat-mdc-simple-snack-bar',
|
|
@@ -206,46 +225,51 @@ const matSnackBarAnimations = {
|
|
|
206
225
|
]),
|
|
207
226
|
};
|
|
208
227
|
|
|
209
|
-
let uniqueId = 0;
|
|
210
228
|
/**
|
|
211
229
|
* Internal component that wraps user-provided snack bar content.
|
|
212
230
|
* @docs-private
|
|
213
231
|
*/
|
|
214
232
|
class MatSnackBarContainer extends BasePortalOutlet {
|
|
233
|
+
_ngZone = inject(NgZone);
|
|
234
|
+
_elementRef = inject(ElementRef);
|
|
235
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
236
|
+
_platform = inject(Platform);
|
|
237
|
+
snackBarConfig = inject(MatSnackBarConfig);
|
|
238
|
+
_document = inject(DOCUMENT);
|
|
239
|
+
_trackedModals = new Set();
|
|
240
|
+
/** The number of milliseconds to wait before announcing the snack bar's content. */
|
|
241
|
+
_announceDelay = 150;
|
|
242
|
+
/** The timeout for announcing the snack bar's content. */
|
|
243
|
+
_announceTimeoutId;
|
|
244
|
+
/** Whether the component has been destroyed. */
|
|
245
|
+
_destroyed = false;
|
|
246
|
+
/** The portal outlet inside of this container into which the snack bar content will be loaded. */
|
|
247
|
+
_portalOutlet;
|
|
248
|
+
/** Subject for notifying that the snack bar has announced to screen readers. */
|
|
249
|
+
_onAnnounce = new Subject();
|
|
250
|
+
/** Subject for notifying that the snack bar has exited from view. */
|
|
251
|
+
_onExit = new Subject();
|
|
252
|
+
/** Subject for notifying that the snack bar has finished entering the view. */
|
|
253
|
+
_onEnter = new Subject();
|
|
254
|
+
/** The state of the snack bar animations. */
|
|
255
|
+
_animationState = 'void';
|
|
256
|
+
/** aria-live value for the live region. */
|
|
257
|
+
_live;
|
|
258
|
+
/**
|
|
259
|
+
* Element that will have the `mdc-snackbar__label` class applied if the attached component
|
|
260
|
+
* or template does not have it. This ensures that the appropriate structure, typography, and
|
|
261
|
+
* color is applied to the attached view.
|
|
262
|
+
*/
|
|
263
|
+
_label;
|
|
264
|
+
/**
|
|
265
|
+
* Role of the live region. This is only for Firefox as there is a known issue where Firefox +
|
|
266
|
+
* JAWS does not read out aria-live message.
|
|
267
|
+
*/
|
|
268
|
+
_role;
|
|
269
|
+
/** Unique ID of the aria-live element. */
|
|
270
|
+
_liveElementId = inject(_IdGenerator).getId('mat-snack-bar-container-live-');
|
|
215
271
|
constructor() {
|
|
216
272
|
super();
|
|
217
|
-
this._ngZone = inject(NgZone);
|
|
218
|
-
this._elementRef = inject(ElementRef);
|
|
219
|
-
this._changeDetectorRef = inject(ChangeDetectorRef);
|
|
220
|
-
this._platform = inject(Platform);
|
|
221
|
-
this.snackBarConfig = inject(MatSnackBarConfig);
|
|
222
|
-
this._document = inject(DOCUMENT);
|
|
223
|
-
this._trackedModals = new Set();
|
|
224
|
-
/** The number of milliseconds to wait before announcing the snack bar's content. */
|
|
225
|
-
this._announceDelay = 150;
|
|
226
|
-
/** Whether the component has been destroyed. */
|
|
227
|
-
this._destroyed = false;
|
|
228
|
-
/** Subject for notifying that the snack bar has announced to screen readers. */
|
|
229
|
-
this._onAnnounce = new Subject();
|
|
230
|
-
/** Subject for notifying that the snack bar has exited from view. */
|
|
231
|
-
this._onExit = new Subject();
|
|
232
|
-
/** Subject for notifying that the snack bar has finished entering the view. */
|
|
233
|
-
this._onEnter = new Subject();
|
|
234
|
-
/** The state of the snack bar animations. */
|
|
235
|
-
this._animationState = 'void';
|
|
236
|
-
/** Unique ID of the aria-live element. */
|
|
237
|
-
this._liveElementId = `mat-snack-bar-container-live-${uniqueId++}`;
|
|
238
|
-
/**
|
|
239
|
-
* Attaches a DOM portal to the snack bar container.
|
|
240
|
-
* @deprecated To be turned into a method.
|
|
241
|
-
* @breaking-change 10.0.0
|
|
242
|
-
*/
|
|
243
|
-
this.attachDomPortal = (portal) => {
|
|
244
|
-
this._assertNotAttached();
|
|
245
|
-
const result = this._portalOutlet.attachDomPortal(portal);
|
|
246
|
-
this._afterPortalAttached();
|
|
247
|
-
return result;
|
|
248
|
-
};
|
|
249
273
|
const config = this.snackBarConfig;
|
|
250
274
|
// Use aria-live rather than a live role like 'alert' or 'status'
|
|
251
275
|
// because NVDA and JAWS have show inconsistent behavior with live roles.
|
|
@@ -283,6 +307,17 @@ class MatSnackBarContainer extends BasePortalOutlet {
|
|
|
283
307
|
this._afterPortalAttached();
|
|
284
308
|
return result;
|
|
285
309
|
}
|
|
310
|
+
/**
|
|
311
|
+
* Attaches a DOM portal to the snack bar container.
|
|
312
|
+
* @deprecated To be turned into a method.
|
|
313
|
+
* @breaking-change 10.0.0
|
|
314
|
+
*/
|
|
315
|
+
attachDomPortal = (portal) => {
|
|
316
|
+
this._assertNotAttached();
|
|
317
|
+
const result = this._portalOutlet.attachDomPortal(portal);
|
|
318
|
+
this._afterPortalAttached();
|
|
319
|
+
return result;
|
|
320
|
+
};
|
|
286
321
|
/** Handle end of animations, updating the state of the snackbar. */
|
|
287
322
|
onAnimationEnd(event) {
|
|
288
323
|
const { fromState, toState } = event;
|
|
@@ -447,10 +482,10 @@ class MatSnackBarContainer extends BasePortalOutlet {
|
|
|
447
482
|
});
|
|
448
483
|
}
|
|
449
484
|
}
|
|
450
|
-
static
|
|
451
|
-
static
|
|
485
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: MatSnackBarContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
486
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0-rc.0", type: MatSnackBarContainer, isStandalone: true, selector: "mat-snack-bar-container", host: { listeners: { "@state.done": "onAnimationEnd($event)" }, properties: { "@state": "_animationState" }, classAttribute: "mdc-snackbar mat-mdc-snack-bar-container" }, viewQueries: [{ propertyName: "_portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }, { propertyName: "_label", first: true, predicate: ["label"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"mdc-snackbar__surface mat-mdc-snackbar-surface\">\n <!--\n This outer label wrapper will have the class `mdc-snackbar__label` applied if\n the attached template/component does not contain it.\n -->\n <div class=\"mat-mdc-snack-bar-label\" #label>\n <!-- Initialy holds the snack bar content, will be empty after announcing to screen readers. -->\n <div aria-hidden=\"true\">\n <ng-template cdkPortalOutlet />\n </div>\n\n <!-- Will receive the snack bar content from the non-live div, move will happen a short delay after opening -->\n <div [attr.aria-live]=\"_live\" [attr.role]=\"_role\" [attr.id]=\"_liveElementId\"></div>\n </div>\n</div>\n", styles: [".mat-mdc-snack-bar-container{display:flex;align-items:center;justify-content:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);margin:8px}.mat-mdc-snack-bar-handset .mat-mdc-snack-bar-container{width:100vw}.mat-mdc-snackbar-surface{box-shadow:0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding-left:0;padding-right:8px}[dir=rtl] .mat-mdc-snackbar-surface{padding-right:0;padding-left:8px}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{min-width:344px;max-width:672px}.mat-mdc-snack-bar-handset .mat-mdc-snackbar-surface{width:100%;min-width:0}@media(forced-colors: active){.mat-mdc-snackbar-surface{outline:solid 1px}}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{color:var(--mdc-snackbar-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mdc-snackbar-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mdc-snackbar-container-color, var(--mat-sys-inverse-surface))}.mdc-snackbar__label{width:100%;flex-grow:1;box-sizing:border-box;margin:0;padding:14px 8px 14px 16px}[dir=rtl] .mdc-snackbar__label{padding-left:8px;padding-right:16px}.mat-mdc-snack-bar-container .mdc-snackbar__label{font-family:var(--mdc-snackbar-supporting-text-font, var(--mat-sys-body-medium-font));font-size:var(--mdc-snackbar-supporting-text-size, var(--mat-sys-body-medium-size));font-weight:var(--mdc-snackbar-supporting-text-weight, var(--mat-sys-body-medium-weight));line-height:var(--mdc-snackbar-supporting-text-line-height, var(--mat-sys-body-medium-line-height))}.mat-mdc-snack-bar-actions{display:flex;flex-shrink:0;align-items:center;box-sizing:border-box}.mat-mdc-snack-bar-handset,.mat-mdc-snack-bar-container,.mat-mdc-snack-bar-label{flex:1 1 auto}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled){color:var(--mat-snack-bar-button-color, var(--mat-sys-inverse-primary))}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled){--mat-text-button-state-layer-color:currentColor;--mat-text-button-ripple-color:currentColor}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled) .mat-ripple-element{opacity:.1}"], dependencies: [{ kind: "directive", type: CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], animations: [matSnackBarAnimations.snackBarState], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
|
|
452
487
|
}
|
|
453
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
488
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: MatSnackBarContainer, decorators: [{
|
|
454
489
|
type: Component,
|
|
455
490
|
args: [{ selector: 'mat-snack-bar-container', changeDetection: ChangeDetectionStrategy.Default, encapsulation: ViewEncapsulation.None, animations: [matSnackBarAnimations.snackBarState], imports: [CdkPortalOutlet], host: {
|
|
456
491
|
'class': 'mdc-snackbar mat-mdc-snack-bar-container',
|
|
@@ -478,6 +513,24 @@ const MAT_SNACK_BAR_DEFAULT_OPTIONS = new InjectionToken('mat-snack-bar-default-
|
|
|
478
513
|
* Service to dispatch Material Design snack bar messages.
|
|
479
514
|
*/
|
|
480
515
|
class MatSnackBar {
|
|
516
|
+
_overlay = inject(Overlay);
|
|
517
|
+
_live = inject(LiveAnnouncer);
|
|
518
|
+
_injector = inject(Injector);
|
|
519
|
+
_breakpointObserver = inject(BreakpointObserver);
|
|
520
|
+
_parentSnackBar = inject(MatSnackBar, { optional: true, skipSelf: true });
|
|
521
|
+
_defaultConfig = inject(MAT_SNACK_BAR_DEFAULT_OPTIONS);
|
|
522
|
+
/**
|
|
523
|
+
* Reference to the current snack bar in the view *at this level* (in the Angular injector tree).
|
|
524
|
+
* If there is a parent snack-bar service, all operations should delegate to that parent
|
|
525
|
+
* via `_openedSnackBarRef`.
|
|
526
|
+
*/
|
|
527
|
+
_snackBarRefAtThisLevel = null;
|
|
528
|
+
/** The component that should be rendered as the snack bar's simple component. */
|
|
529
|
+
simpleSnackBarComponent = SimpleSnackBar;
|
|
530
|
+
/** The container component that attaches the provided template or component. */
|
|
531
|
+
snackBarContainerComponent = MatSnackBarContainer;
|
|
532
|
+
/** The CSS class to apply for handset mode. */
|
|
533
|
+
handsetCssClass = 'mat-mdc-snack-bar-handset';
|
|
481
534
|
/** Reference to the currently opened snackbar at *any* level. */
|
|
482
535
|
get _openedSnackBarRef() {
|
|
483
536
|
const parent = this._parentSnackBar;
|
|
@@ -491,26 +544,7 @@ class MatSnackBar {
|
|
|
491
544
|
this._snackBarRefAtThisLevel = value;
|
|
492
545
|
}
|
|
493
546
|
}
|
|
494
|
-
constructor() {
|
|
495
|
-
this._overlay = inject(Overlay);
|
|
496
|
-
this._live = inject(LiveAnnouncer);
|
|
497
|
-
this._injector = inject(Injector);
|
|
498
|
-
this._breakpointObserver = inject(BreakpointObserver);
|
|
499
|
-
this._parentSnackBar = inject(MatSnackBar, { optional: true, skipSelf: true });
|
|
500
|
-
this._defaultConfig = inject(MAT_SNACK_BAR_DEFAULT_OPTIONS);
|
|
501
|
-
/**
|
|
502
|
-
* Reference to the current snack bar in the view *at this level* (in the Angular injector tree).
|
|
503
|
-
* If there is a parent snack-bar service, all operations should delegate to that parent
|
|
504
|
-
* via `_openedSnackBarRef`.
|
|
505
|
-
*/
|
|
506
|
-
this._snackBarRefAtThisLevel = null;
|
|
507
|
-
/** The component that should be rendered as the snack bar's simple component. */
|
|
508
|
-
this.simpleSnackBarComponent = SimpleSnackBar;
|
|
509
|
-
/** The container component that attaches the provided template or component. */
|
|
510
|
-
this.snackBarContainerComponent = MatSnackBarContainer;
|
|
511
|
-
/** The CSS class to apply for handset mode. */
|
|
512
|
-
this.handsetCssClass = 'mat-mdc-snack-bar-handset';
|
|
513
|
-
}
|
|
547
|
+
constructor() { }
|
|
514
548
|
/**
|
|
515
549
|
* Creates and dispatches a snack bar with a custom component for the content, removing any
|
|
516
550
|
* currently opened snack bars.
|
|
@@ -695,29 +729,29 @@ class MatSnackBar {
|
|
|
695
729
|
],
|
|
696
730
|
});
|
|
697
731
|
}
|
|
698
|
-
static
|
|
699
|
-
static
|
|
732
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: MatSnackBar, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
733
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: MatSnackBar, providedIn: 'root' });
|
|
700
734
|
}
|
|
701
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
735
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: MatSnackBar, decorators: [{
|
|
702
736
|
type: Injectable,
|
|
703
737
|
args: [{ providedIn: 'root' }]
|
|
704
738
|
}], ctorParameters: () => [] });
|
|
705
739
|
|
|
706
740
|
const DIRECTIVES = [MatSnackBarContainer, MatSnackBarLabel, MatSnackBarActions, MatSnackBarAction];
|
|
707
741
|
class MatSnackBarModule {
|
|
708
|
-
static
|
|
709
|
-
static
|
|
742
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: MatSnackBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
743
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0-rc.0", ngImport: i0, type: MatSnackBarModule, imports: [OverlayModule,
|
|
710
744
|
PortalModule,
|
|
711
745
|
MatButtonModule,
|
|
712
746
|
MatCommonModule,
|
|
713
|
-
SimpleSnackBar, MatSnackBarContainer, MatSnackBarLabel, MatSnackBarActions, MatSnackBarAction], exports: [MatCommonModule, MatSnackBarContainer, MatSnackBarLabel, MatSnackBarActions, MatSnackBarAction] });
|
|
714
|
-
static
|
|
747
|
+
SimpleSnackBar, MatSnackBarContainer, MatSnackBarLabel, MatSnackBarActions, MatSnackBarAction], exports: [MatCommonModule, MatSnackBarContainer, MatSnackBarLabel, MatSnackBarActions, MatSnackBarAction] });
|
|
748
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: MatSnackBarModule, providers: [MatSnackBar], imports: [OverlayModule,
|
|
715
749
|
PortalModule,
|
|
716
750
|
MatButtonModule,
|
|
717
751
|
MatCommonModule,
|
|
718
|
-
SimpleSnackBar, MatCommonModule] });
|
|
752
|
+
SimpleSnackBar, MatCommonModule] });
|
|
719
753
|
}
|
|
720
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
|
754
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: MatSnackBarModule, decorators: [{
|
|
721
755
|
type: NgModule,
|
|
722
756
|
args: [{
|
|
723
757
|
imports: [
|