@kato-lee/cdk 14.2.7 → 20.2.14

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 (735) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +8 -8
  3. package/_adev_assets/cdk_drag_drop.json +7215 -0
  4. package/_adev_assets/cdk_testing.json +7605 -0
  5. package/_adev_assets/cdk_testing_protractor.json +1747 -0
  6. package/_adev_assets/cdk_testing_selenium_webdriver.json +1801 -0
  7. package/_adev_assets/cdk_testing_testbed.json +1903 -0
  8. package/_index.scss +8 -8
  9. package/a11y/_index.scss +60 -102
  10. package/a11y/index.d.ts +550 -1212
  11. package/a11y-module.d.d.ts +314 -0
  12. package/a11y-prebuilt.css +1 -1
  13. package/accordion/index.d.ts +92 -140
  14. package/activedescendant-key-manager.d.d.ts +39 -0
  15. package/bidi/index.d.ts +21 -80
  16. package/bidi-module.d.d.ts +57 -0
  17. package/clipboard/index.d.ts +101 -115
  18. package/coercion/index.d.ts +45 -67
  19. package/coercion/private/index.d.ts +9 -0
  20. package/collections/index.d.ts +99 -374
  21. package/data-source.d.d.ts +43 -0
  22. package/dialog/index.d.ts +412 -469
  23. package/drag-drop/index.d.ts +1410 -1614
  24. package/fesm2022/a11y-module.mjs +951 -0
  25. package/fesm2022/a11y-module.mjs.map +1 -0
  26. package/fesm2022/a11y.mjs +538 -0
  27. package/fesm2022/a11y.mjs.map +1 -0
  28. package/fesm2022/accordion.mjs +216 -0
  29. package/fesm2022/accordion.mjs.map +1 -0
  30. package/fesm2022/activedescendant-key-manager.mjs +16 -0
  31. package/fesm2022/activedescendant-key-manager.mjs.map +1 -0
  32. package/fesm2022/array.mjs +6 -0
  33. package/fesm2022/array.mjs.map +1 -0
  34. package/fesm2022/bidi.mjs +78 -0
  35. package/fesm2022/bidi.mjs.map +1 -0
  36. package/fesm2022/breakpoints-observer.mjs +179 -0
  37. package/fesm2022/breakpoints-observer.mjs.map +1 -0
  38. package/fesm2022/cdk.mjs +7 -0
  39. package/fesm2022/cdk.mjs.map +1 -0
  40. package/{fesm2020 → fesm2022}/clipboard.mjs +210 -259
  41. package/fesm2022/clipboard.mjs.map +1 -0
  42. package/fesm2022/coercion/private.mjs +15 -0
  43. package/fesm2022/coercion/private.mjs.map +1 -0
  44. package/fesm2022/coercion.mjs +43 -0
  45. package/fesm2022/coercion.mjs.map +1 -0
  46. package/fesm2022/collections.mjs +8 -0
  47. package/fesm2022/collections.mjs.map +1 -0
  48. package/fesm2022/css-pixel-value.mjs +10 -0
  49. package/fesm2022/css-pixel-value.mjs.map +1 -0
  50. package/fesm2022/data-source.mjs +15 -0
  51. package/fesm2022/data-source.mjs.map +1 -0
  52. package/{fesm2020 → fesm2022}/dialog.mjs +874 -787
  53. package/fesm2022/dialog.mjs.map +1 -0
  54. package/fesm2022/directionality.mjs +77 -0
  55. package/fesm2022/directionality.mjs.map +1 -0
  56. package/fesm2022/dispose-view-repeater-strategy.mjs +44 -0
  57. package/fesm2022/dispose-view-repeater-strategy.mjs.map +1 -0
  58. package/{fesm2020 → fesm2022}/drag-drop.mjs +4477 -3808
  59. package/fesm2022/drag-drop.mjs.map +1 -0
  60. package/fesm2022/element.mjs +29 -0
  61. package/fesm2022/element.mjs.map +1 -0
  62. package/fesm2022/fake-event-detection.mjs +24 -0
  63. package/fesm2022/fake-event-detection.mjs.map +1 -0
  64. package/fesm2022/focus-key-manager.mjs +22 -0
  65. package/fesm2022/focus-key-manager.mjs.map +1 -0
  66. package/fesm2022/focus-monitor.mjs +622 -0
  67. package/fesm2022/focus-monitor.mjs.map +1 -0
  68. package/fesm2022/id-generator.mjs +37 -0
  69. package/fesm2022/id-generator.mjs.map +1 -0
  70. package/fesm2022/keycodes.mjs +15 -0
  71. package/fesm2022/keycodes.mjs.map +1 -0
  72. package/{fesm2015/keycodes.mjs → fesm2022/keycodes2.mjs} +122 -167
  73. package/fesm2022/keycodes2.mjs.map +1 -0
  74. package/fesm2022/layout.mjs +43 -0
  75. package/fesm2022/layout.mjs.map +1 -0
  76. package/fesm2022/list-key-manager.mjs +360 -0
  77. package/fesm2022/list-key-manager.mjs.map +1 -0
  78. package/fesm2022/listbox.mjs +928 -0
  79. package/fesm2022/listbox.mjs.map +1 -0
  80. package/fesm2022/menu.mjs +2001 -0
  81. package/fesm2022/menu.mjs.map +1 -0
  82. package/fesm2022/observers/private.mjs +124 -0
  83. package/fesm2022/observers/private.mjs.map +1 -0
  84. package/fesm2022/observers.mjs +210 -0
  85. package/fesm2022/observers.mjs.map +1 -0
  86. package/{fesm2020/overlay.mjs → fesm2022/overlay-module.mjs} +3062 -3145
  87. package/fesm2022/overlay-module.mjs.map +1 -0
  88. package/fesm2022/overlay.mjs +101 -0
  89. package/fesm2022/overlay.mjs.map +1 -0
  90. package/fesm2022/passive-listeners.mjs +31 -0
  91. package/fesm2022/passive-listeners.mjs.map +1 -0
  92. package/fesm2022/platform.mjs +73 -0
  93. package/fesm2022/platform.mjs.map +1 -0
  94. package/fesm2022/platform2.mjs +77 -0
  95. package/fesm2022/platform2.mjs.map +1 -0
  96. package/{fesm2020 → fesm2022}/portal.mjs +614 -689
  97. package/fesm2022/portal.mjs.map +1 -0
  98. package/fesm2022/private.mjs +19 -0
  99. package/fesm2022/private.mjs.map +1 -0
  100. package/fesm2022/recycle-view-repeater-strategy.mjs +156 -0
  101. package/fesm2022/recycle-view-repeater-strategy.mjs.map +1 -0
  102. package/{fesm2015 → fesm2022}/scrolling.mjs +1472 -1558
  103. package/fesm2022/scrolling.mjs.map +1 -0
  104. package/fesm2022/scrolling2.mjs +99 -0
  105. package/fesm2022/scrolling2.mjs.map +1 -0
  106. package/fesm2022/selection-model.mjs +221 -0
  107. package/fesm2022/selection-model.mjs.map +1 -0
  108. package/fesm2022/shadow-dom.mjs +49 -0
  109. package/fesm2022/shadow-dom.mjs.map +1 -0
  110. package/fesm2022/stepper.mjs +632 -0
  111. package/fesm2022/stepper.mjs.map +1 -0
  112. package/fesm2022/style-loader.mjs +47 -0
  113. package/fesm2022/style-loader.mjs.map +1 -0
  114. package/{fesm2020 → fesm2022}/table.mjs +2511 -2348
  115. package/fesm2022/table.mjs.map +1 -0
  116. package/fesm2022/test-environment.mjs +19 -0
  117. package/fesm2022/test-environment.mjs.map +1 -0
  118. package/fesm2022/testing/selenium-webdriver.mjs +353 -0
  119. package/fesm2022/testing/selenium-webdriver.mjs.map +1 -0
  120. package/fesm2022/testing/testbed.mjs +782 -0
  121. package/fesm2022/testing/testbed.mjs.map +1 -0
  122. package/fesm2022/testing.mjs +950 -0
  123. package/fesm2022/testing.mjs.map +1 -0
  124. package/{fesm2020 → fesm2022}/text-field.mjs +432 -459
  125. package/fesm2022/text-field.mjs.map +1 -0
  126. package/fesm2022/tree-key-manager.mjs +360 -0
  127. package/fesm2022/tree-key-manager.mjs.map +1 -0
  128. package/fesm2022/tree.mjs +1800 -0
  129. package/fesm2022/tree.mjs.map +1 -0
  130. package/fesm2022/typeahead.mjs +88 -0
  131. package/fesm2022/typeahead.mjs.map +1 -0
  132. package/fesm2022/unique-selection-dispatcher.mjs +49 -0
  133. package/fesm2022/unique-selection-dispatcher.mjs.map +1 -0
  134. package/focus-key-manager.d.d.ts +39 -0
  135. package/focus-monitor.d.d.ts +208 -0
  136. package/harness-environment.d.d.ts +944 -0
  137. package/index.d.ts +6 -6
  138. package/keycodes/index.d.ts +129 -249
  139. package/layout/index.d.ts +89 -90
  140. package/list-key-manager.d.d.ts +170 -0
  141. package/listbox/index.d.ts +354 -419
  142. package/menu/index.d.ts +834 -1013
  143. package/number-property.d.d.ts +16 -0
  144. package/observers/index.d.ts +84 -109
  145. package/observers/private/index.d.ts +34 -0
  146. package/overlay/_index-deprecated.scss +13 -13
  147. package/overlay/_index.scss +193 -152
  148. package/overlay/index.d.ts +328 -1343
  149. package/overlay-module.d.d.ts +801 -0
  150. package/overlay-prebuilt.css +1 -1
  151. package/package.json +177 -232
  152. package/platform/index.d.ts +67 -106
  153. package/platform.d.d.ts +33 -0
  154. package/portal/index.d.ts +51 -328
  155. package/portal-directives.d.d.ts +211 -0
  156. package/private/index.d.ts +13 -0
  157. package/schematics/collection.json +18 -0
  158. package/schematics/index.d.ts +14 -0
  159. package/schematics/index.js +37 -0
  160. package/schematics/index.js.map +1 -0
  161. package/schematics/migration.json +15 -0
  162. package/schematics/ng-add/index.d.ts +17 -0
  163. package/schematics/ng-add/index.js +31 -0
  164. package/schematics/ng-add/index.js.map +1 -0
  165. package/schematics/ng-add/schema.d.ts +11 -0
  166. package/schematics/ng-add/schema.js +10 -0
  167. package/schematics/ng-add/schema.js.map +1 -0
  168. package/schematics/ng-add/schema.json +16 -0
  169. package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template +53 -0
  170. package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +21 -0
  171. package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +25 -0
  172. package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +45 -0
  173. package/schematics/ng-generate/drag-drop/index.d.ts +11 -0
  174. package/schematics/ng-generate/drag-drop/index.js +42 -0
  175. package/schematics/ng-generate/drag-drop/index.js.map +1 -0
  176. package/schematics/ng-generate/drag-drop/schema.d.ts +10 -0
  177. package/schematics/ng-generate/drag-drop/schema.js +10 -0
  178. package/schematics/ng-generate/drag-drop/schema.js.map +1 -0
  179. package/schematics/ng-generate/drag-drop/schema.json +100 -0
  180. package/schematics/ng-update/data/attribute-selectors.d.ts +15 -0
  181. package/schematics/ng-update/data/attribute-selectors.js +12 -0
  182. package/schematics/ng-update/data/attribute-selectors.js.map +1 -0
  183. package/schematics/ng-update/data/class-names.d.ts +15 -0
  184. package/schematics/ng-update/data/class-names.js +12 -0
  185. package/schematics/ng-update/data/class-names.js.map +1 -0
  186. package/schematics/ng-update/data/constructor-checks.d.ts +15 -0
  187. package/schematics/ng-update/data/constructor-checks.js +17 -0
  188. package/schematics/ng-update/data/constructor-checks.js.map +1 -0
  189. package/schematics/ng-update/data/css-selectors.d.ts +27 -0
  190. package/schematics/ng-update/data/css-selectors.js +12 -0
  191. package/schematics/ng-update/data/css-selectors.js.map +1 -0
  192. package/schematics/ng-update/data/css-tokens.d.ts +27 -0
  193. package/schematics/ng-update/data/css-tokens.js +12 -0
  194. package/schematics/ng-update/data/css-tokens.js.map +1 -0
  195. package/schematics/ng-update/data/element-selectors.d.ts +15 -0
  196. package/schematics/ng-update/data/element-selectors.js +12 -0
  197. package/schematics/ng-update/data/element-selectors.js.map +1 -0
  198. package/schematics/ng-update/data/index.d.ts +18 -0
  199. package/schematics/ng-update/data/index.js +35 -0
  200. package/schematics/ng-update/data/index.js.map +1 -0
  201. package/schematics/ng-update/data/input-names.d.ts +22 -0
  202. package/schematics/ng-update/data/input-names.js +12 -0
  203. package/schematics/ng-update/data/input-names.js.map +1 -0
  204. package/schematics/ng-update/data/method-call-checks.d.ts +17 -0
  205. package/schematics/ng-update/data/method-call-checks.js +12 -0
  206. package/schematics/ng-update/data/method-call-checks.js.map +1 -0
  207. package/schematics/ng-update/data/output-names.d.ts +22 -0
  208. package/schematics/ng-update/data/output-names.js +12 -0
  209. package/schematics/ng-update/data/output-names.js.map +1 -0
  210. package/schematics/ng-update/data/property-names.d.ts +20 -0
  211. package/schematics/ng-update/data/property-names.js +12 -0
  212. package/schematics/ng-update/data/property-names.js.map +1 -0
  213. package/schematics/ng-update/data/symbol-removal.d.ts +17 -0
  214. package/schematics/ng-update/data/symbol-removal.js +12 -0
  215. package/schematics/ng-update/data/symbol-removal.js.map +1 -0
  216. package/schematics/ng-update/devkit-file-system.d.ts +30 -0
  217. package/schematics/ng-update/devkit-file-system.js +83 -0
  218. package/schematics/ng-update/devkit-file-system.js.map +1 -0
  219. package/schematics/ng-update/devkit-migration-rule.d.ts +24 -0
  220. package/schematics/ng-update/devkit-migration-rule.js +142 -0
  221. package/schematics/ng-update/devkit-migration-rule.js.map +1 -0
  222. package/schematics/ng-update/devkit-migration.d.ts +35 -0
  223. package/schematics/ng-update/devkit-migration.js +20 -0
  224. package/schematics/ng-update/devkit-migration.js.map +1 -0
  225. package/schematics/ng-update/find-stylesheets.d.ts +16 -0
  226. package/schematics/ng-update/find-stylesheets.js +41 -0
  227. package/schematics/ng-update/find-stylesheets.js.map +1 -0
  228. package/schematics/ng-update/html-parsing/angular.d.ts +15 -0
  229. package/schematics/ng-update/html-parsing/angular.js +51 -0
  230. package/schematics/ng-update/html-parsing/angular.js.map +1 -0
  231. package/schematics/ng-update/html-parsing/elements.d.ts +24 -0
  232. package/schematics/ng-update/html-parsing/elements.js +63 -0
  233. package/schematics/ng-update/html-parsing/elements.js.map +1 -0
  234. package/schematics/ng-update/index.d.ts +10 -0
  235. package/schematics/ng-update/index.js +29 -0
  236. package/schematics/ng-update/index.js.map +1 -0
  237. package/schematics/ng-update/migrations/attribute-selectors.d.ts +26 -0
  238. package/schematics/ng-update/migrations/attribute-selectors.js +71 -0
  239. package/schematics/ng-update/migrations/attribute-selectors.js.map +1 -0
  240. package/schematics/ng-update/migrations/class-inheritance.d.ts +26 -0
  241. package/schematics/ng-update/migrations/class-inheritance.js +58 -0
  242. package/schematics/ng-update/migrations/class-inheritance.js.map +1 -0
  243. package/schematics/ng-update/migrations/class-names.d.ts +32 -0
  244. package/schematics/ng-update/migrations/class-names.js +91 -0
  245. package/schematics/ng-update/migrations/class-names.js.map +1 -0
  246. package/schematics/ng-update/migrations/constructor-signature.d.ts +29 -0
  247. package/schematics/ng-update/migrations/constructor-signature.js +139 -0
  248. package/schematics/ng-update/migrations/constructor-signature.js.map +1 -0
  249. package/schematics/ng-update/migrations/css-selectors.d.ts +26 -0
  250. package/schematics/ng-update/migrations/css-selectors.js +75 -0
  251. package/schematics/ng-update/migrations/css-selectors.js.map +1 -0
  252. package/schematics/ng-update/migrations/css-tokens.d.ts +26 -0
  253. package/schematics/ng-update/migrations/css-tokens.js +83 -0
  254. package/schematics/ng-update/migrations/css-tokens.js.map +1 -0
  255. package/schematics/ng-update/migrations/element-selectors.d.ts +26 -0
  256. package/schematics/ng-update/migrations/element-selectors.js +66 -0
  257. package/schematics/ng-update/migrations/element-selectors.js.map +1 -0
  258. package/schematics/ng-update/migrations/input-names.d.ts +26 -0
  259. package/schematics/ng-update/migrations/input-names.js +59 -0
  260. package/schematics/ng-update/migrations/input-names.js.map +1 -0
  261. package/schematics/ng-update/migrations/method-call-arguments.d.ts +22 -0
  262. package/schematics/ng-update/migrations/method-call-arguments.js +62 -0
  263. package/schematics/ng-update/migrations/method-call-arguments.js.map +1 -0
  264. package/schematics/ng-update/migrations/misc-template.d.ts +18 -0
  265. package/schematics/ng-update/migrations/misc-template.js +25 -0
  266. package/schematics/ng-update/migrations/misc-template.js.map +1 -0
  267. package/schematics/ng-update/migrations/output-names.d.ts +22 -0
  268. package/schematics/ng-update/migrations/output-names.js +46 -0
  269. package/schematics/ng-update/migrations/output-names.js.map +1 -0
  270. package/schematics/ng-update/migrations/property-names.d.ts +22 -0
  271. package/schematics/ng-update/migrations/property-names.js +60 -0
  272. package/schematics/ng-update/migrations/property-names.js.map +1 -0
  273. package/schematics/ng-update/migrations/symbol-removal.d.ts +18 -0
  274. package/schematics/ng-update/migrations/symbol-removal.js +47 -0
  275. package/schematics/ng-update/migrations/symbol-removal.js.map +1 -0
  276. package/schematics/ng-update/public-api.d.ts +19 -0
  277. package/schematics/ng-update/public-api.js +36 -0
  278. package/schematics/ng-update/public-api.js.map +1 -0
  279. package/schematics/ng-update/typescript/base-types.d.ts +10 -0
  280. package/schematics/ng-update/typescript/base-types.js +23 -0
  281. package/schematics/ng-update/typescript/base-types.js.map +1 -0
  282. package/schematics/ng-update/typescript/imports.d.ts +18 -0
  283. package/schematics/ng-update/typescript/imports.js +53 -0
  284. package/schematics/ng-update/typescript/imports.js.map +1 -0
  285. package/schematics/ng-update/typescript/literal.d.ts +18 -0
  286. package/schematics/ng-update/typescript/literal.js +32 -0
  287. package/schematics/ng-update/typescript/literal.js.map +1 -0
  288. package/schematics/ng-update/typescript/module-specifiers.d.ts +16 -0
  289. package/schematics/ng-update/typescript/module-specifiers.js +35 -0
  290. package/schematics/ng-update/typescript/module-specifiers.js.map +1 -0
  291. package/schematics/ng-update/upgrade-data.d.ts +35 -0
  292. package/schematics/ng-update/upgrade-data.js +40 -0
  293. package/schematics/ng-update/upgrade-data.js.map +1 -0
  294. package/schematics/package.json +3 -0
  295. package/schematics/paths.d.ts +11 -0
  296. package/schematics/paths.js +16 -0
  297. package/schematics/paths.js.map +1 -0
  298. package/schematics/update-tool/component-resource-collector.d.ts +44 -0
  299. package/schematics/update-tool/component-resource-collector.js +164 -0
  300. package/schematics/update-tool/component-resource-collector.js.map +1 -0
  301. package/schematics/update-tool/file-system.d.ts +72 -0
  302. package/schematics/update-tool/file-system.js +18 -0
  303. package/schematics/update-tool/file-system.js.map +1 -0
  304. package/schematics/update-tool/index.d.ts +74 -0
  305. package/schematics/update-tool/index.js +172 -0
  306. package/schematics/update-tool/index.js.map +1 -0
  307. package/schematics/update-tool/logger.d.ts +15 -0
  308. package/schematics/update-tool/logger.js +18 -0
  309. package/schematics/update-tool/logger.js.map +1 -0
  310. package/schematics/update-tool/migration.d.ts +87 -0
  311. package/schematics/update-tool/migration.js +70 -0
  312. package/schematics/update-tool/migration.js.map +1 -0
  313. package/schematics/update-tool/public-api.d.ts +16 -0
  314. package/schematics/update-tool/public-api.js +33 -0
  315. package/schematics/update-tool/public-api.js.map +1 -0
  316. package/schematics/update-tool/target-version.d.ts +16 -0
  317. package/schematics/update-tool/target-version.js +27 -0
  318. package/schematics/update-tool/target-version.js.map +1 -0
  319. package/schematics/update-tool/update-recorder.d.ts +13 -0
  320. package/schematics/update-tool/update-recorder.js +10 -0
  321. package/schematics/update-tool/update-recorder.js.map +1 -0
  322. package/schematics/update-tool/utils/decorators.d.ts +22 -0
  323. package/schematics/update-tool/utils/decorators.js +41 -0
  324. package/schematics/update-tool/utils/decorators.js.map +1 -0
  325. package/schematics/update-tool/utils/diagnostics.d.ts +11 -0
  326. package/schematics/update-tool/utils/diagnostics.js +18 -0
  327. package/schematics/update-tool/utils/diagnostics.js.map +1 -0
  328. package/schematics/update-tool/utils/functions.d.ts +14 -0
  329. package/schematics/update-tool/utils/functions.js +20 -0
  330. package/schematics/update-tool/utils/functions.js.map +1 -0
  331. package/schematics/update-tool/utils/imports.d.ts +17 -0
  332. package/schematics/update-tool/utils/imports.js +110 -0
  333. package/schematics/update-tool/utils/imports.js.map +1 -0
  334. package/schematics/update-tool/utils/line-mappings.d.ts +21 -0
  335. package/schematics/update-tool/utils/line-mappings.js +75 -0
  336. package/schematics/update-tool/utils/line-mappings.js.map +1 -0
  337. package/schematics/update-tool/utils/parse-tsconfig.d.ts +18 -0
  338. package/schematics/update-tool/utils/parse-tsconfig.js +45 -0
  339. package/schematics/update-tool/utils/parse-tsconfig.js.map +1 -0
  340. package/schematics/update-tool/utils/property-name.d.ts +18 -0
  341. package/schematics/update-tool/utils/property-name.js +27 -0
  342. package/schematics/update-tool/utils/property-name.js.map +1 -0
  343. package/schematics/update-tool/utils/virtual-host.d.ts +36 -0
  344. package/schematics/update-tool/utils/virtual-host.js +71 -0
  345. package/schematics/update-tool/utils/virtual-host.js.map +1 -0
  346. package/schematics/update-tool/version-changes.d.ts +32 -0
  347. package/schematics/update-tool/version-changes.js +38 -0
  348. package/schematics/update-tool/version-changes.js.map +1 -0
  349. package/schematics/utils/ast/ng-module-imports.d.ts +12 -0
  350. package/schematics/utils/ast/ng-module-imports.js +82 -0
  351. package/schematics/utils/ast/ng-module-imports.js.map +1 -0
  352. package/schematics/utils/ast.d.ts +25 -0
  353. package/schematics/utils/ast.js +79 -0
  354. package/schematics/utils/ast.js.map +1 -0
  355. package/schematics/utils/build-component.d.ts +20 -0
  356. package/schematics/utils/build-component.js +189 -0
  357. package/schematics/utils/build-component.js.map +1 -0
  358. package/schematics/utils/get-project.d.ts +13 -0
  359. package/schematics/utils/get-project.js +28 -0
  360. package/schematics/utils/get-project.js.map +1 -0
  361. package/schematics/utils/html-manipulation.d.ts +15 -0
  362. package/schematics/utils/html-manipulation.js +91 -0
  363. package/schematics/utils/html-manipulation.js.map +1 -0
  364. package/schematics/utils/index.d.ts +19 -0
  365. package/schematics/utils/index.js +36 -0
  366. package/schematics/utils/index.js.map +1 -0
  367. package/schematics/utils/parse5-element.d.ts +12 -0
  368. package/schematics/utils/parse5-element.js +30 -0
  369. package/schematics/utils/parse5-element.js.map +1 -0
  370. package/schematics/utils/project-index-file.d.ts +13 -0
  371. package/schematics/utils/project-index-file.js +43 -0
  372. package/schematics/utils/project-index-file.js.map +1 -0
  373. package/schematics/utils/project-main-file.d.ts +11 -0
  374. package/schematics/utils/project-main-file.js +25 -0
  375. package/schematics/utils/project-main-file.js.map +1 -0
  376. package/schematics/utils/project-style-file.d.ts +13 -0
  377. package/schematics/utils/project-style-file.js +42 -0
  378. package/schematics/utils/project-style-file.js.map +1 -0
  379. package/schematics/utils/project-targets.d.ts +15 -0
  380. package/schematics/utils/project-targets.js +46 -0
  381. package/schematics/utils/project-targets.js.map +1 -0
  382. package/schematics/utils/project-tsconfig-paths.d.ts +14 -0
  383. package/schematics/utils/project-tsconfig-paths.js +46 -0
  384. package/schematics/utils/project-tsconfig-paths.js.map +1 -0
  385. package/schematics/utils/schematic-options.d.ts +20 -0
  386. package/schematics/utils/schematic-options.js +89 -0
  387. package/schematics/utils/schematic-options.js.map +1 -0
  388. package/scrolling/index.d.ts +62 -849
  389. package/scrolling-module.d.d.ts +551 -0
  390. package/selection-model.d.d.ts +112 -0
  391. package/stepper/index.d.ts +236 -419
  392. package/style-loader.d.d.ts +21 -0
  393. package/table/index.d.ts +901 -1483
  394. package/testing/index.d.ts +98 -0
  395. package/testing/selenium-webdriver/index.d.ts +150 -0
  396. package/testing/testbed/index.d.ts +157 -0
  397. package/text-field/_index.scss +89 -89
  398. package/text-field/index.d.ts +154 -203
  399. package/text-field-prebuilt.css +1 -1
  400. package/tree/index.d.ts +720 -593
  401. package/tree-key-manager-strategy.d.d.ts +116 -0
  402. package/unique-selection-dispatcher.d.d.ts +33 -0
  403. package/view-repeater.d.d.ts +88 -0
  404. package/a11y/_index.import.scss +0 -2
  405. package/esm2020/a11y/a11y-module.mjs +0 -32
  406. package/esm2020/a11y/a11y_public_index.mjs +0 -5
  407. package/esm2020/a11y/aria-describer/aria-describer.mjs +0 -232
  408. package/esm2020/a11y/aria-describer/aria-reference.mjs +0 -44
  409. package/esm2020/a11y/fake-event-detection.mjs +0 -31
  410. package/esm2020/a11y/focus-monitor/focus-monitor.mjs +0 -451
  411. package/esm2020/a11y/focus-trap/configurable-focus-trap-config.mjs +0 -9
  412. package/esm2020/a11y/focus-trap/configurable-focus-trap-factory.mjs +0 -53
  413. package/esm2020/a11y/focus-trap/configurable-focus-trap.mjs +0 -51
  414. package/esm2020/a11y/focus-trap/event-listener-inert-strategy.mjs +0 -61
  415. package/esm2020/a11y/focus-trap/focus-trap-inert-strategy.mjs +0 -11
  416. package/esm2020/a11y/focus-trap/focus-trap-manager.mjs +0 -53
  417. package/esm2020/a11y/focus-trap/focus-trap.mjs +0 -402
  418. package/esm2020/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +0 -109
  419. package/esm2020/a11y/index.mjs +0 -9
  420. package/esm2020/a11y/input-modality/input-modality-detector.mjs +0 -176
  421. package/esm2020/a11y/interactivity-checker/interactivity-checker.mjs +0 -238
  422. package/esm2020/a11y/key-manager/activedescendant-key-manager.mjs +0 -20
  423. package/esm2020/a11y/key-manager/focus-key-manager.mjs +0 -29
  424. package/esm2020/a11y/key-manager/list-key-manager.mjs +0 -321
  425. package/esm2020/a11y/live-announcer/live-announcer-tokens.mjs +0 -19
  426. package/esm2020/a11y/live-announcer/live-announcer.mjs +0 -178
  427. package/esm2020/a11y/public-api.mjs +0 -26
  428. package/esm2020/accordion/accordion-item.mjs +0 -167
  429. package/esm2020/accordion/accordion-module.mjs +0 -24
  430. package/esm2020/accordion/accordion.mjs +0 -70
  431. package/esm2020/accordion/accordion_public_index.mjs +0 -5
  432. package/esm2020/accordion/index.mjs +0 -9
  433. package/esm2020/accordion/public-api.mjs +0 -11
  434. package/esm2020/bidi/bidi-module.mjs +0 -23
  435. package/esm2020/bidi/bidi_public_index.mjs +0 -5
  436. package/esm2020/bidi/dir-document-token.mjs +0 -33
  437. package/esm2020/bidi/dir.mjs +0 -69
  438. package/esm2020/bidi/directionality.mjs +0 -52
  439. package/esm2020/bidi/index.mjs +0 -9
  440. package/esm2020/bidi/public-api.mjs +0 -12
  441. package/esm2020/clipboard/clipboard-module.mjs +0 -23
  442. package/esm2020/clipboard/clipboard.mjs +0 -53
  443. package/esm2020/clipboard/clipboard_public_index.mjs +0 -5
  444. package/esm2020/clipboard/copy-to-clipboard.mjs +0 -99
  445. package/esm2020/clipboard/index.mjs +0 -9
  446. package/esm2020/clipboard/pending-copy.mjs +0 -69
  447. package/esm2020/clipboard/public-api.mjs +0 -12
  448. package/esm2020/coercion/array.mjs +0 -11
  449. package/esm2020/coercion/boolean-property.mjs +0 -12
  450. package/esm2020/coercion/css-pixel-value.mjs +0 -15
  451. package/esm2020/coercion/element.mjs +0 -16
  452. package/esm2020/coercion/index.mjs +0 -9
  453. package/esm2020/coercion/number-property.mjs +0 -21
  454. package/esm2020/coercion/public-api.mjs +0 -14
  455. package/esm2020/coercion/string-array.mjs +0 -38
  456. package/esm2020/collections/array-data-source.mjs +0 -21
  457. package/esm2020/collections/collection-viewer.mjs +0 -9
  458. package/esm2020/collections/collections_public_index.mjs +0 -5
  459. package/esm2020/collections/data-source.mjs +0 -19
  460. package/esm2020/collections/dispose-view-repeater-strategy.mjs +0 -47
  461. package/esm2020/collections/index.mjs +0 -9
  462. package/esm2020/collections/public-api.mjs +0 -17
  463. package/esm2020/collections/recycle-view-repeater-strategy.mjs +0 -128
  464. package/esm2020/collections/selection-model.mjs +0 -216
  465. package/esm2020/collections/tree-adapter.mjs +0 -9
  466. package/esm2020/collections/unique-selection-dispatcher.mjs +0 -55
  467. package/esm2020/collections/view-repeater.mjs +0 -14
  468. package/esm2020/dialog/dialog-config.mjs +0 -63
  469. package/esm2020/dialog/dialog-container.mjs +0 -278
  470. package/esm2020/dialog/dialog-injectors.mjs +0 -26
  471. package/esm2020/dialog/dialog-module.mjs +0 -42
  472. package/esm2020/dialog/dialog-ref.mjs +0 -76
  473. package/esm2020/dialog/dialog.mjs +0 -301
  474. package/esm2020/dialog/dialog_public_index.mjs +0 -5
  475. package/esm2020/dialog/index.mjs +0 -9
  476. package/esm2020/dialog/public-api.mjs +0 -14
  477. package/esm2020/drag-drop/directives/assertions.mjs +0 -18
  478. package/esm2020/drag-drop/directives/config.mjs +0 -14
  479. package/esm2020/drag-drop/directives/drag-handle.mjs +0 -66
  480. package/esm2020/drag-drop/directives/drag-placeholder.mjs +0 -36
  481. package/esm2020/drag-drop/directives/drag-preview.mjs +0 -47
  482. package/esm2020/drag-drop/directives/drag.mjs +0 -487
  483. package/esm2020/drag-drop/directives/drop-list-group.mjs +0 -53
  484. package/esm2020/drag-drop/directives/drop-list.mjs +0 -345
  485. package/esm2020/drag-drop/dom/client-rect.mjs +0 -64
  486. package/esm2020/drag-drop/dom/clone-node.mjs +0 -65
  487. package/esm2020/drag-drop/dom/parent-position-tracker.mjs +0 -76
  488. package/esm2020/drag-drop/dom/styling.mjs +0 -69
  489. package/esm2020/drag-drop/dom/transition-duration.mjs +0 -36
  490. package/esm2020/drag-drop/drag-drop-module.mjs +0 -57
  491. package/esm2020/drag-drop/drag-drop-registry.mjs +0 -231
  492. package/esm2020/drag-drop/drag-drop.mjs +0 -57
  493. package/esm2020/drag-drop/drag-drop_public_index.mjs +0 -5
  494. package/esm2020/drag-drop/drag-events.mjs +0 -9
  495. package/esm2020/drag-drop/drag-parent.mjs +0 -16
  496. package/esm2020/drag-drop/drag-ref.mjs +0 -1146
  497. package/esm2020/drag-drop/drag-utils.mjs +0 -60
  498. package/esm2020/drag-drop/drop-list-ref.mjs +0 -577
  499. package/esm2020/drag-drop/index.mjs +0 -9
  500. package/esm2020/drag-drop/public-api.mjs +0 -23
  501. package/esm2020/drag-drop/sorting/drop-list-sort-strategy.mjs +0 -9
  502. package/esm2020/drag-drop/sorting/single-axis-sort-strategy.mjs +0 -341
  503. package/esm2020/index.mjs +0 -9
  504. package/esm2020/keycodes/index.mjs +0 -9
  505. package/esm2020/keycodes/keycodes.mjs +0 -127
  506. package/esm2020/keycodes/keycodes_public_index.mjs +0 -5
  507. package/esm2020/keycodes/modifiers.mjs +0 -18
  508. package/esm2020/keycodes/public-api.mjs +0 -10
  509. package/esm2020/layout/breakpoints-observer.mjs +0 -105
  510. package/esm2020/layout/breakpoints.mjs +0 -29
  511. package/esm2020/layout/index.mjs +0 -9
  512. package/esm2020/layout/layout-module.mjs +0 -19
  513. package/esm2020/layout/layout_public_index.mjs +0 -5
  514. package/esm2020/layout/media-matcher.mjs +0 -85
  515. package/esm2020/layout/public-api.mjs +0 -12
  516. package/esm2020/listbox/index.mjs +0 -9
  517. package/esm2020/listbox/listbox-module.mjs +0 -24
  518. package/esm2020/listbox/listbox.mjs +0 -872
  519. package/esm2020/listbox/listbox_public_index.mjs +0 -5
  520. package/esm2020/listbox/public-api.mjs +0 -10
  521. package/esm2020/menu/context-menu-trigger.mjs +0 -212
  522. package/esm2020/menu/index.mjs +0 -9
  523. package/esm2020/menu/menu-aim.mjs +0 -203
  524. package/esm2020/menu/menu-bar.mjs +0 -133
  525. package/esm2020/menu/menu-base.mjs +0 -187
  526. package/esm2020/menu/menu-errors.mjs +0 -22
  527. package/esm2020/menu/menu-group.mjs +0 -30
  528. package/esm2020/menu/menu-interface.mjs +0 -11
  529. package/esm2020/menu/menu-item-checkbox.mjs +0 -49
  530. package/esm2020/menu/menu-item-radio.mjs +0 -71
  531. package/esm2020/menu/menu-item-selectable.mjs +0 -42
  532. package/esm2020/menu/menu-item.mjs +0 -267
  533. package/esm2020/menu/menu-module.mjs +0 -62
  534. package/esm2020/menu/menu-stack.mjs +0 -156
  535. package/esm2020/menu/menu-trigger-base.mjs +0 -107
  536. package/esm2020/menu/menu-trigger.mjs +0 -291
  537. package/esm2020/menu/menu.mjs +0 -134
  538. package/esm2020/menu/menu_public_index.mjs +0 -5
  539. package/esm2020/menu/pointer-focus-tracker.mjs +0 -51
  540. package/esm2020/menu/public-api.mjs +0 -24
  541. package/esm2020/observers/index.mjs +0 -9
  542. package/esm2020/observers/observe-content.mjs +0 -187
  543. package/esm2020/observers/observers_public_index.mjs +0 -5
  544. package/esm2020/observers/public-api.mjs +0 -9
  545. package/esm2020/overlay/dispatchers/base-overlay-dispatcher.mjs +0 -52
  546. package/esm2020/overlay/dispatchers/index.mjs +0 -10
  547. package/esm2020/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +0 -81
  548. package/esm2020/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +0 -138
  549. package/esm2020/overlay/fullscreen-overlay-container.mjs +0 -94
  550. package/esm2020/overlay/index.mjs +0 -9
  551. package/esm2020/overlay/overlay-config.mjs +0 -45
  552. package/esm2020/overlay/overlay-container.mjs +0 -81
  553. package/esm2020/overlay/overlay-directives.mjs +0 -427
  554. package/esm2020/overlay/overlay-module.mjs +0 -29
  555. package/esm2020/overlay/overlay-ref.mjs +0 -427
  556. package/esm2020/overlay/overlay-reference.mjs +0 -9
  557. package/esm2020/overlay/overlay.mjs +0 -125
  558. package/esm2020/overlay/overlay_public_index.mjs +0 -5
  559. package/esm2020/overlay/position/connected-position.mjs +0 -88
  560. package/esm2020/overlay/position/flexible-connected-position-strategy.mjs +0 -985
  561. package/esm2020/overlay/position/global-position-strategy.mjs +0 -237
  562. package/esm2020/overlay/position/overlay-position-builder.mjs +0 -50
  563. package/esm2020/overlay/position/position-strategy.mjs +0 -9
  564. package/esm2020/overlay/position/scroll-clip.mjs +0 -40
  565. package/esm2020/overlay/public-api.mjs +0 -22
  566. package/esm2020/overlay/scroll/block-scroll-strategy.mjs +0 -80
  567. package/esm2020/overlay/scroll/close-scroll-strategy.mjs +0 -61
  568. package/esm2020/overlay/scroll/index.mjs +0 -14
  569. package/esm2020/overlay/scroll/noop-scroll-strategy.mjs +0 -17
  570. package/esm2020/overlay/scroll/reposition-scroll-strategy.mjs +0 -61
  571. package/esm2020/overlay/scroll/scroll-strategy-options.mjs +0 -55
  572. package/esm2020/overlay/scroll/scroll-strategy.mjs +0 -14
  573. package/esm2020/platform/features/input-types.mjs +0 -59
  574. package/esm2020/platform/features/passive-listeners.mjs +0 -36
  575. package/esm2020/platform/features/scrolling.mjs +0 -85
  576. package/esm2020/platform/features/shadow-dom.mjs +0 -54
  577. package/esm2020/platform/features/test-environment.mjs +0 -24
  578. package/esm2020/platform/index.mjs +0 -9
  579. package/esm2020/platform/platform-module.mjs +0 -19
  580. package/esm2020/platform/platform.mjs +0 -85
  581. package/esm2020/platform/platform_public_index.mjs +0 -5
  582. package/esm2020/platform/public-api.mjs +0 -15
  583. package/esm2020/portal/dom-portal-outlet.mjs +0 -158
  584. package/esm2020/portal/index.mjs +0 -9
  585. package/esm2020/portal/portal-directives.mjs +0 -246
  586. package/esm2020/portal/portal-errors.mjs +0 -51
  587. package/esm2020/portal/portal-injector.mjs +0 -28
  588. package/esm2020/portal/portal.mjs +0 -188
  589. package/esm2020/portal/portal_public_index.mjs +0 -5
  590. package/esm2020/portal/public-api.mjs +0 -12
  591. package/esm2020/public-api.mjs +0 -9
  592. package/esm2020/scrolling/fixed-size-virtual-scroll.mjs +0 -217
  593. package/esm2020/scrolling/index.mjs +0 -9
  594. package/esm2020/scrolling/public-api.mjs +0 -20
  595. package/esm2020/scrolling/scroll-dispatcher.mjs +0 -163
  596. package/esm2020/scrolling/scrollable.mjs +0 -176
  597. package/esm2020/scrolling/scrolling-module.mjs +0 -67
  598. package/esm2020/scrolling/scrolling_public_index.mjs +0 -5
  599. package/esm2020/scrolling/viewport-ruler.mjs +0 -146
  600. package/esm2020/scrolling/virtual-for-of.mjs +0 -298
  601. package/esm2020/scrolling/virtual-scroll-repeater.mjs +0 -9
  602. package/esm2020/scrolling/virtual-scroll-strategy.mjs +0 -11
  603. package/esm2020/scrolling/virtual-scroll-viewport.mjs +0 -437
  604. package/esm2020/scrolling/virtual-scrollable-element.mjs +0 -41
  605. package/esm2020/scrolling/virtual-scrollable-window.mjs +0 -40
  606. package/esm2020/scrolling/virtual-scrollable.mjs +0 -40
  607. package/esm2020/stepper/index.mjs +0 -9
  608. package/esm2020/stepper/public-api.mjs +0 -13
  609. package/esm2020/stepper/step-header.mjs +0 -30
  610. package/esm2020/stepper/step-label.mjs +0 -23
  611. package/esm2020/stepper/stepper-button.mjs +0 -56
  612. package/esm2020/stepper/stepper-module.mjs +0 -40
  613. package/esm2020/stepper/stepper.mjs +0 -458
  614. package/esm2020/stepper/stepper_public_index.mjs +0 -5
  615. package/esm2020/table/can-stick.mjs +0 -44
  616. package/esm2020/table/cell.mjs +0 -217
  617. package/esm2020/table/coalesced-style-scheduler.mjs +0 -91
  618. package/esm2020/table/index.mjs +0 -9
  619. package/esm2020/table/public-api.mjs +0 -20
  620. package/esm2020/table/row.mjs +0 -262
  621. package/esm2020/table/sticky-position-listener.mjs +0 -11
  622. package/esm2020/table/sticky-styler.mjs +0 -345
  623. package/esm2020/table/table-errors.mjs +0 -67
  624. package/esm2020/table/table-module.mjs +0 -94
  625. package/esm2020/table/table.mjs +0 -1065
  626. package/esm2020/table/table_public_index.mjs +0 -5
  627. package/esm2020/table/text-column.mjs +0 -153
  628. package/esm2020/table/tokens.mjs +0 -16
  629. package/esm2020/text-field/autofill.mjs +0 -113
  630. package/esm2020/text-field/autosize.mjs +0 -309
  631. package/esm2020/text-field/index.mjs +0 -9
  632. package/esm2020/text-field/public-api.mjs +0 -11
  633. package/esm2020/text-field/text-field-module.mjs +0 -24
  634. package/esm2020/text-field/text-field_public_index.mjs +0 -5
  635. package/esm2020/tree/control/base-tree-control.mjs +0 -57
  636. package/esm2020/tree/control/flat-tree-control.mjs +0 -51
  637. package/esm2020/tree/control/nested-tree-control.mjs +0 -58
  638. package/esm2020/tree/control/tree-control.mjs +0 -2
  639. package/esm2020/tree/index.mjs +0 -9
  640. package/esm2020/tree/nested-node.mjs +0 -112
  641. package/esm2020/tree/node.mjs +0 -35
  642. package/esm2020/tree/outlet.mjs +0 -39
  643. package/esm2020/tree/padding.mjs +0 -131
  644. package/esm2020/tree/public-api.mjs +0 -20
  645. package/esm2020/tree/toggle.mjs +0 -50
  646. package/esm2020/tree/tree-errors.mjs +0 -43
  647. package/esm2020/tree/tree-module.mjs +0 -49
  648. package/esm2020/tree/tree.mjs +0 -347
  649. package/esm2020/tree/tree_public_index.mjs +0 -5
  650. package/esm2020/version.mjs +0 -11
  651. package/fesm2015/a11y.mjs +0 -2473
  652. package/fesm2015/a11y.mjs.map +0 -1
  653. package/fesm2015/accordion.mjs +0 -414
  654. package/fesm2015/accordion.mjs.map +0 -1
  655. package/fesm2015/bidi.mjs +0 -194
  656. package/fesm2015/bidi.mjs.map +0 -1
  657. package/fesm2015/cdk.mjs +0 -30
  658. package/fesm2015/cdk.mjs.map +0 -1
  659. package/fesm2015/clipboard.mjs +0 -263
  660. package/fesm2015/clipboard.mjs.map +0 -1
  661. package/fesm2015/coercion.mjs +0 -132
  662. package/fesm2015/coercion.mjs.map +0 -1
  663. package/fesm2015/collections.mjs +0 -519
  664. package/fesm2015/collections.mjs.map +0 -1
  665. package/fesm2015/dialog.mjs +0 -1050
  666. package/fesm2015/dialog.mjs.map +0 -1
  667. package/fesm2015/drag-drop.mjs +0 -3812
  668. package/fesm2015/drag-drop.mjs.map +0 -1
  669. package/fesm2015/keycodes.mjs.map +0 -1
  670. package/fesm2015/layout.mjs +0 -337
  671. package/fesm2015/layout.mjs.map +0 -1
  672. package/fesm2015/listbox.mjs +0 -1200
  673. package/fesm2015/listbox.mjs.map +0 -1
  674. package/fesm2015/menu.mjs +0 -2719
  675. package/fesm2015/menu.mjs.map +0 -1
  676. package/fesm2015/observers.mjs +0 -326
  677. package/fesm2015/observers.mjs.map +0 -1
  678. package/fesm2015/overlay.mjs +0 -3137
  679. package/fesm2015/overlay.mjs.map +0 -1
  680. package/fesm2015/platform.mjs +0 -385
  681. package/fesm2015/platform.mjs.map +0 -1
  682. package/fesm2015/portal.mjs +0 -691
  683. package/fesm2015/portal.mjs.map +0 -1
  684. package/fesm2015/scrolling.mjs.map +0 -1
  685. package/fesm2015/stepper.mjs +0 -989
  686. package/fesm2015/stepper.mjs.map +0 -1
  687. package/fesm2015/table.mjs +0 -2356
  688. package/fesm2015/table.mjs.map +0 -1
  689. package/fesm2015/testing.mjs +0 -833
  690. package/fesm2015/testing.mjs.map +0 -1
  691. package/fesm2015/text-field.mjs +0 -461
  692. package/fesm2015/text-field.mjs.map +0 -1
  693. package/fesm2015/tree.mjs +0 -1303
  694. package/fesm2015/tree.mjs.map +0 -1
  695. package/fesm2020/a11y.mjs +0 -2476
  696. package/fesm2020/a11y.mjs.map +0 -1
  697. package/fesm2020/accordion.mjs +0 -414
  698. package/fesm2020/accordion.mjs.map +0 -1
  699. package/fesm2020/bidi.mjs +0 -192
  700. package/fesm2020/bidi.mjs.map +0 -1
  701. package/fesm2020/cdk.mjs +0 -30
  702. package/fesm2020/cdk.mjs.map +0 -1
  703. package/fesm2020/clipboard.mjs.map +0 -1
  704. package/fesm2020/coercion.mjs +0 -132
  705. package/fesm2020/coercion.mjs.map +0 -1
  706. package/fesm2020/collections.mjs +0 -535
  707. package/fesm2020/collections.mjs.map +0 -1
  708. package/fesm2020/dialog.mjs.map +0 -1
  709. package/fesm2020/drag-drop.mjs.map +0 -1
  710. package/fesm2020/keycodes.mjs +0 -167
  711. package/fesm2020/keycodes.mjs.map +0 -1
  712. package/fesm2020/layout.mjs +0 -337
  713. package/fesm2020/layout.mjs.map +0 -1
  714. package/fesm2020/listbox.mjs +0 -1164
  715. package/fesm2020/listbox.mjs.map +0 -1
  716. package/fesm2020/menu.mjs +0 -2615
  717. package/fesm2020/menu.mjs.map +0 -1
  718. package/fesm2020/observers.mjs +0 -325
  719. package/fesm2020/observers.mjs.map +0 -1
  720. package/fesm2020/overlay.mjs.map +0 -1
  721. package/fesm2020/platform.mjs +0 -383
  722. package/fesm2020/platform.mjs.map +0 -1
  723. package/fesm2020/portal.mjs.map +0 -1
  724. package/fesm2020/scrolling.mjs +0 -1591
  725. package/fesm2020/scrolling.mjs.map +0 -1
  726. package/fesm2020/stepper.mjs +0 -985
  727. package/fesm2020/stepper.mjs.map +0 -1
  728. package/fesm2020/table.mjs.map +0 -1
  729. package/fesm2020/testing.mjs +0 -797
  730. package/fesm2020/testing.mjs.map +0 -1
  731. package/fesm2020/text-field.mjs.map +0 -1
  732. package/fesm2020/tree.mjs +0 -1305
  733. package/fesm2020/tree.mjs.map +0 -1
  734. package/overlay/_index.import.scss +0 -13
  735. package/text-field/_index.import.scss +0 -2
@@ -1,787 +1,874 @@
1
- import * as i1 from '@kato-lee/cdk/a11y';
2
- import { A11yModule } from '@kato-lee/cdk/a11y';
3
- import * as i1$1 from '@kato-lee/cdk/overlay';
4
- import { Overlay, OverlayConfig, OverlayRef, OverlayModule } from '@kato-lee/cdk/overlay';
5
- import { _getFocusedElementPierceShadowDom } from '@kato-lee/cdk/platform';
6
- import * as i3 from '@kato-lee/cdk/portal';
7
- import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, TemplatePortal, PortalModule } from '@kato-lee/cdk/portal';
8
- import { DOCUMENT } from '@angular/common';
9
- import * as i0 from '@angular/core';
10
- import { Component, ViewEncapsulation, ChangeDetectionStrategy, Optional, Inject, ViewChild, InjectionToken, Injector, TemplateRef, InjectFlags, Injectable, SkipSelf, NgModule } from '@angular/core';
11
- import { ESCAPE, hasModifierKey } from '@kato-lee/cdk/keycodes';
12
- import { Subject, defer, of } from 'rxjs';
13
- import { Directionality } from '@kato-lee/cdk/bidi';
14
- import { startWith } from 'rxjs/operators';
15
-
16
- /**
17
- * @license
18
- * Copyright Google LLC All Rights Reserved.
19
- *
20
- * Use of this source code is governed by an MIT-style license that can be
21
- * found in the LICENSE file at https://angular.io/license
22
- */
23
- /** Configuration for opening a modal dialog. */
24
- class DialogConfig {
25
- constructor() {
26
- /** The ARIA role of the dialog element. */
27
- this.role = 'dialog';
28
- /** Optional CSS class or classes applied to the overlay panel. */
29
- this.panelClass = '';
30
- /** Whether the dialog has a backdrop. */
31
- this.hasBackdrop = true;
32
- /** Optional CSS class or classes applied to the overlay backdrop. */
33
- this.backdropClass = '';
34
- /** Whether the dialog closes with the escape key or pointer events outside the panel element. */
35
- this.disableClose = false;
36
- /** Width of the dialog. */
37
- this.width = '';
38
- /** Height of the dialog. */
39
- this.height = '';
40
- /** Data being injected into the child component. */
41
- this.data = null;
42
- /** ID of the element that describes the dialog. */
43
- this.ariaDescribedBy = null;
44
- /** ID of the element that labels the dialog. */
45
- this.ariaLabelledBy = null;
46
- /** Dialog label applied via `aria-label` */
47
- this.ariaLabel = null;
48
- /** Whether this is a modal dialog. Used to set the `aria-modal` attribute. */
49
- this.ariaModal = true;
50
- /**
51
- * Where the dialog should focus on open.
52
- * @breaking-change 14.0.0 Remove boolean option from autoFocus. Use string or
53
- * AutoFocusTarget instead.
54
- */
55
- this.autoFocus = 'first-tabbable';
56
- /**
57
- * Whether the dialog should restore focus to the previously-focused element upon closing.
58
- * Has the following behavior based on the type that is passed in:
59
- * - `boolean` - when true, will return focus to the element that was focused before the dialog
60
- * was opened, otherwise won't restore focus at all.
61
- * - `string` - focus will be restored to the first element that matches the CSS selector.
62
- * - `HTMLElement` - focus will be restored to the specific element.
63
- */
64
- this.restoreFocus = true;
65
- /**
66
- * Whether the dialog should close when the user navigates backwards or forwards through browser
67
- * history. This does not apply to navigation via anchor element unless using URL-hash based
68
- * routing (`HashLocationStrategy` in the Angular router).
69
- */
70
- this.closeOnNavigation = true;
71
- /**
72
- * Whether the dialog should close when the dialog service is destroyed. This is useful if
73
- * another service is wrapping the dialog and is managing the destruction instead.
74
- */
75
- this.closeOnDestroy = true;
76
- }
77
- }
78
-
79
- /**
80
- * @license
81
- * Copyright Google LLC All Rights Reserved.
82
- *
83
- * Use of this source code is governed by an MIT-style license that can be
84
- * found in the LICENSE file at https://angular.io/license
85
- */
86
- function throwDialogContentAlreadyAttachedError() {
87
- throw Error('Attempting to attach dialog content after content is already attached');
88
- }
89
- /**
90
- * Internal component that wraps user-provided dialog content.
91
- * @docs-private
92
- */
93
- class CdkDialogContainer extends BasePortalOutlet {
94
- constructor(_elementRef, _focusTrapFactory, _document, _config, _interactivityChecker, _ngZone, _overlayRef, _focusMonitor) {
95
- super();
96
- this._elementRef = _elementRef;
97
- this._focusTrapFactory = _focusTrapFactory;
98
- this._config = _config;
99
- this._interactivityChecker = _interactivityChecker;
100
- this._ngZone = _ngZone;
101
- this._overlayRef = _overlayRef;
102
- this._focusMonitor = _focusMonitor;
103
- /** Element that was focused before the dialog was opened. Save this to restore upon close. */
104
- this._elementFocusedBeforeDialogWasOpened = null;
105
- /**
106
- * Type of interaction that led to the dialog being closed. This is used to determine
107
- * whether the focus style will be applied when returning focus to its original location
108
- * after the dialog is closed.
109
- */
110
- this._closeInteractionType = null;
111
- /**
112
- * Attaches a DOM portal to the dialog container.
113
- * @param portal Portal to be attached.
114
- * @deprecated To be turned into a method.
115
- * @breaking-change 10.0.0
116
- */
117
- this.attachDomPortal = (portal) => {
118
- if (this._portalOutlet.hasAttached() && (typeof ngDevMode === 'undefined' || ngDevMode)) {
119
- throwDialogContentAlreadyAttachedError();
120
- }
121
- const result = this._portalOutlet.attachDomPortal(portal);
122
- this._contentAttached();
123
- return result;
124
- };
125
- this._ariaLabelledBy = this._config.ariaLabelledBy || null;
126
- this._document = _document;
127
- }
128
- _contentAttached() {
129
- this._initializeFocusTrap();
130
- this._handleBackdropClicks();
131
- this._captureInitialFocus();
132
- }
133
- /**
134
- * Can be used by child classes to customize the initial focus
135
- * capturing behavior (e.g. if it's tied to an animation).
136
- */
137
- _captureInitialFocus() {
138
- this._trapFocus();
139
- }
140
- ngOnDestroy() {
141
- this._restoreFocus();
142
- }
143
- /**
144
- * Attach a ComponentPortal as content to this dialog container.
145
- * @param portal Portal to be attached as the dialog content.
146
- */
147
- attachComponentPortal(portal) {
148
- if (this._portalOutlet.hasAttached() && (typeof ngDevMode === 'undefined' || ngDevMode)) {
149
- throwDialogContentAlreadyAttachedError();
150
- }
151
- const result = this._portalOutlet.attachComponentPortal(portal);
152
- this._contentAttached();
153
- return result;
154
- }
155
- /**
156
- * Attach a TemplatePortal as content to this dialog container.
157
- * @param portal Portal to be attached as the dialog content.
158
- */
159
- attachTemplatePortal(portal) {
160
- if (this._portalOutlet.hasAttached() && (typeof ngDevMode === 'undefined' || ngDevMode)) {
161
- throwDialogContentAlreadyAttachedError();
162
- }
163
- const result = this._portalOutlet.attachTemplatePortal(portal);
164
- this._contentAttached();
165
- return result;
166
- }
167
- // TODO(crisbeto): this shouldn't be exposed, but there are internal references to it.
168
- /** Captures focus if it isn't already inside the dialog. */
169
- _recaptureFocus() {
170
- if (!this._containsFocus()) {
171
- this._trapFocus();
172
- }
173
- }
174
- /**
175
- * Focuses the provided element. If the element is not focusable, it will add a tabIndex
176
- * attribute to forcefully focus it. The attribute is removed after focus is moved.
177
- * @param element The element to focus.
178
- */
179
- _forceFocus(element, options) {
180
- if (!this._interactivityChecker.isFocusable(element)) {
181
- element.tabIndex = -1;
182
- // The tabindex attribute should be removed to avoid navigating to that element again
183
- this._ngZone.runOutsideAngular(() => {
184
- const callback = () => {
185
- element.removeEventListener('blur', callback);
186
- element.removeEventListener('mousedown', callback);
187
- element.removeAttribute('tabindex');
188
- };
189
- element.addEventListener('blur', callback);
190
- element.addEventListener('mousedown', callback);
191
- });
192
- }
193
- element.focus(options);
194
- }
195
- /**
196
- * Focuses the first element that matches the given selector within the focus trap.
197
- * @param selector The CSS selector for the element to set focus to.
198
- */
199
- _focusByCssSelector(selector, options) {
200
- let elementToFocus = this._elementRef.nativeElement.querySelector(selector);
201
- if (elementToFocus) {
202
- this._forceFocus(elementToFocus, options);
203
- }
204
- }
205
- /**
206
- * Moves the focus inside the focus trap. When autoFocus is not set to 'dialog', if focus
207
- * cannot be moved then focus will go to the dialog container.
208
- */
209
- _trapFocus() {
210
- const element = this._elementRef.nativeElement;
211
- // If were to attempt to focus immediately, then the content of the dialog would not yet be
212
- // ready in instances where change detection has to run first. To deal with this, we simply
213
- // wait for the microtask queue to be empty when setting focus when autoFocus isn't set to
214
- // dialog. If the element inside the dialog can't be focused, then the container is focused
215
- // so the user can't tab into other elements behind it.
216
- switch (this._config.autoFocus) {
217
- case false:
218
- case 'dialog':
219
- // Ensure that focus is on the dialog container. It's possible that a different
220
- // component tried to move focus while the open animation was running. See:
221
- // https://github.com/angular/components/issues/16215. Note that we only want to do this
222
- // if the focus isn't inside the dialog already, because it's possible that the consumer
223
- // turned off `autoFocus` in order to move focus themselves.
224
- if (!this._containsFocus()) {
225
- element.focus();
226
- }
227
- break;
228
- case true:
229
- case 'first-tabbable':
230
- this._focusTrap.focusInitialElementWhenReady().then(focusedSuccessfully => {
231
- // If we weren't able to find a focusable element in the dialog, then focus the dialog
232
- // container instead.
233
- if (!focusedSuccessfully) {
234
- this._focusDialogContainer();
235
- }
236
- });
237
- break;
238
- case 'first-heading':
239
- this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]');
240
- break;
241
- default:
242
- this._focusByCssSelector(this._config.autoFocus);
243
- break;
244
- }
245
- }
246
- /** Restores focus to the element that was focused before the dialog opened. */
247
- _restoreFocus() {
248
- const focusConfig = this._config.restoreFocus;
249
- let focusTargetElement = null;
250
- if (typeof focusConfig === 'string') {
251
- focusTargetElement = this._document.querySelector(focusConfig);
252
- }
253
- else if (typeof focusConfig === 'boolean') {
254
- focusTargetElement = focusConfig ? this._elementFocusedBeforeDialogWasOpened : null;
255
- }
256
- else if (focusConfig) {
257
- focusTargetElement = focusConfig;
258
- }
259
- // We need the extra check, because IE can set the `activeElement` to null in some cases.
260
- if (this._config.restoreFocus &&
261
- focusTargetElement &&
262
- typeof focusTargetElement.focus === 'function') {
263
- const activeElement = _getFocusedElementPierceShadowDom();
264
- const element = this._elementRef.nativeElement;
265
- // Make sure that focus is still inside the dialog or is on the body (usually because a
266
- // non-focusable element like the backdrop was clicked) before moving it. It's possible that
267
- // the consumer moved it themselves before the animation was done, in which case we shouldn't
268
- // do anything.
269
- if (!activeElement ||
270
- activeElement === this._document.body ||
271
- activeElement === element ||
272
- element.contains(activeElement)) {
273
- if (this._focusMonitor) {
274
- this._focusMonitor.focusVia(focusTargetElement, this._closeInteractionType);
275
- this._closeInteractionType = null;
276
- }
277
- else {
278
- focusTargetElement.focus();
279
- }
280
- }
281
- }
282
- if (this._focusTrap) {
283
- this._focusTrap.destroy();
284
- }
285
- }
286
- /** Focuses the dialog container. */
287
- _focusDialogContainer() {
288
- // Note that there is no focus method when rendering on the server.
289
- if (this._elementRef.nativeElement.focus) {
290
- this._elementRef.nativeElement.focus();
291
- }
292
- }
293
- /** Returns whether focus is inside the dialog. */
294
- _containsFocus() {
295
- const element = this._elementRef.nativeElement;
296
- const activeElement = _getFocusedElementPierceShadowDom();
297
- return element === activeElement || element.contains(activeElement);
298
- }
299
- /** Sets up the focus trap. */
300
- _initializeFocusTrap() {
301
- this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
302
- // Save the previously focused element. This element will be re-focused
303
- // when the dialog closes.
304
- if (this._document) {
305
- this._elementFocusedBeforeDialogWasOpened = _getFocusedElementPierceShadowDom();
306
- }
307
- }
308
- /** Sets up the listener that handles clicks on the dialog backdrop. */
309
- _handleBackdropClicks() {
310
- // Clicking on the backdrop will move focus out of dialog.
311
- // Recapture it if closing via the backdrop is disabled.
312
- this._overlayRef.backdropClick().subscribe(() => {
313
- if (this._config.disableClose) {
314
- this._recaptureFocus();
315
- }
316
- });
317
- }
318
- }
319
- CdkDialogContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: CdkDialogContainer, deps: [{ token: i0.ElementRef }, { token: i1.FocusTrapFactory }, { token: DOCUMENT, optional: true }, { token: DialogConfig }, { token: i1.InteractivityChecker }, { token: i0.NgZone }, { token: i1$1.OverlayRef }, { token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
320
- CdkDialogContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: CdkDialogContainer, selector: "cdk-dialog-container", host: { attributes: { "tabindex": "-1" }, properties: { "attr.id": "_config.id || null", "attr.role": "_config.role", "attr.aria-modal": "_config.ariaModal", "attr.aria-labelledby": "_config.ariaLabel ? null : _ariaLabelledBy", "attr.aria-label": "_config.ariaLabel", "attr.aria-describedby": "_config.ariaDescribedBy || null" }, classAttribute: "cdk-dialog-container" }, viewQueries: [{ propertyName: "_portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-template cdkPortalOutlet></ng-template>\n", styles: [".cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}"], dependencies: [{ kind: "directive", type: i3.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
321
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: CdkDialogContainer, decorators: [{
322
- type: Component,
323
- args: [{ selector: 'cdk-dialog-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.Default, host: {
324
- 'class': 'cdk-dialog-container',
325
- 'tabindex': '-1',
326
- '[attr.id]': '_config.id || null',
327
- '[attr.role]': '_config.role',
328
- '[attr.aria-modal]': '_config.ariaModal',
329
- '[attr.aria-labelledby]': '_config.ariaLabel ? null : _ariaLabelledBy',
330
- '[attr.aria-label]': '_config.ariaLabel',
331
- '[attr.aria-describedby]': '_config.ariaDescribedBy || null',
332
- }, template: "<ng-template cdkPortalOutlet></ng-template>\n", styles: [".cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}"] }]
333
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.FocusTrapFactory }, { type: undefined, decorators: [{
334
- type: Optional
335
- }, {
336
- type: Inject,
337
- args: [DOCUMENT]
338
- }] }, { type: undefined, decorators: [{
339
- type: Inject,
340
- args: [DialogConfig]
341
- }] }, { type: i1.InteractivityChecker }, { type: i0.NgZone }, { type: i1$1.OverlayRef }, { type: i1.FocusMonitor }]; }, propDecorators: { _portalOutlet: [{
342
- type: ViewChild,
343
- args: [CdkPortalOutlet, { static: true }]
344
- }] } });
345
-
346
- /**
347
- * @license
348
- * Copyright Google LLC All Rights Reserved.
349
- *
350
- * Use of this source code is governed by an MIT-style license that can be
351
- * found in the LICENSE file at https://angular.io/license
352
- */
353
- /**
354
- * Reference to a dialog opened via the Dialog service.
355
- */
356
- class DialogRef {
357
- constructor(overlayRef, config) {
358
- this.overlayRef = overlayRef;
359
- this.config = config;
360
- /** Emits when the dialog has been closed. */
361
- this.closed = new Subject();
362
- this.disableClose = config.disableClose;
363
- this.backdropClick = overlayRef.backdropClick();
364
- this.keydownEvents = overlayRef.keydownEvents();
365
- this.outsidePointerEvents = overlayRef.outsidePointerEvents();
366
- this.id = config.id; // By the time the dialog is created we are guaranteed to have an ID.
367
- this.keydownEvents.subscribe(event => {
368
- if (event.keyCode === ESCAPE && !this.disableClose && !hasModifierKey(event)) {
369
- event.preventDefault();
370
- this.close(undefined, { focusOrigin: 'keyboard' });
371
- }
372
- });
373
- this.backdropClick.subscribe(() => {
374
- if (!this.disableClose) {
375
- this.close(undefined, { focusOrigin: 'mouse' });
376
- }
377
- });
378
- }
379
- /**
380
- * Close the dialog.
381
- * @param result Optional result to return to the dialog opener.
382
- * @param options Additional options to customize the closing behavior.
383
- */
384
- close(result, options) {
385
- if (this.containerInstance) {
386
- const closedSubject = this.closed;
387
- this.containerInstance._closeInteractionType = options?.focusOrigin || 'program';
388
- this.overlayRef.dispose();
389
- closedSubject.next(result);
390
- closedSubject.complete();
391
- this.componentInstance = this.containerInstance = null;
392
- }
393
- }
394
- /** Updates the position of the dialog based on the current position strategy. */
395
- updatePosition() {
396
- this.overlayRef.updatePosition();
397
- return this;
398
- }
399
- /**
400
- * Updates the dialog's width and height.
401
- * @param width New width of the dialog.
402
- * @param height New height of the dialog.
403
- */
404
- updateSize(width = '', height = '') {
405
- this.overlayRef.updateSize({ width, height });
406
- return this;
407
- }
408
- /** Add a CSS class or an array of classes to the overlay pane. */
409
- addPanelClass(classes) {
410
- this.overlayRef.addPanelClass(classes);
411
- return this;
412
- }
413
- /** Remove a CSS class or an array of classes from the overlay pane. */
414
- removePanelClass(classes) {
415
- this.overlayRef.removePanelClass(classes);
416
- return this;
417
- }
418
- }
419
-
420
- /**
421
- * @license
422
- * Copyright Google LLC All Rights Reserved.
423
- *
424
- * Use of this source code is governed by an MIT-style license that can be
425
- * found in the LICENSE file at https://angular.io/license
426
- */
427
- /** Injection token for the Dialog's ScrollStrategy. */
428
- const DIALOG_SCROLL_STRATEGY = new InjectionToken('DialogScrollStrategy');
429
- /** Injection token for the Dialog's Data. */
430
- const DIALOG_DATA = new InjectionToken('DialogData');
431
- /** Injection token that can be used to provide default options for the dialog module. */
432
- const DEFAULT_DIALOG_CONFIG = new InjectionToken('DefaultDialogConfig');
433
- /** @docs-private */
434
- function DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
435
- return () => overlay.scrollStrategies.block();
436
- }
437
- /** @docs-private */
438
- const DIALOG_SCROLL_STRATEGY_PROVIDER = {
439
- provide: DIALOG_SCROLL_STRATEGY,
440
- deps: [Overlay],
441
- useFactory: DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY,
442
- };
443
-
444
- /**
445
- * @license
446
- * Copyright Google LLC All Rights Reserved.
447
- *
448
- * Use of this source code is governed by an MIT-style license that can be
449
- * found in the LICENSE file at https://angular.io/license
450
- */
451
- /** Unique id for the created dialog. */
452
- let uniqueId = 0;
453
- class Dialog {
454
- constructor(_overlay, _injector, _defaultOptions, _parentDialog, _overlayContainer, scrollStrategy) {
455
- this._overlay = _overlay;
456
- this._injector = _injector;
457
- this._defaultOptions = _defaultOptions;
458
- this._parentDialog = _parentDialog;
459
- this._overlayContainer = _overlayContainer;
460
- this._openDialogsAtThisLevel = [];
461
- this._afterAllClosedAtThisLevel = new Subject();
462
- this._afterOpenedAtThisLevel = new Subject();
463
- this._ariaHiddenElements = new Map();
464
- /**
465
- * Stream that emits when all open dialog have finished closing.
466
- * Will emit on subscribe if there are no open dialogs to begin with.
467
- */
468
- this.afterAllClosed = defer(() => this.openDialogs.length
469
- ? this._getAfterAllClosed()
470
- : this._getAfterAllClosed().pipe(startWith(undefined)));
471
- this._scrollStrategy = scrollStrategy;
472
- }
473
- /** Keeps track of the currently-open dialogs. */
474
- get openDialogs() {
475
- return this._parentDialog ? this._parentDialog.openDialogs : this._openDialogsAtThisLevel;
476
- }
477
- /** Stream that emits when a dialog has been opened. */
478
- get afterOpened() {
479
- return this._parentDialog ? this._parentDialog.afterOpened : this._afterOpenedAtThisLevel;
480
- }
481
- open(componentOrTemplateRef, config) {
482
- const defaults = (this._defaultOptions || new DialogConfig());
483
- config = { ...defaults, ...config };
484
- config.id = config.id || `cdk-dialog-${uniqueId++}`;
485
- if (config.id &&
486
- this.getDialogById(config.id) &&
487
- (typeof ngDevMode === 'undefined' || ngDevMode)) {
488
- throw Error(`Dialog with id "${config.id}" exists already. The dialog id must be unique.`);
489
- }
490
- const overlayConfig = this._getOverlayConfig(config);
491
- const overlayRef = this._overlay.create(overlayConfig);
492
- const dialogRef = new DialogRef(overlayRef, config);
493
- const dialogContainer = this._attachContainer(overlayRef, dialogRef, config);
494
- dialogRef.containerInstance = dialogContainer;
495
- this._attachDialogContent(componentOrTemplateRef, dialogRef, dialogContainer, config);
496
- // If this is the first dialog that we're opening, hide all the non-overlay content.
497
- if (!this.openDialogs.length) {
498
- this._hideNonDialogContentFromAssistiveTechnology();
499
- }
500
- this.openDialogs.push(dialogRef);
501
- dialogRef.closed.subscribe(() => this._removeOpenDialog(dialogRef, true));
502
- this.afterOpened.next(dialogRef);
503
- return dialogRef;
504
- }
505
- /**
506
- * Closes all of the currently-open dialogs.
507
- */
508
- closeAll() {
509
- reverseForEach(this.openDialogs, dialog => dialog.close());
510
- }
511
- /**
512
- * Finds an open dialog by its id.
513
- * @param id ID to use when looking up the dialog.
514
- */
515
- getDialogById(id) {
516
- return this.openDialogs.find(dialog => dialog.id === id);
517
- }
518
- ngOnDestroy() {
519
- // Make one pass over all the dialogs that need to be untracked, but should not be closed. We
520
- // want to stop tracking the open dialog even if it hasn't been closed, because the tracking
521
- // determines when `aria-hidden` is removed from elements outside the dialog.
522
- reverseForEach(this._openDialogsAtThisLevel, dialog => {
523
- // Check for `false` specifically since we want `undefined` to be interpreted as `true`.
524
- if (dialog.config.closeOnDestroy === false) {
525
- this._removeOpenDialog(dialog, false);
526
- }
527
- });
528
- // Make a second pass and close the remaining dialogs. We do this second pass in order to
529
- // correctly dispatch the `afterAllClosed` event in case we have a mixed array of dialogs
530
- // that should be closed and dialogs that should not.
531
- reverseForEach(this._openDialogsAtThisLevel, dialog => dialog.close());
532
- this._afterAllClosedAtThisLevel.complete();
533
- this._afterOpenedAtThisLevel.complete();
534
- this._openDialogsAtThisLevel = [];
535
- }
536
- /**
537
- * Creates an overlay config from a dialog config.
538
- * @param config The dialog configuration.
539
- * @returns The overlay configuration.
540
- */
541
- _getOverlayConfig(config) {
542
- const state = new OverlayConfig({
543
- positionStrategy: config.positionStrategy ||
544
- this._overlay.position().global().centerHorizontally().centerVertically(),
545
- scrollStrategy: config.scrollStrategy || this._scrollStrategy(),
546
- panelClass: config.panelClass,
547
- hasBackdrop: config.hasBackdrop,
548
- direction: config.direction,
549
- minWidth: config.minWidth,
550
- minHeight: config.minHeight,
551
- maxWidth: config.maxWidth,
552
- maxHeight: config.maxHeight,
553
- width: config.width,
554
- height: config.height,
555
- disposeOnNavigation: config.closeOnNavigation,
556
- });
557
- if (config.backdropClass) {
558
- state.backdropClass = config.backdropClass;
559
- }
560
- return state;
561
- }
562
- /**
563
- * Attaches a dialog container to a dialog's already-created overlay.
564
- * @param overlay Reference to the dialog's underlying overlay.
565
- * @param config The dialog configuration.
566
- * @returns A promise resolving to a ComponentRef for the attached container.
567
- */
568
- _attachContainer(overlay, dialogRef, config) {
569
- const userInjector = config.injector || config.viewContainerRef?.injector;
570
- const providers = [
571
- { provide: DialogConfig, useValue: config },
572
- { provide: DialogRef, useValue: dialogRef },
573
- { provide: OverlayRef, useValue: overlay },
574
- ];
575
- let containerType;
576
- if (config.container) {
577
- if (typeof config.container === 'function') {
578
- containerType = config.container;
579
- }
580
- else {
581
- containerType = config.container.type;
582
- providers.push(...config.container.providers(config));
583
- }
584
- }
585
- else {
586
- containerType = CdkDialogContainer;
587
- }
588
- const containerPortal = new ComponentPortal(containerType, config.viewContainerRef, Injector.create({ parent: userInjector || this._injector, providers }), config.componentFactoryResolver);
589
- const containerRef = overlay.attach(containerPortal);
590
- return containerRef.instance;
591
- }
592
- /**
593
- * Attaches the user-provided component to the already-created dialog container.
594
- * @param componentOrTemplateRef The type of component being loaded into the dialog,
595
- * or a TemplateRef to instantiate as the content.
596
- * @param dialogRef Reference to the dialog being opened.
597
- * @param dialogContainer Component that is going to wrap the dialog content.
598
- * @param config Configuration used to open the dialog.
599
- */
600
- _attachDialogContent(componentOrTemplateRef, dialogRef, dialogContainer, config) {
601
- if (componentOrTemplateRef instanceof TemplateRef) {
602
- const injector = this._createInjector(config, dialogRef, dialogContainer, undefined);
603
- let context = { $implicit: config.data, dialogRef };
604
- if (config.templateContext) {
605
- context = {
606
- ...context,
607
- ...(typeof config.templateContext === 'function'
608
- ? config.templateContext()
609
- : config.templateContext),
610
- };
611
- }
612
- dialogContainer.attachTemplatePortal(new TemplatePortal(componentOrTemplateRef, null, context, injector));
613
- }
614
- else {
615
- const injector = this._createInjector(config, dialogRef, dialogContainer, this._injector);
616
- const contentRef = dialogContainer.attachComponentPortal(new ComponentPortal(componentOrTemplateRef, config.viewContainerRef, injector, config.componentFactoryResolver));
617
- dialogRef.componentInstance = contentRef.instance;
618
- }
619
- }
620
- /**
621
- * Creates a custom injector to be used inside the dialog. This allows a component loaded inside
622
- * of a dialog to close itself and, optionally, to return a value.
623
- * @param config Config object that is used to construct the dialog.
624
- * @param dialogRef Reference to the dialog being opened.
625
- * @param dialogContainer Component that is going to wrap the dialog content.
626
- * @param fallbackInjector Injector to use as a fallback when a lookup fails in the custom
627
- * dialog injector, if the user didn't provide a custom one.
628
- * @returns The custom injector that can be used inside the dialog.
629
- */
630
- _createInjector(config, dialogRef, dialogContainer, fallbackInjector) {
631
- const userInjector = config.injector || config.viewContainerRef?.injector;
632
- const providers = [
633
- { provide: DIALOG_DATA, useValue: config.data },
634
- { provide: DialogRef, useValue: dialogRef },
635
- ];
636
- if (config.providers) {
637
- if (typeof config.providers === 'function') {
638
- providers.push(...config.providers(dialogRef, config, dialogContainer));
639
- }
640
- else {
641
- providers.push(...config.providers);
642
- }
643
- }
644
- if (config.direction &&
645
- (!userInjector ||
646
- !userInjector.get(Directionality, null, InjectFlags.Optional))) {
647
- providers.push({
648
- provide: Directionality,
649
- useValue: { value: config.direction, change: of() },
650
- });
651
- }
652
- return Injector.create({ parent: userInjector || fallbackInjector, providers });
653
- }
654
- /**
655
- * Removes a dialog from the array of open dialogs.
656
- * @param dialogRef Dialog to be removed.
657
- * @param emitEvent Whether to emit an event if this is the last dialog.
658
- */
659
- _removeOpenDialog(dialogRef, emitEvent) {
660
- const index = this.openDialogs.indexOf(dialogRef);
661
- if (index > -1) {
662
- this.openDialogs.splice(index, 1);
663
- // If all the dialogs were closed, remove/restore the `aria-hidden`
664
- // to a the siblings and emit to the `afterAllClosed` stream.
665
- if (!this.openDialogs.length) {
666
- this._ariaHiddenElements.forEach((previousValue, element) => {
667
- if (previousValue) {
668
- element.setAttribute('aria-hidden', previousValue);
669
- }
670
- else {
671
- element.removeAttribute('aria-hidden');
672
- }
673
- });
674
- this._ariaHiddenElements.clear();
675
- if (emitEvent) {
676
- this._getAfterAllClosed().next();
677
- }
678
- }
679
- }
680
- }
681
- /** Hides all of the content that isn't an overlay from assistive technology. */
682
- _hideNonDialogContentFromAssistiveTechnology() {
683
- const overlayContainer = this._overlayContainer.getContainerElement();
684
- // Ensure that the overlay container is attached to the DOM.
685
- if (overlayContainer.parentElement) {
686
- const siblings = overlayContainer.parentElement.children;
687
- for (let i = siblings.length - 1; i > -1; i--) {
688
- const sibling = siblings[i];
689
- if (sibling !== overlayContainer &&
690
- sibling.nodeName !== 'SCRIPT' &&
691
- sibling.nodeName !== 'STYLE' &&
692
- !sibling.hasAttribute('aria-live')) {
693
- this._ariaHiddenElements.set(sibling, sibling.getAttribute('aria-hidden'));
694
- sibling.setAttribute('aria-hidden', 'true');
695
- }
696
- }
697
- }
698
- }
699
- _getAfterAllClosed() {
700
- const parent = this._parentDialog;
701
- return parent ? parent._getAfterAllClosed() : this._afterAllClosedAtThisLevel;
702
- }
703
- }
704
- Dialog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: Dialog, deps: [{ token: i1$1.Overlay }, { token: i0.Injector }, { token: DEFAULT_DIALOG_CONFIG, optional: true }, { token: Dialog, optional: true, skipSelf: true }, { token: i1$1.OverlayContainer }, { token: DIALOG_SCROLL_STRATEGY }], target: i0.ɵɵFactoryTarget.Injectable });
705
- Dialog.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: Dialog });
706
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: Dialog, decorators: [{
707
- type: Injectable
708
- }], ctorParameters: function () { return [{ type: i1$1.Overlay }, { type: i0.Injector }, { type: DialogConfig, decorators: [{
709
- type: Optional
710
- }, {
711
- type: Inject,
712
- args: [DEFAULT_DIALOG_CONFIG]
713
- }] }, { type: Dialog, decorators: [{
714
- type: Optional
715
- }, {
716
- type: SkipSelf
717
- }] }, { type: i1$1.OverlayContainer }, { type: undefined, decorators: [{
718
- type: Inject,
719
- args: [DIALOG_SCROLL_STRATEGY]
720
- }] }]; } });
721
- /**
722
- * Executes a callback against all elements in an array while iterating in reverse.
723
- * Useful if the array is being modified as it is being iterated.
724
- */
725
- function reverseForEach(items, callback) {
726
- let i = items.length;
727
- while (i--) {
728
- callback(items[i]);
729
- }
730
- }
731
-
732
- /**
733
- * @license
734
- * Copyright Google LLC All Rights Reserved.
735
- *
736
- * Use of this source code is governed by an MIT-style license that can be
737
- * found in the LICENSE file at https://angular.io/license
738
- */
739
- class DialogModule {
740
- }
741
- DialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
742
- DialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: DialogModule, declarations: [CdkDialogContainer], imports: [OverlayModule, PortalModule, A11yModule], exports: [
743
- // Re-export the PortalModule so that people extending the `CdkDialogContainer`
744
- // don't have to remember to import it or be faced with an unhelpful error.
745
- PortalModule,
746
- CdkDialogContainer] });
747
- DialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DialogModule, providers: [Dialog, DIALOG_SCROLL_STRATEGY_PROVIDER], imports: [OverlayModule, PortalModule, A11yModule,
748
- // Re-export the PortalModule so that people extending the `CdkDialogContainer`
749
- // don't have to remember to import it or be faced with an unhelpful error.
750
- PortalModule] });
751
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DialogModule, decorators: [{
752
- type: NgModule,
753
- args: [{
754
- imports: [OverlayModule, PortalModule, A11yModule],
755
- exports: [
756
- // Re-export the PortalModule so that people extending the `CdkDialogContainer`
757
- // don't have to remember to import it or be faced with an unhelpful error.
758
- PortalModule,
759
- CdkDialogContainer,
760
- ],
761
- declarations: [CdkDialogContainer],
762
- providers: [Dialog, DIALOG_SCROLL_STRATEGY_PROVIDER],
763
- }]
764
- }] });
765
-
766
- /**
767
- * @license
768
- * Copyright Google LLC All Rights Reserved.
769
- *
770
- * Use of this source code is governed by an MIT-style license that can be
771
- * found in the LICENSE file at https://angular.io/license
772
- */
773
-
774
- /**
775
- * @license
776
- * Copyright Google LLC All Rights Reserved.
777
- *
778
- * Use of this source code is governed by an MIT-style license that can be
779
- * found in the LICENSE file at https://angular.io/license
780
- */
781
-
782
- /**
783
- * Generated bundle index. Do not edit.
784
- */
785
-
786
- export { CdkDialogContainer, DEFAULT_DIALOG_CONFIG, DIALOG_DATA, DIALOG_SCROLL_STRATEGY, DIALOG_SCROLL_STRATEGY_PROVIDER, DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY, Dialog, DialogConfig, DialogModule, DialogRef, throwDialogContentAlreadyAttachedError };
787
- //# sourceMappingURL=dialog.mjs.map
1
+ import * as i0 from '@angular/core';
2
+ import { inject, ElementRef, NgZone, Renderer2, ChangeDetectorRef, Injector, DOCUMENT, afterNextRender, Component, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, InjectionToken, TemplateRef, Injectable, signal, EventEmitter, NgModule } from '@angular/core';
3
+ import { Subject, defer } from 'rxjs';
4
+ import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, TemplatePortal, PortalModule } from './portal.mjs';
5
+ export { CdkPortal as ɵɵCdkPortal, PortalHostDirective as ɵɵPortalHostDirective, TemplatePortalDirective as ɵɵTemplatePortalDirective } from './portal.mjs';
6
+ import { FocusTrapFactory, InteractivityChecker, A11yModule } from './a11y-module.mjs';
7
+ import { FocusMonitor } from './focus-monitor.mjs';
8
+ import { Platform } from './platform2.mjs';
9
+ import { _getFocusedElementPierceShadowDom } from './shadow-dom.mjs';
10
+ import { ESCAPE } from './keycodes2.mjs';
11
+ import { hasModifierKey } from './keycodes.mjs';
12
+ import { startWith, take } from 'rxjs/operators';
13
+ import { createBlockScrollStrategy, OverlayContainer, createOverlayRef, OverlayConfig, createGlobalPositionStrategy, OverlayRef, OverlayModule } from './overlay-module.mjs';
14
+ import { _IdGenerator } from './id-generator.mjs';
15
+ import { Directionality } from './directionality.mjs';
16
+ import './style-loader.mjs';
17
+ import './private.mjs';
18
+ import './breakpoints-observer.mjs';
19
+ import './array.mjs';
20
+ import './observers.mjs';
21
+ import './element.mjs';
22
+ import './fake-event-detection.mjs';
23
+ import './passive-listeners.mjs';
24
+ import '@angular/common';
25
+ import './test-environment.mjs';
26
+ import './css-pixel-value.mjs';
27
+ import './scrolling.mjs';
28
+ import './scrolling2.mjs';
29
+ import './bidi.mjs';
30
+ import './recycle-view-repeater-strategy.mjs';
31
+ import './data-source.mjs';
32
+
33
+ /** Configuration for opening a modal dialog. */
34
+ class DialogConfig {
35
+ /**
36
+ * Where the attached component should live in Angular's *logical* component tree.
37
+ * This affects what is available for injection and the change detection order for the
38
+ * component instantiated inside of the dialog. This does not affect where the dialog
39
+ * content will be rendered.
40
+ */
41
+ viewContainerRef;
42
+ /**
43
+ * Injector used for the instantiation of the component to be attached. If provided,
44
+ * takes precedence over the injector indirectly provided by `ViewContainerRef`.
45
+ */
46
+ injector;
47
+ /** ID for the dialog. If omitted, a unique one will be generated. */
48
+ id;
49
+ /** The ARIA role of the dialog element. */
50
+ role = 'dialog';
51
+ /** Optional CSS class or classes applied to the overlay panel. */
52
+ panelClass = '';
53
+ /** Whether the dialog has a backdrop. */
54
+ hasBackdrop = true;
55
+ /** Optional CSS class or classes applied to the overlay backdrop. */
56
+ backdropClass = '';
57
+ /** Whether the dialog closes with the escape key or pointer events outside the panel element. */
58
+ disableClose = false;
59
+ /** Function used to determine whether the dialog is allowed to close. */
60
+ closePredicate;
61
+ /** Width of the dialog. */
62
+ width = '';
63
+ /** Height of the dialog. */
64
+ height = '';
65
+ /** Min-width of the dialog. If a number is provided, assumes pixel units. */
66
+ minWidth;
67
+ /** Min-height of the dialog. If a number is provided, assumes pixel units. */
68
+ minHeight;
69
+ /** Max-width of the dialog. If a number is provided, assumes pixel units. */
70
+ maxWidth;
71
+ /** Max-height of the dialog. If a number is provided, assumes pixel units. */
72
+ maxHeight;
73
+ /** Strategy to use when positioning the dialog. Defaults to centering it on the page. */
74
+ positionStrategy;
75
+ /** Data being injected into the child component. */
76
+ data = null;
77
+ /** Layout direction for the dialog's content. */
78
+ direction;
79
+ /** ID of the element that describes the dialog. */
80
+ ariaDescribedBy = null;
81
+ /** ID of the element that labels the dialog. */
82
+ ariaLabelledBy = null;
83
+ /** Dialog label applied via `aria-label` */
84
+ ariaLabel = null;
85
+ /**
86
+ * Whether this is a modal dialog. Used to set the `aria-modal` attribute. Off by default,
87
+ * because it can interfere with other overlay-based components (e.g. `mat-select`) and because
88
+ * it is redundant since the dialog marks all outside content as `aria-hidden` anyway.
89
+ */
90
+ ariaModal = false;
91
+ /**
92
+ * Where the dialog should focus on open.
93
+ * @breaking-change 14.0.0 Remove boolean option from autoFocus. Use string or
94
+ * AutoFocusTarget instead.
95
+ */
96
+ autoFocus = 'first-tabbable';
97
+ /**
98
+ * Whether the dialog should restore focus to the previously-focused element upon closing.
99
+ * Has the following behavior based on the type that is passed in:
100
+ * - `boolean` - when true, will return focus to the element that was focused before the dialog
101
+ * was opened, otherwise won't restore focus at all.
102
+ * - `string` - focus will be restored to the first element that matches the CSS selector.
103
+ * - `HTMLElement` - focus will be restored to the specific element.
104
+ */
105
+ restoreFocus = true;
106
+ /**
107
+ * Scroll strategy to be used for the dialog. This determines how
108
+ * the dialog responds to scrolling underneath the panel element.
109
+ */
110
+ scrollStrategy;
111
+ /**
112
+ * Whether the dialog should close when the user navigates backwards or forwards through browser
113
+ * history. This does not apply to navigation via anchor element unless using URL-hash based
114
+ * routing (`HashLocationStrategy` in the Angular router).
115
+ */
116
+ closeOnNavigation = true;
117
+ /**
118
+ * Whether the dialog should close when the dialog service is destroyed. This is useful if
119
+ * another service is wrapping the dialog and is managing the destruction instead.
120
+ */
121
+ closeOnDestroy = true;
122
+ /**
123
+ * Whether the dialog should close when the underlying overlay is detached. This is useful if
124
+ * another service is wrapping the dialog and is managing the destruction instead. E.g. an
125
+ * external detachment can happen as a result of a scroll strategy triggering it or when the
126
+ * browser location changes.
127
+ */
128
+ closeOnOverlayDetachments = true;
129
+ /**
130
+ * Whether the built-in overlay animations should be disabled.
131
+ */
132
+ disableAnimations = false;
133
+ /**
134
+ * Providers that will be exposed to the contents of the dialog. Can also
135
+ * be provided as a function in order to generate the providers lazily.
136
+ */
137
+ providers;
138
+ /**
139
+ * Component into which the dialog content will be rendered. Defaults to `CdkDialogContainer`.
140
+ * A configuration object can be passed in to customize the providers that will be exposed
141
+ * to the dialog container.
142
+ */
143
+ container;
144
+ /**
145
+ * Context that will be passed to template-based dialogs.
146
+ * A function can be passed in to resolve the context lazily.
147
+ */
148
+ templateContext;
149
+ }
150
+
151
+ function throwDialogContentAlreadyAttachedError() {
152
+ throw Error('Attempting to attach dialog content after content is already attached');
153
+ }
154
+ /**
155
+ * Internal component that wraps user-provided dialog content.
156
+ * @docs-private
157
+ */
158
+ class CdkDialogContainer extends BasePortalOutlet {
159
+ _elementRef = inject(ElementRef);
160
+ _focusTrapFactory = inject(FocusTrapFactory);
161
+ _config;
162
+ _interactivityChecker = inject(InteractivityChecker);
163
+ _ngZone = inject(NgZone);
164
+ _focusMonitor = inject(FocusMonitor);
165
+ _renderer = inject(Renderer2);
166
+ _changeDetectorRef = inject(ChangeDetectorRef);
167
+ _injector = inject(Injector);
168
+ _platform = inject(Platform);
169
+ _document = inject(DOCUMENT);
170
+ /** The portal outlet inside of this container into which the dialog content will be loaded. */
171
+ _portalOutlet;
172
+ _focusTrapped = new Subject();
173
+ /** The class that traps and manages focus within the dialog. */
174
+ _focusTrap = null;
175
+ /** Element that was focused before the dialog was opened. Save this to restore upon close. */
176
+ _elementFocusedBeforeDialogWasOpened = null;
177
+ /**
178
+ * Type of interaction that led to the dialog being closed. This is used to determine
179
+ * whether the focus style will be applied when returning focus to its original location
180
+ * after the dialog is closed.
181
+ */
182
+ _closeInteractionType = null;
183
+ /**
184
+ * Queue of the IDs of the dialog's label element, based on their definition order. The first
185
+ * ID will be used as the `aria-labelledby` value. We use a queue here to handle the case
186
+ * where there are two or more titles in the DOM at a time and the first one is destroyed while
187
+ * the rest are present.
188
+ */
189
+ _ariaLabelledByQueue = [];
190
+ _isDestroyed = false;
191
+ constructor() {
192
+ super();
193
+ // Callback is primarily for some internal tests
194
+ // that were instantiating the dialog container manually.
195
+ this._config = (inject(DialogConfig, { optional: true }) || new DialogConfig());
196
+ if (this._config.ariaLabelledBy) {
197
+ this._ariaLabelledByQueue.push(this._config.ariaLabelledBy);
198
+ }
199
+ }
200
+ _addAriaLabelledBy(id) {
201
+ this._ariaLabelledByQueue.push(id);
202
+ this._changeDetectorRef.markForCheck();
203
+ }
204
+ _removeAriaLabelledBy(id) {
205
+ const index = this._ariaLabelledByQueue.indexOf(id);
206
+ if (index > -1) {
207
+ this._ariaLabelledByQueue.splice(index, 1);
208
+ this._changeDetectorRef.markForCheck();
209
+ }
210
+ }
211
+ _contentAttached() {
212
+ this._initializeFocusTrap();
213
+ this._captureInitialFocus();
214
+ }
215
+ /**
216
+ * Can be used by child classes to customize the initial focus
217
+ * capturing behavior (e.g. if it's tied to an animation).
218
+ */
219
+ _captureInitialFocus() {
220
+ this._trapFocus();
221
+ }
222
+ ngOnDestroy() {
223
+ this._focusTrapped.complete();
224
+ this._isDestroyed = true;
225
+ this._restoreFocus();
226
+ }
227
+ /**
228
+ * Attach a ComponentPortal as content to this dialog container.
229
+ * @param portal Portal to be attached as the dialog content.
230
+ */
231
+ attachComponentPortal(portal) {
232
+ if (this._portalOutlet.hasAttached() && (typeof ngDevMode === 'undefined' || ngDevMode)) {
233
+ throwDialogContentAlreadyAttachedError();
234
+ }
235
+ const result = this._portalOutlet.attachComponentPortal(portal);
236
+ this._contentAttached();
237
+ return result;
238
+ }
239
+ /**
240
+ * Attach a TemplatePortal as content to this dialog container.
241
+ * @param portal Portal to be attached as the dialog content.
242
+ */
243
+ attachTemplatePortal(portal) {
244
+ if (this._portalOutlet.hasAttached() && (typeof ngDevMode === 'undefined' || ngDevMode)) {
245
+ throwDialogContentAlreadyAttachedError();
246
+ }
247
+ const result = this._portalOutlet.attachTemplatePortal(portal);
248
+ this._contentAttached();
249
+ return result;
250
+ }
251
+ /**
252
+ * Attaches a DOM portal to the dialog container.
253
+ * @param portal Portal to be attached.
254
+ * @deprecated To be turned into a method.
255
+ * @breaking-change 10.0.0
256
+ */
257
+ attachDomPortal = (portal) => {
258
+ if (this._portalOutlet.hasAttached() && (typeof ngDevMode === 'undefined' || ngDevMode)) {
259
+ throwDialogContentAlreadyAttachedError();
260
+ }
261
+ const result = this._portalOutlet.attachDomPortal(portal);
262
+ this._contentAttached();
263
+ return result;
264
+ };
265
+ // TODO(crisbeto): this shouldn't be exposed, but there are internal references to it.
266
+ /** Captures focus if it isn't already inside the dialog. */
267
+ _recaptureFocus() {
268
+ if (!this._containsFocus()) {
269
+ this._trapFocus();
270
+ }
271
+ }
272
+ /**
273
+ * Focuses the provided element. If the element is not focusable, it will add a tabIndex
274
+ * attribute to forcefully focus it. The attribute is removed after focus is moved.
275
+ * @param element The element to focus.
276
+ */
277
+ _forceFocus(element, options) {
278
+ if (!this._interactivityChecker.isFocusable(element)) {
279
+ element.tabIndex = -1;
280
+ // The tabindex attribute should be removed to avoid navigating to that element again
281
+ this._ngZone.runOutsideAngular(() => {
282
+ const callback = () => {
283
+ deregisterBlur();
284
+ deregisterMousedown();
285
+ element.removeAttribute('tabindex');
286
+ };
287
+ const deregisterBlur = this._renderer.listen(element, 'blur', callback);
288
+ const deregisterMousedown = this._renderer.listen(element, 'mousedown', callback);
289
+ });
290
+ }
291
+ element.focus(options);
292
+ }
293
+ /**
294
+ * Focuses the first element that matches the given selector within the focus trap.
295
+ * @param selector The CSS selector for the element to set focus to.
296
+ */
297
+ _focusByCssSelector(selector, options) {
298
+ let elementToFocus = this._elementRef.nativeElement.querySelector(selector);
299
+ if (elementToFocus) {
300
+ this._forceFocus(elementToFocus, options);
301
+ }
302
+ }
303
+ /**
304
+ * Moves the focus inside the focus trap. When autoFocus is not set to 'dialog', if focus
305
+ * cannot be moved then focus will go to the dialog container.
306
+ */
307
+ _trapFocus(options) {
308
+ if (this._isDestroyed) {
309
+ return;
310
+ }
311
+ // If were to attempt to focus immediately, then the content of the dialog would not yet be
312
+ // ready in instances where change detection has to run first. To deal with this, we simply
313
+ // wait until after the next render.
314
+ afterNextRender(() => {
315
+ const element = this._elementRef.nativeElement;
316
+ switch (this._config.autoFocus) {
317
+ case false:
318
+ case 'dialog':
319
+ // Ensure that focus is on the dialog container. It's possible that a different
320
+ // component tried to move focus while the open animation was running. See:
321
+ // https://github.com/angular/components/issues/16215. Note that we only want to do this
322
+ // if the focus isn't inside the dialog already, because it's possible that the consumer
323
+ // turned off `autoFocus` in order to move focus themselves.
324
+ if (!this._containsFocus()) {
325
+ element.focus(options);
326
+ }
327
+ break;
328
+ case true:
329
+ case 'first-tabbable':
330
+ const focusedSuccessfully = this._focusTrap?.focusInitialElement(options);
331
+ // If we weren't able to find a focusable element in the dialog, then focus the dialog
332
+ // container instead.
333
+ if (!focusedSuccessfully) {
334
+ this._focusDialogContainer(options);
335
+ }
336
+ break;
337
+ case 'first-heading':
338
+ this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]', options);
339
+ break;
340
+ default:
341
+ this._focusByCssSelector(this._config.autoFocus, options);
342
+ break;
343
+ }
344
+ this._focusTrapped.next();
345
+ }, { injector: this._injector });
346
+ }
347
+ /** Restores focus to the element that was focused before the dialog opened. */
348
+ _restoreFocus() {
349
+ const focusConfig = this._config.restoreFocus;
350
+ let focusTargetElement = null;
351
+ if (typeof focusConfig === 'string') {
352
+ focusTargetElement = this._document.querySelector(focusConfig);
353
+ }
354
+ else if (typeof focusConfig === 'boolean') {
355
+ focusTargetElement = focusConfig ? this._elementFocusedBeforeDialogWasOpened : null;
356
+ }
357
+ else if (focusConfig) {
358
+ focusTargetElement = focusConfig;
359
+ }
360
+ // We need the extra check, because IE can set the `activeElement` to null in some cases.
361
+ if (this._config.restoreFocus &&
362
+ focusTargetElement &&
363
+ typeof focusTargetElement.focus === 'function') {
364
+ const activeElement = _getFocusedElementPierceShadowDom();
365
+ const element = this._elementRef.nativeElement;
366
+ // Make sure that focus is still inside the dialog or is on the body (usually because a
367
+ // non-focusable element like the backdrop was clicked) before moving it. It's possible that
368
+ // the consumer moved it themselves before the animation was done, in which case we shouldn't
369
+ // do anything.
370
+ if (!activeElement ||
371
+ activeElement === this._document.body ||
372
+ activeElement === element ||
373
+ element.contains(activeElement)) {
374
+ if (this._focusMonitor) {
375
+ this._focusMonitor.focusVia(focusTargetElement, this._closeInteractionType);
376
+ this._closeInteractionType = null;
377
+ }
378
+ else {
379
+ focusTargetElement.focus();
380
+ }
381
+ }
382
+ }
383
+ if (this._focusTrap) {
384
+ this._focusTrap.destroy();
385
+ }
386
+ }
387
+ /** Focuses the dialog container. */
388
+ _focusDialogContainer(options) {
389
+ // Note that there is no focus method when rendering on the server.
390
+ this._elementRef.nativeElement.focus?.(options);
391
+ }
392
+ /** Returns whether focus is inside the dialog. */
393
+ _containsFocus() {
394
+ const element = this._elementRef.nativeElement;
395
+ const activeElement = _getFocusedElementPierceShadowDom();
396
+ return element === activeElement || element.contains(activeElement);
397
+ }
398
+ /** Sets up the focus trap. */
399
+ _initializeFocusTrap() {
400
+ if (this._platform.isBrowser) {
401
+ this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
402
+ // Save the previously focused element. This element will be re-focused
403
+ // when the dialog closes.
404
+ if (this._document) {
405
+ this._elementFocusedBeforeDialogWasOpened = _getFocusedElementPierceShadowDom();
406
+ }
407
+ }
408
+ }
409
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkDialogContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
410
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.0-next.2", type: CdkDialogContainer, isStandalone: true, selector: "cdk-dialog-container", host: { attributes: { "tabindex": "-1" }, properties: { "attr.id": "_config.id || null", "attr.role": "_config.role", "attr.aria-modal": "_config.ariaModal", "attr.aria-labelledby": "_config.ariaLabel ? null : _ariaLabelledByQueue[0]", "attr.aria-label": "_config.ariaLabel", "attr.aria-describedby": "_config.ariaDescribedBy || null" }, classAttribute: "cdk-dialog-container" }, viewQueries: [{ propertyName: "_portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-template cdkPortalOutlet />\n", styles: [".cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}\n"], dependencies: [{ kind: "directive", type: CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
411
+ }
412
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkDialogContainer, decorators: [{
413
+ type: Component,
414
+ args: [{ selector: 'cdk-dialog-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.Default, imports: [CdkPortalOutlet], host: {
415
+ 'class': 'cdk-dialog-container',
416
+ 'tabindex': '-1',
417
+ '[attr.id]': '_config.id || null',
418
+ '[attr.role]': '_config.role',
419
+ '[attr.aria-modal]': '_config.ariaModal',
420
+ '[attr.aria-labelledby]': '_config.ariaLabel ? null : _ariaLabelledByQueue[0]',
421
+ '[attr.aria-label]': '_config.ariaLabel',
422
+ '[attr.aria-describedby]': '_config.ariaDescribedBy || null',
423
+ }, template: "<ng-template cdkPortalOutlet />\n", styles: [".cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}\n"] }]
424
+ }], ctorParameters: () => [], propDecorators: { _portalOutlet: [{
425
+ type: ViewChild,
426
+ args: [CdkPortalOutlet, { static: true }]
427
+ }] } });
428
+
429
+ /**
430
+ * Reference to a dialog opened via the Dialog service.
431
+ */
432
+ class DialogRef {
433
+ overlayRef;
434
+ config;
435
+ /**
436
+ * Instance of component opened into the dialog. Will be
437
+ * null when the dialog is opened using a `TemplateRef`.
438
+ */
439
+ componentInstance;
440
+ /**
441
+ * `ComponentRef` of the component opened into the dialog. Will be
442
+ * null when the dialog is opened using a `TemplateRef`.
443
+ */
444
+ componentRef;
445
+ /** Instance of the container that is rendering out the dialog content. */
446
+ containerInstance;
447
+ /** Whether the user is allowed to close the dialog. */
448
+ disableClose;
449
+ /** Emits when the dialog has been closed. */
450
+ closed = new Subject();
451
+ /** Emits when the backdrop of the dialog is clicked. */
452
+ backdropClick;
453
+ /** Emits when on keyboard events within the dialog. */
454
+ keydownEvents;
455
+ /** Emits on pointer events that happen outside of the dialog. */
456
+ outsidePointerEvents;
457
+ /** Unique ID for the dialog. */
458
+ id;
459
+ /** Subscription to external detachments of the dialog. */
460
+ _detachSubscription;
461
+ constructor(overlayRef, config) {
462
+ this.overlayRef = overlayRef;
463
+ this.config = config;
464
+ this.disableClose = config.disableClose;
465
+ this.backdropClick = overlayRef.backdropClick();
466
+ this.keydownEvents = overlayRef.keydownEvents();
467
+ this.outsidePointerEvents = overlayRef.outsidePointerEvents();
468
+ this.id = config.id; // By the time the dialog is created we are guaranteed to have an ID.
469
+ this.keydownEvents.subscribe(event => {
470
+ if (event.keyCode === ESCAPE && !this.disableClose && !hasModifierKey(event)) {
471
+ event.preventDefault();
472
+ this.close(undefined, { focusOrigin: 'keyboard' });
473
+ }
474
+ });
475
+ this.backdropClick.subscribe(() => {
476
+ if (!this.disableClose && this._canClose()) {
477
+ this.close(undefined, { focusOrigin: 'mouse' });
478
+ }
479
+ else {
480
+ // Clicking on the backdrop will move focus out of dialog.
481
+ // Recapture it if closing via the backdrop is disabled.
482
+ this.containerInstance._recaptureFocus?.();
483
+ }
484
+ });
485
+ this._detachSubscription = overlayRef.detachments().subscribe(() => {
486
+ // Check specifically for `false`, because we want `undefined` to be treated like `true`.
487
+ if (config.closeOnOverlayDetachments !== false) {
488
+ this.close();
489
+ }
490
+ });
491
+ }
492
+ /**
493
+ * Close the dialog.
494
+ * @param result Optional result to return to the dialog opener.
495
+ * @param options Additional options to customize the closing behavior.
496
+ */
497
+ close(result, options) {
498
+ if (this._canClose(result)) {
499
+ const closedSubject = this.closed;
500
+ this.containerInstance._closeInteractionType = options?.focusOrigin || 'program';
501
+ // Drop the detach subscription first since it can be triggered by the
502
+ // `dispose` call and override the result of this closing sequence.
503
+ this._detachSubscription.unsubscribe();
504
+ this.overlayRef.dispose();
505
+ closedSubject.next(result);
506
+ closedSubject.complete();
507
+ this.componentInstance = this.containerInstance = null;
508
+ }
509
+ }
510
+ /** Updates the position of the dialog based on the current position strategy. */
511
+ updatePosition() {
512
+ this.overlayRef.updatePosition();
513
+ return this;
514
+ }
515
+ /**
516
+ * Updates the dialog's width and height.
517
+ * @param width New width of the dialog.
518
+ * @param height New height of the dialog.
519
+ */
520
+ updateSize(width = '', height = '') {
521
+ this.overlayRef.updateSize({ width, height });
522
+ return this;
523
+ }
524
+ /** Add a CSS class or an array of classes to the overlay pane. */
525
+ addPanelClass(classes) {
526
+ this.overlayRef.addPanelClass(classes);
527
+ return this;
528
+ }
529
+ /** Remove a CSS class or an array of classes from the overlay pane. */
530
+ removePanelClass(classes) {
531
+ this.overlayRef.removePanelClass(classes);
532
+ return this;
533
+ }
534
+ /** Whether the dialog is allowed to close. */
535
+ _canClose(result) {
536
+ const config = this.config;
537
+ return (!!this.containerInstance &&
538
+ (!config.closePredicate || config.closePredicate(result, config, this.componentInstance)));
539
+ }
540
+ }
541
+
542
+ /** Injection token for the Dialog's ScrollStrategy. */
543
+ const DIALOG_SCROLL_STRATEGY = new InjectionToken('DialogScrollStrategy', {
544
+ providedIn: 'root',
545
+ factory: () => {
546
+ const injector = inject(Injector);
547
+ return () => createBlockScrollStrategy(injector);
548
+ },
549
+ });
550
+ /** Injection token for the Dialog's Data. */
551
+ const DIALOG_DATA = new InjectionToken('DialogData');
552
+ /** Injection token that can be used to provide default options for the dialog module. */
553
+ const DEFAULT_DIALOG_CONFIG = new InjectionToken('DefaultDialogConfig');
554
+
555
+ function getDirectionality(value) {
556
+ const valueSignal = signal(value, ...(ngDevMode ? [{ debugName: "valueSignal" }] : []));
557
+ const change = new EventEmitter();
558
+ return {
559
+ valueSignal,
560
+ get value() {
561
+ return valueSignal();
562
+ },
563
+ change,
564
+ ngOnDestroy() {
565
+ change.complete();
566
+ },
567
+ };
568
+ }
569
+ class Dialog {
570
+ _injector = inject(Injector);
571
+ _defaultOptions = inject(DEFAULT_DIALOG_CONFIG, { optional: true });
572
+ _parentDialog = inject(Dialog, { optional: true, skipSelf: true });
573
+ _overlayContainer = inject(OverlayContainer);
574
+ _idGenerator = inject(_IdGenerator);
575
+ _openDialogsAtThisLevel = [];
576
+ _afterAllClosedAtThisLevel = new Subject();
577
+ _afterOpenedAtThisLevel = new Subject();
578
+ _ariaHiddenElements = new Map();
579
+ _scrollStrategy = inject(DIALOG_SCROLL_STRATEGY);
580
+ /** Keeps track of the currently-open dialogs. */
581
+ get openDialogs() {
582
+ return this._parentDialog ? this._parentDialog.openDialogs : this._openDialogsAtThisLevel;
583
+ }
584
+ /** Stream that emits when a dialog has been opened. */
585
+ get afterOpened() {
586
+ return this._parentDialog ? this._parentDialog.afterOpened : this._afterOpenedAtThisLevel;
587
+ }
588
+ /**
589
+ * Stream that emits when all open dialog have finished closing.
590
+ * Will emit on subscribe if there are no open dialogs to begin with.
591
+ */
592
+ afterAllClosed = defer(() => this.openDialogs.length
593
+ ? this._getAfterAllClosed()
594
+ : this._getAfterAllClosed().pipe(startWith(undefined)));
595
+ constructor() { }
596
+ open(componentOrTemplateRef, config) {
597
+ const defaults = (this._defaultOptions || new DialogConfig());
598
+ config = { ...defaults, ...config };
599
+ config.id = config.id || this._idGenerator.getId('cdk-dialog-');
600
+ if (config.id &&
601
+ this.getDialogById(config.id) &&
602
+ (typeof ngDevMode === 'undefined' || ngDevMode)) {
603
+ throw Error(`Dialog with id "${config.id}" exists already. The dialog id must be unique.`);
604
+ }
605
+ const overlayConfig = this._getOverlayConfig(config);
606
+ const overlayRef = createOverlayRef(this._injector, overlayConfig);
607
+ const dialogRef = new DialogRef(overlayRef, config);
608
+ const dialogContainer = this._attachContainer(overlayRef, dialogRef, config);
609
+ dialogRef.containerInstance = dialogContainer;
610
+ // If this is the first dialog that we're opening, hide all the non-overlay content.
611
+ if (!this.openDialogs.length) {
612
+ // Resolve this ahead of time, because some internal apps
613
+ // mock it out and depend on it being synchronous.
614
+ const overlayContainer = this._overlayContainer.getContainerElement();
615
+ if (dialogContainer._focusTrapped) {
616
+ dialogContainer._focusTrapped.pipe(take(1)).subscribe(() => {
617
+ this._hideNonDialogContentFromAssistiveTechnology(overlayContainer);
618
+ });
619
+ }
620
+ else {
621
+ this._hideNonDialogContentFromAssistiveTechnology(overlayContainer);
622
+ }
623
+ }
624
+ this._attachDialogContent(componentOrTemplateRef, dialogRef, dialogContainer, config);
625
+ this.openDialogs.push(dialogRef);
626
+ dialogRef.closed.subscribe(() => this._removeOpenDialog(dialogRef, true));
627
+ this.afterOpened.next(dialogRef);
628
+ return dialogRef;
629
+ }
630
+ /**
631
+ * Closes all of the currently-open dialogs.
632
+ */
633
+ closeAll() {
634
+ reverseForEach(this.openDialogs, dialog => dialog.close());
635
+ }
636
+ /**
637
+ * Finds an open dialog by its id.
638
+ * @param id ID to use when looking up the dialog.
639
+ */
640
+ getDialogById(id) {
641
+ return this.openDialogs.find(dialog => dialog.id === id);
642
+ }
643
+ ngOnDestroy() {
644
+ // Make one pass over all the dialogs that need to be untracked, but should not be closed. We
645
+ // want to stop tracking the open dialog even if it hasn't been closed, because the tracking
646
+ // determines when `aria-hidden` is removed from elements outside the dialog.
647
+ reverseForEach(this._openDialogsAtThisLevel, dialog => {
648
+ // Check for `false` specifically since we want `undefined` to be interpreted as `true`.
649
+ if (dialog.config.closeOnDestroy === false) {
650
+ this._removeOpenDialog(dialog, false);
651
+ }
652
+ });
653
+ // Make a second pass and close the remaining dialogs. We do this second pass in order to
654
+ // correctly dispatch the `afterAllClosed` event in case we have a mixed array of dialogs
655
+ // that should be closed and dialogs that should not.
656
+ reverseForEach(this._openDialogsAtThisLevel, dialog => dialog.close());
657
+ this._afterAllClosedAtThisLevel.complete();
658
+ this._afterOpenedAtThisLevel.complete();
659
+ this._openDialogsAtThisLevel = [];
660
+ }
661
+ /**
662
+ * Creates an overlay config from a dialog config.
663
+ * @param config The dialog configuration.
664
+ * @returns The overlay configuration.
665
+ */
666
+ _getOverlayConfig(config) {
667
+ const state = new OverlayConfig({
668
+ positionStrategy: config.positionStrategy ||
669
+ createGlobalPositionStrategy().centerHorizontally().centerVertically(),
670
+ scrollStrategy: config.scrollStrategy || this._scrollStrategy(),
671
+ panelClass: config.panelClass,
672
+ hasBackdrop: config.hasBackdrop,
673
+ direction: config.direction,
674
+ minWidth: config.minWidth,
675
+ minHeight: config.minHeight,
676
+ maxWidth: config.maxWidth,
677
+ maxHeight: config.maxHeight,
678
+ width: config.width,
679
+ height: config.height,
680
+ disposeOnNavigation: config.closeOnNavigation,
681
+ disableAnimations: config.disableAnimations,
682
+ });
683
+ if (config.backdropClass) {
684
+ state.backdropClass = config.backdropClass;
685
+ }
686
+ return state;
687
+ }
688
+ /**
689
+ * Attaches a dialog container to a dialog's already-created overlay.
690
+ * @param overlay Reference to the dialog's underlying overlay.
691
+ * @param config The dialog configuration.
692
+ * @returns A promise resolving to a ComponentRef for the attached container.
693
+ */
694
+ _attachContainer(overlay, dialogRef, config) {
695
+ const userInjector = config.injector || config.viewContainerRef?.injector;
696
+ const providers = [
697
+ { provide: DialogConfig, useValue: config },
698
+ { provide: DialogRef, useValue: dialogRef },
699
+ { provide: OverlayRef, useValue: overlay },
700
+ ];
701
+ let containerType;
702
+ if (config.container) {
703
+ if (typeof config.container === 'function') {
704
+ containerType = config.container;
705
+ }
706
+ else {
707
+ containerType = config.container.type;
708
+ providers.push(...config.container.providers(config));
709
+ }
710
+ }
711
+ else {
712
+ containerType = CdkDialogContainer;
713
+ }
714
+ const containerPortal = new ComponentPortal(containerType, config.viewContainerRef, Injector.create({ parent: userInjector || this._injector, providers }));
715
+ const containerRef = overlay.attach(containerPortal);
716
+ return containerRef.instance;
717
+ }
718
+ /**
719
+ * Attaches the user-provided component to the already-created dialog container.
720
+ * @param componentOrTemplateRef The type of component being loaded into the dialog,
721
+ * or a TemplateRef to instantiate as the content.
722
+ * @param dialogRef Reference to the dialog being opened.
723
+ * @param dialogContainer Component that is going to wrap the dialog content.
724
+ * @param config Configuration used to open the dialog.
725
+ */
726
+ _attachDialogContent(componentOrTemplateRef, dialogRef, dialogContainer, config) {
727
+ if (componentOrTemplateRef instanceof TemplateRef) {
728
+ const injector = this._createInjector(config, dialogRef, dialogContainer, undefined);
729
+ let context = { $implicit: config.data, dialogRef };
730
+ if (config.templateContext) {
731
+ context = {
732
+ ...context,
733
+ ...(typeof config.templateContext === 'function'
734
+ ? config.templateContext()
735
+ : config.templateContext),
736
+ };
737
+ }
738
+ dialogContainer.attachTemplatePortal(new TemplatePortal(componentOrTemplateRef, null, context, injector));
739
+ }
740
+ else {
741
+ const injector = this._createInjector(config, dialogRef, dialogContainer, this._injector);
742
+ const contentRef = dialogContainer.attachComponentPortal(new ComponentPortal(componentOrTemplateRef, config.viewContainerRef, injector));
743
+ dialogRef.componentRef = contentRef;
744
+ dialogRef.componentInstance = contentRef.instance;
745
+ }
746
+ }
747
+ /**
748
+ * Creates a custom injector to be used inside the dialog. This allows a component loaded inside
749
+ * of a dialog to close itself and, optionally, to return a value.
750
+ * @param config Config object that is used to construct the dialog.
751
+ * @param dialogRef Reference to the dialog being opened.
752
+ * @param dialogContainer Component that is going to wrap the dialog content.
753
+ * @param fallbackInjector Injector to use as a fallback when a lookup fails in the custom
754
+ * dialog injector, if the user didn't provide a custom one.
755
+ * @returns The custom injector that can be used inside the dialog.
756
+ */
757
+ _createInjector(config, dialogRef, dialogContainer, fallbackInjector) {
758
+ const userInjector = config.injector || config.viewContainerRef?.injector;
759
+ const providers = [
760
+ { provide: DIALOG_DATA, useValue: config.data },
761
+ { provide: DialogRef, useValue: dialogRef },
762
+ ];
763
+ if (config.providers) {
764
+ if (typeof config.providers === 'function') {
765
+ providers.push(...config.providers(dialogRef, config, dialogContainer));
766
+ }
767
+ else {
768
+ providers.push(...config.providers);
769
+ }
770
+ }
771
+ if (config.direction &&
772
+ (!userInjector ||
773
+ !userInjector.get(Directionality, null, { optional: true }))) {
774
+ providers.push({
775
+ provide: Directionality,
776
+ useValue: getDirectionality(config.direction),
777
+ });
778
+ }
779
+ return Injector.create({ parent: userInjector || fallbackInjector, providers });
780
+ }
781
+ /**
782
+ * Removes a dialog from the array of open dialogs.
783
+ * @param dialogRef Dialog to be removed.
784
+ * @param emitEvent Whether to emit an event if this is the last dialog.
785
+ */
786
+ _removeOpenDialog(dialogRef, emitEvent) {
787
+ const index = this.openDialogs.indexOf(dialogRef);
788
+ if (index > -1) {
789
+ this.openDialogs.splice(index, 1);
790
+ // If all the dialogs were closed, remove/restore the `aria-hidden`
791
+ // to a the siblings and emit to the `afterAllClosed` stream.
792
+ if (!this.openDialogs.length) {
793
+ this._ariaHiddenElements.forEach((previousValue, element) => {
794
+ if (previousValue) {
795
+ element.setAttribute('aria-hidden', previousValue);
796
+ }
797
+ else {
798
+ element.removeAttribute('aria-hidden');
799
+ }
800
+ });
801
+ this._ariaHiddenElements.clear();
802
+ if (emitEvent) {
803
+ this._getAfterAllClosed().next();
804
+ }
805
+ }
806
+ }
807
+ }
808
+ /** Hides all of the content that isn't an overlay from assistive technology. */
809
+ _hideNonDialogContentFromAssistiveTechnology(overlayContainer) {
810
+ // Ensure that the overlay container is attached to the DOM.
811
+ if (overlayContainer.parentElement) {
812
+ const siblings = overlayContainer.parentElement.children;
813
+ for (let i = siblings.length - 1; i > -1; i--) {
814
+ const sibling = siblings[i];
815
+ if (sibling !== overlayContainer &&
816
+ sibling.nodeName !== 'SCRIPT' &&
817
+ sibling.nodeName !== 'STYLE' &&
818
+ !sibling.hasAttribute('aria-live')) {
819
+ this._ariaHiddenElements.set(sibling, sibling.getAttribute('aria-hidden'));
820
+ sibling.setAttribute('aria-hidden', 'true');
821
+ }
822
+ }
823
+ }
824
+ }
825
+ _getAfterAllClosed() {
826
+ const parent = this._parentDialog;
827
+ return parent ? parent._getAfterAllClosed() : this._afterAllClosedAtThisLevel;
828
+ }
829
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: Dialog, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
830
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: Dialog, providedIn: 'root' });
831
+ }
832
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: Dialog, decorators: [{
833
+ type: Injectable,
834
+ args: [{ providedIn: 'root' }]
835
+ }], ctorParameters: () => [] });
836
+ /**
837
+ * Executes a callback against all elements in an array while iterating in reverse.
838
+ * Useful if the array is being modified as it is being iterated.
839
+ */
840
+ function reverseForEach(items, callback) {
841
+ let i = items.length;
842
+ while (i--) {
843
+ callback(items[i]);
844
+ }
845
+ }
846
+
847
+ class DialogModule {
848
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: DialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
849
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.0-next.2", ngImport: i0, type: DialogModule, imports: [OverlayModule, PortalModule, A11yModule, CdkDialogContainer], exports: [
850
+ // Re-export the PortalModule so that people extending the `CdkDialogContainer`
851
+ // don't have to remember to import it or be faced with an unhelpful error.
852
+ PortalModule,
853
+ CdkDialogContainer] });
854
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: DialogModule, providers: [Dialog], imports: [OverlayModule, PortalModule, A11yModule,
855
+ // Re-export the PortalModule so that people extending the `CdkDialogContainer`
856
+ // don't have to remember to import it or be faced with an unhelpful error.
857
+ PortalModule] });
858
+ }
859
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: DialogModule, decorators: [{
860
+ type: NgModule,
861
+ args: [{
862
+ imports: [OverlayModule, PortalModule, A11yModule, CdkDialogContainer],
863
+ exports: [
864
+ // Re-export the PortalModule so that people extending the `CdkDialogContainer`
865
+ // don't have to remember to import it or be faced with an unhelpful error.
866
+ PortalModule,
867
+ CdkDialogContainer,
868
+ ],
869
+ providers: [Dialog],
870
+ }]
871
+ }] });
872
+
873
+ export { CdkDialogContainer, DEFAULT_DIALOG_CONFIG, DIALOG_DATA, DIALOG_SCROLL_STRATEGY, Dialog, DialogConfig, DialogModule, DialogRef, throwDialogContentAlreadyAttachedError, CdkPortalOutlet as ɵɵCdkPortalOutlet };
874
+ //# sourceMappingURL=dialog.mjs.map