@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
|
@@ -4,6 +4,25 @@ import { inject, Injectable, TemplateRef, ViewContainerRef, Directive, Input, Ng
|
|
|
4
4
|
import { of, map, distinctUntilChanged, shareReplay, BehaviorSubject, switchMap, tap } from 'rxjs';
|
|
5
5
|
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Generates a configuration object containing CSS media query strings for a named breakpoint.
|
|
9
|
+
* The function creates media queries for three scenarios: below (`<`), exactly (`=`), and above (`>`) the specified breakpoint.
|
|
10
|
+
*
|
|
11
|
+
* @template T - The string literal type representing the name of the breakpoint.
|
|
12
|
+
* @param {T} name - The name of the breakpoint (e.g., 'md' for medium).
|
|
13
|
+
* @param {number} min - The minimum width (inclusive) where the breakpoint starts.
|
|
14
|
+
* @param {number} max - The maximum width (exclusive) where the breakpoint ends.
|
|
15
|
+
* @returns {BreakpointConfig<T>} An object containing media query strings for targeting screen sizes relative to the breakpoint.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* // Define a medium (md) breakpoint
|
|
20
|
+
* const mdBreakpoint = configureBreakpoint('md', 768, 1024);
|
|
21
|
+
* console.log(mdBreakpoint['<md']); // Outputs: "(max-width: 767px)"
|
|
22
|
+
* console.log(mdBreakpoint['=md']); // Outputs: "(min-width: 768px) and (max-width: 1023px)"
|
|
23
|
+
* console.log(mdBreakpoint['>md']); // Outputs: "(min-width: 768px)"
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
7
26
|
function configureBreakpoint(name, min, max) {
|
|
8
27
|
return {
|
|
9
28
|
[`<${name}`]: `(max-width: ${min - 1}px)`,
|
|
@@ -12,6 +31,21 @@ function configureBreakpoint(name, min, max) {
|
|
|
12
31
|
};
|
|
13
32
|
}
|
|
14
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Defines default responsive breakpoints for the application. These breakpoints are used to
|
|
36
|
+
* apply responsive styles and behaviors across various device sizes. Each breakpoint is
|
|
37
|
+
* configured with a name, a minimum width, and a maximum width, defining the range of device
|
|
38
|
+
* sizes it targets.
|
|
39
|
+
*
|
|
40
|
+
* @constant
|
|
41
|
+
* @type {Record<string, string>}
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* // Accessing a breakpoint value
|
|
46
|
+
* console.log(DEFAULT_BREAKPOINTS['=phone']); // Outputs: "(min-width: 480px) and (max-width: 767px)"
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
15
49
|
const DEFAULT_BREAKPOINTS = {
|
|
16
50
|
...configureBreakpoint('phone-s', 360, 480),
|
|
17
51
|
...configureBreakpoint('phone', 480, 768),
|
|
@@ -19,19 +53,85 @@ const DEFAULT_BREAKPOINTS = {
|
|
|
19
53
|
...configureBreakpoint('desktop-s', 960, 1200),
|
|
20
54
|
...configureBreakpoint('desktop', 1200, 9999),
|
|
21
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* Provides Angular dependency injection tokens for accessing and configuring breakpoints
|
|
58
|
+
* within the application. This enables a type-safe and modular way to manage responsive
|
|
59
|
+
* design breakpoints across the app.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* // Providing custom breakpoints in an Angular module
|
|
64
|
+
* import { NgModule } from '@angular/core';
|
|
65
|
+
* import { provideBreakpointsConfig } from '@odx/angular/breakpoints';
|
|
66
|
+
*
|
|
67
|
+
* @NgModule({
|
|
68
|
+
* providers: [
|
|
69
|
+
* provideBreakpointsConfig({
|
|
70
|
+
* breakpoints: {
|
|
71
|
+
* ...configureBreakpoint('custom-tablet', 640, 1024),
|
|
72
|
+
* },
|
|
73
|
+
* }),
|
|
74
|
+
* ],
|
|
75
|
+
* })
|
|
76
|
+
* export class CustomModule {}
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
22
79
|
const { BreakpointsConfig, BreakpointsDefaultConfig, injectBreakpointsConfig, provideBreakpointsConfig } = createConfigTokens('Breakpoints', '@odx/angular/breakpoints', {
|
|
23
80
|
breakpoints: DEFAULT_BREAKPOINTS,
|
|
24
81
|
});
|
|
25
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Service to observe and react to changes in viewport size based on predefined breakpoints.
|
|
85
|
+
* Utilizes Angular CDK's BreakpointObserver for listening to media query changes and integrates
|
|
86
|
+
* it with the application's custom breakpoints configuration.
|
|
87
|
+
*
|
|
88
|
+
* @Injectable({ providedIn: 'root' })
|
|
89
|
+
*/
|
|
26
90
|
class BreakpointsService {
|
|
27
91
|
constructor() {
|
|
28
92
|
this.breakpointObserver = inject(BreakpointObserver);
|
|
29
93
|
this.config = injectBreakpointsConfig();
|
|
30
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Observes the specified breakpoints and returns an Observable that emits true if any
|
|
97
|
+
* of the specified breakpoints match the current viewport size, and false otherwise.
|
|
98
|
+
*
|
|
99
|
+
* @param {BreakpointName[]} breakpoints - An array of breakpoints to observe.
|
|
100
|
+
* @returns {Observable<boolean>} - An Observable that emits true if the viewport matches the specified breakpoints.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* // Component that uses BreakpointsService to apply dynamic styles based on breakpoints
|
|
105
|
+
* @Component({
|
|
106
|
+
* selector: 'app-responsive-component',
|
|
107
|
+
* templateUrl: './responsive-component.component.html',
|
|
108
|
+
* })
|
|
109
|
+
* export class ResponsiveComponent {
|
|
110
|
+
* isMobile$: Observable<boolean>;
|
|
111
|
+
*
|
|
112
|
+
* constructor(private breakpointsService: BreakpointsService) {
|
|
113
|
+
* this.isMobile$ = this.breakpointsService.observe(['phone', 'tablet']);
|
|
114
|
+
* }
|
|
115
|
+
* }
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
31
118
|
observe(breakpoints) {
|
|
32
119
|
const mediaQueries = this.getMediaQueries(breakpoints);
|
|
33
120
|
return this.createBreakpointObserver(mediaQueries);
|
|
34
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Checks if any of the specified breakpoints match the current viewport size.
|
|
124
|
+
*
|
|
125
|
+
* @param {BreakpointName[]} breakpoints - An array of breakpoints to check.
|
|
126
|
+
* @returns {boolean} - Returns true if the viewport matches the specified breakpoints, false otherwise.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```ts
|
|
130
|
+
* // Checking if the current viewport matches the 'desktop' breakpoint
|
|
131
|
+
* const isDesktop = this.breakpointsService.matches(['desktop']);
|
|
132
|
+
* console.log(`Is desktop view? ${isDesktop}`);
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
35
135
|
matches(breakpoints) {
|
|
36
136
|
const mediaQueries = this.getMediaQueries(breakpoints);
|
|
37
137
|
return this.breakpointObserver.isMatched(mediaQueries);
|
|
@@ -52,6 +152,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
52
152
|
args: [{ providedIn: 'root' }]
|
|
53
153
|
}] });
|
|
54
154
|
|
|
155
|
+
/**
|
|
156
|
+
* A structural directive that conditionally includes an Angular template based on whether the viewport matches
|
|
157
|
+
* specified breakpoints. It leverages the BreakpointsService to observe changes in viewport size and apply
|
|
158
|
+
* the appropriate template.
|
|
159
|
+
*
|
|
160
|
+
* @Directive
|
|
161
|
+
* @param {BreakpointsService} breakpointsService - Injects BreakpointsService to observe breakpoint changes.
|
|
162
|
+
* @param {TemplateRef} template - Injects the Angular template to render when breakpoints match.
|
|
163
|
+
* @param {ViewContainerRef} viewContainer - Injects the container where the template will be rendered.
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```html
|
|
167
|
+
* // Usage in a component template to conditionally display content based on breakpoints
|
|
168
|
+
* // Assume 'mobile' and 'tablet' are defined breakpoints
|
|
169
|
+
* <ng-template [odxMatchBreakpoints]="['mobile', 'tablet']">
|
|
170
|
+
* Content to display on mobile and tablet sizes.
|
|
171
|
+
* </ng-template>
|
|
172
|
+
* <ng-template [odxMatchBreakpoints]="['desktop']" [odxMatchBreakpointsElse]="elseTemplate">
|
|
173
|
+
* Content to display on desktop size.
|
|
174
|
+
* </ng-template>
|
|
175
|
+
* <ng-template #elseTemplate>
|
|
176
|
+
* Content to display when not on desktop size.
|
|
177
|
+
* </ng-template>
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
55
180
|
class MatchBreakpointsDirective {
|
|
56
181
|
constructor() {
|
|
57
182
|
this.breakpoints$$ = new BehaviorSubject([]);
|
|
@@ -59,9 +184,20 @@ class MatchBreakpointsDirective {
|
|
|
59
184
|
this.takeUntilDestroyed = untilDestroyed();
|
|
60
185
|
this.template = inject(TemplateRef);
|
|
61
186
|
this.viewContainer = inject(ViewContainerRef);
|
|
187
|
+
/**
|
|
188
|
+
* Optionally specifies a template to render when the viewport does not match the specified breakpoints.
|
|
189
|
+
*
|
|
190
|
+
* @param {TemplateRef<unknown>} elseTemplate - The template to render when the viewport does not match the breakpoints.
|
|
191
|
+
*/
|
|
62
192
|
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
63
193
|
this.elseTemplate = null;
|
|
64
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Sets the breakpoints to observe. The directive's content is displayed if the current viewport matches
|
|
197
|
+
* any of the specified breakpoints.
|
|
198
|
+
*
|
|
199
|
+
* @param {BreakpointName | BreakpointName[]} value - The breakpoint(s) to match against the current viewport size.
|
|
200
|
+
*/
|
|
65
201
|
set breakpoints(value) {
|
|
66
202
|
this.breakpoints$$.next(coerceArray(value ?? []));
|
|
67
203
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odx-angular-breakpoints.mjs","sources":["../../../../libs/angular/breakpoints/src/lib/helpers/configure-breakpoint.ts","../../../../libs/angular/breakpoints/src/lib/breakpoints.config.ts","../../../../libs/angular/breakpoints/src/lib/breakpoints.service.ts","../../../../libs/angular/breakpoints/src/lib/directives/match-breakpoints.directive.ts","../../../../libs/angular/breakpoints/src/lib/breakpoints.module.ts","../../../../libs/angular/breakpoints/src/odx-angular-breakpoints.ts"],"sourcesContent":["type BreakpointOperators = '<' | '=' | '>';\ntype BreakpointConfig<T extends string> = Record<`${BreakpointOperators}${T}`, string>;\n\nexport function configureBreakpoint<T extends string>(name: T, min: number, max: number): BreakpointConfig<T> {\n return {\n [`<${name}` as const]: `(max-width: ${min - 1}px)`,\n [`=${name}` as const]: `(min-width: ${min}px) and (max-width: ${max - 1}px)`,\n [`>${name}` as const]: `(min-width: ${min}px)`,\n } as BreakpointConfig<T>;\n}\n","import { createConfigTokens } from '@odx/angular/utils';\nimport { configureBreakpoint } from './helpers/configure-breakpoint';\n\nexport const DEFAULT_BREAKPOINTS = {\n ...configureBreakpoint('phone-s', 360, 480),\n ...configureBreakpoint('phone', 480, 768),\n ...configureBreakpoint('tablet', 768, 960),\n ...configureBreakpoint('desktop-s', 960, 1200),\n ...configureBreakpoint('desktop', 1200, 9999),\n} as const;\n\nexport interface BreakpointsConfig {\n breakpoints: Partial<OdxAngular.Breakpoints>;\n}\n\nexport const { BreakpointsConfig, BreakpointsDefaultConfig, injectBreakpointsConfig, provideBreakpointsConfig } = createConfigTokens(\n 'Breakpoints',\n '@odx/angular/breakpoints',\n {\n breakpoints: DEFAULT_BREAKPOINTS,\n } as BreakpointsConfig\n);\n","import { BreakpointObserver } from '@angular/cdk/layout';\nimport { inject, Injectable } from '@angular/core';\nimport { distinctUntilChanged, map, Observable, of, shareReplay } from 'rxjs';\nimport { injectBreakpointsConfig } from './breakpoints.config';\nimport { BreakpointName } from './models';\n\n@Injectable({ providedIn: 'root' })\nexport class BreakpointsService {\n private readonly breakpointObserver = inject(BreakpointObserver);\n private readonly config = injectBreakpointsConfig();\n\n public observe(breakpoints: BreakpointName[]): Observable<boolean> {\n const mediaQueries = this.getMediaQueries(breakpoints);\n\n return this.createBreakpointObserver(mediaQueries);\n }\n\n public matches(breakpoints: BreakpointName[]): boolean {\n const mediaQueries = this.getMediaQueries(breakpoints);\n\n return this.breakpointObserver.isMatched(mediaQueries);\n }\n\n private getMediaQueries(breakpointNames: BreakpointName[]): string[] {\n return breakpointNames.map((name) => this.config.breakpoints[name] as string).filter(Boolean);\n }\n\n private createBreakpointObserver(mediaQueries: string[]): Observable<boolean> {\n if (mediaQueries.length < 1) return of(false);\n\n return this.breakpointObserver.observe(mediaQueries).pipe(\n map(({ matches }) => matches),\n distinctUntilChanged(),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n }\n}\n","import { Directive, inject, Input, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { coerceArray, untilDestroyed } from '@odx/angular/utils';\nimport { BehaviorSubject, switchMap, tap } from 'rxjs';\nimport { BreakpointsService } from '../breakpoints.service';\nimport { BreakpointName } from '../models';\n\n@Directive({\n standalone: true,\n selector: 'ng-template[odxMatchBreakpoints]',\n})\nexport class MatchBreakpointsDirective implements OnInit {\n private readonly breakpoints$$ = new BehaviorSubject<BreakpointName[]>([]);\n private readonly breakpointsService = inject(BreakpointsService);\n private readonly takeUntilDestroyed = untilDestroyed();\n private readonly template = inject(TemplateRef);\n private readonly viewContainer = inject(ViewContainerRef);\n\n @Input('odxMatchBreakpoints')\n public set breakpoints(value: BreakpointName | BreakpointName[] | null | undefined) {\n this.breakpoints$$.next(coerceArray(value ?? []));\n }\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxMatchBreakpointsElse')\n public elseTemplate?: TemplateRef<unknown> | null = null;\n\n public ngOnInit(): void {\n this.breakpoints$$\n .pipe(\n switchMap((breakpoints) => this.breakpointsService.observe(breakpoints)),\n tap((matchesBreakpoints) => this.render(matchesBreakpoints)),\n this.takeUntilDestroyed(),\n )\n .subscribe();\n }\n\n private render(matchesBreakpoints: boolean): void {\n this.viewContainer.clear();\n const template = matchesBreakpoints ? this.template : this.elseTemplate;\n if (template) {\n const viewRef = this.viewContainer.createEmbeddedView(template);\n viewRef.markForCheck();\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { MatchBreakpointsDirective } from './directives';\n\nconst modules = [MatchBreakpointsDirective];\n\n@NgModule({\n imports: modules,\n exports: modules,\n})\nexport class BreakpointsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;SAGgB,mBAAmB,CAAmB,IAAO,EAAE,GAAW,EAAE,GAAW,EAAA;IACrF,OAAO;QACL,CAAC,CAAA,CAAA,EAAI,IAAI,CAAW,CAAA,GAAG,CAAe,YAAA,EAAA,GAAG,GAAG,CAAC,CAAK,GAAA,CAAA;QAClD,CAAC,CAAA,CAAA,EAAI,IAAI,CAAA,CAAW,GAAG,CAAe,YA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CAAA,EAAA,MAAA,EAAA,EAAA,WAAA,EAAA,CAAA,qBAAA,EAAA,aAAA,CAAA,EAAA,YAAA,EAAA,CAAA,yBAAA,EAAA,cAAA,CAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;4FAAzB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAJrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,kCAAkC;AAC7C,iBAAA,CAAA;8BASY,WAAW,EAAA,CAAA;sBADrB,KAAK;uBAAC,qBAAqB,CAAA;gBAOrB,YAAY,EAAA,CAAA;sBADlB,KAAK;uBAAC,yBAAyB,CAAA;;;ACpBlC,MAAM,OAAO,GAAG,CAAC,yBAAyB,CAAC,CAAC;MAM/B,iBAAiB,CAAA;+GAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;gHAAjB,iBAAiB,EAAA,OAAA,EAAA,CANb,yBAAyB,CAAA,EAAA,OAAA,EAAA,CAAzB,yBAAyB,CAAA,EAAA,CAAA,CAAA,EAAA;gHAM7B,iBAAiB,EAAA,CAAA,CAAA,EAAA;;4FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,OAAO;AAChB,oBAAA,OAAO,EAAE,OAAO;AACjB,iBAAA,CAAA;;;ACRD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"odx-angular-breakpoints.mjs","sources":["../../../../libs/angular/breakpoints/src/lib/helpers/configure-breakpoint.ts","../../../../libs/angular/breakpoints/src/lib/breakpoints.config.ts","../../../../libs/angular/breakpoints/src/lib/breakpoints.service.ts","../../../../libs/angular/breakpoints/src/lib/directives/match-breakpoints.directive.ts","../../../../libs/angular/breakpoints/src/lib/breakpoints.module.ts","../../../../libs/angular/breakpoints/src/odx-angular-breakpoints.ts"],"sourcesContent":["type BreakpointOperators = '<' | '=' | '>';\ntype BreakpointConfig<T extends string> = Record<`${BreakpointOperators}${T}`, string>;\n\n/**\n * Generates a configuration object containing CSS media query strings for a named breakpoint.\n * The function creates media queries for three scenarios: below (`<`), exactly (`=`), and above (`>`) the specified breakpoint.\n *\n * @template T - The string literal type representing the name of the breakpoint.\n * @param {T} name - The name of the breakpoint (e.g., 'md' for medium).\n * @param {number} min - The minimum width (inclusive) where the breakpoint starts.\n * @param {number} max - The maximum width (exclusive) where the breakpoint ends.\n * @returns {BreakpointConfig<T>} An object containing media query strings for targeting screen sizes relative to the breakpoint.\n *\n * @example\n * ```ts\n * // Define a medium (md) breakpoint\n * const mdBreakpoint = configureBreakpoint('md', 768, 1024);\n * console.log(mdBreakpoint['<md']); // Outputs: \"(max-width: 767px)\"\n * console.log(mdBreakpoint['=md']); // Outputs: \"(min-width: 768px) and (max-width: 1023px)\"\n * console.log(mdBreakpoint['>md']); // Outputs: \"(min-width: 768px)\"\n * ```\n */\nexport function configureBreakpoint<T extends string>(name: T, min: number, max: number): BreakpointConfig<T> {\n return {\n [`<${name}` as const]: `(max-width: ${min - 1}px)`,\n [`=${name}` as const]: `(min-width: ${min}px) and (max-width: ${max - 1}px)`,\n [`>${name}` as const]: `(min-width: ${min}px)`,\n } as BreakpointConfig<T>;\n}\n","import { createConfigTokens } from '@odx/angular/utils';\nimport { configureBreakpoint } from './helpers/configure-breakpoint';\n\n/**\n * Defines default responsive breakpoints for the application. These breakpoints are used to\n * apply responsive styles and behaviors across various device sizes. Each breakpoint is\n * configured with a name, a minimum width, and a maximum width, defining the range of device\n * sizes it targets.\n *\n * @constant\n * @type {Record<string, string>}\n *\n * @example\n * ```ts\n * // Accessing a breakpoint value\n * console.log(DEFAULT_BREAKPOINTS['=phone']); // Outputs: \"(min-width: 480px) and (max-width: 767px)\"\n * ```\n */\nexport const DEFAULT_BREAKPOINTS = {\n ...configureBreakpoint('phone-s', 360, 480),\n ...configureBreakpoint('phone', 480, 768),\n ...configureBreakpoint('tablet', 768, 960),\n ...configureBreakpoint('desktop-s', 960, 1200),\n ...configureBreakpoint('desktop', 1200, 9999),\n} as const;\n\nexport interface BreakpointsConfig {\n breakpoints: Partial<OdxAngular.Breakpoints>;\n}\n\n/**\n * Provides Angular dependency injection tokens for accessing and configuring breakpoints\n * within the application. This enables a type-safe and modular way to manage responsive\n * design breakpoints across the app.\n *\n * @example\n * ```ts\n * // Providing custom breakpoints in an Angular module\n * import { NgModule } from '@angular/core';\n * import { provideBreakpointsConfig } from '@odx/angular/breakpoints';\n *\n * @NgModule({\n * providers: [\n * provideBreakpointsConfig({\n * breakpoints: {\n * ...configureBreakpoint('custom-tablet', 640, 1024),\n * },\n * }),\n * ],\n * })\n * export class CustomModule {}\n * ```\n */\nexport const { BreakpointsConfig, BreakpointsDefaultConfig, injectBreakpointsConfig, provideBreakpointsConfig } = createConfigTokens(\n 'Breakpoints',\n '@odx/angular/breakpoints',\n {\n breakpoints: DEFAULT_BREAKPOINTS,\n } as BreakpointsConfig,\n);\n","import { BreakpointObserver } from '@angular/cdk/layout';\nimport { inject, Injectable } from '@angular/core';\nimport { distinctUntilChanged, map, Observable, of, shareReplay } from 'rxjs';\nimport { injectBreakpointsConfig } from './breakpoints.config';\nimport { BreakpointName } from './models';\n\n/**\n * Service to observe and react to changes in viewport size based on predefined breakpoints.\n * Utilizes Angular CDK's BreakpointObserver for listening to media query changes and integrates\n * it with the application's custom breakpoints configuration.\n *\n * @Injectable({ providedIn: 'root' })\n */\n@Injectable({ providedIn: 'root' })\nexport class BreakpointsService {\n private readonly breakpointObserver = inject(BreakpointObserver);\n private readonly config = injectBreakpointsConfig();\n\n /**\n * Observes the specified breakpoints and returns an Observable that emits true if any\n * of the specified breakpoints match the current viewport size, and false otherwise.\n *\n * @param {BreakpointName[]} breakpoints - An array of breakpoints to observe.\n * @returns {Observable<boolean>} - An Observable that emits true if the viewport matches the specified breakpoints.\n *\n * @example\n * ```ts\n * // Component that uses BreakpointsService to apply dynamic styles based on breakpoints\n * @Component({\n * selector: 'app-responsive-component',\n * templateUrl: './responsive-component.component.html',\n * })\n * export class ResponsiveComponent {\n * isMobile$: Observable<boolean>;\n *\n * constructor(private breakpointsService: BreakpointsService) {\n * this.isMobile$ = this.breakpointsService.observe(['phone', 'tablet']);\n * }\n * }\n * ```\n */\n public observe(breakpoints: BreakpointName[]): Observable<boolean> {\n const mediaQueries = this.getMediaQueries(breakpoints);\n\n return this.createBreakpointObserver(mediaQueries);\n }\n\n /**\n * Checks if any of the specified breakpoints match the current viewport size.\n *\n * @param {BreakpointName[]} breakpoints - An array of breakpoints to check.\n * @returns {boolean} - Returns true if the viewport matches the specified breakpoints, false otherwise.\n *\n * @example\n * ```ts\n * // Checking if the current viewport matches the 'desktop' breakpoint\n * const isDesktop = this.breakpointsService.matches(['desktop']);\n * console.log(`Is desktop view? ${isDesktop}`);\n * ```\n */\n public matches(breakpoints: BreakpointName[]): boolean {\n const mediaQueries = this.getMediaQueries(breakpoints);\n\n return this.breakpointObserver.isMatched(mediaQueries);\n }\n\n private getMediaQueries(breakpointNames: BreakpointName[]): string[] {\n return breakpointNames.map((name) => this.config.breakpoints[name] as string).filter(Boolean);\n }\n\n private createBreakpointObserver(mediaQueries: string[]): Observable<boolean> {\n if (mediaQueries.length < 1) return of(false);\n\n return this.breakpointObserver.observe(mediaQueries).pipe(\n map(({ matches }) => matches),\n distinctUntilChanged(),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n }\n}\n","import { Directive, inject, Input, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { coerceArray, untilDestroyed } from '@odx/angular/utils';\nimport { BehaviorSubject, switchMap, tap } from 'rxjs';\nimport { BreakpointsService } from '../breakpoints.service';\nimport { BreakpointName } from '../models';\n\n/**\n * A structural directive that conditionally includes an Angular template based on whether the viewport matches\n * specified breakpoints. It leverages the BreakpointsService to observe changes in viewport size and apply\n * the appropriate template.\n *\n * @Directive\n * @param {BreakpointsService} breakpointsService - Injects BreakpointsService to observe breakpoint changes.\n * @param {TemplateRef} template - Injects the Angular template to render when breakpoints match.\n * @param {ViewContainerRef} viewContainer - Injects the container where the template will be rendered.\n *\n * @example\n * ```html\n * // Usage in a component template to conditionally display content based on breakpoints\n * // Assume 'mobile' and 'tablet' are defined breakpoints\n * <ng-template [odxMatchBreakpoints]=\"['mobile', 'tablet']\">\n * Content to display on mobile and tablet sizes.\n * </ng-template>\n * <ng-template [odxMatchBreakpoints]=\"['desktop']\" [odxMatchBreakpointsElse]=\"elseTemplate\">\n * Content to display on desktop size.\n * </ng-template>\n * <ng-template #elseTemplate>\n * Content to display when not on desktop size.\n * </ng-template>\n * ```\n */\n@Directive({\n standalone: true,\n selector: 'ng-template[odxMatchBreakpoints]',\n})\nexport class MatchBreakpointsDirective implements OnInit {\n private readonly breakpoints$$ = new BehaviorSubject<BreakpointName[]>([]);\n private readonly breakpointsService = inject(BreakpointsService);\n private readonly takeUntilDestroyed = untilDestroyed();\n private readonly template = inject(TemplateRef);\n private readonly viewContainer = inject(ViewContainerRef);\n\n /**\n * Sets the breakpoints to observe. The directive's content is displayed if the current viewport matches\n * any of the specified breakpoints.\n *\n * @param {BreakpointName | BreakpointName[]} value - The breakpoint(s) to match against the current viewport size.\n */\n @Input('odxMatchBreakpoints')\n public set breakpoints(value: BreakpointName | BreakpointName[] | null | undefined) {\n this.breakpoints$$.next(coerceArray(value ?? []));\n }\n\n /**\n * Optionally specifies a template to render when the viewport does not match the specified breakpoints.\n *\n * @param {TemplateRef<unknown>} elseTemplate - The template to render when the viewport does not match the breakpoints.\n */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxMatchBreakpointsElse')\n public elseTemplate?: TemplateRef<unknown> | null = null;\n\n public ngOnInit(): void {\n this.breakpoints$$\n .pipe(\n switchMap((breakpoints) => this.breakpointsService.observe(breakpoints)),\n tap((matchesBreakpoints) => this.render(matchesBreakpoints)),\n this.takeUntilDestroyed(),\n )\n .subscribe();\n }\n\n private render(matchesBreakpoints: boolean): void {\n this.viewContainer.clear();\n const template = matchesBreakpoints ? this.template : this.elseTemplate;\n if (template) {\n const viewRef = this.viewContainer.createEmbeddedView(template);\n viewRef.markForCheck();\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { MatchBreakpointsDirective } from './directives';\n\nconst modules = [MatchBreakpointsDirective];\n\n@NgModule({\n imports: modules,\n exports: modules,\n})\nexport class BreakpointsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAGA;;;;;;;;;;;;;;;;;;AAkBG;SACa,mBAAmB,CAAmB,IAAO,EAAE,GAAW,EAAE,GAAW,EAAA;IACrF,OAAO;QACL,CAAC,CAAA,CAAA,EAAI,IAAI,CAAW,CAAA,GAAG,CAAe,YAAA,EAAA,GAAG,GAAG,CAAC,CAAK,GAAA,CAAA;QAClD,CAAC,CAAA,CAAA,EAAI,IAAI,CAAA,CAAW,GAAG,CAAe,YAAA,EAAA,GAAG,CAAuB,oBAAA,EAAA,GAAG,GAAG,CAAC,CAAK,GAAA,CAAA;AAC5E,QAAA,CAAC,IAAI,IAAI,CAAA,CAAW,GAAG,CAAA,YAAA,EAAe,GAAG,CAAK,GAAA,CAAA;KACxB,CAAC;AAC3B;;ACzBA;;;;;;;;;;;;;;AAcG;AACU,MAAA,mBAAmB,GAAG;AACjC,IAAA,GAAG,mBAAmB,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC;AAC3C,IAAA,GAAG,mBAAmB,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC;AACzC,IAAA,GAAG,mBAAmB,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,CAAC;AAC1C,IAAA,GAAG,mBAAmB,CAAC,WAAW,EAAE,GAAG,EAAE,IAAI,CAAC;AAC9C,IAAA,GAAG,mBAAmB,CAAC,SA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C,iBAAA,CAAA;8BAeY,WAAW,EAAA,CAAA;sBADrB,KAAK;uBAAC,qBAAqB,CAAA;gBAYrB,YAAY,EAAA,CAAA;sBADlB,KAAK;uBAAC,yBAAyB,CAAA;;;ACxDlC,MAAM,OAAO,GAAG,CAAC,yBAAyB,CAAC,CAAC;MAM/B,iBAAiB,CAAA;+GAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;gHAAjB,iBAAiB,EAAA,OAAA,EAAA,CANb,yBAAyB,CAAA,EAAA,OAAA,EAAA,CAAzB,yBAAyB,CAAA,EAAA,CAAA,CAAA,EAAA;gHAM7B,iBAAiB,EAAA,CAAA,CAAA,EAAA;;4FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,OAAO;AAChB,oBAAA,OAAO,EAAE,OAAO;AACjB,iBAAA,CAAA;;;ACRD;;AAEG;;;;"}
|
|
@@ -7,10 +7,42 @@ import { __decorate } from 'tslib';
|
|
|
7
7
|
import { CSSComponent } from '@odx/angular/internal';
|
|
8
8
|
import { injectElement, deferFn } from '@odx/angular/utils';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Directive that makes an element interactive, responding to click, Enter key, and Space key events.
|
|
12
|
+
* It automatically handles the disabled state through `DisabledController`, inhibiting interactions when disabled.
|
|
13
|
+
* This directive can be useful for creating custom buttons or interactive elements that are not natively interactive,
|
|
14
|
+
* such as divs or custom components.
|
|
15
|
+
*
|
|
16
|
+
* @Directive
|
|
17
|
+
* @CSSComponent cdk-interactive - A CSS Component class that can be targeted for styling interactive elements.
|
|
18
|
+
* @selector '[odxCdkInteractive]' - Applies this directive to any element with the 'odxCdkInteractive' attribute.
|
|
19
|
+
* @hostDirectives {WithDisabledState, WithTabIndex} - Applies disabled state and tab index handling.
|
|
20
|
+
* @host role='button' - Assigns a role of 'button' to the host element for accessibility.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* Applying the directive to a div element to make it interactive:
|
|
24
|
+
* ```html
|
|
25
|
+
* <div odxCdkInteractive (odxCdkInteractive)="onInteract($event)">
|
|
26
|
+
* Click or press Enter/Space to interact
|
|
27
|
+
* </div>
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* Using the directive on a custom Angular component
|
|
32
|
+
* ```html
|
|
33
|
+
* <app-custom-button odxCdkInteractive (odxCdkInteractive)="onCustomButtonInteract($event)">
|
|
34
|
+
* </app-custom-button>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
10
37
|
let InteractiveDirective = class InteractiveDirective {
|
|
11
38
|
constructor() {
|
|
12
39
|
this.disabledController = DisabledController.inject();
|
|
13
40
|
this.element = injectElement();
|
|
41
|
+
/**
|
|
42
|
+
* Emits an event when the element is interacted with via click, Enter key, or Space key.
|
|
43
|
+
*
|
|
44
|
+
* @emits {MouseEvent | KeyboardEvent} - The event that triggered the interaction.
|
|
45
|
+
*/
|
|
14
46
|
this.interact = new EventEmitter();
|
|
15
47
|
}
|
|
16
48
|
handleEvents(event) {
|
|
@@ -48,14 +80,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
48
80
|
args: ['keyup.space', ['$event']]
|
|
49
81
|
}] } });
|
|
50
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Directive to make an element focusable as part of a list, integrating with Angular CDK's FocusKeyManager.
|
|
85
|
+
* It listens to the disabled state controlled by `DisabledController` to manage focus correctly based on
|
|
86
|
+
* the enabled state of the element.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* In a component template, apply this directive to list items that should be focusable and managed by a FocusKeyManager:
|
|
90
|
+
* ```html
|
|
91
|
+
* <li odxListFocusManagerOption *ngFor="let item of items">
|
|
92
|
+
* {{ item }}
|
|
93
|
+
* </li>
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
51
96
|
class ListFocusManagerOptionDirective {
|
|
52
97
|
constructor() {
|
|
53
98
|
this.disabledController = DisabledController.inject();
|
|
54
99
|
this.element = injectElement();
|
|
55
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Reflects the disabled state of the element, managed by `DisabledController`.
|
|
103
|
+
* If disabled, the element is not focusable.
|
|
104
|
+
*
|
|
105
|
+
* @returns {boolean} True if the directive's host element is disabled.
|
|
106
|
+
*/
|
|
56
107
|
get disabled() {
|
|
57
108
|
return !!this.disabledController?.disabled;
|
|
58
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Focuses the host element. If the element is disabled, it will not be focused.
|
|
112
|
+
*/
|
|
59
113
|
focus() {
|
|
60
114
|
this.element.nativeElement.focus();
|
|
61
115
|
}
|
|
@@ -70,6 +124,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
70
124
|
}]
|
|
71
125
|
}] });
|
|
72
126
|
|
|
127
|
+
/**
|
|
128
|
+
* Directive that sets up keyboard navigation for a list or a group of focusable elements.
|
|
129
|
+
* Utilizes `FocusKeyManager` from Angular CDK to manage focus among items.
|
|
130
|
+
* It automatically skips disabled items and wraps around when navigating past the first or last item.
|
|
131
|
+
* Handles keydown events to navigate through the focusable options.
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* In a component template, use this directive on a container element and `odxListFocusManagerOption`
|
|
135
|
+
* on each focusable list item:
|
|
136
|
+
* ```html
|
|
137
|
+
* <ul odxListFocusManager>
|
|
138
|
+
* <li odxListFocusManagerOption *ngFor="let item of items">
|
|
139
|
+
* {{ item }}
|
|
140
|
+
* </li>
|
|
141
|
+
* </ul>
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
73
144
|
class ListFocusManagerDirective {
|
|
74
145
|
constructor() {
|
|
75
146
|
this.keyManager = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odx-angular-cdk-a11y.mjs","sources":["../../../../libs/angular/cdk/a11y/src/lib/directives/interactive.directive.ts","../../../../libs/angular/cdk/a11y/src/lib/directives/list-focus-manager-option.directive.ts","../../../../libs/angular/cdk/a11y/src/lib/directives/list-focus-manager.directive.ts","../../../../libs/angular/cdk/a11y/src/lib/a11y.module.ts","../../../../libs/angular/cdk/a11y/src/odx-angular-cdk-a11y.ts"],"sourcesContent":["import { Directive, EventEmitter, HostListener, Output } from '@angular/core';\nimport { DisabledController, WithDisabledState, WithTabIndex } from '@odx/angular';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { injectElement } from '@odx/angular/utils';\n\n@CSSComponent('cdk-interactive')\n@Directive({\n selector: '[odxCdkInteractive]',\n standalone: true,\n hostDirectives: [WithDisabledState, WithTabIndex],\n host: {\n role: 'button',\n },\n})\nexport class InteractiveDirective {\n private readonly disabledController = DisabledController.inject();\n\n public readonly element = injectElement();\n\n @Output('odxCdkInteractive')\n public interact = new EventEmitter<MouseEvent | KeyboardEvent>();\n\n @HostListener('click', ['$event'])\n @HostListener('keyup.enter', ['$event'])\n @HostListener('keyup.space', ['$event'])\n protected handleEvents(event: MouseEvent | KeyboardEvent) {\n if (this.disabledController?.disabled) return;\n this.interact.next(event);\n }\n}\n","import { FocusableOption } from '@angular/cdk/a11y';\nimport { Directive } from '@angular/core';\nimport { DisabledController } from '@odx/angular';\nimport { injectElement } from '@odx/angular/utils';\n\n@Directive({\n selector: '[odxListFocusManagerOption]',\n standalone: true,\n})\nexport class ListFocusManagerOptionDirective implements FocusableOption {\n private readonly disabledController = DisabledController.inject();\n private readonly element = injectElement();\n\n public get disabled(): boolean {\n return !!this.disabledController?.disabled;\n }\n\n public focus(): void {\n this.element.nativeElement.focus();\n }\n}\n","import { FocusKeyManager } from '@angular/cdk/a11y';\nimport { AfterContentInit, ContentChildren, Directive, HostListener, OnDestroy, QueryList } from '@angular/core';\nimport { deferFn } from '@odx/angular/utils';\nimport { ListFocusManagerOptionDirective } from './list-focus-manager-option.directive';\n\n@Directive({\n selector: '[odxListFocusManager]',\n standalone: true,\n})\nexport class ListFocusManagerDirective implements AfterContentInit, OnDestroy {\n private keyManager: FocusKeyManager<ListFocusManagerOptionDirective> | null = null;\n\n @ContentChildren(ListFocusManagerOptionDirective)\n protected options!: QueryList<ListFocusManagerOptionDirective>;\n\n public ngAfterContentInit(): void {\n this.keyManager = new FocusKeyManager(this.options)\n .withHomeAndEnd()\n .withWrap()\n .skipPredicate((item) => item.disabled);\n deferFn(() => this.keyManager?.setFirstItemActive());\n }\n\n public ngOnDestroy(): void {\n this.keyManager?.destroy();\n this.keyManager = null;\n }\n\n @HostListener('keydown', ['$event'])\n protected onKeyDown(event: KeyboardEvent): void {\n this.keyManager?.onKeydown(event);\n }\n}\n","import { A11yModule as NgCdkA11yModule } from '@angular/cdk/a11y';\nimport { NgModule } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { InteractiveDirective, ListFocusManagerDirective, ListFocusManagerOptionDirective } from './directives';\n\nconst modules = [ListFocusManagerDirective, ListFocusManagerOptionDirective, InteractiveDirective];\n\n@NgModule({\n imports: [NgCdkA11yModule, ...modules],\n exports: [CoreModule, NgCdkA11yModule, ...modules],\n})\nexport class A11yModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["NgCdkA11yModule"],"mappings":";;;;;;;;;AAca,IAAA,oBAAoB,GAA1B,MAAM,oBAAoB,CAAA;AAA1B,IAAA,WAAA,GAAA;AACY,QAAA,IAAA,CAAA,kBAAkB,GAAG,kBAAkB,CAAC,MAAM,EAAE,CAAC;QAElD,IAAO,CAAA,OAAA,GAAG,aAAa,EAAE,CAAC;AAGnC,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,YAAY,EAA8B,CAAC;AASlE,KAAA;AAJW,IAAA,YAAY,CAAC,KAAiC,EAAA;AACtD,QAAA,IAAI,IAAI,CAAC,kBAAkB,EAAE,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EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAU,YAHXA,YAAe,EAHV,yBAAyB,EAAE,+BAA+B,EAAE,oBAAoB,CAIrF,EAAA,OAAA,EAAA,CAAA,UAAU,EAAEA,YAAe,EAJtB,yBAAyB,EAAE,+BAA+B,EAAE,oBAAoB,CAAA,EAAA,CAAA,CAAA,EAAA;AAMpF,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAU,EAHX,OAAA,EAAA,CAAAA,YAAe,EACf,UAAU,EAAEA,YAAe,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAE1B,UAAU,EAAA,UAAA,EAAA,CAAA;kBAJtB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAACA,YAAe,EAAE,GAAG,OAAO,CAAC;oBACtC,OAAO,EAAE,CAAC,UAAU,EAAEA,YAAe,EAAE,GAAG,OAAO,CAAC;AACnD,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"odx-angular-cdk-a11y.mjs","sources":["../../../../libs/angular/cdk/a11y/src/lib/directives/interactive.directive.ts","../../../../libs/angular/cdk/a11y/src/lib/directives/list-focus-manager-option.directive.ts","../../../../libs/angular/cdk/a11y/src/lib/directives/list-focus-manager.directive.ts","../../../../libs/angular/cdk/a11y/src/lib/a11y.module.ts","../../../../libs/angular/cdk/a11y/src/odx-angular-cdk-a11y.ts"],"sourcesContent":["import { Directive, EventEmitter, HostListener, Output } from '@angular/core';\nimport { DisabledController, WithDisabledState, WithTabIndex } from '@odx/angular';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { injectElement } from '@odx/angular/utils';\n\n/**\n * Directive that makes an element interactive, responding to click, Enter key, and Space key events.\n * It automatically handles the disabled state through `DisabledController`, inhibiting interactions when disabled.\n * This directive can be useful for creating custom buttons or interactive elements that are not natively interactive,\n * such as divs or custom components.\n *\n * @Directive\n * @CSSComponent cdk-interactive - A CSS Component class that can be targeted for styling interactive elements.\n * @selector '[odxCdkInteractive]' - Applies this directive to any element with the 'odxCdkInteractive' attribute.\n * @hostDirectives {WithDisabledState, WithTabIndex} - Applies disabled state and tab index handling.\n * @host role='button' - Assigns a role of 'button' to the host element for accessibility.\n *\n * @example\n * Applying the directive to a div element to make it interactive:\n * ```html\n * <div odxCdkInteractive (odxCdkInteractive)=\"onInteract($event)\">\n * Click or press Enter/Space to interact\n * </div>\n * ```\n *\n * @example\n * Using the directive on a custom Angular component\n * ```html\n * <app-custom-button odxCdkInteractive (odxCdkInteractive)=\"onCustomButtonInteract($event)\">\n * </app-custom-button>\n * ```\n */\n@CSSComponent('cdk-interactive')\n@Directive({\n selector: '[odxCdkInteractive]',\n standalone: true,\n hostDirectives: [WithDisabledState, WithTabIndex],\n host: {\n role: 'button',\n },\n})\nexport class InteractiveDirective {\n private readonly disabledController = DisabledController.inject();\n\n public readonly element = injectElement();\n\n /**\n * Emits an event when the element is interacted with via click, Enter key, or Space key.\n *\n * @emits {MouseEvent | KeyboardEvent} - The event that triggered the interaction.\n */\n @Output('odxCdkInteractive')\n public interact = new EventEmitter<MouseEvent | KeyboardEvent>();\n\n @HostListener('click', ['$event'])\n @HostListener('keyup.enter', ['$event'])\n @HostListener('keyup.space', ['$event'])\n protected handleEvents(event: MouseEvent | KeyboardEvent) {\n if (this.disabledController?.disabled) return;\n this.interact.next(event);\n }\n}\n","import { FocusableOption } from '@angular/cdk/a11y';\nimport { Directive } from '@angular/core';\nimport { DisabledController } from '@odx/angular';\nimport { injectElement } from '@odx/angular/utils';\n\n/**\n * Directive to make an element focusable as part of a list, integrating with Angular CDK's FocusKeyManager.\n * It listens to the disabled state controlled by `DisabledController` to manage focus correctly based on\n * the enabled state of the element.\n *\n * @example\n * In a component template, apply this directive to list items that should be focusable and managed by a FocusKeyManager:\n * ```html\n * <li odxListFocusManagerOption *ngFor=\"let item of items\">\n * {{ item }}\n * </li>\n * ```\n */\n@Directive({\n selector: '[odxListFocusManagerOption]',\n standalone: true,\n})\nexport class ListFocusManagerOptionDirective implements FocusableOption {\n private readonly disabledController = DisabledController.inject();\n private readonly element = injectElement();\n\n /**\n * Reflects the disabled state of the element, managed by `DisabledController`.\n * If disabled, the element is not focusable.\n *\n * @returns {boolean} True if the directive's host element is disabled.\n */\n public get disabled(): boolean {\n return !!this.disabledController?.disabled;\n }\n\n /**\n * Focuses the host element. If the element is disabled, it will not be focused.\n */\n public focus(): void {\n this.element.nativeElement.focus();\n }\n}\n","import { FocusKeyManager } from '@angular/cdk/a11y';\nimport { AfterContentInit, ContentChildren, Directive, HostListener, OnDestroy, QueryList } from '@angular/core';\nimport { deferFn } from '@odx/angular/utils';\nimport { ListFocusManagerOptionDirective } from './list-focus-manager-option.directive';\n\n/**\n * Directive that sets up keyboard navigation for a list or a group of focusable elements.\n * Utilizes `FocusKeyManager` from Angular CDK to manage focus among items.\n * It automatically skips disabled items and wraps around when navigating past the first or last item.\n * Handles keydown events to navigate through the focusable options.\n *\n * @example\n * In a component template, use this directive on a container element and `odxListFocusManagerOption`\n * on each focusable list item:\n * ```html\n * <ul odxListFocusManager>\n * <li odxListFocusManagerOption *ngFor=\"let item of items\">\n * {{ item }}\n * </li>\n * </ul>\n * ```\n */\n@Directive({\n selector: '[odxListFocusManager]',\n standalone: true,\n})\nexport class ListFocusManagerDirective implements AfterContentInit, OnDestroy {\n private keyManager: FocusKeyManager<ListFocusManagerOptionDirective> | null = null;\n\n @ContentChildren(ListFocusManagerOptionDirective)\n protected options!: QueryList<ListFocusManagerOptionDirective>;\n\n public ngAfterContentInit(): void {\n this.keyManager = new FocusKeyManager(this.options)\n .withHomeAndEnd()\n .withWrap()\n .skipPredicate((item) => item.disabled);\n deferFn(() => this.keyManager?.setFirstItemActive());\n }\n\n public ngOnDestroy(): void {\n this.keyManager?.destroy();\n this.keyManager = null;\n }\n\n @HostListener('keydown', ['$event'])\n protected onKeyDown(event: KeyboardEvent): void {\n this.keyManager?.onKeydown(event);\n }\n}\n","import { A11yModule as NgCdkA11yModule } from '@angular/cdk/a11y';\nimport { NgModule } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { InteractiveDirective, ListFocusManagerDirective, ListFocusManagerOptionDirective } from './directives';\n\nconst modules = [ListFocusManagerDirective, ListFocusManagerOptionDirective, InteractiveDirective];\n\n@NgModule({\n imports: [NgCdkA11yModule, ...modules],\n exports: [CoreModule, NgCdkA11yModule, ...modules],\n})\nexport class A11yModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["NgCdkA11yModule"],"mappings":";;;;;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;AAUU,IAAA,oBAAoB,GAA1B,MAAM,oBAAoB,CAAA;AAA1B,IAAA,WAAA,GAAA;AACY,QAAA,IAAA,CAAA,kBAAkB,GAAG,kBAAkB,CAAC,MAAM,EAAE,CAAC;QAElD,IAAO,CAAA,OAAA,GAAG,aAAa,EAAE,CAAC;AAE1C;;;;AAIG;AAEI,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,YAAY,EAA8B,CAAC;AASlE,KAAA;AAJW,IAAA,YAAY,CAAC,KAAiC,EAAA;AACtD,QAAA,IAAI,IAAI,CAAC,kBAAkB,EAAE,QAAQ;YAAE,OAAO;AAC9C,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KAC3B;+GAnBU,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;mGAApB,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,OAAA,EAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,EA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A,CAAA,CAAA,EAAA;AAMpF,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAU,EAHX,OAAA,EAAA,CAAAA,YAAe,EACf,UAAU,EAAEA,YAAe,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAE1B,UAAU,EAAA,UAAA,EAAA,CAAA;kBAJtB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAACA,YAAe,EAAE,GAAG,OAAO,CAAC;oBACtC,OAAO,EAAE,CAAC,UAAU,EAAEA,YAAe,EAAE,GAAG,OAAO,CAAC;AACnD,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
|
|
@@ -17,6 +17,42 @@ const ActiveIndicatorPosition = {
|
|
|
17
17
|
END: 'end',
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* `ActiveIndicatorDirective` is designed to adjust an indicator's position and size dynamically to highlight
|
|
22
|
+
* the active element within a container. It's useful for tabs, menus, or any list where an active state is visually represented.
|
|
23
|
+
* The directive can be customized to align the indicator based on the active element's position and supports
|
|
24
|
+
* both horizontal and vertical orientations.
|
|
25
|
+
*
|
|
26
|
+
* To use this directive, apply it to the element you want to use as an active indicator.
|
|
27
|
+
* Then, bind the active element using the `odxActiveIndicator` input. Optionally, specify
|
|
28
|
+
* the container element with `odxActiveIndicatorParent` if the container is not the immediate parent of the indicator.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```html
|
|
32
|
+
* <div class="tabs-container" #tabsContainer>
|
|
33
|
+
* <div class="tab" *ngFor="let tab of tabs" [class.active]="tab.isActive" #tabElement>{{ tab.label }}</div>
|
|
34
|
+
* <div class="indicator" [odxActiveIndicator]="activeTabElement" [odxActiveIndicatorParent]="tabsContainer"></div>
|
|
35
|
+
* </div>
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* ```ts
|
|
39
|
+
* @Component({
|
|
40
|
+
* selector: 'app-tabs',
|
|
41
|
+
* templateUrl: './tabs.component.html',
|
|
42
|
+
* imports: [ActiveIndicatorDirective, NgForOf],
|
|
43
|
+
* })
|
|
44
|
+
* export class TabsComponent {
|
|
45
|
+
* tabs = [{ label: 'Tab 1', isActive: true }, { label: 'Tab 2', isActive: false }];
|
|
46
|
+
* @ViewChildren('tabElement') tabElements?: QueryList<ElementRef>;
|
|
47
|
+
* @ViewChild('tabsContainer') tabsContainer!: ElementRef;
|
|
48
|
+
*
|
|
49
|
+
* get activeTabElement(): HTMLElement {
|
|
50
|
+
* const activeTab = this.tabElements?.find((tab) => tab.nativeElement.classList.contains('active'));
|
|
51
|
+
* return activeTab ? activeTab.nativeElement : null;
|
|
52
|
+
* }
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
20
56
|
let ActiveIndicatorDirective = class ActiveIndicatorDirective {
|
|
21
57
|
constructor() {
|
|
22
58
|
this.takeUntilDestroyed = untilDestroyed();
|
|
@@ -25,11 +61,38 @@ let ActiveIndicatorDirective = class ActiveIndicatorDirective {
|
|
|
25
61
|
return parentElement ? fromElementResize$(parentElement) : EMPTY;
|
|
26
62
|
}));
|
|
27
63
|
this.element = injectElement();
|
|
64
|
+
/**
|
|
65
|
+
* Indicates whether the element is active or not.
|
|
66
|
+
*
|
|
67
|
+
* @type {boolean}
|
|
68
|
+
*/
|
|
28
69
|
this.isActive = false;
|
|
70
|
+
/**
|
|
71
|
+
* The currently active element to which the indicator should align.
|
|
72
|
+
* It dynamically updates the indicator's position and size based on this element.
|
|
73
|
+
*
|
|
74
|
+
* @type {HTMLElement | null}
|
|
75
|
+
*/
|
|
29
76
|
this.activeElement = null;
|
|
77
|
+
/**
|
|
78
|
+
* The direction in which the indicator should move.
|
|
79
|
+
*
|
|
80
|
+
* @type {ActiveIndicatorDirection}
|
|
81
|
+
*/
|
|
30
82
|
this.direction = ActiveIndicatorDirection.HORIZONTAL;
|
|
83
|
+
/**
|
|
84
|
+
* The position of the indicator relative to the active element.
|
|
85
|
+
*
|
|
86
|
+
* @type {ActiveIndicatorPosition}
|
|
87
|
+
*/
|
|
31
88
|
this.position = ActiveIndicatorPosition.CENTER;
|
|
32
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* The parent container element of the active elements.
|
|
92
|
+
* If not set, the indicator's immediate parent element is used.
|
|
93
|
+
*
|
|
94
|
+
* @type {HTMLElement | null}
|
|
95
|
+
*/
|
|
33
96
|
set parent(value) {
|
|
34
97
|
this.parentElement$$.next(value);
|
|
35
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odx-angular-cdk-active-indicator.mjs","sources":["../../../../libs/angular/cdk/active-indicator/src/lib/models/active-indicator-direction.ts","../../../../libs/angular/cdk/active-indicator/src/lib/models/active-indicator-position.ts","../../../../libs/angular/cdk/active-indicator/src/lib/active-indicator.directive.ts","../../../../libs/angular/cdk/active-indicator/src/odx-angular-cdk-active-indicator.ts"],"sourcesContent":["export type ActiveIndicatorDirection = typeof ActiveIndicatorDirection[keyof typeof ActiveIndicatorDirection];\n\nexport const ActiveIndicatorDirection = {\n HORIZONTAL: 'horizontal',\n VERTICAL: 'vertical',\n} as const;\n","export type ActiveIndicatorPosition = typeof ActiveIndicatorPosition[keyof typeof ActiveIndicatorPosition];\n\nexport const ActiveIndicatorPosition = {\n START: 'start',\n CENTER: 'center',\n END: 'end',\n} as const;\n","import { AfterViewInit, Directive, Input, OnChanges } from '@angular/core';\nimport { CSSComponent, CSSModifier } from '@odx/angular/internal';\nimport { fromElementResize$ } from '@odx/angular/rxjs';\nimport { NgChanges, applyStyles, disableCSSTransitions, hasChanged, injectElement, isPresent, px, untilDestroyed } from '@odx/angular/utils';\nimport { BehaviorSubject, EMPTY, distinctUntilChanged, switchMap } from 'rxjs';\nimport { ActiveIndicatorPosition } from './models';\nimport { ActiveIndicatorDirection } from './models/active-indicator-direction';\n\n@CSSComponent('cdk-active-indicator')\n@Directive({\n standalone: true,\n selector: '[odxActiveIndicator]',\n})\nexport class ActiveIndicatorDirective implements OnChanges, AfterViewInit {\n private readonly takeUntilDestroyed = untilDestroyed();\n private readonly parentElement$$ = new BehaviorSubject<HTMLElement | null>(null);\n private readonly onResize$ = this.parentElement$$.pipe(\n distinctUntilChanged(),\n switchMap((parentElement) => {\n return parentElement ? fromElementResize$(parentElement) : EMPTY;\n }),\n );\n\n public readonly element = injectElement();\n\n @CSSModifier()\n public isActive = false;\n\n @Input('odxActiveIndicator')\n public activeElement?: HTMLElement | null = null;\n\n @Input('odxActiveIndicatorParent')\n public set parent(value: HTMLElement | null) {\n this.parentElement$$.next(value);\n }\n public get parent(): HTMLElement | null {\n return this.parentElement$$.getValue();\n }\n\n @CSSModifier()\n @Input('odxActiveIndicatorDirection')\n public direction: ActiveIndicatorDirection = ActiveIndicatorDirection.HORIZONTAL;\n\n @Input('odxActiveIndicatorPosition')\n public position: ActiveIndicatorPosition = ActiveIndicatorPosition.CENTER;\n\n public ngAfterViewInit(): void {\n this.onResize$.pipe(this.takeUntilDestroyed()).subscribe(() => this.updateStyles());\n this.parent ??= this.element.nativeElement.parentElement;\n }\n\n public ngOnChanges(changes: NgChanges<ActiveIndicatorDirective>): void {\n if (hasChanged(changes, 'activeElement', false)) {\n this.isActive = !!this.activeElement;\n }\n if (hasChanged(changes, ['activeElement', 'direction', 'position'])) {\n this.updateStyles(!isPresent(changes.activeElement?.previousValue));\n }\n }\n\n private updateStyles(disableTransition = false): void {\n if (!this.activeElement) return;\n const isHorizontal = this.direction === ActiveIndicatorDirection.HORIZONTAL;\n const isVertical = this.direction === ActiveIndicatorDirection.VERTICAL;\n const relativeOffset = this.getIndicatorRelativeOffset();\n\n let transform = null;\n if (isHorizontal) {\n const positionX = this.getIndicatorPositionX(this.activeElement);\n transform = `translateX(${px(positionX)}) translateX(${relativeOffset}%)`;\n }\n if (isVertical) {\n const positionY = this.getIndicatorPositionY(this.activeElement);\n transform = `translateY(${px(positionY)}) translateY(${relativeOffset}%)`;\n }\n\n disableTransition && disableCSSTransitions(this.element.nativeElement, true);\n applyStyles(this.element.nativeElement, {\n transform,\n width: isHorizontal ? px(this.activeElement.offsetWidth) : null,\n height: isVertical ? px(this.activeElement.offsetHeight) : null,\n });\n disableTransition && disableCSSTransitions(this.element.nativeElement, false);\n }\n\n private getIndicatorPositionX(activeElement: HTMLElement): number {\n switch (this.position) {\n case ActiveIndicatorPosition.START:\n return activeElement.offsetLeft;\n case ActiveIndicatorPosition.CENTER:\n return activeElement.offsetLeft + activeElement.offsetWidth / 2;\n case ActiveIndicatorPosition.END:\n return activeElement.offsetLeft + activeElement.offsetWidth;\n }\n }\n\n private getIndicatorPositionY(activeElement: HTMLElement): number {\n switch (this.position) {\n case ActiveIndicatorPosition.START:\n return activeElement.offsetTop;\n case ActiveIndicatorPosition.CENTER:\n return activeElement.offsetTop + activeElement.offsetHeight / 2;\n case ActiveIndicatorPosition.END:\n return activeElement.offsetTop + activeElement.offsetHeight;\n }\n }\n\n private getIndicatorRelativeOffset(): number {\n switch (this.position) {\n case ActiveIndicatorPosition.START:\n return 0;\n case ActiveIndicatorPosition.CENTER:\n return -50;\n case ActiveIndicatorPosition.END:\n return -100;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEa,MAAA,wBAAwB,GAAG;AACtC,IAAA,UAAU,EAAE,YAAY;AACxB,IAAA,QAAQ,EAAE,UAAU;;;ACFT,MAAA,uBAAuB,GAAG;AACrC,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,GAAG,EAAE,KAAK;;;ACQC,IAAA,wBAAwB,GAA9B,MAAM,wBAAwB,CAAA;AAA9B,IAAA,WAAA,GAAA;QACY,IAAkB,CAAA,kBAAA,GAAG,cAAc,EAAE,CAAC;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BADd,KAAK;uBAAC,4BAA4B,CAAA;;;AC3CrC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"odx-angular-cdk-active-indicator.mjs","sources":["../../../../libs/angular/cdk/active-indicator/src/lib/models/active-indicator-direction.ts","../../../../libs/angular/cdk/active-indicator/src/lib/models/active-indicator-position.ts","../../../../libs/angular/cdk/active-indicator/src/lib/active-indicator.directive.ts","../../../../libs/angular/cdk/active-indicator/src/odx-angular-cdk-active-indicator.ts"],"sourcesContent":["export type ActiveIndicatorDirection = typeof ActiveIndicatorDirection[keyof typeof ActiveIndicatorDirection];\n\nexport const ActiveIndicatorDirection = {\n HORIZONTAL: 'horizontal',\n VERTICAL: 'vertical',\n} as const;\n","export type ActiveIndicatorPosition = typeof ActiveIndicatorPosition[keyof typeof ActiveIndicatorPosition];\n\nexport const ActiveIndicatorPosition = {\n START: 'start',\n CENTER: 'center',\n END: 'end',\n} as const;\n","import { AfterViewInit, Directive, Input, OnChanges } from '@angular/core';\nimport { CSSComponent, CSSModifier } from '@odx/angular/internal';\nimport { fromElementResize$ } from '@odx/angular/rxjs';\nimport { NgChanges, applyStyles, disableCSSTransitions, hasChanged, injectElement, isPresent, px, untilDestroyed } from '@odx/angular/utils';\nimport { BehaviorSubject, EMPTY, distinctUntilChanged, switchMap } from 'rxjs';\nimport { ActiveIndicatorPosition } from './models';\nimport { ActiveIndicatorDirection } from './models/active-indicator-direction';\n\n/**\n * `ActiveIndicatorDirective` is designed to adjust an indicator's position and size dynamically to highlight\n * the active element within a container. It's useful for tabs, menus, or any list where an active state is visually represented.\n * The directive can be customized to align the indicator based on the active element's position and supports\n * both horizontal and vertical orientations.\n *\n * To use this directive, apply it to the element you want to use as an active indicator.\n * Then, bind the active element using the `odxActiveIndicator` input. Optionally, specify\n * the container element with `odxActiveIndicatorParent` if the container is not the immediate parent of the indicator.\n *\n * @example\n * ```html\n * <div class=\"tabs-container\" #tabsContainer>\n * <div class=\"tab\" *ngFor=\"let tab of tabs\" [class.active]=\"tab.isActive\" #tabElement>{{ tab.label }}</div>\n * <div class=\"indicator\" [odxActiveIndicator]=\"activeTabElement\" [odxActiveIndicatorParent]=\"tabsContainer\"></div>\n * </div>\n * ```\n *\n * ```ts\n * @Component({\n * selector: 'app-tabs',\n * templateUrl: './tabs.component.html',\n * imports: [ActiveIndicatorDirective, NgForOf],\n * })\n * export class TabsComponent {\n * tabs = [{ label: 'Tab 1', isActive: true }, { label: 'Tab 2', isActive: false }];\n * @ViewChildren('tabElement') tabElements?: QueryList<ElementRef>;\n * @ViewChild('tabsContainer') tabsContainer!: ElementRef;\n *\n * get activeTabElement(): HTMLElement {\n * const activeTab = this.tabElements?.find((tab) => tab.nativeElement.classList.contains('active'));\n * return activeTab ? activeTab.nativeElement : null;\n * }\n * }\n * ```\n */\n@CSSComponent('cdk-active-indicator')\n@Directive({\n standalone: true,\n selector: '[odxActiveIndicator]',\n})\nexport class ActiveIndicatorDirective implements OnChanges, AfterViewInit {\n private readonly takeUntilDestroyed = untilDestroyed();\n private readonly parentElement$$ = new BehaviorSubject<HTMLElement | null>(null);\n private readonly onResize$ = this.parentElement$$.pipe(\n distinctUntilChanged(),\n switchMap((parentElement) => {\n return parentElement ? fromElementResize$(parentElement) : EMPTY;\n }),\n );\n\n public readonly element = injectElement();\n\n /**\n * Indicates whether the element is active or not.\n *\n * @type {boolean}\n */\n @CSSModifier()\n public isActive = false;\n\n /**\n * The currently active element to which the indicator should align.\n * It dynamically updates the indicator's position and size based on this element.\n *\n * @type {HTMLElement | null}\n */\n @Input('odxActiveIndicator')\n public activeElement?: HTMLElement | null = null;\n\n /**\n * The parent container element of the active elements.\n * If not set, the indicator's immediate parent element is used.\n *\n * @type {HTMLElement | null}\n */\n @Input('odxActiveIndicatorParent')\n public set parent(value: HTMLElement | null) {\n this.parentElement$$.next(value);\n }\n public get parent(): HTMLElement | null {\n return this.parentElement$$.getValue();\n }\n\n /**\n * The direction in which the indicator should move.\n *\n * @type {ActiveIndicatorDirection}\n */\n @CSSModifier()\n @Input('odxActiveIndicatorDirection')\n public direction: ActiveIndicatorDirection = ActiveIndicatorDirection.HORIZONTAL;\n\n /**\n * The position of the indicator relative to the active element.\n *\n * @type {ActiveIndicatorPosition}\n */\n @Input('odxActiveIndicatorPosition')\n public position: ActiveIndicatorPosition = ActiveIndicatorPosition.CENTER;\n\n public ngAfterViewInit(): void {\n this.onResize$.pipe(this.takeUntilDestroyed()).subscribe(() => this.updateStyles());\n this.parent ??= this.element.nativeElement.parentElement;\n }\n\n public ngOnChanges(changes: NgChanges<ActiveIndicatorDirective>): void {\n if (hasChanged(changes, 'activeElement', false)) {\n this.isActive = !!this.activeElement;\n }\n if (hasChanged(changes, ['activeElement', 'direction', 'position'])) {\n this.updateStyles(!isPresent(changes.activeElement?.previousValue));\n }\n }\n\n private updateStyles(disableTransition = false): void {\n if (!this.activeElement) return;\n const isHorizontal = this.direction === ActiveIndicatorDirection.HORIZONTAL;\n const isVertical = this.direction === ActiveIndicatorDirection.VERTICAL;\n const relativeOffset = this.getIndicatorRelativeOffset();\n\n let transform = null;\n if (isHorizontal) {\n const positionX = this.getIndicatorPositionX(this.activeElement);\n transform = `translateX(${px(positionX)}) translateX(${relativeOffset}%)`;\n }\n if (isVertical) {\n const positionY = this.getIndicatorPositionY(this.activeElement);\n transform = `translateY(${px(positionY)}) translateY(${relativeOffset}%)`;\n }\n\n disableTransition && disableCSSTransitions(this.element.nativeElement, true);\n applyStyles(this.element.nativeElement, {\n transform,\n width: isHorizontal ? px(this.activeElement.offsetWidth) : null,\n height: isVertical ? px(this.activeElement.offsetHeight) : null,\n });\n disableTransition && disableCSSTransitions(this.element.nativeElement, false);\n }\n\n private getIndicatorPositionX(activeElement: HTMLElement): number {\n switch (this.position) {\n case ActiveIndicatorPosition.START:\n return activeElement.offsetLeft;\n case ActiveIndicatorPosition.CENTER:\n return activeElement.offsetLeft + activeElement.offsetWidth / 2;\n case ActiveIndicatorPosition.END:\n return activeElement.offsetLeft + activeElement.offsetWidth;\n }\n }\n\n private getIndicatorPositionY(activeElement: HTMLElement): number {\n switch (this.position) {\n case ActiveIndicatorPosition.START:\n return activeElement.offsetTop;\n case ActiveIndicatorPosition.CENTER:\n return activeElement.offsetTop + activeElement.offsetHeight / 2;\n case ActiveIndicatorPosition.END:\n return activeElement.offsetTop + activeElement.offsetHeight;\n }\n }\n\n private getIndicatorRelativeOffset(): number {\n switch (this.position) {\n case ActiveIndicatorPosition.START:\n return 0;\n case ActiveIndicatorPosition.CENTER:\n return -50;\n case ActiveIndicatorPosition.END:\n return -100;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEa,MAAA,wBAAwB,GAAG;AACtC,IAAA,UAAU,EAAE,YAAY;AACxB,IAAA,QAAQ,EAAE,UAAU;;;ACFT,MAAA,uBAAuB,GAAG;AACrC,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,GAAG,EAAE,KAAK;;;ACGZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCG;AAMU,IAAA,wBAAwB,GAA9B,MAAM,wBAAwB,CAAA;AAA9B,IAAA,WAAA,GAAA;QACY,IAAkB,CAAA,kBAAA,GAAG,cAAc,EAAE,CAAC;AACtC,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,eAAe,CAAqB,IAAI,CAAC,CAAC;AAChE,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CACpD,oBAAoB,EAAE,EACtB,SAAS,CAAC,CAAC,aAAa,KAAI;AAC1B,YAAA,OAAO,aAAa,GAAG,kBAAkB,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC;SAClE,CAAC,CACH,CAAC;QAEc,IAAO,CAAA,OAAA,GAAG,aAAa,EAAE,CAAC;AAE1C;;;;AAIG;QAEI,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;AAExB;;;;;AAKG;QAE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,4BAAA,EAAA,UAAA,CAAA,EAAA,EAAA,aAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;AAkB5B,UAAA,CAAA;AADN,IAAA,WAAW,EAAE;;AACU,CAAA,EAAA,wBAAA,CAAA,SAAA,EAAA,UAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAgCjB,UAAA,CAAA;AAFN,IAAA,WAAW,EAAE;;AAEmE,CAAA,EAAA,wBAAA,CAAA,SAAA,EAAA,WAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAlDtE,wBAAwB,GAAA,UAAA,CAAA;IALpC,YAAY,CAAC,sBAAsB,CAAC;AAKxB,CAAA,EAAA,wBAAwB,CAmIpC,CAAA;4FAnIY,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAJpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,sBAAsB;AACjC,iBAAA,CAAA;AAmBQ,SAAA,CAAA,EAAA,cAAA,EAAA,EAAA,QAAQ,MASR,aAAa,EAAA,CAAA;sBADnB,KAAK;uBAAC,oBAAoB,CAAA;gBAUhB,MAAM,EAAA,CAAA;sBADhB,KAAK;uBAAC,0BAA0B,CAAA;gBAe1B,SAAS,EAAA,CAAA;sBADf,KAAK;uBAAC,6BAA6B,CAAA;gBAS7B,QAAQ,EAAA,CAAA;sBADd,KAAK;uBAAC,4BAA4B,CAAA;;;AC1GrC;;AAEG;;;;"}
|
|
@@ -8,9 +8,24 @@ import { FormFieldComponent } from '@odx/angular/components/form-field';
|
|
|
8
8
|
import { untilDestroyed, injectElement, isFunction, Pure } from '@odx/angular/utils';
|
|
9
9
|
import { __decorate, __metadata } from 'tslib';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* `AutocompleteControl` is a base directive to enhance an input field with autocomplete functionality,
|
|
13
|
+
* providing keyboard navigation and selection for options displayed in a dropdown. It's designed to be extended
|
|
14
|
+
* for specific implementations.
|
|
15
|
+
* Extends `CustomFormControl` to provide form control behavior and state management.
|
|
16
|
+
*
|
|
17
|
+
* @see {CustomFormControl}
|
|
18
|
+
*
|
|
19
|
+
* This directive manages the open/close state of the dropdown, the loading state indication, and the interaction between
|
|
20
|
+
* the autocomplete input and the dropdown options. It utilizes `ActiveDescendantKeyManager` for keyboard navigation among options.
|
|
21
|
+
*
|
|
22
|
+
* Extend this directive to create a fully functional autocomplete control tailored to your data type and UI requirements.
|
|
23
|
+
*
|
|
24
|
+
* @template T - The type of the items displayed in the autocomplete dropdown.
|
|
25
|
+
*/
|
|
11
26
|
class AutocompleteControl extends CustomFormControl {
|
|
12
27
|
get dropdownReferenceElement() {
|
|
13
|
-
return this.formField?.controlElement
|
|
28
|
+
return this.formField?.controlElement?.nativeElement ?? this.element?.nativeElement;
|
|
14
29
|
}
|
|
15
30
|
get hasOptions() {
|
|
16
31
|
return !!this.options?.length;
|
|
@@ -26,6 +41,18 @@ class AutocompleteControl extends CustomFormControl {
|
|
|
26
41
|
this.smoothScrollEnabled = false;
|
|
27
42
|
this.element = injectElement();
|
|
28
43
|
this.isLoading = false;
|
|
44
|
+
/**
|
|
45
|
+
* Emits the selected option when an option is selected from the dropdown.
|
|
46
|
+
*
|
|
47
|
+
* @emits {T} - The selected option.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* autocompleteControl.optionSelected.subscribe((selectedOption) => {
|
|
52
|
+
* console.log('Selected option:', selectedOption);
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
29
56
|
this.optionSelected = new EventEmitter();
|
|
30
57
|
detectControllerChanges(this).subscribe();
|
|
31
58
|
}
|
|
@@ -36,6 +63,17 @@ class AutocompleteControl extends CustomFormControl {
|
|
|
36
63
|
this.handleQueryListOption(this.options);
|
|
37
64
|
this.handleSearchFieldChanges();
|
|
38
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Scrolls the specified option element into view.
|
|
68
|
+
* @param {OptionControl<T>} option - The option control containing the element to scroll into view.
|
|
69
|
+
* @returns {void}
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* const optionControl: OptionControl<string> = { element: myOptionElement };
|
|
74
|
+
* scrollOptionIntoView(optionControl);
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
39
77
|
scrollOptionIntoView({ element }) {
|
|
40
78
|
const behavior = this.smoothScrollEnabled ? 'smooth' : undefined;
|
|
41
79
|
if (isFunction(element.nativeElement.scrollIntoView)) {
|