@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
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.hasNgModuleImport = hasNgModuleImport;
11
+ const schematics_1 = require("@angular-devkit/schematics");
12
+ const ts = require("typescript");
13
+ /**
14
+ * Whether the Angular module in the given path imports the specified module class name.
15
+ */
16
+ function hasNgModuleImport(tree, modulePath, className) {
17
+ const moduleFileContent = tree.read(modulePath);
18
+ if (!moduleFileContent) {
19
+ throw new schematics_1.SchematicsException(`Could not read Angular module file: ${modulePath}`);
20
+ }
21
+ const parsedFile = ts.createSourceFile(modulePath, moduleFileContent.toString(), ts.ScriptTarget.Latest, true);
22
+ const ngModuleMetadata = findNgModuleMetadata(parsedFile);
23
+ if (!ngModuleMetadata) {
24
+ throw new schematics_1.SchematicsException(`Could not find NgModule declaration inside: "${modulePath}"`);
25
+ }
26
+ for (let property of ngModuleMetadata.properties) {
27
+ if (!ts.isPropertyAssignment(property) ||
28
+ property.name.getText() !== 'imports' ||
29
+ !ts.isArrayLiteralExpression(property.initializer)) {
30
+ continue;
31
+ }
32
+ if (property.initializer.elements.some(element => element.getText() === className)) {
33
+ return true;
34
+ }
35
+ }
36
+ return false;
37
+ }
38
+ /**
39
+ * Resolves the last identifier that is part of the given expression. This helps resolving
40
+ * identifiers of nested property access expressions (e.g. myNamespace.core.NgModule).
41
+ */
42
+ function resolveIdentifierOfExpression(expression) {
43
+ if (ts.isIdentifier(expression)) {
44
+ return expression;
45
+ }
46
+ else if (ts.isPropertyAccessExpression(expression) && ts.isIdentifier(expression.name)) {
47
+ return expression.name;
48
+ }
49
+ return null;
50
+ }
51
+ /**
52
+ * Finds a NgModule declaration within the specified TypeScript node and returns the
53
+ * corresponding metadata for it. This function searches breadth first because
54
+ * NgModule's are usually not nested within other expressions or declarations.
55
+ */
56
+ function findNgModuleMetadata(rootNode) {
57
+ // Add immediate child nodes of the root node to the queue.
58
+ const nodeQueue = [...rootNode.getChildren()];
59
+ while (nodeQueue.length) {
60
+ const node = nodeQueue.shift();
61
+ if (ts.isDecorator(node) &&
62
+ ts.isCallExpression(node.expression) &&
63
+ isNgModuleCallExpression(node.expression)) {
64
+ return node.expression.arguments[0];
65
+ }
66
+ else {
67
+ nodeQueue.push(...node.getChildren());
68
+ }
69
+ }
70
+ return null;
71
+ }
72
+ /** Whether the specified call expression is referring to a NgModule definition. */
73
+ function isNgModuleCallExpression(callExpression) {
74
+ if (!callExpression.arguments.length ||
75
+ !ts.isObjectLiteralExpression(callExpression.arguments[0])) {
76
+ return false;
77
+ }
78
+ // The `NgModule` call expression name is never referring to a `PrivateIdentifier`.
79
+ const decoratorIdentifier = resolveIdentifierOfExpression(callExpression.expression);
80
+ return decoratorIdentifier ? decoratorIdentifier.text === 'NgModule' : false;
81
+ }
82
+ //# sourceMappingURL=ng-module-imports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ng-module-imports.js","sourceRoot":"","sources":["ng-module-imports.ts"],"names":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I,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC;AAC/E,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import { Tree } from '@angular-devkit/schematics';
9
+ import { Schema as ComponentOptions } from '@schematics/angular/component/schema';
10
+ import { ProjectDefinition } from '@schematics/angular/utility';
11
+ import * as ts from 'typescript';
12
+ /** Reads file given path and returns TypeScript source file. */
13
+ export declare function parseSourceFile(host: Tree, path: string): ts.SourceFile;
14
+ /** Import and add module to root app module. */
15
+ export declare function addModuleImportToRootModule(host: Tree, moduleName: string, src: string, project: ProjectDefinition): void;
16
+ /**
17
+ * Import and add module to specific module path.
18
+ * @param host the tree we are updating
19
+ * @param modulePath src location of the module to import
20
+ * @param moduleName name of module to import
21
+ * @param src src location to import
22
+ */
23
+ export declare function addModuleImportToModule(host: Tree, modulePath: string, moduleName: string, src: string): void;
24
+ /** Wraps the internal find module from options with undefined path handling */
25
+ export declare function findModuleFromOptions(host: Tree, options: ComponentOptions): Promise<string | undefined>;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
10
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
11
+ return new (P || (P = Promise))(function (resolve, reject) {
12
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
13
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
14
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
15
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
16
+ });
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.parseSourceFile = parseSourceFile;
20
+ exports.addModuleImportToRootModule = addModuleImportToRootModule;
21
+ exports.addModuleImportToModule = addModuleImportToModule;
22
+ exports.findModuleFromOptions = findModuleFromOptions;
23
+ const schematics_1 = require("@angular-devkit/schematics");
24
+ const change_1 = require("@schematics/angular/utility/change");
25
+ const utility_1 = require("@schematics/angular/utility");
26
+ const find_module_1 = require("@schematics/angular/utility/find-module");
27
+ const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
28
+ const ng_ast_utils_1 = require("@schematics/angular/utility/ng-ast-utils");
29
+ const ts = require("typescript");
30
+ const project_main_file_1 = require("./project-main-file");
31
+ /** Reads file given path and returns TypeScript source file. */
32
+ function parseSourceFile(host, path) {
33
+ const buffer = host.read(path);
34
+ if (!buffer) {
35
+ throw new schematics_1.SchematicsException(`Could not find file for path: ${path}`);
36
+ }
37
+ return ts.createSourceFile(path, buffer.toString(), ts.ScriptTarget.Latest, true);
38
+ }
39
+ /** Import and add module to root app module. */
40
+ function addModuleImportToRootModule(host, moduleName, src, project) {
41
+ const modulePath = (0, ng_ast_utils_1.getAppModulePath)(host, (0, project_main_file_1.getProjectMainFile)(project));
42
+ addModuleImportToModule(host, modulePath, moduleName, src);
43
+ }
44
+ /**
45
+ * Import and add module to specific module path.
46
+ * @param host the tree we are updating
47
+ * @param modulePath src location of the module to import
48
+ * @param moduleName name of module to import
49
+ * @param src src location to import
50
+ */
51
+ function addModuleImportToModule(host, modulePath, moduleName, src) {
52
+ const moduleSource = parseSourceFile(host, modulePath);
53
+ if (!moduleSource) {
54
+ throw new schematics_1.SchematicsException(`Module not found: ${modulePath}`);
55
+ }
56
+ const changes = (0, ast_utils_1.addImportToModule)(moduleSource, modulePath, moduleName, src);
57
+ const recorder = host.beginUpdate(modulePath);
58
+ changes.forEach(change => {
59
+ if (change instanceof change_1.InsertChange) {
60
+ recorder.insertLeft(change.pos, change.toAdd);
61
+ }
62
+ });
63
+ host.commitUpdate(recorder);
64
+ }
65
+ /** Wraps the internal find module from options with undefined path handling */
66
+ function findModuleFromOptions(host, options) {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ const workspace = yield (0, utility_1.readWorkspace)(host);
69
+ if (!options.project) {
70
+ options.project = Array.from(workspace.projects.keys())[0];
71
+ }
72
+ const project = workspace.projects.get(options.project);
73
+ if (options.path === undefined) {
74
+ options.path = `/${project.root}/src/app`;
75
+ }
76
+ return (0, find_module_1.findModuleFromOptions)(host, options);
77
+ });
78
+ }
79
+ //# sourceMappingURL=ast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast.js","sourceRoot":"","sources":["ast.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;AAaH,0CAMC;AAGD,kEAQC;AASD,0DAsBC;AAGD,sDAiBC;AA/ED,2DAAqE;AAErE,+DAAgE;AAChE,yDAA6E;AAC7E,yEAAoG;AACpG,qEAAwE;AACxE,2EAA0E;AAC1E,iCAAiC;AACjC,2DAAuD;AAEvD,gEAAgE;AAChE,SAAgB,eAAe,CAAC,IAAU,EAAE,IAAY;IACtD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,gCAAmB,CAAC,iCAAiC,IAAI,EAAE,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,EAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACpF,CAAC;AAED,gDAAgD;AAChD,SAAgB,2BAA2B,CACzC,IAAU,EACV,UAAkB,EAClB,GAAW,EACX,OAA0B;IAE1B,MAAM,UAAU,GAAG,IAAA,+BAAgB,EAAC,IAAI,EAAE,IAAA,sCAAkB,EAAC,OAAO,CAAC,CAAC,CAAC;IACvE,uBAAuB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AE,CAAC;YAC/B,OAAO,CAAC,IAAI,GAAG,IAAI,OAAO,CAAC,IAAI,UAAU,CAAC;QAC5C,CAAC;QAED,OAAO,IAAA,mCAAkB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;CAAA"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import { Rule } from '@angular-devkit/schematics';
9
+ import { Schema as ComponentOptions } from '@schematics/angular/component/schema';
10
+ /**
11
+ * Rule that copies and interpolates the files that belong to this schematic context. Additionally
12
+ * a list of file paths can be passed to this rule in order to expose them inside the EJS
13
+ * template context.
14
+ *
15
+ * This allows inlining the external template or stylesheet files in EJS without having
16
+ * to manually duplicate the file content.
17
+ */
18
+ export declare function buildComponent(options: ComponentOptions, additionalFiles?: {
19
+ [key: string]: string;
20
+ }): Rule;
@@ -0,0 +1,189 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
10
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
11
+ return new (P || (P = Promise))(function (resolve, reject) {
12
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
13
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
14
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
15
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
16
+ });
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.buildComponent = buildComponent;
20
+ const core_1 = require("@angular-devkit/core");
21
+ const schematics_1 = require("@angular-devkit/schematics");
22
+ const schema_1 = require("@schematics/angular/component/schema");
23
+ const change_1 = require("@schematics/angular/utility/change");
24
+ const utility_1 = require("@schematics/angular/utility");
25
+ const find_module_1 = require("@schematics/angular/utility/find-module");
26
+ const parse_name_1 = require("@schematics/angular/utility/parse-name");
27
+ const validation_1 = require("@schematics/angular/utility/validation");
28
+ const workspace_models_1 = require("@schematics/angular/utility/workspace-models");
29
+ const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
30
+ const fs_1 = require("fs");
31
+ const path_1 = require("path");
32
+ const ts = require("typescript");
33
+ const get_project_1 = require("./get-project");
34
+ const schematic_options_1 = require("./schematic-options");
35
+ /**
36
+ * Build a default project path for generating.
37
+ * @param project The project to build the path for.
38
+ */
39
+ function buildDefaultPath(project) {
40
+ const root = project.sourceRoot ? `/${project.sourceRoot}/` : `/${project.root}/src/`;
41
+ const projectDirName = project.extensions['projectType'] === workspace_models_1.ProjectType.Application ? 'app' : 'lib';
42
+ return `${root}${projectDirName}`;
43
+ }
44
+ /**
45
+ * List of style extensions which are CSS compatible. All supported CLI style extensions can be
46
+ * found here: angular/angular-cli/main/packages/schematics/angular/ng-new/schema.json#L118-L122
47
+ */
48
+ const supportedCssExtensions = ['css', 'scss', 'less'];
49
+ function readIntoSourceFile(host, modulePath) {
50
+ const text = host.read(modulePath);
51
+ if (text === null) {
52
+ throw new schematics_1.SchematicsException(`File ${modulePath} does not exist.`);
53
+ }
54
+ return ts.createSourceFile(modulePath, text.toString('utf-8'), ts.ScriptTarget.Latest, true);
55
+ }
56
+ function addDeclarationToNgModule(options) {
57
+ return (host) => {
58
+ if (options.skipImport || options.standalone || !options.module) {
59
+ return host;
60
+ }
61
+ const modulePath = options.module;
62
+ let source = readIntoSourceFile(host, modulePath);
63
+ const componentPath = `/${options.path}/` +
64
+ (options.flat ? '' : schematics_1.strings.dasherize(options.name) + '/') +
65
+ schematics_1.strings.dasherize(options.name) +
66
+ '.component';
67
+ const relativePath = (0, find_module_1.buildRelativePath)(modulePath, componentPath);
68
+ const classifiedName = schematics_1.strings.classify(`${options.name}Component`);
69
+ const declarationChanges = (0, ast_utils_1.addDeclarationToModule)(source, modulePath, classifiedName, relativePath);
70
+ const declarationRecorder = host.beginUpdate(modulePath);
71
+ for (const change of declarationChanges) {
72
+ if (change instanceof change_1.InsertChange) {
73
+ declarationRecorder.insertLeft(change.pos, change.toAdd);
74
+ }
75
+ }
76
+ host.commitUpdate(declarationRecorder);
77
+ if (options.export) {
78
+ // Need to refresh the AST because we overwrote the file in the host.
79
+ source = readIntoSourceFile(host, modulePath);
80
+ const exportRecorder = host.beginUpdate(modulePath);
81
+ const exportChanges = (0, ast_utils_1.addExportToModule)(source, modulePath, schematics_1.strings.classify(`${options.name}Component`), relativePath);
82
+ for (const change of exportChanges) {
83
+ if (change instanceof change_1.InsertChange) {
84
+ exportRecorder.insertLeft(change.pos, change.toAdd);
85
+ }
86
+ }
87
+ host.commitUpdate(exportRecorder);
88
+ }
89
+ return host;
90
+ };
91
+ }
92
+ function buildSelector(options, projectPrefix) {
93
+ let selector = schematics_1.strings.dasherize(options.name);
94
+ if (options.prefix) {
95
+ selector = `${options.prefix}-${selector}`;
96
+ }
97
+ else if (options.prefix === undefined && projectPrefix) {
98
+ selector = `${projectPrefix}-${selector}`;
99
+ }
100
+ return selector;
101
+ }
102
+ /**
103
+ * Indents the text content with the amount of specified spaces. The spaces will be added after
104
+ * every line-break. This utility function can be used inside of EJS templates to properly
105
+ * include the additional files.
106
+ */
107
+ function indentTextContent(text, numSpaces) {
108
+ // In the Material project there should be only LF line-endings, but the schematic files
109
+ // are not being linted and therefore there can be also CRLF or just CR line-endings.
110
+ return text.replace(/(\r\n|\r|\n)/g, `$1${' '.repeat(numSpaces)}`);
111
+ }
112
+ /**
113
+ * Rule that copies and interpolates the files that belong to this schematic context. Additionally
114
+ * a list of file paths can be passed to this rule in order to expose them inside the EJS
115
+ * template context.
116
+ *
117
+ * This allows inlining the external template or stylesheet files in EJS without having
118
+ * to manually duplicate the file content.
119
+ */
120
+ function buildComponent(options, additionalFiles = {}) {
121
+ return (host, ctx) => __awaiter(this, void 0, void 0, function* () {
122
+ const context = ctx;
123
+ const workspace = yield (0, utility_1.readWorkspace)(host);
124
+ const project = (0, get_project_1.getProjectFromWorkspace)(workspace, options.project);
125
+ const defaultComponentOptions = (0, schematic_options_1.getDefaultComponentOptions)(project);
126
+ // TODO(devversion): Remove if we drop support for older CLI versions.
127
+ // This handles an unreported breaking change from the @angular-devkit/schematics. Previously
128
+ // the description path resolved to the factory file, but starting from 6.2.0, it resolves
129
+ // to the factory directory.
130
+ const schematicPath = (0, fs_1.statSync)(context.schematic.description.path).isDirectory()
131
+ ? context.schematic.description.path
132
+ : (0, path_1.dirname)(context.schematic.description.path);
133
+ const schematicFilesUrl = './files';
134
+ const schematicFilesPath = (0, path_1.resolve)(schematicPath, schematicFilesUrl);
135
+ // Add the default component option values to the options if an option is not explicitly
136
+ // specified but a default component option is available.
137
+ Object.keys(options)
138
+ .filter(key => options[key] == null &&
139
+ defaultComponentOptions[key])
140
+ .forEach(key => (options[key] = defaultComponentOptions[key]));
141
+ if (options.path === undefined) {
142
+ options.path = buildDefaultPath(project);
143
+ }
144
+ options.standalone = yield (0, schematic_options_1.isStandaloneSchematic)(host, options);
145
+ if (!options.standalone) {
146
+ // TODO: Remove ext option when the Angular CLI looks for both candidate locations.
147
+ options.module = (0, find_module_1.findModuleFromOptions)(host, Object.assign(Object.assign({}, options), { moduleExt: 'module.ts' }));
148
+ }
149
+ const parsedPath = (0, parse_name_1.parseName)(options.path, options.name);
150
+ options.name = parsedPath.name;
151
+ options.path = parsedPath.path;
152
+ options.selector = options.selector || buildSelector(options, project.prefix);
153
+ (0, validation_1.validateHtmlSelector)(options.selector);
154
+ // In case the specified style extension is not part of the supported CSS supersets,
155
+ // we generate the stylesheets with the "css" extension. This ensures that we don't
156
+ // accidentally generate invalid stylesheets (e.g. drag-drop-comp.styl) which will
157
+ // break the Angular CLI project. See: https://github.com/angular/components/issues/15164
158
+ if (!supportedCssExtensions.includes(options.style)) {
159
+ options.style = schema_1.Style.Css;
160
+ }
161
+ // Object that will be used as context for the EJS templates.
162
+ const baseTemplateContext = Object.assign(Object.assign(Object.assign({}, schematics_1.strings), { 'if-flat': (s) => (options.flat ? '' : s) }), options);
163
+ // Key-value object that includes the specified additional files with their loaded content.
164
+ // The resolved contents can be used inside EJS templates.
165
+ const resolvedFiles = {};
166
+ for (let key in additionalFiles) {
167
+ if (additionalFiles[key]) {
168
+ const fileContent = (0, fs_1.readFileSync)((0, path_1.join)(schematicFilesPath, additionalFiles[key]), 'utf-8');
169
+ // Interpolate the additional files with the base EJS template context.
170
+ resolvedFiles[key] = (0, core_1.template)(fileContent)(baseTemplateContext);
171
+ }
172
+ }
173
+ const templateSource = (0, schematics_1.apply)((0, schematics_1.url)(schematicFilesUrl), [
174
+ options.skipTests ? (0, schematics_1.filter)(path => !path.endsWith('.spec.ts.template')) : (0, schematics_1.noop)(),
175
+ options.inlineStyle ? (0, schematics_1.filter)(path => !path.endsWith('.__style__.template')) : (0, schematics_1.noop)(),
176
+ options.inlineTemplate ? (0, schematics_1.filter)(path => !path.endsWith('.html.template')) : (0, schematics_1.noop)(),
177
+ // Treat the template options as any, because the type definition for the template options
178
+ // is made unnecessarily explicit. Every type of object can be used in the EJS template.
179
+ (0, schematics_1.applyTemplates)(Object.assign({ indentTextContent, resolvedFiles }, baseTemplateContext)),
180
+ // TODO(devversion): figure out why we cannot just remove the first parameter
181
+ // See for example: angular-cli#schematics/angular/component/index.ts#L160
182
+ (0, schematics_1.move)(null, parsedPath.path),
183
+ ]);
184
+ return () => (0, schematics_1.chain)([
185
+ (0, schematics_1.branchAndMerge)((0, schematics_1.chain)([addDeclarationToNgModule(options), (0, schematics_1.mergeWith)(templateSource)])),
186
+ ])(host, context);
187
+ });
188
+ }
189
+ //# sourceMappingURL=build-component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-component.js","sourceRoot":"","sources":["build-component.ts"],"names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AAO,CAAC,CAAC;IACtB,CAAC,CAAA,CAAC;AACJ,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import { ProjectDefinition, WorkspaceDefinition } from '@schematics/angular/utility';
9
+ /**
10
+ * Finds the specified project configuration in the workspace. Throws an error if the project
11
+ * couldn't be found.
12
+ */
13
+ export declare function getProjectFromWorkspace(workspace: WorkspaceDefinition, projectName: string | undefined): ProjectDefinition;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.getProjectFromWorkspace = getProjectFromWorkspace;
11
+ const schematics_1 = require("@angular-devkit/schematics");
12
+ /**
13
+ * Finds the specified project configuration in the workspace. Throws an error if the project
14
+ * couldn't be found.
15
+ */
16
+ function getProjectFromWorkspace(workspace, projectName) {
17
+ if (!projectName) {
18
+ // TODO(crisbeto): some schematics APIs have the project name as optional so for now it's
19
+ // simpler to allow undefined and checking it at runtime. Eventually we should clean this up.
20
+ throw new schematics_1.SchematicsException('Project name is required.');
21
+ }
22
+ const project = workspace.projects.get(projectName);
23
+ if (!project) {
24
+ throw new schematics_1.SchematicsException(`Could not find project in workspace: ${projectName}`);
25
+ }
26
+ return project;
27
+ }
28
+ //# sourceMappingURL=get-project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-project.js","sourceRoot":"","sources":["get-project.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AASH,0DAiBC;AAxBD,2DAA+D;AAG/D;;;GAGG;AACH,SAAgB,uBAAuB,CACrC,SAA8B,EAC9B,WAA+B;IAE/B,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,yFAAyF;QACzF,6FAA6F;QAC7F,MAAM,IAAI,gCAAmB,CAAC,2BAA2B,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAEpD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,gCAAmB,CAAC,wCAAwC,WAAW,EAAE,CAAC,CAAC;IACvF,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import { Tree } from '@angular-devkit/schematics';
9
+ import { Element } from './parse5-element';
10
+ /** Appends the given element HTML fragment to the `<head>` element of the specified HTML file. */
11
+ export declare function appendHtmlElementToHead(host: Tree, htmlFilePath: string, elementHtml: string): void;
12
+ /** Parses the given HTML file and returns the head element if available. */
13
+ export declare function getHtmlHeadTagElement(htmlContent: string): Element | null;
14
+ /** Adds a class to the body of the document. */
15
+ export declare function addBodyClass(host: Tree, htmlFilePath: string, className: string): void;
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.appendHtmlElementToHead = appendHtmlElementToHead;
11
+ exports.getHtmlHeadTagElement = getHtmlHeadTagElement;
12
+ exports.addBodyClass = addBodyClass;
13
+ const schematics_1 = require("@angular-devkit/schematics");
14
+ const parse5_element_1 = require("./parse5-element");
15
+ const parse5_1 = require("parse5");
16
+ /** Appends the given element HTML fragment to the `<head>` element of the specified HTML file. */
17
+ function appendHtmlElementToHead(host, htmlFilePath, elementHtml) {
18
+ const htmlFileBuffer = host.read(htmlFilePath);
19
+ if (!htmlFileBuffer) {
20
+ throw new schematics_1.SchematicsException(`Could not read file for path: ${htmlFilePath}`);
21
+ }
22
+ const htmlContent = htmlFileBuffer.toString();
23
+ if (htmlContent.includes(elementHtml)) {
24
+ return;
25
+ }
26
+ const headTag = getHtmlHeadTagElement(htmlContent);
27
+ if (!headTag) {
28
+ throw Error(`Could not find '<head>' element in HTML file: ${htmlFileBuffer}`);
29
+ }
30
+ // We always have access to the source code location here because the `getHeadTagElement`
31
+ // function explicitly has the `sourceCodeLocationInfo` option enabled.
32
+ const endTagOffset = headTag.sourceCodeLocation.endTag.startOffset;
33
+ const indentationOffset = (0, parse5_element_1.getChildElementIndentation)(headTag);
34
+ const insertion = `${' '.repeat(indentationOffset)}${elementHtml}`;
35
+ const recordedChange = host.beginUpdate(htmlFilePath).insertRight(endTagOffset, `${insertion}\n`);
36
+ host.commitUpdate(recordedChange);
37
+ }
38
+ /** Parses the given HTML file and returns the head element if available. */
39
+ function getHtmlHeadTagElement(htmlContent) {
40
+ return getElementByTagName('head', htmlContent);
41
+ }
42
+ /** Adds a class to the body of the document. */
43
+ function addBodyClass(host, htmlFilePath, className) {
44
+ const htmlFileBuffer = host.read(htmlFilePath);
45
+ if (!htmlFileBuffer) {
46
+ throw new schematics_1.SchematicsException(`Could not read file for path: ${htmlFilePath}`);
47
+ }
48
+ const htmlContent = htmlFileBuffer.toString();
49
+ const body = getElementByTagName('body', htmlContent);
50
+ if (!body) {
51
+ throw Error(`Could not find <body> element in HTML file: ${htmlFileBuffer}`);
52
+ }
53
+ const classAttribute = body.attrs.find(attribute => attribute.name === 'class');
54
+ if (classAttribute) {
55
+ const hasClass = classAttribute.value
56
+ .split(' ')
57
+ .map(part => part.trim())
58
+ .includes(className);
59
+ if (!hasClass) {
60
+ // We have source code location info enabled, and we pre-checked that the element
61
+ // has attributes, specifically the `class` attribute.
62
+ const classAttributeLocation = body.sourceCodeLocation.attrs['class'];
63
+ const recordedChange = host
64
+ .beginUpdate(htmlFilePath)
65
+ .insertRight(classAttributeLocation.endOffset - 1, ` ${className}`);
66
+ host.commitUpdate(recordedChange);
67
+ }
68
+ }
69
+ else {
70
+ const recordedChange = host
71
+ .beginUpdate(htmlFilePath)
72
+ .insertRight(body.sourceCodeLocation.startTag.endOffset - 1, ` class="${className}"`);
73
+ host.commitUpdate(recordedChange);
74
+ }
75
+ }
76
+ /** Finds an element by its tag name. */
77
+ function getElementByTagName(tagName, htmlContent) {
78
+ const document = (0, parse5_1.parse)(htmlContent, { sourceCodeLocationInfo: true });
79
+ const nodeQueue = [...document.childNodes];
80
+ while (nodeQueue.length) {
81
+ const node = nodeQueue.shift();
82
+ if (node.nodeName.toLowerCase() === tagName) {
83
+ return node;
84
+ }
85
+ else if (node.childNodes) {
86
+ nodeQueue.push(...node.childNodes);
87
+ }
88
+ }
89
+ return null;
90
+ }
91
+ //# sourceMappingURL=html-manipulation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-manipulation.js","sourceRoot":"","sources":["html-manipulation.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAOH,0DA4BC;AAGD,sDAEC;AAGD,oCAqCC;AA9ED,2DAAqE;AACrE,qDAAqE;AACrE,mCAA0C;AAE1C,kGAAkG;AAClG,SAAgB,uBAAuB,CAAC,IAAU,EAAE,YAAoB,EAAE,WAAmB;IAC3F,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAE/C,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,MAAM,IAAI,gCAAmB,CAAC,iCAAiC,YAAY,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,MAAM,WAAW,GAAG,cAAc,CAAC,QAAQ,EAAE,CAAC;IAE9C,IAAI,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QACtC,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,qBAAqB,CAAC,WAAW,C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CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,OAAO,EAAE,CAAC;YAC5C,OAAO,IAAI,CAAC;QACd,CAAC;aAAM,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YAC3B,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ export * from './ast';
9
+ export * from './ast/ng-module-imports';
10
+ export * from './build-component';
11
+ export * from './get-project';
12
+ export * from './html-manipulation';
13
+ export * from './parse5-element';
14
+ export * from './project-index-file';
15
+ export * from './project-main-file';
16
+ export * from './project-style-file';
17
+ export * from './project-targets';
18
+ export * from './project-tsconfig-paths';
19
+ export * from './schematic-options';
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
21
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ __exportStar(require("./ast"), exports);
25
+ __exportStar(require("./ast/ng-module-imports"), exports);
26
+ __exportStar(require("./build-component"), exports);
27
+ __exportStar(require("./get-project"), exports);
28
+ __exportStar(require("./html-manipulation"), exports);
29
+ __exportStar(require("./parse5-element"), exports);
30
+ __exportStar(require("./project-index-file"), exports);
31
+ __exportStar(require("./project-main-file"), exports);
32
+ __exportStar(require("./project-style-file"), exports);
33
+ __exportStar(require("./project-targets"), exports);
34
+ __exportStar(require("./project-tsconfig-paths"), exports);
35
+ __exportStar(require("./schematic-options"), exports);
36
+ //# sourceMappingURL=index.js.map