@kato-lee/cdk 14.2.7

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 (374) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +8 -0
  3. package/_index.scss +8 -0
  4. package/a11y/_index.import.scss +2 -0
  5. package/a11y/_index.scss +102 -0
  6. package/a11y/index.d.ts +1212 -0
  7. package/a11y-prebuilt.css +1 -0
  8. package/accordion/index.d.ts +140 -0
  9. package/bidi/index.d.ts +80 -0
  10. package/clipboard/index.d.ts +115 -0
  11. package/coercion/index.d.ts +67 -0
  12. package/collections/index.d.ts +374 -0
  13. package/dialog/index.d.ts +469 -0
  14. package/drag-drop/index.d.ts +1614 -0
  15. package/esm2020/a11y/a11y-module.mjs +32 -0
  16. package/esm2020/a11y/a11y_public_index.mjs +5 -0
  17. package/esm2020/a11y/aria-describer/aria-describer.mjs +232 -0
  18. package/esm2020/a11y/aria-describer/aria-reference.mjs +44 -0
  19. package/esm2020/a11y/fake-event-detection.mjs +31 -0
  20. package/esm2020/a11y/focus-monitor/focus-monitor.mjs +451 -0
  21. package/esm2020/a11y/focus-trap/configurable-focus-trap-config.mjs +9 -0
  22. package/esm2020/a11y/focus-trap/configurable-focus-trap-factory.mjs +53 -0
  23. package/esm2020/a11y/focus-trap/configurable-focus-trap.mjs +51 -0
  24. package/esm2020/a11y/focus-trap/event-listener-inert-strategy.mjs +61 -0
  25. package/esm2020/a11y/focus-trap/focus-trap-inert-strategy.mjs +11 -0
  26. package/esm2020/a11y/focus-trap/focus-trap-manager.mjs +53 -0
  27. package/esm2020/a11y/focus-trap/focus-trap.mjs +402 -0
  28. package/esm2020/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +109 -0
  29. package/esm2020/a11y/index.mjs +9 -0
  30. package/esm2020/a11y/input-modality/input-modality-detector.mjs +176 -0
  31. package/esm2020/a11y/interactivity-checker/interactivity-checker.mjs +238 -0
  32. package/esm2020/a11y/key-manager/activedescendant-key-manager.mjs +20 -0
  33. package/esm2020/a11y/key-manager/focus-key-manager.mjs +29 -0
  34. package/esm2020/a11y/key-manager/list-key-manager.mjs +321 -0
  35. package/esm2020/a11y/live-announcer/live-announcer-tokens.mjs +19 -0
  36. package/esm2020/a11y/live-announcer/live-announcer.mjs +178 -0
  37. package/esm2020/a11y/public-api.mjs +26 -0
  38. package/esm2020/accordion/accordion-item.mjs +167 -0
  39. package/esm2020/accordion/accordion-module.mjs +24 -0
  40. package/esm2020/accordion/accordion.mjs +70 -0
  41. package/esm2020/accordion/accordion_public_index.mjs +5 -0
  42. package/esm2020/accordion/index.mjs +9 -0
  43. package/esm2020/accordion/public-api.mjs +11 -0
  44. package/esm2020/bidi/bidi-module.mjs +23 -0
  45. package/esm2020/bidi/bidi_public_index.mjs +5 -0
  46. package/esm2020/bidi/dir-document-token.mjs +33 -0
  47. package/esm2020/bidi/dir.mjs +69 -0
  48. package/esm2020/bidi/directionality.mjs +52 -0
  49. package/esm2020/bidi/index.mjs +9 -0
  50. package/esm2020/bidi/public-api.mjs +12 -0
  51. package/esm2020/clipboard/clipboard-module.mjs +23 -0
  52. package/esm2020/clipboard/clipboard.mjs +53 -0
  53. package/esm2020/clipboard/clipboard_public_index.mjs +5 -0
  54. package/esm2020/clipboard/copy-to-clipboard.mjs +99 -0
  55. package/esm2020/clipboard/index.mjs +9 -0
  56. package/esm2020/clipboard/pending-copy.mjs +69 -0
  57. package/esm2020/clipboard/public-api.mjs +12 -0
  58. package/esm2020/coercion/array.mjs +11 -0
  59. package/esm2020/coercion/boolean-property.mjs +12 -0
  60. package/esm2020/coercion/css-pixel-value.mjs +15 -0
  61. package/esm2020/coercion/element.mjs +16 -0
  62. package/esm2020/coercion/index.mjs +9 -0
  63. package/esm2020/coercion/number-property.mjs +21 -0
  64. package/esm2020/coercion/public-api.mjs +14 -0
  65. package/esm2020/coercion/string-array.mjs +38 -0
  66. package/esm2020/collections/array-data-source.mjs +21 -0
  67. package/esm2020/collections/collection-viewer.mjs +9 -0
  68. package/esm2020/collections/collections_public_index.mjs +5 -0
  69. package/esm2020/collections/data-source.mjs +19 -0
  70. package/esm2020/collections/dispose-view-repeater-strategy.mjs +47 -0
  71. package/esm2020/collections/index.mjs +9 -0
  72. package/esm2020/collections/public-api.mjs +17 -0
  73. package/esm2020/collections/recycle-view-repeater-strategy.mjs +128 -0
  74. package/esm2020/collections/selection-model.mjs +216 -0
  75. package/esm2020/collections/tree-adapter.mjs +9 -0
  76. package/esm2020/collections/unique-selection-dispatcher.mjs +55 -0
  77. package/esm2020/collections/view-repeater.mjs +14 -0
  78. package/esm2020/dialog/dialog-config.mjs +63 -0
  79. package/esm2020/dialog/dialog-container.mjs +278 -0
  80. package/esm2020/dialog/dialog-injectors.mjs +26 -0
  81. package/esm2020/dialog/dialog-module.mjs +42 -0
  82. package/esm2020/dialog/dialog-ref.mjs +76 -0
  83. package/esm2020/dialog/dialog.mjs +301 -0
  84. package/esm2020/dialog/dialog_public_index.mjs +5 -0
  85. package/esm2020/dialog/index.mjs +9 -0
  86. package/esm2020/dialog/public-api.mjs +14 -0
  87. package/esm2020/drag-drop/directives/assertions.mjs +18 -0
  88. package/esm2020/drag-drop/directives/config.mjs +14 -0
  89. package/esm2020/drag-drop/directives/drag-handle.mjs +66 -0
  90. package/esm2020/drag-drop/directives/drag-placeholder.mjs +36 -0
  91. package/esm2020/drag-drop/directives/drag-preview.mjs +47 -0
  92. package/esm2020/drag-drop/directives/drag.mjs +487 -0
  93. package/esm2020/drag-drop/directives/drop-list-group.mjs +53 -0
  94. package/esm2020/drag-drop/directives/drop-list.mjs +345 -0
  95. package/esm2020/drag-drop/dom/client-rect.mjs +64 -0
  96. package/esm2020/drag-drop/dom/clone-node.mjs +65 -0
  97. package/esm2020/drag-drop/dom/parent-position-tracker.mjs +76 -0
  98. package/esm2020/drag-drop/dom/styling.mjs +69 -0
  99. package/esm2020/drag-drop/dom/transition-duration.mjs +36 -0
  100. package/esm2020/drag-drop/drag-drop-module.mjs +57 -0
  101. package/esm2020/drag-drop/drag-drop-registry.mjs +231 -0
  102. package/esm2020/drag-drop/drag-drop.mjs +57 -0
  103. package/esm2020/drag-drop/drag-drop_public_index.mjs +5 -0
  104. package/esm2020/drag-drop/drag-events.mjs +9 -0
  105. package/esm2020/drag-drop/drag-parent.mjs +16 -0
  106. package/esm2020/drag-drop/drag-ref.mjs +1146 -0
  107. package/esm2020/drag-drop/drag-utils.mjs +60 -0
  108. package/esm2020/drag-drop/drop-list-ref.mjs +577 -0
  109. package/esm2020/drag-drop/index.mjs +9 -0
  110. package/esm2020/drag-drop/public-api.mjs +23 -0
  111. package/esm2020/drag-drop/sorting/drop-list-sort-strategy.mjs +9 -0
  112. package/esm2020/drag-drop/sorting/single-axis-sort-strategy.mjs +341 -0
  113. package/esm2020/index.mjs +9 -0
  114. package/esm2020/keycodes/index.mjs +9 -0
  115. package/esm2020/keycodes/keycodes.mjs +127 -0
  116. package/esm2020/keycodes/keycodes_public_index.mjs +5 -0
  117. package/esm2020/keycodes/modifiers.mjs +18 -0
  118. package/esm2020/keycodes/public-api.mjs +10 -0
  119. package/esm2020/layout/breakpoints-observer.mjs +105 -0
  120. package/esm2020/layout/breakpoints.mjs +29 -0
  121. package/esm2020/layout/index.mjs +9 -0
  122. package/esm2020/layout/layout-module.mjs +19 -0
  123. package/esm2020/layout/layout_public_index.mjs +5 -0
  124. package/esm2020/layout/media-matcher.mjs +85 -0
  125. package/esm2020/layout/public-api.mjs +12 -0
  126. package/esm2020/listbox/index.mjs +9 -0
  127. package/esm2020/listbox/listbox-module.mjs +24 -0
  128. package/esm2020/listbox/listbox.mjs +872 -0
  129. package/esm2020/listbox/listbox_public_index.mjs +5 -0
  130. package/esm2020/listbox/public-api.mjs +10 -0
  131. package/esm2020/menu/context-menu-trigger.mjs +212 -0
  132. package/esm2020/menu/index.mjs +9 -0
  133. package/esm2020/menu/menu-aim.mjs +203 -0
  134. package/esm2020/menu/menu-bar.mjs +133 -0
  135. package/esm2020/menu/menu-base.mjs +187 -0
  136. package/esm2020/menu/menu-errors.mjs +22 -0
  137. package/esm2020/menu/menu-group.mjs +30 -0
  138. package/esm2020/menu/menu-interface.mjs +11 -0
  139. package/esm2020/menu/menu-item-checkbox.mjs +49 -0
  140. package/esm2020/menu/menu-item-radio.mjs +71 -0
  141. package/esm2020/menu/menu-item-selectable.mjs +42 -0
  142. package/esm2020/menu/menu-item.mjs +267 -0
  143. package/esm2020/menu/menu-module.mjs +62 -0
  144. package/esm2020/menu/menu-stack.mjs +156 -0
  145. package/esm2020/menu/menu-trigger-base.mjs +107 -0
  146. package/esm2020/menu/menu-trigger.mjs +291 -0
  147. package/esm2020/menu/menu.mjs +134 -0
  148. package/esm2020/menu/menu_public_index.mjs +5 -0
  149. package/esm2020/menu/pointer-focus-tracker.mjs +51 -0
  150. package/esm2020/menu/public-api.mjs +24 -0
  151. package/esm2020/observers/index.mjs +9 -0
  152. package/esm2020/observers/observe-content.mjs +187 -0
  153. package/esm2020/observers/observers_public_index.mjs +5 -0
  154. package/esm2020/observers/public-api.mjs +9 -0
  155. package/esm2020/overlay/dispatchers/base-overlay-dispatcher.mjs +52 -0
  156. package/esm2020/overlay/dispatchers/index.mjs +10 -0
  157. package/esm2020/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +81 -0
  158. package/esm2020/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +138 -0
  159. package/esm2020/overlay/fullscreen-overlay-container.mjs +94 -0
  160. package/esm2020/overlay/index.mjs +9 -0
  161. package/esm2020/overlay/overlay-config.mjs +45 -0
  162. package/esm2020/overlay/overlay-container.mjs +81 -0
  163. package/esm2020/overlay/overlay-directives.mjs +427 -0
  164. package/esm2020/overlay/overlay-module.mjs +29 -0
  165. package/esm2020/overlay/overlay-ref.mjs +427 -0
  166. package/esm2020/overlay/overlay-reference.mjs +9 -0
  167. package/esm2020/overlay/overlay.mjs +125 -0
  168. package/esm2020/overlay/overlay_public_index.mjs +5 -0
  169. package/esm2020/overlay/position/connected-position.mjs +88 -0
  170. package/esm2020/overlay/position/flexible-connected-position-strategy.mjs +985 -0
  171. package/esm2020/overlay/position/global-position-strategy.mjs +237 -0
  172. package/esm2020/overlay/position/overlay-position-builder.mjs +50 -0
  173. package/esm2020/overlay/position/position-strategy.mjs +9 -0
  174. package/esm2020/overlay/position/scroll-clip.mjs +40 -0
  175. package/esm2020/overlay/public-api.mjs +22 -0
  176. package/esm2020/overlay/scroll/block-scroll-strategy.mjs +80 -0
  177. package/esm2020/overlay/scroll/close-scroll-strategy.mjs +61 -0
  178. package/esm2020/overlay/scroll/index.mjs +14 -0
  179. package/esm2020/overlay/scroll/noop-scroll-strategy.mjs +17 -0
  180. package/esm2020/overlay/scroll/reposition-scroll-strategy.mjs +61 -0
  181. package/esm2020/overlay/scroll/scroll-strategy-options.mjs +55 -0
  182. package/esm2020/overlay/scroll/scroll-strategy.mjs +14 -0
  183. package/esm2020/platform/features/input-types.mjs +59 -0
  184. package/esm2020/platform/features/passive-listeners.mjs +36 -0
  185. package/esm2020/platform/features/scrolling.mjs +85 -0
  186. package/esm2020/platform/features/shadow-dom.mjs +54 -0
  187. package/esm2020/platform/features/test-environment.mjs +24 -0
  188. package/esm2020/platform/index.mjs +9 -0
  189. package/esm2020/platform/platform-module.mjs +19 -0
  190. package/esm2020/platform/platform.mjs +85 -0
  191. package/esm2020/platform/platform_public_index.mjs +5 -0
  192. package/esm2020/platform/public-api.mjs +15 -0
  193. package/esm2020/portal/dom-portal-outlet.mjs +158 -0
  194. package/esm2020/portal/index.mjs +9 -0
  195. package/esm2020/portal/portal-directives.mjs +246 -0
  196. package/esm2020/portal/portal-errors.mjs +51 -0
  197. package/esm2020/portal/portal-injector.mjs +28 -0
  198. package/esm2020/portal/portal.mjs +188 -0
  199. package/esm2020/portal/portal_public_index.mjs +5 -0
  200. package/esm2020/portal/public-api.mjs +12 -0
  201. package/esm2020/public-api.mjs +9 -0
  202. package/esm2020/scrolling/fixed-size-virtual-scroll.mjs +217 -0
  203. package/esm2020/scrolling/index.mjs +9 -0
  204. package/esm2020/scrolling/public-api.mjs +20 -0
  205. package/esm2020/scrolling/scroll-dispatcher.mjs +163 -0
  206. package/esm2020/scrolling/scrollable.mjs +176 -0
  207. package/esm2020/scrolling/scrolling-module.mjs +67 -0
  208. package/esm2020/scrolling/scrolling_public_index.mjs +5 -0
  209. package/esm2020/scrolling/viewport-ruler.mjs +146 -0
  210. package/esm2020/scrolling/virtual-for-of.mjs +298 -0
  211. package/esm2020/scrolling/virtual-scroll-repeater.mjs +9 -0
  212. package/esm2020/scrolling/virtual-scroll-strategy.mjs +11 -0
  213. package/esm2020/scrolling/virtual-scroll-viewport.mjs +437 -0
  214. package/esm2020/scrolling/virtual-scrollable-element.mjs +41 -0
  215. package/esm2020/scrolling/virtual-scrollable-window.mjs +40 -0
  216. package/esm2020/scrolling/virtual-scrollable.mjs +40 -0
  217. package/esm2020/stepper/index.mjs +9 -0
  218. package/esm2020/stepper/public-api.mjs +13 -0
  219. package/esm2020/stepper/step-header.mjs +30 -0
  220. package/esm2020/stepper/step-label.mjs +23 -0
  221. package/esm2020/stepper/stepper-button.mjs +56 -0
  222. package/esm2020/stepper/stepper-module.mjs +40 -0
  223. package/esm2020/stepper/stepper.mjs +458 -0
  224. package/esm2020/stepper/stepper_public_index.mjs +5 -0
  225. package/esm2020/table/can-stick.mjs +44 -0
  226. package/esm2020/table/cell.mjs +217 -0
  227. package/esm2020/table/coalesced-style-scheduler.mjs +91 -0
  228. package/esm2020/table/index.mjs +9 -0
  229. package/esm2020/table/public-api.mjs +20 -0
  230. package/esm2020/table/row.mjs +262 -0
  231. package/esm2020/table/sticky-position-listener.mjs +11 -0
  232. package/esm2020/table/sticky-styler.mjs +345 -0
  233. package/esm2020/table/table-errors.mjs +67 -0
  234. package/esm2020/table/table-module.mjs +94 -0
  235. package/esm2020/table/table.mjs +1065 -0
  236. package/esm2020/table/table_public_index.mjs +5 -0
  237. package/esm2020/table/text-column.mjs +153 -0
  238. package/esm2020/table/tokens.mjs +16 -0
  239. package/esm2020/text-field/autofill.mjs +113 -0
  240. package/esm2020/text-field/autosize.mjs +309 -0
  241. package/esm2020/text-field/index.mjs +9 -0
  242. package/esm2020/text-field/public-api.mjs +11 -0
  243. package/esm2020/text-field/text-field-module.mjs +24 -0
  244. package/esm2020/text-field/text-field_public_index.mjs +5 -0
  245. package/esm2020/tree/control/base-tree-control.mjs +57 -0
  246. package/esm2020/tree/control/flat-tree-control.mjs +51 -0
  247. package/esm2020/tree/control/nested-tree-control.mjs +58 -0
  248. package/esm2020/tree/control/tree-control.mjs +2 -0
  249. package/esm2020/tree/index.mjs +9 -0
  250. package/esm2020/tree/nested-node.mjs +112 -0
  251. package/esm2020/tree/node.mjs +35 -0
  252. package/esm2020/tree/outlet.mjs +39 -0
  253. package/esm2020/tree/padding.mjs +131 -0
  254. package/esm2020/tree/public-api.mjs +20 -0
  255. package/esm2020/tree/toggle.mjs +50 -0
  256. package/esm2020/tree/tree-errors.mjs +43 -0
  257. package/esm2020/tree/tree-module.mjs +49 -0
  258. package/esm2020/tree/tree.mjs +347 -0
  259. package/esm2020/tree/tree_public_index.mjs +5 -0
  260. package/esm2020/version.mjs +11 -0
  261. package/fesm2015/a11y.mjs +2473 -0
  262. package/fesm2015/a11y.mjs.map +1 -0
  263. package/fesm2015/accordion.mjs +414 -0
  264. package/fesm2015/accordion.mjs.map +1 -0
  265. package/fesm2015/bidi.mjs +194 -0
  266. package/fesm2015/bidi.mjs.map +1 -0
  267. package/fesm2015/cdk.mjs +30 -0
  268. package/fesm2015/cdk.mjs.map +1 -0
  269. package/fesm2015/clipboard.mjs +263 -0
  270. package/fesm2015/clipboard.mjs.map +1 -0
  271. package/fesm2015/coercion.mjs +132 -0
  272. package/fesm2015/coercion.mjs.map +1 -0
  273. package/fesm2015/collections.mjs +519 -0
  274. package/fesm2015/collections.mjs.map +1 -0
  275. package/fesm2015/dialog.mjs +1050 -0
  276. package/fesm2015/dialog.mjs.map +1 -0
  277. package/fesm2015/drag-drop.mjs +3812 -0
  278. package/fesm2015/drag-drop.mjs.map +1 -0
  279. package/fesm2015/keycodes.mjs +167 -0
  280. package/fesm2015/keycodes.mjs.map +1 -0
  281. package/fesm2015/layout.mjs +337 -0
  282. package/fesm2015/layout.mjs.map +1 -0
  283. package/fesm2015/listbox.mjs +1200 -0
  284. package/fesm2015/listbox.mjs.map +1 -0
  285. package/fesm2015/menu.mjs +2719 -0
  286. package/fesm2015/menu.mjs.map +1 -0
  287. package/fesm2015/observers.mjs +326 -0
  288. package/fesm2015/observers.mjs.map +1 -0
  289. package/fesm2015/overlay.mjs +3137 -0
  290. package/fesm2015/overlay.mjs.map +1 -0
  291. package/fesm2015/platform.mjs +385 -0
  292. package/fesm2015/platform.mjs.map +1 -0
  293. package/fesm2015/portal.mjs +691 -0
  294. package/fesm2015/portal.mjs.map +1 -0
  295. package/fesm2015/scrolling.mjs +1558 -0
  296. package/fesm2015/scrolling.mjs.map +1 -0
  297. package/fesm2015/stepper.mjs +989 -0
  298. package/fesm2015/stepper.mjs.map +1 -0
  299. package/fesm2015/table.mjs +2356 -0
  300. package/fesm2015/table.mjs.map +1 -0
  301. package/fesm2015/testing.mjs +833 -0
  302. package/fesm2015/testing.mjs.map +1 -0
  303. package/fesm2015/text-field.mjs +461 -0
  304. package/fesm2015/text-field.mjs.map +1 -0
  305. package/fesm2015/tree.mjs +1303 -0
  306. package/fesm2015/tree.mjs.map +1 -0
  307. package/fesm2020/a11y.mjs +2476 -0
  308. package/fesm2020/a11y.mjs.map +1 -0
  309. package/fesm2020/accordion.mjs +414 -0
  310. package/fesm2020/accordion.mjs.map +1 -0
  311. package/fesm2020/bidi.mjs +192 -0
  312. package/fesm2020/bidi.mjs.map +1 -0
  313. package/fesm2020/cdk.mjs +30 -0
  314. package/fesm2020/cdk.mjs.map +1 -0
  315. package/fesm2020/clipboard.mjs +259 -0
  316. package/fesm2020/clipboard.mjs.map +1 -0
  317. package/fesm2020/coercion.mjs +132 -0
  318. package/fesm2020/coercion.mjs.map +1 -0
  319. package/fesm2020/collections.mjs +535 -0
  320. package/fesm2020/collections.mjs.map +1 -0
  321. package/fesm2020/dialog.mjs +787 -0
  322. package/fesm2020/dialog.mjs.map +1 -0
  323. package/fesm2020/drag-drop.mjs +3808 -0
  324. package/fesm2020/drag-drop.mjs.map +1 -0
  325. package/fesm2020/keycodes.mjs +167 -0
  326. package/fesm2020/keycodes.mjs.map +1 -0
  327. package/fesm2020/layout.mjs +337 -0
  328. package/fesm2020/layout.mjs.map +1 -0
  329. package/fesm2020/listbox.mjs +1164 -0
  330. package/fesm2020/listbox.mjs.map +1 -0
  331. package/fesm2020/menu.mjs +2615 -0
  332. package/fesm2020/menu.mjs.map +1 -0
  333. package/fesm2020/observers.mjs +325 -0
  334. package/fesm2020/observers.mjs.map +1 -0
  335. package/fesm2020/overlay.mjs +3145 -0
  336. package/fesm2020/overlay.mjs.map +1 -0
  337. package/fesm2020/platform.mjs +383 -0
  338. package/fesm2020/platform.mjs.map +1 -0
  339. package/fesm2020/portal.mjs +689 -0
  340. package/fesm2020/portal.mjs.map +1 -0
  341. package/fesm2020/scrolling.mjs +1591 -0
  342. package/fesm2020/scrolling.mjs.map +1 -0
  343. package/fesm2020/stepper.mjs +985 -0
  344. package/fesm2020/stepper.mjs.map +1 -0
  345. package/fesm2020/table.mjs +2348 -0
  346. package/fesm2020/table.mjs.map +1 -0
  347. package/fesm2020/testing.mjs +797 -0
  348. package/fesm2020/testing.mjs.map +1 -0
  349. package/fesm2020/text-field.mjs +459 -0
  350. package/fesm2020/text-field.mjs.map +1 -0
  351. package/fesm2020/tree.mjs +1305 -0
  352. package/fesm2020/tree.mjs.map +1 -0
  353. package/index.d.ts +6 -0
  354. package/keycodes/index.d.ts +249 -0
  355. package/layout/index.d.ts +90 -0
  356. package/listbox/index.d.ts +419 -0
  357. package/menu/index.d.ts +1013 -0
  358. package/observers/index.d.ts +109 -0
  359. package/overlay/_index-deprecated.scss +13 -0
  360. package/overlay/_index.import.scss +13 -0
  361. package/overlay/_index.scss +152 -0
  362. package/overlay/index.d.ts +1343 -0
  363. package/overlay-prebuilt.css +1 -0
  364. package/package.json +232 -0
  365. package/platform/index.d.ts +106 -0
  366. package/portal/index.d.ts +328 -0
  367. package/scrolling/index.d.ts +849 -0
  368. package/stepper/index.d.ts +419 -0
  369. package/table/index.d.ts +1483 -0
  370. package/text-field/_index.import.scss +2 -0
  371. package/text-field/_index.scss +89 -0
  372. package/text-field/index.d.ts +203 -0
  373. package/text-field-prebuilt.css +1 -0
  374. package/tree/index.d.ts +593 -0
@@ -0,0 +1,787 @@
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