@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.
- package/.ai/docs/components/accordion/accessibility.md +45 -0
- package/.ai/docs/components/accordion/api.md +279 -0
- package/.ai/docs/components/accordion/developer.md +43 -0
- package/.ai/docs/components/accordion/guidelines.md +99 -0
- package/.ai/docs/components/accordion/overview.md +17 -0
- package/.ai/docs/components/alert/accessibility.md +24 -0
- package/.ai/docs/components/alert/api.md +65 -0
- package/.ai/docs/components/alert/developer.md +63 -0
- package/.ai/docs/components/alert/guidelines.md +62 -0
- package/.ai/docs/components/alert/overview.md +12 -0
- package/.ai/docs/components/button/accessibility.md +25 -0
- package/.ai/docs/components/button/api.md +71 -0
- package/.ai/docs/components/button/developer.md +52 -0
- package/.ai/docs/components/button/guidelines.md +75 -0
- package/.ai/docs/components/button/overview.md +15 -0
- package/.ai/docs/components/buttongroup/api.md +16 -0
- package/.ai/docs/components/buttongroup/developer.md +32 -0
- package/.ai/docs/components/drawer/accessibility.md +15 -0
- package/.ai/docs/components/drawer/api.md +56 -0
- package/.ai/docs/components/drawer/developer.md +36 -0
- package/.ai/docs/components/drawer/examples.md +9 -0
- package/.ai/docs/components/drawer/guidelines.md +58 -0
- package/.ai/docs/components/drawer/overview.md +19 -0
- package/.ai/docs/components/dropdown/accessibility.md +27 -0
- package/.ai/docs/components/dropdown/api.md +85 -0
- package/.ai/docs/components/dropdown/developer.md +59 -0
- package/.ai/docs/components/dropdown/guidelines.md +80 -0
- package/.ai/docs/components/dropdown/overview.md +16 -0
- package/.ai/docs/components/sidenav/accessibility.md +48 -0
- package/.ai/docs/components/sidenav/api.md +110 -0
- package/.ai/docs/components/sidenav/developer.md +14 -0
- package/.ai/docs/components/sidenav/guidelines.md +83 -0
- package/.ai/docs/components/sidenav/overview.md +16 -0
- package/.ai/docs/components/tooltip/accessibility.md +11 -0
- package/.ai/docs/components/tooltip/api.md +39 -0
- package/.ai/docs/components/tooltip/developer.md +16 -0
- package/.ai/docs/components/tooltip/guidelines.md +84 -0
- package/.ai/docs/components/tooltip/overview.md +23 -0
- package/.ai/docs/components/topnav/accessibility.md +51 -0
- package/.ai/docs/components/topnav/api.md +190 -0
- package/.ai/docs/components/topnav/developer.md +43 -0
- package/.ai/docs/components/topnav/guidelines.md +121 -0
- package/.ai/docs/components/topnav/overview.md +17 -0
- package/.ai/docs/demos/accordion/addons-subtitle/accordion-addons-subtitle.html +75 -0
- package/.ai/docs/demos/accordion/addons-subtitle/accordion-addons-subtitle.ts +27 -0
- package/.ai/docs/demos/accordion/basic/accordion-basic.html +16 -0
- package/.ai/docs/demos/accordion/basic/accordion-basic.ts +14 -0
- package/.ai/docs/demos/accordion/close-others/accordion-close-others.html +16 -0
- package/.ai/docs/demos/accordion/close-others/accordion-close-others.ts +14 -0
- package/.ai/docs/demos/accordion/interactive/accordion-interactive.html +84 -0
- package/.ai/docs/demos/accordion/interactive/accordion-interactive.ts +30 -0
- package/.ai/docs/demos/accordion/interactive-addons-subtitle/accordion-interactive-addons-subtitle.html +126 -0
- package/.ai/docs/demos/accordion/interactive-addons-subtitle/accordion-interactive-addons-subtitle.ts +33 -0
- package/.ai/docs/demos/accordion/programmatic-control/accordion-programmatic-control.html +36 -0
- package/.ai/docs/demos/accordion/programmatic-control/accordion-programmatic-control.ts +15 -0
- package/.ai/docs/demos/accordion/selectable/accordion-selectable.html +16 -0
- package/.ai/docs/demos/accordion/selectable/accordion-selectable.ts +14 -0
- package/.ai/docs/demos/accordion/selectable-extended/accordion-selectable-extended.html +28 -0
- package/.ai/docs/demos/accordion/selectable-extended/accordion-selectable-extended.ts +80 -0
- package/.ai/docs/demos/accordion/separator/accordion-separator.html +16 -0
- package/.ai/docs/demos/accordion/separator/accordion-separator.ts +14 -0
- package/.ai/docs/demos/alert/banner/alert-banner.html +15 -0
- package/.ai/docs/demos/alert/banner/alert-banner.ts +16 -0
- package/.ai/docs/demos/alert/basic/alert-basic.html +6 -0
- package/.ai/docs/demos/alert/basic/alert-basic.ts +9 -0
- package/.ai/docs/demos/alert/card/alert-card.html +15 -0
- package/.ai/docs/demos/alert/card/alert-card.ts +9 -0
- package/.ai/docs/demos/alert/dismissal/alert-dismissal.html +5 -0
- package/.ai/docs/demos/alert/dismissal/alert-dismissal.ts +27 -0
- package/.ai/docs/demos/alert/expandable/alert-expandable.html +9 -0
- package/.ai/docs/demos/alert/expandable/alert-expandable.ts +11 -0
- package/.ai/docs/demos/button/basic/button-basic.html +4 -0
- package/.ai/docs/demos/button/basic/button-basic.ts +9 -0
- package/.ai/docs/demos/button/disabled/button-disabled.html +18 -0
- package/.ai/docs/demos/button/disabled/button-disabled.ts +12 -0
- package/.ai/docs/demos/button/icons/button-icons.html +17 -0
- package/.ai/docs/demos/button/icons/button-icons.ts +10 -0
- package/.ai/docs/demos/button/surfaces/button-surfaces.html +13 -0
- package/.ai/docs/demos/button/surfaces/button-surfaces.ts +9 -0
- package/.ai/docs/demos/button/variants/button-variants.html +49 -0
- package/.ai/docs/demos/button/variants/button-variants.ts +9 -0
- package/.ai/docs/demos/buttongroup/basic/buttongroup-basic.html +6 -0
- package/.ai/docs/demos/buttongroup/basic/buttongroup-basic.ts +10 -0
- package/.ai/docs/demos/buttongroup/disabled/buttongroup-disabled.html +6 -0
- package/.ai/docs/demos/buttongroup/disabled/buttongroup-disabled.ts +10 -0
- package/.ai/docs/demos/buttongroup/mirror/buttongroup-mirror.html +8 -0
- package/.ai/docs/demos/buttongroup/mirror/buttongroup-mirror.ts +10 -0
- package/.ai/docs/demos/buttongroup/orientation/buttongroup-orientation.html +19 -0
- package/.ai/docs/demos/buttongroup/orientation/buttongroup-orientation.ts +10 -0
- package/.ai/docs/demos/buttongroup/sizing/buttongroup-sizing.html +19 -0
- package/.ai/docs/demos/buttongroup/sizing/buttongroup-sizing.ts +10 -0
- package/.ai/docs/demos/drawer/inline/drawer-inline-basic.html +46 -0
- package/.ai/docs/demos/drawer/inline/drawer-inline-basic.ts +33 -0
- package/.ai/docs/demos/drawer/overlay/drawer-overlay-basic.html +30 -0
- package/.ai/docs/demos/drawer/overlay/drawer-overlay-basic.ts +25 -0
- package/.ai/docs/demos/dropdown/basic/dropdown-basic.html +8 -0
- package/.ai/docs/demos/dropdown/basic/dropdown-basic.ts +15 -0
- package/.ai/docs/demos/dropdown/sizes/dropdown-sizes.html +9 -0
- package/.ai/docs/demos/dropdown/sizes/dropdown-sizes.ts +21 -0
- package/.ai/docs/demos/dropdown/split/dropdown-split.html +9 -0
- package/.ai/docs/demos/dropdown/split/dropdown-split.ts +11 -0
- package/.ai/docs/demos/dropdown/toggle/dropdown-toggle.html +22 -0
- package/.ai/docs/demos/dropdown/toggle/dropdown-toggle.ts +10 -0
- package/.ai/docs/demos/sidenav/sidenav-basic-no-icon/routes.ts +95 -0
- package/.ai/docs/demos/sidenav/sidenav-basic-no-icon/sidenav-basic-no-icon.html +42 -0
- package/.ai/docs/demos/sidenav/sidenav-basic-no-icon/sidenav-basic-no-icon.ts +12 -0
- package/.ai/docs/demos/sidenav/sidenav-basic-with-icon/routes.ts +41 -0
- package/.ai/docs/demos/sidenav/sidenav-basic-with-icon/sidenav-basic-with-icon.html +34 -0
- package/.ai/docs/demos/sidenav/sidenav-basic-with-icon/sidenav-basic-with-icon.ts +12 -0
- package/.ai/docs/demos/tooltip/basic/tooltip-basic.html +1 -0
- package/.ai/docs/demos/tooltip/basic/tooltip-basic.ts +10 -0
- package/.ai/docs/demos/tooltip/placements/tooltip-placements.html +35 -0
- package/.ai/docs/demos/tooltip/placements/tooltip-placements.ts +12 -0
- package/.ai/docs/demos/tooltip/sizes/tooltip-sizes.html +5 -0
- package/.ai/docs/demos/tooltip/sizes/tooltip-sizes.ts +10 -0
- package/.ai/docs/demos/topnav/brand/topnav-brand.ts +64 -0
- package/.ai/docs/demos/topnav/environment-banner/topnav-environment-banner.ts +20 -0
- package/.ai/docs/demos/topnav/navigation/routes.ts +35 -0
- package/.ai/docs/demos/topnav/navigation/topnav-navigation-flat.ts +67 -0
- package/.ai/docs/demos/topnav/navigation/topnav-navigation-tree.ts +82 -0
- package/.ai/docs/demos/topnav/quick-actions/notifications.ts +75 -0
- package/.ai/docs/demos/topnav/quick-actions/topnav-quick-actions.ts +108 -0
- package/.ai/docs/demos/topnav/quick-actions/user-account.ts +23 -0
- package/.ai/index.md +26 -0
- package/fesm2022/design-factory-angular-accordion.mjs +1153 -0
- package/fesm2022/design-factory-angular-accordion.mjs.map +1 -0
- package/fesm2022/design-factory-angular-alert.mjs +312 -0
- package/fesm2022/design-factory-angular-alert.mjs.map +1 -0
- package/fesm2022/design-factory-angular-breakpoints.mjs +53 -0
- package/fesm2022/design-factory-angular-breakpoints.mjs.map +1 -0
- package/fesm2022/design-factory-angular-button.mjs +240 -0
- package/fesm2022/design-factory-angular-button.mjs.map +1 -0
- package/fesm2022/design-factory-angular-buttongroup.mjs +75 -0
- package/fesm2022/design-factory-angular-buttongroup.mjs.map +1 -0
- package/fesm2022/design-factory-angular-drawer.mjs +64 -62
- package/fesm2022/design-factory-angular-drawer.mjs.map +1 -1
- package/fesm2022/design-factory-angular-dropdown.mjs +323 -0
- package/fesm2022/design-factory-angular-dropdown.mjs.map +1 -0
- package/fesm2022/design-factory-angular-form-field.mjs +287 -0
- package/fesm2022/design-factory-angular-form-field.mjs.map +1 -0
- package/fesm2022/design-factory-angular-icon.mjs +24 -0
- package/fesm2022/design-factory-angular-icon.mjs.map +1 -0
- package/fesm2022/design-factory-angular-input.mjs +34 -0
- package/fesm2022/design-factory-angular-input.mjs.map +1 -0
- package/fesm2022/design-factory-angular-internals.mjs +119 -39
- package/fesm2022/design-factory-angular-internals.mjs.map +1 -1
- package/fesm2022/design-factory-angular-separator.mjs +43 -0
- package/fesm2022/design-factory-angular-separator.mjs.map +1 -0
- package/fesm2022/design-factory-angular-sidenav.mjs +652 -401
- package/fesm2022/design-factory-angular-sidenav.mjs.map +1 -1
- package/fesm2022/design-factory-angular-slider.mjs +451 -0
- package/fesm2022/design-factory-angular-slider.mjs.map +1 -0
- package/fesm2022/design-factory-angular-theme.mjs +29 -19
- package/fesm2022/design-factory-angular-theme.mjs.map +1 -1
- package/fesm2022/design-factory-angular-toggle.mjs +172 -0
- package/fesm2022/design-factory-angular-toggle.mjs.map +1 -0
- package/fesm2022/design-factory-angular-tooltip.mjs +138 -0
- package/fesm2022/design-factory-angular-tooltip.mjs.map +1 -0
- package/fesm2022/design-factory-angular-topnav.mjs +589 -589
- package/fesm2022/design-factory-angular-topnav.mjs.map +1 -1
- package/package.json +61 -8
- package/schematics/collection.json +35 -0
- package/schematics/component-migration/accordion/constants.d.ts +10 -0
- package/schematics/component-migration/accordion/constants.js +46 -0
- package/schematics/component-migration/accordion/guide.md +257 -0
- package/schematics/component-migration/accordion/index.d.ts +2 -0
- package/schematics/component-migration/accordion/index.js +5 -0
- package/schematics/component-migration/accordion/migration.d.ts +2 -0
- package/schematics/component-migration/accordion/migration.js +13 -0
- package/schematics/component-migration/accordion/schema.json +25 -0
- package/schematics/component-migration/accordion/steps/accordion-imports.d.ts +3 -0
- package/schematics/component-migration/accordion/steps/accordion-imports.js +41 -0
- package/schematics/component-migration/accordion/steps/template-migration.d.ts +3 -0
- package/schematics/component-migration/accordion/steps/template-migration.js +554 -0
- package/schematics/component-migration/accordion/steps/title-content.d.ts +9 -0
- package/schematics/component-migration/accordion/steps/title-content.js +75 -0
- package/schematics/component-migration/ai/prompt.md +83 -0
- package/schematics/component-migration/alert/guide.md +246 -0
- package/schematics/component-migration/alert/index.d.ts +2 -0
- package/schematics/component-migration/alert/index.js +5 -0
- package/schematics/component-migration/alert/migration.d.ts +2 -0
- package/schematics/component-migration/alert/migration.js +50 -0
- package/schematics/component-migration/alert/schema.json +25 -0
- package/schematics/component-migration/alert/steps/alert-imports.d.ts +4 -0
- package/schematics/component-migration/alert/steps/alert-imports.js +97 -0
- package/schematics/component-migration/alert/steps/animation-input.d.ts +3 -0
- package/schematics/component-migration/alert/steps/animation-input.js +17 -0
- package/schematics/component-migration/alert/steps/close-output.d.ts +3 -0
- package/schematics/component-migration/alert/steps/close-output.js +17 -0
- package/schematics/component-migration/alert/steps/icon-directive-imports.d.ts +3 -0
- package/schematics/component-migration/alert/steps/icon-directive-imports.js +84 -0
- package/schematics/component-migration/alert/steps/icon-directive.d.ts +3 -0
- package/schematics/component-migration/alert/steps/icon-directive.js +10 -0
- package/schematics/component-migration/alert/steps/legacy-module-imports.d.ts +3 -0
- package/schematics/component-migration/alert/steps/legacy-module-imports.js +57 -0
- package/schematics/component-migration/alert/steps/programmatic-close.d.ts +3 -0
- package/schematics/component-migration/alert/steps/programmatic-close.js +44 -0
- package/schematics/component-migration/alert/steps/selector.d.ts +3 -0
- package/schematics/component-migration/alert/steps/selector.js +18 -0
- package/schematics/component-migration/alert/steps/static-classes.d.ts +3 -0
- package/schematics/component-migration/alert/steps/static-classes.js +97 -0
- package/schematics/component-migration/alert/steps/static-type.d.ts +3 -0
- package/schematics/component-migration/alert/steps/static-type.js +28 -0
- package/schematics/component-migration/alert/steps/template-reference.d.ts +3 -0
- package/schematics/component-migration/alert/steps/template-reference.js +15 -0
- package/schematics/component-migration/alert/steps/template-todos.d.ts +3 -0
- package/schematics/component-migration/alert/steps/template-todos.js +78 -0
- package/schematics/component-migration/button/guide.md +278 -0
- package/schematics/component-migration/button/index.d.ts +2 -0
- package/schematics/component-migration/button/index.js +5 -0
- package/schematics/component-migration/button/migration.d.ts +2 -0
- package/schematics/component-migration/button/migration.js +180 -0
- package/schematics/component-migration/button/schema.json +25 -0
- package/schematics/component-migration/button/steps/static-classes.d.ts +10 -0
- package/schematics/component-migration/button/steps/static-classes.js +128 -0
- package/schematics/component-migration/button/steps/template-todos.d.ts +19 -0
- package/schematics/component-migration/button/steps/template-todos.js +120 -0
- package/schematics/component-migration/button/types.d.ts +7 -0
- package/schematics/component-migration/button/types.js +2 -0
- package/schematics/component-migration/dropdown/guide.md +252 -0
- package/schematics/component-migration/dropdown/index.d.ts +2 -0
- package/schematics/component-migration/dropdown/index.js +5 -0
- package/schematics/component-migration/dropdown/migration.d.ts +2 -0
- package/schematics/component-migration/dropdown/migration.js +41 -0
- package/schematics/component-migration/dropdown/schema.json +25 -0
- package/schematics/component-migration/dropdown/steps/dropdown-imports.d.ts +3 -0
- package/schematics/component-migration/dropdown/steps/dropdown-imports.js +308 -0
- package/schematics/component-migration/dropdown/steps/template-attributes.d.ts +10 -0
- package/schematics/component-migration/dropdown/steps/template-attributes.js +57 -0
- package/schematics/component-migration/dropdown/steps/template-helpers.d.ts +20 -0
- package/schematics/component-migration/dropdown/steps/template-helpers.js +125 -0
- package/schematics/component-migration/dropdown/steps/template-imports.d.ts +22 -0
- package/schematics/component-migration/dropdown/steps/template-imports.js +12 -0
- package/schematics/component-migration/dropdown/steps/template-items.d.ts +7 -0
- package/schematics/component-migration/dropdown/steps/template-items.js +58 -0
- package/schematics/component-migration/dropdown/steps/template-menu.d.ts +14 -0
- package/schematics/component-migration/dropdown/steps/template-menu.js +107 -0
- package/schematics/component-migration/dropdown/steps/template-todos.d.ts +19 -0
- package/schematics/component-migration/dropdown/steps/template-todos.js +118 -0
- package/schematics/component-migration/dropdown/steps/template-toggle.d.ts +9 -0
- package/schematics/component-migration/dropdown/steps/template-toggle.js +70 -0
- package/schematics/component-migration/dropdown/steps/template-wrapper.d.ts +12 -0
- package/schematics/component-migration/dropdown/steps/template-wrapper.js +105 -0
- package/schematics/component-migration/index.d.ts +3 -0
- package/schematics/component-migration/index.js +26 -0
- package/schematics/component-migration/next-steps/index.d.ts +13 -0
- package/schematics/component-migration/next-steps/index.js +34 -0
- package/schematics/component-migration/registry.d.ts +1 -0
- package/schematics/component-migration/registry.js +15 -0
- package/schematics/component-migration/schema.json +20 -0
- package/schematics/component-migration/shared/ai-handoff.d.ts +2 -0
- package/schematics/component-migration/shared/ai-handoff.js +28 -0
- package/schematics/component-migration/shared/angular-component.d.ts +10 -0
- package/schematics/component-migration/shared/angular-component.js +125 -0
- package/schematics/component-migration/shared/button-visual-classes.d.ts +24 -0
- package/schematics/component-migration/shared/button-visual-classes.js +111 -0
- package/schematics/component-migration/shared/component-context.d.ts +7 -0
- package/schematics/component-migration/shared/component-context.js +24 -0
- package/schematics/component-migration/shared/component-imports.d.ts +45 -0
- package/schematics/component-migration/shared/component-imports.js +380 -0
- package/schematics/component-migration/shared/create-component-schematic.d.ts +3 -0
- package/schematics/component-migration/shared/create-component-schematic.js +55 -0
- package/schematics/component-migration/shared/import-edits.d.ts +11 -0
- package/schematics/component-migration/shared/import-edits.js +157 -0
- package/schematics/component-migration/shared/legacy-config-todos.d.ts +3 -0
- package/schematics/component-migration/shared/legacy-config-todos.js +90 -0
- package/schematics/component-migration/shared/migrate-project.d.ts +12 -0
- package/schematics/component-migration/shared/migrate-project.js +151 -0
- package/schematics/component-migration/shared/project-templates.d.ts +15 -0
- package/schematics/component-migration/shared/project-templates.js +43 -0
- package/schematics/component-migration/shared/scan-project.d.ts +3 -0
- package/schematics/component-migration/shared/scan-project.js +24 -0
- package/schematics/component-migration/shared/static-placement.d.ts +1 -0
- package/schematics/component-migration/shared/static-placement.js +45 -0
- package/schematics/component-migration/shared/template-edits.d.ts +28 -0
- package/schematics/component-migration/shared/template-edits.js +153 -0
- package/schematics/component-migration/shared/template-result.d.ts +3 -0
- package/schematics/component-migration/shared/template-result.js +11 -0
- package/schematics/component-migration/shared/testing.d.ts +13 -0
- package/schematics/component-migration/shared/testing.js +59 -0
- package/schematics/component-migration/shared/todo-comments.d.ts +10 -0
- package/schematics/component-migration/shared/todo-comments.js +81 -0
- package/schematics/component-migration/shared/types.d.ts +41 -0
- package/schematics/component-migration/shared/types.js +2 -0
- package/schematics/component-migration/tooltip/guide.md +196 -0
- package/schematics/component-migration/tooltip/index.d.ts +2 -0
- package/schematics/component-migration/tooltip/index.js +5 -0
- package/schematics/component-migration/tooltip/migration.d.ts +2 -0
- package/schematics/component-migration/tooltip/migration.js +50 -0
- package/schematics/component-migration/tooltip/schema.json +25 -0
- package/schematics/component-migration/tooltip/steps/template-attributes.d.ts +13 -0
- package/schematics/component-migration/tooltip/steps/template-attributes.js +266 -0
- package/schematics/component-migration/tooltip/steps/template-todos.d.ts +24 -0
- package/schematics/component-migration/tooltip/steps/template-todos.js +115 -0
- package/schematics/component-migration/tooltip/steps/tooltip-imports.d.ts +3 -0
- package/schematics/component-migration/tooltip/steps/tooltip-imports.js +79 -0
- package/schematics/component-migration/utils/component-resource-collector.d.ts +34 -0
- package/schematics/component-migration/utils/component-resource-collector.js +107 -0
- package/schematics/component-migration/utils/project_tsconfig_paths.d.ts +18 -0
- package/schematics/component-migration/utils/project_tsconfig_paths.js +105 -0
- package/schematics/component-migration/utils/typescript/compiler_host.d.ts +44 -0
- package/schematics/component-migration/utils/typescript/compiler_host.js +87 -0
- package/schematics/component-migration/utils/typescript/decorators.d.ts +22 -0
- package/schematics/component-migration/utils/typescript/decorators.js +41 -0
- package/schematics/component-migration/utils/typescript/functions.d.ts +14 -0
- package/schematics/component-migration/utils/typescript/functions.js +20 -0
- package/schematics/component-migration/utils/typescript/imports.d.ts +17 -0
- package/schematics/component-migration/utils/typescript/imports.js +110 -0
- package/schematics/component-migration/utils/typescript/parse_tsconfig.d.ts +9 -0
- package/schematics/component-migration/utils/typescript/parse_tsconfig.js +29 -0
- package/schematics/component-migration/utils/typescript/property-name.d.ts +13 -0
- package/schematics/component-migration/utils/typescript/property-name.js +22 -0
- package/schematics/package.json +3 -0
- package/types/design-factory-angular-accordion.d.ts +553 -0
- package/types/design-factory-angular-alert.d.ts +166 -0
- package/types/design-factory-angular-breakpoints.d.ts +13 -0
- package/types/design-factory-angular-button.d.ts +166 -0
- package/types/design-factory-angular-buttongroup.d.ts +45 -0
- package/types/design-factory-angular-drawer.d.ts +10 -16
- package/types/design-factory-angular-dropdown.d.ts +148 -0
- package/types/design-factory-angular-form-field.d.ts +122 -0
- package/types/design-factory-angular-icon.d.ts +11 -0
- package/types/design-factory-angular-input.d.ts +16 -0
- package/types/design-factory-angular-internals.d.ts +78 -19
- package/types/design-factory-angular-separator.d.ts +29 -0
- package/types/design-factory-angular-sidenav.d.ts +98 -14
- package/types/design-factory-angular-slider.d.ts +239 -0
- package/types/design-factory-angular-toggle.d.ts +93 -0
- package/types/design-factory-angular-tooltip.d.ts +113 -0
- package/types/design-factory-angular-topnav.d.ts +35 -47
- package/drawer/README.md +0 -54
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Please finish the Design Factory component migration in my current working tree.
|
|
2
|
+
|
|
3
|
+
The deterministic Design Factory migration schematics have already run.
|
|
4
|
+
|
|
5
|
+
## Inputs
|
|
6
|
+
|
|
7
|
+
Use my current working tree and current git diff as the migration source of truth.
|
|
8
|
+
|
|
9
|
+
Read every component guide in this generated migration folder before editing:
|
|
10
|
+
|
|
11
|
+
- `.df-migration/*/guide.md`
|
|
12
|
+
|
|
13
|
+
Use the installed package source code as the API and behavior source of truth when it is available. In workspaces with
|
|
14
|
+
more than one `node_modules`, use the package instance that the migrated project would resolve, preferring the closest
|
|
15
|
+
applicable `node_modules` from the project or workspace path:
|
|
16
|
+
|
|
17
|
+
- legacy components and schematics: `node_modules/@design-factory/design-factory`;
|
|
18
|
+
- legacy ng-bootstrap behavior: `node_modules/@ng-bootstrap/ng-bootstrap`;
|
|
19
|
+
- new Angular components: `node_modules/@design-factory/angular`;
|
|
20
|
+
- shared component behavior, when available in the installed package graph: `node_modules/@design-factory/*`.
|
|
21
|
+
|
|
22
|
+
If there is any doubt about how a legacy or new component works, or if a migration decision depends on component
|
|
23
|
+
behavior, inspect the actual implementation and TypeScript declaration files before editing. If the relevant package
|
|
24
|
+
source is not available locally, use the available typings and generated guides, keep ambiguous cases unresolved, and
|
|
25
|
+
report the missing source in the final summary.
|
|
26
|
+
|
|
27
|
+
The deterministic migration may have:
|
|
28
|
+
|
|
29
|
+
- rewritten safe mechanical template and TypeScript usages;
|
|
30
|
+
- added standalone imports;
|
|
31
|
+
- added `TODO(df-migration ...)` comments for cases that need AI or manual review.
|
|
32
|
+
|
|
33
|
+
## Rules
|
|
34
|
+
|
|
35
|
+
- Preserve user code and unrelated behavior.
|
|
36
|
+
- Treat staged changes, if any, as deterministic migration output that is already prepared for review.
|
|
37
|
+
- Make all AI-assisted follow-up edits in the unstaged working tree only.
|
|
38
|
+
- Do not stage, commit, stash, reset, revert, or otherwise change git state unless I explicitly ask.
|
|
39
|
+
- Do not undo deterministic schematic edits unless they are clearly incorrect.
|
|
40
|
+
- Treat my current git diff as intentionally reviewable. If I have removed or reverted a hunk, do not reintroduce it
|
|
41
|
+
without a clear reason.
|
|
42
|
+
- Resolve only component migrations that have generated guides under `.df-migration/*/guide.md` unless I explicitly ask
|
|
43
|
+
for a broader cleanup.
|
|
44
|
+
- Prefer small local edits over broad refactors.
|
|
45
|
+
- Do not reformat files globally and do not run formatters unless I explicitly ask.
|
|
46
|
+
- Keep formatting-only edits limited to migration-touched lines, such as removing blank lines left by schematic edits.
|
|
47
|
+
- Do not migrate unit tests, e2e tests, page objects, snapshots, or test-only selectors unless I explicitly ask for test
|
|
48
|
+
migration. If tests still reference legacy component selectors or CSS classes, report them as follow-up work.
|
|
49
|
+
- Resolve API and behavior questions from component source code and typings, not from assumptions.
|
|
50
|
+
- Do not leave empty named import declarations such as `import {} from '...';`. If removing named imports leaves no
|
|
51
|
+
imported symbols, remove the whole import declaration.
|
|
52
|
+
- Verify every `TODO(df-migration ...)` comment and remove it only when the underlying issue is actually resolved.
|
|
53
|
+
- Preserve every `TODO(df-migration ...): [human] ...` comment itself. `[human]` means the case must stay visible for
|
|
54
|
+
human review; it does not automatically forbid AI-assisted edits. You may improve the surrounding code when the
|
|
55
|
+
component guide gives a safe path and the intent is clear, but keep the `[human]` TODO so a human can verify the
|
|
56
|
+
result. If the component guide explicitly says to leave a pattern unchanged or out of scope, follow that stricter
|
|
57
|
+
instruction.
|
|
58
|
+
- If a component guide says a TODO must be preserved or excluded from AI migration, leave that TODO unchanged.
|
|
59
|
+
- Leave unresolved TODOs in place when the required behavior is ambiguous.
|
|
60
|
+
- Preserve custom classes, event handlers, ARIA attributes, router directives, form attributes, and test selectors unless
|
|
61
|
+
the component guide explicitly says to change them.
|
|
62
|
+
- When imports are changed, remove old imports only after confirming there are no remaining references.
|
|
63
|
+
|
|
64
|
+
## Suggested Workflow
|
|
65
|
+
|
|
66
|
+
1. Inspect `git diff`.
|
|
67
|
+
2. Find `TODO(df-migration ...)` comments and remaining legacy APIs for guided components.
|
|
68
|
+
3. Read the relevant component guide sections for each TODO code or legacy API.
|
|
69
|
+
4. Make the smallest code changes needed to finish the migration.
|
|
70
|
+
5. Run the narrowest useful validation for touched files or projects when the command is clear.
|
|
71
|
+
6. Report unresolved TODOs, known remaining legacy usages, and validation results.
|
|
72
|
+
|
|
73
|
+
## Validation
|
|
74
|
+
|
|
75
|
+
Use validation commands already defined by the client project. Validation is best effort: if a command fails, report the
|
|
76
|
+
command and the relevant failure summary, but do not assume the whole migration is invalid.
|
|
77
|
+
|
|
78
|
+
Prefer narrow TypeScript compilation or typecheck commands for the touched project when available. Run narrow build,
|
|
79
|
+
unit, or e2e commands only when the command is clear and appropriately scoped. If a full build is broad, slow, or known
|
|
80
|
+
to fail for unrelated reasons, do not run it unless I explicitly ask.
|
|
81
|
+
|
|
82
|
+
Only fix validation failures that are clearly caused by the component migration and are in migration-owned source files.
|
|
83
|
+
Do not fix unrelated failures, and do not update tests/page objects unless I explicitly ask for test migration.
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
# Alert Migration Guide
|
|
2
|
+
|
|
3
|
+
This guide is used by AI-assisted migration after the deterministic `migrate-alert` 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 alerts are based on `ngb-alert` / `NgbAlert` from `@ng-bootstrap/ng-bootstrap/alert` or
|
|
11
|
+
`@ng-bootstrap/ng-bootstrap`, often combined with legacy Design Factory helpers:
|
|
12
|
+
|
|
13
|
+
- `DfAlertModule`
|
|
14
|
+
- `NgbAlertConfig`
|
|
15
|
+
- `dfInsertAlertIcon`
|
|
16
|
+
- `DfInsertIconDirective`
|
|
17
|
+
- `df-alert-sm`
|
|
18
|
+
- `df-alert-lg`
|
|
19
|
+
- `df-page-alert`
|
|
20
|
+
- `df-card-alert`
|
|
21
|
+
- `df-superheader`
|
|
22
|
+
- `df-alert-collapse-main-text`
|
|
23
|
+
- `df-alert-collapsed-text`
|
|
24
|
+
|
|
25
|
+
Legacy collapsible alerts often use `NgbCollapse`, local collapsed state, and custom toggle buttons.
|
|
26
|
+
|
|
27
|
+
## New API
|
|
28
|
+
|
|
29
|
+
New alerts use standalone exports from `@design-factory/angular/alert`:
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { DfAlert, DfAlertDetails, DfAlertTitle, provideDfAlertConfig } from '@design-factory/angular/alert';
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Common template forms:
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<df-alert type="warning" [dismissible]="true" (closed)="onClosed()">Alert content</df-alert>
|
|
39
|
+
|
|
40
|
+
<df-alert expandable>
|
|
41
|
+
<df-alert-title>Alert title</df-alert-title>
|
|
42
|
+
<df-alert-details>Additional details</df-alert-details>
|
|
43
|
+
</df-alert>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Supported alert types are `success`, `info`, `warning`, `danger`, and `tip`.
|
|
47
|
+
|
|
48
|
+
Supported alert inputs and outputs include `type`, `appearance`, `size`, `animated`, `dismissible`, `expandable`,
|
|
49
|
+
`expanded`, and `(closed)`.
|
|
50
|
+
|
|
51
|
+
## Deterministic Schematic Changes
|
|
52
|
+
|
|
53
|
+
The schematic handles these changes when the syntax is local and unambiguous:
|
|
54
|
+
|
|
55
|
+
- `ngb-alert` -> `df-alert`
|
|
56
|
+
- `dfInsertAlertIcon` removal
|
|
57
|
+
- `[animation]` / `animation` -> `[animated]` / `animated`
|
|
58
|
+
- `(close)` -> `(closed)`
|
|
59
|
+
- static `df-alert-sm` / `df-alert-lg` -> `size`
|
|
60
|
+
- static page/card alert classes -> `appearance="banner"` where supported
|
|
61
|
+
- unsupported static alert types normalized to a supported value
|
|
62
|
+
- `#alert="ngbAlert"` export removal
|
|
63
|
+
- `NgbAlert` and `NgbAlertModule` import cleanup where safe
|
|
64
|
+
- `NgbAlert` type references changed to `DfAlert`
|
|
65
|
+
- TODO comments for cases that need review or AI/manual migration
|
|
66
|
+
|
|
67
|
+
Do not repeat these changes unless the schematic missed a local occurrence.
|
|
68
|
+
|
|
69
|
+
## TODO Codes
|
|
70
|
+
|
|
71
|
+
TODO comments may include `[human]`.
|
|
72
|
+
|
|
73
|
+
Verify every TODO and remove it only when the underlying issue is actually resolved. Preserve `[human]` TODO comments
|
|
74
|
+
unchanged so a human can review them after the AI-assisted pass. `[human]` does not forbid AI-assisted edits around the
|
|
75
|
+
comment when the intent is clear; it means the final result must remain visible for human verification.
|
|
76
|
+
|
|
77
|
+
### `alert.review`
|
|
78
|
+
|
|
79
|
+
The alert was migrated automatically. Verify behavior and visual appearance.
|
|
80
|
+
|
|
81
|
+
Pay special attention to vertical spacing. Legacy `ngb-alert` inherited Bootstrap's default bottom margin, which was
|
|
82
|
+
equivalent to `mb-5` / `var(--df-spacing-5)`. New `df-alert` does not set outer spacing; spacing belongs to the
|
|
83
|
+
surrounding layout or the alert host.
|
|
84
|
+
|
|
85
|
+
The deterministic schematic restores that spacing with `mb-5` for normal inline/content alerts when it can prove the
|
|
86
|
+
alert has no bottom-margin utility, no dynamic class binding, and is not a legacy page/card banner alert.
|
|
87
|
+
|
|
88
|
+
When reviewing spacing:
|
|
89
|
+
|
|
90
|
+
- Keep deterministic `mb-5` when the migrated alert is a normal inline/content alert and the old `ngb-alert` bottom
|
|
91
|
+
margin should still separate it from the following content.
|
|
92
|
+
- Add `mb-5` or equivalent layout spacing when the schematic could not do so automatically and the next element now
|
|
93
|
+
sits too close to the alert.
|
|
94
|
+
- Do not add margin when the alert already has explicit margin classes such as `mb-*`, `my-*`, `m-*`, responsive margin
|
|
95
|
+
variants, or app-specific spacing classes.
|
|
96
|
+
- Do not add margin to banner alerts, page-level alerts, card-edge alerts, or alerts intentionally flush with a
|
|
97
|
+
container edge.
|
|
98
|
+
- Be careful in flex rows, modal footers, toolbars, inline status areas, and compact card headers; these often need
|
|
99
|
+
local layout-specific spacing rather than `mb-5`.
|
|
100
|
+
- If the surrounding layout is ambiguous, leave the spacing unchanged and add a specific human TODO immediately above
|
|
101
|
+
the alert:
|
|
102
|
+
|
|
103
|
+
```html
|
|
104
|
+
<!-- TODO(df-migration alert.spacing-review): [human] Legacy ngb-alert had default bottom margin. Verify whether this migrated df-alert needs app/layout spacing. -->
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
After adding `alert.spacing-review`, remove `alert.review` only if all other review concerns for that alert are
|
|
108
|
+
resolved.
|
|
109
|
+
|
|
110
|
+
Keep or remove this TODO based on review. If no behavior issue is found, remove it.
|
|
111
|
+
|
|
112
|
+
### `alert.spacing-review`
|
|
113
|
+
|
|
114
|
+
This TODO may be added during AI-assisted review when the old Bootstrap bottom margin might matter but the surrounding
|
|
115
|
+
layout is not clear enough to update automatically.
|
|
116
|
+
|
|
117
|
+
Keep this TODO for human review. A human should either add the correct layout spacing or confirm the migrated alert is
|
|
118
|
+
intentionally flush with the surrounding content.
|
|
119
|
+
|
|
120
|
+
### `alert.dynamic-class`
|
|
121
|
+
|
|
122
|
+
The alert has dynamic classes such as `[class]`, `[ngClass]`, or dynamic class bindings.
|
|
123
|
+
|
|
124
|
+
Inspect the bound expression. If it can still produce legacy alert classes, convert the logic to new alert inputs such
|
|
125
|
+
as `size`, `appearance`, or local component state. If the expression is unrelated to alert styling, leave it unchanged
|
|
126
|
+
and remove the TODO.
|
|
127
|
+
|
|
128
|
+
### `alert.dynamic-legacy-class`
|
|
129
|
+
|
|
130
|
+
The alert has an explicit dynamic legacy class binding, for example `[class.df-alert-sm]`.
|
|
131
|
+
|
|
132
|
+
Convert it to the corresponding new input logic when possible:
|
|
133
|
+
|
|
134
|
+
- `df-alert-sm` -> `size="sm"` or `[size]="condition ? 'sm' : 'md'"`
|
|
135
|
+
- `df-alert-lg` -> `size="lg"` or `[size]="condition ? 'lg' : 'md'"`
|
|
136
|
+
- `df-page-alert` / `df-card-alert` -> `appearance="banner"` or equivalent conditional expression
|
|
137
|
+
|
|
138
|
+
Preserve unrelated class logic.
|
|
139
|
+
|
|
140
|
+
### `alert.page-level-layout`
|
|
141
|
+
|
|
142
|
+
The alert used legacy `df-page-alert`, either statically or through `[class.df-page-alert]`.
|
|
143
|
+
|
|
144
|
+
This TODO is marked `[human]` because the correct fix depends on the application shell and route layout.
|
|
145
|
+
|
|
146
|
+
The schematic can map the visual banner treatment to `appearance="banner"`, but it does not migrate the legacy fixed
|
|
147
|
+
positioning, top offset, or superheader-aware placement. New alerts should be positioned by the consuming application
|
|
148
|
+
layout.
|
|
149
|
+
|
|
150
|
+
Review the surrounding layout before removing this TODO:
|
|
151
|
+
|
|
152
|
+
- If this is a global or page-level notification, prefer moving it into an app-owned alert/banner slot directly below
|
|
153
|
+
the top navigation or superheader.
|
|
154
|
+
- If it must remain in the routed component, add app-owned positioning and offset styles in that app.
|
|
155
|
+
- If the alert should now be inline content, keep the migrated `df-alert appearance="banner"` and remove the TODO after
|
|
156
|
+
confirming the behavior.
|
|
157
|
+
|
|
158
|
+
### `alert.dynamic-type`
|
|
159
|
+
|
|
160
|
+
The alert keeps a dynamic `[type]` binding.
|
|
161
|
+
|
|
162
|
+
Confirm the expression only returns `success`, `info`, `warning`, `danger`, or `tip`. If it can return Bootstrap-only
|
|
163
|
+
values such as `primary`, `secondary`, `light`, or `dark`, normalize them in TypeScript or template logic.
|
|
164
|
+
|
|
165
|
+
### `alert.collapsible-pattern`
|
|
166
|
+
|
|
167
|
+
Legacy collapsible markup was detected and not structurally migrated.
|
|
168
|
+
|
|
169
|
+
Prefer the new expandable alert structure:
|
|
170
|
+
|
|
171
|
+
```html
|
|
172
|
+
<df-alert expandable [(expanded)]="expanded">
|
|
173
|
+
<df-alert-title>Title content</df-alert-title>
|
|
174
|
+
<df-alert-details>Details content</df-alert-details>
|
|
175
|
+
</df-alert>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
When migrating:
|
|
179
|
+
|
|
180
|
+
- move main text into `df-alert-title`;
|
|
181
|
+
- move collapsed details into `df-alert-details`;
|
|
182
|
+
- remove custom collapse toggle markup when the new alert provides it;
|
|
183
|
+
- remove unused `NgbCollapse` imports and state helpers only after confirming they are not used elsewhere;
|
|
184
|
+
- preserve dismissible behavior, alert type, handlers, and projected content.
|
|
185
|
+
|
|
186
|
+
### `alert.programmatic-close`
|
|
187
|
+
|
|
188
|
+
Legacy `close()` returned an Observable; new `close()` returns `Promise<void>`.
|
|
189
|
+
|
|
190
|
+
Convert:
|
|
191
|
+
|
|
192
|
+
```ts
|
|
193
|
+
alert.close().subscribe(() => {
|
|
194
|
+
this.closed = true;
|
|
195
|
+
});
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
to one of:
|
|
199
|
+
|
|
200
|
+
```ts
|
|
201
|
+
void alert.close().then(() => {
|
|
202
|
+
this.closed = true;
|
|
203
|
+
});
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
or, inside an async function:
|
|
207
|
+
|
|
208
|
+
```ts
|
|
209
|
+
await alert.close();
|
|
210
|
+
this.closed = true;
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Do not make surrounding functions `async` if that changes a public API or call contract without checking usages.
|
|
214
|
+
|
|
215
|
+
### `alert.legacy-module-import`
|
|
216
|
+
|
|
217
|
+
A legacy alert module import remains after the deterministic migration.
|
|
218
|
+
|
|
219
|
+
This TODO is emitted for legacy alert-specific modules such as `DfAlertModule` or `NgbAlertModule`. Check whether the
|
|
220
|
+
module is still needed for other legacy components before removing it.
|
|
221
|
+
|
|
222
|
+
Broad `NgbModule` imports are not flagged by this TODO. Treat them as separate manual cleanup and remove them only when
|
|
223
|
+
the module no longer needs them for remaining ng-bootstrap APIs.
|
|
224
|
+
|
|
225
|
+
### `alert.indirect-component-imports`
|
|
226
|
+
|
|
227
|
+
The component needs `DfAlert`, but its Angular `imports` metadata is not a simple array literal.
|
|
228
|
+
|
|
229
|
+
Inspect the referenced value or expression. Add `DfAlert` to the actual imports list only when the shape is clear. If the
|
|
230
|
+
imports value is computed, shared, or otherwise ambiguous, preserve the TODO for human review.
|
|
231
|
+
|
|
232
|
+
## Configuration Migration
|
|
233
|
+
|
|
234
|
+
Legacy `NgbAlertConfig` is not supported anymore and is marked with `TODO(df-migration alert.config)` for human review.
|
|
235
|
+
|
|
236
|
+
Do not migrate it automatically. Review the legacy defaults and decide whether they should become local alert inputs,
|
|
237
|
+
new `provideDfAlertConfig()` usage, or application-specific cleanup.
|
|
238
|
+
|
|
239
|
+
## Validation
|
|
240
|
+
|
|
241
|
+
After AI-assisted alert migration:
|
|
242
|
+
|
|
243
|
+
1. Confirm no unexpected `ngb-alert`, `NgbAlert`, or `NgbAlertModule` usages remain.
|
|
244
|
+
2. Run the narrowest useful typecheck/build command for touched projects when the command is clear.
|
|
245
|
+
3. Run visual or e2e checks for collapsible, page/banner, card, size, or dynamic type changes when available.
|
|
246
|
+
4. Ask the user before running broad or expensive validation commands if the right command is unclear.
|
|
@@ -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.alertMigration);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.alertMigration = void 0;
|
|
4
|
+
const template_result_1 = require("../shared/template-result");
|
|
5
|
+
const template_edits_1 = require("../shared/template-edits");
|
|
6
|
+
const alert_imports_1 = require("./steps/alert-imports");
|
|
7
|
+
const animation_input_1 = require("./steps/animation-input");
|
|
8
|
+
const close_output_1 = require("./steps/close-output");
|
|
9
|
+
const icon_directive_1 = require("./steps/icon-directive");
|
|
10
|
+
const icon_directive_imports_1 = require("./steps/icon-directive-imports");
|
|
11
|
+
const legacy_module_imports_1 = require("./steps/legacy-module-imports");
|
|
12
|
+
const legacy_config_todos_1 = require("../shared/legacy-config-todos");
|
|
13
|
+
const programmatic_close_1 = require("./steps/programmatic-close");
|
|
14
|
+
const selector_1 = require("./steps/selector");
|
|
15
|
+
const static_classes_1 = require("./steps/static-classes");
|
|
16
|
+
const static_type_1 = require("./steps/static-type");
|
|
17
|
+
const template_todos_1 = require("./steps/template-todos");
|
|
18
|
+
const template_reference_1 = require("./steps/template-reference");
|
|
19
|
+
function getAlertElements(template) {
|
|
20
|
+
return (0, template_edits_1.findTemplateElements)(template, (element) => element.name === 'ngb-alert');
|
|
21
|
+
}
|
|
22
|
+
function migrateAlertTemplate(template) {
|
|
23
|
+
const edits = [];
|
|
24
|
+
for (const element of getAlertElements(template)) {
|
|
25
|
+
(0, template_todos_1.editAlertTemplateTodos)(element, edits);
|
|
26
|
+
(0, icon_directive_1.editIconDirective)(element, edits);
|
|
27
|
+
(0, animation_input_1.editAnimationInput)(element, edits);
|
|
28
|
+
(0, close_output_1.editCloseOutput)(element, edits);
|
|
29
|
+
(0, static_classes_1.editStaticClasses)(element, edits);
|
|
30
|
+
(0, static_type_1.editStaticType)(element, edits);
|
|
31
|
+
(0, template_reference_1.editTemplateReference)(element, edits);
|
|
32
|
+
(0, selector_1.editSelector)(element, edits);
|
|
33
|
+
}
|
|
34
|
+
return (0, template_result_1.createTemplateMigrationResult)(template, edits);
|
|
35
|
+
}
|
|
36
|
+
function migrateAlertSourceFile(context) {
|
|
37
|
+
return [
|
|
38
|
+
...(0, icon_directive_imports_1.editIconDirectiveImports)(context),
|
|
39
|
+
...(0, alert_imports_1.editAlertImports)(context),
|
|
40
|
+
...(0, legacy_module_imports_1.editLegacyModuleImportTodos)(context),
|
|
41
|
+
...(0, programmatic_close_1.editProgrammaticCloseTodos)(context)
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
exports.alertMigration = {
|
|
45
|
+
id: 'alert',
|
|
46
|
+
countLegacyTemplateUsages: (template) => getAlertElements(template).length,
|
|
47
|
+
migrateTemplate: migrateAlertTemplate,
|
|
48
|
+
migrateSourceFile: migrateAlertSourceFile,
|
|
49
|
+
migrateProjectSourceFile: (context) => (0, legacy_config_todos_1.editLegacyConfigTodos)(context, ['NgbAlertConfig'])
|
|
50
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "SchematicsMigrateAlert",
|
|
4
|
+
"title": "Migrate Alert 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 alert usages without applying the migration",
|
|
22
|
+
"default": false
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TemplateEdit } from '../../shared/template-edits';
|
|
2
|
+
import { ComponentMigrationSourceContext } from '../../shared/types';
|
|
3
|
+
export declare function sourceFileNeedsDfAlert(context: ComponentMigrationSourceContext): boolean;
|
|
4
|
+
export declare function editAlertImports(context: ComponentMigrationSourceContext): TemplateEdit[];
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sourceFileNeedsDfAlert = sourceFileNeedsDfAlert;
|
|
4
|
+
exports.editAlertImports = editAlertImports;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const ts = tslib_1.__importStar(require("typescript"));
|
|
7
|
+
const import_edits_1 = require("../../shared/import-edits");
|
|
8
|
+
const angular_component_1 = require("../../shared/angular-component");
|
|
9
|
+
const component_context_1 = require("../../shared/component-context");
|
|
10
|
+
const component_imports_1 = require("../../shared/component-imports");
|
|
11
|
+
const LEGACY_ALERT_IMPORTS = new Set(['@ng-bootstrap/ng-bootstrap/alert', '@ng-bootstrap/ng-bootstrap']);
|
|
12
|
+
const NEW_ALERT_IMPORT = '@design-factory/angular/alert';
|
|
13
|
+
const NGB_ALERT = 'NgbAlert';
|
|
14
|
+
const NGB_ALERT_MODULE = 'NgbAlertModule';
|
|
15
|
+
const DF_ALERT = 'DfAlert';
|
|
16
|
+
function componentUsesDfAlert(templates) {
|
|
17
|
+
return templates.some((template) => template.includes('<df-alert') || template.includes('</df-alert>'));
|
|
18
|
+
}
|
|
19
|
+
function sourceFileNeedsDfAlert(context) {
|
|
20
|
+
return (0, component_context_1.sourceFileNeedsComponentTemplate)(context, componentUsesDfAlert);
|
|
21
|
+
}
|
|
22
|
+
function getLegacyAlertImports(sourceFile) {
|
|
23
|
+
return (0, component_imports_1.getComponentNamedImports)(sourceFile, LEGACY_ALERT_IMPORTS, [NGB_ALERT, NGB_ALERT_MODULE]);
|
|
24
|
+
}
|
|
25
|
+
function getNewImportName(legacyImport) {
|
|
26
|
+
return legacyImport.importedName === NGB_ALERT && legacyImport.localName !== NGB_ALERT
|
|
27
|
+
? `${DF_ALERT} as ${legacyImport.localName}`
|
|
28
|
+
: DF_ALERT;
|
|
29
|
+
}
|
|
30
|
+
function getScopeName(legacyImport) {
|
|
31
|
+
return legacyImport.importedName === NGB_ALERT && legacyImport.localName !== NGB_ALERT
|
|
32
|
+
? legacyImport.localName
|
|
33
|
+
: DF_ALERT;
|
|
34
|
+
}
|
|
35
|
+
function getSkippedRanges(sourceFile) {
|
|
36
|
+
const importDeclarationRanges = sourceFile.statements.flatMap((statement) => ts.isImportDeclaration(statement) ? [{ start: statement.getFullStart(), end: statement.getEnd() }] : []);
|
|
37
|
+
const decoratorImportsArrayRanges = (0, angular_component_1.findDecoratorImportsArrays)(sourceFile).map((importsArray) => ({
|
|
38
|
+
start: importsArray.getStart(sourceFile),
|
|
39
|
+
end: importsArray.getEnd()
|
|
40
|
+
}));
|
|
41
|
+
return [...importDeclarationRanges, ...decoratorImportsArrayRanges];
|
|
42
|
+
}
|
|
43
|
+
function editNgbAlertReferences(sourceFile, legacyImports, newImports) {
|
|
44
|
+
const edits = [];
|
|
45
|
+
const skippedRanges = getSkippedRanges(sourceFile);
|
|
46
|
+
const alertImports = legacyImports.filter((legacyImport) => legacyImport.importedName === NGB_ALERT);
|
|
47
|
+
const scanner = ts.createScanner(ts.ScriptTarget.Latest, false, ts.LanguageVariant.Standard, sourceFile.text);
|
|
48
|
+
let token = scanner.scan();
|
|
49
|
+
while (token !== ts.SyntaxKind.EndOfFileToken) {
|
|
50
|
+
const start = scanner.getTokenStart();
|
|
51
|
+
const end = scanner.getTokenEnd();
|
|
52
|
+
const legacyImport = alertImports.find((candidate) => candidate.localName === scanner.getTokenText());
|
|
53
|
+
if (token === ts.SyntaxKind.Identifier &&
|
|
54
|
+
legacyImport &&
|
|
55
|
+
!skippedRanges.some((range) => start >= range.start && end <= range.end)) {
|
|
56
|
+
const replacement = getScopeName(legacyImport);
|
|
57
|
+
newImports.add(getNewImportName(legacyImport));
|
|
58
|
+
if (scanner.getTokenText() !== replacement) {
|
|
59
|
+
edits.push({ start, end, text: replacement });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
token = scanner.scan();
|
|
63
|
+
}
|
|
64
|
+
return edits;
|
|
65
|
+
}
|
|
66
|
+
function editAlertImports(context) {
|
|
67
|
+
if (!sourceFileNeedsDfAlert(context)) {
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
const newImports = new Set();
|
|
71
|
+
const legacyImports = getLegacyAlertImports(context.sourceFile);
|
|
72
|
+
const scopeEdits = (0, component_imports_1.editComponentScopeImports)({
|
|
73
|
+
context,
|
|
74
|
+
newImport: { moduleName: NEW_ALERT_IMPORT, symbolName: DF_ALERT },
|
|
75
|
+
componentNeedsNewImport: componentUsesDfAlert,
|
|
76
|
+
legacyImports,
|
|
77
|
+
legacyScopeImportedNames: [NGB_ALERT, NGB_ALERT_MODULE],
|
|
78
|
+
getReplacement: (legacyImport) => ({
|
|
79
|
+
scopeName: getScopeName(legacyImport),
|
|
80
|
+
importName: getNewImportName(legacyImport)
|
|
81
|
+
}),
|
|
82
|
+
indirectComponentImportsTodo: {
|
|
83
|
+
code: 'alert.indirect-component-imports',
|
|
84
|
+
message: 'Component imports use an indirect value. Add DfAlert to that imports value after verifying its shape.'
|
|
85
|
+
},
|
|
86
|
+
addTopLevelImport: false
|
|
87
|
+
});
|
|
88
|
+
for (const newImport of scopeEdits.newImports) {
|
|
89
|
+
newImports.add(newImport);
|
|
90
|
+
}
|
|
91
|
+
const edits = [
|
|
92
|
+
...scopeEdits.edits,
|
|
93
|
+
...editNgbAlertReferences(context.sourceFile, legacyImports, newImports),
|
|
94
|
+
...(0, import_edits_1.removeNamedImports)(context.sourceFile, LEGACY_ALERT_IMPORTS, [NGB_ALERT, NGB_ALERT_MODULE])
|
|
95
|
+
];
|
|
96
|
+
return [...edits, ...(0, import_edits_1.addNamedImports)(context.sourceFile, NEW_ALERT_IMPORT, [...newImports])];
|
|
97
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.editAnimationInput = editAnimationInput;
|
|
4
|
+
const template_edits_1 = require("../../shared/template-edits");
|
|
5
|
+
function editAnimationInput(element, edits) {
|
|
6
|
+
if ((0, template_edits_1.findTextAttribute)(element, 'animated') || (0, template_edits_1.findBoundAttribute)(element, 'animated')) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const animationAttribute = (0, template_edits_1.findTextAttribute)(element, 'animation') ?? (0, template_edits_1.findBoundAttribute)(element, 'animation');
|
|
10
|
+
if (animationAttribute?.keySpan) {
|
|
11
|
+
edits.push({
|
|
12
|
+
start: animationAttribute.keySpan.start.offset,
|
|
13
|
+
end: animationAttribute.keySpan.end.offset,
|
|
14
|
+
text: 'animated'
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.editCloseOutput = editCloseOutput;
|
|
4
|
+
const template_edits_1 = require("../../shared/template-edits");
|
|
5
|
+
function editCloseOutput(element, edits) {
|
|
6
|
+
if ((0, template_edits_1.findBoundEvent)(element, 'closed')) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const closeOutput = (0, template_edits_1.findBoundEvent)(element, 'close');
|
|
10
|
+
if (closeOutput?.keySpan) {
|
|
11
|
+
edits.push({
|
|
12
|
+
start: closeOutput.keySpan.start.offset,
|
|
13
|
+
end: closeOutput.keySpan.end.offset,
|
|
14
|
+
text: 'closed'
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.editIconDirectiveImports = editIconDirectiveImports;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const ts = tslib_1.__importStar(require("typescript"));
|
|
6
|
+
const angular_component_1 = require("../../shared/angular-component");
|
|
7
|
+
const import_edits_1 = require("../../shared/import-edits");
|
|
8
|
+
const legacyDesignFactoryImport = '@design-factory/design-factory';
|
|
9
|
+
const iconDirectiveName = 'DfInsertIconDirective';
|
|
10
|
+
function componentStillNeedsIconDirective(templates) {
|
|
11
|
+
return templates.some((template) => template.includes('dfInsertAlertIcon') || template.includes('dfInsertToastIcon'));
|
|
12
|
+
}
|
|
13
|
+
function editComponentImports(context) {
|
|
14
|
+
const edits = [];
|
|
15
|
+
const removedRanges = [];
|
|
16
|
+
for (const [component, templates] of context.templatesByComponent) {
|
|
17
|
+
if (componentStillNeedsIconDirective(templates)) {
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
const importsArray = (0, angular_component_1.findComponentImportsArray)(component);
|
|
21
|
+
const importElement = importsArray?.elements.find((element) => ts.isIdentifier(element) && element.text === iconDirectiveName);
|
|
22
|
+
if (importsArray && importElement) {
|
|
23
|
+
const edit = (0, import_edits_1.editListElement)(importsArray, importElement, context.sourceFile);
|
|
24
|
+
edits.push(edit);
|
|
25
|
+
removedRanges.push({ ...edit, text: '' });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return { edits, removedRanges };
|
|
29
|
+
}
|
|
30
|
+
function isInsideRange(node, ranges) {
|
|
31
|
+
return ranges.some((range) => node.getStart() >= range.start && node.getEnd() <= range.end);
|
|
32
|
+
}
|
|
33
|
+
function hasRemainingIconDirectiveUsage(sourceFile, removedRanges) {
|
|
34
|
+
let found = false;
|
|
35
|
+
const visitNode = (node) => {
|
|
36
|
+
if (found) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (ts.isIdentifier(node) && node.text === iconDirectiveName) {
|
|
40
|
+
if (!ts.isImportSpecifier(node.parent) && !isInsideRange(node, removedRanges)) {
|
|
41
|
+
found = true;
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
ts.forEachChild(node, visitNode);
|
|
46
|
+
};
|
|
47
|
+
ts.forEachChild(sourceFile, visitNode);
|
|
48
|
+
return found;
|
|
49
|
+
}
|
|
50
|
+
function editImportDeclaration(sourceFile) {
|
|
51
|
+
for (const statement of sourceFile.statements) {
|
|
52
|
+
if (!ts.isImportDeclaration(statement) ||
|
|
53
|
+
!ts.isStringLiteral(statement.moduleSpecifier) ||
|
|
54
|
+
statement.moduleSpecifier.text !== legacyDesignFactoryImport) {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const namedBindings = statement.importClause?.namedBindings;
|
|
58
|
+
if (!namedBindings || !ts.isNamedImports(namedBindings)) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
const importSpecifier = namedBindings.elements.find((element) => element.name.text === iconDirectiveName);
|
|
62
|
+
if (!importSpecifier) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (namedBindings.elements.length === 1 && !statement.importClause?.name) {
|
|
66
|
+
return [
|
|
67
|
+
{
|
|
68
|
+
start: statement.getFullStart(),
|
|
69
|
+
end: statement.getEnd(),
|
|
70
|
+
text: ''
|
|
71
|
+
}
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
return [(0, import_edits_1.editListElement)(namedBindings, importSpecifier, sourceFile)];
|
|
75
|
+
}
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
function editIconDirectiveImports(context) {
|
|
79
|
+
const { edits, removedRanges } = editComponentImports(context);
|
|
80
|
+
if (edits.length > 0 && !hasRemainingIconDirectiveUsage(context.sourceFile, removedRanges)) {
|
|
81
|
+
edits.push(...editImportDeclaration(context.sourceFile));
|
|
82
|
+
}
|
|
83
|
+
return edits;
|
|
84
|
+
}
|