@angular/material 20.0.0-next.0 → 20.0.0-next.2

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 (368) hide show
  1. package/autocomplete/_autocomplete-theme.scss +4 -4
  2. package/autocomplete/index.d.ts +96 -126
  3. package/autocomplete/testing/index.d.ts +6 -11
  4. package/badge/_badge-theme.scss +5 -5
  5. package/badge/index.d.ts +8 -112
  6. package/badge/testing/index.d.ts +7 -8
  7. package/badge.d-49a8a74b.d.ts +98 -0
  8. package/bottom-sheet/_bottom-sheet-theme.scss +3 -3
  9. package/bottom-sheet/index.d.ts +88 -103
  10. package/bottom-sheet/testing/index.d.ts +4 -6
  11. package/button/_button-theme.scss +84 -32
  12. package/button/_fab-theme.scss +13 -13
  13. package/button/_icon-button-theme.scss +5 -5
  14. package/button/index.d.ts +10 -245
  15. package/button/testing/index.d.ts +13 -10
  16. package/button-toggle/_button-toggle-theme.scss +8 -8
  17. package/button-toggle/index.d.ts +12 -285
  18. package/button-toggle/testing/index.d.ts +38 -37
  19. package/button-toggle.d-edc8acff.d.ts +257 -0
  20. package/card/_card-theme.scss +12 -12
  21. package/card/index.d.ts +80 -117
  22. package/card/testing/index.d.ts +11 -15
  23. package/checkbox/_checkbox-theme.scss +10 -10
  24. package/checkbox/index.d.ts +43 -104
  25. package/checkbox/testing/index.d.ts +6 -10
  26. package/chips/_chips-theme.scss +14 -14
  27. package/chips/index.d.ts +599 -693
  28. package/chips/testing/index.d.ts +78 -93
  29. package/common-module.d-0e6515ae.d.ts +43 -0
  30. package/core/_core-theme.scss +2 -2
  31. package/core/index.d.ts +50 -979
  32. package/core/option/_optgroup-theme.scss +2 -2
  33. package/core/option/_option-theme.scss +4 -4
  34. package/core/ripple/_ripple-theme.scss +3 -3
  35. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +4 -4
  36. package/core/testing/index.d.ts +3 -65
  37. package/core/theming/_color-api-backwards-compatibility.scss +19 -8
  38. package/core/tokens/_density.scss +3 -0
  39. package/core/tokens/_token-definition.scss +1 -2
  40. package/core/tokens/_token-utils.scss +20 -5
  41. package/core/tokens/m2/_index.scss +2 -0
  42. package/core/tokens/m2/mat/_tonal-button.scss +110 -0
  43. package/core/tokens/m3/_index.scss +2 -0
  44. package/core/tokens/m3/definitions/_index.scss +1 -1
  45. package/core/tokens/m3/definitions/_md-comp-elevated-card.scss +3 -1
  46. package/core/tokens/m3/definitions/_md-sys-color.scss +44 -2
  47. package/core/tokens/m3/definitions/_md-sys-typescale.scss +20 -1
  48. package/core/tokens/m3/mat/_tonal-button.scss +101 -0
  49. package/date-adapter.d-c6835d41.d.ts +267 -0
  50. package/date-range-input-harness.d-549a9f7e.d.ts +278 -0
  51. package/datepicker/_datepicker-theme.scss +8 -7
  52. package/datepicker/index.d.ts +1332 -1482
  53. package/datepicker/testing/index.d.ts +5 -287
  54. package/dialog/_dialog-theme.scss +6 -6
  55. package/dialog/index.d.ts +59 -453
  56. package/dialog/testing/index.d.ts +22 -26
  57. package/dialog.d-57867441.d.ts +335 -0
  58. package/divider/_divider-theme.scss +2 -2
  59. package/divider/index.d.ts +6 -11
  60. package/divider/testing/index.d.ts +2 -16
  61. package/divider-harness.d-d34fede4.d.ts +14 -0
  62. package/error-options.d-448d9046.d.ts +17 -0
  63. package/expansion/_expansion-theme.scss +4 -4
  64. package/expansion/index.d.ts +139 -190
  65. package/expansion/testing/index.d.ts +25 -31
  66. package/fesm2022/autocomplete/testing.mjs +2 -1
  67. package/fesm2022/autocomplete/testing.mjs.map +1 -1
  68. package/fesm2022/autocomplete.mjs +56 -32
  69. package/fesm2022/autocomplete.mjs.map +1 -1
  70. package/fesm2022/badge/testing.mjs.map +1 -1
  71. package/fesm2022/badge.mjs +14 -17
  72. package/fesm2022/badge.mjs.map +1 -1
  73. package/fesm2022/bottom-sheet/testing.mjs.map +1 -1
  74. package/fesm2022/bottom-sheet.mjs +13 -15
  75. package/fesm2022/bottom-sheet.mjs.map +1 -1
  76. package/fesm2022/button/testing.mjs +34 -15
  77. package/fesm2022/button/testing.mjs.map +1 -1
  78. package/fesm2022/button-toggle/testing.mjs.map +1 -1
  79. package/fesm2022/button-toggle.mjs +22 -15
  80. package/fesm2022/button-toggle.mjs.map +1 -1
  81. package/fesm2022/button.mjs +14 -395
  82. package/fesm2022/button.mjs.map +1 -1
  83. package/fesm2022/card/testing.mjs.map +1 -1
  84. package/fesm2022/card.mjs +49 -51
  85. package/fesm2022/card.mjs.map +1 -1
  86. package/fesm2022/checkbox/testing.mjs.map +1 -1
  87. package/fesm2022/checkbox.mjs +32 -73
  88. package/fesm2022/checkbox.mjs.map +1 -1
  89. package/fesm2022/chips/testing.mjs.map +1 -1
  90. package/fesm2022/chips.mjs +51 -46
  91. package/fesm2022/chips.mjs.map +1 -1
  92. package/fesm2022/common-module-2d64df09.mjs +42 -0
  93. package/fesm2022/common-module-2d64df09.mjs.map +1 -0
  94. package/fesm2022/core/testing.mjs +3 -76
  95. package/fesm2022/core/testing.mjs.map +1 -1
  96. package/fesm2022/core.mjs +38 -1598
  97. package/fesm2022/core.mjs.map +1 -1
  98. package/fesm2022/date-formats-b618acb8.mjs +190 -0
  99. package/fesm2022/date-formats-b618acb8.mjs.map +1 -0
  100. package/fesm2022/date-range-input-harness-de70be6a.mjs +467 -0
  101. package/fesm2022/date-range-input-harness-de70be6a.mjs.map +1 -0
  102. package/fesm2022/datepicker/testing.mjs +5 -465
  103. package/fesm2022/datepicker/testing.mjs.map +1 -1
  104. package/fesm2022/datepicker.mjs +162 -131
  105. package/fesm2022/datepicker.mjs.map +1 -1
  106. package/fesm2022/dialog/testing.mjs +12 -1
  107. package/fesm2022/dialog/testing.mjs.map +1 -1
  108. package/fesm2022/dialog.mjs +14 -895
  109. package/fesm2022/dialog.mjs.map +1 -1
  110. package/fesm2022/divider/testing.mjs +2 -17
  111. package/fesm2022/divider/testing.mjs.map +1 -1
  112. package/fesm2022/divider-harness-8099453f.mjs +18 -0
  113. package/fesm2022/divider-harness-8099453f.mjs.map +1 -0
  114. package/fesm2022/divider.mjs +10 -12
  115. package/fesm2022/divider.mjs.map +1 -1
  116. package/fesm2022/error-options-4a00765e.mjs +29 -0
  117. package/fesm2022/error-options-4a00765e.mjs.map +1 -0
  118. package/fesm2022/error-state-8f4ce1af.mjs +37 -0
  119. package/fesm2022/error-state-8f4ce1af.mjs.map +1 -0
  120. package/fesm2022/expansion/testing.mjs.map +1 -1
  121. package/fesm2022/expansion.mjs +30 -32
  122. package/fesm2022/expansion.mjs.map +1 -1
  123. package/fesm2022/form-field/testing/control.mjs +2 -10
  124. package/fesm2022/form-field/testing/control.mjs.map +1 -1
  125. package/fesm2022/form-field/testing.mjs +7 -6
  126. package/fesm2022/form-field/testing.mjs.map +1 -1
  127. package/fesm2022/form-field-6d755764.mjs +1076 -0
  128. package/fesm2022/form-field-6d755764.mjs.map +1 -0
  129. package/fesm2022/form-field-control-harness-efefd4cf.mjs +11 -0
  130. package/fesm2022/form-field-control-harness-efefd4cf.mjs.map +1 -0
  131. package/fesm2022/form-field.mjs +14 -1110
  132. package/fesm2022/form-field.mjs.map +1 -1
  133. package/fesm2022/grid-list/testing.mjs +1 -1
  134. package/fesm2022/grid-list/testing.mjs.map +1 -1
  135. package/fesm2022/grid-list.mjs +30 -173
  136. package/fesm2022/grid-list.mjs.map +1 -1
  137. package/fesm2022/icon/testing.mjs +12 -12
  138. package/fesm2022/icon/testing.mjs.map +1 -1
  139. package/fesm2022/icon-button-0850d958.mjs +211 -0
  140. package/fesm2022/icon-button-0850d958.mjs.map +1 -0
  141. package/fesm2022/icon-module-3f77a24d.mjs +395 -0
  142. package/fesm2022/icon-module-3f77a24d.mjs.map +1 -0
  143. package/fesm2022/icon-registry-13a3b98e.mjs +639 -0
  144. package/fesm2022/icon-registry-13a3b98e.mjs.map +1 -0
  145. package/fesm2022/icon.mjs +11 -1016
  146. package/fesm2022/icon.mjs.map +1 -1
  147. package/fesm2022/index-1763d3a6.mjs +22 -0
  148. package/fesm2022/index-1763d3a6.mjs.map +1 -0
  149. package/fesm2022/index-4bc1d6d3.mjs +20 -0
  150. package/fesm2022/index-4bc1d6d3.mjs.map +1 -0
  151. package/fesm2022/input/testing.mjs +5 -113
  152. package/fesm2022/input/testing.mjs.map +1 -1
  153. package/fesm2022/input-harness-e68bb132.mjs +115 -0
  154. package/fesm2022/input-harness-e68bb132.mjs.map +1 -0
  155. package/fesm2022/input-value-accessor-8a79a24e.mjs +12 -0
  156. package/fesm2022/input-value-accessor-8a79a24e.mjs.map +1 -0
  157. package/fesm2022/input.mjs +21 -23
  158. package/fesm2022/input.mjs.map +1 -1
  159. package/fesm2022/internal-form-field-434c4039.mjs +27 -0
  160. package/fesm2022/internal-form-field-434c4039.mjs.map +1 -0
  161. package/fesm2022/line-d6afe347.mjs +59 -0
  162. package/fesm2022/line-d6afe347.mjs.map +1 -0
  163. package/fesm2022/list/testing.mjs +2 -2
  164. package/fesm2022/list/testing.mjs.map +1 -1
  165. package/fesm2022/list.mjs +59 -56
  166. package/fesm2022/list.mjs.map +1 -1
  167. package/fesm2022/menu/testing.mjs.map +1 -1
  168. package/fesm2022/menu.mjs +37 -25
  169. package/fesm2022/menu.mjs.map +1 -1
  170. package/fesm2022/module-1c16a0a9.mjs +1293 -0
  171. package/fesm2022/module-1c16a0a9.mjs.map +1 -0
  172. package/fesm2022/module-47e3be58.mjs +970 -0
  173. package/fesm2022/module-47e3be58.mjs.map +1 -0
  174. package/fesm2022/module-a5f9ab72.mjs +875 -0
  175. package/fesm2022/module-a5f9ab72.mjs.map +1 -0
  176. package/fesm2022/module-cf951a02.mjs +214 -0
  177. package/fesm2022/module-cf951a02.mjs.map +1 -0
  178. package/fesm2022/module-d757bba0.mjs +38 -0
  179. package/fesm2022/module-d757bba0.mjs.map +1 -0
  180. package/fesm2022/optgroup-harness-5e66b138.mjs +36 -0
  181. package/fesm2022/optgroup-harness-5e66b138.mjs.map +1 -0
  182. package/fesm2022/option-07c3c660.mjs +348 -0
  183. package/fesm2022/option-07c3c660.mjs.map +1 -0
  184. package/fesm2022/option-harness-3b7c1106.mjs +46 -0
  185. package/fesm2022/option-harness-3b7c1106.mjs.map +1 -0
  186. package/fesm2022/paginator/testing.mjs +4 -1
  187. package/fesm2022/paginator/testing.mjs.map +1 -1
  188. package/fesm2022/paginator.mjs +52 -22
  189. package/fesm2022/paginator.mjs.map +1 -1
  190. package/fesm2022/progress-bar/testing.mjs +0 -4
  191. package/fesm2022/progress-bar/testing.mjs.map +1 -1
  192. package/fesm2022/progress-bar.mjs +15 -13
  193. package/fesm2022/progress-bar.mjs.map +1 -1
  194. package/fesm2022/progress-spinner/testing.mjs +0 -4
  195. package/fesm2022/progress-spinner/testing.mjs.map +1 -1
  196. package/fesm2022/progress-spinner.mjs +15 -13
  197. package/fesm2022/progress-spinner.mjs.map +1 -1
  198. package/fesm2022/pseudo-checkbox-af5a4ea4.mjs +52 -0
  199. package/fesm2022/pseudo-checkbox-af5a4ea4.mjs.map +1 -0
  200. package/fesm2022/pseudo-checkbox-module-216fae38.mjs +20 -0
  201. package/fesm2022/pseudo-checkbox-module-216fae38.mjs.map +1 -0
  202. package/fesm2022/public-api-c5ab57f5.mjs +147 -0
  203. package/fesm2022/public-api-c5ab57f5.mjs.map +1 -0
  204. package/fesm2022/radio/testing.mjs.map +1 -1
  205. package/fesm2022/radio.mjs +23 -15
  206. package/fesm2022/radio.mjs.map +1 -1
  207. package/fesm2022/ripple-9939d1f5.mjs +639 -0
  208. package/fesm2022/ripple-9939d1f5.mjs.map +1 -0
  209. package/fesm2022/ripple-loader-f2078c66.mjs +165 -0
  210. package/fesm2022/ripple-loader-f2078c66.mjs.map +1 -0
  211. package/fesm2022/select/testing.mjs +5 -121
  212. package/fesm2022/select/testing.mjs.map +1 -1
  213. package/fesm2022/select-harness-69d47123.mjs +123 -0
  214. package/fesm2022/select-harness-69d47123.mjs.map +1 -0
  215. package/fesm2022/select.mjs +30 -1311
  216. package/fesm2022/select.mjs.map +1 -1
  217. package/fesm2022/sidenav/testing.mjs +1 -1
  218. package/fesm2022/sidenav/testing.mjs.map +1 -1
  219. package/fesm2022/sidenav.mjs +31 -31
  220. package/fesm2022/sidenav.mjs.map +1 -1
  221. package/fesm2022/slide-toggle/testing.mjs.map +1 -1
  222. package/fesm2022/slide-toggle.mjs +27 -75
  223. package/fesm2022/slide-toggle.mjs.map +1 -1
  224. package/fesm2022/slider/testing.mjs.map +1 -1
  225. package/fesm2022/slider.mjs +27 -23
  226. package/fesm2022/slider.mjs.map +1 -1
  227. package/fesm2022/snack-bar/testing.mjs.map +1 -1
  228. package/fesm2022/snack-bar.mjs +38 -30
  229. package/fesm2022/snack-bar.mjs.map +1 -1
  230. package/fesm2022/sort/testing.mjs.map +1 -1
  231. package/fesm2022/sort.mjs +26 -20
  232. package/fesm2022/sort.mjs.map +1 -1
  233. package/fesm2022/stepper/testing.mjs.map +1 -1
  234. package/fesm2022/stepper.mjs +52 -39
  235. package/fesm2022/stepper.mjs.map +1 -1
  236. package/fesm2022/structural-styles-d5ada3b3.mjs +18 -0
  237. package/fesm2022/structural-styles-d5ada3b3.mjs.map +1 -0
  238. package/fesm2022/table/testing.mjs.map +1 -1
  239. package/fesm2022/table.mjs +58 -60
  240. package/fesm2022/table.mjs.map +1 -1
  241. package/fesm2022/tabs/testing.mjs.map +1 -1
  242. package/fesm2022/tabs.mjs +54 -58
  243. package/fesm2022/tabs.mjs.map +1 -1
  244. package/fesm2022/timepicker/testing.mjs +1 -1
  245. package/fesm2022/timepicker/testing.mjs.map +1 -1
  246. package/fesm2022/timepicker.mjs +37 -26
  247. package/fesm2022/timepicker.mjs.map +1 -1
  248. package/fesm2022/toolbar/testing.mjs.map +1 -1
  249. package/fesm2022/toolbar.mjs +13 -15
  250. package/fesm2022/toolbar.mjs.map +1 -1
  251. package/fesm2022/tooltip/testing.mjs.map +1 -1
  252. package/fesm2022/tooltip.mjs +15 -960
  253. package/fesm2022/tooltip.mjs.map +1 -1
  254. package/fesm2022/tree/testing.mjs.map +1 -1
  255. package/fesm2022/tree.mjs +28 -30
  256. package/fesm2022/tree.mjs.map +1 -1
  257. package/form-field/_form-field-theme.scss +16 -16
  258. package/form-field/index.d.ts +16 -508
  259. package/form-field/testing/control/index.d.ts +2 -10
  260. package/form-field/testing/index.d.ts +19 -24
  261. package/form-field-control-harness.d-2d91f25a.d.ts +10 -0
  262. package/form-field-control.d-eb86711c.d.ts +62 -0
  263. package/form-field.d-2edbc094.d.ts +367 -0
  264. package/grid-list/_grid-list-theme.scss +1 -1
  265. package/grid-list/index.d.ts +128 -152
  266. package/grid-list/testing/index.d.ts +39 -44
  267. package/icon/_icon-theme.scss +2 -2
  268. package/icon/index.d.ts +9 -470
  269. package/icon/testing/index.d.ts +41 -44
  270. package/icon-module.d-aa3bbba0.d.ts +167 -0
  271. package/icon-registry.d-1dffe9de.d.ts +286 -0
  272. package/index.d-0536b706.d.ts +11 -0
  273. package/index.d-37e31cd3.d.ts +13 -0
  274. package/index.d.ts +2 -3
  275. package/input/index.d.ts +33 -62
  276. package/input/testing/index.d.ts +13 -71
  277. package/input-harness.d-4eecd1d3.d.ts +60 -0
  278. package/line.d-570a2537.d.ts +25 -0
  279. package/list/_list-theme.scss +15 -15
  280. package/list/index.d.ts +155 -244
  281. package/list/testing/index.d.ts +158 -180
  282. package/list-option-types.d-8739f903.d.ts +15 -0
  283. package/menu/_menu-theme.scss +3 -3
  284. package/menu/index.d.ts +183 -231
  285. package/menu/testing/index.d.ts +17 -23
  286. package/module.d-74a721b9.d.ts +326 -0
  287. package/module.d-792a497c.d.ts +213 -0
  288. package/module.d-ba05faa6.d.ts +448 -0
  289. package/module.d-c17c834e.d.ts +18 -0
  290. package/optgroup-harness.d-7f741f69.d.ts +31 -0
  291. package/option-harness.d-3d33fc9a.d.ts +34 -0
  292. package/option-parent.d-559ad5c5.d.ts +19 -0
  293. package/option.d-6f493d78.d.ts +146 -0
  294. package/package.json +2 -2
  295. package/paginator/_paginator-theme.scss +3 -3
  296. package/paginator/index.d.ts +31 -216
  297. package/paginator/testing/index.d.ts +14 -15
  298. package/paginator.d-40b1766e.d.ts +199 -0
  299. package/palette.d-ec4a617c.d.ts +4 -0
  300. package/prebuilt-themes/deeppurple-amber.css +1 -1
  301. package/prebuilt-themes/indigo-pink.css +1 -1
  302. package/prebuilt-themes/pink-bluegrey.css +1 -1
  303. package/prebuilt-themes/purple-green.css +1 -1
  304. package/progress-bar/_progress-bar-theme.scss +2 -2
  305. package/progress-bar/index.d.ts +40 -59
  306. package/progress-bar/testing/index.d.ts +7 -10
  307. package/progress-spinner/_progress-spinner-theme.scss +4 -4
  308. package/progress-spinner/index.d.ts +8 -110
  309. package/progress-spinner/testing/index.d.ts +10 -11
  310. package/progress-spinner.d-1fc040c5.d.ts +96 -0
  311. package/pseudo-checkbox-module.d-3abc0461.d.ts +44 -0
  312. package/radio/_radio-theme.scss +12 -12
  313. package/radio/index.d.ts +151 -170
  314. package/radio/testing/index.d.ts +61 -67
  315. package/ripple-loader.d-8aac2988.d.ts +48 -0
  316. package/ripple.d-2fb57d04.d.ts +255 -0
  317. package/schematics/ng-add/index.js +1 -1
  318. package/schematics/ng-add/index.mjs +1 -1
  319. package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +2 -2
  320. package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +1 -1
  321. package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +1 -1
  322. package/schematics/ng-generate/theme-color/index_bundled.js +2 -2
  323. package/schematics/ng-generate/theme-color/schema.json +10 -0
  324. package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +2 -2
  325. package/schematics/ng-update/index_bundled.js +31 -31
  326. package/select/_select-theme.scss +6 -6
  327. package/select/index.d.ts +25 -505
  328. package/select/testing/index.d.ts +5 -67
  329. package/select-harness.d-7441a7ac.d.ts +63 -0
  330. package/sidenav/_sidenav-theme.scss +2 -2
  331. package/sidenav/index.d.ts +49 -92
  332. package/sidenav/testing/index.d.ts +58 -63
  333. package/slide-toggle/_slide-toggle-theme.scss +10 -10
  334. package/slide-toggle/index.d.ts +39 -110
  335. package/slide-toggle/testing/index.d.ts +17 -21
  336. package/slider/_slider-theme.scss +10 -10
  337. package/slider/index.d.ts +281 -328
  338. package/slider/testing/index.d.ts +42 -47
  339. package/snack-bar/_snack-bar-theme.scss +4 -4
  340. package/snack-bar/index.d.ts +152 -185
  341. package/snack-bar/testing/index.d.ts +7 -9
  342. package/sort/_sort-theme.scss +3 -3
  343. package/sort/index.d.ts +61 -169
  344. package/sort/testing/index.d.ts +22 -25
  345. package/sort-direction.d-f4ce4649.d.ts +3 -0
  346. package/sort.d-c2b79a45.d.ts +87 -0
  347. package/stepper/_stepper-theme.scss +5 -5
  348. package/stepper/index.d.ts +115 -167
  349. package/stepper/testing/index.d.ts +43 -52
  350. package/table/_table-theme.scss +4 -4
  351. package/table/index.d.ts +97 -156
  352. package/table/testing/index.d.ts +64 -78
  353. package/tabs/_tabs-theme.scss +16 -16
  354. package/tabs/index.d.ts +309 -383
  355. package/tabs/testing/index.d.ts +67 -76
  356. package/timepicker/_timepicker-theme.scss +4 -4
  357. package/timepicker/index.d.ts +127 -160
  358. package/timepicker/testing/index.d.ts +20 -26
  359. package/toolbar/_toolbar-theme.scss +4 -4
  360. package/toolbar/index.d.ts +15 -26
  361. package/toolbar/testing/index.d.ts +13 -16
  362. package/tooltip/_tooltip-theme.scss +4 -4
  363. package/tooltip/index.d.ts +11 -355
  364. package/tooltip/testing/index.d.ts +7 -10
  365. package/tree/_tree-theme.scss +3 -3
  366. package/tree/index.d.ts +117 -163
  367. package/tree/testing/index.d.ts +52 -58
  368. /package/core/tokens/m3/definitions/{unused/_md-comp-filled-tonal-button.scss → _md-comp-filled-tonal-button.scss} +0 -0
package/fesm2022/core.mjs CHANGED
@@ -1,17 +1,32 @@
1
+ export { _ as _MatInternalFormField } from './internal-form-field-434c4039.mjs';
1
2
  import * as i0 from '@angular/core';
2
- import { Version, InjectionToken, inject, NgModule, LOCALE_ID, Injectable, Component, ViewEncapsulation, ChangeDetectionStrategy, Directive, ElementRef, ANIMATION_MODULE_TYPE, NgZone, Injector, Input, booleanAttribute, ChangeDetectorRef, EventEmitter, isSignal, Output, ViewChild, RendererFactory2 } from '@angular/core';
3
- import { HighContrastModeDetector, isFakeMousedownFromScreenReader, isFakeTouchstartFromScreenReader, _IdGenerator } from '@angular/cdk/a11y';
4
- import { BidiModule } from '@angular/cdk/bidi';
5
- import { Subject } from 'rxjs';
6
- import { startWith } from 'rxjs/operators';
7
- import { normalizePassiveListenerOptions, _getEventTarget, Platform, _bindEventWithOptions } from '@angular/cdk/platform';
8
- import { coerceElement } from '@angular/cdk/coercion';
9
- import { _CdkPrivateStyleLoader, _VisuallyHiddenLoader } from '@angular/cdk/private';
10
- import { ENTER, SPACE, hasModifierKey } from '@angular/cdk/keycodes';
11
- import { DOCUMENT } from '@angular/common';
3
+ import { Version, inject, Injectable, NgModule } from '@angular/core';
4
+ export { a as MATERIAL_SANITY_CHECKS, M as MatCommonModule } from './common-module-2d64df09.mjs';
5
+ export { _ as _ErrorStateTracker } from './error-state-8f4ce1af.mjs';
6
+ import { D as DateAdapter, M as MAT_DATE_LOCALE, a as MAT_DATE_FORMATS } from './date-formats-b618acb8.mjs';
7
+ export { D as DateAdapter, a as MAT_DATE_FORMATS, M as MAT_DATE_LOCALE, b as MAT_DATE_LOCALE_FACTORY } from './date-formats-b618acb8.mjs';
8
+ export { E as ErrorStateMatcher, S as ShowOnDirtyErrorStateMatcher } from './error-options-4a00765e.mjs';
9
+ export { _ as _StructuralStylesLoader } from './structural-styles-d5ada3b3.mjs';
10
+ export { M as MatLine, a as MatLineModule, s as setLines } from './line-d6afe347.mjs';
11
+ export { b as MAT_OPTGROUP, M as MAT_OPTION_PARENT_COMPONENT, e as MatOptgroup, a as MatOption, c as MatOptionSelectionChange, _ as _countGroupLabelsBeforeOption, d as _getOptionScrollPosition } from './option-07c3c660.mjs';
12
+ export { M as MatOptionModule } from './index-1763d3a6.mjs';
13
+ export { M as MatRippleLoader } from './ripple-loader-f2078c66.mjs';
14
+ export { a as MAT_RIPPLE_GLOBAL_OPTIONS, M as MatRipple, c as RippleRef, R as RippleRenderer, b as RippleState, d as defaultRippleAnimationConfig } from './ripple-9939d1f5.mjs';
15
+ export { M as MatRippleModule } from './index-4bc1d6d3.mjs';
16
+ export { M as MatPseudoCheckbox } from './pseudo-checkbox-af5a4ea4.mjs';
17
+ export { M as MatPseudoCheckboxModule } from './pseudo-checkbox-module-216fae38.mjs';
18
+ import '@angular/cdk/a11y';
19
+ import '@angular/cdk/bidi';
20
+ import 'rxjs';
21
+ import 'rxjs/operators';
22
+ import '@angular/cdk/keycodes';
23
+ import '@angular/cdk/private';
24
+ import '@angular/common';
25
+ import '@angular/cdk/platform';
26
+ import '@angular/cdk/coercion';
12
27
 
13
28
  /** Current version of Angular Material. */
14
- const VERSION = new Version('20.0.0-next.0');
29
+ const VERSION = new Version('20.0.0-next.2');
15
30
 
16
31
  /**
17
32
  * @deprecated No longer used, will be removed.
@@ -35,257 +50,6 @@ class AnimationDurations {
35
50
  static EXITING = '195ms';
36
51
  }
37
52
 
38
- /**
39
- * Injection token that configures whether the Material sanity checks are enabled.
40
- * @deprecated No longer used and will be removed.
41
- * @breaking-change 21.0.0
42
- */
43
- const MATERIAL_SANITY_CHECKS = new InjectionToken('mat-sanity-checks', {
44
- providedIn: 'root',
45
- factory: () => true,
46
- });
47
- /**
48
- * Module that captures anything that should be loaded and/or run for *all* Angular Material
49
- * components. This includes Bidi, etc.
50
- *
51
- * This module should be imported to each top-level component module (e.g., MatTabsModule).
52
- * @deprecated No longer used and will be removed.
53
- * @breaking-change 21.0.0
54
- */
55
- class MatCommonModule {
56
- constructor() {
57
- // While A11yModule also does this, we repeat it here to avoid importing A11yModule
58
- // in MatCommonModule.
59
- inject(HighContrastModeDetector)._applyBodyHighContrastModeCssClasses();
60
- }
61
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
62
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.0", ngImport: i0, type: MatCommonModule, imports: [BidiModule], exports: [BidiModule] });
63
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatCommonModule, imports: [BidiModule, BidiModule] });
64
- }
65
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatCommonModule, decorators: [{
66
- type: NgModule,
67
- args: [{
68
- imports: [BidiModule],
69
- exports: [BidiModule],
70
- }]
71
- }], ctorParameters: () => [] });
72
-
73
- /**
74
- * Class that tracks the error state of a component.
75
- * @docs-private
76
- */
77
- class _ErrorStateTracker {
78
- _defaultMatcher;
79
- ngControl;
80
- _parentFormGroup;
81
- _parentForm;
82
- _stateChanges;
83
- /** Whether the tracker is currently in an error state. */
84
- errorState = false;
85
- /** User-defined matcher for the error state. */
86
- matcher;
87
- constructor(_defaultMatcher, ngControl, _parentFormGroup, _parentForm, _stateChanges) {
88
- this._defaultMatcher = _defaultMatcher;
89
- this.ngControl = ngControl;
90
- this._parentFormGroup = _parentFormGroup;
91
- this._parentForm = _parentForm;
92
- this._stateChanges = _stateChanges;
93
- }
94
- /** Updates the error state based on the provided error state matcher. */
95
- updateErrorState() {
96
- const oldState = this.errorState;
97
- const parent = this._parentFormGroup || this._parentForm;
98
- const matcher = this.matcher || this._defaultMatcher;
99
- const control = this.ngControl ? this.ngControl.control : null;
100
- const newState = matcher?.isErrorState(control, parent) ?? false;
101
- if (newState !== oldState) {
102
- this.errorState = newState;
103
- this._stateChanges.next();
104
- }
105
- }
106
- }
107
-
108
- /** InjectionToken for datepicker that can be used to override default locale code. */
109
- const MAT_DATE_LOCALE = new InjectionToken('MAT_DATE_LOCALE', {
110
- providedIn: 'root',
111
- factory: MAT_DATE_LOCALE_FACTORY,
112
- });
113
- /** @docs-private */
114
- function MAT_DATE_LOCALE_FACTORY() {
115
- return inject(LOCALE_ID);
116
- }
117
- const NOT_IMPLEMENTED = 'Method not implemented';
118
- /** Adapts type `D` to be usable as a date by cdk-based components that work with dates. */
119
- class DateAdapter {
120
- /** The locale to use for all dates. */
121
- locale;
122
- _localeChanges = new Subject();
123
- /** A stream that emits when the locale changes. */
124
- localeChanges = this._localeChanges;
125
- /**
126
- * Sets the time of one date to the time of another.
127
- * @param target Date whose time will be set.
128
- * @param hours New hours to set on the date object.
129
- * @param minutes New minutes to set on the date object.
130
- * @param seconds New seconds to set on the date object.
131
- */
132
- setTime(target, hours, minutes, seconds) {
133
- throw new Error(NOT_IMPLEMENTED);
134
- }
135
- /**
136
- * Gets the hours component of the given date.
137
- * @param date The date to extract the hours from.
138
- */
139
- getHours(date) {
140
- throw new Error(NOT_IMPLEMENTED);
141
- }
142
- /**
143
- * Gets the minutes component of the given date.
144
- * @param date The date to extract the minutes from.
145
- */
146
- getMinutes(date) {
147
- throw new Error(NOT_IMPLEMENTED);
148
- }
149
- /**
150
- * Gets the seconds component of the given date.
151
- * @param date The date to extract the seconds from.
152
- */
153
- getSeconds(date) {
154
- throw new Error(NOT_IMPLEMENTED);
155
- }
156
- /**
157
- * Parses a date with a specific time from a user-provided value.
158
- * @param value The value to parse.
159
- * @param parseFormat The expected format of the value being parsed
160
- * (type is implementation-dependent).
161
- */
162
- parseTime(value, parseFormat) {
163
- throw new Error(NOT_IMPLEMENTED);
164
- }
165
- /**
166
- * Adds an amount of seconds to the specified date.
167
- * @param date Date to which to add the seconds.
168
- * @param amount Amount of seconds to add to the date.
169
- */
170
- addSeconds(date, amount) {
171
- throw new Error(NOT_IMPLEMENTED);
172
- }
173
- /**
174
- * Given a potential date object, returns that same date object if it is
175
- * a valid date, or `null` if it's not a valid date.
176
- * @param obj The object to check.
177
- * @returns A date or `null`.
178
- */
179
- getValidDateOrNull(obj) {
180
- return this.isDateInstance(obj) && this.isValid(obj) ? obj : null;
181
- }
182
- /**
183
- * Attempts to deserialize a value to a valid date object. This is different from parsing in that
184
- * deserialize should only accept non-ambiguous, locale-independent formats (e.g. a ISO 8601
185
- * string). The default implementation does not allow any deserialization, it simply checks that
186
- * the given value is already a valid date object or null. The `<mat-datepicker>` will call this
187
- * method on all of its `@Input()` properties that accept dates. It is therefore possible to
188
- * support passing values from your backend directly to these properties by overriding this method
189
- * to also deserialize the format used by your backend.
190
- * @param value The value to be deserialized into a date object.
191
- * @returns The deserialized date object, either a valid date, null if the value can be
192
- * deserialized into a null date (e.g. the empty string), or an invalid date.
193
- */
194
- deserialize(value) {
195
- if (value == null || (this.isDateInstance(value) && this.isValid(value))) {
196
- return value;
197
- }
198
- return this.invalid();
199
- }
200
- /**
201
- * Sets the locale used for all dates.
202
- * @param locale The new locale.
203
- */
204
- setLocale(locale) {
205
- this.locale = locale;
206
- this._localeChanges.next();
207
- }
208
- /**
209
- * Compares two dates.
210
- * @param first The first date to compare.
211
- * @param second The second date to compare.
212
- * @returns 0 if the dates are equal, a number less than 0 if the first date is earlier,
213
- * a number greater than 0 if the first date is later.
214
- */
215
- compareDate(first, second) {
216
- return (this.getYear(first) - this.getYear(second) ||
217
- this.getMonth(first) - this.getMonth(second) ||
218
- this.getDate(first) - this.getDate(second));
219
- }
220
- /**
221
- * Compares the time values of two dates.
222
- * @param first First date to compare.
223
- * @param second Second date to compare.
224
- * @returns 0 if the times are equal, a number less than 0 if the first time is earlier,
225
- * a number greater than 0 if the first time is later.
226
- */
227
- compareTime(first, second) {
228
- return (this.getHours(first) - this.getHours(second) ||
229
- this.getMinutes(first) - this.getMinutes(second) ||
230
- this.getSeconds(first) - this.getSeconds(second));
231
- }
232
- /**
233
- * Checks if two dates are equal.
234
- * @param first The first date to check.
235
- * @param second The second date to check.
236
- * @returns Whether the two dates are equal.
237
- * Null dates are considered equal to other null dates.
238
- */
239
- sameDate(first, second) {
240
- if (first && second) {
241
- let firstValid = this.isValid(first);
242
- let secondValid = this.isValid(second);
243
- if (firstValid && secondValid) {
244
- return !this.compareDate(first, second);
245
- }
246
- return firstValid == secondValid;
247
- }
248
- return first == second;
249
- }
250
- /**
251
- * Checks if the times of two dates are equal.
252
- * @param first The first date to check.
253
- * @param second The second date to check.
254
- * @returns Whether the times of the two dates are equal.
255
- * Null dates are considered equal to other null dates.
256
- */
257
- sameTime(first, second) {
258
- if (first && second) {
259
- const firstValid = this.isValid(first);
260
- const secondValid = this.isValid(second);
261
- if (firstValid && secondValid) {
262
- return !this.compareTime(first, second);
263
- }
264
- return firstValid == secondValid;
265
- }
266
- return first == second;
267
- }
268
- /**
269
- * Clamp the given date between min and max dates.
270
- * @param date The date to clamp.
271
- * @param min The minimum value to allow. If null or omitted no min is enforced.
272
- * @param max The maximum value to allow. If null or omitted no max is enforced.
273
- * @returns `min` if `date` is less than `min`, `max` if date is greater than `max`,
274
- * otherwise `date`.
275
- */
276
- clampDate(date, min, max) {
277
- if (min && this.compareDate(date, min) < 0) {
278
- return min;
279
- }
280
- if (max && this.compareDate(date, max) > 0) {
281
- return max;
282
- }
283
- return date;
284
- }
285
- }
286
-
287
- const MAT_DATE_FORMATS = new InjectionToken('mat-date-formats');
288
-
289
53
  /**
290
54
  * Matches strings that have the form of a valid RFC 3339 string
291
55
  * (https://tools.ietf.org/html/rfc3339). Note that the string may not actually be a valid date
@@ -584,10 +348,10 @@ class NativeDateAdapter extends DateAdapter {
584
348
  }
585
349
  return null;
586
350
  }
587
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: NativeDateAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
588
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: NativeDateAdapter });
351
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: NativeDateAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
352
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: NativeDateAdapter });
589
353
  }
590
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: NativeDateAdapter, decorators: [{
354
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: NativeDateAdapter, decorators: [{
591
355
  type: Injectable
592
356
  }], ctorParameters: () => [] });
593
357
  /** Checks whether a number is within a certain range. */
@@ -611,22 +375,22 @@ const MAT_NATIVE_DATE_FORMATS = {
611
375
  };
612
376
 
613
377
  class NativeDateModule {
614
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: NativeDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
615
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.0", ngImport: i0, type: NativeDateModule });
616
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: NativeDateModule, providers: [{ provide: DateAdapter, useClass: NativeDateAdapter }] });
378
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: NativeDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
379
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0-next.1", ngImport: i0, type: NativeDateModule });
380
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: NativeDateModule, providers: [{ provide: DateAdapter, useClass: NativeDateAdapter }] });
617
381
  }
618
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: NativeDateModule, decorators: [{
382
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: NativeDateModule, decorators: [{
619
383
  type: NgModule,
620
384
  args: [{
621
385
  providers: [{ provide: DateAdapter, useClass: NativeDateAdapter }],
622
386
  }]
623
387
  }] });
624
388
  class MatNativeDateModule {
625
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatNativeDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
626
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.0", ngImport: i0, type: MatNativeDateModule });
627
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatNativeDateModule, providers: [provideNativeDateAdapter()] });
389
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: MatNativeDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
390
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0-next.1", ngImport: i0, type: MatNativeDateModule });
391
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: MatNativeDateModule, providers: [provideNativeDateAdapter()] });
628
392
  }
629
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatNativeDateModule, decorators: [{
393
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: MatNativeDateModule, decorators: [{
630
394
  type: NgModule,
631
395
  args: [{
632
396
  providers: [provideNativeDateAdapter()],
@@ -639,1329 +403,5 @@ function provideNativeDateAdapter(formats = MAT_NATIVE_DATE_FORMATS) {
639
403
  ];
640
404
  }
641
405
 
642
- /** Error state matcher that matches when a control is invalid and dirty. */
643
- class ShowOnDirtyErrorStateMatcher {
644
- isErrorState(control, form) {
645
- return !!(control && control.invalid && (control.dirty || (form && form.submitted)));
646
- }
647
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ShowOnDirtyErrorStateMatcher, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
648
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ShowOnDirtyErrorStateMatcher });
649
- }
650
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ShowOnDirtyErrorStateMatcher, decorators: [{
651
- type: Injectable
652
- }] });
653
- /** Provider that defines how form controls behave with regards to displaying error messages. */
654
- class ErrorStateMatcher {
655
- isErrorState(control, form) {
656
- return !!(control && control.invalid && (control.touched || (form && form.submitted)));
657
- }
658
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ErrorStateMatcher, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
659
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ErrorStateMatcher, providedIn: 'root' });
660
- }
661
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ErrorStateMatcher, decorators: [{
662
- type: Injectable,
663
- args: [{ providedIn: 'root' }]
664
- }] });
665
-
666
- /**
667
- * Component used to load structural styles for focus indicators.
668
- * @docs-private
669
- */
670
- class _StructuralStylesLoader {
671
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: _StructuralStylesLoader, deps: [], target: i0.ɵɵFactoryTarget.Component });
672
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.0", type: _StructuralStylesLoader, isStandalone: true, selector: "structural-styles", ngImport: i0, template: '', isInline: true, styles: [".mat-focus-indicator{position:relative}.mat-focus-indicator::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;display:var(--mat-focus-indicator-display, none);border-width:var(--mat-focus-indicator-border-width, 3px);border-style:var(--mat-focus-indicator-border-style, solid);border-color:var(--mat-focus-indicator-border-color, transparent);border-radius:var(--mat-focus-indicator-border-radius, 4px)}.mat-focus-indicator:focus::before{content:\"\"}@media(forced-colors: active){html{--mat-focus-indicator-display: block}}"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
673
- }
674
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: _StructuralStylesLoader, decorators: [{
675
- type: Component,
676
- args: [{ selector: 'structural-styles', encapsulation: ViewEncapsulation.None, template: '', changeDetection: ChangeDetectionStrategy.OnPush, styles: [".mat-focus-indicator{position:relative}.mat-focus-indicator::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;display:var(--mat-focus-indicator-display, none);border-width:var(--mat-focus-indicator-border-width, 3px);border-style:var(--mat-focus-indicator-border-style, solid);border-color:var(--mat-focus-indicator-border-color, transparent);border-radius:var(--mat-focus-indicator-border-radius, 4px)}.mat-focus-indicator:focus::before{content:\"\"}@media(forced-colors: active){html{--mat-focus-indicator-display: block}}"] }]
677
- }] });
678
-
679
- /**
680
- * Shared directive to count lines inside a text area, such as a list item.
681
- * Line elements can be extracted with a @ContentChildren(MatLine) query, then
682
- * counted by checking the query list's length.
683
- */
684
- class MatLine {
685
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatLine, deps: [], target: i0.ɵɵFactoryTarget.Directive });
686
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.0", type: MatLine, isStandalone: true, selector: "[mat-line], [matLine]", host: { classAttribute: "mat-line" }, ngImport: i0 });
687
- }
688
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatLine, decorators: [{
689
- type: Directive,
690
- args: [{
691
- selector: '[mat-line], [matLine]',
692
- host: { 'class': 'mat-line' },
693
- }]
694
- }] });
695
- /**
696
- * Helper that takes a query list of lines and sets the correct class on the host.
697
- * @docs-private
698
- */
699
- function setLines(lines, element, prefix = 'mat') {
700
- // Note: doesn't need to unsubscribe, because `changes`
701
- // gets completed by Angular when the view is destroyed.
702
- lines.changes.pipe(startWith(lines)).subscribe(({ length }) => {
703
- setClass(element, `${prefix}-2-line`, false);
704
- setClass(element, `${prefix}-3-line`, false);
705
- setClass(element, `${prefix}-multi-line`, false);
706
- if (length === 2 || length === 3) {
707
- setClass(element, `${prefix}-${length}-line`, true);
708
- }
709
- else if (length > 3) {
710
- setClass(element, `${prefix}-multi-line`, true);
711
- }
712
- });
713
- }
714
- /** Adds or removes a class from an element. */
715
- function setClass(element, className, isAdd) {
716
- element.nativeElement.classList.toggle(className, isAdd);
717
- }
718
- class MatLineModule {
719
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatLineModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
720
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.0", ngImport: i0, type: MatLineModule, imports: [MatCommonModule, MatLine], exports: [MatLine, MatCommonModule] });
721
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatLineModule, imports: [MatCommonModule, MatCommonModule] });
722
- }
723
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatLineModule, decorators: [{
724
- type: NgModule,
725
- args: [{
726
- imports: [MatCommonModule, MatLine],
727
- exports: [MatLine, MatCommonModule],
728
- }]
729
- }] });
730
-
731
- /** Possible states for a ripple element. */
732
- var RippleState;
733
- (function (RippleState) {
734
- RippleState[RippleState["FADING_IN"] = 0] = "FADING_IN";
735
- RippleState[RippleState["VISIBLE"] = 1] = "VISIBLE";
736
- RippleState[RippleState["FADING_OUT"] = 2] = "FADING_OUT";
737
- RippleState[RippleState["HIDDEN"] = 3] = "HIDDEN";
738
- })(RippleState || (RippleState = {}));
739
- /**
740
- * Reference to a previously launched ripple element.
741
- */
742
- class RippleRef {
743
- _renderer;
744
- element;
745
- config;
746
- _animationForciblyDisabledThroughCss;
747
- /** Current state of the ripple. */
748
- state = RippleState.HIDDEN;
749
- constructor(_renderer,
750
- /** Reference to the ripple HTML element. */
751
- element,
752
- /** Ripple configuration used for the ripple. */
753
- config,
754
- /* Whether animations are forcibly disabled for ripples through CSS. */
755
- _animationForciblyDisabledThroughCss = false) {
756
- this._renderer = _renderer;
757
- this.element = element;
758
- this.config = config;
759
- this._animationForciblyDisabledThroughCss = _animationForciblyDisabledThroughCss;
760
- }
761
- /** Fades out the ripple element. */
762
- fadeOut() {
763
- this._renderer.fadeOutRipple(this);
764
- }
765
- }
766
-
767
- /** Options used to bind a passive capturing event. */
768
- const passiveCapturingEventOptions$1 = normalizePassiveListenerOptions({
769
- passive: true,
770
- capture: true,
771
- });
772
- /** Manages events through delegation so that as few event handlers as possible are bound. */
773
- class RippleEventManager {
774
- _events = new Map();
775
- /** Adds an event handler. */
776
- addHandler(ngZone, name, element, handler) {
777
- const handlersForEvent = this._events.get(name);
778
- if (handlersForEvent) {
779
- const handlersForElement = handlersForEvent.get(element);
780
- if (handlersForElement) {
781
- handlersForElement.add(handler);
782
- }
783
- else {
784
- handlersForEvent.set(element, new Set([handler]));
785
- }
786
- }
787
- else {
788
- this._events.set(name, new Map([[element, new Set([handler])]]));
789
- ngZone.runOutsideAngular(() => {
790
- document.addEventListener(name, this._delegateEventHandler, passiveCapturingEventOptions$1);
791
- });
792
- }
793
- }
794
- /** Removes an event handler. */
795
- removeHandler(name, element, handler) {
796
- const handlersForEvent = this._events.get(name);
797
- if (!handlersForEvent) {
798
- return;
799
- }
800
- const handlersForElement = handlersForEvent.get(element);
801
- if (!handlersForElement) {
802
- return;
803
- }
804
- handlersForElement.delete(handler);
805
- if (handlersForElement.size === 0) {
806
- handlersForEvent.delete(element);
807
- }
808
- if (handlersForEvent.size === 0) {
809
- this._events.delete(name);
810
- document.removeEventListener(name, this._delegateEventHandler, passiveCapturingEventOptions$1);
811
- }
812
- }
813
- /** Event handler that is bound and which dispatches the events to the different targets. */
814
- _delegateEventHandler = (event) => {
815
- const target = _getEventTarget(event);
816
- if (target) {
817
- this._events.get(event.type)?.forEach((handlers, element) => {
818
- if (element === target || element.contains(target)) {
819
- handlers.forEach(handler => handler.handleEvent(event));
820
- }
821
- });
822
- }
823
- };
824
- }
825
-
826
- /**
827
- * Default ripple animation configuration for ripples without an explicit
828
- * animation config specified.
829
- */
830
- const defaultRippleAnimationConfig = {
831
- enterDuration: 225,
832
- exitDuration: 150,
833
- };
834
- /**
835
- * Timeout for ignoring mouse events. Mouse events will be temporary ignored after touch
836
- * events to avoid synthetic mouse events.
837
- */
838
- const ignoreMouseEventsTimeout = 800;
839
- /** Options used to bind a passive capturing event. */
840
- const passiveCapturingEventOptions = normalizePassiveListenerOptions({
841
- passive: true,
842
- capture: true,
843
- });
844
- /** Events that signal that the pointer is down. */
845
- const pointerDownEvents = ['mousedown', 'touchstart'];
846
- /** Events that signal that the pointer is up. */
847
- const pointerUpEvents = ['mouseup', 'mouseleave', 'touchend', 'touchcancel'];
848
- class _MatRippleStylesLoader {
849
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: _MatRippleStylesLoader, deps: [], target: i0.ɵɵFactoryTarget.Component });
850
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.0", type: _MatRippleStylesLoader, isStandalone: true, selector: "ng-component", host: { attributes: { "mat-ripple-style-loader": "" } }, ngImport: i0, template: '', isInline: true, styles: [".mat-ripple{overflow:hidden;position:relative}.mat-ripple:not(:empty){transform:translateZ(0)}.mat-ripple.mat-ripple-unbounded{overflow:visible}.mat-ripple-element{position:absolute;border-radius:50%;pointer-events:none;transition:opacity,transform 0ms cubic-bezier(0, 0, 0.2, 1);transform:scale3d(0, 0, 0);background-color:var(--mat-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface) 10%, transparent))}@media(forced-colors: active){.mat-ripple-element{display:none}}.cdk-drag-preview .mat-ripple-element,.cdk-drag-placeholder .mat-ripple-element{display:none}"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
851
- }
852
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: _MatRippleStylesLoader, decorators: [{
853
- type: Component,
854
- args: [{ template: '', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { 'mat-ripple-style-loader': '' }, styles: [".mat-ripple{overflow:hidden;position:relative}.mat-ripple:not(:empty){transform:translateZ(0)}.mat-ripple.mat-ripple-unbounded{overflow:visible}.mat-ripple-element{position:absolute;border-radius:50%;pointer-events:none;transition:opacity,transform 0ms cubic-bezier(0, 0, 0.2, 1);transform:scale3d(0, 0, 0);background-color:var(--mat-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface) 10%, transparent))}@media(forced-colors: active){.mat-ripple-element{display:none}}.cdk-drag-preview .mat-ripple-element,.cdk-drag-placeholder .mat-ripple-element{display:none}"] }]
855
- }] });
856
- /**
857
- * Helper service that performs DOM manipulations. Not intended to be used outside this module.
858
- * The constructor takes a reference to the ripple directive's host element and a map of DOM
859
- * event handlers to be installed on the element that triggers ripple animations.
860
- * This will eventually become a custom renderer once Angular support exists.
861
- * @docs-private
862
- */
863
- class RippleRenderer {
864
- _target;
865
- _ngZone;
866
- _platform;
867
- /** Element where the ripples are being added to. */
868
- _containerElement;
869
- /** Element which triggers the ripple elements on mouse events. */
870
- _triggerElement;
871
- /** Whether the pointer is currently down or not. */
872
- _isPointerDown = false;
873
- /**
874
- * Map of currently active ripple references.
875
- * The ripple reference is mapped to its element event listeners.
876
- * The reason why `| null` is used is that event listeners are added only
877
- * when the condition is truthy (see the `_startFadeOutTransition` method).
878
- */
879
- _activeRipples = new Map();
880
- /** Latest non-persistent ripple that was triggered. */
881
- _mostRecentTransientRipple;
882
- /** Time in milliseconds when the last touchstart event happened. */
883
- _lastTouchStartEvent;
884
- /** Whether pointer-up event listeners have been registered. */
885
- _pointerUpEventsRegistered = false;
886
- /**
887
- * Cached dimensions of the ripple container. Set when the first
888
- * ripple is shown and cleared once no more ripples are visible.
889
- */
890
- _containerRect;
891
- static _eventManager = new RippleEventManager();
892
- constructor(_target, _ngZone, elementOrElementRef, _platform, injector) {
893
- this._target = _target;
894
- this._ngZone = _ngZone;
895
- this._platform = _platform;
896
- // Only do anything if we're on the browser.
897
- if (_platform.isBrowser) {
898
- this._containerElement = coerceElement(elementOrElementRef);
899
- }
900
- if (injector) {
901
- injector.get(_CdkPrivateStyleLoader).load(_MatRippleStylesLoader);
902
- }
903
- }
904
- /**
905
- * Fades in a ripple at the given coordinates.
906
- * @param x Coordinate within the element, along the X axis at which to start the ripple.
907
- * @param y Coordinate within the element, along the Y axis at which to start the ripple.
908
- * @param config Extra ripple options.
909
- */
910
- fadeInRipple(x, y, config = {}) {
911
- const containerRect = (this._containerRect =
912
- this._containerRect || this._containerElement.getBoundingClientRect());
913
- const animationConfig = { ...defaultRippleAnimationConfig, ...config.animation };
914
- if (config.centered) {
915
- x = containerRect.left + containerRect.width / 2;
916
- y = containerRect.top + containerRect.height / 2;
917
- }
918
- const radius = config.radius || distanceToFurthestCorner(x, y, containerRect);
919
- const offsetX = x - containerRect.left;
920
- const offsetY = y - containerRect.top;
921
- const enterDuration = animationConfig.enterDuration;
922
- const ripple = document.createElement('div');
923
- ripple.classList.add('mat-ripple-element');
924
- ripple.style.left = `${offsetX - radius}px`;
925
- ripple.style.top = `${offsetY - radius}px`;
926
- ripple.style.height = `${radius * 2}px`;
927
- ripple.style.width = `${radius * 2}px`;
928
- // If a custom color has been specified, set it as inline style. If no color is
929
- // set, the default color will be applied through the ripple theme styles.
930
- if (config.color != null) {
931
- ripple.style.backgroundColor = config.color;
932
- }
933
- ripple.style.transitionDuration = `${enterDuration}ms`;
934
- this._containerElement.appendChild(ripple);
935
- // By default the browser does not recalculate the styles of dynamically created
936
- // ripple elements. This is critical to ensure that the `scale` animates properly.
937
- // We enforce a style recalculation by calling `getComputedStyle` and *accessing* a property.
938
- // See: https://gist.github.com/paulirish/5d52fb081b3570c81e3a
939
- const computedStyles = window.getComputedStyle(ripple);
940
- const userTransitionProperty = computedStyles.transitionProperty;
941
- const userTransitionDuration = computedStyles.transitionDuration;
942
- // Note: We detect whether animation is forcibly disabled through CSS (e.g. through
943
- // `transition: none` or `display: none`). This is technically unexpected since animations are
944
- // controlled through the animation config, but this exists for backwards compatibility. This
945
- // logic does not need to be super accurate since it covers some edge cases which can be easily
946
- // avoided by users.
947
- const animationForciblyDisabledThroughCss = userTransitionProperty === 'none' ||
948
- // Note: The canonical unit for serialized CSS `<time>` properties is seconds. Additionally
949
- // some browsers expand the duration for every property (in our case `opacity` and `transform`).
950
- userTransitionDuration === '0s' ||
951
- userTransitionDuration === '0s, 0s' ||
952
- // If the container is 0x0, it's likely `display: none`.
953
- (containerRect.width === 0 && containerRect.height === 0);
954
- // Exposed reference to the ripple that will be returned.
955
- const rippleRef = new RippleRef(this, ripple, config, animationForciblyDisabledThroughCss);
956
- // Start the enter animation by setting the transform/scale to 100%. The animation will
957
- // execute as part of this statement because we forced a style recalculation before.
958
- // Note: We use a 3d transform here in order to avoid an issue in Safari where
959
- // the ripples aren't clipped when inside the shadow DOM (see #24028).
960
- ripple.style.transform = 'scale3d(1, 1, 1)';
961
- rippleRef.state = RippleState.FADING_IN;
962
- if (!config.persistent) {
963
- this._mostRecentTransientRipple = rippleRef;
964
- }
965
- let eventListeners = null;
966
- // Do not register the `transition` event listener if fade-in and fade-out duration
967
- // are set to zero. The events won't fire anyway and we can save resources here.
968
- if (!animationForciblyDisabledThroughCss && (enterDuration || animationConfig.exitDuration)) {
969
- this._ngZone.runOutsideAngular(() => {
970
- const onTransitionEnd = () => {
971
- // Clear the fallback timer since the transition fired correctly.
972
- if (eventListeners) {
973
- eventListeners.fallbackTimer = null;
974
- }
975
- clearTimeout(fallbackTimer);
976
- this._finishRippleTransition(rippleRef);
977
- };
978
- const onTransitionCancel = () => this._destroyRipple(rippleRef);
979
- // In some cases where there's a higher load on the browser, it can choose not to dispatch
980
- // neither `transitionend` nor `transitioncancel` (see b/227356674). This timer serves as a
981
- // fallback for such cases so that the ripple doesn't become stuck. We add a 100ms buffer
982
- // because timers aren't precise. Note that another approach can be to transition the ripple
983
- // to the `VISIBLE` state immediately above and to `FADING_IN` afterwards inside
984
- // `transitionstart`. We go with the timer because it's one less event listener and
985
- // it's less likely to break existing tests.
986
- const fallbackTimer = setTimeout(onTransitionCancel, enterDuration + 100);
987
- ripple.addEventListener('transitionend', onTransitionEnd);
988
- // If the transition is cancelled (e.g. due to DOM removal), we destroy the ripple
989
- // directly as otherwise we would keep it part of the ripple container forever.
990
- // https://www.w3.org/TR/css-transitions-1/#:~:text=no%20longer%20in%20the%20document.
991
- ripple.addEventListener('transitioncancel', onTransitionCancel);
992
- eventListeners = { onTransitionEnd, onTransitionCancel, fallbackTimer };
993
- });
994
- }
995
- // Add the ripple reference to the list of all active ripples.
996
- this._activeRipples.set(rippleRef, eventListeners);
997
- // In case there is no fade-in transition duration, we need to manually call the transition
998
- // end listener because `transitionend` doesn't fire if there is no transition.
999
- if (animationForciblyDisabledThroughCss || !enterDuration) {
1000
- this._finishRippleTransition(rippleRef);
1001
- }
1002
- return rippleRef;
1003
- }
1004
- /** Fades out a ripple reference. */
1005
- fadeOutRipple(rippleRef) {
1006
- // For ripples already fading out or hidden, this should be a noop.
1007
- if (rippleRef.state === RippleState.FADING_OUT || rippleRef.state === RippleState.HIDDEN) {
1008
- return;
1009
- }
1010
- const rippleEl = rippleRef.element;
1011
- const animationConfig = { ...defaultRippleAnimationConfig, ...rippleRef.config.animation };
1012
- // This starts the fade-out transition and will fire the transition end listener that
1013
- // removes the ripple element from the DOM.
1014
- rippleEl.style.transitionDuration = `${animationConfig.exitDuration}ms`;
1015
- rippleEl.style.opacity = '0';
1016
- rippleRef.state = RippleState.FADING_OUT;
1017
- // In case there is no fade-out transition duration, we need to manually call the
1018
- // transition end listener because `transitionend` doesn't fire if there is no transition.
1019
- if (rippleRef._animationForciblyDisabledThroughCss || !animationConfig.exitDuration) {
1020
- this._finishRippleTransition(rippleRef);
1021
- }
1022
- }
1023
- /** Fades out all currently active ripples. */
1024
- fadeOutAll() {
1025
- this._getActiveRipples().forEach(ripple => ripple.fadeOut());
1026
- }
1027
- /** Fades out all currently active non-persistent ripples. */
1028
- fadeOutAllNonPersistent() {
1029
- this._getActiveRipples().forEach(ripple => {
1030
- if (!ripple.config.persistent) {
1031
- ripple.fadeOut();
1032
- }
1033
- });
1034
- }
1035
- /** Sets up the trigger event listeners */
1036
- setupTriggerEvents(elementOrElementRef) {
1037
- const element = coerceElement(elementOrElementRef);
1038
- if (!this._platform.isBrowser || !element || element === this._triggerElement) {
1039
- return;
1040
- }
1041
- // Remove all previously registered event listeners from the trigger element.
1042
- this._removeTriggerEvents();
1043
- this._triggerElement = element;
1044
- // Use event delegation for the trigger events since they're
1045
- // set up during creation and are performance-sensitive.
1046
- pointerDownEvents.forEach(type => {
1047
- RippleRenderer._eventManager.addHandler(this._ngZone, type, element, this);
1048
- });
1049
- }
1050
- /**
1051
- * Handles all registered events.
1052
- * @docs-private
1053
- */
1054
- handleEvent(event) {
1055
- if (event.type === 'mousedown') {
1056
- this._onMousedown(event);
1057
- }
1058
- else if (event.type === 'touchstart') {
1059
- this._onTouchStart(event);
1060
- }
1061
- else {
1062
- this._onPointerUp();
1063
- }
1064
- // If pointer-up events haven't been registered yet, do so now.
1065
- // We do this on-demand in order to reduce the total number of event listeners
1066
- // registered by the ripples, which speeds up the rendering time for large UIs.
1067
- if (!this._pointerUpEventsRegistered) {
1068
- // The events for hiding the ripple are bound directly on the trigger, because:
1069
- // 1. Some of them occur frequently (e.g. `mouseleave`) and any advantage we get from
1070
- // delegation will be diminished by having to look through all the data structures often.
1071
- // 2. They aren't as performance-sensitive, because they're bound only after the user
1072
- // has interacted with an element.
1073
- this._ngZone.runOutsideAngular(() => {
1074
- pointerUpEvents.forEach(type => {
1075
- this._triggerElement.addEventListener(type, this, passiveCapturingEventOptions);
1076
- });
1077
- });
1078
- this._pointerUpEventsRegistered = true;
1079
- }
1080
- }
1081
- /** Method that will be called if the fade-in or fade-in transition completed. */
1082
- _finishRippleTransition(rippleRef) {
1083
- if (rippleRef.state === RippleState.FADING_IN) {
1084
- this._startFadeOutTransition(rippleRef);
1085
- }
1086
- else if (rippleRef.state === RippleState.FADING_OUT) {
1087
- this._destroyRipple(rippleRef);
1088
- }
1089
- }
1090
- /**
1091
- * Starts the fade-out transition of the given ripple if it's not persistent and the pointer
1092
- * is not held down anymore.
1093
- */
1094
- _startFadeOutTransition(rippleRef) {
1095
- const isMostRecentTransientRipple = rippleRef === this._mostRecentTransientRipple;
1096
- const { persistent } = rippleRef.config;
1097
- rippleRef.state = RippleState.VISIBLE;
1098
- // When the timer runs out while the user has kept their pointer down, we want to
1099
- // keep only the persistent ripples and the latest transient ripple. We do this,
1100
- // because we don't want stacked transient ripples to appear after their enter
1101
- // animation has finished.
1102
- if (!persistent && (!isMostRecentTransientRipple || !this._isPointerDown)) {
1103
- rippleRef.fadeOut();
1104
- }
1105
- }
1106
- /** Destroys the given ripple by removing it from the DOM and updating its state. */
1107
- _destroyRipple(rippleRef) {
1108
- const eventListeners = this._activeRipples.get(rippleRef) ?? null;
1109
- this._activeRipples.delete(rippleRef);
1110
- // Clear out the cached bounding rect if we have no more ripples.
1111
- if (!this._activeRipples.size) {
1112
- this._containerRect = null;
1113
- }
1114
- // If the current ref is the most recent transient ripple, unset it
1115
- // avoid memory leaks.
1116
- if (rippleRef === this._mostRecentTransientRipple) {
1117
- this._mostRecentTransientRipple = null;
1118
- }
1119
- rippleRef.state = RippleState.HIDDEN;
1120
- if (eventListeners !== null) {
1121
- rippleRef.element.removeEventListener('transitionend', eventListeners.onTransitionEnd);
1122
- rippleRef.element.removeEventListener('transitioncancel', eventListeners.onTransitionCancel);
1123
- if (eventListeners.fallbackTimer !== null) {
1124
- clearTimeout(eventListeners.fallbackTimer);
1125
- }
1126
- }
1127
- rippleRef.element.remove();
1128
- }
1129
- /** Function being called whenever the trigger is being pressed using mouse. */
1130
- _onMousedown(event) {
1131
- // Screen readers will fire fake mouse events for space/enter. Skip launching a
1132
- // ripple in this case for consistency with the non-screen-reader experience.
1133
- const isFakeMousedown = isFakeMousedownFromScreenReader(event);
1134
- const isSyntheticEvent = this._lastTouchStartEvent &&
1135
- Date.now() < this._lastTouchStartEvent + ignoreMouseEventsTimeout;
1136
- if (!this._target.rippleDisabled && !isFakeMousedown && !isSyntheticEvent) {
1137
- this._isPointerDown = true;
1138
- this.fadeInRipple(event.clientX, event.clientY, this._target.rippleConfig);
1139
- }
1140
- }
1141
- /** Function being called whenever the trigger is being pressed using touch. */
1142
- _onTouchStart(event) {
1143
- if (!this._target.rippleDisabled && !isFakeTouchstartFromScreenReader(event)) {
1144
- // Some browsers fire mouse events after a `touchstart` event. Those synthetic mouse
1145
- // events will launch a second ripple if we don't ignore mouse events for a specific
1146
- // time after a touchstart event.
1147
- this._lastTouchStartEvent = Date.now();
1148
- this._isPointerDown = true;
1149
- // Use `changedTouches` so we skip any touches where the user put
1150
- // their finger down, but used another finger to tap the element again.
1151
- const touches = event.changedTouches;
1152
- // According to the typings the touches should always be defined, but in some cases
1153
- // the browser appears to not assign them in tests which leads to flakes.
1154
- if (touches) {
1155
- for (let i = 0; i < touches.length; i++) {
1156
- this.fadeInRipple(touches[i].clientX, touches[i].clientY, this._target.rippleConfig);
1157
- }
1158
- }
1159
- }
1160
- }
1161
- /** Function being called whenever the trigger is being released. */
1162
- _onPointerUp() {
1163
- if (!this._isPointerDown) {
1164
- return;
1165
- }
1166
- this._isPointerDown = false;
1167
- // Fade-out all ripples that are visible and not persistent.
1168
- this._getActiveRipples().forEach(ripple => {
1169
- // By default, only ripples that are completely visible will fade out on pointer release.
1170
- // If the `terminateOnPointerUp` option is set, ripples that still fade in will also fade out.
1171
- const isVisible = ripple.state === RippleState.VISIBLE ||
1172
- (ripple.config.terminateOnPointerUp && ripple.state === RippleState.FADING_IN);
1173
- if (!ripple.config.persistent && isVisible) {
1174
- ripple.fadeOut();
1175
- }
1176
- });
1177
- }
1178
- _getActiveRipples() {
1179
- return Array.from(this._activeRipples.keys());
1180
- }
1181
- /** Removes previously registered event listeners from the trigger element. */
1182
- _removeTriggerEvents() {
1183
- const trigger = this._triggerElement;
1184
- if (trigger) {
1185
- pointerDownEvents.forEach(type => RippleRenderer._eventManager.removeHandler(type, trigger, this));
1186
- if (this._pointerUpEventsRegistered) {
1187
- pointerUpEvents.forEach(type => trigger.removeEventListener(type, this, passiveCapturingEventOptions));
1188
- this._pointerUpEventsRegistered = false;
1189
- }
1190
- }
1191
- }
1192
- }
1193
- /**
1194
- * Returns the distance from the point (x, y) to the furthest corner of a rectangle.
1195
- */
1196
- function distanceToFurthestCorner(x, y, rect) {
1197
- const distX = Math.max(Math.abs(x - rect.left), Math.abs(x - rect.right));
1198
- const distY = Math.max(Math.abs(y - rect.top), Math.abs(y - rect.bottom));
1199
- return Math.sqrt(distX * distX + distY * distY);
1200
- }
1201
-
1202
- /** Injection token that can be used to specify the global ripple options. */
1203
- const MAT_RIPPLE_GLOBAL_OPTIONS = new InjectionToken('mat-ripple-global-options');
1204
- class MatRipple {
1205
- _elementRef = inject(ElementRef);
1206
- _animationMode = inject(ANIMATION_MODULE_TYPE, { optional: true });
1207
- /** Custom color for all ripples. */
1208
- color;
1209
- /** Whether the ripples should be visible outside the component's bounds. */
1210
- unbounded;
1211
- /**
1212
- * Whether the ripple always originates from the center of the host element's bounds, rather
1213
- * than originating from the location of the click event.
1214
- */
1215
- centered;
1216
- /**
1217
- * If set, the radius in pixels of foreground ripples when fully expanded. If unset, the radius
1218
- * will be the distance from the center of the ripple to the furthest corner of the host element's
1219
- * bounding rectangle.
1220
- */
1221
- radius = 0;
1222
- /**
1223
- * Configuration for the ripple animation. Allows modifying the enter and exit animation
1224
- * duration of the ripples. The animation durations will be overwritten if the
1225
- * `NoopAnimationsModule` is being used.
1226
- */
1227
- animation;
1228
- /**
1229
- * Whether click events will not trigger the ripple. Ripples can be still launched manually
1230
- * by using the `launch()` method.
1231
- */
1232
- get disabled() {
1233
- return this._disabled;
1234
- }
1235
- set disabled(value) {
1236
- if (value) {
1237
- this.fadeOutAllNonPersistent();
1238
- }
1239
- this._disabled = value;
1240
- this._setupTriggerEventsIfEnabled();
1241
- }
1242
- _disabled = false;
1243
- /**
1244
- * The element that triggers the ripple when click events are received.
1245
- * Defaults to the directive's host element.
1246
- */
1247
- get trigger() {
1248
- return this._trigger || this._elementRef.nativeElement;
1249
- }
1250
- set trigger(trigger) {
1251
- this._trigger = trigger;
1252
- this._setupTriggerEventsIfEnabled();
1253
- }
1254
- _trigger;
1255
- /** Renderer for the ripple DOM manipulations. */
1256
- _rippleRenderer;
1257
- /** Options that are set globally for all ripples. */
1258
- _globalOptions;
1259
- /** @docs-private Whether ripple directive is initialized and the input bindings are set. */
1260
- _isInitialized = false;
1261
- constructor() {
1262
- const ngZone = inject(NgZone);
1263
- const platform = inject(Platform);
1264
- const globalOptions = inject(MAT_RIPPLE_GLOBAL_OPTIONS, { optional: true });
1265
- const injector = inject(Injector);
1266
- // Note: cannot use `inject()` here, because this class
1267
- // gets instantiated manually in the ripple loader.
1268
- this._globalOptions = globalOptions || {};
1269
- this._rippleRenderer = new RippleRenderer(this, ngZone, this._elementRef, platform, injector);
1270
- }
1271
- ngOnInit() {
1272
- this._isInitialized = true;
1273
- this._setupTriggerEventsIfEnabled();
1274
- }
1275
- ngOnDestroy() {
1276
- this._rippleRenderer._removeTriggerEvents();
1277
- }
1278
- /** Fades out all currently showing ripple elements. */
1279
- fadeOutAll() {
1280
- this._rippleRenderer.fadeOutAll();
1281
- }
1282
- /** Fades out all currently showing non-persistent ripple elements. */
1283
- fadeOutAllNonPersistent() {
1284
- this._rippleRenderer.fadeOutAllNonPersistent();
1285
- }
1286
- /**
1287
- * Ripple configuration from the directive's input values.
1288
- * @docs-private Implemented as part of RippleTarget
1289
- */
1290
- get rippleConfig() {
1291
- return {
1292
- centered: this.centered,
1293
- radius: this.radius,
1294
- color: this.color,
1295
- animation: {
1296
- ...this._globalOptions.animation,
1297
- ...(this._animationMode === 'NoopAnimations' ? { enterDuration: 0, exitDuration: 0 } : {}),
1298
- ...this.animation,
1299
- },
1300
- terminateOnPointerUp: this._globalOptions.terminateOnPointerUp,
1301
- };
1302
- }
1303
- /**
1304
- * Whether ripples on pointer-down are disabled or not.
1305
- * @docs-private Implemented as part of RippleTarget
1306
- */
1307
- get rippleDisabled() {
1308
- return this.disabled || !!this._globalOptions.disabled;
1309
- }
1310
- /** Sets up the trigger event listeners if ripples are enabled. */
1311
- _setupTriggerEventsIfEnabled() {
1312
- if (!this.disabled && this._isInitialized) {
1313
- this._rippleRenderer.setupTriggerEvents(this.trigger);
1314
- }
1315
- }
1316
- /** Launches a manual ripple at the specified coordinated or just by the ripple config. */
1317
- launch(configOrX, y = 0, config) {
1318
- if (typeof configOrX === 'number') {
1319
- return this._rippleRenderer.fadeInRipple(configOrX, y, { ...this.rippleConfig, ...config });
1320
- }
1321
- else {
1322
- return this._rippleRenderer.fadeInRipple(0, 0, { ...this.rippleConfig, ...configOrX });
1323
- }
1324
- }
1325
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatRipple, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1326
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.0", type: MatRipple, isStandalone: true, selector: "[mat-ripple], [matRipple]", inputs: { color: ["matRippleColor", "color"], unbounded: ["matRippleUnbounded", "unbounded"], centered: ["matRippleCentered", "centered"], radius: ["matRippleRadius", "radius"], animation: ["matRippleAnimation", "animation"], disabled: ["matRippleDisabled", "disabled"], trigger: ["matRippleTrigger", "trigger"] }, host: { properties: { "class.mat-ripple-unbounded": "unbounded" }, classAttribute: "mat-ripple" }, exportAs: ["matRipple"], ngImport: i0 });
1327
- }
1328
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatRipple, decorators: [{
1329
- type: Directive,
1330
- args: [{
1331
- selector: '[mat-ripple], [matRipple]',
1332
- exportAs: 'matRipple',
1333
- host: {
1334
- 'class': 'mat-ripple',
1335
- '[class.mat-ripple-unbounded]': 'unbounded',
1336
- },
1337
- }]
1338
- }], ctorParameters: () => [], propDecorators: { color: [{
1339
- type: Input,
1340
- args: ['matRippleColor']
1341
- }], unbounded: [{
1342
- type: Input,
1343
- args: ['matRippleUnbounded']
1344
- }], centered: [{
1345
- type: Input,
1346
- args: ['matRippleCentered']
1347
- }], radius: [{
1348
- type: Input,
1349
- args: ['matRippleRadius']
1350
- }], animation: [{
1351
- type: Input,
1352
- args: ['matRippleAnimation']
1353
- }], disabled: [{
1354
- type: Input,
1355
- args: ['matRippleDisabled']
1356
- }], trigger: [{
1357
- type: Input,
1358
- args: ['matRippleTrigger']
1359
- }] } });
1360
-
1361
- class MatRippleModule {
1362
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatRippleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1363
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.0", ngImport: i0, type: MatRippleModule, imports: [MatCommonModule, MatRipple], exports: [MatRipple, MatCommonModule] });
1364
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatRippleModule, imports: [MatCommonModule, MatCommonModule] });
1365
- }
1366
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatRippleModule, decorators: [{
1367
- type: NgModule,
1368
- args: [{
1369
- imports: [MatCommonModule, MatRipple],
1370
- exports: [MatRipple, MatCommonModule],
1371
- }]
1372
- }] });
1373
-
1374
- /**
1375
- * Component that shows a simplified checkbox without including any kind of "real" checkbox.
1376
- * Meant to be used when the checkbox is purely decorative and a large number of them will be
1377
- * included, such as for the options in a multi-select. Uses no SVGs or complex animations.
1378
- * Note that theming is meant to be handled by the parent element, e.g.
1379
- * `mat-primary .mat-pseudo-checkbox`.
1380
- *
1381
- * Note that this component will be completely invisible to screen-reader users. This is *not*
1382
- * interchangeable with `<mat-checkbox>` and should *not* be used if the user would directly
1383
- * interact with the checkbox. The pseudo-checkbox should only be used as an implementation detail
1384
- * of more complex components that appropriately handle selected / checked state.
1385
- * @docs-private
1386
- */
1387
- class MatPseudoCheckbox {
1388
- _animationMode = inject(ANIMATION_MODULE_TYPE, { optional: true });
1389
- /** Display state of the checkbox. */
1390
- state = 'unchecked';
1391
- /** Whether the checkbox is disabled. */
1392
- disabled = false;
1393
- /**
1394
- * Appearance of the pseudo checkbox. Default appearance of 'full' renders a checkmark/mixedmark
1395
- * indicator inside a square box. 'minimal' appearance only renders the checkmark/mixedmark.
1396
- */
1397
- appearance = 'full';
1398
- constructor() { }
1399
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatPseudoCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
1400
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.0", type: MatPseudoCheckbox, isStandalone: true, selector: "mat-pseudo-checkbox", inputs: { state: "state", disabled: "disabled", appearance: "appearance" }, host: { properties: { "class.mat-pseudo-checkbox-indeterminate": "state === \"indeterminate\"", "class.mat-pseudo-checkbox-checked": "state === \"checked\"", "class.mat-pseudo-checkbox-disabled": "disabled", "class.mat-pseudo-checkbox-minimal": "appearance === \"minimal\"", "class.mat-pseudo-checkbox-full": "appearance === \"full\"", "class._mat-animation-noopable": "_animationMode === \"NoopAnimations\"" }, classAttribute: "mat-pseudo-checkbox" }, ngImport: i0, template: '', isInline: true, styles: [".mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:\"\";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-minimal-pseudo-checkbox-selected-checkmark-color, var(--mat-sys-primary))}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full{border-color:var(--mat-full-pseudo-checkbox-unselected-icon-color, var(--mat-sys-on-surface-variant));border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-full-pseudo-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-full-pseudo-checkbox-selected-icon-color, var(--mat-sys-primary));border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-full-pseudo-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-full-pseudo-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-full-pseudo-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px}"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1401
- }
1402
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatPseudoCheckbox, decorators: [{
1403
- type: Component,
1404
- args: [{ encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, selector: 'mat-pseudo-checkbox', template: '', host: {
1405
- 'class': 'mat-pseudo-checkbox',
1406
- '[class.mat-pseudo-checkbox-indeterminate]': 'state === "indeterminate"',
1407
- '[class.mat-pseudo-checkbox-checked]': 'state === "checked"',
1408
- '[class.mat-pseudo-checkbox-disabled]': 'disabled',
1409
- '[class.mat-pseudo-checkbox-minimal]': 'appearance === "minimal"',
1410
- '[class.mat-pseudo-checkbox-full]': 'appearance === "full"',
1411
- '[class._mat-animation-noopable]': '_animationMode === "NoopAnimations"',
1412
- }, styles: [".mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:\"\";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-minimal-pseudo-checkbox-selected-checkmark-color, var(--mat-sys-primary))}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full{border-color:var(--mat-full-pseudo-checkbox-unselected-icon-color, var(--mat-sys-on-surface-variant));border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-full-pseudo-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-full-pseudo-checkbox-selected-icon-color, var(--mat-sys-primary));border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-full-pseudo-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-full-pseudo-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-full-pseudo-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px}"] }]
1413
- }], ctorParameters: () => [], propDecorators: { state: [{
1414
- type: Input
1415
- }], disabled: [{
1416
- type: Input
1417
- }], appearance: [{
1418
- type: Input
1419
- }] } });
1420
-
1421
- class MatPseudoCheckboxModule {
1422
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatPseudoCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1423
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.0", ngImport: i0, type: MatPseudoCheckboxModule, imports: [MatCommonModule, MatPseudoCheckbox], exports: [MatPseudoCheckbox] });
1424
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatPseudoCheckboxModule, imports: [MatCommonModule] });
1425
- }
1426
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatPseudoCheckboxModule, decorators: [{
1427
- type: NgModule,
1428
- args: [{
1429
- imports: [MatCommonModule, MatPseudoCheckbox],
1430
- exports: [MatPseudoCheckbox],
1431
- }]
1432
- }] });
1433
-
1434
- /**
1435
- * Injection token used to provide the parent component to options.
1436
- */
1437
- const MAT_OPTION_PARENT_COMPONENT = new InjectionToken('MAT_OPTION_PARENT_COMPONENT');
1438
-
1439
- // Notes on the accessibility pattern used for `mat-optgroup`.
1440
- // The option group has two different "modes": regular and inert. The regular mode uses the
1441
- // recommended a11y pattern which has `role="group"` on the group element with `aria-labelledby`
1442
- // pointing to the label. This works for `mat-select`, but it seems to hit a bug for autocomplete
1443
- // under VoiceOver where the group doesn't get read out at all. The bug appears to be that if
1444
- // there's __any__ a11y-related attribute on the group (e.g. `role` or `aria-labelledby`),
1445
- // VoiceOver on Safari won't read it out.
1446
- // We've introduced the `inert` mode as a workaround. Under this mode, all a11y attributes are
1447
- // removed from the group, and we get the screen reader to read out the group label by mirroring it
1448
- // inside an invisible element in the option. This is sub-optimal, because the screen reader will
1449
- // repeat the group label on each navigation, whereas the default pattern only reads the group when
1450
- // the user enters a new group. The following alternate approaches were considered:
1451
- // 1. Reading out the group label using the `LiveAnnouncer` solves the problem, but we can't control
1452
- // when the text will be read out so sometimes it comes in too late or never if the user
1453
- // navigates quickly.
1454
- // 2. `<mat-option aria-describedby="groupLabel"` - This works on Safari, but VoiceOver in Chrome
1455
- // won't read out the description at all.
1456
- // 3. `<mat-option aria-labelledby="optionLabel groupLabel"` - This works on Chrome, but Safari
1457
- // doesn't read out the text at all. Furthermore, on
1458
- /**
1459
- * Injection token that can be used to reference instances of `MatOptgroup`. It serves as
1460
- * alternative token to the actual `MatOptgroup` class which could cause unnecessary
1461
- * retention of the class and its component metadata.
1462
- */
1463
- const MAT_OPTGROUP = new InjectionToken('MatOptgroup');
1464
- /**
1465
- * Component that is used to group instances of `mat-option`.
1466
- */
1467
- class MatOptgroup {
1468
- /** Label for the option group. */
1469
- label;
1470
- /** whether the option group is disabled. */
1471
- disabled = false;
1472
- /** Unique id for the underlying label. */
1473
- _labelId = inject(_IdGenerator).getId('mat-optgroup-label-');
1474
- /** Whether the group is in inert a11y mode. */
1475
- _inert;
1476
- constructor() {
1477
- const parent = inject(MAT_OPTION_PARENT_COMPONENT, { optional: true });
1478
- this._inert = parent?.inertGroups ?? false;
1479
- }
1480
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatOptgroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
1481
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.2.0", type: MatOptgroup, isStandalone: true, selector: "mat-optgroup", inputs: { label: "label", disabled: ["disabled", "disabled", booleanAttribute] }, host: { properties: { "attr.role": "_inert ? null : \"group\"", "attr.aria-disabled": "_inert ? null : disabled.toString()", "attr.aria-labelledby": "_inert ? null : _labelId" }, classAttribute: "mat-mdc-optgroup" }, providers: [{ provide: MAT_OPTGROUP, useExisting: MatOptgroup }], exportAs: ["matOptgroup"], ngImport: i0, template: "<span\n class=\"mat-mdc-optgroup-label\"\n role=\"presentation\"\n [class.mdc-list-item--disabled]=\"disabled\"\n [id]=\"_labelId\">\n <span class=\"mdc-list-item__primary-text\">{{ label }} <ng-content></ng-content></span>\n</span>\n\n<ng-content select=\"mat-option, ng-container\"></ng-content>\n", styles: [".mat-mdc-optgroup{color:var(--mat-optgroup-label-text-color, var(--mat-sys-on-surface-variant));font-family:var(--mat-optgroup-label-text-font, var(--mat-sys-title-small-font));line-height:var(--mat-optgroup-label-text-line-height, var(--mat-sys-title-small-line-height));font-size:var(--mat-optgroup-label-text-size, var(--mat-sys-title-small-size));letter-spacing:var(--mat-optgroup-label-text-tracking, var(--mat-sys-title-small-tracking));font-weight:var(--mat-optgroup-label-text-weight, var(--mat-sys-title-small-weight))}.mat-mdc-optgroup-label{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;outline:none}.mat-mdc-optgroup-label.mdc-list-item--disabled{opacity:.38}.mat-mdc-optgroup-label .mdc-list-item__primary-text{font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;white-space:normal;color:inherit}"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1482
- }
1483
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatOptgroup, decorators: [{
1484
- type: Component,
1485
- args: [{ selector: 'mat-optgroup', exportAs: 'matOptgroup', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
1486
- 'class': 'mat-mdc-optgroup',
1487
- '[attr.role]': '_inert ? null : "group"',
1488
- '[attr.aria-disabled]': '_inert ? null : disabled.toString()',
1489
- '[attr.aria-labelledby]': '_inert ? null : _labelId',
1490
- }, providers: [{ provide: MAT_OPTGROUP, useExisting: MatOptgroup }], template: "<span\n class=\"mat-mdc-optgroup-label\"\n role=\"presentation\"\n [class.mdc-list-item--disabled]=\"disabled\"\n [id]=\"_labelId\">\n <span class=\"mdc-list-item__primary-text\">{{ label }} <ng-content></ng-content></span>\n</span>\n\n<ng-content select=\"mat-option, ng-container\"></ng-content>\n", styles: [".mat-mdc-optgroup{color:var(--mat-optgroup-label-text-color, var(--mat-sys-on-surface-variant));font-family:var(--mat-optgroup-label-text-font, var(--mat-sys-title-small-font));line-height:var(--mat-optgroup-label-text-line-height, var(--mat-sys-title-small-line-height));font-size:var(--mat-optgroup-label-text-size, var(--mat-sys-title-small-size));letter-spacing:var(--mat-optgroup-label-text-tracking, var(--mat-sys-title-small-tracking));font-weight:var(--mat-optgroup-label-text-weight, var(--mat-sys-title-small-weight))}.mat-mdc-optgroup-label{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;outline:none}.mat-mdc-optgroup-label.mdc-list-item--disabled{opacity:.38}.mat-mdc-optgroup-label .mdc-list-item__primary-text{font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;white-space:normal;color:inherit}"] }]
1491
- }], ctorParameters: () => [], propDecorators: { label: [{
1492
- type: Input
1493
- }], disabled: [{
1494
- type: Input,
1495
- args: [{ transform: booleanAttribute }]
1496
- }] } });
1497
-
1498
- /** Event object emitted by MatOption when selected or deselected. */
1499
- class MatOptionSelectionChange {
1500
- source;
1501
- isUserInput;
1502
- constructor(
1503
- /** Reference to the option that emitted the event. */
1504
- source,
1505
- /** Whether the change in the option's value was a result of a user action. */
1506
- isUserInput = false) {
1507
- this.source = source;
1508
- this.isUserInput = isUserInput;
1509
- }
1510
- }
1511
- /**
1512
- * Single option inside of a `<mat-select>` element.
1513
- */
1514
- class MatOption {
1515
- _element = inject(ElementRef);
1516
- _changeDetectorRef = inject(ChangeDetectorRef);
1517
- _parent = inject(MAT_OPTION_PARENT_COMPONENT, { optional: true });
1518
- group = inject(MAT_OPTGROUP, { optional: true });
1519
- _signalDisableRipple = false;
1520
- _selected = false;
1521
- _active = false;
1522
- _disabled = false;
1523
- _mostRecentViewValue = '';
1524
- /** Whether the wrapping component is in multiple selection mode. */
1525
- get multiple() {
1526
- return this._parent && this._parent.multiple;
1527
- }
1528
- /** Whether or not the option is currently selected. */
1529
- get selected() {
1530
- return this._selected;
1531
- }
1532
- /** The form value of the option. */
1533
- value;
1534
- /** The unique ID of the option. */
1535
- id = inject(_IdGenerator).getId('mat-option-');
1536
- /** Whether the option is disabled. */
1537
- get disabled() {
1538
- return (this.group && this.group.disabled) || this._disabled;
1539
- }
1540
- set disabled(value) {
1541
- this._disabled = value;
1542
- }
1543
- /** Whether ripples for the option are disabled. */
1544
- get disableRipple() {
1545
- return this._signalDisableRipple
1546
- ? this._parent.disableRipple()
1547
- : !!this._parent?.disableRipple;
1548
- }
1549
- /** Whether to display checkmark for single-selection. */
1550
- get hideSingleSelectionIndicator() {
1551
- return !!(this._parent && this._parent.hideSingleSelectionIndicator);
1552
- }
1553
- /** Event emitted when the option is selected or deselected. */
1554
- // tslint:disable-next-line:no-output-on-prefix
1555
- onSelectionChange = new EventEmitter();
1556
- /** Element containing the option's text. */
1557
- _text;
1558
- /** Emits when the state of the option changes and any parents have to be notified. */
1559
- _stateChanges = new Subject();
1560
- constructor() {
1561
- const styleLoader = inject(_CdkPrivateStyleLoader);
1562
- styleLoader.load(_StructuralStylesLoader);
1563
- styleLoader.load(_VisuallyHiddenLoader);
1564
- this._signalDisableRipple = !!this._parent && isSignal(this._parent.disableRipple);
1565
- }
1566
- /**
1567
- * Whether or not the option is currently active and ready to be selected.
1568
- * An active option displays styles as if it is focused, but the
1569
- * focus is actually retained somewhere else. This comes in handy
1570
- * for components like autocomplete where focus must remain on the input.
1571
- */
1572
- get active() {
1573
- return this._active;
1574
- }
1575
- /**
1576
- * The displayed value of the option. It is necessary to show the selected option in the
1577
- * select's trigger.
1578
- */
1579
- get viewValue() {
1580
- // TODO(kara): Add input property alternative for node envs.
1581
- return (this._text?.nativeElement.textContent || '').trim();
1582
- }
1583
- /** Selects the option. */
1584
- select(emitEvent = true) {
1585
- if (!this._selected) {
1586
- this._selected = true;
1587
- this._changeDetectorRef.markForCheck();
1588
- if (emitEvent) {
1589
- this._emitSelectionChangeEvent();
1590
- }
1591
- }
1592
- }
1593
- /** Deselects the option. */
1594
- deselect(emitEvent = true) {
1595
- if (this._selected) {
1596
- this._selected = false;
1597
- this._changeDetectorRef.markForCheck();
1598
- if (emitEvent) {
1599
- this._emitSelectionChangeEvent();
1600
- }
1601
- }
1602
- }
1603
- /** Sets focus onto this option. */
1604
- focus(_origin, options) {
1605
- // Note that we aren't using `_origin`, but we need to keep it because some internal consumers
1606
- // use `MatOption` in a `FocusKeyManager` and we need it to match `FocusableOption`.
1607
- const element = this._getHostElement();
1608
- if (typeof element.focus === 'function') {
1609
- element.focus(options);
1610
- }
1611
- }
1612
- /**
1613
- * This method sets display styles on the option to make it appear
1614
- * active. This is used by the ActiveDescendantKeyManager so key
1615
- * events will display the proper options as active on arrow key events.
1616
- */
1617
- setActiveStyles() {
1618
- if (!this._active) {
1619
- this._active = true;
1620
- this._changeDetectorRef.markForCheck();
1621
- }
1622
- }
1623
- /**
1624
- * This method removes display styles on the option that made it appear
1625
- * active. This is used by the ActiveDescendantKeyManager so key
1626
- * events will display the proper options as active on arrow key events.
1627
- */
1628
- setInactiveStyles() {
1629
- if (this._active) {
1630
- this._active = false;
1631
- this._changeDetectorRef.markForCheck();
1632
- }
1633
- }
1634
- /** Gets the label to be used when determining whether the option should be focused. */
1635
- getLabel() {
1636
- return this.viewValue;
1637
- }
1638
- /** Ensures the option is selected when activated from the keyboard. */
1639
- _handleKeydown(event) {
1640
- if ((event.keyCode === ENTER || event.keyCode === SPACE) && !hasModifierKey(event)) {
1641
- this._selectViaInteraction();
1642
- // Prevent the page from scrolling down and form submits.
1643
- event.preventDefault();
1644
- }
1645
- }
1646
- /**
1647
- * `Selects the option while indicating the selection came from the user. Used to
1648
- * determine if the select's view -> model callback should be invoked.`
1649
- */
1650
- _selectViaInteraction() {
1651
- if (!this.disabled) {
1652
- this._selected = this.multiple ? !this._selected : true;
1653
- this._changeDetectorRef.markForCheck();
1654
- this._emitSelectionChangeEvent(true);
1655
- }
1656
- }
1657
- /** Returns the correct tabindex for the option depending on disabled state. */
1658
- // This method is only used by `MatLegacyOption`. Keeping it here to avoid breaking the types.
1659
- // That's because `MatLegacyOption` use `MatOption` type in a few places such as
1660
- // `MatOptionSelectionChange`. It is safe to delete this when `MatLegacyOption` is deleted.
1661
- _getTabIndex() {
1662
- return this.disabled ? '-1' : '0';
1663
- }
1664
- /** Gets the host DOM element. */
1665
- _getHostElement() {
1666
- return this._element.nativeElement;
1667
- }
1668
- ngAfterViewChecked() {
1669
- // Since parent components could be using the option's label to display the selected values
1670
- // (e.g. `mat-select`) and they don't have a way of knowing if the option's label has changed
1671
- // we have to check for changes in the DOM ourselves and dispatch an event. These checks are
1672
- // relatively cheap, however we still limit them only to selected options in order to avoid
1673
- // hitting the DOM too often.
1674
- if (this._selected) {
1675
- const viewValue = this.viewValue;
1676
- if (viewValue !== this._mostRecentViewValue) {
1677
- if (this._mostRecentViewValue) {
1678
- this._stateChanges.next();
1679
- }
1680
- this._mostRecentViewValue = viewValue;
1681
- }
1682
- }
1683
- }
1684
- ngOnDestroy() {
1685
- this._stateChanges.complete();
1686
- }
1687
- /** Emits the selection change event. */
1688
- _emitSelectionChangeEvent(isUserInput = false) {
1689
- this.onSelectionChange.emit(new MatOptionSelectionChange(this, isUserInput));
1690
- }
1691
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatOption, deps: [], target: i0.ɵɵFactoryTarget.Component });
1692
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: MatOption, isStandalone: true, selector: "mat-option", inputs: { value: "value", id: "id", disabled: ["disabled", "disabled", booleanAttribute] }, outputs: { onSelectionChange: "onSelectionChange" }, host: { attributes: { "role": "option" }, listeners: { "click": "_selectViaInteraction()", "keydown": "_handleKeydown($event)" }, properties: { "class.mdc-list-item--selected": "selected", "class.mat-mdc-option-multiple": "multiple", "class.mat-mdc-option-active": "active", "class.mdc-list-item--disabled": "disabled", "id": "id", "attr.aria-selected": "selected", "attr.aria-disabled": "disabled.toString()" }, classAttribute: "mat-mdc-option mdc-list-item" }, viewQueries: [{ propertyName: "_text", first: true, predicate: ["text"], descendants: true, static: true }], exportAs: ["matOption"], ngImport: i0, template: "<!-- Set aria-hidden=\"true\" to this DOM node and other decorative nodes in this file. This might\n be contributing to issue where sometimes VoiceOver focuses on a TextNode in the a11y tree instead\n of the Option node (#23202). Most assistive technology will generally ignore non-role,\n non-text-content elements. Adding aria-hidden seems to make VoiceOver behave more consistently. -->\n@if (multiple) {\n <mat-pseudo-checkbox\n class=\"mat-mdc-option-pseudo-checkbox\"\n [disabled]=\"disabled\"\n [state]=\"selected ? 'checked' : 'unchecked'\"\n aria-hidden=\"true\"></mat-pseudo-checkbox>\n}\n\n<ng-content select=\"mat-icon\"></ng-content>\n\n<span class=\"mdc-list-item__primary-text\" #text><ng-content></ng-content></span>\n\n<!-- Render checkmark at the end for single-selection. -->\n@if (!multiple && selected && !hideSingleSelectionIndicator) {\n <mat-pseudo-checkbox\n class=\"mat-mdc-option-pseudo-checkbox\"\n [disabled]=\"disabled\"\n state=\"checked\"\n aria-hidden=\"true\"\n appearance=\"minimal\"></mat-pseudo-checkbox>\n}\n\n<!-- See a11y notes inside optgroup.ts for context behind this element. -->\n@if (group && group._inert) {\n <span class=\"cdk-visually-hidden\">({{ group.label }})</span>\n}\n\n<div class=\"mat-mdc-option-ripple mat-focus-indicator\" aria-hidden=\"true\" mat-ripple\n [matRippleTrigger]=\"_getHostElement()\" [matRippleDisabled]=\"disabled || disableRipple\">\n</div>\n", styles: [".mat-mdc-option{-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-option-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-option-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-option-label-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-option-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-option-label-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));outline:0}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){background-color:var(--mat-option-selected-state-layer-color, var(--mat-sys-secondary-container))}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option .mat-pseudo-checkbox{--mat-minimal-pseudo-checkbox-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:32px}[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:16px;padding-right:32px}.mat-mdc-option .mat-icon,.mat-mdc-option .mat-pseudo-checkbox-full{margin-right:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-icon,[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:16px}.mat-mdc-option .mat-pseudo-checkbox-minimal{margin-left:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal{margin-right:16px;margin-left:0}.mat-mdc-option .mat-mdc-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-option .mdc-list-item__primary-text{white-space:normal;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;margin-right:auto}[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text{margin-right:0;margin-left:auto}@media(forced-colors: active){.mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{content:\"\";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{right:auto;left:16px}}.mat-mdc-option-multiple{--mdc-list-list-item-selected-container-color:var(--mdc-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-focus-indicator::before{content:\"\"}"], dependencies: [{ kind: "component", type: MatPseudoCheckbox, selector: "mat-pseudo-checkbox", inputs: ["state", "disabled", "appearance"] }, { kind: "directive", type: MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1693
- }
1694
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatOption, decorators: [{
1695
- type: Component,
1696
- args: [{ selector: 'mat-option', exportAs: 'matOption', host: {
1697
- 'role': 'option',
1698
- '[class.mdc-list-item--selected]': 'selected',
1699
- '[class.mat-mdc-option-multiple]': 'multiple',
1700
- '[class.mat-mdc-option-active]': 'active',
1701
- '[class.mdc-list-item--disabled]': 'disabled',
1702
- '[id]': 'id',
1703
- // Set aria-selected to false for non-selected items and true for selected items. Conform to
1704
- // [WAI ARIA Listbox authoring practices guide](
1705
- // https://www.w3.org/WAI/ARIA/apg/patterns/listbox/), "If any options are selected, each
1706
- // selected option has either aria-selected or aria-checked set to true. All options that are
1707
- // selectable but not selected have either aria-selected or aria-checked set to false." Align
1708
- // aria-selected implementation of Chips and List components.
1709
- //
1710
- // Set `aria-selected="false"` on not-selected listbox options to fix VoiceOver announcing
1711
- // every option as "selected" (#21491).
1712
- '[attr.aria-selected]': 'selected',
1713
- '[attr.aria-disabled]': 'disabled.toString()',
1714
- '(click)': '_selectViaInteraction()',
1715
- '(keydown)': '_handleKeydown($event)',
1716
- 'class': 'mat-mdc-option mdc-list-item',
1717
- }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatPseudoCheckbox, MatRipple], template: "<!-- Set aria-hidden=\"true\" to this DOM node and other decorative nodes in this file. This might\n be contributing to issue where sometimes VoiceOver focuses on a TextNode in the a11y tree instead\n of the Option node (#23202). Most assistive technology will generally ignore non-role,\n non-text-content elements. Adding aria-hidden seems to make VoiceOver behave more consistently. -->\n@if (multiple) {\n <mat-pseudo-checkbox\n class=\"mat-mdc-option-pseudo-checkbox\"\n [disabled]=\"disabled\"\n [state]=\"selected ? 'checked' : 'unchecked'\"\n aria-hidden=\"true\"></mat-pseudo-checkbox>\n}\n\n<ng-content select=\"mat-icon\"></ng-content>\n\n<span class=\"mdc-list-item__primary-text\" #text><ng-content></ng-content></span>\n\n<!-- Render checkmark at the end for single-selection. -->\n@if (!multiple && selected && !hideSingleSelectionIndicator) {\n <mat-pseudo-checkbox\n class=\"mat-mdc-option-pseudo-checkbox\"\n [disabled]=\"disabled\"\n state=\"checked\"\n aria-hidden=\"true\"\n appearance=\"minimal\"></mat-pseudo-checkbox>\n}\n\n<!-- See a11y notes inside optgroup.ts for context behind this element. -->\n@if (group && group._inert) {\n <span class=\"cdk-visually-hidden\">({{ group.label }})</span>\n}\n\n<div class=\"mat-mdc-option-ripple mat-focus-indicator\" aria-hidden=\"true\" mat-ripple\n [matRippleTrigger]=\"_getHostElement()\" [matRippleDisabled]=\"disabled || disableRipple\">\n</div>\n", styles: [".mat-mdc-option{-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-option-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-option-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-option-label-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-option-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-option-label-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));outline:0}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){background-color:var(--mat-option-selected-state-layer-color, var(--mat-sys-secondary-container))}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option .mat-pseudo-checkbox{--mat-minimal-pseudo-checkbox-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:32px}[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:16px;padding-right:32px}.mat-mdc-option .mat-icon,.mat-mdc-option .mat-pseudo-checkbox-full{margin-right:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-icon,[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:16px}.mat-mdc-option .mat-pseudo-checkbox-minimal{margin-left:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal{margin-right:16px;margin-left:0}.mat-mdc-option .mat-mdc-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-option .mdc-list-item__primary-text{white-space:normal;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;margin-right:auto}[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text{margin-right:0;margin-left:auto}@media(forced-colors: active){.mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{content:\"\";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{right:auto;left:16px}}.mat-mdc-option-multiple{--mdc-list-list-item-selected-container-color:var(--mdc-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-focus-indicator::before{content:\"\"}"] }]
1718
- }], ctorParameters: () => [], propDecorators: { value: [{
1719
- type: Input
1720
- }], id: [{
1721
- type: Input
1722
- }], disabled: [{
1723
- type: Input,
1724
- args: [{ transform: booleanAttribute }]
1725
- }], onSelectionChange: [{
1726
- type: Output
1727
- }], _text: [{
1728
- type: ViewChild,
1729
- args: ['text', { static: true }]
1730
- }] } });
1731
- /**
1732
- * Counts the amount of option group labels that precede the specified option.
1733
- * @param optionIndex Index of the option at which to start counting.
1734
- * @param options Flat list of all of the options.
1735
- * @param optionGroups Flat list of all of the option groups.
1736
- * @docs-private
1737
- */
1738
- function _countGroupLabelsBeforeOption(optionIndex, options, optionGroups) {
1739
- if (optionGroups.length) {
1740
- let optionsArray = options.toArray();
1741
- let groups = optionGroups.toArray();
1742
- let groupCounter = 0;
1743
- for (let i = 0; i < optionIndex + 1; i++) {
1744
- if (optionsArray[i].group && optionsArray[i].group === groups[groupCounter]) {
1745
- groupCounter++;
1746
- }
1747
- }
1748
- return groupCounter;
1749
- }
1750
- return 0;
1751
- }
1752
- /**
1753
- * Determines the position to which to scroll a panel in order for an option to be into view.
1754
- * @param optionOffset Offset of the option from the top of the panel.
1755
- * @param optionHeight Height of the options.
1756
- * @param currentScrollPosition Current scroll position of the panel.
1757
- * @param panelHeight Height of the panel.
1758
- * @docs-private
1759
- */
1760
- function _getOptionScrollPosition(optionOffset, optionHeight, currentScrollPosition, panelHeight) {
1761
- if (optionOffset < currentScrollPosition) {
1762
- return optionOffset;
1763
- }
1764
- if (optionOffset + optionHeight > currentScrollPosition + panelHeight) {
1765
- return Math.max(0, optionOffset - panelHeight + optionHeight);
1766
- }
1767
- return currentScrollPosition;
1768
- }
1769
-
1770
- class MatOptionModule {
1771
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatOptionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1772
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.0", ngImport: i0, type: MatOptionModule, imports: [MatRippleModule, MatCommonModule, MatPseudoCheckboxModule, MatOption, MatOptgroup], exports: [MatOption, MatOptgroup] });
1773
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatOptionModule, imports: [MatRippleModule, MatCommonModule, MatPseudoCheckboxModule] });
1774
- }
1775
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatOptionModule, decorators: [{
1776
- type: NgModule,
1777
- args: [{
1778
- imports: [MatRippleModule, MatCommonModule, MatPseudoCheckboxModule, MatOption, MatOptgroup],
1779
- exports: [MatOption, MatOptgroup],
1780
- }]
1781
- }] });
1782
-
1783
- /** The options for the MatRippleLoader's event listeners. */
1784
- const eventListenerOptions = { capture: true };
1785
- /**
1786
- * The events that should trigger the initialization of the ripple.
1787
- * Note that we use `mousedown`, rather than `click`, for mouse devices because
1788
- * we can't rely on `mouseenter` in the shadow DOM and `click` happens too late.
1789
- */
1790
- const rippleInteractionEvents = ['focus', 'mousedown', 'mouseenter', 'touchstart'];
1791
- /** The attribute attached to a component whose ripple has not yet been initialized. */
1792
- const matRippleUninitialized = 'mat-ripple-loader-uninitialized';
1793
- /** Additional classes that should be added to the ripple when it is rendered. */
1794
- const matRippleClassName = 'mat-ripple-loader-class-name';
1795
- /** Whether the ripple should be centered. */
1796
- const matRippleCentered = 'mat-ripple-loader-centered';
1797
- /** Whether the ripple should be disabled. */
1798
- const matRippleDisabled = 'mat-ripple-loader-disabled';
1799
- /**
1800
- * Handles attaching ripples on demand.
1801
- *
1802
- * This service allows us to avoid eagerly creating & attaching MatRipples.
1803
- * It works by creating & attaching a ripple only when a component is first interacted with.
1804
- *
1805
- * @docs-private
1806
- */
1807
- class MatRippleLoader {
1808
- _document = inject(DOCUMENT);
1809
- _animationMode = inject(ANIMATION_MODULE_TYPE, { optional: true });
1810
- _globalRippleOptions = inject(MAT_RIPPLE_GLOBAL_OPTIONS, { optional: true });
1811
- _platform = inject(Platform);
1812
- _ngZone = inject(NgZone);
1813
- _injector = inject(Injector);
1814
- _eventCleanups;
1815
- _hosts = new Map();
1816
- constructor() {
1817
- const renderer = inject(RendererFactory2).createRenderer(null, null);
1818
- this._eventCleanups = this._ngZone.runOutsideAngular(() => {
1819
- return rippleInteractionEvents.map(name => _bindEventWithOptions(renderer, this._document, name, this._onInteraction, eventListenerOptions));
1820
- });
1821
- }
1822
- ngOnDestroy() {
1823
- const hosts = this._hosts.keys();
1824
- for (const host of hosts) {
1825
- this.destroyRipple(host);
1826
- }
1827
- this._eventCleanups.forEach(cleanup => cleanup());
1828
- }
1829
- /**
1830
- * Configures the ripple that will be rendered by the ripple loader.
1831
- *
1832
- * Stores the given information about how the ripple should be configured on the host
1833
- * element so that it can later be retrived & used when the ripple is actually created.
1834
- */
1835
- configureRipple(host, config) {
1836
- // Indicates that the ripple has not yet been rendered for this component.
1837
- host.setAttribute(matRippleUninitialized, this._globalRippleOptions?.namespace ?? '');
1838
- // Store the additional class name(s) that should be added to the ripple element.
1839
- if (config.className || !host.hasAttribute(matRippleClassName)) {
1840
- host.setAttribute(matRippleClassName, config.className || '');
1841
- }
1842
- // Store whether the ripple should be centered.
1843
- if (config.centered) {
1844
- host.setAttribute(matRippleCentered, '');
1845
- }
1846
- if (config.disabled) {
1847
- host.setAttribute(matRippleDisabled, '');
1848
- }
1849
- }
1850
- /** Sets the disabled state on the ripple instance corresponding to the given host element. */
1851
- setDisabled(host, disabled) {
1852
- const ripple = this._hosts.get(host);
1853
- // If the ripple has already been instantiated, just disable it.
1854
- if (ripple) {
1855
- ripple.target.rippleDisabled = disabled;
1856
- if (!disabled && !ripple.hasSetUpEvents) {
1857
- ripple.hasSetUpEvents = true;
1858
- ripple.renderer.setupTriggerEvents(host);
1859
- }
1860
- }
1861
- else if (disabled) {
1862
- // Otherwise, set an attribute so we know what the
1863
- // disabled state should be when the ripple is initialized.
1864
- host.setAttribute(matRippleDisabled, '');
1865
- }
1866
- else {
1867
- host.removeAttribute(matRippleDisabled);
1868
- }
1869
- }
1870
- /**
1871
- * Handles creating and attaching component internals
1872
- * when a component is initially interacted with.
1873
- */
1874
- _onInteraction = (event) => {
1875
- const eventTarget = _getEventTarget(event);
1876
- if (eventTarget instanceof HTMLElement) {
1877
- // TODO(wagnermaciel): Consider batching these events to improve runtime performance.
1878
- const element = eventTarget.closest(`[${matRippleUninitialized}="${this._globalRippleOptions?.namespace ?? ''}"]`);
1879
- if (element) {
1880
- this._createRipple(element);
1881
- }
1882
- }
1883
- };
1884
- /** Creates a MatRipple and appends it to the given element. */
1885
- _createRipple(host) {
1886
- if (!this._document || this._hosts.has(host)) {
1887
- return;
1888
- }
1889
- // Create the ripple element.
1890
- host.querySelector('.mat-ripple')?.remove();
1891
- const rippleEl = this._document.createElement('span');
1892
- rippleEl.classList.add('mat-ripple', host.getAttribute(matRippleClassName));
1893
- host.append(rippleEl);
1894
- const isNoopAnimations = this._animationMode === 'NoopAnimations';
1895
- const globalOptions = this._globalRippleOptions;
1896
- const enterDuration = isNoopAnimations
1897
- ? 0
1898
- : globalOptions?.animation?.enterDuration ?? defaultRippleAnimationConfig.enterDuration;
1899
- const exitDuration = isNoopAnimations
1900
- ? 0
1901
- : globalOptions?.animation?.exitDuration ?? defaultRippleAnimationConfig.exitDuration;
1902
- const target = {
1903
- rippleDisabled: isNoopAnimations || globalOptions?.disabled || host.hasAttribute(matRippleDisabled),
1904
- rippleConfig: {
1905
- centered: host.hasAttribute(matRippleCentered),
1906
- terminateOnPointerUp: globalOptions?.terminateOnPointerUp,
1907
- animation: {
1908
- enterDuration,
1909
- exitDuration,
1910
- },
1911
- },
1912
- };
1913
- const renderer = new RippleRenderer(target, this._ngZone, rippleEl, this._platform, this._injector);
1914
- const hasSetUpEvents = !target.rippleDisabled;
1915
- if (hasSetUpEvents) {
1916
- renderer.setupTriggerEvents(host);
1917
- }
1918
- this._hosts.set(host, {
1919
- target,
1920
- renderer,
1921
- hasSetUpEvents,
1922
- });
1923
- host.removeAttribute(matRippleUninitialized);
1924
- }
1925
- destroyRipple(host) {
1926
- const ripple = this._hosts.get(host);
1927
- if (ripple) {
1928
- ripple.renderer._removeTriggerEvents();
1929
- this._hosts.delete(host);
1930
- }
1931
- }
1932
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatRippleLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1933
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatRippleLoader, providedIn: 'root' });
1934
- }
1935
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatRippleLoader, decorators: [{
1936
- type: Injectable,
1937
- args: [{ providedIn: 'root' }]
1938
- }], ctorParameters: () => [] });
1939
-
1940
- /**
1941
- * Internal shared component used as a container in form field controls.
1942
- * Not to be confused with `mat-form-field` which MDC calls a "text field".
1943
- * @docs-private
1944
- */
1945
- class _MatInternalFormField {
1946
- /** Position of the label relative to the content. */
1947
- labelPosition;
1948
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: _MatInternalFormField, deps: [], target: i0.ɵɵFactoryTarget.Component });
1949
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.0", type: _MatInternalFormField, isStandalone: true, selector: "div[mat-internal-form-field]", inputs: { labelPosition: "labelPosition" }, host: { properties: { "class.mdc-form-field--align-end": "labelPosition === \"before\"" }, classAttribute: "mdc-form-field mat-internal-form-field" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [".mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;vertical-align:middle}.mat-internal-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mat-internal-form-field>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end .mdc-form-field--align-end label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0}"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1950
- }
1951
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: _MatInternalFormField, decorators: [{
1952
- type: Component,
1953
- args: [{ selector: 'div[mat-internal-form-field]', template: '<ng-content></ng-content>', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
1954
- 'class': 'mdc-form-field mat-internal-form-field',
1955
- '[class.mdc-form-field--align-end]': 'labelPosition === "before"',
1956
- }, styles: [".mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;vertical-align:middle}.mat-internal-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mat-internal-form-field>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end .mdc-form-field--align-end label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0}"] }]
1957
- }], propDecorators: { labelPosition: [{
1958
- type: Input,
1959
- args: [{ required: true }]
1960
- }] } });
1961
-
1962
- /**
1963
- * Generated bundle index. Do not edit.
1964
- */
1965
-
1966
- export { AnimationCurves, AnimationDurations, DateAdapter, ErrorStateMatcher, MATERIAL_SANITY_CHECKS, MAT_DATE_FORMATS, MAT_DATE_LOCALE, MAT_DATE_LOCALE_FACTORY, MAT_NATIVE_DATE_FORMATS, MAT_OPTGROUP, MAT_OPTION_PARENT_COMPONENT, MAT_RIPPLE_GLOBAL_OPTIONS, MatCommonModule, MatLine, MatLineModule, MatNativeDateModule, MatOptgroup, MatOption, MatOptionModule, MatOptionSelectionChange, MatPseudoCheckbox, MatPseudoCheckboxModule, MatRipple, MatRippleLoader, MatRippleModule, NativeDateAdapter, NativeDateModule, RippleRef, RippleRenderer, RippleState, ShowOnDirtyErrorStateMatcher, VERSION, _ErrorStateTracker, _MatInternalFormField, _StructuralStylesLoader, _countGroupLabelsBeforeOption, _getOptionScrollPosition, defaultRippleAnimationConfig, provideNativeDateAdapter, setLines };
406
+ export { AnimationCurves, AnimationDurations, MAT_NATIVE_DATE_FORMATS, MatNativeDateModule, NativeDateAdapter, NativeDateModule, VERSION, provideNativeDateAdapter };
1967
407
  //# sourceMappingURL=core.mjs.map