@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,689 +1,614 @@
1
- import * as i0 from '@angular/core';
2
- import { ElementRef, Injector, Directive, EventEmitter, Inject, Output, NgModule } from '@angular/core';
3
- import { DOCUMENT } from '@angular/common';
4
-
5
- /**
6
- * @license
7
- * Copyright Google LLC All Rights Reserved.
8
- *
9
- * Use of this source code is governed by an MIT-style license that can be
10
- * found in the LICENSE file at https://angular.io/license
11
- */
12
- /**
13
- * Throws an exception when attempting to attach a null portal to a host.
14
- * @docs-private
15
- */
16
- function throwNullPortalError() {
17
- throw Error('Must provide a portal to attach');
18
- }
19
- /**
20
- * Throws an exception when attempting to attach a portal to a host that is already attached.
21
- * @docs-private
22
- */
23
- function throwPortalAlreadyAttachedError() {
24
- throw Error('Host already has a portal attached');
25
- }
26
- /**
27
- * Throws an exception when attempting to attach a portal to an already-disposed host.
28
- * @docs-private
29
- */
30
- function throwPortalOutletAlreadyDisposedError() {
31
- throw Error('This PortalOutlet has already been disposed');
32
- }
33
- /**
34
- * Throws an exception when attempting to attach an unknown portal type.
35
- * @docs-private
36
- */
37
- function throwUnknownPortalTypeError() {
38
- throw Error('Attempting to attach an unknown Portal type. BasePortalOutlet accepts either ' +
39
- 'a ComponentPortal or a TemplatePortal.');
40
- }
41
- /**
42
- * Throws an exception when attempting to attach a portal to a null host.
43
- * @docs-private
44
- */
45
- function throwNullPortalOutletError() {
46
- throw Error('Attempting to attach a portal to a null PortalOutlet');
47
- }
48
- /**
49
- * Throws an exception when attempting to detach a portal that is not attached.
50
- * @docs-private
51
- */
52
- function throwNoPortalAttachedError() {
53
- throw Error('Attempting to detach a portal that is not attached to a host');
54
- }
55
-
56
- /**
57
- * @license
58
- * Copyright Google LLC All Rights Reserved.
59
- *
60
- * Use of this source code is governed by an MIT-style license that can be
61
- * found in the LICENSE file at https://angular.io/license
62
- */
63
- /**
64
- * A `Portal` is something that you want to render somewhere else.
65
- * It can be attach to / detached from a `PortalOutlet`.
66
- */
67
- class Portal {
68
- /** Attach this portal to a host. */
69
- attach(host) {
70
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
71
- if (host == null) {
72
- throwNullPortalOutletError();
73
- }
74
- if (host.hasAttached()) {
75
- throwPortalAlreadyAttachedError();
76
- }
77
- }
78
- this._attachedHost = host;
79
- return host.attach(this);
80
- }
81
- /** Detach this portal from its host */
82
- detach() {
83
- let host = this._attachedHost;
84
- if (host != null) {
85
- this._attachedHost = null;
86
- host.detach();
87
- }
88
- else if (typeof ngDevMode === 'undefined' || ngDevMode) {
89
- throwNoPortalAttachedError();
90
- }
91
- }
92
- /** Whether this portal is attached to a host. */
93
- get isAttached() {
94
- return this._attachedHost != null;
95
- }
96
- /**
97
- * Sets the PortalOutlet reference without performing `attach()`. This is used directly by
98
- * the PortalOutlet when it is performing an `attach()` or `detach()`.
99
- */
100
- setAttachedHost(host) {
101
- this._attachedHost = host;
102
- }
103
- }
104
- /**
105
- * A `ComponentPortal` is a portal that instantiates some Component upon attachment.
106
- */
107
- class ComponentPortal extends Portal {
108
- constructor(component, viewContainerRef, injector, componentFactoryResolver) {
109
- super();
110
- this.component = component;
111
- this.viewContainerRef = viewContainerRef;
112
- this.injector = injector;
113
- this.componentFactoryResolver = componentFactoryResolver;
114
- }
115
- }
116
- /**
117
- * A `TemplatePortal` is a portal that represents some embedded template (TemplateRef).
118
- */
119
- class TemplatePortal extends Portal {
120
- constructor(
121
- /** The embedded template that will be used to instantiate an embedded View in the host. */
122
- templateRef,
123
- /** Reference to the ViewContainer into which the template will be stamped out. */
124
- viewContainerRef,
125
- /** Contextual data to be passed in to the embedded view. */
126
- context,
127
- /** The injector to use for the embedded view. */
128
- injector) {
129
- super();
130
- this.templateRef = templateRef;
131
- this.viewContainerRef = viewContainerRef;
132
- this.context = context;
133
- this.injector = injector;
134
- }
135
- get origin() {
136
- return this.templateRef.elementRef;
137
- }
138
- /**
139
- * Attach the portal to the provided `PortalOutlet`.
140
- * When a context is provided it will override the `context` property of the `TemplatePortal`
141
- * instance.
142
- */
143
- attach(host, context = this.context) {
144
- this.context = context;
145
- return super.attach(host);
146
- }
147
- detach() {
148
- this.context = undefined;
149
- return super.detach();
150
- }
151
- }
152
- /**
153
- * A `DomPortal` is a portal whose DOM element will be taken from its current position
154
- * in the DOM and moved into a portal outlet, when it is attached. On detach, the content
155
- * will be restored to its original position.
156
- */
157
- class DomPortal extends Portal {
158
- constructor(element) {
159
- super();
160
- this.element = element instanceof ElementRef ? element.nativeElement : element;
161
- }
162
- }
163
- /**
164
- * Partial implementation of PortalOutlet that handles attaching
165
- * ComponentPortal and TemplatePortal.
166
- */
167
- class BasePortalOutlet {
168
- constructor() {
169
- /** Whether this host has already been permanently disposed. */
170
- this._isDisposed = false;
171
- // @breaking-change 10.0.0 `attachDomPortal` to become a required abstract method.
172
- this.attachDomPortal = null;
173
- }
174
- /** Whether this host has an attached portal. */
175
- hasAttached() {
176
- return !!this._attachedPortal;
177
- }
178
- /** Attaches a portal. */
179
- attach(portal) {
180
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
181
- if (!portal) {
182
- throwNullPortalError();
183
- }
184
- if (this.hasAttached()) {
185
- throwPortalAlreadyAttachedError();
186
- }
187
- if (this._isDisposed) {
188
- throwPortalOutletAlreadyDisposedError();
189
- }
190
- }
191
- if (portal instanceof ComponentPortal) {
192
- this._attachedPortal = portal;
193
- return this.attachComponentPortal(portal);
194
- }
195
- else if (portal instanceof TemplatePortal) {
196
- this._attachedPortal = portal;
197
- return this.attachTemplatePortal(portal);
198
- // @breaking-change 10.0.0 remove null check for `this.attachDomPortal`.
199
- }
200
- else if (this.attachDomPortal && portal instanceof DomPortal) {
201
- this._attachedPortal = portal;
202
- return this.attachDomPortal(portal);
203
- }
204
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
205
- throwUnknownPortalTypeError();
206
- }
207
- }
208
- /** Detaches a previously attached portal. */
209
- detach() {
210
- if (this._attachedPortal) {
211
- this._attachedPortal.setAttachedHost(null);
212
- this._attachedPortal = null;
213
- }
214
- this._invokeDisposeFn();
215
- }
216
- /** Permanently dispose of this portal host. */
217
- dispose() {
218
- if (this.hasAttached()) {
219
- this.detach();
220
- }
221
- this._invokeDisposeFn();
222
- this._isDisposed = true;
223
- }
224
- /** @docs-private */
225
- setDisposeFn(fn) {
226
- this._disposeFn = fn;
227
- }
228
- _invokeDisposeFn() {
229
- if (this._disposeFn) {
230
- this._disposeFn();
231
- this._disposeFn = null;
232
- }
233
- }
234
- }
235
- /**
236
- * @deprecated Use `BasePortalOutlet` instead.
237
- * @breaking-change 9.0.0
238
- */
239
- class BasePortalHost extends BasePortalOutlet {
240
- }
241
-
242
- /**
243
- * @license
244
- * Copyright Google LLC All Rights Reserved.
245
- *
246
- * Use of this source code is governed by an MIT-style license that can be
247
- * found in the LICENSE file at https://angular.io/license
248
- */
249
- /**
250
- * A PortalOutlet for attaching portals to an arbitrary DOM element outside of the Angular
251
- * application context.
252
- */
253
- class DomPortalOutlet extends BasePortalOutlet {
254
- /**
255
- * @param outletElement Element into which the content is projected.
256
- * @param _componentFactoryResolver Used to resolve the component factory.
257
- * Only required when attaching component portals.
258
- * @param _appRef Reference to the application. Only used in component portals when there
259
- * is no `ViewContainerRef` available.
260
- * @param _defaultInjector Injector to use as a fallback when the portal being attached doesn't
261
- * have one. Only used for component portals.
262
- * @param _document Reference to the document. Used when attaching a DOM portal. Will eventually
263
- * become a required parameter.
264
- */
265
- constructor(
266
- /** Element into which the content is projected. */
267
- outletElement, _componentFactoryResolver, _appRef, _defaultInjector,
268
- /**
269
- * @deprecated `_document` Parameter to be made required.
270
- * @breaking-change 10.0.0
271
- */
272
- _document) {
273
- super();
274
- this.outletElement = outletElement;
275
- this._componentFactoryResolver = _componentFactoryResolver;
276
- this._appRef = _appRef;
277
- this._defaultInjector = _defaultInjector;
278
- /**
279
- * Attaches a DOM portal by transferring its content into the outlet.
280
- * @param portal Portal to be attached.
281
- * @deprecated To be turned into a method.
282
- * @breaking-change 10.0.0
283
- */
284
- this.attachDomPortal = (portal) => {
285
- // @breaking-change 10.0.0 Remove check and error once the
286
- // `_document` constructor parameter is required.
287
- if (!this._document && (typeof ngDevMode === 'undefined' || ngDevMode)) {
288
- throw Error('Cannot attach DOM portal without _document constructor parameter');
289
- }
290
- const element = portal.element;
291
- if (!element.parentNode && (typeof ngDevMode === 'undefined' || ngDevMode)) {
292
- throw Error('DOM portal content must be attached to a parent node.');
293
- }
294
- // Anchor used to save the element's previous position so
295
- // that we can restore it when the portal is detached.
296
- const anchorNode = this._document.createComment('dom-portal');
297
- element.parentNode.insertBefore(anchorNode, element);
298
- this.outletElement.appendChild(element);
299
- this._attachedPortal = portal;
300
- super.setDisposeFn(() => {
301
- // We can't use `replaceWith` here because IE doesn't support it.
302
- if (anchorNode.parentNode) {
303
- anchorNode.parentNode.replaceChild(element, anchorNode);
304
- }
305
- });
306
- };
307
- this._document = _document;
308
- }
309
- /**
310
- * Attach the given ComponentPortal to DOM element using the ComponentFactoryResolver.
311
- * @param portal Portal to be attached
312
- * @returns Reference to the created component.
313
- */
314
- attachComponentPortal(portal) {
315
- const resolver = (portal.componentFactoryResolver || this._componentFactoryResolver);
316
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && !resolver) {
317
- throw Error('Cannot attach component portal to outlet without a ComponentFactoryResolver.');
318
- }
319
- const componentFactory = resolver.resolveComponentFactory(portal.component);
320
- let componentRef;
321
- // If the portal specifies a ViewContainerRef, we will use that as the attachment point
322
- // for the component (in terms of Angular's component tree, not rendering).
323
- // When the ViewContainerRef is missing, we use the factory to create the component directly
324
- // and then manually attach the view to the application.
325
- if (portal.viewContainerRef) {
326
- componentRef = portal.viewContainerRef.createComponent(componentFactory, portal.viewContainerRef.length, portal.injector || portal.viewContainerRef.injector);
327
- this.setDisposeFn(() => componentRef.destroy());
328
- }
329
- else {
330
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && !this._appRef) {
331
- throw Error('Cannot attach component portal to outlet without an ApplicationRef.');
332
- }
333
- componentRef = componentFactory.create(portal.injector || this._defaultInjector || Injector.NULL);
334
- this._appRef.attachView(componentRef.hostView);
335
- this.setDisposeFn(() => {
336
- // Verify that the ApplicationRef has registered views before trying to detach a host view.
337
- // This check also protects the `detachView` from being called on a destroyed ApplicationRef.
338
- if (this._appRef.viewCount > 0) {
339
- this._appRef.detachView(componentRef.hostView);
340
- }
341
- componentRef.destroy();
342
- });
343
- }
344
- // At this point the component has been instantiated, so we move it to the location in the DOM
345
- // where we want it to be rendered.
346
- this.outletElement.appendChild(this._getComponentRootNode(componentRef));
347
- this._attachedPortal = portal;
348
- return componentRef;
349
- }
350
- /**
351
- * Attaches a template portal to the DOM as an embedded view.
352
- * @param portal Portal to be attached.
353
- * @returns Reference to the created embedded view.
354
- */
355
- attachTemplatePortal(portal) {
356
- let viewContainer = portal.viewContainerRef;
357
- let viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context, {
358
- injector: portal.injector,
359
- });
360
- // The method `createEmbeddedView` will add the view as a child of the viewContainer.
361
- // But for the DomPortalOutlet the view can be added everywhere in the DOM
362
- // (e.g Overlay Container) To move the view to the specified host element. We just
363
- // re-append the existing root nodes.
364
- viewRef.rootNodes.forEach(rootNode => this.outletElement.appendChild(rootNode));
365
- // Note that we want to detect changes after the nodes have been moved so that
366
- // any directives inside the portal that are looking at the DOM inside a lifecycle
367
- // hook won't be invoked too early.
368
- viewRef.detectChanges();
369
- this.setDisposeFn(() => {
370
- let index = viewContainer.indexOf(viewRef);
371
- if (index !== -1) {
372
- viewContainer.remove(index);
373
- }
374
- });
375
- this._attachedPortal = portal;
376
- // TODO(jelbourn): Return locals from view.
377
- return viewRef;
378
- }
379
- /**
380
- * Clears out a portal from the DOM.
381
- */
382
- dispose() {
383
- super.dispose();
384
- this.outletElement.remove();
385
- }
386
- /** Gets the root HTMLElement for an instantiated component. */
387
- _getComponentRootNode(componentRef) {
388
- return componentRef.hostView.rootNodes[0];
389
- }
390
- }
391
- /**
392
- * @deprecated Use `DomPortalOutlet` instead.
393
- * @breaking-change 9.0.0
394
- */
395
- class DomPortalHost extends DomPortalOutlet {
396
- }
397
-
398
- /**
399
- * @license
400
- * Copyright Google LLC All Rights Reserved.
401
- *
402
- * Use of this source code is governed by an MIT-style license that can be
403
- * found in the LICENSE file at https://angular.io/license
404
- */
405
- /**
406
- * Directive version of a `TemplatePortal`. Because the directive *is* a TemplatePortal,
407
- * the directive instance itself can be attached to a host, enabling declarative use of portals.
408
- */
409
- class CdkPortal extends TemplatePortal {
410
- constructor(templateRef, viewContainerRef) {
411
- super(templateRef, viewContainerRef);
412
- }
413
- }
414
- CdkPortal.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: CdkPortal, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
415
- CdkPortal.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: CdkPortal, selector: "[cdkPortal]", exportAs: ["cdkPortal"], usesInheritance: true, ngImport: i0 });
416
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: CdkPortal, decorators: [{
417
- type: Directive,
418
- args: [{
419
- selector: '[cdkPortal]',
420
- exportAs: 'cdkPortal',
421
- }]
422
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; } });
423
- /**
424
- * @deprecated Use `CdkPortal` instead.
425
- * @breaking-change 9.0.0
426
- */
427
- class TemplatePortalDirective extends CdkPortal {
428
- }
429
- TemplatePortalDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TemplatePortalDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
430
- TemplatePortalDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: TemplatePortalDirective, selector: "[cdk-portal], [portal]", providers: [
431
- {
432
- provide: CdkPortal,
433
- useExisting: TemplatePortalDirective,
434
- },
435
- ], exportAs: ["cdkPortal"], usesInheritance: true, ngImport: i0 });
436
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TemplatePortalDirective, decorators: [{
437
- type: Directive,
438
- args: [{
439
- selector: '[cdk-portal], [portal]',
440
- exportAs: 'cdkPortal',
441
- providers: [
442
- {
443
- provide: CdkPortal,
444
- useExisting: TemplatePortalDirective,
445
- },
446
- ],
447
- }]
448
- }] });
449
- /**
450
- * Directive version of a PortalOutlet. Because the directive *is* a PortalOutlet, portals can be
451
- * directly attached to it, enabling declarative use.
452
- *
453
- * Usage:
454
- * `<ng-template [cdkPortalOutlet]="greeting"></ng-template>`
455
- */
456
- class CdkPortalOutlet extends BasePortalOutlet {
457
- constructor(_componentFactoryResolver, _viewContainerRef,
458
- /**
459
- * @deprecated `_document` parameter to be made required.
460
- * @breaking-change 9.0.0
461
- */
462
- _document) {
463
- super();
464
- this._componentFactoryResolver = _componentFactoryResolver;
465
- this._viewContainerRef = _viewContainerRef;
466
- /** Whether the portal component is initialized. */
467
- this._isInitialized = false;
468
- /** Emits when a portal is attached to the outlet. */
469
- this.attached = new EventEmitter();
470
- /**
471
- * Attaches the given DomPortal to this PortalHost by moving all of the portal content into it.
472
- * @param portal Portal to be attached.
473
- * @deprecated To be turned into a method.
474
- * @breaking-change 10.0.0
475
- */
476
- this.attachDomPortal = (portal) => {
477
- // @breaking-change 9.0.0 Remove check and error once the
478
- // `_document` constructor parameter is required.
479
- if (!this._document && (typeof ngDevMode === 'undefined' || ngDevMode)) {
480
- throw Error('Cannot attach DOM portal without _document constructor parameter');
481
- }
482
- const element = portal.element;
483
- if (!element.parentNode && (typeof ngDevMode === 'undefined' || ngDevMode)) {
484
- throw Error('DOM portal content must be attached to a parent node.');
485
- }
486
- // Anchor used to save the element's previous position so
487
- // that we can restore it when the portal is detached.
488
- const anchorNode = this._document.createComment('dom-portal');
489
- portal.setAttachedHost(this);
490
- element.parentNode.insertBefore(anchorNode, element);
491
- this._getRootNode().appendChild(element);
492
- this._attachedPortal = portal;
493
- super.setDisposeFn(() => {
494
- if (anchorNode.parentNode) {
495
- anchorNode.parentNode.replaceChild(element, anchorNode);
496
- }
497
- });
498
- };
499
- this._document = _document;
500
- }
501
- /** Portal associated with the Portal outlet. */
502
- get portal() {
503
- return this._attachedPortal;
504
- }
505
- set portal(portal) {
506
- // Ignore the cases where the `portal` is set to a falsy value before the lifecycle hooks have
507
- // run. This handles the cases where the user might do something like `<div cdkPortalOutlet>`
508
- // and attach a portal programmatically in the parent component. When Angular does the first CD
509
- // round, it will fire the setter with empty string, causing the user's content to be cleared.
510
- if (this.hasAttached() && !portal && !this._isInitialized) {
511
- return;
512
- }
513
- if (this.hasAttached()) {
514
- super.detach();
515
- }
516
- if (portal) {
517
- super.attach(portal);
518
- }
519
- this._attachedPortal = portal || null;
520
- }
521
- /** Component or view reference that is attached to the portal. */
522
- get attachedRef() {
523
- return this._attachedRef;
524
- }
525
- ngOnInit() {
526
- this._isInitialized = true;
527
- }
528
- ngOnDestroy() {
529
- super.dispose();
530
- this._attachedPortal = null;
531
- this._attachedRef = null;
532
- }
533
- /**
534
- * Attach the given ComponentPortal to this PortalOutlet using the ComponentFactoryResolver.
535
- *
536
- * @param portal Portal to be attached to the portal outlet.
537
- * @returns Reference to the created component.
538
- */
539
- attachComponentPortal(portal) {
540
- portal.setAttachedHost(this);
541
- // If the portal specifies an origin, use that as the logical location of the component
542
- // in the application tree. Otherwise use the location of this PortalOutlet.
543
- const viewContainerRef = portal.viewContainerRef != null ? portal.viewContainerRef : this._viewContainerRef;
544
- const resolver = portal.componentFactoryResolver || this._componentFactoryResolver;
545
- const componentFactory = resolver.resolveComponentFactory(portal.component);
546
- const ref = viewContainerRef.createComponent(componentFactory, viewContainerRef.length, portal.injector || viewContainerRef.injector);
547
- // If we're using a view container that's different from the injected one (e.g. when the portal
548
- // specifies its own) we need to move the component into the outlet, otherwise it'll be rendered
549
- // inside of the alternate view container.
550
- if (viewContainerRef !== this._viewContainerRef) {
551
- this._getRootNode().appendChild(ref.hostView.rootNodes[0]);
552
- }
553
- super.setDisposeFn(() => ref.destroy());
554
- this._attachedPortal = portal;
555
- this._attachedRef = ref;
556
- this.attached.emit(ref);
557
- return ref;
558
- }
559
- /**
560
- * Attach the given TemplatePortal to this PortalHost as an embedded View.
561
- * @param portal Portal to be attached.
562
- * @returns Reference to the created embedded view.
563
- */
564
- attachTemplatePortal(portal) {
565
- portal.setAttachedHost(this);
566
- const viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context, {
567
- injector: portal.injector,
568
- });
569
- super.setDisposeFn(() => this._viewContainerRef.clear());
570
- this._attachedPortal = portal;
571
- this._attachedRef = viewRef;
572
- this.attached.emit(viewRef);
573
- return viewRef;
574
- }
575
- /** Gets the root node of the portal outlet. */
576
- _getRootNode() {
577
- const nativeElement = this._viewContainerRef.element.nativeElement;
578
- // The directive could be set on a template which will result in a comment
579
- // node being the root. Use the comment's parent node if that is the case.
580
- return (nativeElement.nodeType === nativeElement.ELEMENT_NODE
581
- ? nativeElement
582
- : nativeElement.parentNode);
583
- }
584
- }
585
- CdkPortalOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: CdkPortalOutlet, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ViewContainerRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive });
586
- CdkPortalOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: { portal: ["cdkPortalOutlet", "portal"] }, outputs: { attached: "attached" }, exportAs: ["cdkPortalOutlet"], usesInheritance: true, ngImport: i0 });
587
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: CdkPortalOutlet, decorators: [{
588
- type: Directive,
589
- args: [{
590
- selector: '[cdkPortalOutlet]',
591
- exportAs: 'cdkPortalOutlet',
592
- inputs: ['portal: cdkPortalOutlet'],
593
- }]
594
- }], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
595
- type: Inject,
596
- args: [DOCUMENT]
597
- }] }]; }, propDecorators: { attached: [{
598
- type: Output
599
- }] } });
600
- /**
601
- * @deprecated Use `CdkPortalOutlet` instead.
602
- * @breaking-change 9.0.0
603
- */
604
- class PortalHostDirective extends CdkPortalOutlet {
605
- }
606
- PortalHostDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: PortalHostDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
607
- PortalHostDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: PortalHostDirective, selector: "[cdkPortalHost], [portalHost]", inputs: { portal: ["cdkPortalHost", "portal"] }, providers: [
608
- {
609
- provide: CdkPortalOutlet,
610
- useExisting: PortalHostDirective,
611
- },
612
- ], exportAs: ["cdkPortalHost"], usesInheritance: true, ngImport: i0 });
613
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: PortalHostDirective, decorators: [{
614
- type: Directive,
615
- args: [{
616
- selector: '[cdkPortalHost], [portalHost]',
617
- exportAs: 'cdkPortalHost',
618
- inputs: ['portal: cdkPortalHost'],
619
- providers: [
620
- {
621
- provide: CdkPortalOutlet,
622
- useExisting: PortalHostDirective,
623
- },
624
- ],
625
- }]
626
- }] });
627
- class PortalModule {
628
- }
629
- PortalModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: PortalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
630
- PortalModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: PortalModule, declarations: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective], exports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective] });
631
- PortalModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: PortalModule });
632
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: PortalModule, decorators: [{
633
- type: NgModule,
634
- args: [{
635
- exports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective],
636
- declarations: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective],
637
- }]
638
- }] });
639
-
640
- /**
641
- * @license
642
- * Copyright Google LLC All Rights Reserved.
643
- *
644
- * Use of this source code is governed by an MIT-style license that can be
645
- * found in the LICENSE file at https://angular.io/license
646
- */
647
- /**
648
- * Custom injector to be used when providing custom
649
- * injection tokens to components inside a portal.
650
- * @docs-private
651
- * @deprecated Use `Injector.create` instead.
652
- * @breaking-change 11.0.0
653
- */
654
- class PortalInjector {
655
- constructor(_parentInjector, _customTokens) {
656
- this._parentInjector = _parentInjector;
657
- this._customTokens = _customTokens;
658
- }
659
- get(token, notFoundValue) {
660
- const value = this._customTokens.get(token);
661
- if (typeof value !== 'undefined') {
662
- return value;
663
- }
664
- return this._parentInjector.get(token, notFoundValue);
665
- }
666
- }
667
-
668
- /**
669
- * @license
670
- * Copyright Google LLC All Rights Reserved.
671
- *
672
- * Use of this source code is governed by an MIT-style license that can be
673
- * found in the LICENSE file at https://angular.io/license
674
- */
675
-
676
- /**
677
- * @license
678
- * Copyright Google LLC All Rights Reserved.
679
- *
680
- * Use of this source code is governed by an MIT-style license that can be
681
- * found in the LICENSE file at https://angular.io/license
682
- */
683
-
684
- /**
685
- * Generated bundle index. Do not edit.
686
- */
687
-
688
- export { BasePortalHost, BasePortalOutlet, CdkPortal, CdkPortalOutlet, ComponentPortal, DomPortal, DomPortalHost, DomPortalOutlet, Portal, PortalHostDirective, PortalInjector, PortalModule, TemplatePortal, TemplatePortalDirective };
689
- //# sourceMappingURL=portal.mjs.map
1
+ import * as i0 from '@angular/core';
2
+ import { ElementRef, NgModuleRef, EnvironmentInjector, createComponent, Injector, inject, TemplateRef, ViewContainerRef, Directive, DOCUMENT, EventEmitter, Input, Output, NgModule } from '@angular/core';
3
+
4
+ /**
5
+ * Throws an exception when attempting to attach a null portal to a host.
6
+ * @docs-private
7
+ */
8
+ function throwNullPortalError() {
9
+ throw Error('Must provide a portal to attach');
10
+ }
11
+ /**
12
+ * Throws an exception when attempting to attach a portal to a host that is already attached.
13
+ * @docs-private
14
+ */
15
+ function throwPortalAlreadyAttachedError() {
16
+ throw Error('Host already has a portal attached');
17
+ }
18
+ /**
19
+ * Throws an exception when attempting to attach a portal to an already-disposed host.
20
+ * @docs-private
21
+ */
22
+ function throwPortalOutletAlreadyDisposedError() {
23
+ throw Error('This PortalOutlet has already been disposed');
24
+ }
25
+ /**
26
+ * Throws an exception when attempting to attach an unknown portal type.
27
+ * @docs-private
28
+ */
29
+ function throwUnknownPortalTypeError() {
30
+ throw Error('Attempting to attach an unknown Portal type. BasePortalOutlet accepts either ' +
31
+ 'a ComponentPortal or a TemplatePortal.');
32
+ }
33
+ /**
34
+ * Throws an exception when attempting to attach a portal to a null host.
35
+ * @docs-private
36
+ */
37
+ function throwNullPortalOutletError() {
38
+ throw Error('Attempting to attach a portal to a null PortalOutlet');
39
+ }
40
+ /**
41
+ * Throws an exception when attempting to detach a portal that is not attached.
42
+ * @docs-private
43
+ */
44
+ function throwNoPortalAttachedError() {
45
+ throw Error('Attempting to detach a portal that is not attached to a host');
46
+ }
47
+
48
+ /**
49
+ * A `Portal` is something that you want to render somewhere else.
50
+ * It can be attach to / detached from a `PortalOutlet`.
51
+ */
52
+ class Portal {
53
+ _attachedHost;
54
+ /** Attach this portal to a host. */
55
+ attach(host) {
56
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
57
+ if (host == null) {
58
+ throwNullPortalOutletError();
59
+ }
60
+ if (host.hasAttached()) {
61
+ throwPortalAlreadyAttachedError();
62
+ }
63
+ }
64
+ this._attachedHost = host;
65
+ return host.attach(this);
66
+ }
67
+ /** Detach this portal from its host */
68
+ detach() {
69
+ let host = this._attachedHost;
70
+ if (host != null) {
71
+ this._attachedHost = null;
72
+ host.detach();
73
+ }
74
+ else if (typeof ngDevMode === 'undefined' || ngDevMode) {
75
+ throwNoPortalAttachedError();
76
+ }
77
+ }
78
+ /** Whether this portal is attached to a host. */
79
+ get isAttached() {
80
+ return this._attachedHost != null;
81
+ }
82
+ /**
83
+ * Sets the PortalOutlet reference without performing `attach()`. This is used directly by
84
+ * the PortalOutlet when it is performing an `attach()` or `detach()`.
85
+ */
86
+ setAttachedHost(host) {
87
+ this._attachedHost = host;
88
+ }
89
+ }
90
+ /**
91
+ * A `ComponentPortal` is a portal that instantiates some Component upon attachment.
92
+ */
93
+ class ComponentPortal extends Portal {
94
+ /** The type of the component that will be instantiated for attachment. */
95
+ component;
96
+ /**
97
+ * Where the attached component should live in Angular's *logical* component tree.
98
+ * This is different from where the component *renders*, which is determined by the PortalOutlet.
99
+ * The origin is necessary when the host is outside of the Angular application context.
100
+ */
101
+ viewContainerRef;
102
+ /** Injector used for the instantiation of the component. */
103
+ injector;
104
+ /**
105
+ * List of DOM nodes that should be projected through `<ng-content>` of the attached component.
106
+ */
107
+ projectableNodes;
108
+ constructor(component, viewContainerRef, injector, projectableNodes) {
109
+ super();
110
+ this.component = component;
111
+ this.viewContainerRef = viewContainerRef;
112
+ this.injector = injector;
113
+ this.projectableNodes = projectableNodes;
114
+ }
115
+ }
116
+ /**
117
+ * A `TemplatePortal` is a portal that represents some embedded template (TemplateRef).
118
+ */
119
+ class TemplatePortal extends Portal {
120
+ templateRef;
121
+ viewContainerRef;
122
+ context;
123
+ injector;
124
+ constructor(
125
+ /** The embedded template that will be used to instantiate an embedded View in the host. */
126
+ templateRef,
127
+ /** Reference to the ViewContainer into which the template will be stamped out. */
128
+ viewContainerRef,
129
+ /** Contextual data to be passed in to the embedded view. */
130
+ context,
131
+ /** The injector to use for the embedded view. */
132
+ injector) {
133
+ super();
134
+ this.templateRef = templateRef;
135
+ this.viewContainerRef = viewContainerRef;
136
+ this.context = context;
137
+ this.injector = injector;
138
+ }
139
+ get origin() {
140
+ return this.templateRef.elementRef;
141
+ }
142
+ /**
143
+ * Attach the portal to the provided `PortalOutlet`.
144
+ * When a context is provided it will override the `context` property of the `TemplatePortal`
145
+ * instance.
146
+ */
147
+ attach(host, context = this.context) {
148
+ this.context = context;
149
+ return super.attach(host);
150
+ }
151
+ detach() {
152
+ this.context = undefined;
153
+ return super.detach();
154
+ }
155
+ }
156
+ /**
157
+ * A `DomPortal` is a portal whose DOM element will be taken from its current position
158
+ * in the DOM and moved into a portal outlet, when it is attached. On detach, the content
159
+ * will be restored to its original position.
160
+ */
161
+ class DomPortal extends Portal {
162
+ /** DOM node hosting the portal's content. */
163
+ element;
164
+ constructor(element) {
165
+ super();
166
+ this.element = element instanceof ElementRef ? element.nativeElement : element;
167
+ }
168
+ }
169
+ /**
170
+ * Partial implementation of PortalOutlet that handles attaching
171
+ * ComponentPortal and TemplatePortal.
172
+ */
173
+ class BasePortalOutlet {
174
+ /** The portal currently attached to the host. */
175
+ _attachedPortal;
176
+ /** A function that will permanently dispose this host. */
177
+ _disposeFn;
178
+ /** Whether this host has already been permanently disposed. */
179
+ _isDisposed = false;
180
+ /** Whether this host has an attached portal. */
181
+ hasAttached() {
182
+ return !!this._attachedPortal;
183
+ }
184
+ /** Attaches a portal. */
185
+ attach(portal) {
186
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
187
+ if (!portal) {
188
+ throwNullPortalError();
189
+ }
190
+ if (this.hasAttached()) {
191
+ throwPortalAlreadyAttachedError();
192
+ }
193
+ if (this._isDisposed) {
194
+ throwPortalOutletAlreadyDisposedError();
195
+ }
196
+ }
197
+ if (portal instanceof ComponentPortal) {
198
+ this._attachedPortal = portal;
199
+ return this.attachComponentPortal(portal);
200
+ }
201
+ else if (portal instanceof TemplatePortal) {
202
+ this._attachedPortal = portal;
203
+ return this.attachTemplatePortal(portal);
204
+ // @breaking-change 10.0.0 remove null check for `this.attachDomPortal`.
205
+ }
206
+ else if (this.attachDomPortal && portal instanceof DomPortal) {
207
+ this._attachedPortal = portal;
208
+ return this.attachDomPortal(portal);
209
+ }
210
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
211
+ throwUnknownPortalTypeError();
212
+ }
213
+ }
214
+ // @breaking-change 10.0.0 `attachDomPortal` to become a required abstract method.
215
+ attachDomPortal = null;
216
+ /** Detaches a previously attached portal. */
217
+ detach() {
218
+ if (this._attachedPortal) {
219
+ this._attachedPortal.setAttachedHost(null);
220
+ this._attachedPortal = null;
221
+ }
222
+ this._invokeDisposeFn();
223
+ }
224
+ /** Permanently dispose of this portal host. */
225
+ dispose() {
226
+ if (this.hasAttached()) {
227
+ this.detach();
228
+ }
229
+ this._invokeDisposeFn();
230
+ this._isDisposed = true;
231
+ }
232
+ /** @docs-private */
233
+ setDisposeFn(fn) {
234
+ this._disposeFn = fn;
235
+ }
236
+ _invokeDisposeFn() {
237
+ if (this._disposeFn) {
238
+ this._disposeFn();
239
+ this._disposeFn = null;
240
+ }
241
+ }
242
+ }
243
+
244
+ /**
245
+ * A PortalOutlet for attaching portals to an arbitrary DOM element outside of the Angular
246
+ * application context.
247
+ */
248
+ class DomPortalOutlet extends BasePortalOutlet {
249
+ outletElement;
250
+ _appRef;
251
+ _defaultInjector;
252
+ /**
253
+ * @param outletElement Element into which the content is projected.
254
+ * @param _appRef Reference to the application. Only used in component portals when there
255
+ * is no `ViewContainerRef` available.
256
+ * @param _defaultInjector Injector to use as a fallback when the portal being attached doesn't
257
+ * have one. Only used for component portals.
258
+ */
259
+ constructor(
260
+ /** Element into which the content is projected. */
261
+ outletElement, _appRef, _defaultInjector) {
262
+ super();
263
+ this.outletElement = outletElement;
264
+ this._appRef = _appRef;
265
+ this._defaultInjector = _defaultInjector;
266
+ }
267
+ /**
268
+ * Attach the given ComponentPortal to DOM element.
269
+ * @param portal Portal to be attached
270
+ * @returns Reference to the created component.
271
+ */
272
+ attachComponentPortal(portal) {
273
+ let componentRef;
274
+ // If the portal specifies a ViewContainerRef, we will use that as the attachment point
275
+ // for the component (in terms of Angular's component tree, not rendering).
276
+ // When the ViewContainerRef is missing, we use the factory to create the component directly
277
+ // and then manually attach the view to the application.
278
+ if (portal.viewContainerRef) {
279
+ const injector = portal.injector || portal.viewContainerRef.injector;
280
+ const ngModuleRef = injector.get(NgModuleRef, null, { optional: true }) || undefined;
281
+ componentRef = portal.viewContainerRef.createComponent(portal.component, {
282
+ index: portal.viewContainerRef.length,
283
+ injector,
284
+ ngModuleRef,
285
+ projectableNodes: portal.projectableNodes || undefined,
286
+ });
287
+ this.setDisposeFn(() => componentRef.destroy());
288
+ }
289
+ else {
290
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && !this._appRef) {
291
+ throw Error('Cannot attach component portal to outlet without an ApplicationRef.');
292
+ }
293
+ const appRef = this._appRef;
294
+ const elementInjector = portal.injector || this._defaultInjector || Injector.NULL;
295
+ const environmentInjector = elementInjector.get(EnvironmentInjector, appRef.injector);
296
+ componentRef = createComponent(portal.component, {
297
+ elementInjector,
298
+ environmentInjector,
299
+ projectableNodes: portal.projectableNodes || undefined,
300
+ });
301
+ appRef.attachView(componentRef.hostView);
302
+ this.setDisposeFn(() => {
303
+ // Verify that the ApplicationRef has registered views before trying to detach a host view.
304
+ // This check also protects the `detachView` from being called on a destroyed ApplicationRef.
305
+ if (appRef.viewCount > 0) {
306
+ appRef.detachView(componentRef.hostView);
307
+ }
308
+ componentRef.destroy();
309
+ });
310
+ }
311
+ // At this point the component has been instantiated, so we move it to the location in the DOM
312
+ // where we want it to be rendered.
313
+ this.outletElement.appendChild(this._getComponentRootNode(componentRef));
314
+ this._attachedPortal = portal;
315
+ return componentRef;
316
+ }
317
+ /**
318
+ * Attaches a template portal to the DOM as an embedded view.
319
+ * @param portal Portal to be attached.
320
+ * @returns Reference to the created embedded view.
321
+ */
322
+ attachTemplatePortal(portal) {
323
+ let viewContainer = portal.viewContainerRef;
324
+ let viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context, {
325
+ injector: portal.injector,
326
+ });
327
+ // The method `createEmbeddedView` will add the view as a child of the viewContainer.
328
+ // But for the DomPortalOutlet the view can be added everywhere in the DOM
329
+ // (e.g Overlay Container) To move the view to the specified host element. We just
330
+ // re-append the existing root nodes.
331
+ viewRef.rootNodes.forEach(rootNode => this.outletElement.appendChild(rootNode));
332
+ // Note that we want to detect changes after the nodes have been moved so that
333
+ // any directives inside the portal that are looking at the DOM inside a lifecycle
334
+ // hook won't be invoked too early.
335
+ viewRef.detectChanges();
336
+ this.setDisposeFn(() => {
337
+ let index = viewContainer.indexOf(viewRef);
338
+ if (index !== -1) {
339
+ viewContainer.remove(index);
340
+ }
341
+ });
342
+ this._attachedPortal = portal;
343
+ // TODO(jelbourn): Return locals from view.
344
+ return viewRef;
345
+ }
346
+ /**
347
+ * Attaches a DOM portal by transferring its content into the outlet.
348
+ * @param portal Portal to be attached.
349
+ * @deprecated To be turned into a method.
350
+ * @breaking-change 10.0.0
351
+ */
352
+ attachDomPortal = (portal) => {
353
+ const element = portal.element;
354
+ if (!element.parentNode && (typeof ngDevMode === 'undefined' || ngDevMode)) {
355
+ throw Error('DOM portal content must be attached to a parent node.');
356
+ }
357
+ // Anchor used to save the element's previous position so
358
+ // that we can restore it when the portal is detached.
359
+ const anchorNode = this.outletElement.ownerDocument.createComment('dom-portal');
360
+ element.parentNode.insertBefore(anchorNode, element);
361
+ this.outletElement.appendChild(element);
362
+ this._attachedPortal = portal;
363
+ super.setDisposeFn(() => {
364
+ // We can't use `replaceWith` here because IE doesn't support it.
365
+ if (anchorNode.parentNode) {
366
+ anchorNode.parentNode.replaceChild(element, anchorNode);
367
+ }
368
+ });
369
+ };
370
+ /**
371
+ * Clears out a portal from the DOM.
372
+ */
373
+ dispose() {
374
+ super.dispose();
375
+ this.outletElement.remove();
376
+ }
377
+ /** Gets the root HTMLElement for an instantiated component. */
378
+ _getComponentRootNode(componentRef) {
379
+ return componentRef.hostView.rootNodes[0];
380
+ }
381
+ }
382
+
383
+ /**
384
+ * Directive version of a `TemplatePortal`. Because the directive *is* a TemplatePortal,
385
+ * the directive instance itself can be attached to a host, enabling declarative use of portals.
386
+ */
387
+ class CdkPortal extends TemplatePortal {
388
+ constructor() {
389
+ const templateRef = inject(TemplateRef);
390
+ const viewContainerRef = inject(ViewContainerRef);
391
+ super(templateRef, viewContainerRef);
392
+ }
393
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkPortal, deps: [], target: i0.ɵɵFactoryTarget.Directive });
394
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0-next.2", type: CdkPortal, isStandalone: true, selector: "[cdkPortal]", exportAs: ["cdkPortal"], usesInheritance: true, ngImport: i0 });
395
+ }
396
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkPortal, decorators: [{
397
+ type: Directive,
398
+ args: [{
399
+ selector: '[cdkPortal]',
400
+ exportAs: 'cdkPortal',
401
+ }]
402
+ }], ctorParameters: () => [] });
403
+ /**
404
+ * @deprecated Use `CdkPortal` instead.
405
+ * @breaking-change 9.0.0
406
+ */
407
+ class TemplatePortalDirective extends CdkPortal {
408
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: TemplatePortalDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
409
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0-next.2", type: TemplatePortalDirective, isStandalone: true, selector: "[cdk-portal], [portal]", providers: [
410
+ {
411
+ provide: CdkPortal,
412
+ useExisting: TemplatePortalDirective,
413
+ },
414
+ ], exportAs: ["cdkPortal"], usesInheritance: true, ngImport: i0 });
415
+ }
416
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: TemplatePortalDirective, decorators: [{
417
+ type: Directive,
418
+ args: [{
419
+ selector: '[cdk-portal], [portal]',
420
+ exportAs: 'cdkPortal',
421
+ providers: [
422
+ {
423
+ provide: CdkPortal,
424
+ useExisting: TemplatePortalDirective,
425
+ },
426
+ ],
427
+ }]
428
+ }] });
429
+ /**
430
+ * Directive version of a PortalOutlet. Because the directive *is* a PortalOutlet, portals can be
431
+ * directly attached to it, enabling declarative use.
432
+ *
433
+ * Usage:
434
+ * `<ng-template [cdkPortalOutlet]="greeting"></ng-template>`
435
+ */
436
+ class CdkPortalOutlet extends BasePortalOutlet {
437
+ _moduleRef = inject(NgModuleRef, { optional: true });
438
+ _document = inject(DOCUMENT);
439
+ _viewContainerRef = inject(ViewContainerRef);
440
+ /** Whether the portal component is initialized. */
441
+ _isInitialized = false;
442
+ /** Reference to the currently-attached component/view ref. */
443
+ _attachedRef;
444
+ constructor() {
445
+ super();
446
+ }
447
+ /** Portal associated with the Portal outlet. */
448
+ get portal() {
449
+ return this._attachedPortal;
450
+ }
451
+ set portal(portal) {
452
+ // Ignore the cases where the `portal` is set to a falsy value before the lifecycle hooks have
453
+ // run. This handles the cases where the user might do something like `<div cdkPortalOutlet>`
454
+ // and attach a portal programmatically in the parent component. When Angular does the first CD
455
+ // round, it will fire the setter with empty string, causing the user's content to be cleared.
456
+ if (this.hasAttached() && !portal && !this._isInitialized) {
457
+ return;
458
+ }
459
+ if (this.hasAttached()) {
460
+ super.detach();
461
+ }
462
+ if (portal) {
463
+ super.attach(portal);
464
+ }
465
+ this._attachedPortal = portal || null;
466
+ }
467
+ /** Emits when a portal is attached to the outlet. */
468
+ attached = new EventEmitter();
469
+ /** Component or view reference that is attached to the portal. */
470
+ get attachedRef() {
471
+ return this._attachedRef;
472
+ }
473
+ ngOnInit() {
474
+ this._isInitialized = true;
475
+ }
476
+ ngOnDestroy() {
477
+ super.dispose();
478
+ this._attachedRef = this._attachedPortal = null;
479
+ }
480
+ /**
481
+ * Attach the given ComponentPortal to this PortalOutlet.
482
+ *
483
+ * @param portal Portal to be attached to the portal outlet.
484
+ * @returns Reference to the created component.
485
+ */
486
+ attachComponentPortal(portal) {
487
+ portal.setAttachedHost(this);
488
+ // If the portal specifies an origin, use that as the logical location of the component
489
+ // in the application tree. Otherwise use the location of this PortalOutlet.
490
+ const viewContainerRef = portal.viewContainerRef != null ? portal.viewContainerRef : this._viewContainerRef;
491
+ const ref = viewContainerRef.createComponent(portal.component, {
492
+ index: viewContainerRef.length,
493
+ injector: portal.injector || viewContainerRef.injector,
494
+ projectableNodes: portal.projectableNodes || undefined,
495
+ ngModuleRef: this._moduleRef || undefined,
496
+ });
497
+ // If we're using a view container that's different from the injected one (e.g. when the portal
498
+ // specifies its own) we need to move the component into the outlet, otherwise it'll be rendered
499
+ // inside of the alternate view container.
500
+ if (viewContainerRef !== this._viewContainerRef) {
501
+ this._getRootNode().appendChild(ref.hostView.rootNodes[0]);
502
+ }
503
+ super.setDisposeFn(() => ref.destroy());
504
+ this._attachedPortal = portal;
505
+ this._attachedRef = ref;
506
+ this.attached.emit(ref);
507
+ return ref;
508
+ }
509
+ /**
510
+ * Attach the given TemplatePortal to this PortalHost as an embedded View.
511
+ * @param portal Portal to be attached.
512
+ * @returns Reference to the created embedded view.
513
+ */
514
+ attachTemplatePortal(portal) {
515
+ portal.setAttachedHost(this);
516
+ const viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context, {
517
+ injector: portal.injector,
518
+ });
519
+ super.setDisposeFn(() => this._viewContainerRef.clear());
520
+ this._attachedPortal = portal;
521
+ this._attachedRef = viewRef;
522
+ this.attached.emit(viewRef);
523
+ return viewRef;
524
+ }
525
+ /**
526
+ * Attaches the given DomPortal to this PortalHost by moving all of the portal content into it.
527
+ * @param portal Portal to be attached.
528
+ * @deprecated To be turned into a method.
529
+ * @breaking-change 10.0.0
530
+ */
531
+ attachDomPortal = (portal) => {
532
+ const element = portal.element;
533
+ if (!element.parentNode && (typeof ngDevMode === 'undefined' || ngDevMode)) {
534
+ throw Error('DOM portal content must be attached to a parent node.');
535
+ }
536
+ // Anchor used to save the element's previous position so
537
+ // that we can restore it when the portal is detached.
538
+ const anchorNode = this._document.createComment('dom-portal');
539
+ portal.setAttachedHost(this);
540
+ element.parentNode.insertBefore(anchorNode, element);
541
+ this._getRootNode().appendChild(element);
542
+ this._attachedPortal = portal;
543
+ super.setDisposeFn(() => {
544
+ if (anchorNode.parentNode) {
545
+ anchorNode.parentNode.replaceChild(element, anchorNode);
546
+ }
547
+ });
548
+ };
549
+ /** Gets the root node of the portal outlet. */
550
+ _getRootNode() {
551
+ const nativeElement = this._viewContainerRef.element.nativeElement;
552
+ // The directive could be set on a template which will result in a comment
553
+ // node being the root. Use the comment's parent node if that is the case.
554
+ return (nativeElement.nodeType === nativeElement.ELEMENT_NODE
555
+ ? nativeElement
556
+ : nativeElement.parentNode);
557
+ }
558
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkPortalOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive });
559
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0-next.2", type: CdkPortalOutlet, isStandalone: true, selector: "[cdkPortalOutlet]", inputs: { portal: ["cdkPortalOutlet", "portal"] }, outputs: { attached: "attached" }, exportAs: ["cdkPortalOutlet"], usesInheritance: true, ngImport: i0 });
560
+ }
561
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkPortalOutlet, decorators: [{
562
+ type: Directive,
563
+ args: [{
564
+ selector: '[cdkPortalOutlet]',
565
+ exportAs: 'cdkPortalOutlet',
566
+ }]
567
+ }], ctorParameters: () => [], propDecorators: { portal: [{
568
+ type: Input,
569
+ args: ['cdkPortalOutlet']
570
+ }], attached: [{
571
+ type: Output
572
+ }] } });
573
+ /**
574
+ * @deprecated Use `CdkPortalOutlet` instead.
575
+ * @breaking-change 9.0.0
576
+ */
577
+ class PortalHostDirective extends CdkPortalOutlet {
578
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: PortalHostDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
579
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0-next.2", type: PortalHostDirective, isStandalone: true, selector: "[cdkPortalHost], [portalHost]", inputs: { portal: ["cdkPortalHost", "portal"] }, providers: [
580
+ {
581
+ provide: CdkPortalOutlet,
582
+ useExisting: PortalHostDirective,
583
+ },
584
+ ], exportAs: ["cdkPortalHost"], usesInheritance: true, ngImport: i0 });
585
+ }
586
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: PortalHostDirective, decorators: [{
587
+ type: Directive,
588
+ args: [{
589
+ selector: '[cdkPortalHost], [portalHost]',
590
+ exportAs: 'cdkPortalHost',
591
+ inputs: [{ name: 'portal', alias: 'cdkPortalHost' }],
592
+ providers: [
593
+ {
594
+ provide: CdkPortalOutlet,
595
+ useExisting: PortalHostDirective,
596
+ },
597
+ ],
598
+ }]
599
+ }] });
600
+ class PortalModule {
601
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: PortalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
602
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.0-next.2", ngImport: i0, type: PortalModule, imports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective], exports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective] });
603
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: PortalModule });
604
+ }
605
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: PortalModule, decorators: [{
606
+ type: NgModule,
607
+ args: [{
608
+ imports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective],
609
+ exports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective],
610
+ }]
611
+ }] });
612
+
613
+ export { BasePortalOutlet, CdkPortal, CdkPortalOutlet, ComponentPortal, DomPortal, DomPortalOutlet, Portal, PortalHostDirective, PortalModule, TemplatePortal, TemplatePortalDirective };
614
+ //# sourceMappingURL=portal.mjs.map