@angular/material 19.0.0-next.9 → 19.0.0-rc.1

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