@angular/material 19.0.0-next.9 → 19.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/autocomplete/_autocomplete-theme.scss +8 -4
- package/autocomplete/index.d.ts +5 -6
- package/badge/_badge-theme.scss +10 -6
- 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/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/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/tokens/_m3-system.scss +55 -39
- package/datepicker/_datepicker-theme.scss +10 -6
- package/datepicker/index.d.ts +32 -33
- package/dialog/_dialog-theme.scss +8 -4
- 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 +220 -141
- 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 +41 -30
- 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 +76 -54
- 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 +78 -40
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +87 -60
- 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 +38 -40
- 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 +99 -56
- 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 +303 -251
- 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 +217 -160
- 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 +788 -533
- 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 +210 -140
- 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 +7 -9
- 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 +76 -65
- 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 +165 -111
- 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 +65 -43
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon/testing.mjs +6 -6
- package/fesm2022/icon/testing.mjs.map +1 -1
- package/fesm2022/icon.mjs +62 -42
- 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 +101 -69
- 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 +175 -164
- 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 +171 -118
- 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 +79 -54
- 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 +33 -32
- 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 +25 -11
- 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 +119 -82
- 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 +215 -177
- 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 +125 -112
- 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 +72 -41
- 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 +255 -185
- 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 +133 -98
- 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 +89 -68
- 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 +133 -95
- 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 +164 -159
- 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 +308 -225
- 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 +152 -146
- 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 +22 -12
- 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 +93 -69
- 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 +48 -46
- package/fesm2022/tree.mjs.map +1 -1
- package/form-field/_form-field-theme.scss +9 -5
- package/form-field/index.d.ts +8 -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 +8 -9
- 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 +6 -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
|
@@ -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,29 +112,36 @@ 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-next.10", ngImport: i0, type: MatSnackBarLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
144
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MatSnackBarLabel, isStandalone: true, selector: "[matSnackBarLabel]", host: { classAttribute: "mat-mdc-snack-bar-label mdc-snackbar__label" }, ngImport: i0 });
|
|
125
145
|
}
|
|
126
146
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MatSnackBarLabel, decorators: [{
|
|
127
147
|
type: Directive,
|
|
@@ -134,8 +154,8 @@ 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-next.10", ngImport: i0, type: MatSnackBarActions, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
158
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MatSnackBarActions, isStandalone: true, selector: "[matSnackBarActions]", host: { classAttribute: "mat-mdc-snack-bar-actions mdc-snackbar__actions" }, ngImport: i0 });
|
|
139
159
|
}
|
|
140
160
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MatSnackBarActions, decorators: [{
|
|
141
161
|
type: Directive,
|
|
@@ -148,8 +168,8 @@ 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-next.10", ngImport: i0, type: MatSnackBarAction, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
172
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MatSnackBarAction, isStandalone: true, selector: "[matSnackBarAction]", host: { classAttribute: "mat-mdc-snack-bar-action mdc-snackbar__action" }, ngImport: i0 });
|
|
153
173
|
}
|
|
154
174
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MatSnackBarAction, decorators: [{
|
|
155
175
|
type: Directive,
|
|
@@ -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,8 +193,8 @@ 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-next.10", ngImport: i0, type: SimpleSnackBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
197
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0-next.10", 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
199
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: SimpleSnackBar, decorators: [{
|
|
181
200
|
type: Component,
|
|
@@ -212,40 +231,46 @@ let uniqueId = 0;
|
|
|
212
231
|
* @docs-private
|
|
213
232
|
*/
|
|
214
233
|
class MatSnackBarContainer extends BasePortalOutlet {
|
|
234
|
+
_ngZone = inject(NgZone);
|
|
235
|
+
_elementRef = inject(ElementRef);
|
|
236
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
237
|
+
_platform = inject(Platform);
|
|
238
|
+
snackBarConfig = inject(MatSnackBarConfig);
|
|
239
|
+
_document = inject(DOCUMENT);
|
|
240
|
+
_trackedModals = new Set();
|
|
241
|
+
/** The number of milliseconds to wait before announcing the snack bar's content. */
|
|
242
|
+
_announceDelay = 150;
|
|
243
|
+
/** The timeout for announcing the snack bar's content. */
|
|
244
|
+
_announceTimeoutId;
|
|
245
|
+
/** Whether the component has been destroyed. */
|
|
246
|
+
_destroyed = false;
|
|
247
|
+
/** The portal outlet inside of this container into which the snack bar content will be loaded. */
|
|
248
|
+
_portalOutlet;
|
|
249
|
+
/** Subject for notifying that the snack bar has announced to screen readers. */
|
|
250
|
+
_onAnnounce = new Subject();
|
|
251
|
+
/** Subject for notifying that the snack bar has exited from view. */
|
|
252
|
+
_onExit = new Subject();
|
|
253
|
+
/** Subject for notifying that the snack bar has finished entering the view. */
|
|
254
|
+
_onEnter = new Subject();
|
|
255
|
+
/** The state of the snack bar animations. */
|
|
256
|
+
_animationState = 'void';
|
|
257
|
+
/** aria-live value for the live region. */
|
|
258
|
+
_live;
|
|
259
|
+
/**
|
|
260
|
+
* Element that will have the `mdc-snackbar__label` class applied if the attached component
|
|
261
|
+
* or template does not have it. This ensures that the appropriate structure, typography, and
|
|
262
|
+
* color is applied to the attached view.
|
|
263
|
+
*/
|
|
264
|
+
_label;
|
|
265
|
+
/**
|
|
266
|
+
* Role of the live region. This is only for Firefox as there is a known issue where Firefox +
|
|
267
|
+
* JAWS does not read out aria-live message.
|
|
268
|
+
*/
|
|
269
|
+
_role;
|
|
270
|
+
/** Unique ID of the aria-live element. */
|
|
271
|
+
_liveElementId = `mat-snack-bar-container-live-${uniqueId++}`;
|
|
215
272
|
constructor() {
|
|
216
273
|
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
274
|
const config = this.snackBarConfig;
|
|
250
275
|
// Use aria-live rather than a live role like 'alert' or 'status'
|
|
251
276
|
// because NVDA and JAWS have show inconsistent behavior with live roles.
|
|
@@ -283,6 +308,17 @@ class MatSnackBarContainer extends BasePortalOutlet {
|
|
|
283
308
|
this._afterPortalAttached();
|
|
284
309
|
return result;
|
|
285
310
|
}
|
|
311
|
+
/**
|
|
312
|
+
* Attaches a DOM portal to the snack bar container.
|
|
313
|
+
* @deprecated To be turned into a method.
|
|
314
|
+
* @breaking-change 10.0.0
|
|
315
|
+
*/
|
|
316
|
+
attachDomPortal = (portal) => {
|
|
317
|
+
this._assertNotAttached();
|
|
318
|
+
const result = this._portalOutlet.attachDomPortal(portal);
|
|
319
|
+
this._afterPortalAttached();
|
|
320
|
+
return result;
|
|
321
|
+
};
|
|
286
322
|
/** Handle end of animations, updating the state of the snackbar. */
|
|
287
323
|
onAnimationEnd(event) {
|
|
288
324
|
const { fromState, toState } = event;
|
|
@@ -447,8 +483,8 @@ class MatSnackBarContainer extends BasePortalOutlet {
|
|
|
447
483
|
});
|
|
448
484
|
}
|
|
449
485
|
}
|
|
450
|
-
static
|
|
451
|
-
static
|
|
486
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MatSnackBarContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
487
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0-next.10", 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
488
|
}
|
|
453
489
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MatSnackBarContainer, decorators: [{
|
|
454
490
|
type: Component,
|
|
@@ -478,6 +514,24 @@ const MAT_SNACK_BAR_DEFAULT_OPTIONS = new InjectionToken('mat-snack-bar-default-
|
|
|
478
514
|
* Service to dispatch Material Design snack bar messages.
|
|
479
515
|
*/
|
|
480
516
|
class MatSnackBar {
|
|
517
|
+
_overlay = inject(Overlay);
|
|
518
|
+
_live = inject(LiveAnnouncer);
|
|
519
|
+
_injector = inject(Injector);
|
|
520
|
+
_breakpointObserver = inject(BreakpointObserver);
|
|
521
|
+
_parentSnackBar = inject(MatSnackBar, { optional: true, skipSelf: true });
|
|
522
|
+
_defaultConfig = inject(MAT_SNACK_BAR_DEFAULT_OPTIONS);
|
|
523
|
+
/**
|
|
524
|
+
* Reference to the current snack bar in the view *at this level* (in the Angular injector tree).
|
|
525
|
+
* If there is a parent snack-bar service, all operations should delegate to that parent
|
|
526
|
+
* via `_openedSnackBarRef`.
|
|
527
|
+
*/
|
|
528
|
+
_snackBarRefAtThisLevel = null;
|
|
529
|
+
/** The component that should be rendered as the snack bar's simple component. */
|
|
530
|
+
simpleSnackBarComponent = SimpleSnackBar;
|
|
531
|
+
/** The container component that attaches the provided template or component. */
|
|
532
|
+
snackBarContainerComponent = MatSnackBarContainer;
|
|
533
|
+
/** The CSS class to apply for handset mode. */
|
|
534
|
+
handsetCssClass = 'mat-mdc-snack-bar-handset';
|
|
481
535
|
/** Reference to the currently opened snackbar at *any* level. */
|
|
482
536
|
get _openedSnackBarRef() {
|
|
483
537
|
const parent = this._parentSnackBar;
|
|
@@ -491,26 +545,7 @@ class MatSnackBar {
|
|
|
491
545
|
this._snackBarRefAtThisLevel = value;
|
|
492
546
|
}
|
|
493
547
|
}
|
|
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
|
-
}
|
|
548
|
+
constructor() { }
|
|
514
549
|
/**
|
|
515
550
|
* Creates and dispatches a snack bar with a custom component for the content, removing any
|
|
516
551
|
* currently opened snack bars.
|
|
@@ -695,8 +730,8 @@ class MatSnackBar {
|
|
|
695
730
|
],
|
|
696
731
|
});
|
|
697
732
|
}
|
|
698
|
-
static
|
|
699
|
-
static
|
|
733
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MatSnackBar, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
734
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MatSnackBar, providedIn: 'root' });
|
|
700
735
|
}
|
|
701
736
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MatSnackBar, decorators: [{
|
|
702
737
|
type: Injectable,
|
|
@@ -705,17 +740,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10",
|
|
|
705
740
|
|
|
706
741
|
const DIRECTIVES = [MatSnackBarContainer, MatSnackBarLabel, MatSnackBarActions, MatSnackBarAction];
|
|
707
742
|
class MatSnackBarModule {
|
|
708
|
-
static
|
|
709
|
-
static
|
|
743
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MatSnackBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
744
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0-next.10", ngImport: i0, type: MatSnackBarModule, imports: [OverlayModule,
|
|
710
745
|
PortalModule,
|
|
711
746
|
MatButtonModule,
|
|
712
747
|
MatCommonModule,
|
|
713
|
-
SimpleSnackBar, MatSnackBarContainer, MatSnackBarLabel, MatSnackBarActions, MatSnackBarAction], exports: [MatCommonModule, MatSnackBarContainer, MatSnackBarLabel, MatSnackBarActions, MatSnackBarAction] });
|
|
714
|
-
static
|
|
748
|
+
SimpleSnackBar, MatSnackBarContainer, MatSnackBarLabel, MatSnackBarActions, MatSnackBarAction], exports: [MatCommonModule, MatSnackBarContainer, MatSnackBarLabel, MatSnackBarActions, MatSnackBarAction] });
|
|
749
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MatSnackBarModule, providers: [MatSnackBar], imports: [OverlayModule,
|
|
715
750
|
PortalModule,
|
|
716
751
|
MatButtonModule,
|
|
717
752
|
MatCommonModule,
|
|
718
|
-
SimpleSnackBar, MatCommonModule] });
|
|
753
|
+
SimpleSnackBar, MatCommonModule] });
|
|
719
754
|
}
|
|
720
755
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MatSnackBarModule, decorators: [{
|
|
721
756
|
type: NgModule,
|