@odx/angular 1.0.0-rc.9 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdk/a11y/lib/directives/interactive.directive.d.ts +2 -2
- package/cdk/a11y/lib/directives/list-focus-manager-option.directive.d.ts +1 -2
- package/cdk/active-indicator/lib/models/active-indicator-direction.d.ts +1 -1
- package/cdk/active-indicator/lib/models/active-indicator-position.d.ts +1 -1
- package/cdk/checkbox-control/lib/checkbox-control.directive.d.ts +3 -1
- package/cdk/connected-overlay/lib/connected-overlay.component.d.ts +2 -2
- package/cdk/connected-overlay/lib/helpers/index.d.ts +0 -2
- package/cdk/connected-overlay/lib/models/connected-overlay-options.d.ts +3 -2
- package/cdk/custom-form-control/lib/custom-form-control.d.ts +5 -1
- package/cdk/dynamic-view/lib/facade/dynamic-content.d.ts +3 -3
- package/cdk/dynamic-view/lib/models/dynamic-component-ref.d.ts +1 -0
- package/cdk/radio-group-control/lib/radio-group-control.directive.d.ts +2 -1
- package/components/action-group/action-group.component.d.ts +1 -1
- package/components/area-header/area-header.component.d.ts +1 -1
- package/components/area-header/models/area-header-size.d.ts +1 -1
- package/components/avatar/lib/avatar.component.d.ts +3 -2
- package/components/avatar/lib/models/avatar-size.d.ts +1 -1
- package/components/avatar/lib/models/avatar-variant.d.ts +5 -0
- package/components/avatar/lib/models/index.d.ts +1 -0
- package/components/badge/lib/badge.component.d.ts +7 -17
- package/components/badge/lib/badge.directive.d.ts +16 -12
- package/components/badge/lib/models/badge-variant.d.ts +1 -1
- package/components/badge/lib/models/index.d.ts +0 -1
- package/components/bar/lib/models/bar-button-variant.d.ts +1 -1
- package/components/button/index.d.ts +1 -0
- package/components/button/lib/directives/index.d.ts +1 -0
- package/components/button/lib/directives/responsive-button.directive.d.ts +6 -0
- package/components/button/lib/models/button-size.d.ts +1 -1
- package/components/button/lib/models/button-variant.d.ts +1 -1
- package/components/card/README.md +3 -0
- package/components/card/index.d.ts +5 -0
- package/components/card/lib/card.component.d.ts +20 -0
- package/components/card/lib/card.module.d.ts +16 -0
- package/components/card/lib/components/card-footer/card-footer.component.d.ts +5 -0
- package/components/card/lib/components/index.d.ts +2 -0
- package/components/card/lib/components/launch-card-subtitle/launch-card-subtitle.component.d.ts +5 -0
- package/components/card/lib/directives/card-content.directive.d.ts +5 -0
- package/components/card/lib/directives/card-title.directive.d.ts +5 -0
- package/components/card/lib/directives/index.d.ts +2 -0
- package/components/card/lib/models/card-variant.d.ts +6 -0
- package/components/card/lib/models/index.d.ts +1 -0
- package/components/chip/lib/models/chip-size.d.ts +1 -1
- package/components/chip/lib/models/chip-variant.d.ts +1 -1
- package/components/circular-progress/lib/circular-progress.component.d.ts +2 -1
- package/components/circular-progress/lib/models/circular-progress-size.d.ts +1 -1
- package/components/content-box/lib/content-box.module.d.ts +2 -2
- package/components/content-box/lib/directives/index.d.ts +2 -2
- package/components/dropdown/lib/dropdown.directive.d.ts +3 -2
- package/components/dropdown/lib/models/dropdown-options.d.ts +1 -1
- package/components/form-field/index.d.ts +1 -0
- package/components/form-field/lib/form-field.component.d.ts +8 -3
- package/components/form-field/lib/form-field.config.d.ts +3 -2
- package/components/form-field/lib/form-field.module.d.ts +0 -4
- package/components/form-field/lib/models/form-field-error-resolver.d.ts +1 -1
- package/components/form-field/lib/models/form-field-error.d.ts +1 -0
- package/components/form-field/lib/models/form-field-variant.d.ts +5 -0
- package/components/form-field/lib/models/index.d.ts +1 -0
- package/components/form-field/lib/services/form-field-error.service.d.ts +1 -0
- package/components/header/lib/directives/header-avatar.directive.d.ts +5 -2
- package/components/header/lib/header.component.d.ts +1 -1
- package/components/icon/index.d.ts +1 -0
- package/components/icon/lib/icon.component.d.ts +3 -5
- package/components/icon/lib/icon.config.d.ts +4 -0
- package/components/icon/lib/models/icon-size.d.ts +1 -1
- package/components/inline-message/lib/models/inline-message-variant.d.ts +1 -1
- package/components/list/lib/components/expandable-list-item/expandable-list-item.component.d.ts +14 -0
- package/components/list/lib/components/index.d.ts +1 -0
- package/components/list/lib/list.component.d.ts +4 -2
- package/components/list/lib/list.module.d.ts +3 -2
- package/components/loading-spinner/lib/loading-spinner.directive.d.ts +3 -1
- package/components/logo/models/logo-size.d.ts +1 -1
- package/components/logo/models/logo-variant.d.ts +1 -1
- package/components/main-menu/lib/directives/main-menu-item.directive.d.ts +2 -0
- package/components/mainfilter-group/README.md +3 -0
- package/components/mainfilter-group/index.d.ts +1 -0
- package/components/mainfilter-group/lib/mainfilter-group.component.d.ts +6 -0
- package/components/menu/lib/directives/menu-item.directive.d.ts +1 -2
- package/components/menu/lib/menu.component.d.ts +4 -1
- package/components/menu/lib/menu.directive.d.ts +5 -4
- package/components/modal/index.d.ts +1 -1
- package/components/modal/lib/modal.config.d.ts +2 -2
- package/components/modal/lib/modal.module.d.ts +0 -4
- package/components/modal/lib/modal.service.d.ts +7 -3
- package/components/modal/lib/models/basic-modal-options.d.ts +1 -1
- package/components/modal/lib/models/modal-hero-variant.d.ts +1 -1
- package/components/modal/lib/models/modal-options.d.ts +2 -1
- package/components/modal/lib/models/modal-ref.d.ts +6 -4
- package/components/modal/lib/models/modal-size.d.ts +2 -1
- package/components/modal/lib/models/modal-type.d.ts +1 -1
- package/components/modal/lib/models/modal-variant.d.ts +1 -1
- package/components/navigation-back/README.md +3 -0
- package/components/navigation-back/index.d.ts +1 -0
- package/components/navigation-back/lib/navigation-back.component.d.ts +6 -0
- package/components/select/lib/abstract/select-control-option.d.ts +2 -0
- package/components/select/lib/abstract/select-control.d.ts +1 -0
- package/components/select/lib/components/option/option.component.d.ts +6 -2
- package/components/select/lib/select.component.d.ts +10 -5
- package/components/tab-bar/lib/components/tab-bar-item/tab-bar-item.component.d.ts +5 -2
- package/components/toast/lib/components/toast-item/toast-item.component.d.ts +1 -1
- package/components/toast/lib/models/toast-variant.d.ts +1 -1
- package/components/toast/lib/toast.config.d.ts +2 -2
- package/components/toast/lib/toast.module.d.ts +0 -4
- package/components/toast/lib/toast.service.d.ts +1 -1
- package/components/toggle-button-group/lib/components/toggle-button/toggle-button.component.d.ts +4 -1
- package/components/toggle-button-group/lib/toggle-button-group.component.d.ts +8 -3
- package/components/tooltip/lib/models/tooltip-size.d.ts +1 -1
- package/components/tooltip/lib/models/tooltip-trigger.d.ts +1 -1
- package/components/tooltip/lib/tooltip.component.d.ts +3 -2
- package/components/tooltip/lib/tooltip.directive.d.ts +3 -3
- package/esm2020/animations/lib/expand.mjs +3 -3
- package/esm2020/cdk/a11y/lib/a11y.module.mjs +4 -4
- package/esm2020/cdk/a11y/lib/directives/interactive.directive.mjs +4 -4
- package/esm2020/cdk/a11y/lib/directives/list-focus-manager-option.directive.mjs +5 -7
- package/esm2020/cdk/a11y/lib/directives/list-focus-manager.directive.mjs +3 -3
- package/esm2020/cdk/active-indicator/lib/active-indicator.directive.mjs +3 -3
- package/esm2020/cdk/checkbox-control/lib/checkbox-control.directive.mjs +16 -12
- package/esm2020/cdk/connected-overlay/lib/connected-overlay.component.mjs +8 -8
- package/esm2020/cdk/connected-overlay/lib/connected-overlay.service.mjs +5 -5
- package/esm2020/cdk/connected-overlay/lib/helpers/compute-overlay-position.mjs +4 -6
- package/esm2020/cdk/connected-overlay/lib/helpers/index.mjs +1 -3
- package/esm2020/cdk/connected-overlay/lib/models/connected-overlay-options.mjs +3 -2
- package/esm2020/cdk/custom-form-control/lib/control.directive.mjs +3 -3
- package/esm2020/cdk/custom-form-control/lib/custom-form-control.mjs +44 -20
- package/esm2020/cdk/dynamic-view/lib/dynamic-view.component.mjs +3 -3
- package/esm2020/cdk/dynamic-view/lib/dynamic-view.directive.mjs +7 -5
- package/esm2020/cdk/dynamic-view/lib/dynamic-view.service.mjs +3 -3
- package/esm2020/cdk/dynamic-view/lib/models/dynamic-component-ref.mjs +15 -4
- package/esm2020/cdk/dynamic-view/lib/models/dynamic-template-ref.mjs +2 -2
- package/esm2020/cdk/expandable/lib/directives/expandable-item.directive.mjs +3 -3
- package/esm2020/cdk/expandable/lib/directives/extandable-container.directive.mjs +3 -3
- package/esm2020/cdk/expandable/lib/expandable.module.mjs +4 -4
- package/esm2020/cdk/radio-group-control/lib/radio-control.directive.mjs +10 -10
- package/esm2020/cdk/radio-group-control/lib/radio-group-control.directive.mjs +14 -10
- package/esm2020/cdk/radio-group-control/lib/radio-group-control.module.mjs +4 -4
- package/esm2020/components/accordion/lib/accordion.component.mjs +6 -6
- package/esm2020/components/accordion/lib/accordion.module.mjs +4 -4
- package/esm2020/components/accordion/lib/components/accordion-item/accordion-item.component.mjs +5 -5
- package/esm2020/components/accordion/lib/directives/accordion-item-title.mjs +3 -3
- package/esm2020/components/action-group/action-group.component.mjs +5 -5
- package/esm2020/components/area-header/area-header.component.mjs +7 -6
- package/esm2020/components/area-header/area-header.module.mjs +4 -4
- package/esm2020/components/area-header/directives/area-header-content.directive.mjs +3 -3
- package/esm2020/components/area-header/directives/area-header-subtitle.directive.mjs +3 -3
- package/esm2020/components/avatar/lib/avatar.component.mjs +14 -8
- package/esm2020/components/avatar/lib/models/avatar-variant.mjs +5 -0
- package/esm2020/components/avatar/lib/models/index.mjs +2 -1
- package/esm2020/components/badge/lib/badge.component.mjs +18 -65
- package/esm2020/components/badge/lib/badge.directive.mjs +50 -25
- package/esm2020/components/badge/lib/models/index.mjs +1 -2
- package/esm2020/components/bar/lib/bar.component.mjs +3 -3
- package/esm2020/components/bar/lib/bar.module.mjs +4 -4
- package/esm2020/components/bar/lib/directives/bar-button.directive.mjs +6 -7
- package/esm2020/components/bar/lib/directives/bar-label.directive.mjs +3 -3
- package/esm2020/components/breadcrumbs/lib/breadcrumbs.component.mjs +3 -3
- package/esm2020/components/button/index.mjs +2 -1
- package/esm2020/components/button/lib/button.component.mjs +8 -10
- package/esm2020/components/button/lib/directives/index.mjs +2 -0
- package/esm2020/components/button/lib/directives/responsive-button.directive.mjs +24 -0
- package/esm2020/components/button-group/lib/button-group.component.mjs +3 -3
- package/esm2020/components/card/index.mjs +6 -0
- package/esm2020/components/card/lib/card.component.mjs +67 -0
- package/esm2020/components/card/lib/card.module.mjs +53 -0
- package/esm2020/components/card/lib/components/card-footer/card-footer.component.mjs +13 -0
- package/esm2020/components/card/lib/components/index.mjs +3 -0
- package/esm2020/components/card/lib/components/launch-card-subtitle/launch-card-subtitle.component.mjs +13 -0
- package/esm2020/components/card/lib/directives/card-content.directive.mjs +17 -0
- package/esm2020/components/card/lib/directives/card-title.directive.mjs +17 -0
- package/esm2020/components/card/lib/directives/index.mjs +3 -0
- package/esm2020/components/card/lib/models/card-variant.mjs +6 -0
- package/esm2020/components/card/lib/models/index.mjs +2 -0
- package/esm2020/components/card/odx-angular-components-card.mjs +5 -0
- package/esm2020/components/checkbox/lib/checkbox.component.mjs +5 -5
- package/esm2020/components/checkbox/lib/checkbox.module.mjs +4 -4
- package/esm2020/components/checkbox/lib/checkbox.validator.mjs +3 -3
- package/esm2020/components/chip/lib/chip.component.mjs +5 -5
- package/esm2020/components/circular-progress/lib/circular-progress.component.mjs +8 -6
- package/esm2020/components/content-box/lib/content-box.component.mjs +3 -3
- package/esm2020/components/content-box/lib/content-box.module.mjs +7 -7
- package/esm2020/components/content-box/lib/directives/{content-box-footer-directive.mjs → content-box-footer.directive.mjs} +4 -4
- package/esm2020/components/content-box/lib/directives/{content-box-header-directive.mjs → content-box-header.directive.mjs} +4 -4
- package/esm2020/components/content-box/lib/directives/index.mjs +3 -3
- package/esm2020/components/dropdown/lib/dropdown.component.mjs +3 -3
- package/esm2020/components/dropdown/lib/dropdown.directive.mjs +10 -7
- package/esm2020/components/dropdown/lib/dropdown.module.mjs +4 -4
- package/esm2020/components/dropdown/lib/models/dropdown-options.mjs +3 -2
- package/esm2020/components/form-field/index.mjs +2 -1
- package/esm2020/components/form-field/lib/components/form-field-info/form-field-info.component.mjs +3 -3
- package/esm2020/components/form-field/lib/components/form-group/form-group.component.mjs +3 -3
- package/esm2020/components/form-field/lib/directives/form-field-control.directive.mjs +6 -6
- package/esm2020/components/form-field/lib/directives/form-field-error.directive.mjs +3 -3
- package/esm2020/components/form-field/lib/directives/form-field-hint.directive.mjs +3 -3
- package/esm2020/components/form-field/lib/directives/form-field-label.directive.mjs +3 -3
- package/esm2020/components/form-field/lib/directives/form.directive.mjs +3 -3
- package/esm2020/components/form-field/lib/form-field.component.mjs +32 -15
- package/esm2020/components/form-field/lib/form-field.config.mjs +4 -3
- package/esm2020/components/form-field/lib/form-field.module.mjs +5 -13
- package/esm2020/components/form-field/lib/form-field.service.mjs +3 -3
- package/esm2020/components/form-field/lib/models/form-field-error.mjs +1 -1
- package/esm2020/components/form-field/lib/models/form-field-variant.mjs +5 -0
- package/esm2020/components/form-field/lib/models/index.mjs +2 -1
- package/esm2020/components/form-field/lib/services/form-field-error.service.mjs +16 -16
- package/esm2020/components/header/lib/directives/header-avatar.directive.mjs +13 -6
- package/esm2020/components/header/lib/directives/header-title.directive.mjs +3 -3
- package/esm2020/components/header/lib/header.component.mjs +5 -5
- package/esm2020/components/header/lib/header.module.mjs +4 -4
- package/esm2020/components/icon/index.mjs +2 -1
- package/esm2020/components/icon/lib/icon.component.mjs +12 -21
- package/esm2020/components/icon/lib/icon.config.mjs +5 -0
- package/esm2020/components/inline-message/lib/inline-message.component.mjs +8 -9
- package/esm2020/components/link/link.directive.mjs +3 -3
- package/esm2020/components/list/lib/components/expandable-list-item/expandable-list-item.component.mjs +49 -0
- package/esm2020/components/list/lib/components/index.mjs +2 -1
- package/esm2020/components/list/lib/components/list-item/list-item.component.mjs +3 -3
- package/esm2020/components/list/lib/list.component.mjs +22 -11
- package/esm2020/components/list/lib/list.module.mjs +7 -7
- package/esm2020/components/loading-spinner/lib/loading-spinner.component.mjs +3 -3
- package/esm2020/components/loading-spinner/lib/loading-spinner.directive.mjs +13 -6
- package/esm2020/components/loading-spinner/lib/loading-spinner.module.mjs +4 -4
- package/esm2020/components/logo/logo.directive.mjs +8 -6
- package/esm2020/components/main-menu/lib/directives/main-menu-button.directive.mjs +3 -3
- package/esm2020/components/main-menu/lib/directives/main-menu-item.directive.mjs +13 -5
- package/esm2020/components/main-menu/lib/main-menu.component.mjs +5 -5
- package/esm2020/components/main-menu/lib/main-menu.module.mjs +4 -4
- package/esm2020/components/main-menu/lib/main-menu.service.mjs +3 -3
- package/esm2020/components/mainfilter-group/index.mjs +2 -0
- package/esm2020/components/mainfilter-group/lib/mainfilter-group.component.mjs +21 -0
- package/esm2020/components/mainfilter-group/odx-angular-components-mainfilter-group.mjs +5 -0
- package/esm2020/components/menu/lib/directives/menu-item.directive.mjs +6 -8
- package/esm2020/components/menu/lib/menu.component.mjs +22 -11
- package/esm2020/components/menu/lib/menu.directive.mjs +11 -4
- package/esm2020/components/menu/lib/menu.module.mjs +4 -4
- package/esm2020/components/modal/index.mjs +2 -2
- package/esm2020/components/modal/lib/components/basic-modal/basic-modal.component.mjs +3 -3
- package/esm2020/components/modal/lib/components/modal-footer/modal-footer.component.mjs +3 -3
- package/esm2020/components/modal/lib/components/modal-header/modal-header.component.mjs +5 -5
- package/esm2020/components/modal/lib/components/modal-hero/modal-hero.component.mjs +5 -5
- package/esm2020/components/modal/lib/directives/modal-close.directive.mjs +3 -3
- package/esm2020/components/modal/lib/directives/modal-content.directive.mjs +3 -3
- package/esm2020/components/modal/lib/directives/modal-dismiss.directive.mjs +3 -3
- package/esm2020/components/modal/lib/modal.component.mjs +5 -5
- package/esm2020/components/modal/lib/modal.config.mjs +4 -3
- package/esm2020/components/modal/lib/modal.directive.mjs +3 -3
- package/esm2020/components/modal/lib/modal.module.mjs +5 -13
- package/esm2020/components/modal/lib/modal.service.mjs +37 -26
- package/esm2020/components/modal/lib/models/modal-options.mjs +1 -1
- package/esm2020/components/modal/lib/models/modal-ref.mjs +20 -12
- package/esm2020/components/modal/lib/models/modal-size.mjs +2 -1
- package/esm2020/components/navigation-back/index.mjs +2 -0
- package/esm2020/components/navigation-back/lib/navigation-back.component.mjs +22 -0
- package/esm2020/components/navigation-back/odx-angular-components-navigation-back.mjs +5 -0
- package/esm2020/components/progress/lib/progress.component.mjs +3 -3
- package/esm2020/components/radio-group/lib/components/radio-button/radio-button.component.mjs +3 -3
- package/esm2020/components/radio-group/lib/radio-group.component.mjs +7 -7
- package/esm2020/components/radio-group/lib/radio-group.module.mjs +4 -4
- package/esm2020/components/rail-navigation/lib/components/rail-navigation-item.component.mjs +5 -5
- package/esm2020/components/rail-navigation/lib/rail-navigation.component.mjs +3 -3
- package/esm2020/components/rail-navigation/lib/rail-navigation.module.mjs +4 -4
- package/esm2020/components/select/lib/abstract/select-control-option.mjs +1 -1
- package/esm2020/components/select/lib/abstract/select-control.mjs +1 -1
- package/esm2020/components/select/lib/components/option/option.component.mjs +37 -20
- package/esm2020/components/select/lib/directives/select-search-field.directive.mjs +3 -3
- package/esm2020/components/select/lib/pipes/select-search-filter.pipe.mjs +3 -3
- package/esm2020/components/select/lib/select.component.mjs +82 -35
- package/esm2020/components/select/lib/select.module.mjs +4 -4
- package/esm2020/components/slider/lib/slider.directive.mjs +3 -3
- package/esm2020/components/spinbox/lib/spinbox.component.mjs +8 -8
- package/esm2020/components/switch/lib/switch.component.mjs +5 -5
- package/esm2020/components/switch/lib/switch.module.mjs +4 -4
- package/esm2020/components/switch/lib/switch.validator.mjs +3 -3
- package/esm2020/components/tab-bar/lib/components/tab-bar-item/tab-bar-item.component.mjs +15 -6
- package/esm2020/components/tab-bar/lib/tab-bar.component.mjs +7 -7
- package/esm2020/components/tab-bar/lib/tab-bar.module.mjs +4 -4
- package/esm2020/components/toast/lib/components/toast-container/toast-container.component.mjs +3 -3
- package/esm2020/components/toast/lib/components/toast-item/toast-item.component.mjs +9 -8
- package/esm2020/components/toast/lib/toast.config.mjs +3 -3
- package/esm2020/components/toast/lib/toast.module.mjs +5 -13
- package/esm2020/components/toast/lib/toast.service.mjs +7 -7
- package/esm2020/components/toggle-button-group/lib/components/toggle-button/toggle-button.component.mjs +13 -7
- package/esm2020/components/toggle-button-group/lib/toggle-button-group.component.mjs +23 -12
- package/esm2020/components/toggle-button-group/lib/toggle-button-group.module.mjs +4 -4
- package/esm2020/components/tooltip/lib/tooltip.component.mjs +4 -4
- package/esm2020/components/tooltip/lib/tooltip.directive.mjs +11 -12
- package/esm2020/internal/decorators/css-component.mjs +3 -8
- package/esm2020/internal/decorators/css-modifier.mjs +21 -18
- package/esm2020/internal/helpers/decorator-property-name.mjs +4 -0
- package/esm2020/internal/helpers/deepmerge.mjs +6 -0
- package/esm2020/internal/helpers/index.mjs +3 -1
- package/esm2020/internal/helpers/with-mutiple-descriptors.mjs +22 -13
- package/esm2020/lib/controllers/controller.mjs +3 -3
- package/esm2020/lib/controllers/disabled.controller.mjs +26 -20
- package/esm2020/lib/controllers/readonly.controller.mjs +30 -21
- package/esm2020/lib/core.module.mjs +9 -8
- package/esm2020/lib/directives/click-outside.directive.mjs +15 -12
- package/esm2020/lib/directives/delegate-focus.directive.mjs +40 -0
- package/esm2020/lib/directives/index.mjs +2 -2
- package/esm2020/lib/directives/with-disabled-state.directive.mjs +9 -9
- package/esm2020/lib/directives/with-tabindex.directive.mjs +3 -3
- package/esm2020/lib/services/window-ref.mjs +13 -6
- package/esm2020/theming/index.mjs +5 -0
- package/esm2020/theming/lib/helpers/index.mjs +4 -0
- package/esm2020/theming/lib/helpers/prefers-dark-theme.mjs +4 -0
- package/esm2020/theming/lib/helpers/resolve-theme.mjs +5 -0
- package/esm2020/theming/lib/helpers/theme-storage.mjs +19 -0
- package/esm2020/theming/lib/models/index.mjs +2 -0
- package/esm2020/theming/lib/models/theme.mjs +6 -0
- package/esm2020/theming/lib/theming.config.mjs +21 -0
- package/esm2020/theming/lib/theming.service.mjs +42 -0
- package/esm2020/theming/odx-angular-theming.mjs +5 -0
- package/esm2020/utils/lib/decorators/transform.mjs +3 -3
- package/esm2020/utils/lib/helpers/build-url.mjs +4 -0
- package/esm2020/utils/lib/helpers/dom.mjs +2 -2
- package/esm2020/utils/lib/helpers/event-manager.mjs +3 -3
- package/esm2020/utils/lib/helpers/get-axis.mjs +14 -0
- package/esm2020/utils/lib/helpers/get-opposite-side.mjs +15 -0
- package/esm2020/utils/lib/helpers/get-side.mjs +4 -0
- package/esm2020/utils/lib/helpers/index.mjs +6 -2
- package/esm2020/utils/lib/helpers/provide-config.mjs +25 -0
- package/esm2020/utils/lib/helpers/queue.mjs +36 -11
- package/esm2020/utils/lib/types/axis.mjs +5 -0
- package/esm2020/utils/lib/types/index.mjs +4 -1
- package/esm2020/utils/lib/types/position.mjs +15 -0
- package/esm2020/utils/lib/types/side.mjs +7 -0
- package/fesm2015/odx-angular-animations.mjs +2 -2
- package/fesm2015/odx-angular-animations.mjs.map +1 -1
- package/fesm2015/odx-angular-cdk-a11y.mjs +13 -14
- package/fesm2015/odx-angular-cdk-a11y.mjs.map +1 -1
- package/fesm2015/odx-angular-cdk-active-indicator.mjs +3 -3
- package/fesm2015/odx-angular-cdk-checkbox-control.mjs +16 -12
- package/fesm2015/odx-angular-cdk-checkbox-control.mjs.map +1 -1
- package/fesm2015/odx-angular-cdk-connected-overlay.mjs +13 -31
- package/fesm2015/odx-angular-cdk-connected-overlay.mjs.map +1 -1
- package/fesm2015/odx-angular-cdk-custom-form-control.mjs +47 -24
- package/fesm2015/odx-angular-cdk-custom-form-control.mjs.map +1 -1
- package/fesm2015/odx-angular-cdk-dynamic-view.mjs +26 -12
- package/fesm2015/odx-angular-cdk-dynamic-view.mjs.map +1 -1
- package/fesm2015/odx-angular-cdk-expandable.mjs +10 -10
- package/fesm2015/odx-angular-cdk-radio-group-control.mjs +26 -23
- package/fesm2015/odx-angular-cdk-radio-group-control.mjs.map +1 -1
- package/fesm2015/odx-angular-components-accordion.mjs +16 -16
- package/fesm2015/odx-angular-components-accordion.mjs.map +1 -1
- package/fesm2015/odx-angular-components-action-group.mjs +4 -4
- package/fesm2015/odx-angular-components-action-group.mjs.map +1 -1
- package/fesm2015/odx-angular-components-area-header.mjs +16 -15
- package/fesm2015/odx-angular-components-area-header.mjs.map +1 -1
- package/fesm2015/odx-angular-components-avatar.mjs +18 -7
- package/fesm2015/odx-angular-components-avatar.mjs.map +1 -1
- package/fesm2015/odx-angular-components-badge.mjs +63 -97
- package/fesm2015/odx-angular-components-badge.mjs.map +1 -1
- package/fesm2015/odx-angular-components-bar.mjs +15 -16
- package/fesm2015/odx-angular-components-bar.mjs.map +1 -1
- package/fesm2015/odx-angular-components-breadcrumbs.mjs +3 -3
- package/fesm2015/odx-angular-components-button-group.mjs +3 -3
- package/fesm2015/odx-angular-components-button.mjs +31 -11
- package/fesm2015/odx-angular-components-button.mjs.map +1 -1
- package/fesm2015/odx-angular-components-card.mjs +174 -0
- package/fesm2015/odx-angular-components-card.mjs.map +1 -0
- package/fesm2015/odx-angular-components-checkbox.mjs +11 -11
- package/fesm2015/odx-angular-components-checkbox.mjs.map +1 -1
- package/fesm2015/odx-angular-components-chip.mjs +4 -4
- package/fesm2015/odx-angular-components-chip.mjs.map +1 -1
- package/fesm2015/odx-angular-components-circular-progress.mjs +7 -5
- package/fesm2015/odx-angular-components-circular-progress.mjs.map +1 -1
- package/fesm2015/odx-angular-components-content-box.mjs +13 -13
- package/fesm2015/odx-angular-components-content-box.mjs.map +1 -1
- package/fesm2015/odx-angular-components-dropdown.mjs +18 -14
- package/fesm2015/odx-angular-components-dropdown.mjs.map +1 -1
- package/fesm2015/odx-angular-components-form-field.mjs +80 -64
- package/fesm2015/odx-angular-components-form-field.mjs.map +1 -1
- package/fesm2015/odx-angular-components-header.mjs +23 -17
- package/fesm2015/odx-angular-components-header.mjs.map +1 -1
- package/fesm2015/odx-angular-components-icon.mjs +16 -22
- package/fesm2015/odx-angular-components-icon.mjs.map +1 -1
- package/fesm2015/odx-angular-components-inline-message.mjs +7 -8
- package/fesm2015/odx-angular-components-inline-message.mjs.map +1 -1
- package/fesm2015/odx-angular-components-link.mjs +3 -3
- package/fesm2015/odx-angular-components-list.mjs +70 -20
- package/fesm2015/odx-angular-components-list.mjs.map +1 -1
- package/fesm2015/odx-angular-components-loading-spinner.mjs +21 -13
- package/fesm2015/odx-angular-components-loading-spinner.mjs.map +1 -1
- package/fesm2015/odx-angular-components-logo.mjs +7 -5
- package/fesm2015/odx-angular-components-logo.mjs.map +1 -1
- package/fesm2015/odx-angular-components-main-menu.mjs +57 -49
- package/fesm2015/odx-angular-components-main-menu.mjs.map +1 -1
- package/fesm2015/odx-angular-components-mainfilter-group.mjs +27 -0
- package/fesm2015/odx-angular-components-mainfilter-group.mjs.map +1 -0
- package/fesm2015/odx-angular-components-menu.mjs +41 -24
- package/fesm2015/odx-angular-components-menu.mjs.map +1 -1
- package/fesm2015/odx-angular-components-modal.mjs +91 -118
- package/fesm2015/odx-angular-components-modal.mjs.map +1 -1
- package/fesm2015/odx-angular-components-navigation-back.mjs +28 -0
- package/fesm2015/odx-angular-components-navigation-back.mjs.map +1 -0
- package/fesm2015/odx-angular-components-progress.mjs +3 -3
- package/fesm2015/odx-angular-components-radio-group.mjs +13 -13
- package/fesm2015/odx-angular-components-radio-group.mjs.map +1 -1
- package/fesm2015/odx-angular-components-rail-navigation.mjs +11 -11
- package/fesm2015/odx-angular-components-rail-navigation.mjs.map +1 -1
- package/fesm2015/odx-angular-components-select.mjs +126 -68
- package/fesm2015/odx-angular-components-select.mjs.map +1 -1
- package/fesm2015/odx-angular-components-slider.mjs +3 -3
- package/fesm2015/odx-angular-components-spinbox.mjs +8 -8
- package/fesm2015/odx-angular-components-spinbox.mjs.map +1 -1
- package/fesm2015/odx-angular-components-switch.mjs +11 -11
- package/fesm2015/odx-angular-components-switch.mjs.map +1 -1
- package/fesm2015/odx-angular-components-tab-bar.mjs +25 -16
- package/fesm2015/odx-angular-components-tab-bar.mjs.map +1 -1
- package/fesm2015/odx-angular-components-toast.mjs +23 -29
- package/fesm2015/odx-angular-components-toast.mjs.map +1 -1
- package/fesm2015/odx-angular-components-toggle-button-group.mjs +40 -20
- package/fesm2015/odx-angular-components-toggle-button-group.mjs.map +1 -1
- package/fesm2015/odx-angular-components-tooltip.mjs +13 -14
- package/fesm2015/odx-angular-components-tooltip.mjs.map +1 -1
- package/fesm2015/odx-angular-internal.mjs +69 -53
- package/fesm2015/odx-angular-internal.mjs.map +1 -1
- package/fesm2015/odx-angular-theming.mjs +99 -0
- package/fesm2015/odx-angular-theming.mjs.map +1 -0
- package/fesm2015/odx-angular-utils.mjs +119 -25
- package/fesm2015/odx-angular-utils.mjs.map +1 -1
- package/fesm2015/odx-angular.mjs +134 -102
- package/fesm2015/odx-angular.mjs.map +1 -1
- package/fesm2020/odx-angular-animations.mjs +2 -2
- package/fesm2020/odx-angular-animations.mjs.map +1 -1
- package/fesm2020/odx-angular-cdk-a11y.mjs +13 -14
- package/fesm2020/odx-angular-cdk-a11y.mjs.map +1 -1
- package/fesm2020/odx-angular-cdk-active-indicator.mjs +3 -3
- package/fesm2020/odx-angular-cdk-checkbox-control.mjs +16 -12
- package/fesm2020/odx-angular-cdk-checkbox-control.mjs.map +1 -1
- package/fesm2020/odx-angular-cdk-connected-overlay.mjs +13 -31
- package/fesm2020/odx-angular-cdk-connected-overlay.mjs.map +1 -1
- package/fesm2020/odx-angular-cdk-custom-form-control.mjs +47 -24
- package/fesm2020/odx-angular-cdk-custom-form-control.mjs.map +1 -1
- package/fesm2020/odx-angular-cdk-dynamic-view.mjs +25 -12
- package/fesm2020/odx-angular-cdk-dynamic-view.mjs.map +1 -1
- package/fesm2020/odx-angular-cdk-expandable.mjs +10 -10
- package/fesm2020/odx-angular-cdk-radio-group-control.mjs +26 -23
- package/fesm2020/odx-angular-cdk-radio-group-control.mjs.map +1 -1
- package/fesm2020/odx-angular-components-accordion.mjs +16 -16
- package/fesm2020/odx-angular-components-accordion.mjs.map +1 -1
- package/fesm2020/odx-angular-components-action-group.mjs +4 -4
- package/fesm2020/odx-angular-components-action-group.mjs.map +1 -1
- package/fesm2020/odx-angular-components-area-header.mjs +16 -15
- package/fesm2020/odx-angular-components-area-header.mjs.map +1 -1
- package/fesm2020/odx-angular-components-avatar.mjs +18 -7
- package/fesm2020/odx-angular-components-avatar.mjs.map +1 -1
- package/fesm2020/odx-angular-components-badge.mjs +60 -90
- package/fesm2020/odx-angular-components-badge.mjs.map +1 -1
- package/fesm2020/odx-angular-components-bar.mjs +15 -16
- package/fesm2020/odx-angular-components-bar.mjs.map +1 -1
- package/fesm2020/odx-angular-components-breadcrumbs.mjs +3 -3
- package/fesm2020/odx-angular-components-button-group.mjs +3 -3
- package/fesm2020/odx-angular-components-button.mjs +31 -11
- package/fesm2020/odx-angular-components-button.mjs.map +1 -1
- package/fesm2020/odx-angular-components-card.mjs +173 -0
- package/fesm2020/odx-angular-components-card.mjs.map +1 -0
- package/fesm2020/odx-angular-components-checkbox.mjs +11 -11
- package/fesm2020/odx-angular-components-checkbox.mjs.map +1 -1
- package/fesm2020/odx-angular-components-chip.mjs +4 -4
- package/fesm2020/odx-angular-components-chip.mjs.map +1 -1
- package/fesm2020/odx-angular-components-circular-progress.mjs +7 -5
- package/fesm2020/odx-angular-components-circular-progress.mjs.map +1 -1
- package/fesm2020/odx-angular-components-content-box.mjs +13 -13
- package/fesm2020/odx-angular-components-content-box.mjs.map +1 -1
- package/fesm2020/odx-angular-components-dropdown.mjs +18 -14
- package/fesm2020/odx-angular-components-dropdown.mjs.map +1 -1
- package/fesm2020/odx-angular-components-form-field.mjs +79 -64
- package/fesm2020/odx-angular-components-form-field.mjs.map +1 -1
- package/fesm2020/odx-angular-components-header.mjs +23 -17
- package/fesm2020/odx-angular-components-header.mjs.map +1 -1
- package/fesm2020/odx-angular-components-icon.mjs +16 -22
- package/fesm2020/odx-angular-components-icon.mjs.map +1 -1
- package/fesm2020/odx-angular-components-inline-message.mjs +7 -8
- package/fesm2020/odx-angular-components-inline-message.mjs.map +1 -1
- package/fesm2020/odx-angular-components-link.mjs +3 -3
- package/fesm2020/odx-angular-components-list.mjs +69 -20
- package/fesm2020/odx-angular-components-list.mjs.map +1 -1
- package/fesm2020/odx-angular-components-loading-spinner.mjs +20 -13
- package/fesm2020/odx-angular-components-loading-spinner.mjs.map +1 -1
- package/fesm2020/odx-angular-components-logo.mjs +7 -5
- package/fesm2020/odx-angular-components-logo.mjs.map +1 -1
- package/fesm2020/odx-angular-components-main-menu.mjs +56 -49
- package/fesm2020/odx-angular-components-main-menu.mjs.map +1 -1
- package/fesm2020/odx-angular-components-mainfilter-group.mjs +27 -0
- package/fesm2020/odx-angular-components-mainfilter-group.mjs.map +1 -0
- package/fesm2020/odx-angular-components-menu.mjs +41 -24
- package/fesm2020/odx-angular-components-menu.mjs.map +1 -1
- package/fesm2020/odx-angular-components-modal.mjs +90 -116
- package/fesm2020/odx-angular-components-modal.mjs.map +1 -1
- package/fesm2020/odx-angular-components-navigation-back.mjs +28 -0
- package/fesm2020/odx-angular-components-navigation-back.mjs.map +1 -0
- package/fesm2020/odx-angular-components-progress.mjs +3 -3
- package/fesm2020/odx-angular-components-radio-group.mjs +13 -13
- package/fesm2020/odx-angular-components-radio-group.mjs.map +1 -1
- package/fesm2020/odx-angular-components-rail-navigation.mjs +11 -11
- package/fesm2020/odx-angular-components-rail-navigation.mjs.map +1 -1
- package/fesm2020/odx-angular-components-select.mjs +126 -62
- package/fesm2020/odx-angular-components-select.mjs.map +1 -1
- package/fesm2020/odx-angular-components-slider.mjs +3 -3
- package/fesm2020/odx-angular-components-spinbox.mjs +7 -7
- package/fesm2020/odx-angular-components-spinbox.mjs.map +1 -1
- package/fesm2020/odx-angular-components-switch.mjs +11 -11
- package/fesm2020/odx-angular-components-switch.mjs.map +1 -1
- package/fesm2020/odx-angular-components-tab-bar.mjs +24 -16
- package/fesm2020/odx-angular-components-tab-bar.mjs.map +1 -1
- package/fesm2020/odx-angular-components-toast.mjs +23 -29
- package/fesm2020/odx-angular-components-toast.mjs.map +1 -1
- package/fesm2020/odx-angular-components-toggle-button-group.mjs +37 -20
- package/fesm2020/odx-angular-components-toggle-button-group.mjs.map +1 -1
- package/fesm2020/odx-angular-components-tooltip.mjs +13 -14
- package/fesm2020/odx-angular-components-tooltip.mjs.map +1 -1
- package/fesm2020/odx-angular-internal.mjs +67 -51
- package/fesm2020/odx-angular-internal.mjs.map +1 -1
- package/fesm2020/odx-angular-theming.mjs +96 -0
- package/fesm2020/odx-angular-theming.mjs.map +1 -0
- package/fesm2020/odx-angular-utils.mjs +115 -27
- package/fesm2020/odx-angular-utils.mjs.map +1 -1
- package/fesm2020/odx-angular.mjs +129 -98
- package/fesm2020/odx-angular.mjs.map +1 -1
- package/internal/decorators/css-component.d.ts +1 -2
- package/internal/decorators/css-modifier.d.ts +0 -1
- package/internal/helpers/decorator-property-name.d.ts +1 -0
- package/internal/helpers/deepmerge.d.ts +10 -0
- package/internal/helpers/index.d.ts +2 -0
- package/internal/helpers/with-mutiple-descriptors.d.ts +1 -1
- package/lib/controllers/disabled.controller.d.ts +5 -2
- package/lib/controllers/readonly.controller.d.ts +1 -0
- package/lib/core.module.d.ts +3 -3
- package/lib/directives/click-outside.directive.d.ts +2 -3
- package/lib/directives/delegate-focus.directive.d.ts +11 -0
- package/lib/directives/index.d.ts +1 -1
- package/lib/services/window-ref.d.ts +3 -0
- package/lib/tokens/identity-matcher.d.ts +1 -1
- package/lib/tokens/string-search-handler.d.ts +1 -1
- package/lib/tokens/stringify.d.ts +1 -1
- package/package.json +37 -11
- package/theming/README.md +3 -0
- package/theming/index.d.ts +4 -0
- package/theming/lib/helpers/index.d.ts +3 -0
- package/theming/lib/helpers/prefers-dark-theme.d.ts +1 -0
- package/theming/lib/helpers/resolve-theme.d.ts +2 -0
- package/theming/lib/helpers/theme-storage.d.ts +4 -0
- package/theming/lib/models/index.d.ts +1 -0
- package/theming/lib/models/theme.d.ts +6 -0
- package/theming/lib/theming.config.d.ts +10 -0
- package/theming/lib/theming.service.d.ts +16 -0
- package/utils/lib/decorators/transform.d.ts +2 -2
- package/utils/lib/helpers/build-url.d.ts +1 -0
- package/utils/lib/helpers/get-axis.d.ts +2 -0
- package/utils/lib/helpers/get-opposite-side.d.ts +2 -0
- package/utils/lib/helpers/get-side.d.ts +2 -0
- package/utils/lib/helpers/index.d.ts +5 -1
- package/utils/lib/helpers/ng-changes.d.ts +1 -1
- package/utils/lib/helpers/provide-config.d.ts +12 -0
- package/utils/lib/helpers/queue.d.ts +13 -2
- package/utils/lib/types/axis.d.ts +5 -0
- package/utils/lib/types/get-properties.d.ts +2 -2
- package/utils/lib/types/index.d.ts +3 -0
- package/utils/lib/types/position.d.ts +15 -0
- package/utils/lib/types/side.d.ts +7 -0
- package/cdk/connected-overlay/lib/helpers/get-opposite-overlay-side.d.ts +0 -2
- package/cdk/connected-overlay/lib/helpers/get-overlay-side.d.ts +0 -2
- package/components/badge/lib/badge.config.d.ts +0 -3
- package/components/badge/lib/facade/badge-host.d.ts +0 -3
- package/components/badge/lib/facade/index.d.ts +0 -1
- package/components/badge/lib/models/badge-position.d.ts +0 -5
- package/components/launch-tile/README.md +0 -3
- package/components/launch-tile/index.d.ts +0 -3
- package/components/launch-tile/lib/components/index.d.ts +0 -2
- package/components/launch-tile/lib/components/launch-tile-footer/launch-tile-footer.component.d.ts +0 -5
- package/components/launch-tile/lib/components/launch-tile-subtitle/launch-tile-subtitle.component.d.ts +0 -5
- package/components/launch-tile/lib/launch-tile.component.d.ts +0 -13
- package/components/launch-tile/lib/launch-tile.module.d.ts +0 -14
- package/components/modal/lib/services/index.d.ts +0 -1
- package/components/modal/lib/services/open-modal-manager.service.d.ts +0 -15
- package/esm2020/cdk/connected-overlay/lib/helpers/get-opposite-overlay-side.mjs +0 -13
- package/esm2020/cdk/connected-overlay/lib/helpers/get-overlay-side.mjs +0 -4
- package/esm2020/components/badge/lib/badge.config.mjs +0 -3
- package/esm2020/components/badge/lib/facade/badge-host.mjs +0 -2
- package/esm2020/components/badge/lib/facade/index.mjs +0 -2
- package/esm2020/components/badge/lib/models/badge-position.mjs +0 -5
- package/esm2020/components/launch-tile/index.mjs +0 -4
- package/esm2020/components/launch-tile/lib/components/index.mjs +0 -3
- package/esm2020/components/launch-tile/lib/components/launch-tile-footer/launch-tile-footer.component.mjs +0 -13
- package/esm2020/components/launch-tile/lib/components/launch-tile-subtitle/launch-tile-subtitle.component.mjs +0 -13
- package/esm2020/components/launch-tile/lib/launch-tile.component.mjs +0 -51
- package/esm2020/components/launch-tile/lib/launch-tile.module.mjs +0 -23
- package/esm2020/components/launch-tile/odx-angular-components-launch-tile.mjs +0 -5
- package/esm2020/components/modal/lib/services/index.mjs +0 -2
- package/esm2020/components/modal/lib/services/open-modal-manager.service.mjs +0 -42
- package/esm2020/lib/directives/let.directive.mjs +0 -36
- package/esm2020/utils/lib/helpers/provide-module-config.mjs +0 -21
- package/fesm2015/odx-angular-components-launch-tile.mjs +0 -95
- package/fesm2015/odx-angular-components-launch-tile.mjs.map +0 -1
- package/fesm2020/odx-angular-components-launch-tile.mjs +0 -94
- package/fesm2020/odx-angular-components-launch-tile.mjs.map +0 -1
- package/lib/directives/let.directive.d.ts +0 -17
- package/utils/lib/helpers/provide-module-config.d.ts +0 -12
- /package/components/content-box/lib/directives/{content-box-footer-directive.d.ts → content-box-footer.directive.d.ts} +0 -0
- /package/components/content-box/lib/directives/{content-box-header-directive.d.ts → content-box-header.directive.d.ts} +0 -0
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const CSS_COMPONENT_MODIFIERS = Symbol('__CSSComponentModifiers__');
|
|
3
|
-
/** @internal */
|
|
4
|
-
/* istanbul ignore next */
|
|
5
|
-
function CSSComponent(name, prefix = 'odx') {
|
|
6
|
-
return (target) => {
|
|
7
|
-
const cssClass = `${prefix}-${name}`;
|
|
8
|
-
Object.defineProperty(target.prototype, CSS_COMPONENT_NAME, {
|
|
9
|
-
value: cssClass,
|
|
10
|
-
});
|
|
11
|
-
(function (ngOnInit) {
|
|
12
|
-
target.prototype.ngOnInit = function () {
|
|
13
|
-
this.element.nativeElement.classList.add(cssClass);
|
|
14
|
-
ngOnInit?.call(this);
|
|
15
|
-
if (Array.isArray(this[CSS_COMPONENT_MODIFIERS])) {
|
|
16
|
-
for (const property of this[CSS_COMPONENT_MODIFIERS]) {
|
|
17
|
-
this[property] ?? (this[property] = null);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
})(target.prototype.ngOnInit);
|
|
22
|
-
};
|
|
23
|
-
}
|
|
1
|
+
import { deepmergeCustom } from 'deepmerge-ts';
|
|
24
2
|
|
|
25
3
|
/** @internal */
|
|
26
4
|
/* istanbul ignore next */
|
|
@@ -34,6 +12,15 @@ function camelToKebabCase(value) {
|
|
|
34
12
|
return value;
|
|
35
13
|
}
|
|
36
14
|
|
|
15
|
+
function decoratorPropertyName(decoratorName, propertyName) {
|
|
16
|
+
return `__ODX_${decoratorName}_${propertyName}__`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const deepmerge = deepmergeCustom({
|
|
20
|
+
mergeArrays: false,
|
|
21
|
+
mergeSets: false,
|
|
22
|
+
});
|
|
23
|
+
|
|
37
24
|
/* istanbul ignore next */
|
|
38
25
|
function isSameDomain(styleSheet) {
|
|
39
26
|
if (!styleSheet.href) {
|
|
@@ -72,14 +59,16 @@ function getEnumValues(e) {
|
|
|
72
59
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
73
60
|
/** @internal */
|
|
74
61
|
/* istanbul ignore next */
|
|
75
|
-
function ɵwithMultipleDescriptors(target, key,
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
const
|
|
62
|
+
function ɵwithMultipleDescriptors(target, key, propertySymbol) {
|
|
63
|
+
const keyName = key.toString();
|
|
64
|
+
const settersProperty = decoratorPropertyName('MultipleDescriptors', `setters_${target.constructor.name}_${keyName}`);
|
|
65
|
+
const gettersProperty = decoratorPropertyName('MultipleDescriptors', `getters_${target.constructor.name}_${keyName}`);
|
|
66
|
+
const valueProperty = decoratorPropertyName('MultipleDescriptors', `value_${keyName}`);
|
|
67
|
+
const setters = (target[settersProperty] ?? (target[settersProperty] = []));
|
|
68
|
+
const getters = (target[gettersProperty] ?? (target[gettersProperty] = []));
|
|
80
69
|
return {
|
|
81
70
|
addSetter(fn) {
|
|
82
|
-
setters.push({ fn, propertySymbol
|
|
71
|
+
setters.push({ fn, propertySymbol });
|
|
83
72
|
},
|
|
84
73
|
addGetter(fn) {
|
|
85
74
|
getters.push({ fn });
|
|
@@ -87,17 +76,23 @@ function ɵwithMultipleDescriptors(target, key, symbol) {
|
|
|
87
76
|
init() {
|
|
88
77
|
Object.defineProperty(target, key, {
|
|
89
78
|
set(value) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
79
|
+
let currentValue = value;
|
|
80
|
+
for (const { fn, propertySymbol } of setters) {
|
|
81
|
+
fn.call(this, currentValue);
|
|
82
|
+
currentValue = this[propertySymbol];
|
|
83
|
+
}
|
|
84
|
+
this[valueProperty] = currentValue;
|
|
94
85
|
},
|
|
95
86
|
get() {
|
|
96
87
|
if (Array.isArray(getters)) {
|
|
97
|
-
|
|
88
|
+
let currentValue = this[valueProperty];
|
|
89
|
+
for (const { fn } of getters) {
|
|
90
|
+
currentValue = fn.call(this);
|
|
91
|
+
}
|
|
92
|
+
return currentValue;
|
|
98
93
|
}
|
|
99
94
|
else {
|
|
100
|
-
return this[
|
|
95
|
+
return this[valueProperty];
|
|
101
96
|
}
|
|
102
97
|
},
|
|
103
98
|
configurable: true,
|
|
@@ -106,41 +101,62 @@ function ɵwithMultipleDescriptors(target, key, symbol) {
|
|
|
106
101
|
};
|
|
107
102
|
}
|
|
108
103
|
|
|
104
|
+
const CSS_COMPONENT_NAME = decoratorPropertyName('CSSComponent', 'name');
|
|
105
|
+
/** @internal */
|
|
106
|
+
/* istanbul ignore next */
|
|
107
|
+
function CSSComponent(name, prefix = 'odx') {
|
|
108
|
+
return (target) => {
|
|
109
|
+
const cssClass = `${prefix}-${name}`;
|
|
110
|
+
Object.defineProperty(target.prototype, CSS_COMPONENT_NAME, {
|
|
111
|
+
value: cssClass,
|
|
112
|
+
});
|
|
113
|
+
(function (ngOnInit) {
|
|
114
|
+
target.prototype.ngOnInit = function () {
|
|
115
|
+
this.element.nativeElement.classList.add(cssClass);
|
|
116
|
+
ngOnInit?.call(this);
|
|
117
|
+
};
|
|
118
|
+
})(target.prototype.ngOnInit);
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
109
122
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
110
123
|
/** @internal */
|
|
111
124
|
/* istanbul ignore next */
|
|
112
125
|
function CSSModifier(options) {
|
|
113
126
|
return (target, propertyKey) => {
|
|
114
|
-
const
|
|
127
|
+
const propertyKeyName = propertyKey.toString();
|
|
128
|
+
const propertyKeyKebabCase = camelToKebabCase(propertyKeyName);
|
|
129
|
+
const propertySymbol = decoratorPropertyName('CSSModifier', propertyKeyName);
|
|
130
|
+
const propertyDefaultValue = decoratorPropertyName('CSSModifier', `${propertyKeyName}_default`);
|
|
115
131
|
const descriptors = ɵwithMultipleDescriptors(target, propertyKey, propertySymbol);
|
|
116
|
-
const propertyKeyKebabCase = camelToKebabCase(propertyKey.toString());
|
|
117
132
|
function createModifierClass(value) {
|
|
118
|
-
value = value ?? options?.default ?? null;
|
|
119
133
|
if (typeof value === 'boolean' || (typeof value === 'string' && value.length > 0)) {
|
|
120
134
|
let modifier = typeof value === 'boolean' ? propertyKeyKebabCase : value;
|
|
121
135
|
if (options?.withPrefix) {
|
|
122
|
-
modifier =
|
|
136
|
+
modifier = `${propertyKeyName}-${modifier}`;
|
|
123
137
|
}
|
|
124
|
-
|
|
138
|
+
if (options?.withComponentPrefix ?? true) {
|
|
139
|
+
return `${this[CSS_COMPONENT_NAME]}--${modifier}`;
|
|
140
|
+
}
|
|
141
|
+
return modifier;
|
|
125
142
|
}
|
|
126
143
|
return null;
|
|
127
144
|
}
|
|
128
|
-
if (options?.default) {
|
|
129
|
-
target[CSS_COMPONENT_MODIFIERS] = (target[CSS_COMPONENT_MODIFIERS] || []).concat(propertyKey);
|
|
130
|
-
}
|
|
131
145
|
function setter(value) {
|
|
132
146
|
const values = options?.isArray ? value : [value];
|
|
133
|
-
this[propertySymbol]
|
|
147
|
+
this[propertySymbol] ?? (this[propertySymbol] = []);
|
|
148
|
+
this[propertyDefaultValue] ?? (this[propertyDefaultValue] = values);
|
|
134
149
|
for (let i = 0; i < values.length; ++i) {
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
150
|
+
const nextValue = values[i] ?? this[propertyDefaultValue]?.[i] ?? null;
|
|
151
|
+
const currentValue = this[propertySymbol][i] ?? null;
|
|
152
|
+
if (this[propertySymbol].length < 1 || nextValue !== currentValue) {
|
|
153
|
+
const currentModifierClass = createModifierClass.apply(this, [currentValue]);
|
|
138
154
|
if (currentModifierClass !== null) {
|
|
139
155
|
this.element.nativeElement.classList.remove(currentModifierClass);
|
|
140
156
|
}
|
|
141
|
-
this[propertySymbol][i] =
|
|
142
|
-
const newModifierClass = createModifierClass.apply(this, [
|
|
143
|
-
if (newModifierClass !== null && (typeof
|
|
157
|
+
this[propertySymbol][i] = nextValue;
|
|
158
|
+
const newModifierClass = createModifierClass.apply(this, [nextValue]);
|
|
159
|
+
if (newModifierClass !== null && (typeof nextValue === 'boolean' ? nextValue : true)) {
|
|
144
160
|
this.element.nativeElement.classList.add(newModifierClass);
|
|
145
161
|
}
|
|
146
162
|
}
|
|
@@ -159,5 +175,5 @@ function CSSModifier(options) {
|
|
|
159
175
|
* Generated bundle index. Do not edit.
|
|
160
176
|
*/
|
|
161
177
|
|
|
162
|
-
export { CSSComponent, CSSModifier,
|
|
178
|
+
export { CSSComponent, CSSModifier, CSS_COMPONENT_NAME, camelToKebabCase, decoratorPropertyName, deepmerge, getCSSVariables, getEnumValues, ɵwithMultipleDescriptors };
|
|
163
179
|
//# sourceMappingURL=odx-angular-internal.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odx-angular-internal.mjs","sources":["../../../../libs/angular/internal/src/decorators/css-component.ts","../../../../libs/angular/internal/src/helpers/camel-to-kebab-case.ts","../../../../libs/angular/internal/src/helpers/get-css-variables.ts","../../../../libs/angular/internal/src/helpers/get-enum-values.ts","../../../../libs/angular/internal/src/helpers/with-mutiple-descriptors.ts","../../../../libs/angular/internal/src/decorators/css-modifier.ts","../../../../libs/angular/internal/src/odx-angular-internal.ts"],"sourcesContent":["import { ElementRef, Type } from '@angular/core';\n\nexport const CSS_COMPONENT_NAME = Symbol('__CSSComponentName__');\n\nexport const CSS_COMPONENT_MODIFIERS = Symbol('__CSSComponentModifiers__');\n\n/** @internal */\nexport interface CSSComponent {\n readonly element: ElementRef<unknown>;\n}\n\n/** @internal */\n/* istanbul ignore next */\nexport function CSSComponent(name: string, prefix = 'odx') {\n return (target: Type<CSSComponent>) => {\n const cssClass = `${prefix}-${name}`;\n Object.defineProperty(target.prototype, CSS_COMPONENT_NAME, {\n value: cssClass,\n });\n\n (function (this: unknown, ngOnInit?: () => void) {\n target.prototype.ngOnInit = function () {\n this.element.nativeElement.classList.add(cssClass);\n ngOnInit?.call(this);\n\n if (Array.isArray(this[CSS_COMPONENT_MODIFIERS])) {\n for (const property of this[CSS_COMPONENT_MODIFIERS]) {\n this[property] ??= null;\n }\n }\n };\n })(target.prototype.ngOnInit);\n };\n}\n","/** @internal */\n/* istanbul ignore next */\nexport function camelToKebabCase(value: string): string {\n if (value !== value.toLowerCase()) {\n return value.replace(/[A-Z]/g, (match, index) => {\n const char = match.toLowerCase();\n\n return index === 0 ? char : `-${char}`;\n });\n }\n return value;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\ninterface ColorDefinition {\n name: string;\n variableName: string;\n value: string;\n}\n\n/* istanbul ignore next */\nfunction isSameDomain(styleSheet: StyleSheet): boolean {\n if (!styleSheet.href) {\n return true;\n }\n\n return styleSheet.href.indexOf(window.location.origin) === 0;\n}\n\n/** @internal */\n/* istanbul ignore next */\nexport function getCSSVariables(filter: RegExp): ColorDefinition[] {\n const stylesheets = Array.from(document.styleSheets).filter(isSameDomain);\n return stylesheets.reduce<any[]>((variables, { cssRules }) => {\n for (const { style, type } of Array.from(cssRules) as any[]) {\n if (type === 1) {\n for (const prop of Array.from(style ?? []) as string[]) {\n const name = prop.trim();\n if (name.startsWith('--') && filter.test(name)) {\n variables.push({\n name: name,\n value: style.getPropertyValue(prop).trim(),\n });\n }\n }\n }\n }\n return variables;\n }, []);\n}\n","/** @internal */\nexport function getEnumValues<TEnum, TKeys extends string>(e: { [key in TKeys]: TEnum }): TEnum[] {\n const keys = Object.keys(e) as TKeys[];\n return keys.filter((key) => e[key] !== undefined).map((key) => e[key]);\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/** @internal */\ninterface DescriptiorManager {\n addGetter: (value: any) => void;\n addSetter: (value: any) => void;\n init: () => void;\n}\n\n/** @internal */\n/* istanbul ignore next */\nexport function ɵwithMultipleDescriptors(target: any, key: PropertyKey, symbol: symbol): DescriptiorManager {\n const setters = (target[`__propSetters__${target.constructor}__${key.toString()}`] ??= []);\n const getters = (target[`__propGetters__${target.constructor}__${key.toString()}`] ??= []);\n const propertyValue = `__propValue_${String(key)}__`;\n return {\n addSetter(fn: (this: any, value: any) => void) {\n setters.push({ fn, propertySymbol: symbol });\n },\n addGetter(fn: (this: any, value: any) => void) {\n getters.push({ fn });\n },\n init() {\n Object.defineProperty(target, key, {\n set(value) {\n this[propertyValue] = setters.reduce((result: any, { fn, propertySymbol }: any) => {\n fn.call(this, result);\n return this[propertySymbol];\n }, value);\n },\n get() {\n if (Array.isArray(getters)) {\n return getters.reduce((_: any, { fn }: any) => fn.call(this), this[propertyValue]);\n } else {\n return this[propertyValue];\n }\n },\n configurable: true,\n });\n },\n };\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { camelToKebabCase, ɵwithMultipleDescriptors } from '../helpers';\nimport { CSS_COMPONENT_MODIFIERS, CSS_COMPONENT_NAME } from './css-component';\n\n/** @internal */\ninterface CSSModifierOptions {\n isArray?: boolean;\n withComponentPrefix?: boolean;\n default?: string;\n withPrefix?: boolean;\n}\n\n/** @internal */\n/* istanbul ignore next */\nexport function CSSModifier(options?: CSSModifierOptions) {\n return (target: any, propertyKey: PropertyKey) => {\n const propertySymbol = Symbol(`__CSSModifier{${propertyKey.toString()}}__`);\n const descriptors = ɵwithMultipleDescriptors(target, propertyKey, propertySymbol);\n const propertyKeyKebabCase = camelToKebabCase(propertyKey.toString());\n\n function createModifierClass(this: any, value: any) {\n value = value ?? options?.default ?? null;\n\n if (typeof value === 'boolean' || (typeof value === 'string' && value.length > 0)) {\n let modifier = typeof value === 'boolean' ? propertyKeyKebabCase : value;\n if (options?.withPrefix) {\n modifier = [propertyKey, modifier].join('-');\n }\n return [options?.withComponentPrefix ?? true ? this[CSS_COMPONENT_NAME] : null, modifier].filter(Boolean).join('--');\n }\n return null;\n }\n\n if (options?.default) {\n target[CSS_COMPONENT_MODIFIERS] = (target[CSS_COMPONENT_MODIFIERS] || []).concat(propertyKey);\n }\n\n function setter(this: any, value: any) {\n const values = options?.isArray ? value : [value];\n this[propertySymbol] = this[propertySymbol] || [];\n for (let i = 0; i < values.length; ++i) {\n const currentValue = values[i];\n if (this[propertySymbol].length < 1 || currentValue !== this[propertySymbol][i]) {\n const currentModifierClass = createModifierClass.apply(this, [this[propertySymbol][i]]);\n if (currentModifierClass !== null) {\n this.element.nativeElement.classList.remove(currentModifierClass);\n }\n this[propertySymbol][i] = currentValue;\n const newModifierClass = createModifierClass.apply(this, [this[propertySymbol][i]]);\n if (newModifierClass !== null && (typeof currentValue === 'boolean' ? currentValue : true)) {\n this.element.nativeElement.classList.add(newModifierClass);\n }\n }\n }\n }\n\n function getter(this: any) {\n return options?.isArray ? this[propertySymbol] : this[propertySymbol]?.[0];\n }\n\n descriptors.addSetter(setter);\n descriptors.addGetter(getter);\n descriptors.init();\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"MAEa,kBAAkB,GAAG,MAAM,CAAC,sBAAsB,EAAE;MAEpD,uBAAuB,GAAG,MAAM,CAAC,2BAA2B,EAAE;AAO3E;AACA;SACgB,YAAY,C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CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACxF,IAAI,oBAAoB,KAAK,IAAI,EAAE;wBACjC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;AACnE,qBAAA;oBACD,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC;AACvC,oBAAA,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpF,oBAAA,IAAI,gBAAgB,KAAK,IAAI,KAAK,OAAO,YAAY,KAAK,SAAS,GAAG,YAAY,GAAG,IAAI,CAAC,EAAE;wBAC1F,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAC5D,qBAAA;AACF,iBAAA;AACF,aAAA;SACF;AAED,QAAA,SAAS,MAAM,GAAA;YACb,OAAO,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;SAC5E;AAED,QAAA,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAC9B,QAAA,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9B,WAAW,CAAC,IAAI,EAAE,CAAC;AACrB,KAAC,CAAC;AACJ;;AChEA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"odx-angular-internal.mjs","sources":["../../../../libs/angular/internal/src/helpers/camel-to-kebab-case.ts","../../../../libs/angular/internal/src/helpers/decorator-property-name.ts","../../../../libs/angular/internal/src/helpers/deepmerge.ts","../../../../libs/angular/internal/src/helpers/get-css-variables.ts","../../../../libs/angular/internal/src/helpers/get-enum-values.ts","../../../../libs/angular/internal/src/helpers/with-mutiple-descriptors.ts","../../../../libs/angular/internal/src/decorators/css-component.ts","../../../../libs/angular/internal/src/decorators/css-modifier.ts","../../../../libs/angular/internal/src/odx-angular-internal.ts"],"sourcesContent":["/** @internal */\n/* istanbul ignore next */\nexport function camelToKebabCase(value: string): string {\n if (value !== value.toLowerCase()) {\n return value.replace(/[A-Z]/g, (match, index) => {\n const char = match.toLowerCase();\n\n return index === 0 ? char : `-${char}`;\n });\n }\n return value;\n}\n","export function decoratorPropertyName<D extends string, T extends string>(decoratorName: D, propertyName: T): `__ODX_${D}_${T}__` {\n return `__ODX_${decoratorName}_${propertyName}__`;\n}\n","import { deepmergeCustom, DeepMergeLeafURI } from 'deepmerge-ts';\n\nexport const deepmerge = deepmergeCustom<{ DeepMergeArraysURI: DeepMergeLeafURI }>({\n mergeArrays: false,\n mergeSets: false,\n});\n","/* eslint-disable @typescript-eslint/no-explicit-any */\ninterface ColorDefinition {\n name: string;\n variableName: string;\n value: string;\n}\n\n/* istanbul ignore next */\nfunction isSameDomain(styleSheet: StyleSheet): boolean {\n if (!styleSheet.href) {\n return true;\n }\n\n return styleSheet.href.indexOf(window.location.origin) === 0;\n}\n\n/** @internal */\n/* istanbul ignore next */\nexport function getCSSVariables(filter: RegExp): ColorDefinition[] {\n const stylesheets = Array.from(document.styleSheets).filter(isSameDomain);\n return stylesheets.reduce<any[]>((variables, { cssRules }) => {\n for (const { style, type } of Array.from(cssRules) as any[]) {\n if (type === 1) {\n for (const prop of Array.from(style ?? []) as string[]) {\n const name = prop.trim();\n if (name.startsWith('--') && filter.test(name)) {\n variables.push({\n name: name,\n value: style.getPropertyValue(prop).trim(),\n });\n }\n }\n }\n }\n return variables;\n }, []);\n}\n","/** @internal */\nexport function getEnumValues<TEnum, TKeys extends string>(e: { [key in TKeys]: TEnum }): TEnum[] {\n const keys = Object.keys(e) as TKeys[];\n return keys.filter((key) => e[key] !== undefined).map((key) => e[key]);\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { decoratorPropertyName } from './decorator-property-name';\n\n/** @internal */\ninterface DescriptiorManager {\n addGetter: (value: any) => void;\n addSetter: (value: any) => void;\n init: () => void;\n}\n\n/** @internal */\n/* istanbul ignore next */\nexport function ɵwithMultipleDescriptors(target: any, key: PropertyKey, propertySymbol: string): DescriptiorManager {\n const keyName = key.toString();\n const settersProperty = decoratorPropertyName('MultipleDescriptors', `setters_${target.constructor.name}_${keyName}`);\n const gettersProperty = decoratorPropertyName('MultipleDescriptors', `getters_${target.constructor.name}_${keyName}`);\n const valueProperty = decoratorPropertyName('MultipleDescriptors', `value_${keyName}`);\n const setters = (target[settersProperty] ??= []);\n const getters = (target[gettersProperty] ??= []);\n return {\n addSetter(fn: (this: any, value: any) => void) {\n setters.push({ fn, propertySymbol });\n },\n addGetter(fn: (this: any, value: any) => void) {\n getters.push({ fn });\n },\n init() {\n Object.defineProperty(target, key, {\n set(value) {\n let currentValue = value;\n for (const { fn, propertySymbol } of setters) {\n fn.call(this, currentValue);\n currentValue = this[propertySymbol];\n }\n this[valueProperty] = currentValue;\n },\n get() {\n if (Array.isArray(getters)) {\n let currentValue = this[valueProperty];\n for (const { fn } of getters) {\n currentValue = fn.call(this);\n }\n return currentValue;\n } else {\n return this[valueProperty];\n }\n },\n configurable: true,\n });\n },\n };\n}\n","import { ElementRef, Type } from '@angular/core';\nimport { decoratorPropertyName } from '../helpers';\n\nexport const CSS_COMPONENT_NAME = decoratorPropertyName('CSSComponent', 'name');\n\n/** @internal */\nexport interface CSSComponent {\n readonly element: ElementRef<unknown>;\n}\n\n/** @internal */\n/* istanbul ignore next */\nexport function CSSComponent(name: string, prefix = 'odx') {\n return (target: Type<CSSComponent>) => {\n const cssClass = `${prefix}-${name}`;\n Object.defineProperty(target.prototype, CSS_COMPONENT_NAME, {\n value: cssClass,\n });\n\n (function (this: unknown, ngOnInit?: () => void) {\n target.prototype.ngOnInit = function () {\n this.element.nativeElement.classList.add(cssClass);\n ngOnInit?.call(this);\n };\n })(target.prototype.ngOnInit);\n };\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { camelToKebabCase, decoratorPropertyName, ɵwithMultipleDescriptors } from '../helpers';\nimport { CSS_COMPONENT_NAME } from './css-component';\n\n/** @internal */\ninterface CSSModifierOptions {\n isArray?: boolean;\n withComponentPrefix?: boolean;\n withPrefix?: boolean;\n}\n\n/** @internal */\n/* istanbul ignore next */\nexport function CSSModifier(options?: CSSModifierOptions) {\n return (target: any, propertyKey: PropertyKey) => {\n const propertyKeyName = propertyKey.toString();\n const propertyKeyKebabCase = camelToKebabCase(propertyKeyName);\n const propertySymbol = decoratorPropertyName('CSSModifier', propertyKeyName);\n const propertyDefaultValue = decoratorPropertyName('CSSModifier', `${propertyKeyName}_default`);\n const descriptors = ɵwithMultipleDescriptors(target, propertyKey, propertySymbol);\n\n function createModifierClass(this: any, value: any) {\n if (typeof value === 'boolean' || (typeof value === 'string' && value.length > 0)) {\n let modifier = typeof value === 'boolean' ? propertyKeyKebabCase : value;\n if (options?.withPrefix) {\n modifier = `${propertyKeyName}-${modifier}`;\n }\n if (options?.withComponentPrefix ?? true) {\n return `${this[CSS_COMPONENT_NAME]}--${modifier}`;\n }\n return modifier;\n }\n return null;\n }\n\n function setter(this: any, value: any) {\n const values = options?.isArray ? value : [value];\n this[propertySymbol] ??= [];\n this[propertyDefaultValue] ??= values;\n for (let i = 0; i < values.length; ++i) {\n const nextValue = values[i] ?? this[propertyDefaultValue]?.[i] ?? null;\n const currentValue = this[propertySymbol][i] ?? null;\n if (this[propertySymbol].length < 1 || nextValue !== currentValue) {\n const currentModifierClass = createModifierClass.apply(this, [currentValue]);\n if (currentModifierClass !== null) {\n this.element.nativeElement.classList.remove(currentModifierClass);\n }\n this[propertySymbol][i] = nextValue;\n const newModifierClass = createModifierClass.apply(this, [nextValue]);\n if (newModifierClass !== null && (typeof nextValue === 'boolean' ? nextValue : true)) {\n this.element.nativeElement.classList.add(newModifierClass);\n }\n }\n }\n }\n\n function getter(this: any) {\n return options?.isArray ? this[propertySymbol] : this[propertySymbol]?.[0];\n }\n\n descriptors.addSetter(setter);\n descriptors.addGetter(getter);\n descriptors.init();\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;AACA;AACM,SAAU,gBAAgB,CAAC,KAAa,EAAA;AAC5C,IAAA,IAAI,KAAK,KAAK,KAAK,CAAC,WAAW,EAAE,EAAE;QACjC,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAI;AAC9C,YAAA,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;AAEjC,YAAA,OAAO,KAAK,KAAK,CAAC,GAAG,IAAI,GAAG,CAAI,CAAA,EAAA,IAAI,EAAE,CAAC;AACzC,SAAC,CAAC,CAAC;AACJ,KAAA;AACD,IAAA,OAAO,KAAK,CAAC;AACf;;ACXgB,SAAA,qBAAqB,CAAqC,aAAgB,EAAE,YAAe,EAAA;AACzG,IAAA,OAAO,CAAS,MAAA,EAAA,aAAa,CAAI,CAAA,EAAA,YAAY,IAAI,CAAC;AACpD;;ACAO,MAAM,SAAS,GAAG,eAAe,CAA2C;AACjF,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,SAAS,EAAE,KAAK;AACjB,CAAA;;ACED;AACA,SAAS,YAAY,CAAC,UAAsB,EAAA;AAC1C,IAAA,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;AACpB,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;AAED,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC/D,CAAC;AAED;AACA;AACM,SAAU,eAAe,CAAC,MAAc,EAAA;AAC5C,IAAA,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IA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AO,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;SAC5E;AAED,QAAA,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAC9B,QAAA,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9B,WAAW,CAAC,IAAI,EAAE,CAAC;AACrB,KAAC,CAAC;AACJ;;AChEA;;AAEG;;;;"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Injectable, makeEnvironmentProviders, ENVIRONMENT_INITIALIZER } from '@angular/core';
|
|
3
|
+
import { createConfigTokens } from '@odx/angular/utils';
|
|
4
|
+
import { DOCUMENT } from '@angular/common';
|
|
5
|
+
import { WindowRef } from '@odx/angular';
|
|
6
|
+
import { BehaviorSubject, distinctUntilChanged, shareReplay } from 'rxjs';
|
|
7
|
+
|
|
8
|
+
function prefersDarkTheme(view) {
|
|
9
|
+
return !!view.matchMedia?.('(prefers-color-scheme: dark)')?.matches;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const Theme = {
|
|
13
|
+
DARK: 'dark',
|
|
14
|
+
LIGHT: 'light',
|
|
15
|
+
};
|
|
16
|
+
const availableThemes = Object.values(Theme);
|
|
17
|
+
|
|
18
|
+
function resolveTheme(theme) {
|
|
19
|
+
return availableThemes.find((t) => t === theme) ?? null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const THEME_STORAGE_NAME = '@odx/angular/theming:SelectedTheme';
|
|
23
|
+
function saveTheme(storage, theme) {
|
|
24
|
+
try {
|
|
25
|
+
storage?.setItem(THEME_STORAGE_NAME, theme);
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
//
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function readTheme(storage) {
|
|
32
|
+
try {
|
|
33
|
+
return resolveTheme(storage?.getItem(THEME_STORAGE_NAME)) ?? null;
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const THEME_ATTRIBUTE_NAME = 'odxTheme';
|
|
41
|
+
class ThemingService {
|
|
42
|
+
constructor() {
|
|
43
|
+
this.config = injectThemingConfig();
|
|
44
|
+
this.document = inject(DOCUMENT);
|
|
45
|
+
this.windowRef = inject(WindowRef);
|
|
46
|
+
this.theme$$ = new BehaviorSubject(this.getInitialTheme());
|
|
47
|
+
this.theme$ = this.theme$$.pipe(distinctUntilChanged(), shareReplay({ refCount: true }));
|
|
48
|
+
this.theme$.subscribe((theme) => {
|
|
49
|
+
this.document.body.setAttribute(THEME_ATTRIBUTE_NAME, theme);
|
|
50
|
+
saveTheme(this.config.storage, theme);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
selectTheme(theme) {
|
|
54
|
+
this.theme$$.next(theme);
|
|
55
|
+
}
|
|
56
|
+
getSelectedTheme() {
|
|
57
|
+
return this.theme$$.getValue();
|
|
58
|
+
}
|
|
59
|
+
getInitialTheme() {
|
|
60
|
+
let selectedTheme = readTheme(this.config.storage);
|
|
61
|
+
if (!selectedTheme && this.config.autoDetect && prefersDarkTheme(this.windowRef.nativeWindow)) {
|
|
62
|
+
selectedTheme = Theme.DARK;
|
|
63
|
+
}
|
|
64
|
+
return selectedTheme ?? this.config.defaultTheme;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
ThemingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ThemingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
68
|
+
ThemingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ThemingService, providedIn: 'root' });
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ThemingService, decorators: [{
|
|
70
|
+
type: Injectable,
|
|
71
|
+
args: [{ providedIn: 'root' }]
|
|
72
|
+
}], ctorParameters: function () { return []; } });
|
|
73
|
+
|
|
74
|
+
const { ThemingConfig, injectThemingConfig, provideThemingConfig } = createConfigTokens('Theming', '@odx/angular/theme', {
|
|
75
|
+
autoDetect: false,
|
|
76
|
+
defaultTheme: Theme.LIGHT,
|
|
77
|
+
storage: null,
|
|
78
|
+
});
|
|
79
|
+
function provideTheming(config) {
|
|
80
|
+
return makeEnvironmentProviders([
|
|
81
|
+
provideThemingConfig(config),
|
|
82
|
+
{
|
|
83
|
+
provide: ENVIRONMENT_INITIALIZER,
|
|
84
|
+
useFactory: () => () => inject(ThemingService),
|
|
85
|
+
deps: [ThemingConfig],
|
|
86
|
+
multi: true,
|
|
87
|
+
},
|
|
88
|
+
]);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Generated bundle index. Do not edit.
|
|
93
|
+
*/
|
|
94
|
+
|
|
95
|
+
export { THEME_ATTRIBUTE_NAME, THEME_STORAGE_NAME, Theme, ThemingConfig, ThemingService, availableThemes, injectThemingConfig, prefersDarkTheme, provideTheming, provideThemingConfig, readTheme, resolveTheme, saveTheme };
|
|
96
|
+
//# sourceMappingURL=odx-angular-theming.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"odx-angular-theming.mjs","sources":["../../../../libs/angular/theming/src/lib/helpers/prefers-dark-theme.ts","../../../../libs/angular/theming/src/lib/models/theme.ts","../../../../libs/angular/theming/src/lib/helpers/resolve-theme.ts","../../../../libs/angular/theming/src/lib/helpers/theme-storage.ts","../../../../libs/angular/theming/src/lib/theming.service.ts","../../../../libs/angular/theming/src/lib/theming.config.ts","../../../../libs/angular/theming/src/odx-angular-theming.ts"],"sourcesContent":["export function prefersDarkTheme(view: Window): boolean {\n return !!view.matchMedia?.('(prefers-color-scheme: dark)')?.matches;\n}\n","export type Theme = (typeof Theme)[keyof typeof Theme];\nexport const Theme = {\n DARK: 'dark',\n LIGHT: 'light',\n} as const;\n\nexport const availableThemes = Object.values(Theme);\n","import { availableThemes, Theme } from '../models';\n\nexport function resolveTheme(theme?: string | null): Theme | null {\n return availableThemes.find((t) => t === theme) ?? null;\n}\n","import { Theme } from '../models';\nimport { resolveTheme } from './resolve-theme';\n\nexport const THEME_STORAGE_NAME = '@odx/angular/theming:SelectedTheme';\n\nexport function saveTheme(storage: Storage | null | undefined, theme: Theme): void {\n try {\n storage?.setItem(THEME_STORAGE_NAME, theme);\n } catch {\n //\n }\n}\n\nexport function readTheme(storage?: Storage | null): Theme | null {\n try {\n return resolveTheme(storage?.getItem(THEME_STORAGE_NAME)) ?? null;\n } catch {\n return null;\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { inject, Injectable } from '@angular/core';\nimport { WindowRef } from '@odx/angular';\nimport { BehaviorSubject, distinctUntilChanged, shareReplay } from 'rxjs';\nimport { prefersDarkTheme, readTheme, saveTheme } from './helpers';\nimport { Theme } from './models';\nimport { injectThemingConfig } from './theming.config';\n\nexport const THEME_ATTRIBUTE_NAME = 'odxTheme';\n\n@Injectable({ providedIn: 'root' })\nexport class ThemingService {\n private readonly config = injectThemingConfig();\n private readonly document = inject(DOCUMENT);\n private readonly windowRef = inject(WindowRef);\n private readonly theme$$ = new BehaviorSubject<Theme>(this.getInitialTheme());\n\n public readonly theme$ = this.theme$$.pipe(distinctUntilChanged(), shareReplay({ refCount: true }));\n\n constructor() {\n this.theme$.subscribe((theme) => {\n this.document.body.setAttribute(THEME_ATTRIBUTE_NAME, theme);\n saveTheme(this.config.storage, theme);\n });\n }\n\n public selectTheme(theme: Theme): void {\n this.theme$$.next(theme);\n }\n\n public getSelectedTheme(): Theme {\n return this.theme$$.getValue();\n }\n\n private getInitialTheme(): Theme {\n let selectedTheme = readTheme(this.config.storage);\n\n if (!selectedTheme && this.config.autoDetect && prefersDarkTheme(this.windowRef.nativeWindow)) {\n selectedTheme = Theme.DARK;\n }\n\n return selectedTheme ?? this.config.defaultTheme;\n }\n}\n","import { EnvironmentProviders, ENVIRONMENT_INITIALIZER, inject, makeEnvironmentProviders } from '@angular/core';\nimport { ConfigDependencies, ConfigProvider, createConfigTokens } from '@odx/angular/utils';\nimport { Theme } from './models';\nimport { ThemingService } from './theming.service';\n\nexport interface ThemingConfig {\n autoDetect: boolean;\n defaultTheme: Theme;\n storage?: Storage | null;\n}\n\nexport const { ThemingConfig, injectThemingConfig, provideThemingConfig } = createConfigTokens('Theming', '@odx/angular/theme', {\n autoDetect: false,\n defaultTheme: Theme.LIGHT,\n storage: null,\n} as ThemingConfig);\n\nexport function provideTheming<D extends ConfigDependencies = ConfigDependencies<ThemingConfig>>(\n config: ConfigProvider<Partial<ThemingConfig>, D>\n): EnvironmentProviders {\n return makeEnvironmentProviders([\n provideThemingConfig(config),\n {\n provide: ENVIRONMENT_INITIALIZER,\n useFactory: () => () => inject(ThemingService),\n deps: [ThemingConfig],\n multi: true,\n },\n ]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAM,SAAU,gBAAgB,CAAC,IAAY,EAAA;IAC3C,OAAO,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,8BAA8B,CAAC,EAAE,OAAO,CAAC;AACtE;;ACDa,MAAA,KAAK,GAAG;AACnB,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,KAAK,EAAE,OAAO;EACL;AAEE,MAAA,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK;;ACJ5C,SAAU,YAAY,CAAC,KAAqB,EAAA;AAChD,IAAA,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,IAAI,IAAI,CAAC;AAC1D;;ACDO,MAAM,kBAAkB,GAAG,qCAAqC;AAEvD,SAAA,SAAS,CAAC,OAAmC,EAAE,KAAY,EAAA;IACzE,IAAI;AACF,QAAA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C,aAAa,CAAC;AACrB,YAAA,KAAK,EAAE,IAAI;AACZ,SAAA;AACF,KAAA,CAAC,CAAC;AACL;;AC7BA;;AAEG;;;;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ɵwithMultipleDescriptors } from '@odx/angular/internal';
|
|
1
|
+
import { decoratorPropertyName, ɵwithMultipleDescriptors, deepmerge } from '@odx/angular/internal';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { TemplateRef, inject, ChangeDetectorRef, Injector, ElementRef, Renderer2, Injectable, InjectionToken } from '@angular/core';
|
|
4
4
|
import { Subject, takeUntil, tap, BehaviorSubject } from 'rxjs';
|
|
5
|
-
import { deepmerge } from 'deepmerge-ts';
|
|
6
5
|
import { map, shareReplay } from 'rxjs/operators';
|
|
7
6
|
|
|
8
7
|
function Pure(_target, propertyKey, { get, enumerable, value }) {
|
|
@@ -45,7 +44,7 @@ function Pure(_target, propertyKey, { get, enumerable, value }) {
|
|
|
45
44
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
46
45
|
function Transform(transformer) {
|
|
47
46
|
return (target, propertyKey) => {
|
|
48
|
-
const propertySymbol =
|
|
47
|
+
const propertySymbol = decoratorPropertyName('Transform', propertyKey.toString());
|
|
49
48
|
const descriptors = ɵwithMultipleDescriptors(target, propertyKey, propertySymbol);
|
|
50
49
|
function setter(value) {
|
|
51
50
|
this[propertySymbol] = transformer.apply(this, [value]);
|
|
@@ -93,7 +92,7 @@ function booleanToOptionalAttributeString(state) {
|
|
|
93
92
|
return state ? 'true' : null;
|
|
94
93
|
}
|
|
95
94
|
function px(value) {
|
|
96
|
-
return isNumber(value) ? `${
|
|
95
|
+
return isNumber(value) ? `${value}px` : '0px';
|
|
97
96
|
}
|
|
98
97
|
function cssTranslate(x, y) {
|
|
99
98
|
return `translate3d(${x}, ${y}, 0)`;
|
|
@@ -178,6 +177,10 @@ function pluckFromArray(arr, key) {
|
|
|
178
177
|
return arr.map((value) => value[key]);
|
|
179
178
|
}
|
|
180
179
|
|
|
180
|
+
function buildUrl(...args) {
|
|
181
|
+
return args.join('/').replace(/(^.*)(https?:\/\/)|(\/)+/g, '$2$3');
|
|
182
|
+
}
|
|
183
|
+
|
|
181
184
|
function deferFn(fn) {
|
|
182
185
|
setTimeout(fn, 0);
|
|
183
186
|
}
|
|
@@ -203,12 +206,68 @@ class EventManager {
|
|
|
203
206
|
this.destroyListeners();
|
|
204
207
|
}
|
|
205
208
|
}
|
|
206
|
-
EventManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
207
|
-
EventManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
208
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
209
|
+
EventManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EventManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
210
|
+
EventManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EventManager });
|
|
211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EventManager, decorators: [{
|
|
209
212
|
type: Injectable
|
|
210
213
|
}] });
|
|
211
214
|
|
|
215
|
+
const Axis = {
|
|
216
|
+
X: 'x',
|
|
217
|
+
Y: 'y',
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
const Position = {
|
|
221
|
+
TOP: 'top',
|
|
222
|
+
TOP_START: 'top-start',
|
|
223
|
+
TOP_END: 'top-end',
|
|
224
|
+
RIGHT: 'right',
|
|
225
|
+
RIGHT_START: 'right-start',
|
|
226
|
+
RIGHT_END: 'right-end',
|
|
227
|
+
BOTTOM: 'bottom',
|
|
228
|
+
BOTTOM_START: 'bottom-start',
|
|
229
|
+
BOTTOM_END: 'bottom-end',
|
|
230
|
+
LEFT: 'left',
|
|
231
|
+
LEFT_START: 'left-start',
|
|
232
|
+
LEFT_END: 'left-end',
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
const Side = {
|
|
236
|
+
TOP: 'top',
|
|
237
|
+
RIGHT: 'right',
|
|
238
|
+
BOTTOM: 'bottom',
|
|
239
|
+
LEFT: 'left',
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
function getSide(position) {
|
|
243
|
+
return position.split('-')[0];
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function getAxis(position) {
|
|
247
|
+
const side = getSide(position);
|
|
248
|
+
switch (side) {
|
|
249
|
+
case Side.TOP:
|
|
250
|
+
case Side.BOTTOM:
|
|
251
|
+
return Axis.Y;
|
|
252
|
+
case Side.LEFT:
|
|
253
|
+
case Side.RIGHT:
|
|
254
|
+
return Axis.X;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function getOppositeSide(position) {
|
|
259
|
+
switch (getSide(position)) {
|
|
260
|
+
case Side.TOP:
|
|
261
|
+
return Side.BOTTOM;
|
|
262
|
+
case Side.RIGHT:
|
|
263
|
+
return Side.LEFT;
|
|
264
|
+
case Side.BOTTOM:
|
|
265
|
+
return Side.TOP;
|
|
266
|
+
case Side.LEFT:
|
|
267
|
+
return Side.RIGHT;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
212
271
|
const uniqueIdCache = {};
|
|
213
272
|
function getUniqueId(key = '') {
|
|
214
273
|
const n = (uniqueIdCache[key] ?? 0) + 1;
|
|
@@ -230,44 +289,73 @@ function hasChanged(changes, keyOrKeys, ignoreFirstChange = true) {
|
|
|
230
289
|
}
|
|
231
290
|
}
|
|
232
291
|
|
|
233
|
-
function
|
|
292
|
+
function provideConfig(token, config) {
|
|
234
293
|
if ('useFactory' in config) {
|
|
235
294
|
return { provide: token, useFactory: config.useFactory, deps: config.deps };
|
|
236
295
|
}
|
|
237
296
|
return { provide: token, useValue: config };
|
|
238
297
|
}
|
|
239
|
-
function
|
|
240
|
-
const
|
|
241
|
-
const
|
|
242
|
-
const
|
|
243
|
-
const
|
|
298
|
+
function createConfigTokens(name, prefix, defaultValue) {
|
|
299
|
+
const configName = `${name}Config`;
|
|
300
|
+
const defaultConfigName = `${name}DefaultConfig`;
|
|
301
|
+
const injectConfigName = `inject${name}Config`;
|
|
302
|
+
const provideConfigName = `provide${name}Config`;
|
|
303
|
+
const tokenName = `${prefix}::${configName}`;
|
|
244
304
|
const token = new InjectionToken(tokenName, { providedIn: 'root', factory: () => defaultValue });
|
|
245
305
|
return {
|
|
246
|
-
[
|
|
247
|
-
[
|
|
248
|
-
[
|
|
306
|
+
[configName]: token,
|
|
307
|
+
[defaultConfigName]: defaultValue,
|
|
308
|
+
[injectConfigName]: () => deepmerge(defaultValue, inject(token, { skipSelf: true, optional: true }) ?? {}, inject(token)),
|
|
309
|
+
[provideConfigName]: (config) => {
|
|
310
|
+
return provideConfig(token, config);
|
|
311
|
+
},
|
|
249
312
|
};
|
|
250
313
|
}
|
|
251
314
|
|
|
252
315
|
class Queue {
|
|
253
316
|
constructor() {
|
|
254
|
-
this.queue = new
|
|
255
|
-
this.
|
|
317
|
+
this.queue = new Map();
|
|
318
|
+
this.update$$ = new BehaviorSubject(undefined);
|
|
319
|
+
this.values = [];
|
|
320
|
+
this.firstItem = null;
|
|
321
|
+
this.lastItem = null;
|
|
322
|
+
this.value$ = this.update$$.pipe(map(() => this.values), shareReplay({ bufferSize: 1, refCount: true }));
|
|
323
|
+
}
|
|
324
|
+
get size() {
|
|
325
|
+
return this.queue.size;
|
|
326
|
+
}
|
|
327
|
+
isFirst({ id }) {
|
|
328
|
+
return this.firstItem?.id === id;
|
|
329
|
+
}
|
|
330
|
+
isLast({ id }) {
|
|
331
|
+
return this.lastItem?.id === id;
|
|
332
|
+
}
|
|
333
|
+
get(id) {
|
|
334
|
+
return this.queue.get(id.toString()) ?? null;
|
|
256
335
|
}
|
|
257
336
|
add(item) {
|
|
258
|
-
this.
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
});
|
|
337
|
+
this.remove(item);
|
|
338
|
+
this.queue.set(item.id.toString(), item);
|
|
339
|
+
this.notify();
|
|
262
340
|
return item;
|
|
263
341
|
}
|
|
264
342
|
remove(item) {
|
|
265
|
-
|
|
266
|
-
this.
|
|
267
|
-
return
|
|
343
|
+
this.queue.delete(item.id.toString());
|
|
344
|
+
this.notify();
|
|
345
|
+
return item;
|
|
268
346
|
}
|
|
269
347
|
clear() {
|
|
270
|
-
this.queue.
|
|
348
|
+
this.queue.clear();
|
|
349
|
+
this.notify();
|
|
350
|
+
}
|
|
351
|
+
toArray() {
|
|
352
|
+
return this.values;
|
|
353
|
+
}
|
|
354
|
+
notify() {
|
|
355
|
+
this.values = Array.from(this.queue, ([_, item]) => item).reverse();
|
|
356
|
+
this.firstItem = this.values[0] ?? null;
|
|
357
|
+
this.lastItem = this.values[this.values.length - 1] ?? null;
|
|
358
|
+
this.update$$.next(undefined);
|
|
271
359
|
}
|
|
272
360
|
}
|
|
273
361
|
|
|
@@ -275,5 +363,5 @@ class Queue {
|
|
|
275
363
|
* Generated bundle index. Do not edit.
|
|
276
364
|
*/
|
|
277
365
|
|
|
278
|
-
export { EventManager, Pure, Queue, Transform, applyStyles, booleanToAttributeString, booleanToOptionalAttributeString, containsElement,
|
|
366
|
+
export { Axis, EventManager, Position, Pure, Queue, Side, Transform, applyStyles, booleanToAttributeString, booleanToOptionalAttributeString, buildUrl, containsElement, createConfigTokens, createResizeObserver, cssTranslate, deferFn, disableCSSTransitions, forceLayoutReflow, getAxis, getInjector, getOppositeSide, getSide, getUniqueId, hasChanged, injectElement, isBoolean, isComponent, isFunction, isNonEmptyString, isNumber, isPresent, isString, isTemplateRef, isViewContainer, pluckFromArray, provideConfig, px, reactiveAttributeBinding, reactiveClassBinding, setAttribute, untilDestroyed };
|
|
279
367
|
//# sourceMappingURL=odx-angular-utils.mjs.map
|