@odx/angular 6.0.0 → 6.1.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/CHANGELOG.md +22 -0
- package/animations/lib/expand.d.ts +44 -0
- package/animations/lib/fade.d.ts +70 -0
- package/animations/lib/slide.d.ts +21 -0
- package/animations/lib/wait-for-child-animations.d.ts +38 -0
- package/breakpoints/lib/breakpoints.config.d.ts +38 -0
- package/breakpoints/lib/breakpoints.service.d.ts +43 -0
- package/breakpoints/lib/directives/match-breakpoints.directive.d.ts +36 -0
- package/breakpoints/lib/helpers/configure-breakpoint.d.ts +19 -0
- package/cdk/a11y/lib/directives/interactive.directive.d.ts +32 -0
- package/cdk/a11y/lib/directives/list-focus-manager-option.directive.d.ts +22 -0
- package/cdk/a11y/lib/directives/list-focus-manager.directive.d.ts +17 -0
- package/cdk/active-indicator/lib/active-indicator.directive.d.ts +63 -0
- package/cdk/autocomplete-control/lib/autocomplete-control.d.ts +53 -0
- package/cdk/checkbox-control/lib/checkbox-control.directive.d.ts +3 -0
- package/cdk/connected-overlay/lib/connected-overlay.service.d.ts +44 -0
- package/cdk/connected-overlay/lib/helpers/compute-overlay-position.d.ts +10 -0
- package/cdk/connected-overlay/lib/models/connected-overlay-ref.d.ts +49 -0
- package/cdk/custom-form-control/lib/custom-form-control.d.ts +108 -0
- package/cdk/custom-form-control/lib/input-control.directive.d.ts +75 -0
- package/cdk/dynamic-view/lib/dynamic-view.directive.d.ts +25 -0
- package/cdk/dynamic-view/lib/dynamic-view.service.d.ts +30 -0
- package/cdk/dynamic-view/lib/helpers/create-projectable-nodes.d.ts +22 -0
- package/cdk/dynamic-view/lib/helpers/is-dynamic-text-content.d.ts +22 -0
- package/cdk/dynamic-view/lib/helpers/is-dynamic-view.d.ts +22 -0
- package/cdk/dynamic-view/lib/models/dynamic-component-ref.d.ts +39 -0
- package/cdk/dynamic-view/lib/models/dynamic-template-ref.d.ts +36 -0
- package/cdk/dynamic-view/lib/tokens/dynamic-view-context.d.ts +4 -0
- package/cdk/dynamic-view/lib/tokens/dynamic-view-default-host.d.ts +10 -0
- package/cdk/event-plugins/lib/event-plugins.config.d.ts +35 -0
- package/cdk/event-plugins/lib/models/event-plugin.d.ts +57 -0
- package/cdk/event-plugins/lib/plugins/debounce-event-plugin.d.ts +32 -0
- package/cdk/event-plugins/lib/plugins/defer-event-plugin.d.ts +24 -0
- package/cdk/expandable/lib/directives/expandable-container.directive.d.ts +41 -0
- package/cdk/expandable/lib/directives/expandable-item.directive.d.ts +47 -0
- package/cdk/option-control/lib/option-control.d.ts +47 -0
- package/cdk/radio-group-control/lib/radio-control.directive.d.ts +8 -0
- package/cdk/radio-group-control/lib/radio-group-control.directive.d.ts +11 -0
- package/components/accordion/lib/accordion.component.d.ts +8 -0
- package/components/accordion/lib/components/accordion-item/accordion-item.component.d.ts +37 -1
- package/components/accordion/lib/directives/accordion-item-title.d.ts +3 -0
- package/components/action-group/action-group.component.d.ts +6 -0
- package/components/area-header/area-header.component.d.ts +8 -0
- package/components/area-header/directives/area-header-content.directive.d.ts +3 -0
- package/components/area-header/directives/area-header-subtitle.directive.d.ts +3 -0
- package/components/autocomplete/lib/autocomplete.component.d.ts +18 -0
- package/components/avatar/lib/avatar.component.d.ts +8 -0
- package/components/badge/lib/badge.component.d.ts +10 -0
- package/components/badge/lib/badge.directive.d.ts +15 -0
- package/components/bar/lib/bar.component.d.ts +7 -0
- package/components/bar/lib/directives/bar-button.directive.d.ts +3 -0
- package/components/bar/lib/directives/bar-label.directive.d.ts +3 -0
- package/components/breadcrumbs/lib/breadcrumbs.component.d.ts +3 -0
- package/components/button/lib/button.component.d.ts +10 -0
- package/components/button-group/lib/button-group.component.d.ts +15 -0
- package/components/calendar/lib/calendar.component.d.ts +48 -0
- package/components/calendar/lib/calendar.config.d.ts +17 -0
- package/components/calendar/lib/calendar.service.d.ts +48 -0
- package/components/calendar/lib/components/calendar-header/calendar-header.component.d.ts +24 -0
- package/components/calendar/lib/components/calendar-month/calendar-month.component.d.ts +6 -0
- package/components/calendar/lib/components/calendar-year/calendar-year.component.d.ts +6 -0
- package/components/calendar/lib/components/calendar-years/calendar-years.component.d.ts +6 -0
- package/components/calendar/lib/daterange.service.d.ts +16 -0
- package/components/calendar/lib/directives/calendar-cell.directive.d.ts +37 -0
- package/components/calendar/lib/directives/calendar-view.directive.d.ts +41 -0
- package/components/calendar/lib/pipes/date-label.pipe.d.ts +5 -0
- package/components/calendar/lib/services/calendar-month.service.d.ts +1 -0
- package/components/calendar/lib/services/calendar-year.service.d.ts +1 -0
- package/components/calendar/lib/services/calendar-years.service.d.ts +1 -0
- package/components/calendar/lib/utils/check-cell-in-range.d.ts +1 -0
- package/components/calendar/lib/utils/check-identical-date.d.ts +1 -0
- package/components/calendar/lib/utils/get-A11y-label.d.ts +1 -0
- package/components/calendar/lib/utils/is-date-disabled.d.ts +1 -0
- package/components/calendar/lib/utils/parse-date.d.ts +1 -0
- package/components/calendar/lib/utils/validate-daterange.d.ts +1 -0
- package/components/calendar/lib/utils/validate-max-date.d.ts +1 -0
- package/components/calendar/lib/utils/validate-min-date.d.ts +1 -0
- package/components/calendar/lib/utils/validate-next-date-set.d.ts +1 -0
- package/components/calendar/lib/utils/validate-previous-date-set.d.ts +1 -0
- package/components/checkbox/lib/checkbox.component.d.ts +32 -0
- package/components/checkbox/lib/checkbox.validator.d.ts +23 -0
- package/components/chip/lib/components/chip/chip.component.d.ts +14 -0
- package/components/chip/lib/components/chip-list/chip-list.component.d.ts +3 -0
- package/components/chip/lib/components/chip-list-row/chip-list-row.component.d.ts +3 -0
- package/components/circular-progress/lib/circular-progress.component.d.ts +20 -0
- package/components/content-box/lib/content-box.component.d.ts +3 -0
- package/components/content-box/lib/directives/content-box-footer.directive.d.ts +3 -0
- package/components/content-box/lib/directives/content-box-header.directive.d.ts +3 -0
- package/components/datepicker/lib/datepicker.component.d.ts +47 -0
- package/components/datepicker/lib/datepicker.config.d.ts +19 -0
- package/components/datepicker/lib/directives/datepicker-input-control.directive.d.ts +30 -0
- package/components/datepicker/lib/utils/get-datepicker-input-pattern.d.ts +2 -0
- package/components/datepicker/lib/utils/get-datepicker-input-value-as-date.d.ts +1 -0
- package/components/daterangepicker/lib/daterangepicker.component.d.ts +89 -0
- package/components/daterangepicker/lib/daterangepicker.config.d.ts +19 -0
- package/components/daterangepicker/lib/directives/daterangepicker-input-control.directive.d.ts +30 -0
- package/components/daterangepicker/lib/range.validator.d.ts +15 -0
- package/components/daterangepicker/lib/required.validator.d.ts +6 -0
- package/components/daterangepicker/lib/utils/get-daterangepicker-input-pattern.d.ts +2 -0
- package/components/daterangepicker/lib/utils/get-daterangepicker-input-value-as-date.d.ts +1 -0
- package/components/dropdown/lib/dropdown.component.d.ts +16 -0
- package/components/dropdown/lib/dropdown.directive.d.ts +67 -0
- package/components/dropdown/lib/helpers/close-current-dropdown.d.ts +5 -0
- package/components/error-page/lib/error-page.component.d.ts +7 -0
- package/components/error-page/lib/error-page.config.d.ts +18 -0
- package/components/footer/lib/footer.component.d.ts +9 -6
- package/components/footer/lib/footer.config.d.ts +2 -0
- package/components/form-field/lib/components/form-field-info/form-field-info.component.d.ts +13 -0
- package/components/form-field/lib/components/form-group/form-group.component.d.ts +16 -0
- package/components/form-field/lib/directives/form-field-control.directive.d.ts +5 -0
- package/components/form-field/lib/directives/form-field-error.directive.d.ts +6 -0
- package/components/form-field/lib/directives/form-field-hint.directive.d.ts +3 -0
- package/components/form-field/lib/directives/form-field-label.directive.d.ts +3 -0
- package/components/form-field/lib/directives/form.directive.d.ts +13 -0
- package/components/form-field/lib/form-field.component.d.ts +20 -0
- package/components/form-field/lib/form-field.service.d.ts +42 -0
- package/components/form-field/lib/services/form-field-error.service.d.ts +24 -0
- package/components/header/lib/directives/header-avatar.directive.d.ts +4 -0
- package/components/header/lib/directives/header-title.directive.d.ts +3 -0
- package/components/header/lib/header.component.d.ts +3 -0
- package/components/header-navigation/lib/directives/header-navigation-link.directive.d.ts +3 -0
- package/components/header-navigation/lib/header-navigation.component.d.ts +6 -0
- package/components/icon/lib/helpers/unpack-icon-identifier.d.ts +14 -0
- package/components/icon/lib/icon.component.d.ts +24 -0
- package/components/icon/lib/icon.config.d.ts +26 -0
- package/components/inline-message/lib/inline-message.component.d.ts +13 -0
- package/components/link/link.directive.d.ts +3 -0
- package/components/list/lib/components/expandable-list-item/expandable-list-item.component.d.ts +6 -0
- package/components/list/lib/components/list-item/list-item.component.d.ts +17 -1
- package/components/list/lib/list.component.d.ts +5 -0
- package/components/loading-spinner/lib/loading-spinner.component.d.ts +8 -0
- package/components/loading-spinner/lib/loading-spinner.directive.d.ts +22 -0
- package/components/logo/logo.directive.d.ts +15 -0
- package/components/main-menu/lib/directives/main-menu-button.directive.d.ts +5 -1
- package/components/main-menu/lib/directives/main-menu-close.directive.d.ts +3 -0
- package/components/main-menu/lib/directives/main-menu-item.directive.d.ts +16 -0
- package/components/main-menu/lib/helpers/create-main-menu-links.d.ts +1 -0
- package/components/main-menu/lib/main-menu.component.d.ts +42 -0
- package/components/main-menu/lib/main-menu.config.d.ts +31 -0
- package/components/main-menu/lib/main-menu.service.d.ts +28 -0
- package/components/mainfilter-group/lib/mainfilter-group.component.d.ts +4 -0
- package/components/menu/lib/directives/menu-item.directive.d.ts +6 -0
- package/components/menu/lib/menu.component.d.ts +13 -1
- package/components/menu/lib/menu.directive.d.ts +31 -0
- package/components/modal/lib/components/basic-modal/basic-modal.component.d.ts +14 -0
- package/components/modal/lib/components/modal-footer/modal-footer.component.d.ts +3 -0
- package/components/modal/lib/components/modal-header/modal-header.component.d.ts +9 -0
- package/components/modal/lib/components/modal-hero/modal-hero.component.d.ts +21 -0
- package/components/modal/lib/directives/modal-close.directive.d.ts +25 -1
- package/components/modal/lib/directives/modal-content.directive.d.ts +3 -0
- package/components/modal/lib/directives/modal-dismiss.directive.d.ts +18 -1
- package/components/modal/lib/helpers/inject-modal-ref.d.ts +21 -0
- package/components/modal/lib/helpers/provide-modal-ref.d.ts +9 -0
- package/components/modal/lib/modal.component.d.ts +25 -0
- package/components/modal/lib/modal.config.d.ts +33 -0
- package/components/modal/lib/modal.directive.d.ts +29 -0
- package/components/modal/lib/modal.service.d.ts +54 -0
- package/components/modal/lib/models/modal-ref.d.ts +34 -0
- package/components/navigation-back/lib/navigation-back.component.d.ts +3 -0
- package/components/notification/lib/components/notification-center/notification-center.component.d.ts +0 -2
- package/components/notification/lib/directives/notification-center.directive.d.ts +18 -4
- package/components/notification/lib/helpers/get-notifications-by-tag.d.ts +1 -0
- package/components/notification/lib/helpers/sort-notifications.d.ts +1 -0
- package/components/notification/lib/helpers/to-notification-collection.d.ts +1 -0
- package/components/notification/lib/models/notification-feature.d.ts +15 -0
- package/components/notification/lib/notification.config.d.ts +54 -0
- package/components/notification/lib/notification.logger.d.ts +1 -0
- package/components/notification/lib/notification.service.d.ts +55 -0
- package/components/notification/lib/notification.tokens.d.ts +3 -0
- package/components/notification/lib/services/notification-center.service.d.ts +9 -0
- package/components/paginator/lib/paginator.component.d.ts +89 -0
- package/components/paginator/lib/paginator.config.d.ts +24 -2
- package/components/progress/lib/progress.component.d.ts +15 -0
- package/components/radio-group/lib/components/radio-button/radio-button.component.d.ts +18 -1
- package/components/radio-group/lib/radio-group.component.d.ts +11 -0
- package/components/rail-navigation/lib/components/rail-navigation-item/rail-navigation-item.component.d.ts +19 -0
- package/components/rail-navigation/lib/rail-navigation.component.d.ts +26 -0
- package/components/rich-list/lib/components/rich-list-content/rich-list-content.component.d.ts +4 -0
- package/components/rich-list/lib/components/rich-list-header/rich-list-header.component.d.ts +4 -0
- package/components/rich-list/lib/components/rich-list-item/rich-list-item.component.d.ts +9 -1
- package/components/rich-list/lib/rich-list.component.d.ts +9 -2
- package/components/select/lib/components/select-option/select-option.component.d.ts +39 -2
- package/components/select/lib/directives/select-input-control.directive.d.ts +11 -0
- package/components/select/lib/pipes/select-search-filter.pipe.d.ts +10 -0
- package/components/select/lib/select.component.d.ts +59 -0
- package/components/slider/lib/slider.directive.d.ts +19 -0
- package/components/spinbox/lib/spinbox.component.d.ts +16 -0
- package/components/switch/lib/switch.component.d.ts +10 -0
- package/components/switch/lib/switch.validator.d.ts +12 -0
- package/components/tab-bar/lib/components/tab-bar-item/tab-bar-item.component.d.ts +28 -0
- package/components/tab-bar/lib/tab-bar.component.d.ts +69 -0
- package/components/table/lib/components/check-cell/check-cell.component.d.ts +18 -0
- package/components/table/lib/components/header-title/header-title.component.d.ts +33 -1
- package/components/table/lib/directives/table-cell.directive.d.ts +4 -0
- package/components/table/lib/directives/table-row.directive.d.ts +4 -0
- package/components/table/lib/table.component.d.ts +36 -0
- package/components/timepicker/lib/timepicker.component.d.ts +11 -2
- package/components/timepicker/lib/utils/generate-time-stamps.d.ts +2 -1
- package/components/timepicker/lib/utils/ngx-mask-helper.d.ts +2 -2
- package/components/toast/lib/components/toast-item/toast-item.component.d.ts +5 -4
- package/components/toast/lib/models/toast.d.ts +4 -2
- package/components/toast/lib/toast.config.d.ts +26 -0
- package/components/toast/lib/toast.service.d.ts +35 -0
- package/components/toggle-button-group/lib/components/toggle-button/toggle-button.component.d.ts +11 -0
- package/components/toggle-button-group/lib/toggle-button-group.component.d.ts +12 -0
- package/components/tooltip/lib/helpers/resolve-tooltip-trigger-events.d.ts +7 -0
- package/components/tooltip/lib/tooltip.component.d.ts +20 -0
- package/components/tooltip/lib/tooltip.directive.d.ts +35 -0
- package/components/wizard/lib/components/wizard-step/wizard-step.component.d.ts +34 -0
- package/components/wizard/lib/wizard.component.d.ts +20 -0
- package/esm2022/animations/lib/expand.mjs +45 -1
- package/esm2022/animations/lib/fade.mjs +71 -1
- package/esm2022/animations/lib/slide.mjs +22 -1
- package/esm2022/animations/lib/wait-for-child-animations.mjs +39 -1
- package/esm2022/breakpoints/lib/breakpoints.config.mjs +39 -1
- package/esm2022/breakpoints/lib/breakpoints.service.mjs +44 -1
- package/esm2022/breakpoints/lib/directives/match-breakpoints.directive.mjs +37 -1
- package/esm2022/breakpoints/lib/helpers/configure-breakpoint.mjs +20 -1
- package/esm2022/cdk/a11y/lib/directives/interactive.directive.mjs +33 -1
- package/esm2022/cdk/a11y/lib/directives/list-focus-manager-option.directive.mjs +23 -1
- package/esm2022/cdk/a11y/lib/directives/list-focus-manager.directive.mjs +18 -1
- package/esm2022/cdk/active-indicator/lib/active-indicator.directive.mjs +64 -1
- package/esm2022/cdk/autocomplete-control/lib/autocomplete-control.mjs +40 -2
- package/esm2022/cdk/checkbox-control/lib/checkbox-control.directive.mjs +4 -1
- package/esm2022/cdk/connected-overlay/lib/connected-overlay.service.mjs +45 -1
- package/esm2022/cdk/connected-overlay/lib/helpers/compute-overlay-position.mjs +11 -1
- package/esm2022/cdk/connected-overlay/lib/models/connected-overlay-ref.mjs +50 -1
- package/esm2022/cdk/custom-form-control/lib/custom-form-control.mjs +109 -3
- package/esm2022/cdk/custom-form-control/lib/input-control.directive.mjs +76 -1
- package/esm2022/cdk/dynamic-view/lib/dynamic-view.directive.mjs +18 -1
- package/esm2022/cdk/dynamic-view/lib/dynamic-view.service.mjs +31 -1
- package/esm2022/cdk/dynamic-view/lib/helpers/create-projectable-nodes.mjs +23 -1
- package/esm2022/cdk/dynamic-view/lib/helpers/is-dynamic-text-content.mjs +23 -1
- package/esm2022/cdk/dynamic-view/lib/helpers/is-dynamic-view.mjs +23 -1
- package/esm2022/cdk/dynamic-view/lib/models/dynamic-component-ref.mjs +40 -1
- package/esm2022/cdk/dynamic-view/lib/models/dynamic-template-ref.mjs +37 -1
- package/esm2022/cdk/dynamic-view/lib/tokens/dynamic-view-context.mjs +5 -1
- package/esm2022/cdk/dynamic-view/lib/tokens/dynamic-view-default-host.mjs +11 -1
- package/esm2022/cdk/event-plugins/lib/event-plugins.config.mjs +36 -1
- package/esm2022/cdk/event-plugins/lib/models/event-plugin.mjs +45 -1
- package/esm2022/cdk/event-plugins/lib/plugins/debounce-event-plugin.mjs +33 -1
- package/esm2022/cdk/event-plugins/lib/plugins/defer-event-plugin.mjs +25 -1
- package/esm2022/cdk/expandable/lib/directives/expandable-container.directive.mjs +42 -1
- package/esm2022/cdk/expandable/lib/directives/expandable-item.directive.mjs +48 -1
- package/esm2022/cdk/option-control/lib/option-control.mjs +48 -1
- package/esm2022/cdk/radio-group-control/lib/radio-control.directive.mjs +9 -1
- package/esm2022/cdk/radio-group-control/lib/radio-group-control.directive.mjs +12 -1
- package/esm2022/components/accordion/lib/accordion.component.mjs +9 -1
- package/esm2022/components/accordion/lib/components/accordion-item/accordion-item.component.mjs +31 -1
- package/esm2022/components/accordion/lib/directives/accordion-item-title.mjs +4 -1
- package/esm2022/components/action-group/action-group.component.mjs +7 -1
- package/esm2022/components/area-header/area-header.component.mjs +9 -1
- package/esm2022/components/area-header/directives/area-header-content.directive.mjs +4 -1
- package/esm2022/components/area-header/directives/area-header-subtitle.directive.mjs +4 -1
- package/esm2022/components/autocomplete/lib/autocomplete.component.mjs +29 -5
- package/esm2022/components/avatar/lib/avatar.component.mjs +9 -1
- package/esm2022/components/badge/lib/badge.component.mjs +11 -1
- package/esm2022/components/badge/lib/badge.directive.mjs +16 -1
- package/esm2022/components/bar/lib/bar.component.mjs +8 -1
- package/esm2022/components/bar/lib/directives/bar-button.directive.mjs +4 -1
- package/esm2022/components/bar/lib/directives/bar-label.directive.mjs +4 -1
- package/esm2022/components/breadcrumbs/lib/breadcrumbs.component.mjs +4 -1
- package/esm2022/components/button/lib/button.component.mjs +11 -1
- package/esm2022/components/button-group/lib/button-group.component.mjs +16 -1
- package/esm2022/components/calendar/lib/calendar.component.mjs +35 -1
- package/esm2022/components/calendar/lib/calendar.config.mjs +18 -1
- package/esm2022/components/calendar/lib/calendar.service.mjs +49 -1
- package/esm2022/components/calendar/lib/components/calendar-header/calendar-header.component.mjs +19 -1
- package/esm2022/components/calendar/lib/components/calendar-month/calendar-month.component.mjs +7 -1
- package/esm2022/components/calendar/lib/components/calendar-year/calendar-year.component.mjs +7 -1
- package/esm2022/components/calendar/lib/components/calendar-years/calendar-years.component.mjs +7 -1
- package/esm2022/components/calendar/lib/daterange.service.mjs +17 -1
- package/esm2022/components/calendar/lib/directives/calendar-cell.directive.mjs +26 -1
- package/esm2022/components/calendar/lib/directives/calendar-view.directive.mjs +39 -1
- package/esm2022/components/calendar/lib/pipes/date-label.pipe.mjs +6 -1
- package/esm2022/components/calendar/lib/services/calendar-month.service.mjs +2 -1
- package/esm2022/components/calendar/lib/services/calendar-year.service.mjs +2 -1
- package/esm2022/components/calendar/lib/services/calendar-years.service.mjs +2 -1
- package/esm2022/components/calendar/lib/utils/check-cell-in-range.mjs +2 -1
- package/esm2022/components/calendar/lib/utils/check-identical-date.mjs +2 -1
- package/esm2022/components/calendar/lib/utils/get-A11y-label.mjs +2 -1
- package/esm2022/components/calendar/lib/utils/is-date-disabled.mjs +2 -1
- package/esm2022/components/calendar/lib/utils/parse-date.mjs +2 -1
- package/esm2022/components/calendar/lib/utils/validate-daterange.mjs +2 -1
- package/esm2022/components/calendar/lib/utils/validate-max-date.mjs +2 -1
- package/esm2022/components/calendar/lib/utils/validate-min-date.mjs +2 -1
- package/esm2022/components/calendar/lib/utils/validate-next-date-set.mjs +2 -1
- package/esm2022/components/calendar/lib/utils/validate-previous-date-set.mjs +2 -1
- package/esm2022/components/checkbox/lib/checkbox.component.mjs +33 -1
- package/esm2022/components/checkbox/lib/checkbox.validator.mjs +24 -1
- package/esm2022/components/chip/lib/components/chip/chip.component.mjs +15 -1
- package/esm2022/components/chip/lib/components/chip-list/chip-list.component.mjs +4 -1
- package/esm2022/components/chip/lib/components/chip-list-row/chip-list-row.component.mjs +4 -1
- package/esm2022/components/circular-progress/lib/circular-progress.component.mjs +21 -1
- package/esm2022/components/content-box/lib/content-box.component.mjs +4 -1
- package/esm2022/components/content-box/lib/directives/content-box-footer.directive.mjs +4 -1
- package/esm2022/components/content-box/lib/directives/content-box-header.directive.mjs +4 -1
- package/esm2022/components/datepicker/lib/datepicker.component.mjs +33 -1
- package/esm2022/components/datepicker/lib/datepicker.config.mjs +20 -1
- package/esm2022/components/datepicker/lib/directives/datepicker-input-control.directive.mjs +31 -1
- package/esm2022/components/datepicker/lib/utils/get-datepicker-input-pattern.mjs +3 -1
- package/esm2022/components/datepicker/lib/utils/get-datepicker-input-value-as-date.mjs +2 -1
- package/esm2022/components/daterangepicker/lib/daterangepicker.component.mjs +65 -1
- package/esm2022/components/daterangepicker/lib/daterangepicker.config.mjs +20 -1
- package/esm2022/components/daterangepicker/lib/directives/daterangepicker-input-control.directive.mjs +31 -1
- package/esm2022/components/daterangepicker/lib/range.validator.mjs +16 -1
- package/esm2022/components/daterangepicker/lib/required.validator.mjs +15 -1
- package/esm2022/components/daterangepicker/lib/utils/get-daterangepicker-input-pattern.mjs +3 -1
- package/esm2022/components/daterangepicker/lib/utils/get-daterangepicker-input-value-as-date.mjs +2 -1
- package/esm2022/components/dropdown/lib/dropdown.component.mjs +8 -1
- package/esm2022/components/dropdown/lib/dropdown.directive.mjs +55 -1
- package/esm2022/components/dropdown/lib/helpers/close-current-dropdown.mjs +6 -1
- package/esm2022/components/error-page/lib/error-page.component.mjs +8 -1
- package/esm2022/components/error-page/lib/error-page.config.mjs +9 -1
- package/esm2022/components/footer/lib/footer.component.mjs +10 -7
- package/esm2022/components/footer/lib/footer.config.mjs +3 -1
- package/esm2022/components/form-field/lib/components/form-field-info/form-field-info.component.mjs +14 -1
- package/esm2022/components/form-field/lib/components/form-group/form-group.component.mjs +13 -1
- package/esm2022/components/form-field/lib/directives/form-field-control.directive.mjs +6 -1
- package/esm2022/components/form-field/lib/directives/form-field-error.directive.mjs +4 -1
- package/esm2022/components/form-field/lib/directives/form-field-hint.directive.mjs +4 -1
- package/esm2022/components/form-field/lib/directives/form-field-label.directive.mjs +4 -1
- package/esm2022/components/form-field/lib/directives/form.directive.mjs +14 -1
- package/esm2022/components/form-field/lib/form-field.component.mjs +14 -1
- package/esm2022/components/form-field/lib/form-field.service.mjs +43 -1
- package/esm2022/components/form-field/lib/services/form-field-error.service.mjs +25 -1
- package/esm2022/components/header/lib/directives/header-avatar.directive.mjs +5 -1
- package/esm2022/components/header/lib/directives/header-title.directive.mjs +4 -1
- package/esm2022/components/header/lib/header.component.mjs +4 -1
- package/esm2022/components/header-navigation/lib/directives/header-navigation-link.directive.mjs +4 -1
- package/esm2022/components/header-navigation/lib/header-navigation.component.mjs +4 -1
- package/esm2022/components/icon/lib/helpers/unpack-icon-identifier.mjs +15 -1
- package/esm2022/components/icon/lib/icon.component.mjs +25 -1
- package/esm2022/components/icon/lib/icon.config.mjs +20 -1
- package/esm2022/components/inline-message/lib/inline-message.component.mjs +14 -1
- package/esm2022/components/link/link.directive.mjs +4 -1
- package/esm2022/components/list/lib/components/expandable-list-item/expandable-list-item.component.mjs +7 -1
- package/esm2022/components/list/lib/components/list-item/list-item.component.mjs +18 -2
- package/esm2022/components/list/lib/list.component.mjs +6 -1
- package/esm2022/components/loading-spinner/lib/loading-spinner.component.mjs +10 -2
- package/esm2022/components/loading-spinner/lib/loading-spinner.directive.mjs +23 -1
- package/esm2022/components/logo/logo.directive.mjs +16 -1
- package/esm2022/components/main-menu/lib/directives/main-menu-button.directive.mjs +5 -1
- package/esm2022/components/main-menu/lib/directives/main-menu-close.directive.mjs +4 -1
- package/esm2022/components/main-menu/lib/directives/main-menu-item.directive.mjs +17 -1
- package/esm2022/components/main-menu/lib/helpers/create-main-menu-links.mjs +2 -1
- package/esm2022/components/main-menu/lib/main-menu.component.mjs +37 -1
- package/esm2022/components/main-menu/lib/main-menu.config.mjs +32 -1
- package/esm2022/components/main-menu/lib/main-menu.service.mjs +29 -1
- package/esm2022/components/mainfilter-group/lib/mainfilter-group.component.mjs +5 -1
- package/esm2022/components/menu/lib/directives/menu-item.directive.mjs +7 -1
- package/esm2022/components/menu/lib/menu.component.mjs +13 -1
- package/esm2022/components/menu/lib/menu.directive.mjs +19 -1
- package/esm2022/components/modal/lib/components/basic-modal/basic-modal.component.mjs +15 -1
- package/esm2022/components/modal/lib/components/modal-footer/modal-footer.component.mjs +4 -1
- package/esm2022/components/modal/lib/components/modal-header/modal-header.component.mjs +4 -1
- package/esm2022/components/modal/lib/components/modal-hero/modal-hero.component.mjs +12 -1
- package/esm2022/components/modal/lib/directives/modal-close.directive.mjs +25 -1
- package/esm2022/components/modal/lib/directives/modal-content.directive.mjs +4 -1
- package/esm2022/components/modal/lib/directives/modal-dismiss.directive.mjs +18 -1
- package/esm2022/components/modal/lib/helpers/inject-modal-ref.mjs +22 -1
- package/esm2022/components/modal/lib/helpers/provide-modal-ref.mjs +10 -1
- package/esm2022/components/modal/lib/modal.component.mjs +21 -2
- package/esm2022/components/modal/lib/modal.config.mjs +34 -1
- package/esm2022/components/modal/lib/modal.directive.mjs +25 -1
- package/esm2022/components/modal/lib/modal.service.mjs +39 -1
- package/esm2022/components/modal/lib/models/modal-ref.mjs +34 -1
- package/esm2022/components/navigation-back/lib/navigation-back.component.mjs +4 -1
- package/esm2022/components/notification/lib/components/notification-center/notification-center.component.mjs +1 -3
- package/esm2022/components/notification/lib/directives/notification-center.directive.mjs +19 -5
- package/esm2022/components/notification/lib/helpers/get-notifications-by-tag.mjs +2 -1
- package/esm2022/components/notification/lib/helpers/sort-notifications.mjs +2 -1
- package/esm2022/components/notification/lib/helpers/to-notification-collection.mjs +2 -1
- package/esm2022/components/notification/lib/models/notification-feature.mjs +16 -1
- package/esm2022/components/notification/lib/notification.config.mjs +45 -1
- package/esm2022/components/notification/lib/notification.logger.mjs +2 -1
- package/esm2022/components/notification/lib/notification.service.mjs +56 -1
- package/esm2022/components/notification/lib/notification.tokens.mjs +4 -1
- package/esm2022/components/notification/lib/services/notification-center.service.mjs +10 -1
- package/esm2022/components/paginator/lib/paginator.component.mjs +90 -1
- package/esm2022/components/paginator/lib/paginator.config.mjs +29 -1
- package/esm2022/components/progress/lib/progress.component.mjs +16 -1
- package/esm2022/components/radio-group/lib/components/radio-button/radio-button.component.mjs +20 -3
- package/esm2022/components/radio-group/lib/radio-group.component.mjs +13 -2
- package/esm2022/components/rail-navigation/lib/components/rail-navigation-item/rail-navigation-item.component.mjs +17 -1
- package/esm2022/components/rail-navigation/lib/rail-navigation.component.mjs +27 -1
- package/esm2022/components/rich-list/lib/components/rich-list-content/rich-list-content.component.mjs +5 -1
- package/esm2022/components/rich-list/lib/components/rich-list-header/rich-list-header.component.mjs +5 -1
- package/esm2022/components/rich-list/lib/components/rich-list-item/rich-list-item.component.mjs +10 -2
- package/esm2022/components/rich-list/lib/rich-list.component.mjs +10 -3
- package/esm2022/components/select/lib/components/select-option/select-option.component.mjs +49 -7
- package/esm2022/components/select/lib/directives/select-input-control.directive.mjs +12 -2
- package/esm2022/components/select/lib/pipes/select-search-filter.pipe.mjs +11 -1
- package/esm2022/components/select/lib/select.component.mjs +59 -5
- package/esm2022/components/slider/lib/slider.directive.mjs +20 -1
- package/esm2022/components/spinbox/lib/spinbox.component.mjs +17 -1
- package/esm2022/components/switch/lib/switch.component.mjs +11 -1
- package/esm2022/components/switch/lib/switch.validator.mjs +13 -1
- package/esm2022/components/tab-bar/lib/components/tab-bar-item/tab-bar-item.component.mjs +29 -1
- package/esm2022/components/tab-bar/lib/tab-bar.component.mjs +71 -1
- package/esm2022/components/table/lib/components/check-cell/check-cell.component.mjs +19 -1
- package/esm2022/components/table/lib/components/header-title/header-title.component.mjs +30 -2
- package/esm2022/components/table/lib/directives/table-cell.directive.mjs +5 -1
- package/esm2022/components/table/lib/directives/table-row.directive.mjs +5 -1
- package/esm2022/components/table/lib/table.component.mjs +30 -1
- package/esm2022/components/timepicker/lib/timepicker.component.mjs +15 -6
- package/esm2022/components/timepicker/lib/utils/generate-time-stamps.mjs +5 -3
- package/esm2022/components/timepicker/lib/utils/ngx-mask-helper.mjs +3 -3
- package/esm2022/components/toast/lib/components/toast-container/toast-container.component.mjs +3 -3
- package/esm2022/components/toast/lib/components/toast-item/toast-item.component.mjs +5 -3
- package/esm2022/components/toast/lib/models/toast.mjs +1 -1
- package/esm2022/components/toast/lib/toast.config.mjs +27 -1
- package/esm2022/components/toast/lib/toast.service.mjs +36 -1
- package/esm2022/components/toggle-button-group/lib/components/toggle-button/toggle-button.component.mjs +12 -1
- package/esm2022/components/toggle-button-group/lib/toggle-button-group.component.mjs +14 -2
- package/esm2022/components/tooltip/lib/helpers/resolve-tooltip-trigger-events.mjs +8 -1
- package/esm2022/components/tooltip/lib/tooltip.component.mjs +18 -1
- package/esm2022/components/tooltip/lib/tooltip.directive.mjs +36 -1
- package/esm2022/components/wizard/lib/components/wizard-step/wizard-step.component.mjs +35 -1
- package/esm2022/components/wizard/lib/wizard.component.mjs +21 -1
- package/esm2022/internal/lib/helpers/decorator-property-name.mjs +9 -1
- package/esm2022/internal/translate/lib/translate.config.mjs +32 -1
- package/esm2022/internal/translate/lib/translate.service.mjs +30 -1
- package/esm2022/lib/controllers/controller.mjs +26 -1
- package/esm2022/lib/controllers/disabled.controller.mjs +60 -1
- package/esm2022/lib/controllers/readonly.controller.mjs +57 -1
- package/esm2022/lib/directives/click-outside.directive.mjs +30 -1
- package/esm2022/lib/directives/delegate-focus.directive.mjs +15 -1
- package/esm2022/lib/services/window-ref.mjs +67 -1
- package/esm2022/lib/tokens/identity-matcher.mjs +25 -1
- package/esm2022/lib/tokens/string-search-handler.mjs +25 -1
- package/esm2022/lib/tokens/stringify.mjs +26 -1
- package/esm2022/localization/lib/features/with-http-language-header.mjs +54 -1
- package/esm2022/localization/lib/features/with-http-language-query-param.mjs +52 -1
- package/esm2022/localization/lib/loaders/browser-language-loader.mjs +33 -1
- package/esm2022/localization/lib/localization.config.mjs +71 -1
- package/esm2022/localization/lib/localization.service.mjs +42 -3
- package/esm2022/localization/lib/models/localization-feature.mjs +8 -1
- package/esm2022/rxjs/index.mjs +2 -2
- package/esm2022/rxjs/lib/delay-until.mjs +23 -1
- package/esm2022/rxjs/lib/from-element-mutation.mjs +22 -1
- package/esm2022/rxjs/lib/from-element-resize.mjs +25 -1
- package/esm2022/rxjs/lib/from-events.mjs +25 -1
- package/esm2022/rxjs/lib/from-query-list.mjs +24 -0
- package/esm2022/sdk/lib/application-environment.mjs +51 -1
- package/esm2022/theming/lib/helpers/prefers-dark-theme.mjs +19 -1
- package/esm2022/theming/lib/helpers/resolve-theme.mjs +26 -1
- package/esm2022/theming/lib/helpers/theme-storage.mjs +43 -1
- package/esm2022/theming/lib/theming.config.mjs +34 -1
- package/esm2022/theming/lib/theming.service.mjs +32 -1
- package/esm2022/utils/lib/decorators/pure.mjs +52 -1
- package/esm2022/utils/lib/helpers/angular.mjs +37 -1
- package/esm2022/utils/lib/helpers/array.mjs +5 -1
- package/esm2022/utils/lib/helpers/build-url.mjs +21 -1
- package/esm2022/utils/lib/helpers/build-website-url.mjs +3 -2
- package/esm2022/utils/lib/helpers/cache-storage-client.mjs +52 -1
- package/esm2022/utils/lib/helpers/coercion.mjs +18 -1
- package/esm2022/utils/lib/helpers/debounce.mjs +28 -1
- package/esm2022/utils/lib/helpers/defer-fn.mjs +21 -1
- package/esm2022/utils/lib/helpers/dom.mjs +71 -1
- package/esm2022/utils/lib/helpers/get-axis.mjs +21 -1
- package/esm2022/utils/lib/helpers/get-language-code.mjs +18 -1
- package/esm2022/utils/lib/helpers/get-opposite-side.mjs +22 -1
- package/esm2022/utils/lib/helpers/get-side.mjs +18 -1
- package/esm2022/utils/lib/helpers/get-unique-id.mjs +34 -1
- package/esm2022/utils/lib/helpers/match-url.mjs +41 -1
- package/esm2022/utils/lib/helpers/ng-changes.mjs +30 -1
- package/esm2022/utils/lib/helpers/provide-config.mjs +57 -1
- package/esm2022/utils/lib/helpers/queue.mjs +84 -1
- package/esm2022/utils/lib/helpers/type-guards.mjs +58 -1
- package/esm2022/utils/lib/helpers/until-destroyed.mjs +39 -1
- package/fesm2022/odx-angular-animations.mjs +173 -0
- package/fesm2022/odx-angular-animations.mjs.map +1 -1
- package/fesm2022/odx-angular-breakpoints.mjs +136 -0
- package/fesm2022/odx-angular-breakpoints.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-a11y.mjs +71 -0
- package/fesm2022/odx-angular-cdk-a11y.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-active-indicator.mjs +63 -0
- package/fesm2022/odx-angular-cdk-active-indicator.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-autocomplete-control.mjs +39 -1
- package/fesm2022/odx-angular-cdk-autocomplete-control.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-checkbox-control.mjs +3 -0
- package/fesm2022/odx-angular-cdk-checkbox-control.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-connected-overlay.mjs +103 -0
- package/fesm2022/odx-angular-cdk-connected-overlay.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-custom-form-control.mjs +183 -2
- package/fesm2022/odx-angular-cdk-custom-form-control.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-dynamic-view.mjs +202 -0
- package/fesm2022/odx-angular-cdk-dynamic-view.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-event-plugins.mjs +135 -0
- package/fesm2022/odx-angular-cdk-event-plugins.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-expandable.mjs +88 -0
- package/fesm2022/odx-angular-cdk-expandable.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-option-control.mjs +47 -0
- package/fesm2022/odx-angular-cdk-option-control.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-radio-group-control.mjs +19 -0
- package/fesm2022/odx-angular-cdk-radio-group-control.mjs.map +1 -1
- package/fesm2022/odx-angular-components-accordion.mjs +41 -0
- package/fesm2022/odx-angular-components-accordion.mjs.map +1 -1
- package/fesm2022/odx-angular-components-action-group.mjs +6 -0
- package/fesm2022/odx-angular-components-action-group.mjs.map +1 -1
- package/fesm2022/odx-angular-components-area-header.mjs +14 -0
- package/fesm2022/odx-angular-components-area-header.mjs.map +1 -1
- package/fesm2022/odx-angular-components-autocomplete.mjs +28 -4
- package/fesm2022/odx-angular-components-autocomplete.mjs.map +1 -1
- package/fesm2022/odx-angular-components-avatar.mjs +8 -0
- package/fesm2022/odx-angular-components-avatar.mjs.map +1 -1
- package/fesm2022/odx-angular-components-badge.mjs +25 -0
- package/fesm2022/odx-angular-components-badge.mjs.map +1 -1
- package/fesm2022/odx-angular-components-bar.mjs +13 -0
- package/fesm2022/odx-angular-components-bar.mjs.map +1 -1
- package/fesm2022/odx-angular-components-breadcrumbs.mjs +3 -0
- package/fesm2022/odx-angular-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/odx-angular-components-button-group.mjs +15 -0
- package/fesm2022/odx-angular-components-button-group.mjs.map +1 -1
- package/fesm2022/odx-angular-components-button.mjs +10 -0
- package/fesm2022/odx-angular-components-button.mjs.map +1 -1
- package/fesm2022/odx-angular-components-calendar.mjs +232 -0
- package/fesm2022/odx-angular-components-calendar.mjs.map +1 -1
- package/fesm2022/odx-angular-components-checkbox.mjs +55 -0
- package/fesm2022/odx-angular-components-checkbox.mjs.map +1 -1
- package/fesm2022/odx-angular-components-chip.mjs +20 -0
- package/fesm2022/odx-angular-components-chip.mjs.map +1 -1
- package/fesm2022/odx-angular-components-circular-progress.mjs +20 -0
- package/fesm2022/odx-angular-components-circular-progress.mjs.map +1 -1
- package/fesm2022/odx-angular-components-content-box.mjs +9 -0
- package/fesm2022/odx-angular-components-content-box.mjs.map +1 -1
- package/fesm2022/odx-angular-components-datepicker.mjs +84 -0
- package/fesm2022/odx-angular-components-datepicker.mjs.map +1 -1
- package/fesm2022/odx-angular-components-daterangepicker.mjs +145 -0
- package/fesm2022/odx-angular-components-daterangepicker.mjs.map +1 -1
- package/fesm2022/odx-angular-components-dropdown.mjs +66 -0
- package/fesm2022/odx-angular-components-dropdown.mjs.map +1 -1
- package/fesm2022/odx-angular-components-error-page.mjs +15 -0
- package/fesm2022/odx-angular-components-error-page.mjs.map +1 -1
- package/fesm2022/odx-angular-components-footer.mjs +11 -6
- package/fesm2022/odx-angular-components-footer.mjs.map +1 -1
- package/fesm2022/odx-angular-components-form-field.mjs +131 -0
- package/fesm2022/odx-angular-components-form-field.mjs.map +1 -1
- package/fesm2022/odx-angular-components-header-navigation.mjs +6 -0
- package/fesm2022/odx-angular-components-header-navigation.mjs.map +1 -1
- package/fesm2022/odx-angular-components-header.mjs +10 -0
- package/fesm2022/odx-angular-components-header.mjs.map +1 -1
- package/fesm2022/odx-angular-components-icon.mjs +57 -0
- package/fesm2022/odx-angular-components-icon.mjs.map +1 -1
- package/fesm2022/odx-angular-components-inline-message.mjs +13 -0
- package/fesm2022/odx-angular-components-inline-message.mjs.map +1 -1
- package/fesm2022/odx-angular-components-link.mjs +3 -0
- package/fesm2022/odx-angular-components-link.mjs.map +1 -1
- package/fesm2022/odx-angular-components-list.mjs +28 -1
- package/fesm2022/odx-angular-components-list.mjs.map +1 -1
- package/fesm2022/odx-angular-components-loading-spinner.mjs +30 -0
- package/fesm2022/odx-angular-components-loading-spinner.mjs.map +1 -1
- package/fesm2022/odx-angular-components-logo.mjs +15 -0
- package/fesm2022/odx-angular-components-logo.mjs.map +1 -1
- package/fesm2022/odx-angular-components-main-menu.mjs +119 -0
- package/fesm2022/odx-angular-components-main-menu.mjs.map +1 -1
- package/fesm2022/odx-angular-components-mainfilter-group.mjs +4 -0
- package/fesm2022/odx-angular-components-mainfilter-group.mjs.map +1 -1
- package/fesm2022/odx-angular-components-menu.mjs +36 -0
- package/fesm2022/odx-angular-components-menu.mjs.map +1 -1
- package/fesm2022/odx-angular-components-modal.mjs +252 -0
- package/fesm2022/odx-angular-components-modal.mjs.map +1 -1
- package/fesm2022/odx-angular-components-navigation-back.mjs +3 -0
- package/fesm2022/odx-angular-components-navigation-back.mjs.map +1 -1
- package/fesm2022/odx-angular-components-notification.mjs +148 -6
- package/fesm2022/odx-angular-components-notification.mjs.map +1 -1
- package/fesm2022/odx-angular-components-paginator.mjs +117 -0
- package/fesm2022/odx-angular-components-paginator.mjs.map +1 -1
- package/fesm2022/odx-angular-components-progress.mjs +15 -0
- package/fesm2022/odx-angular-components-progress.mjs.map +1 -1
- package/fesm2022/odx-angular-components-radio-group.mjs +30 -2
- package/fesm2022/odx-angular-components-radio-group.mjs.map +1 -1
- package/fesm2022/odx-angular-components-rail-navigation.mjs +42 -0
- package/fesm2022/odx-angular-components-rail-navigation.mjs.map +1 -1
- package/fesm2022/odx-angular-components-rich-list.mjs +26 -3
- package/fesm2022/odx-angular-components-rich-list.mjs.map +1 -1
- package/fesm2022/odx-angular-components-select.mjs +126 -11
- package/fesm2022/odx-angular-components-select.mjs.map +1 -1
- package/fesm2022/odx-angular-components-slider.mjs +19 -0
- package/fesm2022/odx-angular-components-slider.mjs.map +1 -1
- package/fesm2022/odx-angular-components-spinbox.mjs +16 -0
- package/fesm2022/odx-angular-components-spinbox.mjs.map +1 -1
- package/fesm2022/odx-angular-components-switch.mjs +22 -0
- package/fesm2022/odx-angular-components-switch.mjs.map +1 -1
- package/fesm2022/odx-angular-components-tab-bar.mjs +98 -0
- package/fesm2022/odx-angular-components-tab-bar.mjs.map +1 -1
- package/fesm2022/odx-angular-components-table.mjs +84 -1
- package/fesm2022/odx-angular-components-table.mjs.map +1 -1
- package/fesm2022/odx-angular-components-timepicker.mjs +20 -9
- package/fesm2022/odx-angular-components-timepicker.mjs.map +1 -1
- package/fesm2022/odx-angular-components-toast.mjs +67 -4
- package/fesm2022/odx-angular-components-toast.mjs.map +1 -1
- package/fesm2022/odx-angular-components-toggle-button-group.mjs +23 -0
- package/fesm2022/odx-angular-components-toggle-button-group.mjs.map +1 -1
- package/fesm2022/odx-angular-components-tooltip.mjs +59 -0
- package/fesm2022/odx-angular-components-tooltip.mjs.map +1 -1
- package/fesm2022/odx-angular-components-wizard.mjs +54 -0
- package/fesm2022/odx-angular-components-wizard.mjs.map +1 -1
- package/fesm2022/odx-angular-internal-translate.mjs +60 -0
- package/fesm2022/odx-angular-internal-translate.mjs.map +1 -1
- package/fesm2022/odx-angular-internal.mjs +8 -0
- package/fesm2022/odx-angular-internal.mjs.map +1 -1
- package/fesm2022/odx-angular-localization.mjs +254 -2
- package/fesm2022/odx-angular-localization.mjs.map +1 -1
- package/fesm2022/odx-angular-rxjs.mjs +115 -5
- package/fesm2022/odx-angular-rxjs.mjs.map +1 -1
- package/fesm2022/odx-angular-sdk.mjs +50 -0
- package/fesm2022/odx-angular-sdk.mjs.map +1 -1
- package/fesm2022/odx-angular-theming.mjs +149 -0
- package/fesm2022/odx-angular-theming.mjs.map +1 -1
- package/fesm2022/odx-angular-utils.mjs +709 -1
- package/fesm2022/odx-angular-utils.mjs.map +1 -1
- package/fesm2022/odx-angular.mjs +322 -0
- package/fesm2022/odx-angular.mjs.map +1 -1
- package/internal/lib/helpers/decorator-property-name.d.ts +8 -0
- package/internal/translate/lib/translate.config.d.ts +31 -0
- package/internal/translate/lib/translate.service.d.ts +29 -0
- package/lib/controllers/controller.d.ts +25 -0
- package/lib/controllers/disabled.controller.d.ts +59 -0
- package/lib/controllers/readonly.controller.d.ts +56 -0
- package/lib/directives/click-outside.directive.d.ts +29 -0
- package/lib/directives/delegate-focus.directive.d.ts +14 -0
- package/lib/services/window-ref.d.ts +66 -0
- package/lib/tokens/identity-matcher.d.ts +41 -0
- package/lib/tokens/string-search-handler.d.ts +39 -0
- package/lib/tokens/stringify.d.ts +42 -0
- package/localization/lib/features/with-http-language-header.d.ts +63 -0
- package/localization/lib/features/with-http-language-query-param.d.ts +61 -0
- package/localization/lib/loaders/browser-language-loader.d.ts +32 -0
- package/localization/lib/localization.config.d.ts +81 -0
- package/localization/lib/localization.service.d.ts +39 -0
- package/localization/lib/models/localization-feature.d.ts +7 -0
- package/package.json +1 -1
- package/rxjs/index.d.ts +1 -1
- package/rxjs/lib/delay-until.d.ts +22 -0
- package/rxjs/lib/from-element-mutation.d.ts +21 -0
- package/rxjs/lib/from-element-resize.d.ts +24 -0
- package/rxjs/lib/from-events.d.ts +24 -0
- package/rxjs/lib/from-query-list.d.ts +22 -0
- package/sdk/lib/application-environment.d.ts +59 -0
- package/theming/lib/helpers/prefers-dark-theme.d.ts +18 -0
- package/theming/lib/helpers/resolve-theme.d.ts +25 -0
- package/theming/lib/helpers/theme-storage.d.ts +42 -0
- package/theming/lib/theming.config.d.ts +46 -0
- package/theming/lib/theming.service.d.ts +31 -0
- package/utils/lib/decorators/pure.d.ts +51 -0
- package/utils/lib/helpers/angular.d.ts +36 -0
- package/utils/lib/helpers/array.d.ts +4 -0
- package/utils/lib/helpers/build-url.d.ts +20 -0
- package/utils/lib/helpers/build-website-url.d.ts +2 -1
- package/utils/lib/helpers/cache-storage-client.d.ts +51 -0
- package/utils/lib/helpers/coercion.d.ts +17 -0
- package/utils/lib/helpers/debounce.d.ts +27 -0
- package/utils/lib/helpers/defer-fn.d.ts +20 -0
- package/utils/lib/helpers/dom.d.ts +70 -0
- package/utils/lib/helpers/get-axis.d.ts +20 -0
- package/utils/lib/helpers/get-language-code.d.ts +17 -0
- package/utils/lib/helpers/get-opposite-side.d.ts +21 -0
- package/utils/lib/helpers/get-side.d.ts +17 -0
- package/utils/lib/helpers/get-unique-id.d.ts +33 -0
- package/utils/lib/helpers/match-url.d.ts +40 -0
- package/utils/lib/helpers/ng-changes.d.ts +52 -0
- package/utils/lib/helpers/provide-config.d.ts +56 -0
- package/utils/lib/helpers/queue.d.ts +83 -0
- package/utils/lib/helpers/type-guards.d.ts +57 -0
- package/utils/lib/helpers/until-destroyed.d.ts +38 -0
- package/esm2022/rxjs/lib/form-query-list.mjs +0 -5
- package/rxjs/lib/form-query-list.d.ts +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odx-angular-rxjs.mjs","sources":["../../../../libs/angular/rxjs/src/lib/delay-until.ts","../../../../libs/angular/rxjs/src/lib/
|
|
1
|
+
{"version":3,"file":"odx-angular-rxjs.mjs","sources":["../../../../libs/angular/rxjs/src/lib/delay-until.ts","../../../../libs/angular/rxjs/src/lib/from-element-mutation.ts","../../../../libs/angular/rxjs/src/lib/from-element-resize.ts","../../../../libs/angular/rxjs/src/lib/from-events.ts","../../../../libs/angular/rxjs/src/lib/from-query-list.ts","../../../../libs/angular/rxjs/src/odx-angular-rxjs.ts"],"sourcesContent":["import { map, MonoTypeOperatorFunction, Observable, switchMap, takeUntil, timer } from 'rxjs';\n\n/**\n * Delays the emission of each value from the source Observable by a time span determined by the `delay` function.\n * If the `notifier` Observable emits before the delay expires, the delayed emission is cancelled.\n *\n * This operator is useful for postponing the observable emissions until certain conditions are met,\n * represented by the passage of time defined by `delay`. It also allows for a way to preemptively\n * cancel the delay in response to another observable's emission.\n *\n * @template T The type of items emitted by the source Observable.\n * @param {() => number} delay A function that returns the delay (in milliseconds) before the source Observable's values are emitted.\n * @param {Observable<unknown>} notifier An Observable that cancels the delay when it emits.\n * @returns {MonoTypeOperatorFunction<T>} An Observable that emits the source Observable's items with a delay if not cancelled.\n * @example\n * ```ts\n * // Delay each number emission by 1 second, unless the 'cancel' button is clicked.\n * const delayedNumbers$ = of(1, 2, 3).pipe(\n * delayUntil(() => 1000, fromEvent(cancelButton, 'click'))\n * );\n *\n * delayedNumbers$.subscribe(console.log);\n * ```\n */\nexport function delayUntil<T>(delay: () => number, notifier: Observable<unknown>): MonoTypeOperatorFunction<T> {\n return (source$: Observable<T>) =>\n source$.pipe(\n switchMap((value: T) =>\n timer(delay()).pipe(\n map(() => value),\n takeUntil(notifier),\n ),\n ),\n );\n}\n","import { createMutationObserver } from '@odx/angular/utils';\nimport { Observable } from 'rxjs';\n\n/**\n * Creates an RxJS Observable that emits mutation records for changes in a DOM element's attributes,\n * child list, and subtree. It uses the `MutationObserver` Web API to observe mutations on the specified\n * element according to the options provided.\n *\n * @param {Element} element The DOM element to observe for mutations.\n * @param {MutationObserverInit} options An object that specifies which DOM mutations should be reported.\n * Options include attributes, childList, subtree, attributeOldValue, characterData, characterDataOldValue,\n * and attributeFilter.\n * @returns {Observable<MutationRecord>} An Observable that emits a `MutationRecord` each time a mutation\n * matching the specified options occurs in the observed element.\n * @example\n * ```ts\n * // Observing changes to the child list of an element\n * const element = document.getElementById('my-element');\n * const mutationOptions = { childList: true };\n *\n * fromElementMutation$(element, mutationOptions).subscribe((mutation) => console.log('Mutation detected:', mutation));\n * ```\n * Note: Always remember to unsubscribe from the observable to prevent memory leaks.\n */\nexport function fromElementMutation$(element: Element, options: MutationObserverInit): Observable<MutationRecord> {\n return new Observable<MutationRecord>((observer) => {\n const mutationObserver = createMutationObserver(observer, (events) => events.length > 0);\n observer.add(() => mutationObserver.disconnect());\n mutationObserver.observe(element, options);\n });\n}\n","import { createResizeObserver } from '@odx/angular/utils';\nimport { debounceTime, Observable } from 'rxjs';\n\n/**\n * Creates an RxJS Observable that emits an array of `ResizeObserverEntry` objects whenever\n * the target element's size changes. This function provides a reactive way to observe\n * and respond to changes in an element's dimensions, using the `ResizeObserver` Web API.\n *\n * The observable debounces the emitted values to improve performance and reduce the frequency\n * of change detection runs in Angular applications. The debounce time can be adjusted via\n * the `debounceDuration` parameter.\n *\n * @param {Element} element The DOM element to observe for size changes.\n * @param {number} [debounceDuration=50] The time, in milliseconds, to debounce the emitted\n * values. Defaults to 50ms.\n * @returns {Observable<ResizeObserverEntry[]>} An Observable that emits the resize events\n * for the observed element. Each emission is an array of `ResizeObserverEntry` objects, one\n * for each observed element that experienced a resize.\n * @example\n * ```ts\n * // Observing resize events of an element with a 100ms debounce duration\n * const element = document.getElementById('resizable-element');\n * fromElementResize$(element, 100).subscribe((entries) => console.log('Element resized:', entries));\n * ```\n *\n * Always unsubscribe from the observable to clean up resources and prevent memory leaks.\n */\nexport function fromElementResize$(element: Element, debounceDuration = 50): Observable<ResizeObserverEntry[]> {\n return new Observable<ResizeObserverEntry[]>((observer) => {\n const resizeObserver = createResizeObserver((events) => {\n if (events.length > 0) {\n observer.next(events);\n }\n });\n observer.add(() => resizeObserver.disconnect());\n resizeObserver.observe(element);\n }).pipe(debounceTime(debounceDuration));\n}\n","import { fromEvent, merge, Observable } from 'rxjs';\nimport { HasEventTargetAddRemove } from 'rxjs/internal/observable/fromEvent';\n\n/**\n * Creates an Observable that emits events of a specific type from one or multiple event targets.\n * It listens to multiple event types on the given target(s) and emits the events through a single\n * Observable stream, simplifying the handling of related event types.\n *\n * @template T The event object type that the Observable will emit.\n * @param {HasEventTargetAddRemove<T> | HasEventTargetAddRemove<T>[]} target The DOM element(s) or event target(s) to listen on.\n * @param {...string[]} events The names of the events to listen for on the target(s).\n * @returns {Observable<T>} An Observable that emits an event each time one of the specified events occurs on the given target(s).\n *\n * @example\n * ```ts\n * // Listen to both 'click' and 'keyup' events on document\n * fromEvents(document, 'click', 'keyup').subscribe(event => {\n * console.log('Event occurred:', event);\n * });\n *\n * // Listen to 'mousemove' event on multiple elements\n * const elements = [document.getElementById('first'), document.getElementById('second')];\n * fromEvents(elements, 'mousemove').subscribe(event => {\n * console.log('Mouse moved over:', event.target);\n * });\n * ```\n */\nexport function fromEvents<T>(target: HasEventTargetAddRemove<T> | HasEventTargetAddRemove<T>[], ...events: string[]): Observable<T> {\n return merge(...events.map((event) => fromEvent(target, event)));\n}\n","import { QueryList } from '@angular/core';\nimport { Observable, startWith } from 'rxjs';\n\n/**\n * Creates an Observable from an Angular QueryList. The Observable emits the initial state\n * of the QueryList and continues to emit updates every time the QueryList changes.\n * This utility function is useful for integrating Angular's QueryList changes into\n * the RxJS reactive data flow, allowing developers to apply RxJS operators and\n * subscriptions to respond to QueryList updates.\n *\n * @template T The type of elements contained within the QueryList.\n * @param {QueryList<T>} queryList The QueryList instance to observe.\n * @returns {Observable<QueryList<T>>} An Observable that emits the current state of the QueryList\n * and updates whenever the QueryList changes.\n * @example\n * ```ts\n * // Assuming 'items' is a QueryList of component instances or DOM elements\n * fromQueryList(items).subscribe(queryList => {\n * console.log('QueryList changed:', queryList);\n * });\n * ```\n */\nexport function fromQueryList<T>(queryList: QueryList<T>): Observable<QueryList<T>> {\n return queryList.changes.pipe(startWith(queryList));\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;;AAqBG;AACa,SAAA,UAAU,CAAI,KAAmB,EAAE,QAA6B,EAAA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;AAC1C;;AClCA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;SACa,UAAU,CAAI,MAAiE,EAAE,GAAG,MAAgB,EAAA;IAClH,OAAO,KAAK,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AACnE;;AC1BA;;;;;;;;;;;;;;;;;;AAkBG;AACG,SAAU,aAAa,CAAI,SAAuB,EAAA;IACtD,OAAO,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;AACtD;;ACxBA;;AAEG;;;;"}
|
|
@@ -2,10 +2,60 @@ import { InjectionToken, inject } from '@angular/core';
|
|
|
2
2
|
import { bootstrapApplication } from '@angular/platform-browser';
|
|
3
3
|
import { CacheStorageClient } from '@odx/angular/utils';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Creates a loader function for fetching application environment data over HTTP and caching it.
|
|
7
|
+
* Utilizes `CacheStorageClient` for caching the fetched data to optimize performance and reduce network load.
|
|
8
|
+
*
|
|
9
|
+
* @template Data The type of the data expected from the HTTP request.
|
|
10
|
+
* @param {Function} handler - A function that processes the fetched data and returns a promise resolving to the desired environment data format.
|
|
11
|
+
* @returns {ApplicationEnvironmentLoader<Data, Parameters<CacheStorageClient['request']>>} A loader function that fetches, caches, and processes environment data.
|
|
12
|
+
* @example
|
|
13
|
+
* const environmentLoader = createHttpApplicationEnvironmentLoader(async (dto) => {
|
|
14
|
+
* return { apiEndpoint: dto.apiEndpoint, featureFlags: dto.featureFlags };
|
|
15
|
+
* });
|
|
16
|
+
*/
|
|
5
17
|
function createHttpApplicationEnvironmentLoader(handler) {
|
|
6
18
|
const cache = new CacheStorageClient('@odx/angular/sdk::ApplicationEnvironment');
|
|
7
19
|
return (...args) => cache.request(...args).then((dto) => handler(dto));
|
|
8
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* The application environment module can be used to load environment data before application startup,
|
|
23
|
+
* that can be used to load environment variables from an external URL.
|
|
24
|
+
*
|
|
25
|
+
* @template Data The type of the environment data.
|
|
26
|
+
* @template Params The types of the parameters accepted by the loader function.
|
|
27
|
+
* @param {ApplicationEnvironmentLoader<Data, Params>} loader - A loader function that asynchronously loads the environment data.
|
|
28
|
+
* @returns An object containing utilities for working with the application environment, including the InjectionToken
|
|
29
|
+
* and functions for loading and bootstrapping the application with the environment.
|
|
30
|
+
* @example
|
|
31
|
+
* To add an application environment to your Angular application, follow the following steps:
|
|
32
|
+
* 1. Create the application environment with your loader:
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { createApplicationEnvironment, createHttpApplicationEnvironmentLoader } from '@odx/angular/sdk';
|
|
35
|
+
* import { z } from 'zod';
|
|
36
|
+
*
|
|
37
|
+
* export const ApplicationConfigSchema = z.object({
|
|
38
|
+
* environment: z.enum(['dev', 'stage', 'prod']),
|
|
39
|
+
* appName: z.string().default('App'),
|
|
40
|
+
* });
|
|
41
|
+
*
|
|
42
|
+
* const httpEnvironmentLoader = createHttpApplicationEnvironmentLoader((res) => res.json().then(ApplicationConfigSchema.parse));
|
|
43
|
+
* export const { injectApplicationEnvironment, bootstrapApplicationWithEnvironment } = createApplicationEnvironment(httpEnvironmentLoader);
|
|
44
|
+
* ```
|
|
45
|
+
* This example creates an HTTP environment loader which parses the response as JSON and validate it against a schema
|
|
46
|
+
*
|
|
47
|
+
* 2. Provide the application environment:
|
|
48
|
+
* ```ts
|
|
49
|
+
* bootstrapApplicationWithEnvironment(['assets/config.json'], AppComponent, { providers: [] });
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* 3. Use the application environment via DI
|
|
53
|
+
* ```ts
|
|
54
|
+
* class MyService {
|
|
55
|
+
* private readonly environment = injectApplicationEnvironment();
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
9
59
|
function createApplicationEnvironment(loader) {
|
|
10
60
|
let environment;
|
|
11
61
|
const APPLICATION_ENVIRONMENT = new InjectionToken('@odx/angular/sdk::ApplicationEnvironment', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odx-angular-sdk.mjs","sources":["../../../../libs/angular/sdk/src/lib/application-environment.ts","../../../../libs/angular/sdk/src/odx-angular-sdk.ts"],"sourcesContent":["import { ApplicationRef, inject, InjectionToken } from '@angular/core';\nimport { bootstrapApplication } from '@angular/platform-browser';\nimport { CacheStorageClient } from '@odx/angular/utils';\n\nexport type ApplicationEnvironmentLoader<EnvironmentData, Params extends unknown[]> = (...args: Params) => Promise<EnvironmentData>;\n\nexport function createHttpApplicationEnvironmentLoader<Data>(\n handler: (dto: unknown) => Promise<Data>,\n): ApplicationEnvironmentLoader<Data, Parameters<CacheStorageClient['request']>> {\n const cache = new CacheStorageClient('@odx/angular/sdk::ApplicationEnvironment');\n\n return (...args: Parameters<CacheStorageClient['request']>) => cache.request<unknown>(...args).then((dto) => handler(dto));\n}\n\nexport function createApplicationEnvironment<Data, Params extends unknown[]>(loader: ApplicationEnvironmentLoader<Data, Params>) {\n let environment: Data;\n const APPLICATION_ENVIRONMENT = new InjectionToken<Data>('@odx/angular/sdk::ApplicationEnvironment', {\n providedIn: 'root',\n factory: () => environment as Data,\n });\n\n function injectApplicationEnvironment(): Data {\n return inject(APPLICATION_ENVIRONMENT);\n }\n\n async function loadApplicationEnvironment(...args: Parameters<typeof loader>): Promise<Data> {\n environment = await loader(...args);\n if (!environment) {\n throw new Error('[@odx/angular/sdk] Failed load application environment');\n }\n return environment;\n }\n\n async function bootstrapApplicationWithEnvironment(\n params: Parameters<typeof loader>,\n ...args: Parameters<typeof bootstrapApplication>\n ): Promise<ApplicationRef> {\n await loadApplicationEnvironment(...params);\n\n return bootstrapApplication(...args);\n }\n\n return {\n APPLICATION_ENVIRONMENT,\n injectApplicationEnvironment,\n bootstrapApplicationWithEnvironment,\n loadApplicationEnvironment,\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"odx-angular-sdk.mjs","sources":["../../../../libs/angular/sdk/src/lib/application-environment.ts","../../../../libs/angular/sdk/src/odx-angular-sdk.ts"],"sourcesContent":["import { ApplicationRef, inject, InjectionToken } from '@angular/core';\nimport { bootstrapApplication } from '@angular/platform-browser';\nimport { CacheStorageClient } from '@odx/angular/utils';\n\n/**\n * A function type definition for loading environment data for an application.\n * It's a generic loader function that accepts parameters and returns a Promise of environment data.\n *\n * @template EnvironmentData The type of the environment data to be loaded.\n * @template Params The types of the parameters accepted by the loader function.\n * @param {...Params} args - Parameters passed to the loader function.\n * @returns {Promise<EnvironmentData>} A promise resolving to the loaded environment data.\n */\nexport type ApplicationEnvironmentLoader<EnvironmentData, Params extends unknown[]> = (...args: Params) => Promise<EnvironmentData>;\n\n/**\n * Creates a loader function for fetching application environment data over HTTP and caching it.\n * Utilizes `CacheStorageClient` for caching the fetched data to optimize performance and reduce network load.\n *\n * @template Data The type of the data expected from the HTTP request.\n * @param {Function} handler - A function that processes the fetched data and returns a promise resolving to the desired environment data format.\n * @returns {ApplicationEnvironmentLoader<Data, Parameters<CacheStorageClient['request']>>} A loader function that fetches, caches, and processes environment data.\n * @example\n * const environmentLoader = createHttpApplicationEnvironmentLoader(async (dto) => {\n * return { apiEndpoint: dto.apiEndpoint, featureFlags: dto.featureFlags };\n * });\n */\nexport function createHttpApplicationEnvironmentLoader<Data>(\n handler: (dto: unknown) => Promise<Data>,\n): ApplicationEnvironmentLoader<Data, Parameters<CacheStorageClient['request']>> {\n const cache = new CacheStorageClient('@odx/angular/sdk::ApplicationEnvironment');\n\n return (...args: Parameters<CacheStorageClient['request']>) => cache.request<unknown>(...args).then((dto) => handler(dto));\n}\n\n/**\n * The application environment module can be used to load environment data before application startup,\n * that can be used to load environment variables from an external URL.\n *\n * @template Data The type of the environment data.\n * @template Params The types of the parameters accepted by the loader function.\n * @param {ApplicationEnvironmentLoader<Data, Params>} loader - A loader function that asynchronously loads the environment data.\n * @returns An object containing utilities for working with the application environment, including the InjectionToken\n * and functions for loading and bootstrapping the application with the environment.\n * @example\n * To add an application environment to your Angular application, follow the following steps:\n * 1. Create the application environment with your loader:\n * ```ts\n * import { createApplicationEnvironment, createHttpApplicationEnvironmentLoader } from '@odx/angular/sdk';\n * import { z } from 'zod';\n *\n * export const ApplicationConfigSchema = z.object({\n * environment: z.enum(['dev', 'stage', 'prod']),\n * appName: z.string().default('App'),\n * });\n *\n * const httpEnvironmentLoader = createHttpApplicationEnvironmentLoader((res) => res.json().then(ApplicationConfigSchema.parse));\n * export const { injectApplicationEnvironment, bootstrapApplicationWithEnvironment } = createApplicationEnvironment(httpEnvironmentLoader);\n * ```\n * This example creates an HTTP environment loader which parses the response as JSON and validate it against a schema\n *\n * 2. Provide the application environment:\n * ```ts\n * bootstrapApplicationWithEnvironment(['assets/config.json'], AppComponent, { providers: [] });\n * ```\n *\n * 3. Use the application environment via DI\n * ```ts\n * class MyService {\n * private readonly environment = injectApplicationEnvironment();\n * }\n * ```\n */\nexport function createApplicationEnvironment<Data, Params extends unknown[]>(loader: ApplicationEnvironmentLoader<Data, Params>) {\n let environment: Data;\n const APPLICATION_ENVIRONMENT = new InjectionToken<Data>('@odx/angular/sdk::ApplicationEnvironment', {\n providedIn: 'root',\n factory: () => environment as Data,\n });\n\n function injectApplicationEnvironment(): Data {\n return inject(APPLICATION_ENVIRONMENT);\n }\n\n async function loadApplicationEnvironment(...args: Parameters<typeof loader>): Promise<Data> {\n environment = await loader(...args);\n if (!environment) {\n throw new Error('[@odx/angular/sdk] Failed load application environment');\n }\n return environment;\n }\n\n async function bootstrapApplicationWithEnvironment(\n params: Parameters<typeof loader>,\n ...args: Parameters<typeof bootstrapApplication>\n ): Promise<ApplicationRef> {\n await loadApplicationEnvironment(...params);\n\n return bootstrapApplication(...args);\n }\n\n return {\n APPLICATION_ENVIRONMENT,\n injectApplicationEnvironment,\n bootstrapApplicationWithEnvironment,\n loadApplic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C5B,mCAAmC;QACnC,0BAA0B;KAC3B,CAAC;AACJ;;AC3GA;;AAEG;;;;"}
|
|
@@ -5,6 +5,24 @@ import { DOCUMENT } from '@angular/common';
|
|
|
5
5
|
import { WindowRef } from '@odx/angular';
|
|
6
6
|
import { BehaviorSubject, distinctUntilChanged, shareReplay } from 'rxjs';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Determines whether the user's system preferences indicate a preference for dark themes.
|
|
10
|
+
* This is achieved by querying the '(prefers-color-scheme: dark)' media feature, which reflects
|
|
11
|
+
* the user's preference for a light or dark color scheme in their operating system's UI.
|
|
12
|
+
*
|
|
13
|
+
* @param {Window} view - The window object, typically `window`, from which to access the matchMedia method.
|
|
14
|
+
* @returns {boolean} `true` if the user prefers a dark theme, otherwise `false`.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* Example usage in a web application to toggle themes:
|
|
18
|
+
* ```ts
|
|
19
|
+
* if (prefersDarkTheme(window)) {
|
|
20
|
+
* document.body.classList.add('dark-theme');
|
|
21
|
+
* } else {
|
|
22
|
+
* document.body.classList.remove('dark-theme');
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
8
26
|
function prefersDarkTheme(view) {
|
|
9
27
|
return !!view.matchMedia?.('(prefers-color-scheme: dark)')?.matches;
|
|
10
28
|
}
|
|
@@ -15,11 +33,57 @@ const Theme = {
|
|
|
15
33
|
};
|
|
16
34
|
const availableThemes = Object.values(Theme);
|
|
17
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Resolves the specified theme by checking if it exists in the predefined list of available themes.
|
|
38
|
+
* This function ensures that only valid themes are used in the application, providing a safeguard
|
|
39
|
+
* against invalid theme names and facilitating the dynamic application of themes.
|
|
40
|
+
*
|
|
41
|
+
* @param {string | null} [theme] - The name of the theme to resolve. It's optional and can be `null`.
|
|
42
|
+
* @returns {Theme | null} - Returns the resolved `Theme` object if the theme is found within the list of `availableThemes`;
|
|
43
|
+
* otherwise, returns `null` to indicate the theme is not recognized or available.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* // Assuming 'dark' and 'light' are in the availableThemes array
|
|
48
|
+
* console.log(resolveTheme('dark')); // Outputs the 'dark' Theme object
|
|
49
|
+
* console.log(resolveTheme('unknown')); // Outputs null
|
|
50
|
+
*
|
|
51
|
+
* // Using resolveTheme to apply a user-selected theme
|
|
52
|
+
* const userSelectedTheme = getUserSelectedTheme(); // This function gets the user's theme choice
|
|
53
|
+
* const themeToApply = resolveTheme(userSelectedTheme);
|
|
54
|
+
* if (themeToApply) {
|
|
55
|
+
* applyTheme(themeToApply); // This function applies the resolved theme to the application
|
|
56
|
+
* } else {
|
|
57
|
+
* console.warn('Selected theme is not available.');
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
18
61
|
function resolveTheme(theme) {
|
|
19
62
|
return availableThemes.find((t) => t === theme) ?? null;
|
|
20
63
|
}
|
|
21
64
|
|
|
65
|
+
/**
|
|
66
|
+
* The key used to store the selected theme in `Storage`.
|
|
67
|
+
* This constant ensures consistent access to the theme setting across the application.
|
|
68
|
+
*/
|
|
22
69
|
const THEME_STORAGE_NAME = '@odx/angular/theming:SelectedTheme';
|
|
70
|
+
/**
|
|
71
|
+
* Saves the specified theme to storage. This function abstracts the storage interaction,
|
|
72
|
+
* providing a fail-safe mechanism to avoid exceptions if the storage is not available.
|
|
73
|
+
*
|
|
74
|
+
* @param {Storage | null | undefined} storage - The storage mechanism to use, typically `localStorage` or `sessionStorage`.
|
|
75
|
+
* @param {Theme} theme - The theme to save. Should be a value that is recognized by the application's theming system.
|
|
76
|
+
* @throws Will silently catch and ignore any exceptions caused by storage limitations or permissions.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* // Example usage with localStorage
|
|
81
|
+
* saveTheme(localStorage, 'dark');
|
|
82
|
+
*
|
|
83
|
+
* // Using sessionStorage instead
|
|
84
|
+
* saveTheme(sessionStorage, 'light');
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
23
87
|
function saveTheme(storage, theme) {
|
|
24
88
|
try {
|
|
25
89
|
storage?.setItem(THEME_STORAGE_NAME, theme);
|
|
@@ -28,6 +92,27 @@ function saveTheme(storage, theme) {
|
|
|
28
92
|
//
|
|
29
93
|
}
|
|
30
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Reads the theme from storage, attempting to resolve it to a valid application theme.
|
|
97
|
+
* If the theme cannot be found or is invalid, `null` is returned. This function also provides
|
|
98
|
+
* error handling for any storage access issues, ensuring the application can gracefully handle
|
|
99
|
+
* scenarios where storage is not available or accessible.
|
|
100
|
+
*
|
|
101
|
+
* @param {Storage | null} [storage] - The storage mechanism to use, typically `localStorage` or `sessionStorage`.
|
|
102
|
+
* @returns {Theme | null} - The resolved theme if found and valid; otherwise, `null`.
|
|
103
|
+
* @throws Will silently catch and ignore any exceptions caused by storage access, returning `null`.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* // Reading theme from localStorage
|
|
108
|
+
* const theme = readTheme(localStorage);
|
|
109
|
+
* if (theme) {
|
|
110
|
+
* applyTheme(theme); // Assuming applyTheme is a function to apply the theme
|
|
111
|
+
* } else {
|
|
112
|
+
* console.warn('No saved theme found or theme is invalid.');
|
|
113
|
+
* }
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
31
116
|
function readTheme(storage) {
|
|
32
117
|
try {
|
|
33
118
|
return resolveTheme(storage?.getItem(THEME_STORAGE_NAME)) ?? null;
|
|
@@ -38,24 +123,49 @@ function readTheme(storage) {
|
|
|
38
123
|
}
|
|
39
124
|
|
|
40
125
|
const THEME_ATTRIBUTE_NAME = 'odxTheme';
|
|
126
|
+
/**
|
|
127
|
+
* Manages theming for the application. It allows for dynamic theme selection, automatically saves theme preferences,
|
|
128
|
+
* and applies the user's preferred theme or the default theme based on configuration settings.
|
|
129
|
+
*
|
|
130
|
+
* The service leverages the BehaviorSubject pattern to reactively handle theme changes across the application,
|
|
131
|
+
* ensuring that subscribers are notified whenever the theme changes. It also interacts with the DOM directly
|
|
132
|
+
* to apply the current theme and with the provided storage mechanism to persist theme preferences.
|
|
133
|
+
*/
|
|
41
134
|
class ThemingService {
|
|
42
135
|
constructor() {
|
|
43
136
|
this.config = injectThemingConfig();
|
|
44
137
|
this.document = inject(DOCUMENT);
|
|
45
138
|
this.windowRef = inject(WindowRef);
|
|
46
139
|
this.theme$$ = new BehaviorSubject(this.getInitialTheme());
|
|
140
|
+
/**
|
|
141
|
+
* An observable stream of the current theme, emitting values whenever the theme changes.
|
|
142
|
+
* Subscribers to this observable can react to theme changes in real-time.
|
|
143
|
+
*/
|
|
47
144
|
this.theme$ = this.theme$$.pipe(distinctUntilChanged(), shareReplay({ bufferSize: 1, refCount: true }));
|
|
48
145
|
this.theme$.subscribe((theme) => {
|
|
49
146
|
this.document.body.setAttribute(THEME_ATTRIBUTE_NAME, theme);
|
|
50
147
|
saveTheme(this.config.storage, theme);
|
|
51
148
|
});
|
|
52
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Selects and applies a given theme by updating the BehaviorSubject and persisting the preference.
|
|
152
|
+
*
|
|
153
|
+
* @param {Theme} theme - The theme to apply.
|
|
154
|
+
*/
|
|
53
155
|
selectTheme(theme) {
|
|
54
156
|
this.theme$$.next(theme);
|
|
55
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Retrieves the currently selected theme.
|
|
160
|
+
*
|
|
161
|
+
* @returns {Theme} The currently selected theme.
|
|
162
|
+
*/
|
|
56
163
|
getSelectedTheme() {
|
|
57
164
|
return this.theme$$.getValue();
|
|
58
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Toggles between dark and light themes, depending on the current theme.
|
|
168
|
+
*/
|
|
59
169
|
toggleDarkMode() {
|
|
60
170
|
const currentTheme = this.getSelectedTheme();
|
|
61
171
|
if (currentTheme === Theme.DARK) {
|
|
@@ -65,9 +175,15 @@ class ThemingService {
|
|
|
65
175
|
this.enableDarkMode();
|
|
66
176
|
}
|
|
67
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* Enables the dark mode theme.
|
|
180
|
+
*/
|
|
68
181
|
enableDarkMode() {
|
|
69
182
|
this.selectTheme(Theme.DARK);
|
|
70
183
|
}
|
|
184
|
+
/**
|
|
185
|
+
* Enables the light mode theme.
|
|
186
|
+
*/
|
|
71
187
|
enableLightMode() {
|
|
72
188
|
this.selectTheme(Theme.LIGHT);
|
|
73
189
|
}
|
|
@@ -86,11 +202,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
86
202
|
args: [{ providedIn: 'root' }]
|
|
87
203
|
}], ctorParameters: function () { return []; } });
|
|
88
204
|
|
|
205
|
+
/**
|
|
206
|
+
* Utility created by `createConfigTokens` for managing theming configuration tokens and functions.
|
|
207
|
+
* Provides easy access to theming configuration, default values, and dependency injection utilities.
|
|
208
|
+
*/
|
|
89
209
|
const { ThemingConfig, injectThemingConfig, provideThemingConfig } = createConfigTokens('Theming', '@odx/angular/theme', {
|
|
90
210
|
autoDetect: false,
|
|
91
211
|
defaultTheme: Theme.LIGHT,
|
|
92
212
|
storage: null,
|
|
93
213
|
});
|
|
214
|
+
/**
|
|
215
|
+
* Provides the theming configuration to the application and initializes the `ThemingService`
|
|
216
|
+
* based on the provided configuration. This function simplifies the setup of a dynamic theming
|
|
217
|
+
* system, integrating with Angular's environment initializers to ensure proper initialization.
|
|
218
|
+
*
|
|
219
|
+
* @template D - The dependencies required by the theming configuration, if any.
|
|
220
|
+
* @param {ConfigProvider<Partial<ThemingConfig>, D>} config - The theming configuration or a configuration factory provider.
|
|
221
|
+
* @returns {EnvironmentProviders} An array of providers for setting up theming in the application.
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* ```ts
|
|
225
|
+
* // Providing a simple theming configuration
|
|
226
|
+
* provideTheming({
|
|
227
|
+
* autoDetect: true,
|
|
228
|
+
* defaultTheme: Theme.DARK,
|
|
229
|
+
* storage: localStorage,
|
|
230
|
+
* });
|
|
231
|
+
*
|
|
232
|
+
* // Providing a theming configuration with dependencies
|
|
233
|
+
* provideTheming({
|
|
234
|
+
* useFactory: (deps: Dependencies) => ({
|
|
235
|
+
* autoDetect: deps.setting,
|
|
236
|
+
* defaultTheme: Theme.DARK,
|
|
237
|
+
* storage: localStorage,
|
|
238
|
+
* }),
|
|
239
|
+
* deps: [SomeDependency],
|
|
240
|
+
* });
|
|
241
|
+
* ```
|
|
242
|
+
*/
|
|
94
243
|
function provideTheming(config) {
|
|
95
244
|
return makeEnvironmentProviders([
|
|
96
245
|
provideThemingConfig(config),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odx-angular-theming.mjs","sources":["../../../../libs/angular/theming/src/lib/helpers/prefers-dark-theme.ts","../../../../libs/angular/theming/src/lib/models/theme.ts","../../../../libs/angular/theming/src/lib/helpers/resolve-theme.ts","../../../../libs/angular/theming/src/lib/helpers/theme-storage.ts","../../../../libs/angular/theming/src/lib/theming.service.ts","../../../../libs/angular/theming/src/lib/theming.config.ts","../../../../libs/angular/theming/src/odx-angular-theming.ts"],"sourcesContent":["export function prefersDarkTheme(view: Window): boolean {\n return !!view.matchMedia?.('(prefers-color-scheme: dark)')?.matches;\n}\n","export type Theme = (typeof Theme)[keyof typeof Theme];\nexport const Theme = {\n DARK: 'dark',\n LIGHT: 'light',\n} as const;\n\nexport const availableThemes = Object.values(Theme);\n","import { availableThemes, Theme } from '../models';\n\nexport function resolveTheme(theme?: string | null): Theme | null {\n return availableThemes.find((t) => t === theme) ?? null;\n}\n","import { Theme } from '../models';\nimport { resolveTheme } from './resolve-theme';\n\nexport const THEME_STORAGE_NAME = '@odx/angular/theming:SelectedTheme';\n\nexport function saveTheme(storage: Storage | null | undefined, theme: Theme): void {\n try {\n storage?.setItem(THEME_STORAGE_NAME, theme);\n } catch {\n //\n }\n}\n\nexport function readTheme(storage?: Storage | null): Theme | null {\n try {\n return resolveTheme(storage?.getItem(THEME_STORAGE_NAME)) ?? null;\n } catch {\n return null;\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { inject, Injectable } from '@angular/core';\nimport { WindowRef } from '@odx/angular';\nimport { BehaviorSubject, distinctUntilChanged, shareReplay } from 'rxjs';\nimport { prefersDarkTheme, readTheme, saveTheme } from './helpers';\nimport { Theme } from './models';\nimport { injectThemingConfig } from './theming.config';\n\nexport const THEME_ATTRIBUTE_NAME = 'odxTheme';\n\n@Injectable({ providedIn: 'root' })\nexport class ThemingService {\n private readonly config = injectThemingConfig();\n private readonly document = inject(DOCUMENT);\n private readonly windowRef = inject(WindowRef);\n private readonly theme$$ = new BehaviorSubject<Theme>(this.getInitialTheme());\n\n public readonly theme$ = this.theme$$.pipe(distinctUntilChanged(), shareReplay({ bufferSize: 1, refCount: true }));\n\n constructor() {\n this.theme$.subscribe((theme) => {\n this.document.body.setAttribute(THEME_ATTRIBUTE_NAME, theme);\n saveTheme(this.config.storage, theme);\n });\n }\n\n public selectTheme(theme: Theme): void {\n this.theme$$.next(theme);\n }\n\n public getSelectedTheme(): Theme {\n return this.theme$$.getValue();\n }\n\n public toggleDarkMode(): void {\n const currentTheme = this.getSelectedTheme();\n if (currentTheme === Theme.DARK) {\n this.enableLightMode();\n } else {\n this.enableDarkMode();\n }\n }\n\n public enableDarkMode(): void {\n this.selectTheme(Theme.DARK);\n }\n\n public enableLightMode(): void {\n this.selectTheme(Theme.LIGHT);\n }\n\n private getInitialTheme(): Theme {\n let selectedTheme = readTheme(this.config.storage);\n\n if (!selectedTheme && this.config.autoDetect && prefersDarkTheme(this.windowRef.nativeWindow)) {\n selectedTheme = Theme.DARK;\n }\n\n return selectedTheme ?? this.config.defaultTheme;\n }\n}\n","import { EnvironmentProviders, ENVIRONMENT_INITIALIZER, inject, makeEnvironmentProviders } from '@angular/core';\nimport { ConfigDependencies, ConfigProvider, createConfigTokens } from '@odx/angular/utils';\nimport { Theme } from './models';\nimport { ThemingService } from './theming.service';\n\nexport interface ThemingConfig {\n autoDetect: boolean;\n defaultTheme: Theme;\n storage?: Storage | null;\n}\n\nexport const { ThemingConfig, injectThemingConfig, provideThemingConfig } = createConfigTokens('Theming', '@odx/angular/theme', {\n autoDetect: false,\n defaultTheme: Theme.LIGHT,\n storage: null,\n} as ThemingConfig);\n\nexport function provideTheming<D extends ConfigDependencies = ConfigDependencies<ThemingConfig>>(\n config: ConfigProvider<Partial<ThemingConfig>, D>\n): EnvironmentProviders {\n return makeEnvironmentProviders([\n provideThemingConfig(config),\n {\n provide: ENVIRONMENT_INITIALIZER,\n useFactory: () => () => inject(ThemingService),\n deps: [ThemingConfig],\n multi: true,\n },\n ]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAM,SAAU,gBAAgB,CAAC,IAAY,EAAA;IAC3C,OAAO,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,8BAA8B,CAAC,EAAE,OAAO,CAAC;AACtE;;ACDa,MAAA,KAAK,GAAG;AACnB,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,KAAK,EAAE,OAAO;EACL;AAEE,MAAA,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK;;ACJ5C,SAAU,YAAY,CAAC,KAAqB,EAAA;AAChD,IAAA,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,IAAI,IAAI,CAAC;AAC1D;;ACDO,MAAM,kBAAkB,GAAG,qCAAqC;AAEvD,SAAA,SAAS,CAAC,OAAmC,EAAE,KAAY,EAAA;IACzE,IAAI;AACF,QAAA,OAAO,EAAE,OAAO,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;AAC7C,KAAA;IAAC,MAAM;;AAEP,KAAA;AACH,CAAC;AAEK,SAAU,SAAS,CAAC,OAAwB,EAAA;IAChD,IAAI;QACF,OA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IACjB,YAAY,EAAE,KAAK,CAAC,KAAK;AACzB,IAAA,OAAO,EAAE,IAAI;AACG,CAAA,EAAE;AAEd,SAAU,cAAc,CAC5B,MAAiD,EAAA;AAEjD,IAAA,OAAO,wBAAwB,CAAC;QAC9B,oBAAoB,CAAC,MAAM,CAAC;AAC5B,QAAA;AACE,YAAA,OAAO,EAAE,uBAAuB;YAChC,UAAU,EAAE,MAAM,MAAM,MAAM,CAAC,cAAc,CAAC;YAC9C,IAAI,EAAE,CAAC,aAAa,CAAC;AACrB,YAAA,KAAK,EAAE,IAAI;AACZ,SAAA;AACF,KAAA,CAAC,CAAC;AACL;;AC7BA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"odx-angular-theming.mjs","sources":["../../../../libs/angular/theming/src/lib/helpers/prefers-dark-theme.ts","../../../../libs/angular/theming/src/lib/models/theme.ts","../../../../libs/angular/theming/src/lib/helpers/resolve-theme.ts","../../../../libs/angular/theming/src/lib/helpers/theme-storage.ts","../../../../libs/angular/theming/src/lib/theming.service.ts","../../../../libs/angular/theming/src/lib/theming.config.ts","../../../../libs/angular/theming/src/odx-angular-theming.ts"],"sourcesContent":["/**\n * Determines whether the user's system preferences indicate a preference for dark themes.\n * This is achieved by querying the '(prefers-color-scheme: dark)' media feature, which reflects\n * the user's preference for a light or dark color scheme in their operating system's UI.\n *\n * @param {Window} view - The window object, typically `window`, from which to access the matchMedia method.\n * @returns {boolean} `true` if the user prefers a dark theme, otherwise `false`.\n *\n * @example\n * Example usage in a web application to toggle themes:\n * ```ts\n * if (prefersDarkTheme(window)) {\n * document.body.classList.add('dark-theme');\n * } else {\n * document.body.classList.remove('dark-theme');\n * }\n * ```\n */\n\nexport function prefersDarkTheme(view: Window): boolean {\n return !!view.matchMedia?.('(prefers-color-scheme: dark)')?.matches;\n}\n","export type Theme = (typeof Theme)[keyof typeof Theme];\nexport const Theme = {\n DARK: 'dark',\n LIGHT: 'light',\n} as const;\n\nexport const availableThemes = Object.values(Theme);\n","import { availableThemes, Theme } from '../models';\n\n/**\n * Resolves the specified theme by checking if it exists in the predefined list of available themes.\n * This function ensures that only valid themes are used in the application, providing a safeguard\n * against invalid theme names and facilitating the dynamic application of themes.\n *\n * @param {string | null} [theme] - The name of the theme to resolve. It's optional and can be `null`.\n * @returns {Theme | null} - Returns the resolved `Theme` object if the theme is found within the list of `availableThemes`;\n * otherwise, returns `null` to indicate the theme is not recognized or available.\n *\n * @example\n * ```ts\n * // Assuming 'dark' and 'light' are in the availableThemes array\n * console.log(resolveTheme('dark')); // Outputs the 'dark' Theme object\n * console.log(resolveTheme('unknown')); // Outputs null\n *\n * // Using resolveTheme to apply a user-selected theme\n * const userSelectedTheme = getUserSelectedTheme(); // This function gets the user's theme choice\n * const themeToApply = resolveTheme(userSelectedTheme);\n * if (themeToApply) {\n * applyTheme(themeToApply); // This function applies the resolved theme to the application\n * } else {\n * console.warn('Selected theme is not available.');\n * }\n * ```\n */\nexport function resolveTheme(theme?: string | null): Theme | null {\n return availableThemes.find((t) => t === theme) ?? null;\n}\n","import { Theme } from '../models';\nimport { resolveTheme } from './resolve-theme';\n\n/**\n * The key used to store the selected theme in `Storage`.\n * This constant ensures consistent access to the theme setting across the application.\n */\nexport const THEME_STORAGE_NAME = '@odx/angular/theming:SelectedTheme';\n\n/**\n * Saves the specified theme to storage. This function abstracts the storage interaction,\n * providing a fail-safe mechanism to avoid exceptions if the storage is not available.\n *\n * @param {Storage | null | undefined} storage - The storage mechanism to use, typically `localStorage` or `sessionStorage`.\n * @param {Theme} theme - The theme to save. Should be a value that is recognized by the application's theming system.\n * @throws Will silently catch and ignore any exceptions caused by storage limitations or permissions.\n *\n * @example\n * ```ts\n * // Example usage with localStorage\n * saveTheme(localStorage, 'dark');\n *\n * // Using sessionStorage instead\n * saveTheme(sessionStorage, 'light');\n * ```\n */\nexport function saveTheme(storage: Storage | null | undefined, theme: Theme): void {\n try {\n storage?.setItem(THEME_STORAGE_NAME, theme);\n } catch {\n //\n }\n}\n\n/**\n * Reads the theme from storage, attempting to resolve it to a valid application theme.\n * If the theme cannot be found or is invalid, `null` is returned. This function also provides\n * error handling for any storage access issues, ensuring the application can gracefully handle\n * scenarios where storage is not available or accessible.\n *\n * @param {Storage | null} [storage] - The storage mechanism to use, typically `localStorage` or `sessionStorage`.\n * @returns {Theme | null} - The resolved theme if found and valid; otherwise, `null`.\n * @throws Will silently catch and ignore any exceptions caused by storage access, returning `null`.\n *\n * @example\n * ```ts\n * // Reading theme from localStorage\n * const theme = readTheme(localStorage);\n * if (theme) {\n * applyTheme(theme); // Assuming applyTheme is a function to apply the theme\n * } else {\n * console.warn('No saved theme found or theme is invalid.');\n * }\n * ```\n */\nexport function readTheme(storage?: Storage | null): Theme | null {\n try {\n return resolveTheme(storage?.getItem(THEME_STORAGE_NAME)) ?? null;\n } catch {\n return null;\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { inject, Injectable } from '@angular/core';\nimport { WindowRef } from '@odx/angular';\nimport { BehaviorSubject, distinctUntilChanged, shareReplay } from 'rxjs';\nimport { prefersDarkTheme, readTheme, saveTheme } from './helpers';\nimport { Theme } from './models';\nimport { injectThemingConfig } from './theming.config';\n\nexport const THEME_ATTRIBUTE_NAME = 'odxTheme';\n\n/**\n * Manages theming for the application. It allows for dynamic theme selection, automatically saves theme preferences,\n * and applies the user's preferred theme or the default theme based on configuration settings.\n *\n * The service leverages the BehaviorSubject pattern to reactively handle theme changes across the application,\n * ensuring that subscribers are notified whenever the theme changes. It also interacts with the DOM directly\n * to apply the current theme and with the provided storage mechanism to persist theme preferences.\n */\n@Injectable({ providedIn: 'root' })\nexport class ThemingService {\n private readonly config = injectThemingConfig();\n private readonly document = inject(DOCUMENT);\n private readonly windowRef = inject(WindowRef);\n private readonly theme$$ = new BehaviorSubject<Theme>(this.getInitialTheme());\n\n /**\n * An observable stream of the current theme, emitting values whenever the theme changes.\n * Subscribers to this observable can react to theme changes in real-time.\n */\n public readonly theme$ = this.theme$$.pipe(distinctUntilChanged(), shareReplay({ bufferSize: 1, refCount: true }));\n\n constructor() {\n this.theme$.subscribe((theme) => {\n this.document.body.setAttribute(THEME_ATTRIBUTE_NAME, theme);\n saveTheme(this.config.storage, theme);\n });\n }\n\n /**\n * Selects and applies a given theme by updating the BehaviorSubject and persisting the preference.\n *\n * @param {Theme} theme - The theme to apply.\n */\n public selectTheme(theme: Theme): void {\n this.theme$$.next(theme);\n }\n\n /**\n * Retrieves the currently selected theme.\n *\n * @returns {Theme} The currently selected theme.\n */\n public getSelectedTheme(): Theme {\n return this.theme$$.getValue();\n }\n\n /**\n * Toggles between dark and light themes, depending on the current theme.\n */\n public toggleDarkMode(): void {\n const currentTheme = this.getSelectedTheme();\n if (currentTheme === Theme.DARK) {\n this.enableLightMode();\n } else {\n this.enableDarkMode();\n }\n }\n\n /**\n * Enables the dark mode theme.\n */\n public enableDarkMode(): void {\n this.selectTheme(Theme.DARK);\n }\n\n /**\n * Enables the light mode theme.\n */\n public enableLightMode(): void {\n this.selectTheme(Theme.LIGHT);\n }\n\n private getInitialTheme(): Theme {\n let selectedTheme = readTheme(this.config.storage);\n\n if (!selectedTheme && this.config.autoDetect && prefersDarkTheme(this.windowRef.nativeWindow)) {\n selectedTheme = Theme.DARK;\n }\n\n return selectedTheme ?? this.config.defaultTheme;\n }\n}\n","import { ENVIRONMENT_INITIALIZER, EnvironmentProviders, inject, makeEnvironmentProviders } from '@angular/core';\nimport { ConfigDependencies, ConfigProvider, createConfigTokens } from '@odx/angular/utils';\nimport { Theme } from './models';\nimport { ThemingService } from './theming.service';\n\n/**\n * Defines the structure for theming configuration options in the application.\n */\nexport interface ThemingConfig {\n /**\n * Determines whether the theme should be auto-detected based on system preferences.\n */\n autoDetect: boolean;\n\n /**\n * Specifies the default theme to be used if auto-detection is not enabled or fails.\n */\n defaultTheme: Theme;\n\n /**\n * The storage mechanism (like `localStorage` or `sessionStorage`) to persist theme settings,\n * or `null` to disable persistence.\n */\n storage?: Storage | null;\n}\n\n/**\n * Utility created by `createConfigTokens` for managing theming configuration tokens and functions.\n * Provides easy access to theming configuration, default values, and dependency injection utilities.\n */\nexport const { ThemingConfig, injectThemingConfig, provideThemingConfig } = createConfigTokens('Theming', '@odx/angular/theme', {\n autoDetect: false,\n defaultTheme: Theme.LIGHT,\n storage: null,\n} as ThemingConfig);\n\n/**\n * Provides the theming configuration to the application and initializes the `ThemingService`\n * based on the provided configuration. This function simplifies the setup of a dynamic theming\n * system, integrating with Angular's environment initializers to ensure proper initialization.\n *\n * @template D - The dependencies required by the theming configuration, if any.\n * @param {ConfigProvider<Partial<ThemingConfig>, D>} config - The theming configuration or a configuration factory provider.\n * @returns {EnvironmentProviders} An array of providers for setting up theming in the application.\n *\n * @example\n * ```ts\n * // Providing a simple theming configuration\n * provideTheming({\n * autoDetect: true,\n * defaultTheme: Theme.DARK,\n * storage: localStorage,\n * });\n *\n * // Providing a theming configuration with dependencies\n * provideTheming({\n * useFactory: (deps: Dependencies) => ({\n * autoDetect: deps.setting,\n * defaultTheme: Theme.DARK,\n * storage: localStorage,\n * }),\n * deps: [SomeDependency],\n * });\n * ```\n */\nexport function provideTheming<D extends ConfigDependencies = ConfigDependencies<ThemingConfig>>(\n config: ConfigProvider<Partial<ThemingConfig>, D>,\n): EnvironmentProviders {\n return makeEnvironmentProviders([\n provideThemingConfig(config),\n {\n provide: ENVIRONMENT_INITIALIZER,\n useFactory: () => () => inject(ThemingService),\n deps: [ThemingConfig],\n multi: true,\n },\n ]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;;;AAiBG;AAEG,SAAU,gBAAgB,CAAC,IAAY,EAAA;IAC3C,OAAO,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,8BAA8B,CAAC,EAAE,OAAO,CAAC;AACtE;;ACpBa,MAAA,KAAK,GAAG;AACnB,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,KAAK,EAAE,OAAO;EACL;AAEE,MAA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