@design-factory/angular 21.1.0 → 22.0.0-next.0

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 (331) hide show
  1. package/.ai/docs/components/accordion/accessibility.md +45 -0
  2. package/.ai/docs/components/accordion/api.md +279 -0
  3. package/.ai/docs/components/accordion/developer.md +43 -0
  4. package/.ai/docs/components/accordion/guidelines.md +99 -0
  5. package/.ai/docs/components/accordion/overview.md +17 -0
  6. package/.ai/docs/components/alert/accessibility.md +24 -0
  7. package/.ai/docs/components/alert/api.md +65 -0
  8. package/.ai/docs/components/alert/developer.md +63 -0
  9. package/.ai/docs/components/alert/guidelines.md +62 -0
  10. package/.ai/docs/components/alert/overview.md +12 -0
  11. package/.ai/docs/components/button/accessibility.md +25 -0
  12. package/.ai/docs/components/button/api.md +71 -0
  13. package/.ai/docs/components/button/developer.md +52 -0
  14. package/.ai/docs/components/button/guidelines.md +75 -0
  15. package/.ai/docs/components/button/overview.md +15 -0
  16. package/.ai/docs/components/buttongroup/api.md +16 -0
  17. package/.ai/docs/components/buttongroup/developer.md +32 -0
  18. package/.ai/docs/components/drawer/accessibility.md +15 -0
  19. package/.ai/docs/components/drawer/api.md +56 -0
  20. package/.ai/docs/components/drawer/developer.md +36 -0
  21. package/.ai/docs/components/drawer/examples.md +9 -0
  22. package/.ai/docs/components/drawer/guidelines.md +58 -0
  23. package/.ai/docs/components/drawer/overview.md +19 -0
  24. package/.ai/docs/components/dropdown/accessibility.md +27 -0
  25. package/.ai/docs/components/dropdown/api.md +85 -0
  26. package/.ai/docs/components/dropdown/developer.md +59 -0
  27. package/.ai/docs/components/dropdown/guidelines.md +80 -0
  28. package/.ai/docs/components/dropdown/overview.md +16 -0
  29. package/.ai/docs/components/sidenav/accessibility.md +48 -0
  30. package/.ai/docs/components/sidenav/api.md +110 -0
  31. package/.ai/docs/components/sidenav/developer.md +14 -0
  32. package/.ai/docs/components/sidenav/guidelines.md +83 -0
  33. package/.ai/docs/components/sidenav/overview.md +16 -0
  34. package/.ai/docs/components/tooltip/accessibility.md +11 -0
  35. package/.ai/docs/components/tooltip/api.md +39 -0
  36. package/.ai/docs/components/tooltip/developer.md +16 -0
  37. package/.ai/docs/components/tooltip/guidelines.md +84 -0
  38. package/.ai/docs/components/tooltip/overview.md +23 -0
  39. package/.ai/docs/components/topnav/accessibility.md +51 -0
  40. package/.ai/docs/components/topnav/api.md +190 -0
  41. package/.ai/docs/components/topnav/developer.md +43 -0
  42. package/.ai/docs/components/topnav/guidelines.md +121 -0
  43. package/.ai/docs/components/topnav/overview.md +17 -0
  44. package/.ai/docs/demos/accordion/addons-subtitle/accordion-addons-subtitle.html +75 -0
  45. package/.ai/docs/demos/accordion/addons-subtitle/accordion-addons-subtitle.ts +27 -0
  46. package/.ai/docs/demos/accordion/basic/accordion-basic.html +16 -0
  47. package/.ai/docs/demos/accordion/basic/accordion-basic.ts +14 -0
  48. package/.ai/docs/demos/accordion/close-others/accordion-close-others.html +16 -0
  49. package/.ai/docs/demos/accordion/close-others/accordion-close-others.ts +14 -0
  50. package/.ai/docs/demos/accordion/interactive/accordion-interactive.html +84 -0
  51. package/.ai/docs/demos/accordion/interactive/accordion-interactive.ts +30 -0
  52. package/.ai/docs/demos/accordion/interactive-addons-subtitle/accordion-interactive-addons-subtitle.html +126 -0
  53. package/.ai/docs/demos/accordion/interactive-addons-subtitle/accordion-interactive-addons-subtitle.ts +33 -0
  54. package/.ai/docs/demos/accordion/programmatic-control/accordion-programmatic-control.html +36 -0
  55. package/.ai/docs/demos/accordion/programmatic-control/accordion-programmatic-control.ts +15 -0
  56. package/.ai/docs/demos/accordion/selectable/accordion-selectable.html +16 -0
  57. package/.ai/docs/demos/accordion/selectable/accordion-selectable.ts +14 -0
  58. package/.ai/docs/demos/accordion/selectable-extended/accordion-selectable-extended.html +28 -0
  59. package/.ai/docs/demos/accordion/selectable-extended/accordion-selectable-extended.ts +80 -0
  60. package/.ai/docs/demos/accordion/separator/accordion-separator.html +16 -0
  61. package/.ai/docs/demos/accordion/separator/accordion-separator.ts +14 -0
  62. package/.ai/docs/demos/alert/banner/alert-banner.html +15 -0
  63. package/.ai/docs/demos/alert/banner/alert-banner.ts +16 -0
  64. package/.ai/docs/demos/alert/basic/alert-basic.html +6 -0
  65. package/.ai/docs/demos/alert/basic/alert-basic.ts +9 -0
  66. package/.ai/docs/demos/alert/card/alert-card.html +15 -0
  67. package/.ai/docs/demos/alert/card/alert-card.ts +9 -0
  68. package/.ai/docs/demos/alert/dismissal/alert-dismissal.html +5 -0
  69. package/.ai/docs/demos/alert/dismissal/alert-dismissal.ts +27 -0
  70. package/.ai/docs/demos/alert/expandable/alert-expandable.html +9 -0
  71. package/.ai/docs/demos/alert/expandable/alert-expandable.ts +11 -0
  72. package/.ai/docs/demos/button/basic/button-basic.html +4 -0
  73. package/.ai/docs/demos/button/basic/button-basic.ts +9 -0
  74. package/.ai/docs/demos/button/disabled/button-disabled.html +18 -0
  75. package/.ai/docs/demos/button/disabled/button-disabled.ts +12 -0
  76. package/.ai/docs/demos/button/icons/button-icons.html +17 -0
  77. package/.ai/docs/demos/button/icons/button-icons.ts +10 -0
  78. package/.ai/docs/demos/button/surfaces/button-surfaces.html +13 -0
  79. package/.ai/docs/demos/button/surfaces/button-surfaces.ts +9 -0
  80. package/.ai/docs/demos/button/variants/button-variants.html +49 -0
  81. package/.ai/docs/demos/button/variants/button-variants.ts +9 -0
  82. package/.ai/docs/demos/buttongroup/basic/buttongroup-basic.html +6 -0
  83. package/.ai/docs/demos/buttongroup/basic/buttongroup-basic.ts +10 -0
  84. package/.ai/docs/demos/buttongroup/disabled/buttongroup-disabled.html +6 -0
  85. package/.ai/docs/demos/buttongroup/disabled/buttongroup-disabled.ts +10 -0
  86. package/.ai/docs/demos/buttongroup/mirror/buttongroup-mirror.html +8 -0
  87. package/.ai/docs/demos/buttongroup/mirror/buttongroup-mirror.ts +10 -0
  88. package/.ai/docs/demos/buttongroup/orientation/buttongroup-orientation.html +19 -0
  89. package/.ai/docs/demos/buttongroup/orientation/buttongroup-orientation.ts +10 -0
  90. package/.ai/docs/demos/buttongroup/sizing/buttongroup-sizing.html +19 -0
  91. package/.ai/docs/demos/buttongroup/sizing/buttongroup-sizing.ts +10 -0
  92. package/.ai/docs/demos/drawer/inline/drawer-inline-basic.html +46 -0
  93. package/.ai/docs/demos/drawer/inline/drawer-inline-basic.ts +33 -0
  94. package/.ai/docs/demos/drawer/overlay/drawer-overlay-basic.html +30 -0
  95. package/.ai/docs/demos/drawer/overlay/drawer-overlay-basic.ts +25 -0
  96. package/.ai/docs/demos/dropdown/basic/dropdown-basic.html +8 -0
  97. package/.ai/docs/demos/dropdown/basic/dropdown-basic.ts +15 -0
  98. package/.ai/docs/demos/dropdown/sizes/dropdown-sizes.html +9 -0
  99. package/.ai/docs/demos/dropdown/sizes/dropdown-sizes.ts +21 -0
  100. package/.ai/docs/demos/dropdown/split/dropdown-split.html +9 -0
  101. package/.ai/docs/demos/dropdown/split/dropdown-split.ts +11 -0
  102. package/.ai/docs/demos/dropdown/toggle/dropdown-toggle.html +22 -0
  103. package/.ai/docs/demos/dropdown/toggle/dropdown-toggle.ts +10 -0
  104. package/.ai/docs/demos/sidenav/sidenav-basic-no-icon/routes.ts +95 -0
  105. package/.ai/docs/demos/sidenav/sidenav-basic-no-icon/sidenav-basic-no-icon.html +42 -0
  106. package/.ai/docs/demos/sidenav/sidenav-basic-no-icon/sidenav-basic-no-icon.ts +12 -0
  107. package/.ai/docs/demos/sidenav/sidenav-basic-with-icon/routes.ts +41 -0
  108. package/.ai/docs/demos/sidenav/sidenav-basic-with-icon/sidenav-basic-with-icon.html +34 -0
  109. package/.ai/docs/demos/sidenav/sidenav-basic-with-icon/sidenav-basic-with-icon.ts +12 -0
  110. package/.ai/docs/demos/tooltip/basic/tooltip-basic.html +1 -0
  111. package/.ai/docs/demos/tooltip/basic/tooltip-basic.ts +10 -0
  112. package/.ai/docs/demos/tooltip/placements/tooltip-placements.html +35 -0
  113. package/.ai/docs/demos/tooltip/placements/tooltip-placements.ts +12 -0
  114. package/.ai/docs/demos/tooltip/sizes/tooltip-sizes.html +5 -0
  115. package/.ai/docs/demos/tooltip/sizes/tooltip-sizes.ts +10 -0
  116. package/.ai/docs/demos/topnav/brand/topnav-brand.ts +64 -0
  117. package/.ai/docs/demos/topnav/environment-banner/topnav-environment-banner.ts +20 -0
  118. package/.ai/docs/demos/topnav/navigation/routes.ts +35 -0
  119. package/.ai/docs/demos/topnav/navigation/topnav-navigation-flat.ts +67 -0
  120. package/.ai/docs/demos/topnav/navigation/topnav-navigation-tree.ts +82 -0
  121. package/.ai/docs/demos/topnav/quick-actions/notifications.ts +75 -0
  122. package/.ai/docs/demos/topnav/quick-actions/topnav-quick-actions.ts +108 -0
  123. package/.ai/docs/demos/topnav/quick-actions/user-account.ts +23 -0
  124. package/.ai/index.md +26 -0
  125. package/fesm2022/design-factory-angular-accordion.mjs +1153 -0
  126. package/fesm2022/design-factory-angular-accordion.mjs.map +1 -0
  127. package/fesm2022/design-factory-angular-alert.mjs +312 -0
  128. package/fesm2022/design-factory-angular-alert.mjs.map +1 -0
  129. package/fesm2022/design-factory-angular-breakpoints.mjs +53 -0
  130. package/fesm2022/design-factory-angular-breakpoints.mjs.map +1 -0
  131. package/fesm2022/design-factory-angular-button.mjs +240 -0
  132. package/fesm2022/design-factory-angular-button.mjs.map +1 -0
  133. package/fesm2022/design-factory-angular-buttongroup.mjs +75 -0
  134. package/fesm2022/design-factory-angular-buttongroup.mjs.map +1 -0
  135. package/fesm2022/design-factory-angular-drawer.mjs +64 -62
  136. package/fesm2022/design-factory-angular-drawer.mjs.map +1 -1
  137. package/fesm2022/design-factory-angular-dropdown.mjs +323 -0
  138. package/fesm2022/design-factory-angular-dropdown.mjs.map +1 -0
  139. package/fesm2022/design-factory-angular-form-field.mjs +287 -0
  140. package/fesm2022/design-factory-angular-form-field.mjs.map +1 -0
  141. package/fesm2022/design-factory-angular-icon.mjs +24 -0
  142. package/fesm2022/design-factory-angular-icon.mjs.map +1 -0
  143. package/fesm2022/design-factory-angular-input.mjs +34 -0
  144. package/fesm2022/design-factory-angular-input.mjs.map +1 -0
  145. package/fesm2022/design-factory-angular-internals.mjs +119 -39
  146. package/fesm2022/design-factory-angular-internals.mjs.map +1 -1
  147. package/fesm2022/design-factory-angular-separator.mjs +43 -0
  148. package/fesm2022/design-factory-angular-separator.mjs.map +1 -0
  149. package/fesm2022/design-factory-angular-sidenav.mjs +652 -401
  150. package/fesm2022/design-factory-angular-sidenav.mjs.map +1 -1
  151. package/fesm2022/design-factory-angular-slider.mjs +451 -0
  152. package/fesm2022/design-factory-angular-slider.mjs.map +1 -0
  153. package/fesm2022/design-factory-angular-theme.mjs +29 -19
  154. package/fesm2022/design-factory-angular-theme.mjs.map +1 -1
  155. package/fesm2022/design-factory-angular-toggle.mjs +172 -0
  156. package/fesm2022/design-factory-angular-toggle.mjs.map +1 -0
  157. package/fesm2022/design-factory-angular-tooltip.mjs +138 -0
  158. package/fesm2022/design-factory-angular-tooltip.mjs.map +1 -0
  159. package/fesm2022/design-factory-angular-topnav.mjs +589 -589
  160. package/fesm2022/design-factory-angular-topnav.mjs.map +1 -1
  161. package/package.json +61 -8
  162. package/schematics/collection.json +35 -0
  163. package/schematics/component-migration/accordion/constants.d.ts +10 -0
  164. package/schematics/component-migration/accordion/constants.js +46 -0
  165. package/schematics/component-migration/accordion/guide.md +257 -0
  166. package/schematics/component-migration/accordion/index.d.ts +2 -0
  167. package/schematics/component-migration/accordion/index.js +5 -0
  168. package/schematics/component-migration/accordion/migration.d.ts +2 -0
  169. package/schematics/component-migration/accordion/migration.js +13 -0
  170. package/schematics/component-migration/accordion/schema.json +25 -0
  171. package/schematics/component-migration/accordion/steps/accordion-imports.d.ts +3 -0
  172. package/schematics/component-migration/accordion/steps/accordion-imports.js +41 -0
  173. package/schematics/component-migration/accordion/steps/template-migration.d.ts +3 -0
  174. package/schematics/component-migration/accordion/steps/template-migration.js +554 -0
  175. package/schematics/component-migration/accordion/steps/title-content.d.ts +9 -0
  176. package/schematics/component-migration/accordion/steps/title-content.js +75 -0
  177. package/schematics/component-migration/ai/prompt.md +83 -0
  178. package/schematics/component-migration/alert/guide.md +246 -0
  179. package/schematics/component-migration/alert/index.d.ts +2 -0
  180. package/schematics/component-migration/alert/index.js +5 -0
  181. package/schematics/component-migration/alert/migration.d.ts +2 -0
  182. package/schematics/component-migration/alert/migration.js +50 -0
  183. package/schematics/component-migration/alert/schema.json +25 -0
  184. package/schematics/component-migration/alert/steps/alert-imports.d.ts +4 -0
  185. package/schematics/component-migration/alert/steps/alert-imports.js +97 -0
  186. package/schematics/component-migration/alert/steps/animation-input.d.ts +3 -0
  187. package/schematics/component-migration/alert/steps/animation-input.js +17 -0
  188. package/schematics/component-migration/alert/steps/close-output.d.ts +3 -0
  189. package/schematics/component-migration/alert/steps/close-output.js +17 -0
  190. package/schematics/component-migration/alert/steps/icon-directive-imports.d.ts +3 -0
  191. package/schematics/component-migration/alert/steps/icon-directive-imports.js +84 -0
  192. package/schematics/component-migration/alert/steps/icon-directive.d.ts +3 -0
  193. package/schematics/component-migration/alert/steps/icon-directive.js +10 -0
  194. package/schematics/component-migration/alert/steps/legacy-module-imports.d.ts +3 -0
  195. package/schematics/component-migration/alert/steps/legacy-module-imports.js +57 -0
  196. package/schematics/component-migration/alert/steps/programmatic-close.d.ts +3 -0
  197. package/schematics/component-migration/alert/steps/programmatic-close.js +44 -0
  198. package/schematics/component-migration/alert/steps/selector.d.ts +3 -0
  199. package/schematics/component-migration/alert/steps/selector.js +18 -0
  200. package/schematics/component-migration/alert/steps/static-classes.d.ts +3 -0
  201. package/schematics/component-migration/alert/steps/static-classes.js +97 -0
  202. package/schematics/component-migration/alert/steps/static-type.d.ts +3 -0
  203. package/schematics/component-migration/alert/steps/static-type.js +28 -0
  204. package/schematics/component-migration/alert/steps/template-reference.d.ts +3 -0
  205. package/schematics/component-migration/alert/steps/template-reference.js +15 -0
  206. package/schematics/component-migration/alert/steps/template-todos.d.ts +3 -0
  207. package/schematics/component-migration/alert/steps/template-todos.js +78 -0
  208. package/schematics/component-migration/button/guide.md +278 -0
  209. package/schematics/component-migration/button/index.d.ts +2 -0
  210. package/schematics/component-migration/button/index.js +5 -0
  211. package/schematics/component-migration/button/migration.d.ts +2 -0
  212. package/schematics/component-migration/button/migration.js +180 -0
  213. package/schematics/component-migration/button/schema.json +25 -0
  214. package/schematics/component-migration/button/steps/static-classes.d.ts +10 -0
  215. package/schematics/component-migration/button/steps/static-classes.js +128 -0
  216. package/schematics/component-migration/button/steps/template-todos.d.ts +19 -0
  217. package/schematics/component-migration/button/steps/template-todos.js +120 -0
  218. package/schematics/component-migration/button/types.d.ts +7 -0
  219. package/schematics/component-migration/button/types.js +2 -0
  220. package/schematics/component-migration/dropdown/guide.md +252 -0
  221. package/schematics/component-migration/dropdown/index.d.ts +2 -0
  222. package/schematics/component-migration/dropdown/index.js +5 -0
  223. package/schematics/component-migration/dropdown/migration.d.ts +2 -0
  224. package/schematics/component-migration/dropdown/migration.js +41 -0
  225. package/schematics/component-migration/dropdown/schema.json +25 -0
  226. package/schematics/component-migration/dropdown/steps/dropdown-imports.d.ts +3 -0
  227. package/schematics/component-migration/dropdown/steps/dropdown-imports.js +308 -0
  228. package/schematics/component-migration/dropdown/steps/template-attributes.d.ts +10 -0
  229. package/schematics/component-migration/dropdown/steps/template-attributes.js +57 -0
  230. package/schematics/component-migration/dropdown/steps/template-helpers.d.ts +20 -0
  231. package/schematics/component-migration/dropdown/steps/template-helpers.js +125 -0
  232. package/schematics/component-migration/dropdown/steps/template-imports.d.ts +22 -0
  233. package/schematics/component-migration/dropdown/steps/template-imports.js +12 -0
  234. package/schematics/component-migration/dropdown/steps/template-items.d.ts +7 -0
  235. package/schematics/component-migration/dropdown/steps/template-items.js +58 -0
  236. package/schematics/component-migration/dropdown/steps/template-menu.d.ts +14 -0
  237. package/schematics/component-migration/dropdown/steps/template-menu.js +107 -0
  238. package/schematics/component-migration/dropdown/steps/template-todos.d.ts +19 -0
  239. package/schematics/component-migration/dropdown/steps/template-todos.js +118 -0
  240. package/schematics/component-migration/dropdown/steps/template-toggle.d.ts +9 -0
  241. package/schematics/component-migration/dropdown/steps/template-toggle.js +70 -0
  242. package/schematics/component-migration/dropdown/steps/template-wrapper.d.ts +12 -0
  243. package/schematics/component-migration/dropdown/steps/template-wrapper.js +105 -0
  244. package/schematics/component-migration/index.d.ts +3 -0
  245. package/schematics/component-migration/index.js +26 -0
  246. package/schematics/component-migration/next-steps/index.d.ts +13 -0
  247. package/schematics/component-migration/next-steps/index.js +34 -0
  248. package/schematics/component-migration/registry.d.ts +1 -0
  249. package/schematics/component-migration/registry.js +15 -0
  250. package/schematics/component-migration/schema.json +20 -0
  251. package/schematics/component-migration/shared/ai-handoff.d.ts +2 -0
  252. package/schematics/component-migration/shared/ai-handoff.js +28 -0
  253. package/schematics/component-migration/shared/angular-component.d.ts +10 -0
  254. package/schematics/component-migration/shared/angular-component.js +125 -0
  255. package/schematics/component-migration/shared/button-visual-classes.d.ts +24 -0
  256. package/schematics/component-migration/shared/button-visual-classes.js +111 -0
  257. package/schematics/component-migration/shared/component-context.d.ts +7 -0
  258. package/schematics/component-migration/shared/component-context.js +24 -0
  259. package/schematics/component-migration/shared/component-imports.d.ts +45 -0
  260. package/schematics/component-migration/shared/component-imports.js +380 -0
  261. package/schematics/component-migration/shared/create-component-schematic.d.ts +3 -0
  262. package/schematics/component-migration/shared/create-component-schematic.js +55 -0
  263. package/schematics/component-migration/shared/import-edits.d.ts +11 -0
  264. package/schematics/component-migration/shared/import-edits.js +157 -0
  265. package/schematics/component-migration/shared/legacy-config-todos.d.ts +3 -0
  266. package/schematics/component-migration/shared/legacy-config-todos.js +90 -0
  267. package/schematics/component-migration/shared/migrate-project.d.ts +12 -0
  268. package/schematics/component-migration/shared/migrate-project.js +151 -0
  269. package/schematics/component-migration/shared/project-templates.d.ts +15 -0
  270. package/schematics/component-migration/shared/project-templates.js +43 -0
  271. package/schematics/component-migration/shared/scan-project.d.ts +3 -0
  272. package/schematics/component-migration/shared/scan-project.js +24 -0
  273. package/schematics/component-migration/shared/static-placement.d.ts +1 -0
  274. package/schematics/component-migration/shared/static-placement.js +45 -0
  275. package/schematics/component-migration/shared/template-edits.d.ts +28 -0
  276. package/schematics/component-migration/shared/template-edits.js +153 -0
  277. package/schematics/component-migration/shared/template-result.d.ts +3 -0
  278. package/schematics/component-migration/shared/template-result.js +11 -0
  279. package/schematics/component-migration/shared/testing.d.ts +13 -0
  280. package/schematics/component-migration/shared/testing.js +59 -0
  281. package/schematics/component-migration/shared/todo-comments.d.ts +10 -0
  282. package/schematics/component-migration/shared/todo-comments.js +81 -0
  283. package/schematics/component-migration/shared/types.d.ts +41 -0
  284. package/schematics/component-migration/shared/types.js +2 -0
  285. package/schematics/component-migration/tooltip/guide.md +196 -0
  286. package/schematics/component-migration/tooltip/index.d.ts +2 -0
  287. package/schematics/component-migration/tooltip/index.js +5 -0
  288. package/schematics/component-migration/tooltip/migration.d.ts +2 -0
  289. package/schematics/component-migration/tooltip/migration.js +50 -0
  290. package/schematics/component-migration/tooltip/schema.json +25 -0
  291. package/schematics/component-migration/tooltip/steps/template-attributes.d.ts +13 -0
  292. package/schematics/component-migration/tooltip/steps/template-attributes.js +266 -0
  293. package/schematics/component-migration/tooltip/steps/template-todos.d.ts +24 -0
  294. package/schematics/component-migration/tooltip/steps/template-todos.js +115 -0
  295. package/schematics/component-migration/tooltip/steps/tooltip-imports.d.ts +3 -0
  296. package/schematics/component-migration/tooltip/steps/tooltip-imports.js +79 -0
  297. package/schematics/component-migration/utils/component-resource-collector.d.ts +34 -0
  298. package/schematics/component-migration/utils/component-resource-collector.js +107 -0
  299. package/schematics/component-migration/utils/project_tsconfig_paths.d.ts +18 -0
  300. package/schematics/component-migration/utils/project_tsconfig_paths.js +105 -0
  301. package/schematics/component-migration/utils/typescript/compiler_host.d.ts +44 -0
  302. package/schematics/component-migration/utils/typescript/compiler_host.js +87 -0
  303. package/schematics/component-migration/utils/typescript/decorators.d.ts +22 -0
  304. package/schematics/component-migration/utils/typescript/decorators.js +41 -0
  305. package/schematics/component-migration/utils/typescript/functions.d.ts +14 -0
  306. package/schematics/component-migration/utils/typescript/functions.js +20 -0
  307. package/schematics/component-migration/utils/typescript/imports.d.ts +17 -0
  308. package/schematics/component-migration/utils/typescript/imports.js +110 -0
  309. package/schematics/component-migration/utils/typescript/parse_tsconfig.d.ts +9 -0
  310. package/schematics/component-migration/utils/typescript/parse_tsconfig.js +29 -0
  311. package/schematics/component-migration/utils/typescript/property-name.d.ts +13 -0
  312. package/schematics/component-migration/utils/typescript/property-name.js +22 -0
  313. package/schematics/package.json +3 -0
  314. package/types/design-factory-angular-accordion.d.ts +553 -0
  315. package/types/design-factory-angular-alert.d.ts +166 -0
  316. package/types/design-factory-angular-breakpoints.d.ts +13 -0
  317. package/types/design-factory-angular-button.d.ts +166 -0
  318. package/types/design-factory-angular-buttongroup.d.ts +45 -0
  319. package/types/design-factory-angular-drawer.d.ts +10 -16
  320. package/types/design-factory-angular-dropdown.d.ts +148 -0
  321. package/types/design-factory-angular-form-field.d.ts +122 -0
  322. package/types/design-factory-angular-icon.d.ts +11 -0
  323. package/types/design-factory-angular-input.d.ts +16 -0
  324. package/types/design-factory-angular-internals.d.ts +78 -19
  325. package/types/design-factory-angular-separator.d.ts +29 -0
  326. package/types/design-factory-angular-sidenav.d.ts +98 -14
  327. package/types/design-factory-angular-slider.d.ts +239 -0
  328. package/types/design-factory-angular-toggle.d.ts +93 -0
  329. package/types/design-factory-angular-tooltip.d.ts +113 -0
  330. package/types/design-factory-angular-topnav.d.ts +35 -47
  331. package/drawer/README.md +0 -54
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setupComponentMigrationTest = setupComponentMigrationTest;
4
+ exports.cleanupComponentMigrationTest = cleanupComponentMigrationTest;
5
+ exports.expectTestCaseOutputFile = expectTestCaseOutputFile;
6
+ exports.expectSchematicIdempotent = expectSchematicIdempotent;
7
+ const tslib_1 = require("tslib");
8
+ const core_1 = require("@angular-devkit/core");
9
+ const testing_1 = require("@angular-devkit/core/node/testing");
10
+ const schematics_1 = require("@angular-devkit/schematics");
11
+ const testing_2 = require("@angular-devkit/schematics/testing");
12
+ const fs_1 = require("fs");
13
+ const node_assert_1 = tslib_1.__importDefault(require("node:assert"));
14
+ const path_1 = require("path");
15
+ const commonTestCaseRoot = (0, path_1.join)(__dirname, 'test-cases', 'common');
16
+ function toTreePath(filePath) {
17
+ return `/${filePath.split(path_1.sep).join('/')}`;
18
+ }
19
+ function writeFixtureDirectory(host, sourceDir, rootDir = sourceDir) {
20
+ for (const entry of (0, fs_1.readdirSync)(sourceDir)) {
21
+ const entryPath = (0, path_1.join)(sourceDir, entry);
22
+ if ((0, fs_1.statSync)(entryPath).isDirectory()) {
23
+ writeFixtureDirectory(host, entryPath, rootDir);
24
+ continue;
25
+ }
26
+ const treePath = toTreePath((0, path_1.relative)(rootDir, entryPath));
27
+ host.sync.write((0, core_1.normalize)(treePath), core_1.virtualFs.stringToFileBuffer((0, fs_1.readFileSync)(entryPath, 'utf-8')));
28
+ }
29
+ }
30
+ function setupComponentMigrationTest(runner, testCaseRoot) {
31
+ const host = new testing_1.TempScopedNodeJsSyncHost();
32
+ const tree = new testing_2.UnitTestTree(new schematics_1.HostTree(host));
33
+ const logs = [];
34
+ runner.logger.subscribe((entry) => logs.push(entry.message));
35
+ writeFixtureDirectory(host, commonTestCaseRoot);
36
+ writeFixtureDirectory(host, (0, path_1.join)(testCaseRoot, 'test-cases', 'input'));
37
+ const previousWorkingDir = process.cwd();
38
+ const tmpDirPath = (0, core_1.getSystemPath)(host.root);
39
+ process.chdir(tmpDirPath);
40
+ return { host, tree, tmpDirPath, previousWorkingDir, logs };
41
+ }
42
+ function cleanupComponentMigrationTest(context) {
43
+ process.chdir(context.previousWorkingDir);
44
+ (0, fs_1.rmSync)(context.tmpDirPath, { recursive: true, force: true });
45
+ }
46
+ function expectTestCaseOutputFile(tree, testCaseRoot, filePath) {
47
+ const outputDir = (0, path_1.join)(testCaseRoot, 'test-cases', 'output');
48
+ const treePath = toTreePath(filePath);
49
+ node_assert_1.default.equal(tree.readContent(treePath), (0, fs_1.readFileSync)((0, path_1.join)(outputDir, filePath), 'utf-8'), treePath);
50
+ }
51
+ function getTreeSnapshot(tree) {
52
+ return new Map(tree.files.sort().map((filePath) => [filePath, tree.readContent(filePath)]));
53
+ }
54
+ async function expectSchematicIdempotent(runner, schematicName, context) {
55
+ await runner.runSchematic(schematicName, { project: 'app' }, context.tree);
56
+ const once = getTreeSnapshot(context.tree);
57
+ await runner.runSchematic(schematicName, { project: 'app' }, context.tree);
58
+ node_assert_1.default.deepEqual(getTreeSnapshot(context.tree), once);
59
+ }
@@ -0,0 +1,10 @@
1
+ import { TmplAstElement } from '@angular/compiler';
2
+ import * as ts from 'typescript';
3
+ import { TemplateEdit } from './template-edits';
4
+ export interface MigrationTodo {
5
+ code: string;
6
+ message: string;
7
+ marker?: 'human';
8
+ }
9
+ export declare function editTemplateTodos(element: TmplAstElement, todos: MigrationTodo[], edits: TemplateEdit[]): void;
10
+ export declare function editSourceTodo(sourceFile: ts.SourceFile, node: ts.Node, todo: MigrationTodo): TemplateEdit | null;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.editTemplateTodos = editTemplateTodos;
4
+ exports.editSourceTodo = editSourceTodo;
5
+ const tslib_1 = require("tslib");
6
+ const ts = tslib_1.__importStar(require("typescript"));
7
+ function getLineStart(content, offset) {
8
+ return content.lastIndexOf('\n', offset - 1) + 1;
9
+ }
10
+ function getLineIndent(content, lineStart, offset) {
11
+ const prefix = content.slice(lineStart, offset);
12
+ return /^\s*$/.test(prefix) ? prefix : '';
13
+ }
14
+ function hasNearbyTodo(content, offset, code) {
15
+ return getLeadingTodoBlock(content, offset).includes(`TODO(df-migration ${code})`);
16
+ }
17
+ function hasSourceHeaderTodo(sourceFile, code) {
18
+ const firstNonImportStatement = sourceFile.statements.find((statement) => !ts.isImportDeclaration(statement));
19
+ const headerEnd = firstNonImportStatement?.getFullStart() ?? sourceFile.text.length;
20
+ return sourceFile.text.slice(0, headerEnd).includes(`TODO(df-migration ${code})`);
21
+ }
22
+ function isSourceHeaderTodoTarget(sourceFile, node) {
23
+ return node === sourceFile || ts.isImportDeclaration(node);
24
+ }
25
+ function getLeadingTodoBlock(content, offset) {
26
+ const lines = content.slice(0, offset).split('\n');
27
+ const block = [];
28
+ for (let index = lines.length - 1; index >= 0; index--) {
29
+ const line = lines[index];
30
+ if (/^\s*$/.test(line)) {
31
+ continue;
32
+ }
33
+ if (/^\s*(?:<!--\s*)?TODO\(df-migration [^)]+\):/.test(line)) {
34
+ block.unshift(line);
35
+ continue;
36
+ }
37
+ if (/^\s*\/\/\s*TODO\(df-migration [^)]+\):/.test(line)) {
38
+ block.unshift(line);
39
+ continue;
40
+ }
41
+ break;
42
+ }
43
+ return block.join('\n');
44
+ }
45
+ function editTemplateTodos(element, todos, edits) {
46
+ const content = element.sourceSpan.start.file.content;
47
+ const offset = element.sourceSpan.start.offset;
48
+ const lineStart = getLineStart(content, offset);
49
+ const indentation = getLineIndent(content, lineStart, offset);
50
+ const newTodos = todos.filter((todo) => !hasNearbyTodo(content, offset, todo.code));
51
+ if (newTodos.length === 0) {
52
+ return;
53
+ }
54
+ const isTemplateStart = lineStart === 0 && offset === 0;
55
+ edits.push({
56
+ start: lineStart,
57
+ end: lineStart,
58
+ text: newTodos
59
+ .map((todo) => `${isTemplateStart ? '' : indentation}<!-- TODO(df-migration ${todo.code}): ${formatTodoMessage(todo)} -->\n`)
60
+ .join('') + (isTemplateStart ? ' ' : '')
61
+ });
62
+ }
63
+ function formatTodoMessage(todo) {
64
+ return `${todo.marker ? `[${todo.marker}] ` : ''}${todo.message}`;
65
+ }
66
+ function editSourceTodo(sourceFile, node, todo) {
67
+ const content = sourceFile.text;
68
+ const offset = node.getStart(sourceFile);
69
+ const lineStart = getLineStart(content, offset);
70
+ if (isSourceHeaderTodoTarget(sourceFile, node) && hasSourceHeaderTodo(sourceFile, todo.code)) {
71
+ return null;
72
+ }
73
+ if (hasNearbyTodo(content, offset, todo.code)) {
74
+ return null;
75
+ }
76
+ return {
77
+ start: lineStart,
78
+ end: lineStart,
79
+ text: `${getLineIndent(content, lineStart, offset)}// TODO(df-migration ${todo.code}): ${formatTodoMessage(todo)}\n`
80
+ };
81
+ }
@@ -0,0 +1,41 @@
1
+ import * as ts from 'typescript';
2
+ import { TemplateEdit } from './template-edits';
3
+ export interface ComponentMigrationTemplateResult {
4
+ content: string;
5
+ changes: number;
6
+ standaloneImports?: StandaloneImportRequirement[];
7
+ }
8
+ export interface ComponentMigrationRunContext {
9
+ processedSourceFiles: Set<string>;
10
+ processedTemplateFiles: Set<string>;
11
+ migratedExternalTemplates: Map<string, ComponentMigrationTemplateResult>;
12
+ changedFiles: Set<string>;
13
+ }
14
+ export interface StandaloneImportRequirement {
15
+ moduleName: string;
16
+ symbolName: string;
17
+ }
18
+ export interface ComponentMigrationSourceContext {
19
+ sourceFile: ts.SourceFile;
20
+ typeChecker: ts.TypeChecker;
21
+ templatesByComponent: Map<ts.ClassDeclaration, string[]>;
22
+ projectTemplatesByComponent: Map<ts.ClassDeclaration, string[]>;
23
+ standaloneImportsByComponent: Map<ts.ClassDeclaration, StandaloneImportRequirement[]>;
24
+ projectStandaloneImportsByComponent: Map<ts.ClassDeclaration, StandaloneImportRequirement[]>;
25
+ }
26
+ export interface ComponentMigrationDefinition {
27
+ id: string;
28
+ countLegacyTemplateUsages: (template: string) => number;
29
+ migrateTemplate?: (template: string) => ComponentMigrationTemplateResult;
30
+ migrateSourceFile?: (context: ComponentMigrationSourceContext) => TemplateEdit[];
31
+ migrateProjectSourceFile?: (context: ComponentMigrationSourceContext) => TemplateEdit[];
32
+ }
33
+ export interface ComponentMigrationScanResult {
34
+ migration: ComponentMigrationDefinition;
35
+ legacyUsages: number;
36
+ }
37
+ export interface ComponentMigrationSchema {
38
+ project?: string;
39
+ all?: boolean;
40
+ scan?: boolean;
41
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,196 @@
1
+ # Tooltip Migration Guide
2
+
3
+ This guide is used by AI-assisted migration after the deterministic `migrate-tooltip` schematic has run.
4
+
5
+ Use it together with the user's current working tree and current git diff. The diff shows which safe changes were made
6
+ by the schematic and which `TODO(df-migration ...)` comments still need review.
7
+
8
+ ## Legacy API
9
+
10
+ Legacy tooltips are based on `NgbTooltip` / `NgbTooltipModule` from `@ng-bootstrap/ng-bootstrap/tooltip` or
11
+ `@ng-bootstrap/ng-bootstrap`, often exposed through legacy Design Factory helpers:
12
+
13
+ - `DfTooltipModule`
14
+ - `DfTooltipTruncateDirective`
15
+ - `dfTooltipTruncate`
16
+ - `NgbTooltipConfig`
17
+ - `ngbTooltip`
18
+ - `placement`
19
+ - `tooltipClass`
20
+ - `disableTooltip`
21
+ - `triggers`
22
+ - `autoClose`
23
+ - `container`
24
+ - `#tooltip="ngbTooltip"`
25
+
26
+ Legacy tooltip content can be plain text, a dynamic expression, or an `ng-template`.
27
+
28
+ ## New API
29
+
30
+ New tooltips use the standalone `DfTooltip` directive from `@design-factory/angular/tooltip`:
31
+
32
+ ```ts
33
+ import { DfTooltip, provideDfTooltipConfig } from '@design-factory/angular/tooltip';
34
+ ```
35
+
36
+ Common template forms:
37
+
38
+ ```html
39
+ <button dfTooltip="Short helpful text">Button</button>
40
+ <button [dfTooltip]="tooltipText" dfTooltipPlacement="vertical" dfTooltipSize="sm">Button</button>
41
+ <button dfTooltip="Disabled reason" [dfTooltipDisabled]="enabled">Button</button>
42
+ ```
43
+
44
+ Supported placement values include `top`, `bottom`, `start`, `end`, aligned variants such as `top-start`, and the
45
+ `auto`, `vertical`, and `horizontal` shortcuts. Supported sizes are `sm`, `md`, and `lg`.
46
+
47
+ ## Deterministic Schematic Changes
48
+
49
+ The schematic handles these changes when syntax is local and unambiguous:
50
+
51
+ - `ngbTooltip` -> `dfTooltip` for static plain text, interpolated text, and bound content expressions
52
+ - `i18n-ngbTooltip` -> `i18n-dfTooltip` when the tooltip content is migrated
53
+ - `placement` -> `dfTooltipPlacement`
54
+ - static `left` / `right` placements -> `start` / `end`
55
+ - static `auto` placements are preserved, for example `top auto` -> `top auto`
56
+ - `tooltipClass="tooltip-inner-sm"` -> `dfTooltipSize="sm"`
57
+ - `tooltipClass="tooltip-inner-lg"` -> `dfTooltipSize="lg"`
58
+ - unsupported static or dynamic `tooltipClass` removal with a `[human]` TODO
59
+ - `dfTooltipTruncate` removal with a `[human]` TODO because the overflow-only behavior has no new API equivalent
60
+ - `disableTooltip` -> `dfTooltipDisabled`
61
+ - orphan `i18n-ngbTooltip` removal with a `[human]` TODO when no tooltip binding exists on the element
62
+ - custom `triggers` removal for migrated tooltips because the new tooltip has fixed trigger behavior
63
+ - standalone `DfTooltip` imports where needed
64
+ - direct standalone `NgbTooltip` imports replaced or removed when no legacy tooltip remains in that component scope
65
+ - unused `DfTooltipTruncateDirective` import cleanup
66
+ - legacy tooltip module imports such as `NgbTooltipModule` and `DfTooltipModule` are preserved with TODOs for
67
+ second-pass verification
68
+ - TODO comments for cases that need review or AI/manual migration
69
+
70
+ Do not repeat these changes unless the schematic missed a local occurrence.
71
+
72
+ ## TODO Codes
73
+
74
+ TODO comments may include `[human]`.
75
+
76
+ Verify every TODO and remove it only when the underlying issue is actually resolved. Preserve `[human]` TODO comments
77
+ unchanged so a human can review them after the AI-assisted pass. `[human]` does not forbid AI-assisted edits around the
78
+ comment when the intent is clear; it means the final result must remain visible for human verification.
79
+
80
+ ### `tooltip.review`
81
+
82
+ The tooltip was migrated automatically. Verify behavior and visual appearance.
83
+
84
+ Keep or remove this TODO based on review. If no behavior issue is found, remove it.
85
+
86
+ ### `tooltip.dynamic-content`
87
+
88
+ Dynamic tooltip content was moved to the new tooltip input without rewriting the expression.
89
+
90
+ Confirm the expression returns plain text. This includes pipes, function calls, ternaries, `async`, and object-literal
91
+ expressions passed to a pipe. `null` or `undefined` are valid when the tooltip should be hidden. If the expression can
92
+ return a `TemplateRef`, HTML structure, or interactive content, convert it manually to plain text or use a popover.
93
+
94
+ ### `tooltip.template-content`
95
+
96
+ Template-based tooltip content was not migrated.
97
+
98
+ New `DfTooltip` supports text content only. Convert simple templates to string content when the rendered text is clear.
99
+ Use popover for rich markup or interactive content. Keep the `[human]` TODO when the conversion needs human
100
+ verification.
101
+
102
+ ### `tooltip.custom-class`
103
+
104
+ The legacy `tooltipClass` attribute/input is not supported by the new tooltip API.
105
+
106
+ Known static size classes are migrated automatically when the tooltip itself is migrated. Other static or dynamic
107
+ `tooltipClass` bindings are removed by the deterministic migration. Inspect the old styling intent and replace it with
108
+ supported tooltip inputs or local design changes.
109
+
110
+ ### `tooltip.custom-triggers`
111
+
112
+ Custom tooltip triggers are not supported by the new tooltip API. The deterministic migration removes trigger attributes
113
+ from migrated tooltips.
114
+
115
+ The new tooltip opens on hover, keyboard focus, and long press. Verify whether the old custom trigger behavior still
116
+ matters. Click or manual trigger behavior may need a popover or custom interaction. If the old trigger behavior is no
117
+ longer needed after inspecting usage, update the code and keep the `[human]` TODO for review.
118
+
119
+ ### `tooltip.manual-trigger`
120
+
121
+ Manual tooltip trigger control was not migrated.
122
+
123
+ Replace programmatic `open()`, `close()`, `toggle()`, and `isOpen()` flows when the intent is clear and the new behavior
124
+ can be represented safely. Use popover or custom interaction if manual control is still required. Keep the `[human]`
125
+ TODO when human verification is needed.
126
+
127
+ ### `tooltip.auto-close`
128
+
129
+ Legacy click `autoClose` behavior was not migrated.
130
+
131
+ This usually belongs with old click-trigger tooltips. Prefer popover or custom interaction if click persistence is
132
+ still required.
133
+
134
+ ### `tooltip.truncate`
135
+
136
+ `dfTooltipTruncate` depends on the legacy `NgbTooltip` directive and is removed by the deterministic migration.
137
+
138
+ Rebuild the behavior if the tooltip should only appear when text overflows. If always-on tooltip behavior is acceptable
139
+ or the overflow-only behavior is no longer needed, update the code and keep the `[human]` TODO for review.
140
+
141
+ ### `tooltip.template-reference`
142
+
143
+ Template references such as `#tooltip="ngbTooltip"` were not migrated.
144
+
145
+ The new tooltip has no equivalent export or programmatic API. The deterministic migration may still remove independent
146
+ legacy attributes such as `tooltipClass` or `dfTooltipTruncate` on the same element.
147
+
148
+ ### `tooltip.dynamic-placement`
149
+
150
+ Dynamic placement was migrated to `dfTooltipPlacement`.
151
+
152
+ Verify the expression only returns supported new placement values. Convert old `left` / `right` values to `start` /
153
+ `end`. Keep `auto`, `vertical`, and `horizontal` values when they are intentional.
154
+
155
+ ### `tooltip.orphan-i18n`
156
+
157
+ An `i18n-ngbTooltip` marker existed without `ngbTooltip` or `[ngbTooltip]` on the same element.
158
+
159
+ The deterministic migration removes the orphan i18n marker and leaves a `[human]` TODO. Verify whether a tooltip was
160
+ intended on that element.
161
+
162
+ ### `tooltip.legacy-import`
163
+
164
+ A legacy tooltip import remains after the deterministic migration.
165
+
166
+ The deterministic migration intentionally keeps legacy tooltip modules such as `NgbTooltipModule` and `DfTooltipModule`
167
+ so the AI-assisted or manual pass can verify whether shared module imports are still needed. Remove direct `NgbTooltip`
168
+ imports only after no legacy tooltip usages remain.
169
+
170
+ `DfTooltipTruncateDirective` is different: it should be removed when `dfTooltipTruncate` has been removed.
171
+
172
+ ### `tooltip.indirect-component-imports`
173
+
174
+ The component needs `DfTooltip`, but its Angular `imports` metadata is not a simple array literal.
175
+
176
+ Inspect the referenced value or expression. Add `DfTooltip` to the actual imports list only when the shape is clear. If
177
+ the imports value is computed, shared, or otherwise ambiguous, preserve the TODO for human review.
178
+
179
+ ## Configuration Migration
180
+
181
+ Legacy `NgbTooltipConfig` is not supported anymore and is marked with `TODO(df-migration tooltip.config)` for human
182
+ review.
183
+
184
+ Do not migrate it automatically. Review the legacy defaults and decide whether they should become local tooltip inputs,
185
+ new `provideDfTooltipConfig()` usage, or application-specific cleanup.
186
+
187
+ ## Validation
188
+
189
+ After AI-assisted tooltip migration:
190
+
191
+ 1. Confirm no unexpected `ngbTooltip`, `NgbTooltip`, `DfTooltipModule`, `NgbTooltipModule`, or `dfTooltipTruncate`
192
+ usages remain in app code.
193
+ 2. Confirm dynamic `dfTooltip` values are plain text.
194
+ 3. Confirm dynamic `dfTooltipPlacement` values use supported new placements.
195
+ 4. Run the narrowest useful typecheck/build command for touched projects when the command is clear.
196
+ 5. Run visual or e2e checks for dynamic content, truncation, custom trigger, and custom class cases when available.
@@ -0,0 +1,2 @@
1
+ declare const _default: (options: import("../shared/types").ComponentMigrationSchema) => import("@angular-devkit/schematics").Rule;
2
+ export default _default;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const create_component_schematic_1 = require("../shared/create-component-schematic");
4
+ const migration_1 = require("./migration");
5
+ exports.default = (0, create_component_schematic_1.createComponentMigrationSchematic)(migration_1.tooltipMigration);
@@ -0,0 +1,2 @@
1
+ import { ComponentMigrationDefinition } from '../shared/types';
2
+ export declare const tooltipMigration: ComponentMigrationDefinition;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tooltipMigration = void 0;
4
+ const template_result_1 = require("../shared/template-result");
5
+ const template_edits_1 = require("../shared/template-edits");
6
+ const template_attributes_1 = require("./steps/template-attributes");
7
+ const template_todos_1 = require("./steps/template-todos");
8
+ const tooltip_imports_1 = require("./steps/tooltip-imports");
9
+ const legacy_config_todos_1 = require("../shared/legacy-config-todos");
10
+ const TOOLTIP_IMPORT = {
11
+ moduleName: '@design-factory/angular/tooltip',
12
+ symbolName: 'DfTooltip'
13
+ };
14
+ function getTooltipElements(template) {
15
+ return (0, template_edits_1.findTemplateElements)(template, (element) => element.attributes.some((attribute) => attribute.name === 'ngbTooltip') ||
16
+ (0, template_attributes_1.hasTooltipI18nAttribute)(element) ||
17
+ element.inputs.some((input) => input.name === 'ngbTooltip'));
18
+ }
19
+ function getTemplateReferenceNames(template) {
20
+ const names = new Set();
21
+ const templateRefPattern = /<ng-template\b[^>]*#([A-Za-z_$][\w$-]*)/g;
22
+ let match = templateRefPattern.exec(template);
23
+ while (match) {
24
+ names.add(match[1]);
25
+ match = templateRefPattern.exec(template);
26
+ }
27
+ return names;
28
+ }
29
+ function migrateTooltipTemplate(template) {
30
+ const edits = [];
31
+ const standaloneImports = [];
32
+ for (const element of getTooltipElements(template)) {
33
+ const result = (0, template_attributes_1.editTooltipElement)(element, { templateReferenceNames: getTemplateReferenceNames(template) }, edits);
34
+ (0, template_todos_1.editTooltipTemplateTodos)(element, edits, { ...result.todos, migrated: result.migrated });
35
+ if (result.migrated && standaloneImports.length === 0) {
36
+ standaloneImports.push(TOOLTIP_IMPORT);
37
+ }
38
+ }
39
+ return (0, template_result_1.createTemplateMigrationResult)(template, edits, standaloneImports);
40
+ }
41
+ function migrateTooltipSourceFile(context) {
42
+ return (0, tooltip_imports_1.editTooltipImports)(context);
43
+ }
44
+ exports.tooltipMigration = {
45
+ id: 'tooltip',
46
+ countLegacyTemplateUsages: (template) => getTooltipElements(template).length,
47
+ migrateTemplate: migrateTooltipTemplate,
48
+ migrateSourceFile: migrateTooltipSourceFile,
49
+ migrateProjectSourceFile: (context) => (0, legacy_config_todos_1.editLegacyConfigTodos)(context, ['NgbTooltipConfig'])
50
+ };
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "SchematicsMigrateTooltip",
4
+ "title": "Migrate Tooltip Schema",
5
+ "type": "object",
6
+ "properties": {
7
+ "project": {
8
+ "type": "string",
9
+ "description": "Name of the Angular project to scan or migrate",
10
+ "$default": {
11
+ "$source": "projectName"
12
+ }
13
+ },
14
+ "all": {
15
+ "type": "boolean",
16
+ "description": "Scan or migrate every buildable Angular project",
17
+ "default": false
18
+ },
19
+ "scan": {
20
+ "type": "boolean",
21
+ "description": "Only scan tooltip usages without applying the migration",
22
+ "default": false
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,13 @@
1
+ import { TmplAstElement } from '@angular/compiler';
2
+ import { TemplateEdit } from '../../shared/template-edits';
3
+ import { TooltipTemplateTodoContext } from './template-todos';
4
+ interface TooltipTemplateContext {
5
+ templateReferenceNames: Set<string>;
6
+ }
7
+ interface TooltipTemplateEditResult {
8
+ migrated: boolean;
9
+ todos: TooltipTemplateTodoContext;
10
+ }
11
+ export declare function hasTooltipI18nAttribute(element: TmplAstElement): boolean;
12
+ export declare function editTooltipElement(element: TmplAstElement, context: TooltipTemplateContext, edits: TemplateEdit[]): TooltipTemplateEditResult;
13
+ export {};