@design-factory/angular 21.1.0-next.1 → 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 +76 -81
- 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 +766 -438
- 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 +30 -20
- 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 +635 -558
- 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 +19 -26
- 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 +114 -17
- 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 +47 -52
- package/drawer/README.md +0 -54
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isPlatformBrowser } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, PLATFORM_ID, signal, computed, effect, Injectable, provideAppInitializer } from '@angular/core';
|
|
3
|
+
import { inject, DOCUMENT, PLATFORM_ID, signal, computed, effect, Injectable, provideAppInitializer } from '@angular/core';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The DfThemeService is an abstract service that manages the theme state of the application.
|
|
@@ -10,6 +10,7 @@ import { inject, PLATFORM_ID, signal, computed, effect, Injectable, provideAppIn
|
|
|
10
10
|
* @since 21.1
|
|
11
11
|
*/
|
|
12
12
|
class DfThemeService {
|
|
13
|
+
#document = inject(DOCUMENT);
|
|
13
14
|
#preferred;
|
|
14
15
|
#system;
|
|
15
16
|
#toApply;
|
|
@@ -31,18 +32,23 @@ class DfThemeService {
|
|
|
31
32
|
if (isPlatformBrowser(inject(PLATFORM_ID))) {
|
|
32
33
|
defaultMode = window.matchMedia('(prefers-color-scheme: dark)').matches ? defaultDark : defaultLight;
|
|
33
34
|
}
|
|
34
|
-
this.#preferred = signal(defaultMode,
|
|
35
|
-
|
|
36
|
-
this
|
|
35
|
+
this.#preferred = signal(defaultMode, /* @ts-ignore */
|
|
36
|
+
...(ngDevMode ? [{ debugName: "#preferred" }] : /* istanbul ignore next */ []));
|
|
37
|
+
this.#system = signal(defaultMode, /* @ts-ignore */
|
|
38
|
+
...(ngDevMode ? [{ debugName: "#system" }] : /* istanbul ignore next */ []));
|
|
39
|
+
this.applied = signal(defaultMode, /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "applied" }] : /* istanbul ignore next */ []));
|
|
37
41
|
this.selected = computed(() => this.allOptions.includes(this.#preferred())
|
|
38
42
|
? this.#preferred()
|
|
39
43
|
: this.allOptions.includes('auto')
|
|
40
44
|
? 'auto'
|
|
41
|
-
: defaultMode,
|
|
45
|
+
: defaultMode, /* @ts-ignore */
|
|
46
|
+
...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
42
47
|
this.#toApply = computed(() => {
|
|
43
48
|
const selected = this.selected();
|
|
44
49
|
return selected === 'auto' ? this.#system() : selected;
|
|
45
|
-
},
|
|
50
|
+
}, /* @ts-ignore */
|
|
51
|
+
...(ngDevMode ? [{ debugName: "#toApply" }] : /* istanbul ignore next */ []));
|
|
46
52
|
}
|
|
47
53
|
init() {
|
|
48
54
|
if (isPlatformBrowser(inject(PLATFORM_ID))) {
|
|
@@ -78,7 +84,7 @@ class DfThemeService {
|
|
|
78
84
|
this.#preferred.set(theme);
|
|
79
85
|
}
|
|
80
86
|
#applyTheme(theme) {
|
|
81
|
-
document.documentElement.setAttribute('data-df-theme', theme);
|
|
87
|
+
this.#document.documentElement.setAttribute('data-df-theme', theme);
|
|
82
88
|
this.#themeApplied = true;
|
|
83
89
|
this.applied.set(theme);
|
|
84
90
|
}
|
|
@@ -86,7 +92,7 @@ class DfThemeService {
|
|
|
86
92
|
// Use View Transitions API if available and user has not requested reduced motion
|
|
87
93
|
if (!this.#themeApplied ||
|
|
88
94
|
!this.viewTransitionAnimation ||
|
|
89
|
-
!document.startViewTransition ||
|
|
95
|
+
!this.#document.startViewTransition ||
|
|
90
96
|
window.parent !== window ||
|
|
91
97
|
window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
|
|
92
98
|
this.#applyTheme(theme);
|
|
@@ -96,18 +102,22 @@ class DfThemeService {
|
|
|
96
102
|
if (setup) {
|
|
97
103
|
await setup();
|
|
98
104
|
}
|
|
99
|
-
const viewTransition = document.startViewTransition(() => this.#applyTheme(theme));
|
|
105
|
+
const viewTransition = this.#document.startViewTransition(() => this.#applyTheme(theme));
|
|
100
106
|
await viewTransition.ready;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
107
|
+
try {
|
|
108
|
+
await animation(theme);
|
|
109
|
+
}
|
|
110
|
+
finally {
|
|
111
|
+
await viewTransition.finished;
|
|
112
|
+
if (cleanup) {
|
|
113
|
+
await cleanup();
|
|
114
|
+
}
|
|
105
115
|
}
|
|
106
116
|
}
|
|
107
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
108
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
117
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: DfThemeService, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
118
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: DfThemeService, providedIn: 'root', useFactory: () => new DfThemeDefaultService() }); }
|
|
109
119
|
}
|
|
110
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
120
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: DfThemeService, decorators: [{
|
|
111
121
|
type: Injectable,
|
|
112
122
|
args: [{
|
|
113
123
|
providedIn: 'root',
|
|
@@ -160,7 +170,7 @@ class DfThemeDefaultService extends DfThemeService {
|
|
|
160
170
|
from { opacity: 0; }
|
|
161
171
|
to { opacity: 1; }
|
|
162
172
|
}
|
|
163
|
-
.df-
|
|
173
|
+
.df-topnav-header {
|
|
164
174
|
view-transition-name: unset !important;
|
|
165
175
|
}
|
|
166
176
|
`;
|
|
@@ -173,10 +183,10 @@ class DfThemeDefaultService extends DfThemeService {
|
|
|
173
183
|
};
|
|
174
184
|
this.init();
|
|
175
185
|
}
|
|
176
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
177
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
186
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: DfThemeDefaultService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
187
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: DfThemeDefaultService }); }
|
|
178
188
|
}
|
|
179
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: DfThemeDefaultService, decorators: [{
|
|
180
190
|
type: Injectable
|
|
181
191
|
}], ctorParameters: () => [] });
|
|
182
192
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design-factory-angular-theme.mjs","sources":["../../theme/theme.service.ts","../../theme/design-factory-angular-theme.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport {\n computed,\n effect,\n inject,\n Injectable,\n PLATFORM_ID,\n provideAppInitializer,\n Signal,\n signal,\n WritableSignal\n} from '@angular/core';\n\n/**\n * The view transition animation configuration for {@link DfThemeService}.\n *\n * @since 21.1\n */\nexport type DfViewTransitionAnimation<T extends string> = {\n /**\n * The setup function is called before the view transition starts. It can be used to prepare the DOM for the upcoming theme change, e.g. by adding necessary styles or classes.\n */\n setup?: () => Promise<void> | void;\n /**\n * The animation function is called after the view transition has started. It can be used to perform any necessary animations during the theme change. The function receives the theme that is being applied as an argument.\n */\n animation: (theme: T) => Promise<void> | void;\n /**\n * The cleanup function is called after the view transition has completed. It can be used to remove any temporary styles or classes added during the setup or animation phases.\n */\n cleanup?: () => Promise<void> | void;\n};\n\n/**\n * The DfThemeService is an abstract service that manages the theme state of the application.\n *\n * It provides functionality to select and apply themes, persist user preferences, and handle system theme changes.\n *\n * @since 21.1\n */\n@Injectable({\n providedIn: 'root',\n useFactory: () => new DfThemeDefaultService()\n})\nexport abstract class DfThemeService<ThemeMode extends string> {\n // The configuration of the theme service that must be provided by concrete implementations\n /**\n * An array of all available theme options. Must include at least the default light and dark themes, and optionally 'auto' if the service should support automatic theme selection based on system preferences.\n */\n abstract readonly allOptions: ThemeMode[];\n /**\n * The key used to store the user's theme preference in local storage. This is required if `syncLocalStorage` is true.\n */\n abstract readonly storageKey: string;\n /**\n * Whether to synchronize the user's theme selection with local storage. If true, the service will persist the selected theme in local storage and listen for changes to update the theme across tabs/frames.\n */\n abstract readonly syncLocalStorage: boolean;\n /**\n * The view transition animation configuration. If provided, the service will use the View Transitions API to animate theme changes. If not provided, theme changes will be applied immediately without animation.\n */\n abstract readonly viewTransitionAnimation: DfViewTransitionAnimation<Exclude<ThemeMode, 'auto'>> | undefined;\n\n readonly #preferred: WritableSignal<ThemeMode>;\n readonly #system: WritableSignal<Exclude<ThemeMode, 'auto'>>;\n readonly #toApply: Signal<Exclude<ThemeMode, 'auto'>>;\n\n /**\n * The currently selected theme option by the user.\n */\n readonly selected: Signal<ThemeMode>;\n\n /**\n * The currently applied theme. This signal is triggered after the view transition has started.\n */\n readonly applied: WritableSignal<Exclude<ThemeMode, 'auto'>>;\n\n #themeApplied = false;\n\n constructor(\n /**\n * The default light theme.\n */\n // eslint-disable-next-line @angular-eslint/prefer-inject\n private readonly defaultLight: Exclude<ThemeMode, 'auto'>,\n /**\n * The default dark theme.\n */\n // eslint-disable-next-line @angular-eslint/prefer-inject\n private readonly defaultDark: Exclude<ThemeMode, 'auto'>\n ) {\n let defaultMode: Exclude<ThemeMode, 'auto'> = defaultLight;\n if (isPlatformBrowser(inject(PLATFORM_ID))) {\n defaultMode = window.matchMedia('(prefers-color-scheme: dark)').matches ? defaultDark : defaultLight;\n }\n this.#preferred = signal<ThemeMode>(defaultMode);\n this.#system = signal<Exclude<ThemeMode, 'auto'>>(defaultMode);\n this.applied = signal<Exclude<ThemeMode, 'auto'>>(defaultMode);\n\n this.selected = computed(() =>\n this.allOptions.includes(this.#preferred())\n ? this.#preferred()\n : this.allOptions.includes('auto' as ThemeMode)\n ? ('auto' as ThemeMode)\n : defaultMode\n );\n this.#toApply = computed(() => {\n const selected = this.selected();\n return selected === 'auto' ? this.#system() : (selected as Exclude<ThemeMode, 'auto'>);\n });\n }\n\n protected init() {\n if (isPlatformBrowser(inject(PLATFORM_ID))) {\n // System theme preference change handling\n if (this.allOptions.includes('auto' as ThemeMode)) {\n window\n .matchMedia('(prefers-color-scheme: dark)')\n .addEventListener('change', (event) =>\n this.#system.set(event.matches ? this.defaultDark : this.defaultLight)\n );\n }\n\n // Local storage handling\n if (this.syncLocalStorage) {\n this.#preferred.set(window.localStorage.getItem(this.storageKey) as ThemeMode);\n effect(() => window.localStorage.setItem(this.storageKey, this.selected()));\n\n // Updates the theme across tabs/frames\n // Note: it is raised only in \"other\" tabs/frames, not the one that changes the storage\n window.addEventListener('storage', ({ key, newValue }) => {\n if (key === this.storageKey) {\n this.#preferred.set((newValue as ThemeMode) ?? 'auto');\n }\n });\n }\n\n // In the browser - apply with animation (maybe)\n effect(() => void this.#applyThemeWithAnimation(this.#toApply()));\n } else {\n // on the server - just apply directly\n effect(() => this.#applyTheme(this.#toApply()));\n }\n\n // valid selected theme and actually applied theme\n\n this.applied.set(this.#toApply());\n }\n\n setTheme(theme: ThemeMode) {\n this.#preferred.set(theme);\n }\n\n #applyTheme(theme: Exclude<ThemeMode, 'auto'>) {\n document.documentElement.setAttribute('data-df-theme', theme);\n this.#themeApplied = true;\n this.applied.set(theme);\n }\n\n async #applyThemeWithAnimation(theme: Exclude<ThemeMode, 'auto'>) {\n // Use View Transitions API if available and user has not requested reduced motion\n if (\n !this.#themeApplied ||\n !this.viewTransitionAnimation ||\n !document.startViewTransition ||\n window.parent !== window ||\n window.matchMedia('(prefers-reduced-motion: reduce)').matches\n ) {\n this.#applyTheme(theme);\n return;\n }\n\n const { setup, animation, cleanup } = this.viewTransitionAnimation;\n\n if (setup) {\n await setup();\n }\n\n const viewTransition = document.startViewTransition(() => this.#applyTheme(theme));\n await viewTransition.ready;\n\n await animation(theme);\n\n await viewTransition.finished;\n\n if (cleanup) {\n await cleanup();\n }\n }\n}\n\n/**\n * The modes supported by the {@link DfThemeDefaultService}.\n *\n * @since 21.1\n */\nexport type DfThemeDefaultMode = 'auto' | 'light' | 'dark';\n/**\n * The storage key used by the {@link DfThemeDefaultService} to persist the user's theme selection in local storage.\n *\n * @since 21.1\n */\nexport const DF_THEME_DEFAULT_STORAGE_KEY = 'df-theme';\n\n/**\n * The default {@link DfThemeService} implementation.\n *\n * - It supports the modes `auto`, `light` and `dark`, and uses local storage to persist the user's selection.\n * - It provides a cross fade transition when changing themes.\n *\n * @since 21.1\n */\n@Injectable()\nexport class DfThemeDefaultService extends DfThemeService<DfThemeDefaultMode> {\n override readonly allOptions = ['auto', 'light', 'dark'] satisfies DfThemeDefaultMode[];\n override readonly storageKey = DF_THEME_DEFAULT_STORAGE_KEY;\n override readonly syncLocalStorage = true;\n\n private styleElement!: HTMLStyleElement;\n\n override readonly viewTransitionAnimation = {\n setup: () => {\n this.styleElement = document.createElement('style');\n this.styleElement.textContent = `\n ::view-transition-old(*),\n ::view-transition-new(*) {\n animation: false !important;\n mix-blend-mode: normal !important;\n }\n * {\n transition: none !important;\n } \n ::view-transition-old(root) {\n animation: fade-out 300ms ease both !important;\n }\n ::view-transition-new(root) {\n animation: fade-in 300ms ease both !important;\n }\n @keyframes fade-out {\n from { opacity: 1; }\n to { opacity: 0; }\n }\n @keyframes fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n .df-app-container > .df-topnav > .df-topnav-header {\n view-transition-name: unset !important;\n }\n `;\n document.head.appendChild(this.styleElement);\n },\n animation: () => {},\n cleanup: () => {\n this.styleElement.remove();\n }\n };\n\n constructor() {\n super('light', 'dark');\n this.init();\n }\n}\n\n/**\n * Provides the {@link DfThemeService} and initializes it on app startup.\n *\n * This should be included in the providers array of the root module or component to ensure the theme service is available and initialized when the application starts.\n *\n * @since 21.1\n */\nexport const provideDfThemeService = () =>\n provideAppInitializer(() => {\n inject(DfThemeService);\n });\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAiCA;;;;;;AAMG;MAKmB,cAAc,CAAA;AAmBzB,IAAA,UAAU;AACV,IAAA,OAAO;AACP,IAAA,QAAQ;IAYjB,aAAa,GAAG,KAAK;AAErB,IAAA,WAAA;AACE;;AAEG;;IAEc,YAAwC;AACzD;;AAEG;;IAEc,WAAuC,EAAA;QALvC,IAAA,CAAA,YAAY,GAAZ,YAAY;QAKZ,IAAA,CAAA,WAAW,GAAX,WAAW;QAE5B,IAAI,WAAW,GAA+B,YAAY;QAC1D,IAAI,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE;AAC1C,YAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC,OAAO,GAAG,WAAW,GAAG,YAAY;QACtG;AACA,QAAA,IAAI,CAAC,UAAU,GAAG,MAAM,CAAY,WAAW,sDAAC;AAChD,QAAA,IAAI,CAAC,OAAO,GAAG,MAAM,CAA6B,WAAW,mDAAC;AAC9D,QAAA,IAAI,CAAC,OAAO,GAAG,MAAM,CAA6B,WAAW,mDAAC;AAE9D,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,MACvB,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE;AACxC,cAAE,IAAI,CAAC,UAAU;cACf,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAmB;AAC5C,kBAAG;kBACD,WAAW,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,G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MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAArB,qBAAqB,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBADjC;;AAoDD;;;;;;AAMG;AACI,MAAM,qBAAqB,GAAG,MACnC,qBAAqB,CAAC,MAAK;IACzB,MAAM,CAAC,cAAc,CAAC;AACxB,CAAC;;AClRH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"design-factory-angular-theme.mjs","sources":["../../theme/theme.service.ts","../../theme/design-factory-angular-theme.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport {\n computed,\n DOCUMENT,\n effect,\n inject,\n Injectable,\n PLATFORM_ID,\n provideAppInitializer,\n Signal,\n signal,\n WritableSignal\n} from '@angular/core';\n\n/**\n * The view transition animation configuration for {@link DfThemeService}.\n *\n * @since 21.1\n */\nexport type DfViewTransitionAnimation<T extends string> = {\n /**\n * The setup function is called before the view transition starts. It can be used to prepare the DOM for the upcoming theme change, e.g. by adding necessary styles or classes.\n */\n setup?: () => Promise<void> | void;\n /**\n * The animation function is called after the view transition has started. It can be used to perform any necessary animations during the theme change. The function receives the theme that is being applied as an argument.\n */\n animation: (theme: T) => Promise<void> | void;\n /**\n * The cleanup function is called after the view transition has completed. It can be used to remove any temporary styles or classes added during the setup or animation phases.\n */\n cleanup?: () => Promise<void> | void;\n};\n\n/**\n * The DfThemeService is an abstract service that manages the theme state of the application.\n *\n * It provides functionality to select and apply themes, persist user preferences, and handle system theme changes.\n *\n * @since 21.1\n */\n@Injectable({\n providedIn: 'root',\n useFactory: () => new DfThemeDefaultService()\n})\nexport abstract class DfThemeService<ThemeMode extends string> {\n // The configuration of the theme service that must be provided by concrete implementations\n /**\n * An array of all available theme options. Must include at least the default light and dark themes, and optionally 'auto' if the service should support automatic theme selection based on system preferences.\n */\n abstract readonly allOptions: ThemeMode[];\n /**\n * The key used to store the user's theme preference in local storage. This is required if `syncLocalStorage` is true.\n */\n abstract readonly storageKey: string;\n /**\n * Whether to synchronize the user's theme selection with local storage. If true, the service will persist the selected theme in local storage and listen for changes to update the theme across tabs/frames.\n */\n abstract readonly syncLocalStorage: boolean;\n /**\n * The view transition animation configuration. If provided, the service will use the View Transitions API to animate theme changes. If not provided, theme changes will be applied immediately without animation.\n */\n abstract readonly viewTransitionAnimation: DfViewTransitionAnimation<Exclude<ThemeMode, 'auto'>> | undefined;\n\n readonly #document = inject(DOCUMENT);\n readonly #preferred: WritableSignal<ThemeMode>;\n readonly #system: WritableSignal<Exclude<ThemeMode, 'auto'>>;\n readonly #toApply: Signal<Exclude<ThemeMode, 'auto'>>;\n\n /**\n * The currently selected theme option by the user.\n */\n readonly selected: Signal<ThemeMode>;\n\n /**\n * The currently applied theme. This signal is triggered after the view transition has started.\n */\n readonly applied: WritableSignal<Exclude<ThemeMode, 'auto'>>;\n\n #themeApplied = false;\n\n constructor(\n /**\n * The default light theme.\n */\n // eslint-disable-next-line @angular-eslint/prefer-inject\n private readonly defaultLight: Exclude<ThemeMode, 'auto'>,\n /**\n * The default dark theme.\n */\n // eslint-disable-next-line @angular-eslint/prefer-inject\n private readonly defaultDark: Exclude<ThemeMode, 'auto'>\n ) {\n let defaultMode: Exclude<ThemeMode, 'auto'> = defaultLight;\n if (isPlatformBrowser(inject(PLATFORM_ID))) {\n defaultMode = window.matchMedia('(prefers-color-scheme: dark)').matches ? defaultDark : defaultLight;\n }\n this.#preferred = signal<ThemeMode>(defaultMode);\n this.#system = signal<Exclude<ThemeMode, 'auto'>>(defaultMode);\n this.applied = signal<Exclude<ThemeMode, 'auto'>>(defaultMode);\n\n this.selected = computed(() =>\n this.allOptions.includes(this.#preferred())\n ? this.#preferred()\n : this.allOptions.includes('auto' as ThemeMode)\n ? ('auto' as ThemeMode)\n : defaultMode\n );\n this.#toApply = computed(() => {\n const selected = this.selected();\n return selected === 'auto' ? this.#system() : (selected as Exclude<ThemeMode, 'auto'>);\n });\n }\n\n protected init() {\n if (isPlatformBrowser(inject(PLATFORM_ID))) {\n // System theme preference change handling\n if (this.allOptions.includes('auto' as ThemeMode)) {\n window\n .matchMedia('(prefers-color-scheme: dark)')\n .addEventListener('change', (event) =>\n this.#system.set(event.matches ? this.defaultDark : this.defaultLight)\n );\n }\n\n // Local storage handling\n if (this.syncLocalStorage) {\n this.#preferred.set(window.localStorage.getItem(this.storageKey) as ThemeMode);\n effect(() => window.localStorage.setItem(this.storageKey, this.selected()));\n\n // Updates the theme across tabs/frames\n // Note: it is raised only in \"other\" tabs/frames, not the one that changes the storage\n window.addEventListener('storage', ({ key, newValue }) => {\n if (key === this.storageKey) {\n this.#preferred.set((newValue as ThemeMode) ?? 'auto');\n }\n });\n }\n\n // In the browser - apply with animation (maybe)\n effect(() => void this.#applyThemeWithAnimation(this.#toApply()));\n } else {\n // on the server - just apply directly\n effect(() => this.#applyTheme(this.#toApply()));\n }\n\n // valid selected theme and actually applied theme\n\n this.applied.set(this.#toApply());\n }\n\n setTheme(theme: ThemeMode) {\n this.#preferred.set(theme);\n }\n\n #applyTheme(theme: Exclude<ThemeMode, 'auto'>) {\n this.#document.documentElement.setAttribute('data-df-theme', theme);\n this.#themeApplied = true;\n this.applied.set(theme);\n }\n\n async #applyThemeWithAnimation(theme: Exclude<ThemeMode, 'auto'>) {\n // Use View Transitions API if available and user has not requested reduced motion\n if (\n !this.#themeApplied ||\n !this.viewTransitionAnimation ||\n !this.#document.startViewTransition ||\n window.parent !== window ||\n window.matchMedia('(prefers-reduced-motion: reduce)').matches\n ) {\n this.#applyTheme(theme);\n return;\n }\n\n const { setup, animation, cleanup } = this.viewTransitionAnimation;\n\n if (setup) {\n await setup();\n }\n\n const viewTransition = this.#document.startViewTransition(() => this.#applyTheme(theme));\n await viewTransition.ready;\n\n try {\n await animation(theme);\n } finally {\n await viewTransition.finished;\n\n if (cleanup) {\n await cleanup();\n }\n }\n }\n}\n\n/**\n * The modes supported by the {@link DfThemeDefaultService}.\n *\n * @since 21.1\n */\nexport type DfThemeDefaultMode = 'auto' | 'light' | 'dark';\n/**\n * The storage key used by the {@link DfThemeDefaultService} to persist the user's theme selection in local storage.\n *\n * @since 21.1\n */\nexport const DF_THEME_DEFAULT_STORAGE_KEY = 'df-theme';\n\n/**\n * The default {@link DfThemeService} implementation.\n *\n * - It supports the modes `auto`, `light` and `dark`, and uses local storage to persist the user's selection.\n * - It provides a cross fade transition when changing themes.\n *\n * @since 21.1\n */\n@Injectable()\nexport class DfThemeDefaultService extends DfThemeService<DfThemeDefaultMode> {\n override readonly allOptions = ['auto', 'light', 'dark'] satisfies DfThemeDefaultMode[];\n override readonly storageKey = DF_THEME_DEFAULT_STORAGE_KEY;\n override readonly syncLocalStorage = true;\n\n private styleElement!: HTMLStyleElement;\n\n override readonly viewTransitionAnimation = {\n setup: () => {\n this.styleElement = document.createElement('style');\n this.styleElement.textContent = `\n ::view-transition-old(*),\n ::view-transition-new(*) {\n animation: false !important;\n mix-blend-mode: normal !important;\n }\n * {\n transition: none !important;\n } \n ::view-transition-old(root) {\n animation: fade-out 300ms ease both !important;\n }\n ::view-transition-new(root) {\n animation: fade-in 300ms ease both !important;\n }\n @keyframes fade-out {\n from { opacity: 1; }\n to { opacity: 0; }\n }\n @keyframes fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n .df-topnav-header {\n view-transition-name: unset !important;\n }\n `;\n document.head.appendChild(this.styleElement);\n },\n animation: () => {},\n cleanup: () => {\n this.styleElement.remove();\n }\n };\n\n constructor() {\n super('light', 'dark');\n this.init();\n }\n}\n\n/**\n * Provides the {@link DfThemeService} and initializes it on app startup.\n *\n * This should be included in the providers array of the root module or component to ensure the theme service is available and initialized when the application starts.\n *\n * @since 21.1\n */\nexport const provideDfThemeService = () =>\n provideAppInitializer(() => {\n inject(DfThemeService);\n });\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAkCA;;;;;;AAMG;MAKmB,cAAc,CAAA;AAmBzB,IAAA,SA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172 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, model, booleanAttribute, signal, computed, forwardRef, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
import { generateId } from '@design-factory/core/utils/id';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Design Factory toggle switch.
|
|
8
|
+
*
|
|
9
|
+
* Renders a native `<input type="checkbox" role="switch">` underneath with a custom visual.
|
|
10
|
+
* Any projected content is rendered inline-end of the switch (typically the on/off state text,
|
|
11
|
+
* e.g. `{{ checked() ? 'On' : 'Off' }}`).
|
|
12
|
+
*
|
|
13
|
+
* Form integration is handled through `ControlValueAccessor`; `disabled`, `readonly`, and
|
|
14
|
+
* `required` states flow from the bound Angular form control.
|
|
15
|
+
*
|
|
16
|
+
* @experimental 22.0
|
|
17
|
+
*/
|
|
18
|
+
class DfToggle {
|
|
19
|
+
constructor() {
|
|
20
|
+
/**
|
|
21
|
+
* ID of the internal `<input>` element.
|
|
22
|
+
*
|
|
23
|
+
* Defaults to a generated `dfId-[counter]` so the internal input always has a stable id that
|
|
24
|
+
* surrounding labels or form-field markup can target.
|
|
25
|
+
*
|
|
26
|
+
* @defaultValue `'dfId-[number]'`
|
|
27
|
+
*/
|
|
28
|
+
this.id = input(generateId(), /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
30
|
+
/**
|
|
31
|
+
* Checked state of the toggle.
|
|
32
|
+
*
|
|
33
|
+
* @defaultValue `false`
|
|
34
|
+
*/
|
|
35
|
+
this.checked = model(false, /* @ts-ignore */
|
|
36
|
+
...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
37
|
+
/**
|
|
38
|
+
* Size of the toggle.
|
|
39
|
+
*
|
|
40
|
+
* @defaultValue `'md'`
|
|
41
|
+
*/
|
|
42
|
+
this.size = input('md', /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
44
|
+
/**
|
|
45
|
+
* Accessible name for the internal `<input>`. Use when the toggle has no visible label
|
|
46
|
+
* (e.g. when projected content describes state, not purpose).
|
|
47
|
+
*
|
|
48
|
+
* Forwarded to the internal `<input>` as `aria-label`. Prefer {@link ariaLabelledby} when a
|
|
49
|
+
* visible label element exists.
|
|
50
|
+
*/
|
|
51
|
+
this.ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
52
|
+
/**
|
|
53
|
+
* IDs of one or more elements that label the internal `<input>`.
|
|
54
|
+
*
|
|
55
|
+
* Forwarded to the internal `<input>` as `aria-labelledby`. Used by the surrounding form-field
|
|
56
|
+
* markup to wire its label element to the toggle.
|
|
57
|
+
*/
|
|
58
|
+
this.ariaLabelledby = input(null, { ...(ngDevMode ? { debugName: "ariaLabelledby" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
|
|
59
|
+
/**
|
|
60
|
+
* Disabled state of the toggle.
|
|
61
|
+
*
|
|
62
|
+
* Combines additively with the disabled state driven by `ControlValueAccessor.setDisabledState`
|
|
63
|
+
* (typically `formControl.disable()`): the toggle is disabled if **either** source asks for it.
|
|
64
|
+
*
|
|
65
|
+
* Concrete behavior:
|
|
66
|
+
* - `[disabled]="true"` disables the toggle regardless of the form control state.
|
|
67
|
+
* - `formControl.disable()` disables the toggle regardless of the `[disabled]` value.
|
|
68
|
+
* - To re-enable, **both** sources must agree: clear `[disabled]` (or set it to `false`) **and**
|
|
69
|
+
* call `formControl.enable()`.
|
|
70
|
+
* - There is no precedence/last-write-wins: the order in which the two sources change does not
|
|
71
|
+
* matter. The combined state is recomputed reactively whenever either source changes.
|
|
72
|
+
*
|
|
73
|
+
* Use the input for ad-hoc disabling that does not need a form control (e.g. gating on a sibling
|
|
74
|
+
* signal); use the form control when the toggle is part of an Angular form.
|
|
75
|
+
*
|
|
76
|
+
* @defaultValue `false`
|
|
77
|
+
*/
|
|
78
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
79
|
+
/** Disabled state driven by `ControlValueAccessor.setDisabledState` (form-driven channel). */
|
|
80
|
+
this.cvaDisabled = signal(false, /* @ts-ignore */
|
|
81
|
+
...(ngDevMode ? [{ debugName: "cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
82
|
+
/** Effective disabled state forwarded to the internal `<input>`: input OR form-driven. */
|
|
83
|
+
this.effectiveDisabled = computed(() => this.disabled() || this.cvaDisabled(), /* @ts-ignore */
|
|
84
|
+
...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
|
|
85
|
+
this.onChange = () => { };
|
|
86
|
+
this.onTouched = () => { };
|
|
87
|
+
}
|
|
88
|
+
handleChange(event) {
|
|
89
|
+
const next = event.target.checked;
|
|
90
|
+
this.checked.set(next);
|
|
91
|
+
this.onChange(next);
|
|
92
|
+
}
|
|
93
|
+
handleBlur() {
|
|
94
|
+
this.onTouched();
|
|
95
|
+
}
|
|
96
|
+
/** @internal */
|
|
97
|
+
writeValue(value) {
|
|
98
|
+
this.checked.set(!!value);
|
|
99
|
+
}
|
|
100
|
+
/** @internal */
|
|
101
|
+
registerOnChange(fn) {
|
|
102
|
+
this.onChange = fn;
|
|
103
|
+
}
|
|
104
|
+
/** @internal */
|
|
105
|
+
registerOnTouched(fn) {
|
|
106
|
+
this.onTouched = fn;
|
|
107
|
+
}
|
|
108
|
+
/** @internal */
|
|
109
|
+
setDisabledState(isDisabled) {
|
|
110
|
+
this.cvaDisabled.set(isDisabled);
|
|
111
|
+
}
|
|
112
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: DfToggle, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
113
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.4", type: DfToggle, isStandalone: true, selector: "df-toggle", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, host: { properties: { "class.df-toggle-sm": "size() === 'sm'", "class.df-toggle-lg": "size() === 'lg'", "attr.id": "null", "attr.aria-label": "null", "attr.aria-labelledby": "null" }, classAttribute: "df-toggle" }, providers: [
|
|
114
|
+
{
|
|
115
|
+
provide: NG_VALUE_ACCESSOR,
|
|
116
|
+
useExisting: forwardRef(() => DfToggle),
|
|
117
|
+
multi: true
|
|
118
|
+
}
|
|
119
|
+
], ngImport: i0, template: `
|
|
120
|
+
<input
|
|
121
|
+
type="checkbox"
|
|
122
|
+
role="switch"
|
|
123
|
+
class="df-toggle-input"
|
|
124
|
+
[id]="id()"
|
|
125
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
126
|
+
[attr.aria-labelledby]="ariaLabelledby() || null"
|
|
127
|
+
[checked]="checked()"
|
|
128
|
+
[disabled]="effectiveDisabled()"
|
|
129
|
+
(change)="handleChange($event)"
|
|
130
|
+
(blur)="handleBlur()"
|
|
131
|
+
/>
|
|
132
|
+
<span class="df-toggle-content"><ng-content /></span>
|
|
133
|
+
`, isInline: true, styles: [".df-toggle{display:inline-flex;align-items:center;gap:var(--df-spacing-3);vertical-align:middle;cursor:pointer}.df-toggle:has(.df-toggle-input:disabled){cursor:not-allowed;color:var(--df-color-inert-neutral-main-foreground)}.df-toggle-input{appearance:none;flex:none;width:48px;height:24px;margin:0;padding:0;border:1px solid var(--df-color-neutral-main-default-border);border-radius:var(--df-borderRadius-main-rounded);background-color:var(--df-color-neutral-alt-default-background);cursor:inherit;position:relative}.df-toggle-input:before{content:\"\";position:absolute;inset:3px 2px;background-color:var(--df-color-neutral-main-default-background);-webkit-mask-image:url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'><circle cx='1' cy='1' r='1' fill='black'/></svg>\");mask-image:url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'><circle cx='1' cy='1' r='1' fill='black'/></svg>\");-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:16px;mask-size:16px;-webkit-mask-position:left center;mask-position:left center;transition:mask-position .15s ease-in-out}@media(prefers-reduced-motion:reduce){.df-toggle-input:before{transition:none}}.df-toggle-input:checked{background-color:var(--df-color-primary-main-default-background);border-color:var(--df-color-primary-main-default-border)}.df-toggle-input:checked:before{-webkit-mask-position:right center;mask-position:right center;background-color:var(--df-color-primary-alt-default-background)}.df-toggle-input:checked:focus-visible{--df-box-shadow-color: var(--df-color-primary-main-default-border)}.df-toggle-input:focus-visible{outline:0;--df-box-shadow-color: var(--df-color-neutral-main-default-border);box-shadow:0 0 0 2px var(--df-color-inert-neutral-main-background),0 0 0 4px var(--df-box-shadow-color)}.df-toggle-input:disabled{border-color:var(--df-color-disabled-main-border);background-color:var(--df-color-disabled-main-background)}.df-toggle-input:disabled:before{background-color:var(--df-color-disabled-alt-background)}.df-toggle-input:disabled:checked{background-color:var(--df-color-disabled-alt-background)}.df-toggle-input:disabled:checked:before{background-color:var(--df-color-disabled-main-background)}[dir=rtl] .df-toggle-input:before{-webkit-mask-position:right center;mask-position:right center}[dir=rtl] .df-toggle-input:checked:before{-webkit-mask-position:left center;mask-position:left center}.df-toggle-sm .df-toggle-input{width:37px;height:18px}.df-toggle-sm .df-toggle-input:before{inset:2px;-webkit-mask-size:12px;mask-size:12px}.df-toggle-lg .df-toggle-input{width:61px;height:30px}.df-toggle-lg .df-toggle-input:before{inset:2px;-webkit-mask-size:24px;mask-size:24px}.df-toggle-content{font-weight:var(--df-typo-weight-medium)}.df-toggle-content:empty{display:none}\n"], encapsulation: i0.ViewEncapsulation.None }); }
|
|
134
|
+
}
|
|
135
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: DfToggle, decorators: [{
|
|
136
|
+
type: Component,
|
|
137
|
+
args: [{ selector: 'df-toggle', encapsulation: ViewEncapsulation.None, providers: [
|
|
138
|
+
{
|
|
139
|
+
provide: NG_VALUE_ACCESSOR,
|
|
140
|
+
useExisting: forwardRef(() => DfToggle),
|
|
141
|
+
multi: true
|
|
142
|
+
}
|
|
143
|
+
], host: {
|
|
144
|
+
class: 'df-toggle',
|
|
145
|
+
'[class.df-toggle-sm]': `size() === 'sm'`,
|
|
146
|
+
'[class.df-toggle-lg]': `size() === 'lg'`,
|
|
147
|
+
'[attr.id]': 'null',
|
|
148
|
+
'[attr.aria-label]': 'null',
|
|
149
|
+
'[attr.aria-labelledby]': 'null'
|
|
150
|
+
}, template: `
|
|
151
|
+
<input
|
|
152
|
+
type="checkbox"
|
|
153
|
+
role="switch"
|
|
154
|
+
class="df-toggle-input"
|
|
155
|
+
[id]="id()"
|
|
156
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
157
|
+
[attr.aria-labelledby]="ariaLabelledby() || null"
|
|
158
|
+
[checked]="checked()"
|
|
159
|
+
[disabled]="effectiveDisabled()"
|
|
160
|
+
(change)="handleChange($event)"
|
|
161
|
+
(blur)="handleBlur()"
|
|
162
|
+
/>
|
|
163
|
+
<span class="df-toggle-content"><ng-content /></span>
|
|
164
|
+
`, styles: [".df-toggle{display:inline-flex;align-items:center;gap:var(--df-spacing-3);vertical-align:middle;cursor:pointer}.df-toggle:has(.df-toggle-input:disabled){cursor:not-allowed;color:var(--df-color-inert-neutral-main-foreground)}.df-toggle-input{appearance:none;flex:none;width:48px;height:24px;margin:0;padding:0;border:1px solid var(--df-color-neutral-main-default-border);border-radius:var(--df-borderRadius-main-rounded);background-color:var(--df-color-neutral-alt-default-background);cursor:inherit;position:relative}.df-toggle-input:before{content:\"\";position:absolute;inset:3px 2px;background-color:var(--df-color-neutral-main-default-background);-webkit-mask-image:url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'><circle cx='1' cy='1' r='1' fill='black'/></svg>\");mask-image:url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'><circle cx='1' cy='1' r='1' fill='black'/></svg>\");-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:16px;mask-size:16px;-webkit-mask-position:left center;mask-position:left center;transition:mask-position .15s ease-in-out}@media(prefers-reduced-motion:reduce){.df-toggle-input:before{transition:none}}.df-toggle-input:checked{background-color:var(--df-color-primary-main-default-background);border-color:var(--df-color-primary-main-default-border)}.df-toggle-input:checked:before{-webkit-mask-position:right center;mask-position:right center;background-color:var(--df-color-primary-alt-default-background)}.df-toggle-input:checked:focus-visible{--df-box-shadow-color: var(--df-color-primary-main-default-border)}.df-toggle-input:focus-visible{outline:0;--df-box-shadow-color: var(--df-color-neutral-main-default-border);box-shadow:0 0 0 2px var(--df-color-inert-neutral-main-background),0 0 0 4px var(--df-box-shadow-color)}.df-toggle-input:disabled{border-color:var(--df-color-disabled-main-border);background-color:var(--df-color-disabled-main-background)}.df-toggle-input:disabled:before{background-color:var(--df-color-disabled-alt-background)}.df-toggle-input:disabled:checked{background-color:var(--df-color-disabled-alt-background)}.df-toggle-input:disabled:checked:before{background-color:var(--df-color-disabled-main-background)}[dir=rtl] .df-toggle-input:before{-webkit-mask-position:right center;mask-position:right center}[dir=rtl] .df-toggle-input:checked:before{-webkit-mask-position:left center;mask-position:left center}.df-toggle-sm .df-toggle-input{width:37px;height:18px}.df-toggle-sm .df-toggle-input:before{inset:2px;-webkit-mask-size:12px;mask-size:12px}.df-toggle-lg .df-toggle-input{width:61px;height:30px}.df-toggle-lg .df-toggle-input:before{inset:2px;-webkit-mask-size:24px;mask-size:24px}.df-toggle-content{font-weight:var(--df-typo-weight-medium)}.df-toggle-content:empty{display:none}\n"] }]
|
|
165
|
+
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Generated bundle index. Do not edit.
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
export { DfToggle };
|
|
172
|
+
//# sourceMappingURL=design-factory-angular-toggle.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-factory-angular-toggle.mjs","sources":["../../toggle/toggle.ts","../../toggle/design-factory-angular-toggle.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n forwardRef,\n input,\n model,\n signal,\n ViewEncapsulation\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { generateId } from '@design-factory/core/utils/id';\n\n/**\n * Design Factory toggle switch.\n *\n * Renders a native `<input type=\"checkbox\" role=\"switch\">` underneath with a custom visual.\n * Any projected content is rendered inline-end of the switch (typically the on/off state text,\n * e.g. `{{ checked() ? 'On' : 'Off' }}`).\n *\n * Form integration is handled through `ControlValueAccessor`; `disabled`, `readonly`, and\n * `required` states flow from the bound Angular form control.\n *\n * @experimental 22.0\n */\n@Component({\n selector: 'df-toggle',\n encapsulation: ViewEncapsulation.None,\n styles: \"@use '@design-factory/components-styles/toggle';\",\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DfToggle),\n multi: true\n }\n ],\n host: {\n class: 'df-toggle',\n '[class.df-toggle-sm]': `size() === 'sm'`,\n '[class.df-toggle-lg]': `size() === 'lg'`,\n '[attr.id]': 'null',\n '[attr.aria-label]': 'null',\n '[attr.aria-labelledby]': 'null'\n },\n template: `\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"df-toggle-input\"\n [id]=\"id()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledby() || null\"\n [checked]=\"checked()\"\n [disabled]=\"effectiveDisabled()\"\n (change)=\"handleChange($event)\"\n (blur)=\"handleBlur()\"\n />\n <span class=\"df-toggle-content\"><ng-content /></span>\n `\n})\nexport class DfToggle implements ControlValueAccessor {\n /**\n * ID of the internal `<input>` element.\n *\n * Defaults to a generated `dfId-[counter]` so the internal input always has a stable id that\n * surrounding labels or form-field markup can target.\n *\n * @defaultValue `'dfId-[number]'`\n */\n readonly id = input<string>(generateId());\n\n /**\n * Checked state of the toggle.\n *\n * @defaultValue `false`\n */\n readonly checked = model<boolean>(false);\n\n /**\n * Size of the toggle.\n *\n * @defaultValue `'md'`\n */\n readonly size = input<'sm' | 'md' | 'lg'>('md');\n\n /**\n * Accessible name for the internal `<input>`. Use when the toggle has no visible label\n * (e.g. when projected content describes state, not purpose).\n *\n * Forwarded to the internal `<input>` as `aria-label`. Prefer {@link ariaLabelledby} when a\n * visible label element exists.\n */\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n /**\n * IDs of one or more elements that label the internal `<input>`.\n *\n * Forwarded to the internal `<input>` as `aria-labelledby`. Used by the surrounding form-field\n * markup to wire its label element to the toggle.\n */\n readonly ariaLabelledby = input<string | null>(null, { alias: 'aria-labelledby' });\n\n /**\n * Disabled state of the toggle.\n *\n * Combines additively with the disabled state driven by `ControlValueAccessor.setDisabledState`\n * (typically `formControl.disable()`): the toggle is disabled if **either** source asks for it.\n *\n * Concrete behavior:\n * - `[disabled]=\"true\"` disables the toggle regardless of the form control state.\n * - `formControl.disable()` disables the toggle regardless of the `[disabled]` value.\n * - To re-enable, **both** sources must agree: clear `[disabled]` (or set it to `false`) **and**\n * call `formControl.enable()`.\n * - There is no precedence/last-write-wins: the order in which the two sources change does not\n * matter. The combined state is recomputed reactively whenever either source changes.\n *\n * Use the input for ad-hoc disabling that does not need a form control (e.g. gating on a sibling\n * signal); use the form control when the toggle is part of an Angular form.\n *\n * @defaultValue `false`\n */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n /** Disabled state driven by `ControlValueAccessor.setDisabledState` (form-driven channel). */\n private readonly cvaDisabled = signal(false);\n\n /** Effective disabled state forwarded to the internal `<input>`: input OR form-driven. */\n protected readonly effectiveDisabled = computed(() => this.disabled() || this.cvaDisabled());\n\n private onChange: (value: boolean) => void = () => {};\n private onTouched: () => void = () => {};\n\n protected handleChange(event: Event): void {\n const next = (event.target as HTMLInputElement).checked;\n this.checked.set(next);\n this.onChange(next);\n }\n\n protected handleBlur(): void {\n this.onTouched();\n }\n\n /** @internal */\n writeValue(value: boolean): void {\n this.checked.set(!!value);\n }\n\n /** @internal */\n registerOnChange(fn: (value: boolean) => void): void {\n this.onChange = fn;\n }\n\n /** @internal */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @internal */\n setDisabledState(isDisabled: boolean): void {\n this.cvaDisabled.set(isDisabled);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAaA;;;;;;;;;;;AAWG;MAoCU,QAAQ,CAAA;AAnCrB,IAAA,WAAA,GAAA;AAoCE;;;;;;;AAOG;AACM,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAS,UAAU,EAAE;+EAAC;AAE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wBAAA,WAAW,EAAE,MAAM;AACnB,wBAAA,mBAAmB,EAAE,MAAM;AAC3B,wBAAA,wBAAwB,EAAE;qBAC3B,EAAA,QAAA,EACS;;;;;;;;;;;;;;AAcT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,uxFAAA,CAAA,EAAA;;;AC1DH;;AAEG;;;;"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, ViewEncapsulation, Component, inject, ApplicationRef, DOCUMENT, Injector, EnvironmentInjector, effect, untracked, createComponent, Directive } from '@angular/core';
|
|
3
|
+
import { AgnosWidgetDirective, callWidgetFactory, useDirectiveForHost, useDirectiveForElement, auBooleanAttribute, provideDfComponentConfig, injectDfComponentConfig } from '@design-factory/angular/internals';
|
|
4
|
+
import { createTooltip } from '@design-factory/core/components/tooltip';
|
|
5
|
+
|
|
6
|
+
class DfTooltipWindow {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.widget = input.required(/* @ts-ignore */
|
|
9
|
+
...(ngDevMode ? [{ debugName: "widget" }] : /* istanbul ignore next */ []));
|
|
10
|
+
}
|
|
11
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: DfTooltipWindow, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.4", type: DfTooltipWindow, isStandalone: true, selector: "df-tooltip-window", inputs: { widget: { classPropertyName: "widget", publicName: "widget", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.df-tooltip-sm": "widget().state.size() === 'sm'", "class.df-tooltip-lg": "widget().state.size() === 'lg'" }, classAttribute: "df-tooltip-window" }, ngImport: i0, template: `{{ widget().state.content() }}`, isInline: true, styles: [".df-fade{transition:opacity .15s linear}@media(prefers-reduced-motion:reduce){.df-fade{transition:none}}.df-fade:not(.df-show){opacity:0}.df-hidden{display:none!important}.df-tooltip-window{z-index:2020;display:block;max-width:320px;padding:var(--df-spacing-2) var(--df-spacing-5);font-size:var(--df-typo-sizing-default);color:var(--df-color-inert-neutral-alt-foreground);text-align:center;background-color:var(--df-color-tooltip-background);border-radius:var(--df-borderRadius-main-medium);overflow-wrap:break-word}.df-tooltip-window.df-tooltip-sm{border-radius:var(--df-borderRadius-main-small);font-size:var(--df-typo-sizing-small);padding:var(--df-spacing-2) var(--df-spacing-3)}.df-tooltip-window.df-tooltip-lg{border-radius:var(--df-borderRadius-main-large);font-size:var(--df-typo-sizing-large);padding:var(--df-spacing-3) var(--df-spacing-6)}\n"], encapsulation: i0.ViewEncapsulation.None }); }
|
|
13
|
+
}
|
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: DfTooltipWindow, decorators: [{
|
|
15
|
+
type: Component,
|
|
16
|
+
args: [{ selector: 'df-tooltip-window', encapsulation: ViewEncapsulation.None, host: {
|
|
17
|
+
class: 'df-tooltip-window',
|
|
18
|
+
'[class.df-tooltip-sm]': "widget().state.size() === 'sm'",
|
|
19
|
+
'[class.df-tooltip-lg]': "widget().state.size() === 'lg'"
|
|
20
|
+
}, template: `{{ widget().state.content() }}`, styles: [".df-fade{transition:opacity .15s linear}@media(prefers-reduced-motion:reduce){.df-fade{transition:none}}.df-fade:not(.df-show){opacity:0}.df-hidden{display:none!important}.df-tooltip-window{z-index:2020;display:block;max-width:320px;padding:var(--df-spacing-2) var(--df-spacing-5);font-size:var(--df-typo-sizing-default);color:var(--df-color-inert-neutral-alt-foreground);text-align:center;background-color:var(--df-color-tooltip-background);border-radius:var(--df-borderRadius-main-medium);overflow-wrap:break-word}.df-tooltip-window.df-tooltip-sm{border-radius:var(--df-borderRadius-main-small);font-size:var(--df-typo-sizing-small);padding:var(--df-spacing-2) var(--df-spacing-3)}.df-tooltip-window.df-tooltip-lg{border-radius:var(--df-borderRadius-main-large);font-size:var(--df-typo-sizing-large);padding:var(--df-spacing-3) var(--df-spacing-6)}\n"] }]
|
|
21
|
+
}], propDecorators: { widget: [{ type: i0.Input, args: [{ isSignal: true, alias: "widget", required: true }] }] } });
|
|
22
|
+
/**
|
|
23
|
+
* A directive that attaches a tooltip to its host element.
|
|
24
|
+
*
|
|
25
|
+
* The tooltip is shown when the host element is hovered, receives keyboard focus or long press, and hidden when the mouse leaves,
|
|
26
|
+
* the element loses keyboard focus, or the user presses `Escape`. The tooltip window is rendered in `document.body` and
|
|
27
|
+
* positioned next to the host using the configured placement preference.
|
|
28
|
+
*
|
|
29
|
+
* @since 22.0
|
|
30
|
+
*/
|
|
31
|
+
class DfTooltip extends AgnosWidgetDirective {
|
|
32
|
+
constructor() {
|
|
33
|
+
const widget = callWidgetFactory(createTooltip, {
|
|
34
|
+
afterInit: () => {
|
|
35
|
+
useDirectiveForHost(widget.directives.referenceDirective);
|
|
36
|
+
const applicationRef = inject(ApplicationRef);
|
|
37
|
+
const document = inject(DOCUMENT);
|
|
38
|
+
const injector = inject(Injector);
|
|
39
|
+
const environmentInjector = inject(EnvironmentInjector);
|
|
40
|
+
effect((onCleanup) => {
|
|
41
|
+
if (!widget.state.hidden()) {
|
|
42
|
+
untracked(() => {
|
|
43
|
+
const hostElement = document.body.appendChild(document.createElement('df-tooltip-window'));
|
|
44
|
+
const tooltipWindow = createComponent(DfTooltipWindow, {
|
|
45
|
+
hostElement,
|
|
46
|
+
elementInjector: injector,
|
|
47
|
+
environmentInjector
|
|
48
|
+
});
|
|
49
|
+
useDirectiveForElement(hostElement, widget.directives.floatingDirective, tooltipWindow.injector);
|
|
50
|
+
tooltipWindow.setInput('widget', widget);
|
|
51
|
+
applicationRef.attachView(tooltipWindow.hostView);
|
|
52
|
+
tooltipWindow.changeDetectorRef.detectChanges();
|
|
53
|
+
onCleanup(() => {
|
|
54
|
+
applicationRef.detachView(tooltipWindow.hostView);
|
|
55
|
+
tooltipWindow.destroy();
|
|
56
|
+
hostElement.remove();
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
super(widget);
|
|
64
|
+
/**
|
|
65
|
+
* Text content to be displayed inside the tooltip.
|
|
66
|
+
*/
|
|
67
|
+
this.content = input(undefined, { ...(ngDevMode ? { debugName: "content" } : /* istanbul ignore next */ {}), alias: 'dfTooltip' });
|
|
68
|
+
/**
|
|
69
|
+
* Size of the tooltip.
|
|
70
|
+
*/
|
|
71
|
+
this.size = input(undefined, { ...(ngDevMode ? { debugName: "size" } : /* istanbul ignore next */ {}), alias: 'dfTooltipSize' });
|
|
72
|
+
/**
|
|
73
|
+
* List of placements, in order of preference. The first valid placement will be used.
|
|
74
|
+
*/
|
|
75
|
+
this.placement = input(undefined, { ...(ngDevMode ? { debugName: "placement" } : /* istanbul ignore next */ {}), alias: 'dfTooltipPlacement' });
|
|
76
|
+
/**
|
|
77
|
+
* Whether the tooltip is disabled. When `true`, the tooltip will not be displayed, even if the reference element is focused, hovered or long-pressed.
|
|
78
|
+
*/
|
|
79
|
+
this.disabled = input(undefined, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), alias: 'dfTooltipDisabled', transform: auBooleanAttribute });
|
|
80
|
+
/**
|
|
81
|
+
* Whether showing or hiding the tooltip should be animated.
|
|
82
|
+
*/
|
|
83
|
+
this.animated = input(undefined, { ...(ngDevMode ? { debugName: "animated" } : /* istanbul ignore next */ {}), alias: 'dfTooltipAnimated', transform: auBooleanAttribute });
|
|
84
|
+
}
|
|
85
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: DfTooltip, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
86
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.4", type: DfTooltip, isStandalone: true, selector: "[dfTooltip]", inputs: { content: { classPropertyName: "content", publicName: "dfTooltip", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "dfTooltipSize", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "dfTooltipPlacement", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "dfTooltipDisabled", isSignal: true, isRequired: false, transformFunction: null }, animated: { classPropertyName: "animated", publicName: "dfTooltipAnimated", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
|
|
87
|
+
}
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: DfTooltip, decorators: [{
|
|
89
|
+
type: Directive,
|
|
90
|
+
args: [{
|
|
91
|
+
selector: '[dfTooltip]'
|
|
92
|
+
}]
|
|
93
|
+
}], ctorParameters: () => [], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "dfTooltip", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "dfTooltipSize", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "dfTooltipPlacement", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "dfTooltipDisabled", required: false }] }], animated: [{ type: i0.Input, args: [{ isSignal: true, alias: "dfTooltipAnimated", required: false }] }] } });
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Tooltip config key in the global DF component config.
|
|
97
|
+
* @since 22.0
|
|
98
|
+
*/
|
|
99
|
+
const TOOLTIP_CONFIG_KEY = 'tooltip';
|
|
100
|
+
/**
|
|
101
|
+
* Provides the configuration for the tooltip component.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* @Component({
|
|
106
|
+
* providers: [provideDfTooltipConfig({ animated: false })]
|
|
107
|
+
* })
|
|
108
|
+
* export class MyHomeComponent {}
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* @param config - Partial configuration or a function that receives the parent configuration and returns a partial configuration.
|
|
112
|
+
* @since 22.0
|
|
113
|
+
*/
|
|
114
|
+
const provideDfTooltipConfig = provideDfComponentConfig(TOOLTIP_CONFIG_KEY);
|
|
115
|
+
/**
|
|
116
|
+
* Injects the configuration for the tooltip component.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* @Component({
|
|
121
|
+
* providers: [provideDfTooltipConfig()]
|
|
122
|
+
* })
|
|
123
|
+
* export class MyTooltipComponent {
|
|
124
|
+
* readonly tooltipConfig = injectDfTooltipConfig();
|
|
125
|
+
* }
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
128
|
+
* @returns A writable signal containing the tooltip configuration.
|
|
129
|
+
* @since 22.0
|
|
130
|
+
*/
|
|
131
|
+
const injectDfTooltipConfig = injectDfComponentConfig(TOOLTIP_CONFIG_KEY);
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Generated bundle index. Do not edit.
|
|
135
|
+
*/
|
|
136
|
+
|
|
137
|
+
export { DfTooltip, TOOLTIP_CONFIG_KEY, injectDfTooltipConfig, provideDfTooltipConfig };
|
|
138
|
+
//# sourceMappingURL=design-factory-angular-tooltip.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-factory-angular-tooltip.mjs","sources":["../../tooltip/tooltip.ts","../../tooltip/tooltip.config.ts","../../tooltip/design-factory-angular-tooltip.ts"],"sourcesContent":["import {\n ApplicationRef,\n Component,\n createComponent,\n Directive,\n DOCUMENT,\n effect,\n EnvironmentInjector,\n inject,\n Injector,\n input,\n untracked,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n AgnosWidgetDirective,\n AngularWidget,\n auBooleanAttribute,\n callWidgetFactory,\n useDirectiveForElement,\n useDirectiveForHost\n} from '@design-factory/angular/internals';\nimport { createTooltip, TooltipPlacement, TooltipSize, TooltipWidget } from '@design-factory/core/components/tooltip';\n\n/**\n * Valid placement values for the tooltip.\n * Includes all individual placement values plus `'auto'`, `'vertical'` and `'horizontal'` shortcuts.\n *\n * - `'auto'` expands to `'vertical horizontal'`\n * - `'vertical'` expands to `'top top-start top-end bottom bottom-start bottom-end'`\n * - `'horizontal'` expands to `'end end-end end-start start start-end start-start'`\n *\n * @since 22.0\n */\nexport type DfTooltipPlacement = TooltipPlacement;\n\n/**\n * Accepted value for the tooltip `placement` input.\n *\n * Either an array of placements or a space-separated string of placements, in order of preference.\n * The first placement that fits the viewport will be used.\n *\n * @since 22.0\n */\nexport type DfTooltipPlacementArray = DfTooltipPlacement[] | `${DfTooltipPlacement}${string}`;\n\n/**\n * Available tooltip sizes.\n * @since 22.0\n */\nexport type DfTooltipSize = TooltipSize;\n\n@Component({\n selector: 'df-tooltip-window',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'df-tooltip-window',\n '[class.df-tooltip-sm]': \"widget().state.size() === 'sm'\",\n '[class.df-tooltip-lg]': \"widget().state.size() === 'lg'\"\n },\n styles: \"@use '@design-factory/components-styles/tooltip';\",\n template: `{{ widget().state.content() }}`\n})\nclass DfTooltipWindow {\n readonly widget = input.required<AngularWidget<TooltipWidget>>();\n}\n\n/**\n * A directive that attaches a tooltip to its host element.\n *\n * The tooltip is shown when the host element is hovered, receives keyboard focus or long press, and hidden when the mouse leaves,\n * the element loses keyboard focus, or the user presses `Escape`. The tooltip window is rendered in `document.body` and\n * positioned next to the host using the configured placement preference.\n *\n * @since 22.0\n */\n@Directive({\n selector: '[dfTooltip]'\n})\nexport class DfTooltip extends AgnosWidgetDirective<TooltipWidget> {\n /**\n * Text content to be displayed inside the tooltip.\n */\n readonly content = input<string | null | undefined>(undefined, { alias: 'dfTooltip' });\n\n /**\n * Size of the tooltip.\n */\n readonly size = input<DfTooltipSize | undefined>(undefined, { alias: 'dfTooltipSize' });\n\n /**\n * List of placements, in order of preference. The first valid placement will be used.\n */\n readonly placement = input<DfTooltipPlacementArray | undefined>(undefined, { alias: 'dfTooltipPlacement' });\n\n /**\n * Whether the tooltip is disabled. When `true`, the tooltip will not be displayed, even if the reference element is focused, hovered or long-pressed.\n */\n readonly disabled = input(undefined, { alias: 'dfTooltipDisabled', transform: auBooleanAttribute });\n\n /**\n * Whether showing or hiding the tooltip should be animated.\n */\n readonly animated = input(undefined, { alias: 'dfTooltipAnimated', transform: auBooleanAttribute });\n\n constructor() {\n const widget = callWidgetFactory(createTooltip, {\n afterInit: () => {\n useDirectiveForHost(widget.directives.referenceDirective);\n const applicationRef = inject(ApplicationRef);\n const document = inject(DOCUMENT);\n const injector = inject(Injector);\n const environmentInjector = inject(EnvironmentInjector);\n effect((onCleanup) => {\n if (!widget.state.hidden()) {\n untracked(() => {\n const hostElement = document.body.appendChild(document.createElement('df-tooltip-window'));\n const tooltipWindow = createComponent(DfTooltipWindow, {\n hostElement,\n elementInjector: injector,\n environmentInjector\n });\n useDirectiveForElement(hostElement, widget.directives.floatingDirective, tooltipWindow.injector);\n tooltipWindow.setInput('widget', widget);\n applicationRef.attachView(tooltipWindow.hostView);\n tooltipWindow.changeDetectorRef.detectChanges();\n onCleanup(() => {\n applicationRef.detachView(tooltipWindow.hostView);\n tooltipWindow.destroy();\n hostElement.remove();\n });\n });\n }\n });\n }\n });\n\n super(widget);\n }\n}\n","import type { TooltipProps } from '@design-factory/core/components/tooltip';\nimport { injectDfComponentConfig, provideDfComponentConfig } from '@design-factory/angular/internals';\n\n/**\n * Configuration options supported by `provideDfTooltipConfig`.\n *\n * These defaults apply to every `DfTooltip` instance within the providing injector, unless explicitly overridden on\n * the directive itself.\n *\n * @since 22.0\n */\nexport type DfTooltipConfig = Pick<TooltipProps, 'animated'>;\n\n/**\n * Tooltip config key in the global DF component config.\n * @since 22.0\n */\nexport const TOOLTIP_CONFIG_KEY = 'tooltip' as const;\n\n/**\n * Provides the configuration for the tooltip component.\n *\n * @example\n * ```ts\n * @Component({\n * providers: [provideDfTooltipConfig({ animated: false })]\n * })\n * export class MyHomeComponent {}\n * ```\n *\n * @param config - Partial configuration or a function that receives the parent configuration and returns a partial configuration.\n * @since 22.0\n */\nexport const provideDfTooltipConfig = provideDfComponentConfig<DfTooltipConfig>(TOOLTIP_CONFIG_KEY);\n\n/**\n * Injects the configuration for the tooltip component.\n *\n * @example\n * ```ts\n * @Component({\n * providers: [provideDfTooltipConfig()]\n * })\n * export class MyTooltipComponent {\n * readonly tooltipConfig = injectDfTooltipConfig();\n * }\n * ```\n *\n * @returns A writable signal containing the tooltip configuration.\n * @since 22.0\n */\nexport const injectDfTooltipConfig = injectDfComponentConfig<DfTooltipConfig>(TOOLTIP_CONFIG_KEY);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAoDA,MAWM,eAAe,CAAA;AAXrB,IAAA,WAAA,GAAA;QAYW,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,QAAQ;mFAAgC;AACjE,IAAA;8GAFK,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAe,oYAFT,CAAA,8BAAA,CAAgC,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,s1BAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FAEtC,eAAe,EAAA,UAAA,EAAA,CAAA;kBAXpB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,EAAA,aAAA,EACd,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,KAAK,EAAE,mBAAmB;AAC1B,wBAAA,uBAAuB,EAAE,gCAAgC;AACzD,wBAAA,uBAAuB,EAAE;AAC1B,qBAAA,E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