@angular/material 19.0.0-next.8 → 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/_index.scss +1 -2
- package/autocomplete/_autocomplete-theme.scss +37 -24
- package/autocomplete/index.d.ts +5 -6
- package/badge/_badge-theme.scss +38 -24
- package/bottom-sheet/_bottom-sheet-theme.scss +32 -20
- package/button/_button-theme.scss +229 -105
- package/button/_fab-theme.scss +95 -44
- package/button/_icon-button-theme.scss +38 -25
- package/button/index.d.ts +3 -3
- package/button-toggle/_button-toggle-theme.scss +62 -37
- package/card/_card-theme.scss +79 -38
- package/card/index.d.ts +2 -3
- package/checkbox/_checkbox-theme.scss +16 -10
- package/chips/_chips-theme.scss +64 -30
- package/core/_core-theme.scss +55 -37
- package/core/_core.scss +3 -6
- package/core/option/_optgroup-theme.scss +29 -18
- package/core/option/_option-theme.scss +34 -21
- package/core/ripple/_ripple-theme.scss +33 -21
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +49 -23
- package/core/theming/_config-validation.scss +4 -4
- package/core/theming/_definition.scss +12 -2
- package/core/tokens/_m3-system.scss +86 -42
- package/core/tokens/_token-utils.scss +91 -34
- package/core/tokens/m2/mat/_badge.scss +12 -3
- package/core/tokens/m2/mdc/_radio.scss +1 -1
- package/core/tokens/m3/definitions/_md-comp-elevated-card.scss +1 -1
- package/core/tokens/m3/mat/_badge.scss +6 -3
- package/datepicker/_datepicker-theme.scss +53 -32
- package/datepicker/index.d.ts +33 -34
- package/dialog/_dialog-theme.scss +46 -23
- package/divider/_divider-theme.scss +28 -17
- package/expansion/_expansion-theme.scss +36 -24
- package/fesm2022/autocomplete/testing.mjs +2 -5
- package/fesm2022/autocomplete/testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs +225 -148
- 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 -35
- 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 +80 -58
- 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 +82 -45
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +106 -79
- 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 +56 -69
- 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 +104 -62
- 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 +322 -276
- 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 +242 -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 +827 -582
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog/testing.mjs +15 -10
- package/fesm2022/dialog/testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs +221 -156
- 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 +10 -12
- 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 +86 -80
- 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 -132
- 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 +75 -56
- 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 +66 -46
- 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 +103 -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 +197 -195
- 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 -127
- 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 +83 -58
- 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 +36 -35
- 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 +28 -14
- 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 -87
- 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 +219 -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 +136 -125
- 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 +77 -47
- 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 +262 -194
- 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 +143 -111
- 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 +94 -74
- 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 +146 -113
- 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 +183 -194
- 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 +329 -251
- 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 +160 -155
- 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 +26 -17
- 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 +97 -74
- 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 +57 -61
- package/fesm2022/tree.mjs.map +1 -1
- package/form-field/_form-field-theme.scss +114 -61
- package/form-field/index.d.ts +9 -10
- package/grid-list/_grid-list-theme.scss +25 -15
- package/icon/_icon-theme.scss +22 -14
- package/input/_input-theme.scss +18 -11
- package/list/_list-theme.scss +89 -47
- package/list/index.d.ts +20 -21
- package/menu/_menu-theme.scss +33 -21
- package/menu/index.d.ts +8 -9
- package/package.json +2 -2
- package/paginator/_paginator-theme.scss +39 -23
- 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 +20 -16
- package/progress-spinner/_progress-spinner-theme.scss +41 -25
- package/progress-spinner/index.d.ts +3 -4
- package/radio/_radio-theme.scss +60 -32
- package/radio/index.d.ts +2 -3
- package/schematics/collection.json +3 -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/{m3-theme → theme-color}/index_bundled.js +480 -288
- package/schematics/ng-generate/theme-color/index_bundled.js.map +7 -0
- package/schematics/ng-generate/{m3-theme → theme-color}/schema.json +7 -13
- package/schematics/ng-update/index_bundled.js +6 -1
- package/schematics/ng-update/index_bundled.js.map +1 -1
- package/select/_select-theme.scss +38 -25
- package/select/index.d.ts +6 -7
- package/sidenav/_sidenav-theme.scss +28 -17
- package/slide-toggle/_slide-toggle-theme.scss +52 -28
- package/slider/_slider-theme.scss +62 -38
- package/snack-bar/_snack-bar-theme.scss +29 -17
- package/sort/_sort-theme.scss +33 -21
- package/stepper/_stepper-theme.scss +40 -27
- package/stepper/index.d.ts +14 -15
- package/table/_table-theme.scss +36 -23
- package/tabs/_tabs-theme.scss +97 -50
- package/tabs/index.d.ts +2 -2
- package/timepicker/_timepicker-theme.scss +37 -24
- package/toolbar/_toolbar-theme.scss +35 -22
- package/tooltip/_tooltip-theme.scss +18 -15
- package/tooltip/index.d.ts +5 -6
- package/tree/_tree-theme.scss +33 -21
- package/schematics/ng-generate/m3-theme/index_bundled.js.map +0 -7
|
@@ -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,35 +112,41 @@ 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
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MatSnackBarLabel, decorators: [{
|
|
127
147
|
type: Directive,
|
|
128
148
|
args: [{
|
|
129
149
|
selector: `[matSnackBarLabel]`,
|
|
130
|
-
standalone: true,
|
|
131
150
|
host: {
|
|
132
151
|
'class': 'mat-mdc-snack-bar-label mdc-snackbar__label',
|
|
133
152
|
},
|
|
@@ -135,14 +154,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8",
|
|
|
135
154
|
}] });
|
|
136
155
|
/** Directive that should be applied to the element containing the snack bar's action buttons. */
|
|
137
156
|
class MatSnackBarActions {
|
|
138
|
-
static
|
|
139
|
-
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 });
|
|
140
159
|
}
|
|
141
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
160
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MatSnackBarActions, decorators: [{
|
|
142
161
|
type: Directive,
|
|
143
162
|
args: [{
|
|
144
163
|
selector: `[matSnackBarActions]`,
|
|
145
|
-
standalone: true,
|
|
146
164
|
host: {
|
|
147
165
|
'class': 'mat-mdc-snack-bar-actions mdc-snackbar__actions',
|
|
148
166
|
},
|
|
@@ -150,14 +168,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8",
|
|
|
150
168
|
}] });
|
|
151
169
|
/** Directive that should be applied to each of the snack bar's action buttons. */
|
|
152
170
|
class MatSnackBarAction {
|
|
153
|
-
static
|
|
154
|
-
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 });
|
|
155
173
|
}
|
|
156
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
174
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MatSnackBarAction, decorators: [{
|
|
157
175
|
type: Directive,
|
|
158
176
|
args: [{
|
|
159
177
|
selector: `[matSnackBarAction]`,
|
|
160
|
-
standalone: true,
|
|
161
178
|
host: {
|
|
162
179
|
'class': 'mat-mdc-snack-bar-action mdc-snackbar__action',
|
|
163
180
|
},
|
|
@@ -165,10 +182,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.8",
|
|
|
165
182
|
}] });
|
|
166
183
|
|
|
167
184
|
class SimpleSnackBar {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
185
|
+
snackBarRef = inject(MatSnackBarRef);
|
|
186
|
+
data = inject(MAT_SNACK_BAR_DATA);
|
|
187
|
+
constructor() { }
|
|
172
188
|
/** Performs the action on the snack bar. */
|
|
173
189
|
action() {
|
|
174
190
|
this.snackBarRef.dismissWithAction();
|
|
@@ -177,12 +193,12 @@ class SimpleSnackBar {
|
|
|
177
193
|
get hasAction() {
|
|
178
194
|
return !!this.data.action;
|
|
179
195
|
}
|
|
180
|
-
static
|
|
181
|
-
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 });
|
|
182
198
|
}
|
|
183
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
199
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: SimpleSnackBar, decorators: [{
|
|
184
200
|
type: Component,
|
|
185
|
-
args: [{ selector: 'simple-snack-bar', exportAs: 'matSnackBar', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButton, MatSnackBarLabel, MatSnackBarActions, MatSnackBarAction],
|
|
201
|
+
args: [{ selector: 'simple-snack-bar', exportAs: 'matSnackBar', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButton, MatSnackBarLabel, MatSnackBarActions, MatSnackBarAction], host: {
|
|
186
202
|
'class': 'mat-mdc-simple-snack-bar',
|
|
187
203
|
}, 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}"] }]
|
|
188
204
|
}], ctorParameters: () => [] });
|
|
@@ -215,40 +231,46 @@ let uniqueId = 0;
|
|
|
215
231
|
* @docs-private
|
|
216
232
|
*/
|
|
217
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++}`;
|
|
218
272
|
constructor() {
|
|
219
273
|
super();
|
|
220
|
-
this._ngZone = inject(NgZone);
|
|
221
|
-
this._elementRef = inject(ElementRef);
|
|
222
|
-
this._changeDetectorRef = inject(ChangeDetectorRef);
|
|
223
|
-
this._platform = inject(Platform);
|
|
224
|
-
this.snackBarConfig = inject(MatSnackBarConfig);
|
|
225
|
-
this._document = inject(DOCUMENT);
|
|
226
|
-
this._trackedModals = new Set();
|
|
227
|
-
/** The number of milliseconds to wait before announcing the snack bar's content. */
|
|
228
|
-
this._announceDelay = 150;
|
|
229
|
-
/** Whether the component has been destroyed. */
|
|
230
|
-
this._destroyed = false;
|
|
231
|
-
/** Subject for notifying that the snack bar has announced to screen readers. */
|
|
232
|
-
this._onAnnounce = new Subject();
|
|
233
|
-
/** Subject for notifying that the snack bar has exited from view. */
|
|
234
|
-
this._onExit = new Subject();
|
|
235
|
-
/** Subject for notifying that the snack bar has finished entering the view. */
|
|
236
|
-
this._onEnter = new Subject();
|
|
237
|
-
/** The state of the snack bar animations. */
|
|
238
|
-
this._animationState = 'void';
|
|
239
|
-
/** Unique ID of the aria-live element. */
|
|
240
|
-
this._liveElementId = `mat-snack-bar-container-live-${uniqueId++}`;
|
|
241
|
-
/**
|
|
242
|
-
* Attaches a DOM portal to the snack bar container.
|
|
243
|
-
* @deprecated To be turned into a method.
|
|
244
|
-
* @breaking-change 10.0.0
|
|
245
|
-
*/
|
|
246
|
-
this.attachDomPortal = (portal) => {
|
|
247
|
-
this._assertNotAttached();
|
|
248
|
-
const result = this._portalOutlet.attachDomPortal(portal);
|
|
249
|
-
this._afterPortalAttached();
|
|
250
|
-
return result;
|
|
251
|
-
};
|
|
252
274
|
const config = this.snackBarConfig;
|
|
253
275
|
// Use aria-live rather than a live role like 'alert' or 'status'
|
|
254
276
|
// because NVDA and JAWS have show inconsistent behavior with live roles.
|
|
@@ -286,6 +308,17 @@ class MatSnackBarContainer extends BasePortalOutlet {
|
|
|
286
308
|
this._afterPortalAttached();
|
|
287
309
|
return result;
|
|
288
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
|
+
};
|
|
289
322
|
/** Handle end of animations, updating the state of the snackbar. */
|
|
290
323
|
onAnimationEnd(event) {
|
|
291
324
|
const { fromState, toState } = event;
|
|
@@ -450,16 +483,16 @@ class MatSnackBarContainer extends BasePortalOutlet {
|
|
|
450
483
|
});
|
|
451
484
|
}
|
|
452
485
|
}
|
|
453
|
-
static
|
|
454
|
-
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 });
|
|
455
488
|
}
|
|
456
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
489
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MatSnackBarContainer, decorators: [{
|
|
457
490
|
type: Component,
|
|
458
|
-
args: [{ selector: 'mat-snack-bar-container', changeDetection: ChangeDetectionStrategy.Default, encapsulation: ViewEncapsulation.None, animations: [matSnackBarAnimations.snackBarState],
|
|
491
|
+
args: [{ selector: 'mat-snack-bar-container', changeDetection: ChangeDetectionStrategy.Default, encapsulation: ViewEncapsulation.None, animations: [matSnackBarAnimations.snackBarState], imports: [CdkPortalOutlet], host: {
|
|
459
492
|
'class': 'mdc-snackbar mat-mdc-snack-bar-container',
|
|
460
493
|
'[@state]': '_animationState',
|
|
461
494
|
'(@state.done)': 'onAnimationEnd($event)',
|
|
462
|
-
}, 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-
|
|
495
|
+
}, 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}"] }]
|
|
463
496
|
}], ctorParameters: () => [], propDecorators: { _portalOutlet: [{
|
|
464
497
|
type: ViewChild,
|
|
465
498
|
args: [CdkPortalOutlet, { static: true }]
|
|
@@ -481,6 +514,24 @@ const MAT_SNACK_BAR_DEFAULT_OPTIONS = new InjectionToken('mat-snack-bar-default-
|
|
|
481
514
|
* Service to dispatch Material Design snack bar messages.
|
|
482
515
|
*/
|
|
483
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';
|
|
484
535
|
/** Reference to the currently opened snackbar at *any* level. */
|
|
485
536
|
get _openedSnackBarRef() {
|
|
486
537
|
const parent = this._parentSnackBar;
|
|
@@ -494,26 +545,7 @@ class MatSnackBar {
|
|
|
494
545
|
this._snackBarRefAtThisLevel = value;
|
|
495
546
|
}
|
|
496
547
|
}
|
|
497
|
-
constructor() {
|
|
498
|
-
this._overlay = inject(Overlay);
|
|
499
|
-
this._live = inject(LiveAnnouncer);
|
|
500
|
-
this._injector = inject(Injector);
|
|
501
|
-
this._breakpointObserver = inject(BreakpointObserver);
|
|
502
|
-
this._parentSnackBar = inject(MatSnackBar, { optional: true, skipSelf: true });
|
|
503
|
-
this._defaultConfig = inject(MAT_SNACK_BAR_DEFAULT_OPTIONS);
|
|
504
|
-
/**
|
|
505
|
-
* Reference to the current snack bar in the view *at this level* (in the Angular injector tree).
|
|
506
|
-
* If there is a parent snack-bar service, all operations should delegate to that parent
|
|
507
|
-
* via `_openedSnackBarRef`.
|
|
508
|
-
*/
|
|
509
|
-
this._snackBarRefAtThisLevel = null;
|
|
510
|
-
/** The component that should be rendered as the snack bar's simple component. */
|
|
511
|
-
this.simpleSnackBarComponent = SimpleSnackBar;
|
|
512
|
-
/** The container component that attaches the provided template or component. */
|
|
513
|
-
this.snackBarContainerComponent = MatSnackBarContainer;
|
|
514
|
-
/** The CSS class to apply for handset mode. */
|
|
515
|
-
this.handsetCssClass = 'mat-mdc-snack-bar-handset';
|
|
516
|
-
}
|
|
548
|
+
constructor() { }
|
|
517
549
|
/**
|
|
518
550
|
* Creates and dispatches a snack bar with a custom component for the content, removing any
|
|
519
551
|
* currently opened snack bars.
|
|
@@ -698,29 +730,29 @@ class MatSnackBar {
|
|
|
698
730
|
],
|
|
699
731
|
});
|
|
700
732
|
}
|
|
701
|
-
static
|
|
702
|
-
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' });
|
|
703
735
|
}
|
|
704
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
736
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MatSnackBar, decorators: [{
|
|
705
737
|
type: Injectable,
|
|
706
738
|
args: [{ providedIn: 'root' }]
|
|
707
739
|
}], ctorParameters: () => [] });
|
|
708
740
|
|
|
709
741
|
const DIRECTIVES = [MatSnackBarContainer, MatSnackBarLabel, MatSnackBarActions, MatSnackBarAction];
|
|
710
742
|
class MatSnackBarModule {
|
|
711
|
-
static
|
|
712
|
-
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,
|
|
713
745
|
PortalModule,
|
|
714
746
|
MatButtonModule,
|
|
715
747
|
MatCommonModule,
|
|
716
|
-
SimpleSnackBar, MatSnackBarContainer, MatSnackBarLabel, MatSnackBarActions, MatSnackBarAction], exports: [MatCommonModule, MatSnackBarContainer, MatSnackBarLabel, MatSnackBarActions, MatSnackBarAction] });
|
|
717
|
-
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,
|
|
718
750
|
PortalModule,
|
|
719
751
|
MatButtonModule,
|
|
720
752
|
MatCommonModule,
|
|
721
|
-
SimpleSnackBar, MatCommonModule] });
|
|
753
|
+
SimpleSnackBar, MatCommonModule] });
|
|
722
754
|
}
|
|
723
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.
|
|
755
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MatSnackBarModule, decorators: [{
|
|
724
756
|
type: NgModule,
|
|
725
757
|
args: [{
|
|
726
758
|
imports: [
|