@odx/angular 5.7.4 → 6.0.1
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 +17 -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/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 +17 -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 +41 -93
- 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 -9
- package/components/calendar/lib/directives/calendar-view.directive.d.ts +41 -9
- package/components/calendar/lib/pipes/date-label.pipe.d.ts +12 -21
- 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 +2 -2
- 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/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/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/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 +39 -1
- 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/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 +18 -1
- 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 -12
- 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 +9 -3
- package/esm2022/components/calendar/lib/components/calendar-year/calendar-year.component.mjs +9 -3
- package/esm2022/components/calendar/lib/components/calendar-years/calendar-years.component.mjs +9 -3
- package/esm2022/components/calendar/lib/daterange.service.mjs +17 -1
- package/esm2022/components/calendar/lib/directives/calendar-cell.directive.mjs +27 -2
- package/esm2022/components/calendar/lib/directives/calendar-view.directive.mjs +39 -1
- package/esm2022/components/calendar/lib/pipes/date-label.pipe.mjs +27 -9
- 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 +11 -8
- 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/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 +47 -6
- 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 +56 -2
- 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 +70 -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/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/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/fast-equals.mjs +3 -0
- package/esm2022/internal/lib/helpers/index.mjs +2 -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 +73 -5
- package/esm2022/localization/lib/localization.logger.mjs +3 -0
- package/esm2022/localization/lib/localization.service.mjs +59 -29
- 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 +38 -0
- 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 +188 -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 +17 -0
- 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 +270 -33
- 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 +11 -0
- 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 +122 -7
- 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 +97 -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 +61 -0
- 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 +52 -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 +4 -1
- package/fesm2022/odx-angular-internal.mjs.map +1 -1
- package/fesm2022/odx-angular-localization.mjs +269 -32
- 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/fast-equals.d.ts +1 -0
- package/internal/lib/helpers/index.d.ts +1 -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 -2
- package/localization/lib/localization.logger.d.ts +3 -0
- package/localization/lib/localization.service.d.ts +42 -7
- package/package.json +8 -7
- 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
|
@@ -7,6 +7,57 @@ export { coerceArray, coerceCssPixelValue, coerceElement, coerceStringArray } fr
|
|
|
7
7
|
import { deepmerge } from '@odx/angular/internal';
|
|
8
8
|
import { startWith, map, shareReplay, distinctUntilChanged, filter, concatAll, share } from 'rxjs/operators';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* A decorator that transforms a class method or getter into a pure function. For methods, it caches the result
|
|
12
|
+
* of the first invocation with a given set of arguments and returns the cached result on subsequent invocations
|
|
13
|
+
* with the same arguments. For getters, it caches the result of the first access and returns the cached value
|
|
14
|
+
* on subsequent accesses.
|
|
15
|
+
*
|
|
16
|
+
* This decorator is intended to improve performance by avoiding unnecessary recalculations or processing
|
|
17
|
+
* when the inputs have not changed.
|
|
18
|
+
*
|
|
19
|
+
* @template T The type of the property being decorated.
|
|
20
|
+
* @param {object} _target The prototype of the class.
|
|
21
|
+
* @param {string} propertyKey The name of the method or getter.
|
|
22
|
+
* @param {TypedPropertyDescriptor<T>} descriptor The property descriptor for the method or getter.
|
|
23
|
+
* @throws {Error} Throws an error if applied to non-function properties.
|
|
24
|
+
* @returns {TypedPropertyDescriptor<T>} A new descriptor with the getter or method patched for pure behavior.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* Usage with a getter:
|
|
28
|
+
* ```ts
|
|
29
|
+
* class ExampleClass {
|
|
30
|
+
* private _value: number = Math.random();
|
|
31
|
+
*
|
|
32
|
+
* @Pure
|
|
33
|
+
* get value(): number {
|
|
34
|
+
* console.log('Getter called');
|
|
35
|
+
* return this._value;
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
38
|
+
*
|
|
39
|
+
* const example = new ExampleClass();
|
|
40
|
+
* console.log(example.value); // Logs 'Getter called' and the value
|
|
41
|
+
* console.log(example.value); // Logs only the value, without calling the getter again
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* Usage with a method:
|
|
45
|
+
* ```ts
|
|
46
|
+
* class Counter {
|
|
47
|
+
* private count = 0;
|
|
48
|
+
*
|
|
49
|
+
* @Pure
|
|
50
|
+
* increment(step: number) {
|
|
51
|
+
* console.log('Increment called');
|
|
52
|
+
* return (this.count += step);
|
|
53
|
+
* }
|
|
54
|
+
* }
|
|
55
|
+
*
|
|
56
|
+
* const counter = new Counter();
|
|
57
|
+
* console.log(counter.increment(1)); // Logs 'Increment called' and 1
|
|
58
|
+
* console.log(counter.increment(1)); // Logs 1 without calling increment again
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
10
61
|
function Pure(_target, propertyKey, { get, enumerable, value }) {
|
|
11
62
|
if (get) {
|
|
12
63
|
return {
|
|
@@ -44,49 +95,143 @@ function Pure(_target, propertyKey, { get, enumerable, value }) {
|
|
|
44
95
|
};
|
|
45
96
|
}
|
|
46
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Checks if the given value is a `ViewContainerRef`.
|
|
100
|
+
*
|
|
101
|
+
* @param {unknown} value - The value to check.
|
|
102
|
+
* @returns {value is ViewContainerRef} `true` if the value is a `ViewContainerRef`, otherwise `false`.
|
|
103
|
+
*/
|
|
47
104
|
function isViewContainer(value) {
|
|
48
105
|
return isFunction(value?.createComponent);
|
|
49
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Checks if the given value is a `TemplateRef`.
|
|
109
|
+
*
|
|
110
|
+
* @template T - The embedded view type.
|
|
111
|
+
* @param {unknown} value - The value to check.
|
|
112
|
+
* @returns {value is TemplateRef<T>} `true` if the value is a `TemplateRef`, otherwise `false`.
|
|
113
|
+
*/
|
|
50
114
|
function isTemplateRef(value) {
|
|
51
115
|
return value instanceof TemplateRef;
|
|
52
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Checks if the given value is an Angular component class.
|
|
119
|
+
*
|
|
120
|
+
* @template T - The component class type.
|
|
121
|
+
* @param {unknown} value - The value to check.
|
|
122
|
+
* @returns {value is Type<T>} `true` if the value is a component class, otherwise `false`.
|
|
123
|
+
*/
|
|
53
124
|
function isComponent(value) {
|
|
54
125
|
return isFunction(value);
|
|
55
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Checks if the given value is a string.
|
|
129
|
+
*
|
|
130
|
+
* @param {unknown} value - The value to check.
|
|
131
|
+
* @returns {value is string} `true` if the value is a string, otherwise `false`.
|
|
132
|
+
*/
|
|
56
133
|
function isString(value) {
|
|
57
134
|
return typeof value === 'string';
|
|
58
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Checks if the given value is a non-empty string.
|
|
138
|
+
*
|
|
139
|
+
* @param {unknown} value - The value to check.
|
|
140
|
+
* @returns {value is string} `true` if the value is a non-empty string, otherwise `false`.
|
|
141
|
+
*/
|
|
59
142
|
function isNonEmptyString(value) {
|
|
60
143
|
return isString(value) && value.length > 0;
|
|
61
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Checks if the given value is a boolean.
|
|
147
|
+
*
|
|
148
|
+
* @param {unknown} value - The value to check.
|
|
149
|
+
* @returns {value is boolean} `true` if the value is a boolean, otherwise `false`.
|
|
150
|
+
*/
|
|
62
151
|
function isBoolean(value) {
|
|
63
152
|
return value === true || value === false;
|
|
64
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* Checks if the given value is a function.
|
|
156
|
+
*
|
|
157
|
+
* @param {unknown} value - The value to check.
|
|
158
|
+
* @returns {value is CallableFunction} `true` if the value is a function, otherwise `false`.
|
|
159
|
+
*/
|
|
65
160
|
function isFunction(value) {
|
|
66
161
|
return typeof value === 'function';
|
|
67
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* Checks if the given value is present (not null or undefined).
|
|
165
|
+
*
|
|
166
|
+
* @template T - The value type.
|
|
167
|
+
* @param {T | null | undefined} value - The value to check.
|
|
168
|
+
* @returns {value is NonNullable<T>} `true` if the value is present, otherwise `false`.
|
|
169
|
+
*/
|
|
68
170
|
function isPresent(value) {
|
|
69
171
|
return value !== null && value !== undefined;
|
|
70
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* Checks if the given value is a number.
|
|
175
|
+
*
|
|
176
|
+
* @param {unknown} value - The value to check.
|
|
177
|
+
* @returns {value is number} `true` if the value is a number, otherwise `false`.
|
|
178
|
+
*/
|
|
71
179
|
function isNumber(value) {
|
|
72
180
|
return typeof value === 'number';
|
|
73
181
|
}
|
|
74
182
|
|
|
183
|
+
/**
|
|
184
|
+
* Applies a set of CSS styles to an HTML element.
|
|
185
|
+
*
|
|
186
|
+
* @param {HTMLElement} element - The element to apply styles to.
|
|
187
|
+
* @param {Partial<CSSStyleDeclaration | Record<keyof CSSStyleDeclaration, string | null>>} styles - An object containing CSS properties and values to apply.
|
|
188
|
+
*/
|
|
75
189
|
function applyStyles(element, styles) {
|
|
76
190
|
Object.assign(element.style, styles);
|
|
77
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* Converts a boolean value to a corresponding attribute string.
|
|
194
|
+
*
|
|
195
|
+
* @param {boolean} state - The boolean state to convert.
|
|
196
|
+
* @returns {string} 'true' if the state is true; otherwise, 'false'.
|
|
197
|
+
*/
|
|
78
198
|
function booleanToAttributeString(state) {
|
|
79
199
|
return booleanToOptionalAttributeString(state) ?? 'false';
|
|
80
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* Converts a boolean value to 'true' or null, useful for setting attributes based on boolean conditions.
|
|
203
|
+
*
|
|
204
|
+
* @param {boolean} state - The boolean state to convert.
|
|
205
|
+
* @returns {string | null} 'true' if the state is true; otherwise, null.
|
|
206
|
+
*/
|
|
81
207
|
function booleanToOptionalAttributeString(state) {
|
|
82
208
|
return state ? 'true' : null;
|
|
83
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* Converts a numeric value to a pixel string, appending 'px' to the number.
|
|
212
|
+
*
|
|
213
|
+
* @param {unknown} value - The value to convert to pixels.
|
|
214
|
+
* @returns {`${number}px`} The value in pixels, or '0px' if the input is not a number.
|
|
215
|
+
*/
|
|
84
216
|
function px(value) {
|
|
85
217
|
return isNumber(value) ? `${value}px` : '0px';
|
|
86
218
|
}
|
|
219
|
+
/**
|
|
220
|
+
* Generates a CSS translate3d string for given x and y values.
|
|
221
|
+
*
|
|
222
|
+
* @param {string | 0} x - The translation value along the x-axis.
|
|
223
|
+
* @param {string | 0} y - The translation value along the y-axis.
|
|
224
|
+
* @returns {`translate3d(${string | 0}, ${string | 0}, 0)`} The CSS translate3d value.
|
|
225
|
+
*/
|
|
87
226
|
function cssTranslate(x, y) {
|
|
88
227
|
return `translate3d(${x}, ${y}, 0)`;
|
|
89
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* Disables or re-enables CSS transitions on an element.
|
|
231
|
+
*
|
|
232
|
+
* @param {HTMLElement} element - The element to modify.
|
|
233
|
+
* @param {boolean} disabled - Whether to disable CSS transitions.
|
|
234
|
+
*/
|
|
90
235
|
function disableCSSTransitions(element, disabled) {
|
|
91
236
|
if (disabled) {
|
|
92
237
|
applyStyles(element, { transition: 'none' });
|
|
@@ -96,9 +241,21 @@ function disableCSSTransitions(element, disabled) {
|
|
|
96
241
|
applyStyles(element, { transition: null });
|
|
97
242
|
}
|
|
98
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* Forces the browser to reflow the layout, useful for triggering CSS transitions or animations.
|
|
246
|
+
*
|
|
247
|
+
* @param {HTMLElement} element - The element to force a reflow on.
|
|
248
|
+
*/
|
|
99
249
|
function forceLayoutReflow(element) {
|
|
100
250
|
element.offsetHeight;
|
|
101
251
|
}
|
|
252
|
+
/**
|
|
253
|
+
* Sets an attribute on an HTML element, converting the value to a string if necessary.
|
|
254
|
+
*
|
|
255
|
+
* @param {HTMLElement} element - The element to set the attribute on.
|
|
256
|
+
* @param {string} attribute - The name of the attribute to set.
|
|
257
|
+
* @param {unknown} value - The value of the attribute; will be converted to a string if it's not null or undefined.
|
|
258
|
+
*/
|
|
102
259
|
function setAttribute(element, attribute, value) {
|
|
103
260
|
if (isString(value) || isNumber(value)) {
|
|
104
261
|
element.setAttribute(attribute, value.toString());
|
|
@@ -107,6 +264,12 @@ function setAttribute(element, attribute, value) {
|
|
|
107
264
|
element.toggleAttribute(attribute, !!value);
|
|
108
265
|
}
|
|
109
266
|
}
|
|
267
|
+
/**
|
|
268
|
+
* Creates a ResizeObserver instance safely, falling back to a dummy if the API is not supported.
|
|
269
|
+
*
|
|
270
|
+
* @param {ResizeObserverCallback} callback - The callback to execute when an observed element's size changes.
|
|
271
|
+
* @returns {ResizeObserver} A ResizeObserver instance or a dummy object with no-op methods if unsupported.
|
|
272
|
+
*/
|
|
110
273
|
function createResizeObserver(callback) {
|
|
111
274
|
try {
|
|
112
275
|
return new ResizeObserver(callback);
|
|
@@ -115,6 +278,13 @@ function createResizeObserver(callback) {
|
|
|
115
278
|
return { observe: () => void 0, disconnect: () => void 0, unobserve: () => void 0 };
|
|
116
279
|
}
|
|
117
280
|
}
|
|
281
|
+
/**
|
|
282
|
+
* Creates a MutationObserver instance safely, falling back to a dummy if the API is not supported.
|
|
283
|
+
*
|
|
284
|
+
* @param {Subscriber<MutationRecord>} observer - The RxJS Subscriber to emit next values to.
|
|
285
|
+
* @param {(mutations: MutationRecord[]) => boolean} callback - The callback that determines whether to notify the observer based on mutations.
|
|
286
|
+
* @returns {MutationObserver} A MutationObserver instance or a dummy object with no-op methods if unsupported.
|
|
287
|
+
*/
|
|
118
288
|
function createMutationObserver(observer, callback) {
|
|
119
289
|
try {
|
|
120
290
|
return new MutationObserver((mutations) => {
|
|
@@ -127,6 +297,14 @@ function createMutationObserver(observer, callback) {
|
|
|
127
297
|
return { disconnect: () => void 0, observe: () => void 0, takeRecords: () => [] };
|
|
128
298
|
}
|
|
129
299
|
}
|
|
300
|
+
/**
|
|
301
|
+
* Checks whether one element contains another in the DOM tree.
|
|
302
|
+
*
|
|
303
|
+
* @param {Element | null} parent - The parent element.
|
|
304
|
+
* @param {Element | null} other - The element to check for containment.
|
|
305
|
+
* @param {boolean} [inclusive=true] - Whether to consider an element as containing itself.
|
|
306
|
+
* @returns {boolean} True if the parent contains the other element; false otherwise.
|
|
307
|
+
*/
|
|
130
308
|
function containsElement(parent, other, inclusive = true) {
|
|
131
309
|
if (!parent || !other)
|
|
132
310
|
return false;
|
|
@@ -135,6 +313,44 @@ function containsElement(parent, other, inclusive = true) {
|
|
|
135
313
|
return parent.contains(other);
|
|
136
314
|
}
|
|
137
315
|
|
|
316
|
+
/**
|
|
317
|
+
* Creates a MonoTypeOperatorFunction that automatically unsubscribes from observables when the host component or service is destroyed.
|
|
318
|
+
* It uses Angular's `DestroyRef` to detect when the component or service is destroyed and triggers the unsubscription at that point.
|
|
319
|
+
* This utility function helps in managing subscriptions and prevents memory leaks by ensuring observables are unsubscribed when no longer needed.
|
|
320
|
+
*
|
|
321
|
+
* @returns A function that returns a `MonoTypeOperatorFunction<T>`, which can be used in an RxJS pipe to automatically unsubscribe
|
|
322
|
+
* based on the component's or service's lifecycle.
|
|
323
|
+
*
|
|
324
|
+
* @example
|
|
325
|
+
* ```ts
|
|
326
|
+
* // In an Angular component or service
|
|
327
|
+
* import { Component } from '@angular/core';
|
|
328
|
+
* import { Observable } from 'rxjs';
|
|
329
|
+
* import { untilDestroyed } from './path/to/untilDestroyed';
|
|
330
|
+
*
|
|
331
|
+
* @Component({
|
|
332
|
+
* selector: 'app-example',
|
|
333
|
+
* template: `<div>Example Component</div>`,
|
|
334
|
+
* })
|
|
335
|
+
* export class ExampleComponent {
|
|
336
|
+
* private readonly takeUntilDestroyed = untilDestroyed();
|
|
337
|
+
*
|
|
338
|
+
* constructor() {
|
|
339
|
+
* const exampleObservable$ = new Observable(observer => {
|
|
340
|
+
* // Observable logic here
|
|
341
|
+
* });
|
|
342
|
+
*
|
|
343
|
+
* exampleObservable$.pipe(
|
|
344
|
+
* this.takeUntilDestroyed(),
|
|
345
|
+
* ).subscribe(data => {
|
|
346
|
+
* // Subscription logic here
|
|
347
|
+
* });
|
|
348
|
+
* }
|
|
349
|
+
*
|
|
350
|
+
* // No need to manually implement ngOnDestroy to unsubscribe
|
|
351
|
+
* }
|
|
352
|
+
* ```
|
|
353
|
+
*/
|
|
138
354
|
function untilDestroyed() {
|
|
139
355
|
const destroyRef = inject(DestroyRef);
|
|
140
356
|
return () => takeUntilDestroyed(destroyRef);
|
|
@@ -144,12 +360,28 @@ function reactiveBinding(updateFn) {
|
|
|
144
360
|
const takeUntilDestroyed = untilDestroyed();
|
|
145
361
|
return (source$) => source$.pipe(tap((state) => updateFn(state)), takeUntilDestroyed());
|
|
146
362
|
}
|
|
363
|
+
/**
|
|
364
|
+
* Binds an observable to toggle a CSS class on the host element based on the truthiness of the emitted values.
|
|
365
|
+
* The subscription automatically ends when the component is destroyed.
|
|
366
|
+
*
|
|
367
|
+
* @template T The type of items emitted by the source observable.
|
|
368
|
+
* @param {Observable<T> | null | undefined} source$ The observable source emitting truthy or falsy values.
|
|
369
|
+
* @param {string} cssClass The CSS class to toggle based on the emitted values.
|
|
370
|
+
*/
|
|
147
371
|
function reactiveClassBinding(source$, cssClass) {
|
|
148
372
|
const { nativeElement } = injectElement();
|
|
149
373
|
if (source$) {
|
|
150
374
|
source$.pipe(reactiveBinding((state) => nativeElement.classList.toggle(cssClass, !!state))).subscribe();
|
|
151
375
|
}
|
|
152
376
|
}
|
|
377
|
+
/**
|
|
378
|
+
* Binds an observable to update attributes on the host element with the emitted values.
|
|
379
|
+
* The subscription automatically ends when the component is destroyed.
|
|
380
|
+
*
|
|
381
|
+
* @template T The type of items emitted by the source observable.
|
|
382
|
+
* @param {Observable<T> | null | undefined} source$ The observable source.
|
|
383
|
+
* @param {...string[]} attributes The attributes to set on the host element based on the emitted values.
|
|
384
|
+
*/
|
|
153
385
|
function reactiveAttributeBinding(source$, ...attributes) {
|
|
154
386
|
const { nativeElement } = injectElement();
|
|
155
387
|
if (source$) {
|
|
@@ -162,12 +394,32 @@ function reactiveAttributeBinding(source$, ...attributes) {
|
|
|
162
394
|
.subscribe();
|
|
163
395
|
}
|
|
164
396
|
}
|
|
397
|
+
/**
|
|
398
|
+
* Injects the ElementRef of the host element in an Angular component or directive.
|
|
399
|
+
*
|
|
400
|
+
* @template T The expected type of the native element.
|
|
401
|
+
* @returns {ElementRef<T>} The injected ElementRef instance.
|
|
402
|
+
*/
|
|
165
403
|
function injectElement() {
|
|
166
404
|
return inject(ElementRef);
|
|
167
405
|
}
|
|
406
|
+
/**
|
|
407
|
+
* Tracking function for use with `*ngFor` that tracks items by their index.
|
|
408
|
+
*
|
|
409
|
+
* @param {number} index The index of the item in the iterable.
|
|
410
|
+
* @returns {number} The index, used as the trackBy identity.
|
|
411
|
+
*/
|
|
168
412
|
function trackByIndex(index) {
|
|
169
413
|
return index;
|
|
170
414
|
}
|
|
415
|
+
/**
|
|
416
|
+
* Tracking function for use with `*ngFor` that tracks items by their unique ID.
|
|
417
|
+
*
|
|
418
|
+
* @template T The type of the items in the iterable, must have an 'id' property.
|
|
419
|
+
* @param {number} _ The index of the item in the iterable, not used.
|
|
420
|
+
* @param {T} item The item in the iterable.
|
|
421
|
+
* @returns {T['id']} The item's ID, used as the trackBy identity.
|
|
422
|
+
*/
|
|
171
423
|
function trackById(_, { id }) {
|
|
172
424
|
return id;
|
|
173
425
|
}
|
|
@@ -181,8 +433,10 @@ function trackById(_, { id }) {
|
|
|
181
433
|
* @param {K} key - The key whose values are to be plucked from each object in the array.
|
|
182
434
|
* @returns {Array<T[K]>} An array of values corresponding to the specified key from each object.
|
|
183
435
|
* @example
|
|
436
|
+
* ```ts
|
|
184
437
|
* const users = [{ name: 'Alice' }, { name: 'Bob' }];
|
|
185
438
|
* const names = pluckFromArray(users, 'name'); // ['Alice', 'Bob']
|
|
439
|
+
* ```
|
|
186
440
|
*/
|
|
187
441
|
function pluckFromArray(arr, key) {
|
|
188
442
|
return arr.map((value) => value[key]);
|
|
@@ -195,8 +449,10 @@ function pluckFromArray(arr, key) {
|
|
|
195
449
|
* @param {OrderByDirection} [direction='ASC'] - The direction to sort ('ASC' for ascending, 'DESC' for descending).
|
|
196
450
|
* @returns {(a: T, b: T) => number} A compare function that can be used in the array sort method.
|
|
197
451
|
* @example
|
|
452
|
+
* ```ts
|
|
198
453
|
* const items = [{ value: 10 }, { value: 5 }, { value: 7 }];
|
|
199
454
|
* const sortedItems = items.sort(orderBy('value', 'ASC')); // Sorted by value in ascending order
|
|
455
|
+
* ```
|
|
200
456
|
*/
|
|
201
457
|
function orderBy(key, direction = 'ASC') {
|
|
202
458
|
return (a, b) => {
|
|
@@ -218,6 +474,26 @@ function orderBy(key, direction = 'ASC') {
|
|
|
218
474
|
};
|
|
219
475
|
}
|
|
220
476
|
|
|
477
|
+
/**
|
|
478
|
+
* Constructs a URL string from provided segments, ensuring proper slash separation without duplications.
|
|
479
|
+
* It gracefully handles `null`, `undefined`, and symbol values by omitting them from the final URL.
|
|
480
|
+
* Additionally, the function preserves the protocol part of the URL, if specified.
|
|
481
|
+
*
|
|
482
|
+
* @param {...Array<string | number | symbol | null | undefined>} args - The segments to concatenate into a URL.
|
|
483
|
+
* Can be a mix of strings, numbers, symbols (converted to strings), or `null`/`undefined` (which are omitted).
|
|
484
|
+
* @returns {string} The constructed URL string with correctly formatted slashes.
|
|
485
|
+
*
|
|
486
|
+
* @example
|
|
487
|
+
* ```ts
|
|
488
|
+
* // Basic usage
|
|
489
|
+
* console.log(buildUrl('http://example.com', 'path', 'to', 'resource'));
|
|
490
|
+
* // Outputs: "http://example.com/path/to/resource"
|
|
491
|
+
*
|
|
492
|
+
* // Removing duplicate slashes
|
|
493
|
+
* console.log(buildUrl('http://example.com/', '/path/', '//to', '/resource/'));
|
|
494
|
+
* // Outputs: "http://example.com/path/to/resource/"
|
|
495
|
+
* ```
|
|
496
|
+
*/
|
|
221
497
|
function buildUrl(...args) {
|
|
222
498
|
return args.join('/').replace(/(^.*)(https?:\/\/)|(\/)+/g, '$2$3');
|
|
223
499
|
}
|
|
@@ -239,35 +515,87 @@ const DRAEGER_WEBSITE_URL = 'https://www.draeger.com';
|
|
|
239
515
|
* @returns {string} The fully constructed URL, including the base URL and all provided path segments.
|
|
240
516
|
*
|
|
241
517
|
* @example
|
|
518
|
+
* ```ts
|
|
242
519
|
* // Returns 'https://www.draeger.com/about-us'
|
|
243
520
|
* const url = buildWebsiteUrl('about-us');
|
|
244
521
|
*
|
|
245
|
-
* @example
|
|
246
522
|
* // Can also handle multiple segments, returning 'https://www.draeger.com/products/search/123'
|
|
247
523
|
* const productUrl = buildWebsiteUrl('products', 'search', 123);
|
|
524
|
+
* ```
|
|
248
525
|
*/
|
|
249
526
|
function buildWebsiteUrl(...segments) {
|
|
250
527
|
return buildUrl(DRAEGER_WEBSITE_URL, ...segments);
|
|
251
528
|
}
|
|
252
529
|
|
|
530
|
+
/**
|
|
531
|
+
* The HTTP 'Etag' header, used for web cache validation.
|
|
532
|
+
*/
|
|
253
533
|
const HTTP_ETAG_HEADER = 'Etag';
|
|
534
|
+
/**
|
|
535
|
+
* The HTTP 'If-None-Match' header, used in conditional requests to compare against the ETag.
|
|
536
|
+
*/
|
|
254
537
|
const HTTP_IF_NONE_MATCH_HEADER = 'If-None-Match';
|
|
538
|
+
/**
|
|
539
|
+
* The HTTP 'Cache-Control' header, used to specify directives for caching mechanisms in requests and responses.
|
|
540
|
+
*/
|
|
255
541
|
const HTTP_CACHE_CONTROL_HEADER = 'Cache-Control';
|
|
542
|
+
/**
|
|
543
|
+
* A client for managing cache storage for web applications. It simplifies interactions with the Cache Storage API,
|
|
544
|
+
* allowing for the caching, retrieval, and deletion of request responses. This class uses HTTP caching headers to
|
|
545
|
+
* optimize network requests and cache management.
|
|
546
|
+
*
|
|
547
|
+
* @example
|
|
548
|
+
* ```ts
|
|
549
|
+
* // Creating an instance of CacheStorageClient
|
|
550
|
+
* const cacheClient = new CacheStorageClient('my-cache');
|
|
551
|
+
*
|
|
552
|
+
* // Requesting and caching data
|
|
553
|
+
* cacheClient.request('https://api.example.com/data').then(data => {
|
|
554
|
+
* console.log(data);
|
|
555
|
+
* });
|
|
556
|
+
*
|
|
557
|
+
* // Deleting a specific cache entry
|
|
558
|
+
* cacheClient.delete('https://api.example.com/data');
|
|
559
|
+
*
|
|
560
|
+
* // Clearing all cache entries
|
|
561
|
+
* cacheClient.deleteAll();
|
|
562
|
+
* ```
|
|
563
|
+
*/
|
|
256
564
|
class CacheStorageClient {
|
|
257
565
|
constructor(cacheKey, cacheStorage = window.caches) {
|
|
258
566
|
this.cacheKey = cacheKey;
|
|
259
567
|
this.cacheStorage = cacheStorage;
|
|
260
568
|
}
|
|
569
|
+
/**
|
|
570
|
+
* Deletes a specific cache entry.
|
|
571
|
+
*
|
|
572
|
+
* @param {RequestInfo | URL} request - The request or URL to delete from the cache.
|
|
573
|
+
* @returns {Promise<boolean>} A promise that resolves to a boolean indicating whether the deletion was successful.
|
|
574
|
+
*/
|
|
261
575
|
async delete(request) {
|
|
262
576
|
const cache = await this.getCache();
|
|
263
577
|
return cache.delete(request);
|
|
264
578
|
}
|
|
579
|
+
/**
|
|
580
|
+
* Deletes all entries from the cache.
|
|
581
|
+
*
|
|
582
|
+
* @returns {Promise<void>} A promise that resolves when all entries have been deleted.
|
|
583
|
+
*/
|
|
265
584
|
async deleteAll() {
|
|
266
585
|
const cache = await this.getCache();
|
|
267
586
|
for (const key of await cache.keys()) {
|
|
268
587
|
await cache.delete(key);
|
|
269
588
|
}
|
|
270
589
|
}
|
|
590
|
+
/**
|
|
591
|
+
* Performs a request, caching the response if applicable. If a response is cached for the request and still valid,
|
|
592
|
+
* it returns the cached response instead of making a new network request.
|
|
593
|
+
*
|
|
594
|
+
* @template T - The expected response data type.
|
|
595
|
+
* @param {RequestInfo | URL} requestInfo - The request information or URL to fetch and cache.
|
|
596
|
+
* @param {(response: Response) => boolean} [shouldDelete=({ status }) => status >= 400 && status < 500] - An optional function to determine if the cache entry should be deleted based on the response.
|
|
597
|
+
* @returns {Promise<T | null>} A promise that resolves to the response data, or null if the request fails.
|
|
598
|
+
*/
|
|
271
599
|
async request(requestInfo, shouldDelete = ({ status }) => status >= 400 && status < 500) {
|
|
272
600
|
const cache = await this.getCache();
|
|
273
601
|
const request = await this.prepareRequest(cache, requestInfo);
|
|
@@ -303,10 +631,54 @@ class CacheStorageClient {
|
|
|
303
631
|
}
|
|
304
632
|
}
|
|
305
633
|
|
|
634
|
+
/**
|
|
635
|
+
* Coerces a value to an array. If the value is already an array, it is returned directly.
|
|
636
|
+
* If the value is not an array, it is wrapped in an array. This utility is useful for
|
|
637
|
+
* handling values that can be either single values or arrays, ensuring consistent array handling.
|
|
638
|
+
*
|
|
639
|
+
* @param {string | string[]} value - The value to coerce to an array. Can be a single string or an array of strings.
|
|
640
|
+
* @returns {string[]} The coerced value as an array of strings.
|
|
641
|
+
*
|
|
642
|
+
* @example
|
|
643
|
+
* ```ts
|
|
644
|
+
* // Coercing a single string to an array
|
|
645
|
+
* console.log(arrayAttribute('singleValue')); // Outputs: ['singleValue']
|
|
646
|
+
*
|
|
647
|
+
* // Returning an array directly
|
|
648
|
+
* console.log(arrayAttribute(['value1', 'value2'])); // Outputs: ['value1', 'value2']
|
|
649
|
+
* ```
|
|
650
|
+
*/
|
|
306
651
|
function arrayAttribute(value) {
|
|
307
652
|
return coerceArray(value);
|
|
308
653
|
}
|
|
309
654
|
|
|
655
|
+
/**
|
|
656
|
+
* Creates a debounced function that delays invoking the provided function until after `delay` milliseconds
|
|
657
|
+
* have elapsed since the last time the debounced function was invoked. Optionally, the function can be
|
|
658
|
+
* triggered immediately on the first call, then debounced for subsequent calls.
|
|
659
|
+
*
|
|
660
|
+
* @template Args - A tuple representing the types of arguments the `func` accepts.
|
|
661
|
+
* @param {(...args: Args) => void} func - The function to debounce.
|
|
662
|
+
* @param {number} delay - The number of milliseconds to delay.
|
|
663
|
+
* @param {boolean} [immediate=false] - Whether to trigger the function immediately on the first call,
|
|
664
|
+
* and then debounce subsequent calls.
|
|
665
|
+
* @returns {(...args: Args) => void} A new, debounced function.
|
|
666
|
+
*
|
|
667
|
+
* @example
|
|
668
|
+
* ```ts
|
|
669
|
+
* // Example usage with a window resize event
|
|
670
|
+
* const handleResize = debounce(() => {
|
|
671
|
+
* console.log('Window resized');
|
|
672
|
+
* }, 250);
|
|
673
|
+
* window.addEventListener('resize', handleResize);
|
|
674
|
+
*
|
|
675
|
+
* // Example using immediate invocation
|
|
676
|
+
* const processKeyPress = debounce((event) => {
|
|
677
|
+
* console.log('Key pressed:', event.key);
|
|
678
|
+
* }, 200, true);
|
|
679
|
+
* document.addEventListener('keypress', processKeyPress);
|
|
680
|
+
* ```
|
|
681
|
+
*/
|
|
310
682
|
function debounce(func, delay, immediate = false) {
|
|
311
683
|
let timeout = null;
|
|
312
684
|
return function (...args) {
|
|
@@ -328,15 +700,68 @@ function debounce(func, delay, immediate = false) {
|
|
|
328
700
|
};
|
|
329
701
|
}
|
|
330
702
|
|
|
703
|
+
/**
|
|
704
|
+
* Defers the execution of a function until the current call stack is clear.
|
|
705
|
+
* This is achieved by using `setTimeout` with a delay of `0`, effectively placing the function
|
|
706
|
+
* at the end of the event queue and allowing the browser to complete any pending tasks before execution.
|
|
707
|
+
*
|
|
708
|
+
* @param {() => void} fn - The function to be deferred.
|
|
709
|
+
*
|
|
710
|
+
* @example
|
|
711
|
+
* ```ts
|
|
712
|
+
* // Deferring a simple function
|
|
713
|
+
* deferFn(() => console.log('This will be logged after the current execution context completes.'));
|
|
714
|
+
*
|
|
715
|
+
* // Using deferFn to update the UI after a synchronous operation
|
|
716
|
+
* function updateUI() {
|
|
717
|
+
* // UI update logic here
|
|
718
|
+
* }
|
|
719
|
+
* // Assume we're inside a synchronous block of code that updates data
|
|
720
|
+
* deferFn(updateUI); // Ensures UI is updated after data changes are fully applied
|
|
721
|
+
* ```
|
|
722
|
+
*/
|
|
331
723
|
function deferFn(fn) {
|
|
332
724
|
setTimeout(fn, 0);
|
|
333
725
|
}
|
|
334
726
|
|
|
335
727
|
let uniqueIdCache = {};
|
|
728
|
+
/**
|
|
729
|
+
* Generates a unique identifier for a given key. If the key has previously been used,
|
|
730
|
+
* the function increments a counter associated with that key to ensure uniqueness.
|
|
731
|
+
* The generated ID is in the format of `${key}-${counter}`.
|
|
732
|
+
*
|
|
733
|
+
* @param {string} key - The key for which to generate a unique identifier.
|
|
734
|
+
* @returns {string} A unique identifier string based on the provided key.
|
|
735
|
+
*
|
|
736
|
+
* @example
|
|
737
|
+
* ```ts
|
|
738
|
+
* const id1 = getUniqueId('component');
|
|
739
|
+
* console.log(id1); // Outputs: "component-1"
|
|
740
|
+
*
|
|
741
|
+
* const id2 = getUniqueId('component');
|
|
742
|
+
* console.log(id2); // Outputs: "component-2"
|
|
743
|
+
* ```
|
|
744
|
+
*/
|
|
336
745
|
function getUniqueId(key) {
|
|
337
746
|
uniqueIdCache[key] = (uniqueIdCache[key] ?? 0) + 1;
|
|
338
747
|
return `${key}-${uniqueIdCache[key]}`;
|
|
339
748
|
}
|
|
749
|
+
/**
|
|
750
|
+
* Clears the cache used by `getUniqueId` to generate unique identifiers. This function
|
|
751
|
+
* resets all counters associated with each key, effectively restarting the generation
|
|
752
|
+
* of unique IDs from their initial state.
|
|
753
|
+
*
|
|
754
|
+
* This can be useful in scenarios such as testing or when starting a new session that
|
|
755
|
+
* requires resetting the state of unique ID generation.
|
|
756
|
+
*
|
|
757
|
+
* @example
|
|
758
|
+
* ```ts
|
|
759
|
+
* getUniqueId('component'); // Returns "component-1"
|
|
760
|
+
* getUniqueId('component'); // Returns "component-2"
|
|
761
|
+
* clearUniqueIdCache();
|
|
762
|
+
* getUniqueId('component'); // Returns "component-1" after cache reset
|
|
763
|
+
* ```
|
|
764
|
+
*/
|
|
340
765
|
function clearUniqueIdCache() {
|
|
341
766
|
uniqueIdCache = {};
|
|
342
767
|
}
|
|
@@ -412,10 +837,47 @@ const Side = {
|
|
|
412
837
|
LEFT: 'left',
|
|
413
838
|
};
|
|
414
839
|
|
|
840
|
+
/**
|
|
841
|
+
* Extracts the side part from a position string. The position format generally combines
|
|
842
|
+
* a side (e.g., "top", "bottom", "left", "right") with an optional alignment
|
|
843
|
+
* (e.g., "left", "center", "right" for vertical positions or "top", "middle", "bottom" for horizontal positions).
|
|
844
|
+
*
|
|
845
|
+
* @param {Position} position - The position string from which to extract the side.
|
|
846
|
+
* @returns {Side} The side part of the position, indicating the general placement direction.
|
|
847
|
+
*
|
|
848
|
+
* @example
|
|
849
|
+
* ```ts
|
|
850
|
+
* // Extracting the side from a position with alignment
|
|
851
|
+
* console.log(getSide('top-left')); // Outputs: 'top'
|
|
852
|
+
*
|
|
853
|
+
* // Extracting the side from a simple position
|
|
854
|
+
* console.log(getSide('bottom')); // Outputs: 'bottom'
|
|
855
|
+
* ```
|
|
856
|
+
*/
|
|
415
857
|
function getSide(position) {
|
|
416
858
|
return position.split('-')[0];
|
|
417
859
|
}
|
|
418
860
|
|
|
861
|
+
/**
|
|
862
|
+
* Determines the axis associated with a given position. The function first extracts the side from the position,
|
|
863
|
+
* then evaluates whether that side corresponds to the X-axis (left or right) or the Y-axis (top or bottom).
|
|
864
|
+
*
|
|
865
|
+
* @param {Position} position - The position string, which includes a side (top, bottom, left, right) and possibly an alignment.
|
|
866
|
+
* @returns {Axis} The axis (X or Y) associated with the given position's side.
|
|
867
|
+
*
|
|
868
|
+
* @example
|
|
869
|
+
* ```ts
|
|
870
|
+
* // Determining the axis for different positions
|
|
871
|
+
* console.log(getAxis('top-left')); // Outputs: 'Y'
|
|
872
|
+
* console.log(getAxis('right')); // Outputs: 'X'
|
|
873
|
+
*
|
|
874
|
+
* // Using getAxis in UI element positioning logic
|
|
875
|
+
* const elementPosition = 'bottom';
|
|
876
|
+
* const axis = getAxis(elementPosition);
|
|
877
|
+
* // Assuming a function that adjusts UI elements based on the axis
|
|
878
|
+
* adjustElementAlongAxis(axis);
|
|
879
|
+
* ```
|
|
880
|
+
*/
|
|
419
881
|
function getAxis(position) {
|
|
420
882
|
const side = getSide(position);
|
|
421
883
|
switch (side) {
|
|
@@ -428,11 +890,49 @@ function getAxis(position) {
|
|
|
428
890
|
}
|
|
429
891
|
}
|
|
430
892
|
|
|
893
|
+
/**
|
|
894
|
+
* Extracts the language code from a language string that may include both a language and a region code.
|
|
895
|
+
* The function supports language strings formatted with either a hyphen (`-`) or an underscore (`_`) as the separator.
|
|
896
|
+
*
|
|
897
|
+
* @param {string} language - The complete language string, potentially including both language and region codes.
|
|
898
|
+
* @returns {string} The extracted language code, converted to lower case.
|
|
899
|
+
*
|
|
900
|
+
* @example
|
|
901
|
+
* ```ts
|
|
902
|
+
* // Extracting language code from a language-region string
|
|
903
|
+
* console.log(getLanguageCode('en-US')); // Outputs: 'en'
|
|
904
|
+
* console.log(getLanguageCode('zh_CN')); // Outputs: 'zh'
|
|
905
|
+
*
|
|
906
|
+
* // Handling language codes without region codes
|
|
907
|
+
* console.log(getLanguageCode('fr')); // Outputs: 'fr'
|
|
908
|
+
* ```
|
|
909
|
+
*/
|
|
431
910
|
function getLanguageCode(language) {
|
|
432
911
|
const [languageCode] = language.split(/-|_/);
|
|
433
912
|
return languageCode?.toLowerCase();
|
|
434
913
|
}
|
|
435
914
|
|
|
915
|
+
/**
|
|
916
|
+
* Determines the opposite side for a given position. This function is useful for scenarios
|
|
917
|
+
* where you need to dynamically calculate the positioning or alignment opposite to the current one,
|
|
918
|
+
* such as inverting tooltips, popovers, or any UI elements that adjust based on available viewport space.
|
|
919
|
+
*
|
|
920
|
+
* @param {Position} position - The position string, which includes a side and possibly an alignment.
|
|
921
|
+
* @returns {Side} The opposite side relative to the provided position's side.
|
|
922
|
+
*
|
|
923
|
+
* @example
|
|
924
|
+
* ```ts
|
|
925
|
+
* // Getting the opposite side of a given position
|
|
926
|
+
* console.log(getOppositeSide('top-left')); // Outputs: 'bottom'
|
|
927
|
+
* console.log(getOppositeSide('right')); // Outputs: 'left'
|
|
928
|
+
*
|
|
929
|
+
* // Using getOppositeSide to adjust UI elements
|
|
930
|
+
* const currentSide = 'left';
|
|
931
|
+
* const newPosition = getOppositeSide(currentSide);
|
|
932
|
+
* // Assuming an element's position or orientation needs to be dynamically updated
|
|
933
|
+
* updateElementPosition(newPosition);
|
|
934
|
+
* ```
|
|
935
|
+
*/
|
|
436
936
|
function getOppositeSide(position) {
|
|
437
937
|
switch (getSide(position)) {
|
|
438
938
|
case Side.TOP:
|
|
@@ -446,13 +946,82 @@ function getOppositeSide(position) {
|
|
|
446
946
|
}
|
|
447
947
|
}
|
|
448
948
|
|
|
949
|
+
/**
|
|
950
|
+
* Checks if a given value is a valid URL matcher, which can be either a string or a regular expression.
|
|
951
|
+
* This function serves as a type guard to facilitate URL matching operations by verifying the type of the filter.
|
|
952
|
+
*
|
|
953
|
+
* @param {unknown} value - The value to check for being a valid URL matcher.
|
|
954
|
+
* @returns {value is string | RegExp} `true` if the value is a string or RegExp, indicating it can be used for URL matching; otherwise, `false`.
|
|
955
|
+
*
|
|
956
|
+
* @example
|
|
957
|
+
* ```ts
|
|
958
|
+
* // Checking a string URL matcher
|
|
959
|
+
* console.log(isUrlMatcher('https://example.com')); // true
|
|
960
|
+
*
|
|
961
|
+
* // Checking a RegExp URL matcher
|
|
962
|
+
* console.log(isUrlMatcher(/https:\/\/example\.com/)); // true
|
|
963
|
+
*
|
|
964
|
+
* // Checking a non-matcher value
|
|
965
|
+
* console.log(isUrlMatcher(123)); // false
|
|
966
|
+
* ```
|
|
967
|
+
*/
|
|
449
968
|
function isUrlMatcher(value) {
|
|
450
969
|
return isString(value) || value instanceof RegExp;
|
|
451
970
|
}
|
|
971
|
+
/**
|
|
972
|
+
* Determines if a given URL matches a specified filter, which can be either a string or a regular expression.
|
|
973
|
+
* For string filters, the function checks if the URL starts with the filter value. For RegExp filters,
|
|
974
|
+
* it checks if the URL matches the regular expression pattern.
|
|
975
|
+
*
|
|
976
|
+
* @param {string} url - The URL to be checked against the filter.
|
|
977
|
+
* @param {string | RegExp} filter - The filter used to match the URL, which can be a prefix string or a RegExp pattern.
|
|
978
|
+
* @returns {boolean} `true` if the URL matches the filter; otherwise, `false`.
|
|
979
|
+
*
|
|
980
|
+
* @example
|
|
981
|
+
* ```ts
|
|
982
|
+
* // Matching a URL with a string filter
|
|
983
|
+
* console.log(matchUrl('https://example.com/page', 'https://example.com')); // true
|
|
984
|
+
*
|
|
985
|
+
* // Matching a URL with a RegExp filter
|
|
986
|
+
* console.log(matchUrl('https://example.com/page', /example\.com\/page/)); // true
|
|
987
|
+
*
|
|
988
|
+
* // A non-matching example
|
|
989
|
+
* console.log(matchUrl('https://example.com/page', 'https://another.com')); // false
|
|
990
|
+
* ```
|
|
991
|
+
*/
|
|
452
992
|
function matchUrl(url, filter) {
|
|
453
993
|
return isString(filter) ? url.startsWith(filter) : !!url.match(filter);
|
|
454
994
|
}
|
|
455
995
|
|
|
996
|
+
/**
|
|
997
|
+
* Checks if the specified property or properties have changed in the current change detection cycle.
|
|
998
|
+
* Optionally ignores changes that occur during the first change detection cycle (e.g., initialization).
|
|
999
|
+
*
|
|
1000
|
+
* @template U - The component or directive class.
|
|
1001
|
+
* @template T - The type representing the changes, typically `NgChanges<U>`.
|
|
1002
|
+
* @template K - The key or keys representing the properties to check for changes.
|
|
1003
|
+
* @param {T} changes - The `NgChanges` object containing information about all changes.
|
|
1004
|
+
* @param {K | K[]} keyOrKeys - The property name(s) to check for changes.
|
|
1005
|
+
* @param {boolean} [ignoreFirstChange=true] - Whether to ignore changes that occur during the first change detection cycle.
|
|
1006
|
+
* @returns {boolean} `true` if the specified property or properties have changed, otherwise `false`.
|
|
1007
|
+
*
|
|
1008
|
+
* @example
|
|
1009
|
+
* ```ts
|
|
1010
|
+
* // Example usage within an Angular component's `ngOnChanges` method
|
|
1011
|
+
* ngOnChanges(changes: NgChanges<MyComponent>): void {
|
|
1012
|
+
* if (hasChanged(changes, 'name')) {
|
|
1013
|
+
* console.log('Name has changed');
|
|
1014
|
+
* }
|
|
1015
|
+
* }
|
|
1016
|
+
*
|
|
1017
|
+
* // Checking multiple properties for changes
|
|
1018
|
+
* ngOnChanges(changes: NgChanges<MyComponent>): void {
|
|
1019
|
+
* if (hasChanged(changes, ['name', 'age'], false)) {
|
|
1020
|
+
* console.log('Name or age has changed (including first change)');
|
|
1021
|
+
* }
|
|
1022
|
+
* }
|
|
1023
|
+
* ```
|
|
1024
|
+
*/
|
|
456
1025
|
function hasChanged(changes, keyOrKeys, ignoreFirstChange = true) {
|
|
457
1026
|
if (Array.isArray(keyOrKeys)) {
|
|
458
1027
|
for (const key of keyOrKeys) {
|
|
@@ -467,6 +1036,35 @@ function hasChanged(changes, keyOrKeys, ignoreFirstChange = true) {
|
|
|
467
1036
|
}
|
|
468
1037
|
}
|
|
469
1038
|
|
|
1039
|
+
/**
|
|
1040
|
+
* Provides a configuration object or a factory for creating the configuration object, optionally applying a transformation function.
|
|
1041
|
+
* This utility simplifies the process of defining and injecting configuration objects throughout an Angular application.
|
|
1042
|
+
*
|
|
1043
|
+
* @template T - The type of the configuration object.
|
|
1044
|
+
* @template D - The dependencies required by the configuration factory, if any.
|
|
1045
|
+
* @param {InjectionToken<T> | string} token - The injection token or string token associated with the configuration.
|
|
1046
|
+
* @param {ConfigProvider<T, D>} config - The configuration object or a factory provider that produces the configuration.
|
|
1047
|
+
* @param {ConfigTransformFn<T>} [transform=() => ({}))] - An optional transformation function to apply to the configuration object.
|
|
1048
|
+
* @returns {FactoryProvider | ValueProvider} - An Angular provider object for the given configuration.
|
|
1049
|
+
*
|
|
1050
|
+
* @example
|
|
1051
|
+
* ```ts
|
|
1052
|
+
* // Define a simple configuration object
|
|
1053
|
+
* const appConfig = { apiEndpoint: 'https://api.example.com' };
|
|
1054
|
+
*
|
|
1055
|
+
* // Provide the configuration with an optional transformation function
|
|
1056
|
+
* provideConfig(appConfigToken, appConfig, (config) => ({
|
|
1057
|
+
* ...config,
|
|
1058
|
+
* apiEndpoint: `${config.apiEndpoint}/v2`,
|
|
1059
|
+
* }));
|
|
1060
|
+
*
|
|
1061
|
+
* // Using a factory provider for dynamic configuration
|
|
1062
|
+
* provideConfig(appConfigToken, {
|
|
1063
|
+
* useFactory: (envService) => ({ apiEndpoint: envService.getApiEndpoint() }),
|
|
1064
|
+
* deps: [EnvironmentService],
|
|
1065
|
+
* });
|
|
1066
|
+
* ```
|
|
1067
|
+
*/
|
|
470
1068
|
function provideConfig(token, config, transform = () => ({})) {
|
|
471
1069
|
const prepareConfig = (value) => deepmerge(value, transform(value));
|
|
472
1070
|
if ('useFactory' in config) {
|
|
@@ -487,6 +1085,33 @@ function mergeConfig(token, defaultValue) {
|
|
|
487
1085
|
const parentConfig = inject(token, { skipSelf: true, optional: true }) ?? {};
|
|
488
1086
|
return deepmerge(defaultValue, parentConfig, config);
|
|
489
1087
|
}
|
|
1088
|
+
/**
|
|
1089
|
+
* Generates a set of configuration-related tokens and utility functions for managing configuration in an Angular application.
|
|
1090
|
+
* This function creates a standardized way to define, provide, and inject configurations, including defaults and transformations.
|
|
1091
|
+
*
|
|
1092
|
+
* @template T - The type of the configuration object.
|
|
1093
|
+
* @template N - The name of the configuration, used to generate token names and utility functions.
|
|
1094
|
+
* @param {N} name - The name of the configuration.
|
|
1095
|
+
* @param {string} prefix - A prefix for the injection token to ensure uniqueness across the application.
|
|
1096
|
+
* @param {T} defaultValue - The default value for the configuration.
|
|
1097
|
+
* @param {ConfigTransformFn<T>} [transform] - An optional transformation function to be applied to the configuration.
|
|
1098
|
+
* @returns An object containing the generated injection token, default configuration, and utility functions for the configuration.
|
|
1099
|
+
*
|
|
1100
|
+
* @example
|
|
1101
|
+
* ```ts
|
|
1102
|
+
* // Create configuration tokens and utilities for "appConfig" with a default value and optional transform function
|
|
1103
|
+
* const { appConfigConfig, provideAppConfigConfig } = createConfigTokens('appConfig', 'myPrefix', { debug: false }, (config) => ({
|
|
1104
|
+
* ...config,
|
|
1105
|
+
* debug: true, // Enable debug mode by default
|
|
1106
|
+
* }));
|
|
1107
|
+
*
|
|
1108
|
+
* // Later, in a module or component, provide the customized configuration
|
|
1109
|
+
* @NgModule({
|
|
1110
|
+
* providers: [provideAppConfigConfig({ apiEndpoint: 'https://api.example.com' })]
|
|
1111
|
+
* })
|
|
1112
|
+
* class AppModule {}
|
|
1113
|
+
* ```
|
|
1114
|
+
*/
|
|
490
1115
|
function createConfigTokens(name, prefix, defaultValue, transform) {
|
|
491
1116
|
const configName = `${name}Config`;
|
|
492
1117
|
const defaultConfigName = `${name}DefaultConfig`;
|
|
@@ -505,6 +1130,13 @@ function createConfigTokens(name, prefix, defaultValue, transform) {
|
|
|
505
1130
|
function isQueueItemId(value) {
|
|
506
1131
|
return isString(value) || isNumber(value);
|
|
507
1132
|
}
|
|
1133
|
+
/**
|
|
1134
|
+
* A class representing a queue structure with advanced functionalities including adding, removing,
|
|
1135
|
+
* updating items, and observing changes through RxJS observables. It supports generic queue item types,
|
|
1136
|
+
* allowing for flexible usage across different contexts.
|
|
1137
|
+
*
|
|
1138
|
+
* @template T - The type of items stored in the queue. Each item must extend an object containing a unique `id`.
|
|
1139
|
+
*/
|
|
508
1140
|
class Queue {
|
|
509
1141
|
constructor() {
|
|
510
1142
|
this.queue = new Map();
|
|
@@ -512,29 +1144,82 @@ class Queue {
|
|
|
512
1144
|
this.values = [];
|
|
513
1145
|
this.firstItem = null;
|
|
514
1146
|
this.lastItem = null;
|
|
1147
|
+
/**
|
|
1148
|
+
* An observable that emits when an item is added to the queue.
|
|
1149
|
+
* @type {Observable<T>}
|
|
1150
|
+
*/
|
|
515
1151
|
this.onAdd$ = this.createEventObserver('add');
|
|
1152
|
+
/**
|
|
1153
|
+
* An observable that emits when an item in the queue is updated.
|
|
1154
|
+
* @type {Observable<T>}
|
|
1155
|
+
*/
|
|
516
1156
|
this.onUpdate$ = this.createEventObserver('update');
|
|
1157
|
+
/**
|
|
1158
|
+
* An observable that emits when an item is removed from the queue.
|
|
1159
|
+
* @type {Observable<T>}
|
|
1160
|
+
*/
|
|
517
1161
|
this.onRemove$ = this.createEventObserver('remove');
|
|
1162
|
+
/**
|
|
1163
|
+
* An observable representing the current state of the queue as an array of items.
|
|
1164
|
+
* @type {Observable<QueueItem<T>[]>}
|
|
1165
|
+
*/
|
|
518
1166
|
this.value$ = this.events$$.pipe(startWith(() => void 0), map(() => this.values), shareReplay({ bufferSize: 1, refCount: true }));
|
|
1167
|
+
/**
|
|
1168
|
+
* An observable that emits the current size of the queue.
|
|
1169
|
+
* @type {Observable<number>}
|
|
1170
|
+
*/
|
|
519
1171
|
this.size$ = this.value$.pipe(map(() => this.size), distinctUntilChanged(), shareReplay({ bufferSize: 1, refCount: true }));
|
|
520
1172
|
}
|
|
1173
|
+
/**
|
|
1174
|
+
* Gets the size of the queue.
|
|
1175
|
+
* @returns The number of elements in the queue.
|
|
1176
|
+
*/
|
|
521
1177
|
get size() {
|
|
522
1178
|
return this.queue.size;
|
|
523
1179
|
}
|
|
1180
|
+
/**
|
|
1181
|
+
* Checks if the specified item is the first item in the queue.
|
|
1182
|
+
* @param {QueueItem<T>} item - The item to check.
|
|
1183
|
+
* @returns {boolean} - Returns `true` if the item is the first item in the queue, `false` otherwise.
|
|
1184
|
+
*/
|
|
524
1185
|
isFirst({ id }) {
|
|
525
1186
|
return this.firstItem?.id === id;
|
|
526
1187
|
}
|
|
1188
|
+
/**
|
|
1189
|
+
* Checks if the specified item is the last item in the queue.
|
|
1190
|
+
* @param {QueueItem<T>} item - The item to check.
|
|
1191
|
+
* @returns {boolean} - Returns true if the item is the last item, otherwise returns false.
|
|
1192
|
+
*/
|
|
527
1193
|
isLast({ id }) {
|
|
528
1194
|
return this.lastItem?.id === id;
|
|
529
1195
|
}
|
|
1196
|
+
/**
|
|
1197
|
+
* Retrieves a queue item from the queue based on the provided item or item ID.
|
|
1198
|
+
* @param itemOrId - The queue item or item ID to retrieve.
|
|
1199
|
+
* @returns The queue item if found, or `null` if not found.
|
|
1200
|
+
*/
|
|
530
1201
|
get(itemOrId) {
|
|
531
1202
|
const id = isQueueItemId(itemOrId) ? itemOrId.toString() : itemOrId.id.toString();
|
|
532
1203
|
return this.queue.get(id) ?? null;
|
|
533
1204
|
}
|
|
1205
|
+
/**
|
|
1206
|
+
* Adds an item to the queue, optionally emitting an event.
|
|
1207
|
+
*
|
|
1208
|
+
* @param {QueueItem<T>} item - The item to add.
|
|
1209
|
+
* @param {boolean} [emitEvent=true] - Whether to emit an event for this action.
|
|
1210
|
+
* @returns {QueueItem<T>} The item added to the queue.
|
|
1211
|
+
*/
|
|
534
1212
|
add(item, emitEvent = true) {
|
|
535
1213
|
this.remove(item, false);
|
|
536
1214
|
return this.addMany([item], emitEvent)[0];
|
|
537
1215
|
}
|
|
1216
|
+
/**
|
|
1217
|
+
* Adds multiple items to the queue.
|
|
1218
|
+
*
|
|
1219
|
+
* @param items - An array of items to be added to the queue.
|
|
1220
|
+
* @param emitEvent - (Optional) A boolean indicating whether to emit an event after adding the items. Default is true.
|
|
1221
|
+
* @returns An array of added items.
|
|
1222
|
+
*/
|
|
538
1223
|
addMany(items, emitEvent = true) {
|
|
539
1224
|
const addedItems = [];
|
|
540
1225
|
const updatedItems = [];
|
|
@@ -555,9 +1240,22 @@ class Queue {
|
|
|
555
1240
|
}
|
|
556
1241
|
return items;
|
|
557
1242
|
}
|
|
1243
|
+
/**
|
|
1244
|
+
* Removes an item from the queue.
|
|
1245
|
+
*
|
|
1246
|
+
* @param itemOrId - The item or ID of the item to be removed.
|
|
1247
|
+
* @param emitEvent - Whether to emit an event after removing the item. Default is `true`.
|
|
1248
|
+
* @returns The removed item, or `null` if the item was not found.
|
|
1249
|
+
*/
|
|
558
1250
|
remove(itemOrId, emitEvent = true) {
|
|
559
1251
|
return this.removeMany([itemOrId], emitEvent)[0];
|
|
560
1252
|
}
|
|
1253
|
+
/**
|
|
1254
|
+
* Removes multiple items from the queue based on the provided item or item IDs.
|
|
1255
|
+
* @param itemOrIds - An array of QueueItem or QueueItemId objects representing the items to be removed.
|
|
1256
|
+
* @param emitEvent - A boolean indicating whether to emit an event after removing the items. Default is true.
|
|
1257
|
+
* @returns An array of removed QueueItem objects or null values.
|
|
1258
|
+
*/
|
|
561
1259
|
removeMany(itemOrIds, emitEvent = true) {
|
|
562
1260
|
const items = itemOrIds.map((itemOrId) => this.get(itemOrId)).filter(Boolean);
|
|
563
1261
|
const removedItems = [];
|
|
@@ -570,11 +1268,21 @@ class Queue {
|
|
|
570
1268
|
this.notify({ type: 'remove', items: removedItems }, emitEvent);
|
|
571
1269
|
return items;
|
|
572
1270
|
}
|
|
1271
|
+
/**
|
|
1272
|
+
* Clears the queue by removing all items.
|
|
1273
|
+
*
|
|
1274
|
+
* @param emitEvent - Whether to emit an event after clearing the queue. Default is true.
|
|
1275
|
+
*/
|
|
573
1276
|
clear(emitEvent = true) {
|
|
574
1277
|
const items = this.toArray();
|
|
575
1278
|
this.queue.clear();
|
|
576
1279
|
this.notify({ type: 'remove', items }, emitEvent);
|
|
577
1280
|
}
|
|
1281
|
+
/**
|
|
1282
|
+
* Returns an array representation of the queue.
|
|
1283
|
+
*
|
|
1284
|
+
* @returns An array containing all the items in the queue.
|
|
1285
|
+
*/
|
|
578
1286
|
toArray() {
|
|
579
1287
|
return this.values;
|
|
580
1288
|
}
|