@odx/angular 11.5.0 → 12.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/CHANGELOG.md +12 -0
- package/breakpoints/lib/breakpoints.config.d.ts +1 -1
- package/breakpoints/lib/breakpoints.typings.d.ts +1 -2
- package/components/calendar/lib/calendar.config.d.ts +1 -1
- package/components/card/lib/card.config.d.ts +1 -1
- package/components/datepicker/lib/datepicker.config.d.ts +1 -1
- package/components/daterangepicker/lib/daterangepicker.config.d.ts +1 -1
- package/components/error-page/lib/error-page.config.d.ts +1 -1
- package/components/footer/lib/footer.config.d.ts +1 -1
- package/components/form-field/lib/form-field.config.d.ts +1 -1
- package/components/icon/lib/icon.config.d.ts +1 -1
- package/components/main-menu/lib/main-menu.config.d.ts +1 -1
- package/components/modal/lib/modal.config.d.ts +1 -1
- package/components/notification/lib/notification.config.d.ts +1 -1
- package/components/paginator/lib/paginator.config.d.ts +1 -1
- package/components/timepicker/lib/directives/timepicker-input-control.directive.d.ts +3 -3
- package/components/toast/lib/toast.config.d.ts +1 -1
- package/components/tooltip/lib/tooltip.config.d.ts +1 -1
- package/esm2022/breakpoints/lib/breakpoints.module.mjs +4 -4
- package/esm2022/breakpoints/lib/breakpoints.service.mjs +3 -3
- package/esm2022/breakpoints/lib/breakpoints.typings.mjs +1 -1
- package/esm2022/breakpoints/lib/directives/match-breakpoints.directive.mjs +3 -3
- package/esm2022/cdk/a11y/lib/a11y.module.mjs +4 -4
- package/esm2022/cdk/a11y/lib/directives/interactive.directive.mjs +3 -3
- package/esm2022/cdk/a11y/lib/directives/list-focus-manager-option.directive.mjs +3 -3
- package/esm2022/cdk/a11y/lib/directives/list-focus-manager.directive.mjs +3 -3
- package/esm2022/cdk/active-indicator/lib/active-indicator.directive.mjs +3 -3
- package/esm2022/cdk/autocomplete-control/lib/autocomplete-control.mjs +3 -3
- package/esm2022/cdk/checkbox-control/lib/checkbox-control.directive.mjs +3 -3
- package/esm2022/cdk/connected-overlay/lib/connected-overlay.component.mjs +3 -3
- package/esm2022/cdk/connected-overlay/lib/connected-overlay.service.mjs +3 -3
- package/esm2022/cdk/custom-form-control/lib/control.directive.mjs +3 -3
- package/esm2022/cdk/custom-form-control/lib/custom-form-control.mjs +3 -3
- package/esm2022/cdk/custom-form-control/lib/input-control.directive.mjs +3 -3
- package/esm2022/cdk/dynamic-view/lib/dynamic-view.component.mjs +3 -3
- package/esm2022/cdk/dynamic-view/lib/dynamic-view.directive.mjs +3 -3
- package/esm2022/cdk/dynamic-view/lib/dynamic-view.service.mjs +3 -3
- package/esm2022/cdk/event-plugins/lib/models/event-plugin.mjs +1 -1
- package/esm2022/cdk/event-plugins/lib/plugins/debounce-event-plugin.mjs +5 -5
- package/esm2022/cdk/event-plugins/lib/plugins/defer-event-plugin.mjs +5 -5
- package/esm2022/cdk/expandable/lib/directives/expandable-container.directive.mjs +3 -3
- package/esm2022/cdk/expandable/lib/directives/expandable-item.directive.mjs +3 -3
- package/esm2022/cdk/expandable/lib/expandable.module.mjs +4 -4
- package/esm2022/cdk/option-control/lib/option-control.mjs +3 -3
- package/esm2022/cdk/radio-group-control/lib/radio-control.directive.mjs +3 -3
- package/esm2022/cdk/radio-group-control/lib/radio-group-control.directive.mjs +3 -3
- package/esm2022/cdk/radio-group-control/lib/radio-group-control.module.mjs +4 -4
- package/esm2022/components/accordion/lib/accordion.component.mjs +3 -3
- package/esm2022/components/accordion/lib/accordion.module.mjs +4 -4
- package/esm2022/components/accordion/lib/components/accordion-item/accordion-item.component.mjs +3 -3
- package/esm2022/components/accordion/lib/directives/accordion-item-title.mjs +3 -3
- package/esm2022/components/action-group/action-group.component.mjs +3 -3
- package/esm2022/components/area-header/area-header.component.mjs +3 -3
- package/esm2022/components/area-header/area-header.module.mjs +4 -4
- package/esm2022/components/area-header/directives/area-header-content.directive.mjs +3 -3
- package/esm2022/components/area-header/directives/area-header-subtitle.directive.mjs +3 -3
- package/esm2022/components/autocomplete/lib/autocomplete.component.mjs +3 -3
- package/esm2022/components/autocomplete/lib/autocomplete.module.mjs +4 -4
- package/esm2022/components/autocomplete/lib/components/option/autocomplete-option.component.mjs +3 -3
- package/esm2022/components/autocomplete/lib/directives/autocomplete-input-control.directive.mjs +3 -3
- package/esm2022/components/autocomplete/lib/pipes/autocomplete-search-filter.pipe.mjs +3 -3
- package/esm2022/components/avatar/lib/avatar.component.mjs +3 -3
- package/esm2022/components/badge/lib/badge.component.mjs +3 -3
- package/esm2022/components/badge/lib/badge.directive.mjs +3 -3
- package/esm2022/components/bar/lib/bar.component.mjs +3 -3
- package/esm2022/components/bar/lib/bar.module.mjs +4 -4
- package/esm2022/components/bar/lib/directives/bar-button.directive.mjs +3 -3
- package/esm2022/components/bar/lib/directives/bar-label.directive.mjs +3 -3
- package/esm2022/components/breadcrumbs/lib/breadcrumbs.component.mjs +3 -3
- package/esm2022/components/button/lib/button.component.mjs +3 -3
- package/esm2022/components/button/lib/directives/responsive-button.directive.mjs +3 -3
- package/esm2022/components/button-group/lib/button-group.component.mjs +3 -3
- package/esm2022/components/calendar/lib/calendar.component.mjs +3 -3
- package/esm2022/components/calendar/lib/calendar.service.mjs +3 -3
- package/esm2022/components/calendar/lib/components/calendar-header/calendar-header.component.mjs +3 -3
- package/esm2022/components/calendar/lib/components/calendar-month/calendar-month.component.mjs +3 -3
- package/esm2022/components/calendar/lib/components/calendar-year/calendar-year.component.mjs +3 -3
- package/esm2022/components/calendar/lib/components/calendar-years/calendar-years.component.mjs +3 -3
- package/esm2022/components/calendar/lib/daterange.service.mjs +3 -3
- package/esm2022/components/calendar/lib/directives/calendar-cell.directive.mjs +3 -3
- package/esm2022/components/calendar/lib/directives/calendar-view.directive.mjs +3 -3
- package/esm2022/components/calendar/lib/pipes/date-label.pipe.mjs +3 -3
- package/esm2022/components/calendar/lib/services/calendar-month.service.mjs +3 -3
- package/esm2022/components/calendar/lib/services/calendar-year.service.mjs +3 -3
- package/esm2022/components/calendar/lib/services/calendar-years.service.mjs +3 -3
- package/esm2022/components/card/lib/card.component.mjs +3 -3
- package/esm2022/components/card/lib/card.module.mjs +4 -4
- package/esm2022/components/card/lib/components/card-footer/card-footer.component.mjs +3 -3
- package/esm2022/components/card/lib/components/card-image/card-image.component.mjs +3 -3
- package/esm2022/components/card/lib/components/launch-card-subtitle/launch-card-subtitle.component.mjs +3 -3
- package/esm2022/components/card/lib/directives/card-content.directive.mjs +3 -3
- package/esm2022/components/checkbox/lib/checkbox.component.mjs +3 -3
- package/esm2022/components/checkbox/lib/checkbox.module.mjs +4 -4
- package/esm2022/components/checkbox/lib/checkbox.validator.mjs +3 -3
- package/esm2022/components/chip/lib/components/chip/chip.component.mjs +3 -3
- package/esm2022/components/chip/lib/components/chip-list/chip-list.component.mjs +3 -3
- package/esm2022/components/chip/lib/components/chip-list-row/chip-list-row.component.mjs +3 -3
- package/esm2022/components/circular-progress/lib/circular-progress.component.mjs +3 -3
- package/esm2022/components/content-box/lib/content-box.component.mjs +3 -3
- package/esm2022/components/content-box/lib/content-box.module.mjs +4 -4
- package/esm2022/components/content-box/lib/directives/content-box-footer.directive.mjs +3 -3
- package/esm2022/components/content-box/lib/directives/content-box-header.directive.mjs +3 -3
- package/esm2022/components/datepicker/lib/datepicker.component.mjs +3 -3
- package/esm2022/components/datepicker/lib/datepicker.module.mjs +4 -4
- package/esm2022/components/datepicker/lib/directives/datepicker-input-control.directive.mjs +4 -4
- package/esm2022/components/daterangepicker/lib/daterangepicker.component.mjs +3 -3
- package/esm2022/components/daterangepicker/lib/daterangepicker.module.mjs +4 -4
- package/esm2022/components/daterangepicker/lib/directives/daterangepicker-input-control.directive.mjs +4 -4
- package/esm2022/components/daterangepicker/lib/range.validator.mjs +3 -3
- package/esm2022/components/daterangepicker/lib/required.validator.mjs +3 -3
- package/esm2022/components/dropdown/lib/dropdown.component.mjs +3 -3
- package/esm2022/components/dropdown/lib/dropdown.directive.mjs +3 -3
- package/esm2022/components/dropdown/lib/dropdown.module.mjs +4 -4
- package/esm2022/components/error-page/lib/error-page.component.mjs +3 -3
- package/esm2022/components/footer/lib/footer.component.mjs +3 -3
- package/esm2022/components/form-field/lib/components/form-field-info/form-field-info.component.mjs +3 -3
- package/esm2022/components/form-field/lib/components/form-group/form-group.component.mjs +3 -3
- package/esm2022/components/form-field/lib/directives/form-field-control.directive.mjs +3 -3
- package/esm2022/components/form-field/lib/directives/form-field-error.directive.mjs +3 -3
- package/esm2022/components/form-field/lib/directives/form-field-hint.directive.mjs +3 -3
- package/esm2022/components/form-field/lib/directives/form-field-label.directive.mjs +3 -3
- package/esm2022/components/form-field/lib/directives/form.directive.mjs +3 -3
- package/esm2022/components/form-field/lib/form-field.component.mjs +3 -3
- package/esm2022/components/form-field/lib/form-field.module.mjs +4 -4
- package/esm2022/components/form-field/lib/form-field.service.mjs +3 -3
- package/esm2022/components/form-field/lib/services/form-field-error.service.mjs +3 -3
- package/esm2022/components/header/lib/directives/header-avatar.directive.mjs +3 -3
- package/esm2022/components/header/lib/directives/header-title.directive.mjs +3 -3
- package/esm2022/components/header/lib/header.component.mjs +3 -3
- package/esm2022/components/header/lib/header.module.mjs +4 -4
- package/esm2022/components/header-navigation/lib/directives/header-navigation-link.directive.mjs +6 -6
- package/esm2022/components/header-navigation/lib/header-navigation.component.mjs +3 -3
- package/esm2022/components/header-navigation/lib/header-navigation.module.mjs +4 -4
- package/esm2022/components/icon/lib/icon.component.mjs +3 -3
- package/esm2022/components/inline-message/lib/inline-message.component.mjs +3 -3
- package/esm2022/components/link/link.directive.mjs +3 -3
- package/esm2022/components/list/lib/components/expandable-list-item/expandable-list-item.component.mjs +3 -3
- package/esm2022/components/list/lib/components/list-item/list-item.component.mjs +3 -3
- package/esm2022/components/list/lib/list.component.mjs +3 -3
- package/esm2022/components/list/lib/list.module.mjs +4 -4
- package/esm2022/components/loading-spinner/lib/loading-spinner.component.mjs +3 -3
- package/esm2022/components/loading-spinner/lib/loading-spinner.directive.mjs +3 -3
- package/esm2022/components/loading-spinner/lib/loading-spinner.module.mjs +4 -4
- package/esm2022/components/logo/logo.directive.mjs +3 -3
- package/esm2022/components/main-menu/lib/directives/main-menu-button.directive.mjs +3 -3
- package/esm2022/components/main-menu/lib/directives/main-menu-close.directive.mjs +3 -3
- package/esm2022/components/main-menu/lib/directives/main-menu-item.directive.mjs +3 -3
- package/esm2022/components/main-menu/lib/main-menu.component.mjs +3 -3
- package/esm2022/components/main-menu/lib/main-menu.module.mjs +4 -4
- package/esm2022/components/main-menu/lib/main-menu.service.mjs +3 -3
- package/esm2022/components/mainfilter-group/lib/mainfilter-group.component.mjs +3 -3
- package/esm2022/components/menu/lib/directives/menu-item.directive.mjs +3 -3
- package/esm2022/components/menu/lib/menu.component.mjs +3 -3
- package/esm2022/components/menu/lib/menu.directive.mjs +3 -3
- package/esm2022/components/menu/lib/menu.module.mjs +4 -4
- package/esm2022/components/modal/lib/components/basic-modal/basic-modal.component.mjs +3 -3
- package/esm2022/components/modal/lib/components/modal-footer/modal-footer.component.mjs +3 -3
- package/esm2022/components/modal/lib/components/modal-header/modal-header.component.mjs +3 -3
- package/esm2022/components/modal/lib/components/modal-hero/modal-hero.component.mjs +3 -3
- package/esm2022/components/modal/lib/directives/modal-close.directive.mjs +3 -3
- package/esm2022/components/modal/lib/directives/modal-content.directive.mjs +3 -3
- package/esm2022/components/modal/lib/directives/modal-dismiss.directive.mjs +3 -3
- package/esm2022/components/modal/lib/directives/prevent-form-method-dialog.directive.mjs +3 -3
- package/esm2022/components/modal/lib/directives/prevent-method-dialog.directive.mjs +3 -3
- package/esm2022/components/modal/lib/modal.component.mjs +3 -3
- package/esm2022/components/modal/lib/modal.directive.mjs +3 -3
- package/esm2022/components/modal/lib/modal.module.mjs +4 -4
- package/esm2022/components/modal/lib/modal.service.mjs +3 -3
- package/esm2022/components/navigation-back/lib/navigation-back.component.mjs +3 -3
- package/esm2022/components/notification/lib/components/notification-center/notification-center.component.mjs +3 -3
- package/esm2022/components/notification/lib/components/notification-item/notification-item.component.mjs +3 -3
- package/esm2022/components/notification/lib/directives/notification-center.directive.mjs +3 -3
- package/esm2022/components/notification/lib/notification.service.mjs +3 -3
- package/esm2022/components/notification/lib/services/notification-center.service.mjs +3 -3
- package/esm2022/components/paginator/lib/paginator.component.mjs +3 -3
- package/esm2022/components/paginator/lib/paginator.module.mjs +4 -4
- package/esm2022/components/progress/lib/progress.component.mjs +3 -3
- package/esm2022/components/radio-group/lib/components/radio-button/radio-button.component.mjs +3 -3
- package/esm2022/components/radio-group/lib/radio-group.component.mjs +3 -3
- package/esm2022/components/radio-group/lib/radio-group.module.mjs +4 -4
- package/esm2022/components/rail-navigation/lib/components/rail-navigation-item/rail-navigation-item.component.mjs +3 -3
- package/esm2022/components/rail-navigation/lib/rail-navigation.component.mjs +3 -3
- package/esm2022/components/rail-navigation/lib/rail-navigation.module.mjs +4 -4
- package/esm2022/components/rich-list/lib/components/rich-list-content/rich-list-content.component.mjs +3 -3
- package/esm2022/components/rich-list/lib/components/rich-list-item/rich-list-item.component.mjs +3 -3
- package/esm2022/components/rich-list/lib/components/rich-list-item-header/rich-list-item-header.component.mjs +3 -3
- package/esm2022/components/rich-list/lib/rich-list.component.mjs +3 -3
- package/esm2022/components/rich-list/lib/rich-list.module.mjs +4 -4
- package/esm2022/components/search-bar/lib/search-bar-control.directive.mjs +3 -3
- package/esm2022/components/search-bar/lib/search-bar.component.mjs +3 -3
- package/esm2022/components/search-bar/lib/search-bar.module.mjs +4 -4
- package/esm2022/components/select/lib/components/select-option/select-option.component.mjs +3 -3
- package/esm2022/components/select/lib/directives/select-input-control.directive.mjs +3 -3
- package/esm2022/components/select/lib/pipes/select-search-filter.pipe.mjs +3 -3
- package/esm2022/components/select/lib/select.component.mjs +3 -3
- package/esm2022/components/select/lib/select.module.mjs +4 -4
- package/esm2022/components/slider/lib/slider.directive.mjs +3 -3
- package/esm2022/components/spinbox/lib/spinbox.component.mjs +3 -3
- package/esm2022/components/switch/lib/switch.component.mjs +3 -3
- package/esm2022/components/switch/lib/switch.module.mjs +4 -4
- package/esm2022/components/switch/lib/switch.validator.mjs +3 -3
- package/esm2022/components/tab-bar/lib/components/tab-bar-item/tab-bar-item.component.mjs +3 -3
- package/esm2022/components/tab-bar/lib/tab-bar.component.mjs +3 -3
- package/esm2022/components/tab-bar/lib/tab-bar.module.mjs +4 -4
- package/esm2022/components/table/lib/components/check-cell/check-cell.component.mjs +3 -3
- package/esm2022/components/table/lib/components/header-title/header-title.component.mjs +3 -3
- package/esm2022/components/table/lib/directives/table-cell.directive.mjs +3 -3
- package/esm2022/components/table/lib/directives/table-row.directive.mjs +3 -3
- package/esm2022/components/table/lib/table.component.mjs +3 -3
- package/esm2022/components/table/lib/table.module.mjs +4 -4
- package/esm2022/components/timepicker/lib/components/timepicker-option.component.mjs +3 -3
- package/esm2022/components/timepicker/lib/directives/timepicker-input-control.directive.mjs +5 -5
- package/esm2022/components/timepicker/lib/timepicker.component.mjs +3 -3
- package/esm2022/components/timepicker/lib/timepicker.module.mjs +4 -4
- package/esm2022/components/timepicker/lib/timepicker.service.mjs +3 -3
- package/esm2022/components/toast/lib/components/toast-container/toast-container.component.mjs +3 -3
- package/esm2022/components/toast/lib/components/toast-item/toast-item.component.mjs +3 -3
- package/esm2022/components/toast/lib/toast.module.mjs +4 -4
- package/esm2022/components/toast/lib/toast.service.mjs +3 -3
- package/esm2022/components/toggle-button-group/lib/components/toggle-button/toggle-button.component.mjs +3 -3
- package/esm2022/components/toggle-button-group/lib/toggle-button-group.component.mjs +3 -3
- package/esm2022/components/toggle-button-group/lib/toggle-button-group.module.mjs +4 -4
- package/esm2022/components/tooltip/lib/tooltip.component.mjs +3 -3
- package/esm2022/components/tooltip/lib/tooltip.directive.mjs +3 -3
- package/esm2022/components/wizard/lib/components/wizard-step/wizard-step.component.mjs +3 -3
- package/esm2022/components/wizard/lib/wizard.component.mjs +3 -3
- package/esm2022/components/wizard/lib/wizard.module.mjs +4 -4
- package/esm2022/internal/translate/lib/pipes/translate.pipe.mjs +3 -3
- package/esm2022/lib/controllers/controller.mjs +3 -3
- package/esm2022/lib/controllers/disabled.controller.mjs +3 -3
- package/esm2022/lib/controllers/readonly.controller.mjs +3 -3
- package/esm2022/lib/core.module.mjs +4 -4
- package/esm2022/lib/directives/click-outside.directive.mjs +3 -3
- package/esm2022/lib/directives/delegate-focus.directive.mjs +3 -3
- package/esm2022/lib/directives/with-disabled-state.directive.mjs +3 -3
- package/esm2022/lib/directives/with-tabindex.directive.mjs +3 -3
- package/esm2022/lib/services/window-ref.mjs +3 -3
- package/esm2022/localization/lib/localization.service.mjs +3 -3
- package/esm2022/theming/lib/theming.service.mjs +3 -3
- package/esm2022/utils/lib/helpers/dom.mjs +3 -2
- package/esm2022/utils/lib/helpers/event-manager.mjs +3 -3
- package/fesm2022/odx-angular-animations.mjs.map +1 -1
- package/fesm2022/odx-angular-breakpoints.mjs +10 -10
- package/fesm2022/odx-angular-breakpoints.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-a11y.mjs +13 -13
- package/fesm2022/odx-angular-cdk-a11y.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-active-indicator.mjs +3 -3
- package/fesm2022/odx-angular-cdk-active-indicator.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-autocomplete-control.mjs +3 -3
- package/fesm2022/odx-angular-cdk-autocomplete-control.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-checkbox-control.mjs +3 -3
- package/fesm2022/odx-angular-cdk-checkbox-control.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-connected-overlay.mjs +6 -6
- package/fesm2022/odx-angular-cdk-connected-overlay.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-custom-form-control.mjs +9 -9
- package/fesm2022/odx-angular-cdk-custom-form-control.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-dynamic-view.mjs +9 -9
- package/fesm2022/odx-angular-cdk-dynamic-view.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-event-plugins.mjs +8 -8
- package/fesm2022/odx-angular-cdk-event-plugins.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-expandable.mjs +10 -10
- package/fesm2022/odx-angular-cdk-expandable.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-option-control.mjs +3 -3
- package/fesm2022/odx-angular-cdk-option-control.mjs.map +1 -1
- package/fesm2022/odx-angular-cdk-radio-group-control.mjs +10 -10
- package/fesm2022/odx-angular-cdk-radio-group-control.mjs.map +1 -1
- package/fesm2022/odx-angular-components-accordion.mjs +13 -13
- package/fesm2022/odx-angular-components-accordion.mjs.map +1 -1
- package/fesm2022/odx-angular-components-action-group.mjs +3 -3
- package/fesm2022/odx-angular-components-action-group.mjs.map +1 -1
- package/fesm2022/odx-angular-components-area-header.mjs +13 -13
- package/fesm2022/odx-angular-components-area-header.mjs.map +1 -1
- package/fesm2022/odx-angular-components-autocomplete.mjs +16 -16
- package/fesm2022/odx-angular-components-autocomplete.mjs.map +1 -1
- package/fesm2022/odx-angular-components-avatar.mjs +3 -3
- package/fesm2022/odx-angular-components-avatar.mjs.map +1 -1
- package/fesm2022/odx-angular-components-badge.mjs +6 -6
- package/fesm2022/odx-angular-components-badge.mjs.map +1 -1
- package/fesm2022/odx-angular-components-bar.mjs +13 -13
- package/fesm2022/odx-angular-components-bar.mjs.map +1 -1
- package/fesm2022/odx-angular-components-breadcrumbs.mjs +3 -3
- package/fesm2022/odx-angular-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/odx-angular-components-button-group.mjs +3 -3
- package/fesm2022/odx-angular-components-button-group.mjs.map +1 -1
- package/fesm2022/odx-angular-components-button.mjs +6 -6
- package/fesm2022/odx-angular-components-button.mjs.map +1 -1
- package/fesm2022/odx-angular-components-calendar.mjs +39 -39
- package/fesm2022/odx-angular-components-calendar.mjs.map +1 -1
- package/fesm2022/odx-angular-components-card.mjs +19 -19
- package/fesm2022/odx-angular-components-card.mjs.map +1 -1
- package/fesm2022/odx-angular-components-checkbox.mjs +10 -10
- package/fesm2022/odx-angular-components-checkbox.mjs.map +1 -1
- package/fesm2022/odx-angular-components-chip.mjs +9 -9
- package/fesm2022/odx-angular-components-chip.mjs.map +1 -1
- package/fesm2022/odx-angular-components-circular-progress.mjs +3 -3
- package/fesm2022/odx-angular-components-circular-progress.mjs.map +1 -1
- package/fesm2022/odx-angular-components-content-box.mjs +13 -13
- package/fesm2022/odx-angular-components-content-box.mjs.map +1 -1
- package/fesm2022/odx-angular-components-datepicker.mjs +10 -10
- package/fesm2022/odx-angular-components-datepicker.mjs.map +1 -1
- package/fesm2022/odx-angular-components-daterangepicker.mjs +16 -16
- package/fesm2022/odx-angular-components-daterangepicker.mjs.map +1 -1
- package/fesm2022/odx-angular-components-dropdown.mjs +10 -10
- package/fesm2022/odx-angular-components-dropdown.mjs.map +1 -1
- package/fesm2022/odx-angular-components-error-page.mjs +3 -3
- package/fesm2022/odx-angular-components-error-page.mjs.map +1 -1
- package/fesm2022/odx-angular-components-footer.mjs +3 -3
- package/fesm2022/odx-angular-components-footer.mjs.map +1 -1
- package/fesm2022/odx-angular-components-form-field.mjs +34 -34
- package/fesm2022/odx-angular-components-form-field.mjs.map +1 -1
- package/fesm2022/odx-angular-components-header-navigation.mjs +13 -13
- package/fesm2022/odx-angular-components-header-navigation.mjs.map +1 -1
- package/fesm2022/odx-angular-components-header.mjs +13 -13
- package/fesm2022/odx-angular-components-header.mjs.map +1 -1
- package/fesm2022/odx-angular-components-icon.mjs +3 -3
- package/fesm2022/odx-angular-components-icon.mjs.map +1 -1
- package/fesm2022/odx-angular-components-inline-message.mjs +3 -3
- package/fesm2022/odx-angular-components-inline-message.mjs.map +1 -1
- package/fesm2022/odx-angular-components-link.mjs +3 -3
- package/fesm2022/odx-angular-components-link.mjs.map +1 -1
- package/fesm2022/odx-angular-components-list.mjs +13 -13
- package/fesm2022/odx-angular-components-list.mjs.map +1 -1
- package/fesm2022/odx-angular-components-loading-spinner.mjs +10 -10
- package/fesm2022/odx-angular-components-loading-spinner.mjs.map +1 -1
- package/fesm2022/odx-angular-components-logo.mjs +3 -3
- package/fesm2022/odx-angular-components-logo.mjs.map +1 -1
- package/fesm2022/odx-angular-components-main-menu.mjs +19 -19
- package/fesm2022/odx-angular-components-main-menu.mjs.map +1 -1
- package/fesm2022/odx-angular-components-mainfilter-group.mjs +3 -3
- package/fesm2022/odx-angular-components-mainfilter-group.mjs.map +1 -1
- package/fesm2022/odx-angular-components-menu.mjs +13 -13
- package/fesm2022/odx-angular-components-menu.mjs.map +1 -1
- package/fesm2022/odx-angular-components-modal.mjs +40 -40
- package/fesm2022/odx-angular-components-modal.mjs.map +1 -1
- package/fesm2022/odx-angular-components-navigation-back.mjs +3 -3
- package/fesm2022/odx-angular-components-navigation-back.mjs.map +1 -1
- package/fesm2022/odx-angular-components-notification-testing.mjs.map +1 -1
- package/fesm2022/odx-angular-components-notification.mjs +15 -15
- package/fesm2022/odx-angular-components-notification.mjs.map +1 -1
- package/fesm2022/odx-angular-components-paginator.mjs +7 -7
- package/fesm2022/odx-angular-components-paginator.mjs.map +1 -1
- package/fesm2022/odx-angular-components-progress.mjs +3 -3
- package/fesm2022/odx-angular-components-progress.mjs.map +1 -1
- package/fesm2022/odx-angular-components-radio-group.mjs +10 -10
- package/fesm2022/odx-angular-components-radio-group.mjs.map +1 -1
- package/fesm2022/odx-angular-components-rail-navigation.mjs +10 -10
- package/fesm2022/odx-angular-components-rail-navigation.mjs.map +1 -1
- package/fesm2022/odx-angular-components-rich-list.mjs +16 -16
- package/fesm2022/odx-angular-components-rich-list.mjs.map +1 -1
- package/fesm2022/odx-angular-components-search-bar.mjs +10 -10
- package/fesm2022/odx-angular-components-search-bar.mjs.map +1 -1
- package/fesm2022/odx-angular-components-select.mjs +16 -16
- package/fesm2022/odx-angular-components-select.mjs.map +1 -1
- package/fesm2022/odx-angular-components-slider.mjs +3 -3
- package/fesm2022/odx-angular-components-slider.mjs.map +1 -1
- package/fesm2022/odx-angular-components-spinbox.mjs +3 -3
- package/fesm2022/odx-angular-components-spinbox.mjs.map +1 -1
- package/fesm2022/odx-angular-components-switch.mjs +10 -10
- package/fesm2022/odx-angular-components-switch.mjs.map +1 -1
- package/fesm2022/odx-angular-components-tab-bar.mjs +10 -10
- package/fesm2022/odx-angular-components-tab-bar.mjs.map +1 -1
- package/fesm2022/odx-angular-components-table.mjs +19 -19
- package/fesm2022/odx-angular-components-table.mjs.map +1 -1
- package/fesm2022/odx-angular-components-timepicker.mjs +17 -17
- package/fesm2022/odx-angular-components-timepicker.mjs.map +1 -1
- package/fesm2022/odx-angular-components-toast.mjs +13 -13
- package/fesm2022/odx-angular-components-toast.mjs.map +1 -1
- package/fesm2022/odx-angular-components-toggle-button-group.mjs +10 -10
- package/fesm2022/odx-angular-components-toggle-button-group.mjs.map +1 -1
- package/fesm2022/odx-angular-components-tooltip.mjs +6 -6
- package/fesm2022/odx-angular-components-tooltip.mjs.map +1 -1
- package/fesm2022/odx-angular-components-wizard.mjs +10 -10
- package/fesm2022/odx-angular-components-wizard.mjs.map +1 -1
- package/fesm2022/odx-angular-internal-translate.mjs +3 -3
- package/fesm2022/odx-angular-internal-translate.mjs.map +1 -1
- package/fesm2022/odx-angular-internal.mjs.map +1 -1
- package/fesm2022/odx-angular-localization.mjs +3 -3
- package/fesm2022/odx-angular-localization.mjs.map +1 -1
- package/fesm2022/odx-angular-rxjs.mjs.map +1 -1
- package/fesm2022/odx-angular-sdk.mjs.map +1 -1
- package/fesm2022/odx-angular-theming.mjs +3 -3
- package/fesm2022/odx-angular-theming.mjs.map +1 -1
- package/fesm2022/odx-angular-utils.mjs +5 -4
- package/fesm2022/odx-angular-utils.mjs.map +1 -1
- package/fesm2022/odx-angular.mjs +28 -28
- package/fesm2022/odx-angular.mjs.map +1 -1
- package/internal/lib/helpers/deepmerge.d.ts +1 -1
- package/localization/lib/localization.config.d.ts +1 -1
- package/package.json +13 -13
- package/theming/lib/theming.config.d.ts +1 -1
- package/utils/lib/helpers/dom.d.ts +1 -1
- package/utils/lib/helpers/provide-config.d.ts +1 -1
|
@@ -28,10 +28,10 @@ class DynamicViewComponent {
|
|
|
28
28
|
setContent(value) {
|
|
29
29
|
this.element.nativeElement.innerHTML = value;
|
|
30
30
|
}
|
|
31
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
32
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
31
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DynamicViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
32
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.12", type: DynamicViewComponent, isStandalone: true, selector: "odx-dynamic-view", inputs: { content: "content" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
33
33
|
}
|
|
34
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DynamicViewComponent, decorators: [{
|
|
35
35
|
type: Component,
|
|
36
36
|
args: [{
|
|
37
37
|
selector: 'odx-dynamic-view',
|
|
@@ -398,10 +398,10 @@ class DynamicViewService {
|
|
|
398
398
|
}
|
|
399
399
|
throw new Error('Content type is not supported');
|
|
400
400
|
}
|
|
401
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
402
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
401
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DynamicViewService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
402
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DynamicViewService, providedIn: 'root' }); }
|
|
403
403
|
}
|
|
404
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
404
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DynamicViewService, decorators: [{
|
|
405
405
|
type: Injectable,
|
|
406
406
|
args: [{ providedIn: 'root' }]
|
|
407
407
|
}] });
|
|
@@ -495,10 +495,10 @@ class DynamicViewDirective {
|
|
|
495
495
|
this.contentViewRef = null;
|
|
496
496
|
this.viewRef = null;
|
|
497
497
|
}
|
|
498
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
499
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
498
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DynamicViewDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
499
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.12", type: DynamicViewDirective, isStandalone: true, selector: "ng-template[odxDynamicView]", inputs: { content: ["odxDynamicView", "content"], injector: ["odxDynamicViewInjector", "injector"], context: ["odxDynamicViewContext", "context"] }, usesOnChanges: true, ngImport: i0 }); }
|
|
500
500
|
}
|
|
501
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
501
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DynamicViewDirective, decorators: [{
|
|
502
502
|
type: Directive,
|
|
503
503
|
args: [{
|
|
504
504
|
selector: 'ng-template[odxDynamicView]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odx-angular-cdk-dynamic-view.mjs","sources":["../../../../libs/angular/cdk/dynamic-view/src/lib/dynamic-view.component.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/helpers/create-projectable-nodes.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/helpers/is-dynamic-text-content.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/models/dynamic-component-ref.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/models/dynamic-template-ref.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/helpers/is-dynamic-view.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/tokens/dynamic-view-context.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/tokens/dynamic-view-default-host.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/dynamic-view.service.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/dynamic-view.directive.ts","../../../../libs/angular/cdk/dynamic-view/src/odx-angular-cdk-dynamic-view.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input, OnDestroy, ViewEncapsulation } from '@angular/core';\nimport { injectElement } from '@odx/angular/utils';\nimport { distinctUntilChanged, isObservable, Subscription } from 'rxjs';\nimport { DynamicTextContent } from './facade';\n\n@Component({\n selector: 'odx-dynamic-view',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n standalone: true,\n})\nexport class DynamicViewComponent implements OnDestroy {\n private readonly element = injectElement();\n private currentSubscription: Subscription | null = null;\n\n @Input()\n public set content(value: DynamicTextContent) {\n if (isObservable(value)) {\n this.ngOnDestroy();\n this.currentSubscription = value.pipe(distinctUntilChanged()).subscribe((innerValue) => {\n this.setContent(innerValue);\n });\n } else {\n this.setContent(value);\n }\n }\n\n public ngOnDestroy(): void {\n this.currentSubscription?.unsubscribe();\n this.currentSubscription = null;\n }\n\n private setContent(value: string): void {\n this.element.nativeElement.innerHTML = value;\n }\n}\n","import { reflectComponentType, Type } from '@angular/core';\n\n/**\n * Prepares an array of node arrays suitable for projection into the `<ng-content>` slots\n * of a dynamically created Angular component based on its content selectors.\n *\n * The function inspects the component's content selectors and aligns the provided nodes\n * for projection according to these selectors. A selector of '*' indicates that the nodes\n * should be projected into this slot. If a content selector does not match '*', an empty\n * array is returned for that slot, indicating no nodes are projected into it.\n *\n * @param {Type<unknown>} component - The component class for which the projectable nodes are being prepared.\n * @param {Node[]} nodes - The nodes intended for projection into the component's `<ng-content>` slots.\n * @returns {Node[][]} An array of node arrays, each corresponding to a `<ng-content>` slot in the component.\n * Each sub-array contains nodes to be projected into the respective `<ng-content>` slot, based on the component's content selectors.\n *\n * @example\n * ```ts\n * // Given a component with two `<ng-content>` slots, the first without a selector and the second with the selector `<ng-content select=\".selector-class\">`,\n * const nodes = [document.createTextNode('Hello'), document.createElement('div')];\n * const projectableNodes = createProjectableNodes(MyComponent, nodes);\n * // projectableNodes would be `[[TextNode, DivElement], []]` for a component with selectors ['*', '.selector-class']\n * ```\n */\nexport function createProjectableNodes(component: Type<unknown>, nodes: Node[]): Node[][] {\n const componentType = reflectComponentType(component);\n if (componentType && componentType.ngContentSelectors.length > 0) {\n return componentType.ngContentSelectors.map((selector) => (selector === '*' ? nodes : []));\n }\n return [];\n}\n","import { isString } from '@odx/angular/utils';\nimport { isObservable } from 'rxjs';\nimport { DynamicTextContent } from '../facade';\n\n/**\n * Type guard function to check if a given value is considered dynamic text content.\n * Dynamic text content can either be a plain string or an Observable. This function\n * facilitates type-safe handling of dynamic text content by checking the type of the value.\n *\n * @param {unknown} value - The value to be checked.\n * @returns {value is DynamicTextContent} Returns `true` if the value is a string or an Observable,\n * indicating it can be used as dynamic text content; otherwise, returns `false`.\n *\n * @example\n * ```ts\n * // Example usage of the isDynamicTextContent function\n * const textValue: unknown = getTextValue(); // This function may return either string or Observable\n *\n * if (isDynamicTextContent(textValue)) {\n * // The type of textValue is now narrowed to DynamicTextContent (string | Observable)\n * console.log('The value can be used as dynamic text content.');\n * } else {\n * console.log('The value is not suitable as dynamic text content.');\n * }\n * ```\n */\nexport function isDynamicTextContent(value: unknown): value is DynamicTextContent {\n return isString(value) || isObservable(value);\n}\n","import { ApplicationRef, ComponentRef, createComponent, EnvironmentInjector, reflectComponentType, Type, ViewRef } from '@angular/core';\nimport { deepmerge } from '@odx/angular/internal';\nimport { isViewContainer } from '@odx/angular/utils';\nimport { GetDynamicViewContext } from '../facade';\nimport { DynamicViewRef } from '../facade/dynamic-view-ref';\nimport { DynamicViewOptions } from './dynamic-view-options';\n\nexport interface DynamicComponentOptions<T extends Type<unknown>> extends DynamicViewOptions<T> {\n component: T;\n}\n\n/**\n * The DynamicComponentRef class is a powerful utility for dynamically creating and managing\n * Angular components at runtime. It encapsulates the logic for component creation, input handling,\n * and lifecycle management, making it easier to work with dynamic components in complex applications.\n *\n * A reference to a dynamically created component, providing methods to manage its lifecycle,\n * detect changes, and update its inputs based on a context.\n *\n * @template T - The type of the component being managed.\n * @template C - The type of the context used to update the component's inputs.\n */\nexport class DynamicComponentRef<T extends Type<unknown>, C extends GetDynamicViewContext<T>> implements DynamicViewRef<T> {\n private readonly application = this.options.injector.get(ApplicationRef);\n private componentRef: ComponentRef<T> | null = null;\n private componentInputs: Record<string, true> | null = null;\n\n constructor(private readonly options: DynamicComponentOptions<T>) {\n const { component, context, injector, projectableNodes, host } = options;\n\n this.componentRef = createComponent(component as Type<T>, {\n environmentInjector: injector.get(EnvironmentInjector),\n elementInjector: injector,\n projectableNodes,\n });\n this.componentInputs =\n reflectComponentType(this.componentRef.componentType)?.inputs.reduce(\n (acc, { propName }) => {\n acc[propName] = true;\n return acc;\n },\n {} as Record<string, true>,\n ) ?? null;\n\n if (isViewContainer(host)) {\n host.insert(this.componentRef.hostView);\n } else {\n this.application.attachView(this.componentRef.hostView);\n if (host) {\n host.appendChild(this.getElement());\n }\n }\n if (context) {\n this.update(context as C);\n }\n }\n\n /**\n * Triggers change detection for the dynamically created component, ensuring that any updates to inputs\n * or internal state are reflected in the view.\n */\n public detectChanges(): void {\n this.componentRef?.changeDetectorRef.detectChanges();\n }\n\n /**\n * Destroys the dynamically created component, cleaning up resources and detaching it from the application view.\n */\n public destroy(): void {\n if (this.componentRef?.hostView.destroyed) {\n this.componentRef = null;\n return;\n }\n if (this.componentRef && !isViewContainer(this.options.host)) {\n this.application.detachView(this.componentRef.hostView);\n }\n this.componentRef?.destroy();\n this.componentRef = null;\n this.componentInputs = null;\n }\n\n /**\n * Retrieves the native element associated with the dynamically created component's host view.\n *\n * @returns {Element} The native DOM element of the component.\n */\n public getElement(): Element {\n return this.componentRef?.location.nativeElement ?? null;\n }\n\n /**\n * Updates the component's inputs based on the provided context. Merges the new context with the existing\n * context and applies the combined context as inputs to the component.\n *\n * @param {C} context - The context containing new values for the component's inputs.\n */\n public update(context: C): void {\n this.options.context = deepmerge({}, this.options.context, context) as C;\n if (!this.componentRef) return;\n for (const key in this.options.context) {\n if (this.componentInputs?.[key]) {\n this.componentRef.setInput(key, this.options.context[key]);\n }\n }\n }\n\n /**\n * Retrieves the current context used for the component's inputs.\n *\n * @returns {GetDynamicViewContext<T>} The current context object.\n */\n public getContext(): GetDynamicViewContext<T> {\n return this.options.context ?? {};\n }\n\n /**\n * Retrieves the view reference associated with the dynamically created component.\n *\n * @returns {ViewRef | null} The view reference, or null if the component has not been created or has been destroyed.\n */\n public getView(): ViewRef | null {\n return this.componentRef?.hostView ?? null;\n }\n}\n","import { ApplicationRef, EmbeddedViewRef, TemplateRef as NgTemplateRef, ViewRef } from '@angular/core';\nimport { deepmerge } from '@odx/angular/internal';\nimport { isViewContainer } from '@odx/angular/utils';\nimport { DynamicViewRef, GetDynamicViewContext } from '../facade';\nimport { DynamicViewOptions } from './dynamic-view-options';\n\nexport interface DynamicTemplateOptions<T extends NgTemplateRef<unknown>> extends DynamicViewOptions<T> {\n template: T;\n}\n\n/**\n * A reference to a dynamically created template, offering methods to manage its lifecycle,\n * detect changes, and update its context. It encapsulates the logic for creating and manipulating\n * an `EmbeddedViewRef` from a given `TemplateRef`.\n *\n * @template T - The type of the `NgTemplateRef` being managed.\n */\nexport class DynamicTemplateRef<T extends NgTemplateRef<unknown> = NgTemplateRef<unknown>> implements DynamicViewRef<T> {\n private readonly application = this.options.injector.get(ApplicationRef);\n private embeddedViewRef: EmbeddedViewRef<unknown> | null = null;\n\n constructor(private readonly options: DynamicTemplateOptions<T>) {\n this.create(options);\n }\n\n /**\n * Triggers change detection on the embedded view created from the template, ensuring that any updates\n * to the context or internal state are reflected in the view.\n */\n public detectChanges(): void {\n this.embeddedViewRef?.detectChanges();\n }\n\n /**\n * Destroys the embedded view associated with the template, cleaning up resources and detaching it from the\n * application view if necessary.\n */\n public destroy(): void {\n if (this.embeddedViewRef?.destroyed) {\n this.embeddedViewRef = null;\n return;\n }\n if (!isViewContainer(this.options.host) && this.embeddedViewRef) {\n this.application.detachView(this.embeddedViewRef);\n }\n this.embeddedViewRef?.destroy();\n this.embeddedViewRef = null;\n }\n\n /**\n * Retrieves the native element associated with the template's embedded view's root node.\n *\n * @returns {Element} The native DOM element of the embedded view's root node, if available.\n */\n public getElement(): Element {\n return this.embeddedViewRef?.rootNodes?.[0] ?? null;\n }\n\n /**\n * Updates the context of the embedded view based on the provided context object. Merges the new context\n * with the existing one and applies the combined context to the embedded view.\n *\n * @param {GetDynamicViewContext<T>} context - The context containing new values for the template's view.\n */\n public update(context: GetDynamicViewContext<T>): void {\n this.options.context = deepmerge({}, this.options.context, context) as GetDynamicViewContext<T>;\n if (this.embeddedViewRef) {\n this.embeddedViewRef.context = this.options.context;\n this.detectChanges();\n }\n }\n\n /**\n * Retrieves the current context used for the template's view.\n *\n * @returns {GetDynamicViewContext<T>} The current context object.\n */\n public getContext(): GetDynamicViewContext<T> {\n return this.options.context ?? {};\n }\n\n /**\n * Retrieves the view reference (`ViewRef`) associated with the dynamically created template's embedded view.\n *\n * @returns {ViewRef | null} The view reference, or null if the template has not been instantiated or has been destroyed.\n */\n public getView(): ViewRef | null {\n return this.embeddedViewRef;\n }\n\n private create({ context, template, host }: DynamicTemplateOptions<T>) {\n if (isViewContainer(host)) {\n this.embeddedViewRef = host.createEmbeddedView(template, context, { injector: this.options.injector });\n } else {\n this.embeddedViewRef = template.createEmbeddedView(context ?? {}, this.options.injector);\n this.application.attachView(this.embeddedViewRef);\n }\n }\n}\n","import { DynamicContent, DynamicViewRef } from '../facade';\nimport { DynamicComponentRef, DynamicTemplateRef } from '../models';\n\n/**\n * Type guard function to check if a given value is a reference to a dynamically created view.\n * This helps in distinguishing between dynamic view references (`DynamicComponentRef` or `DynamicTemplateRef`)\n * and other types of values, facilitating type-safe operations on dynamic views.\n *\n * @param {unknown} value - The value to check.\n * @returns {value is DynamicViewRef<DynamicContent>} `true` if the value is an instance of `DynamicComponentRef`\n * or `DynamicTemplateRef`, indicating it is a dynamic view reference; otherwise, `false`.\n *\n * @example\n * ```ts\n * // Given a value that could be a dynamic view reference or something else\n * const value: unknown = getSomeValue();\n *\n * if (isDynamicView(value)) {\n * // TypeScript now knows `value` is a dynamic view reference, so you can access its methods safely\n * value.detectChanges();\n * } else {\n * console.log('Value is not a dynamic view reference');\n * }\n * ```\n */\nexport function isDynamicView(value: unknown): value is DynamicViewRef<DynamicContent> {\n return value instanceof DynamicComponentRef || value instanceof DynamicTemplateRef;\n}\n","import { InjectionToken, TemplateRef } from '@angular/core';\n\nexport interface DynamicViewContextWithImplicitTemplate<T = unknown> {\n $implicit: TemplateRef<T>;\n}\n\n/**\n * @internal\n * Injection token for the dynamic view context.\n */\nexport const DYNAMIC_VIEW_CONTEXT = new InjectionToken('@odx/angular/cdk/dynamic-view::DynamicViewContext');\n","import { DOCUMENT } from '@angular/common';\nimport { inject, InjectionToken } from '@angular/core';\n\n/**\n * @internal\n * Injection token for the default host element for dynamic views.\n */\nexport const ODX_DYNAMIC_VIEW_DEFAULT_HOST = new InjectionToken<Element>('@odx/angular/cdk/dynamic-view::DynamicViewDefaultHost', {\n providedIn: 'root',\n factory: () => inject(DOCUMENT).body,\n});\n\n/**\n * @internal\n * Retrieves the default host for dynamic views.\n *\n * @returns {Element} The default host element for dynamic views.\n */\nexport function getDynamicViewDefaultHost(): Element {\n return inject(ODX_DYNAMIC_VIEW_DEFAULT_HOST);\n}\n","import { inject, Injectable, Injector } from '@angular/core';\nimport { isComponent, isTemplateRef } from '@odx/angular/utils';\nimport { DynamicViewComponent } from './dynamic-view.component';\nimport { DynamicContent, DynamicViewRef } from './facade';\nimport { isDynamicTextContent } from './helpers';\nimport { DynamicComponentRef, DynamicViewOptions } from './models';\nimport { DynamicTemplateRef } from './models/dynamic-template-ref';\nimport { DYNAMIC_VIEW_CONTEXT, getDynamicViewDefaultHost } from './tokens';\n\n/**\n * A service for creating and managing dynamic views in an Angular application.\n * It supports rendering Angular components, templates, and text content dynamically,\n * allowing for flexible and dynamic content composition.\n */\n@Injectable({ providedIn: 'root' })\nexport class DynamicViewService {\n private readonly injector = inject(Injector);\n private readonly defaultHost = getDynamicViewDefaultHost();\n\n /**\n * Creates and returns a reference to a dynamic view based on the provided content and options.\n * The method supports dynamic creation of components, template references, and text content,\n * providing a unified API for dynamic content rendering.\n *\n * @template T - The type of the content to be dynamically rendered.\n * @param {T} content - The content to be rendered dynamically. This can be a component class,\n * a template reference, or text content.\n * @param {Partial<DynamicViewOptions<T>>} [options={}] - Optional configuration for the dynamic view creation,\n * including a custom injector, context, host element, and additional providers for the dynamic component's injector.\n * @returns {DynamicViewRef<T>} A reference to the dynamically created view, encapsulating the rendered content\n * and providing methods for interaction and management.\n * @throws {Error} Throws an error if the content type is not supported.\n * @example\n * ```ts\n * // Create a dynamic view for a component\n * const componentRef = dynamicViewService.createView(MyComponent, { context: { ... } });\n *\n * // Create a dynamic view for a template reference\n * const templateRef = dynamicViewService.createView(myTemplate, { context: { ... } });\n *\n * // Create a dynamic view for text content\n * const textRef = dynamicViewService.createView('Dynamic text content', {});\n * ```\n */\n public createView<T extends DynamicContent>(content: T, options: Partial<DynamicViewOptions<T>> = {}): DynamicViewRef<T> {\n const viewOptions: DynamicViewOptions<T> = {\n ...options,\n host: options.host ?? this.defaultHost,\n injector: Injector.create({\n providers: [{ provide: DYNAMIC_VIEW_CONTEXT, useValue: options.context }, options.providers ?? []],\n parent: options.injector ?? this.injector,\n }),\n };\n if (isTemplateRef(content)) {\n return new DynamicTemplateRef({ ...viewOptions, template: content });\n }\n if (isComponent(content)) {\n return new DynamicComponentRef({ ...viewOptions, context: options.context, component: content });\n }\n if (isDynamicTextContent(content)) {\n return new DynamicComponentRef({\n ...viewOptions,\n component: DynamicViewComponent,\n context: { content },\n }) as never;\n }\n throw new Error('Content type is not supported');\n }\n}\n","import { Directive, EmbeddedViewRef, inject, Injector, Input, OnChanges, OnDestroy, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { hasChanged, isComponent, NgChanges } from '@odx/angular/utils';\nimport { DynamicViewService } from './dynamic-view.service';\nimport { DynamicContent, DynamicViewRef, GetDynamicViewContext } from './facade';\nimport { createProjectableNodes, isDynamicTextContent, isDynamicView } from './helpers';\n\n/**\n * A directive that dynamically renders content based on the provided input. It supports rendering\n * Angular components, templates, and text content, allowing for dynamic and flexible content\n * management within Angular applications.\n *\n * @template T - A type parameter that extends `DynamicContent<unknown>`, representing the type of content to be dynamically rendered.\n */\n@Directive({\n selector: 'ng-template[odxDynamicView]',\n standalone: true,\n})\nexport class DynamicViewDirective<T extends DynamicContent<unknown> = DynamicContent<unknown>> implements OnDestroy, OnInit, OnChanges {\n private readonly dynamicViewService = inject(DynamicViewService);\n private readonly viewContainer = inject(ViewContainerRef);\n private readonly template = inject(TemplateRef);\n private viewRef: DynamicViewRef<T> | null = null;\n private contentViewRef: DynamicViewRef<TemplateRef<unknown>> | null = null;\n\n /**\n * The content to be dynamically rendered. This can be a component, template reference, or text content.\n * The content is wrapped in a `DynamicViewRef`, providing additional control over the dynamically rendered view.\n *\n * @type {T | DynamicViewRef<T> | null}\n * @default null\n */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxDynamicView')\n public content?: T | DynamicViewRef<T> | null = null;\n\n /**\n * An optional injector to be used for dynamically created components.\n * This allows for custom dependency injection\n * into dynamically rendered components.\n *\n * @type {Injector | undefined}\n */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxDynamicViewInjector')\n public injector?: Injector;\n\n /**\n * An optional context providing function for dynamically created views. This function returns the context\n * object to be passed to the dynamically rendered content, allowing for dynamic interaction with the content.\n *\n * @type {GetDynamicViewContext<T> | undefined}\n */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxDynamicViewContext')\n public context?: GetDynamicViewContext<T>;\n\n public ngOnInit(): void {\n this.render();\n }\n\n public ngOnChanges(changes: NgChanges<DynamicViewDirective<DynamicContent>>): void {\n if (hasChanged(changes, 'injector')) {\n this.render();\n }\n if (hasChanged(changes, 'content')) {\n const hasChangedTextContent = isDynamicTextContent(changes.content?.previousValue) && isDynamicTextContent(changes.content?.currentValue);\n this.render(!hasChangedTextContent);\n }\n if (hasChanged(changes, 'context')) {\n this.viewRef?.update(changes.context?.currentValue ?? {});\n }\n }\n\n public ngOnDestroy(): void {\n this.destroy();\n }\n\n /**\n * Retrieves the current `DynamicViewRef` associated with the rendered content, providing access\n * to the view reference for additional operations like updating context or manual destruction.\n *\n * @returns {DynamicViewRef<T> | null} The current view reference for the dynamically rendered content, if available.\n */\n public getView(): DynamicViewRef<T> | null {\n return this.viewRef;\n }\n\n private render(reRender = true) {\n if (!this.content) {\n this.destroy();\n return;\n }\n if (!reRender && this.viewRef) {\n this.viewRef?.update({ content: this.content } as object);\n return;\n }\n this.viewRef?.destroy();\n if (isDynamicView(this.content)) {\n this.viewRef = this.content;\n const hostView = this.viewRef.getView();\n if (hostView) {\n this.viewContainer.insert(hostView);\n }\n } else {\n let projectableNodes: Node[][] = [];\n if (isComponent(this.content)) {\n this.contentViewRef = this.dynamicViewService.createView(this.template, { injector: this.injector });\n const rootNodes = (this.contentViewRef.getView() as EmbeddedViewRef<unknown>).rootNodes;\n projectableNodes = createProjectableNodes(this.content, rootNodes);\n }\n this.viewRef = this.dynamicViewService.createView(this.content, {\n context: this.context ?? undefined,\n injector: this.injector ?? this.viewContainer.injector,\n projectableNodes,\n host: this.viewContainer,\n });\n }\n }\n\n private destroy() {\n this.contentViewRef?.destroy();\n this.viewRef?.destroy();\n this.contentViewRef = null;\n this.viewRef = null;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAYa,oBAAoB,CAAA;AAPjC,IAAA,WAAA,GAAA;QAQmB,IAAO,CAAA,OAAA,GAAG,aAAa,EAAE,CAAC;QACnC,IAAmB,CAAA,mBAAA,GAAwB,IAAI,CAAC;AAsBzD,KAAA;IApBC,IACW,OAAO,CAAC,KAAyB,EAAA;AAC1C,QAAA,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE;YACvB,IAAI,CAAC,WAAW,EAAE,CAAC;AACnB,YAAA,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,KAAI;AACrF,gBAAA,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAC9B,aAAC,CAAC,CAAC;SACJ;aAAM;AACL,YAAA,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;SACxB;KACF;IAEM,WAAW,GAAA;AAChB,QAAA,IAAI,CAAC,mBAAmB,EAAE,WAAW,EAAE,CAAC;AACxC,QAAA,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;KACjC;AAEO,IAAA,UAAU,CAAC,KAAa,EAAA;QAC9B,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,GAAG,KAAK,CAAC;KAC9C;+GAvBU,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAApB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,oBAAoB,4GALrB,EA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gBAAA,EAAA,SAAA,CAAA,EAAA,QAAA,EAAA,CAAA,wBAAA,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,uBAAA,EAAA,SAAA,CAAA,EAAA,EAAA,aAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;4FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,6BAA6B;AACvC,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA,CAAA;8BAiBQ,OAAO,EAAA,CAAA;sBADb,KAAK;uBAAC,gBAAgB,CAAA;gBAYhB,QAAQ,EAAA,CAAA;sBADd,KAAK;uBAAC,wBAAwB,CAAA;gBAWxB,OAAO,EAAA,CAAA;sBADb,KAAK;uBAAC,uBAAuB,CAAA;;;ACrDhC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"odx-angular-cdk-dynamic-view.mjs","sources":["../../../../libs/angular/cdk/dynamic-view/src/lib/dynamic-view.component.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/helpers/create-projectable-nodes.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/helpers/is-dynamic-text-content.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/models/dynamic-component-ref.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/models/dynamic-template-ref.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/helpers/is-dynamic-view.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/tokens/dynamic-view-context.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/tokens/dynamic-view-default-host.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/dynamic-view.service.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/dynamic-view.directive.ts","../../../../libs/angular/cdk/dynamic-view/src/odx-angular-cdk-dynamic-view.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input, OnDestroy, ViewEncapsulation } from '@angular/core';\nimport { injectElement } from '@odx/angular/utils';\nimport { distinctUntilChanged, isObservable, Subscription } from 'rxjs';\nimport { DynamicTextContent } from './facade';\n\n@Component({\n selector: 'odx-dynamic-view',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n standalone: true,\n})\nexport class DynamicViewComponent implements OnDestroy {\n private readonly element = injectElement();\n private currentSubscription: Subscription | null = null;\n\n @Input()\n public set content(value: DynamicTextContent) {\n if (isObservable(value)) {\n this.ngOnDestroy();\n this.currentSubscription = value.pipe(distinctUntilChanged()).subscribe((innerValue) => {\n this.setContent(innerValue);\n });\n } else {\n this.setContent(value);\n }\n }\n\n public ngOnDestroy(): void {\n this.currentSubscription?.unsubscribe();\n this.currentSubscription = null;\n }\n\n private setContent(value: string): void {\n this.element.nativeElement.innerHTML = value;\n }\n}\n","import { reflectComponentType, Type } from '@angular/core';\n\n/**\n * Prepares an array of node arrays suitable for projection into the `<ng-content>` slots\n * of a dynamically created Angular component based on its content selectors.\n *\n * The function inspects the component's content selectors and aligns the provided nodes\n * for projection according to these selectors. A selector of '*' indicates that the nodes\n * should be projected into this slot. If a content selector does not match '*', an empty\n * array is returned for that slot, indicating no nodes are projected into it.\n *\n * @param {Type<unknown>} component - The component class for which the projectable nodes are being prepared.\n * @param {Node[]} nodes - The nodes intended for projection into the component's `<ng-content>` slots.\n * @returns {Node[][]} An array of node arrays, each corresponding to a `<ng-content>` slot in the component.\n * Each sub-array contains nodes to be projected into the respective `<ng-content>` slot, based on the component's content selectors.\n *\n * @example\n * ```ts\n * // Given a component with two `<ng-content>` slots, the first without a selector and the second with the selector `<ng-content select=\".selector-class\">`,\n * const nodes = [document.createTextNode('Hello'), document.createElement('div')];\n * const projectableNodes = createProjectableNodes(MyComponent, nodes);\n * // projectableNodes would be `[[TextNode, DivElement], []]` for a component with selectors ['*', '.selector-class']\n * ```\n */\nexport function createProjectableNodes(component: Type<unknown>, nodes: Node[]): Node[][] {\n const componentType = reflectComponentType(component);\n if (componentType && componentType.ngContentSelectors.length > 0) {\n return componentType.ngContentSelectors.map((selector) => (selector === '*' ? nodes : []));\n }\n return [];\n}\n","import { isString } from '@odx/angular/utils';\nimport { isObservable } from 'rxjs';\nimport { DynamicTextContent } from '../facade';\n\n/**\n * Type guard function to check if a given value is considered dynamic text content.\n * Dynamic text content can either be a plain string or an Observable. This function\n * facilitates type-safe handling of dynamic text content by checking the type of the value.\n *\n * @param {unknown} value - The value to be checked.\n * @returns {value is DynamicTextContent} Returns `true` if the value is a string or an Observable,\n * indicating it can be used as dynamic text content; otherwise, returns `false`.\n *\n * @example\n * ```ts\n * // Example usage of the isDynamicTextContent function\n * const textValue: unknown = getTextValue(); // This function may return either string or Observable\n *\n * if (isDynamicTextContent(textValue)) {\n * // The type of textValue is now narrowed to DynamicTextContent (string | Observable)\n * console.log('The value can be used as dynamic text content.');\n * } else {\n * console.log('The value is not suitable as dynamic text content.');\n * }\n * ```\n */\nexport function isDynamicTextContent(value: unknown): value is DynamicTextContent {\n return isString(value) || isObservable(value);\n}\n","import { ApplicationRef, ComponentRef, createComponent, EnvironmentInjector, reflectComponentType, Type, ViewRef } from '@angular/core';\nimport { deepmerge } from '@odx/angular/internal';\nimport { isViewContainer } from '@odx/angular/utils';\nimport { GetDynamicViewContext } from '../facade';\nimport { DynamicViewRef } from '../facade/dynamic-view-ref';\nimport { DynamicViewOptions } from './dynamic-view-options';\n\nexport interface DynamicComponentOptions<T extends Type<unknown>> extends DynamicViewOptions<T> {\n component: T;\n}\n\n/**\n * The DynamicComponentRef class is a powerful utility for dynamically creating and managing\n * Angular components at runtime. It encapsulates the logic for component creation, input handling,\n * and lifecycle management, making it easier to work with dynamic components in complex applications.\n *\n * A reference to a dynamically created component, providing methods to manage its lifecycle,\n * detect changes, and update its inputs based on a context.\n *\n * @template T - The type of the component being managed.\n * @template C - The type of the context used to update the component's inputs.\n */\nexport class DynamicComponentRef<T extends Type<unknown>, C extends GetDynamicViewContext<T>> implements DynamicViewRef<T> {\n private readonly application = this.options.injector.get(ApplicationRef);\n private componentRef: ComponentRef<T> | null = null;\n private componentInputs: Record<string, true> | null = null;\n\n constructor(private readonly options: DynamicComponentOptions<T>) {\n const { component, context, injector, projectableNodes, host } = options;\n\n this.componentRef = createComponent(component as Type<T>, {\n environmentInjector: injector.get(EnvironmentInjector),\n elementInjector: injector,\n projectableNodes,\n });\n this.componentInputs =\n reflectComponentType(this.componentRef.componentType)?.inputs.reduce(\n (acc, { propName }) => {\n acc[propName] = true;\n return acc;\n },\n {} as Record<string, true>,\n ) ?? null;\n\n if (isViewContainer(host)) {\n host.insert(this.componentRef.hostView);\n } else {\n this.application.attachView(this.componentRef.hostView);\n if (host) {\n host.appendChild(this.getElement());\n }\n }\n if (context) {\n this.update(context as C);\n }\n }\n\n /**\n * Triggers change detection for the dynamically created component, ensuring that any updates to inputs\n * or internal state are reflected in the view.\n */\n public detectChanges(): void {\n this.componentRef?.changeDetectorRef.detectChanges();\n }\n\n /**\n * Destroys the dynamically created component, cleaning up resources and detaching it from the application view.\n */\n public destroy(): void {\n if (this.componentRef?.hostView.destroyed) {\n this.componentRef = null;\n return;\n }\n if (this.componentRef && !isViewContainer(this.options.host)) {\n this.application.detachView(this.componentRef.hostView);\n }\n this.componentRef?.destroy();\n this.componentRef = null;\n this.componentInputs = null;\n }\n\n /**\n * Retrieves the native element associated with the dynamically created component's host view.\n *\n * @returns {Element} The native DOM element of the component.\n */\n public getElement(): Element {\n return this.componentRef?.location.nativeElement ?? null;\n }\n\n /**\n * Updates the component's inputs based on the provided context. Merges the new context with the existing\n * context and applies the combined context as inputs to the component.\n *\n * @param {C} context - The context containing new values for the component's inputs.\n */\n public update(context: C): void {\n this.options.context = deepmerge({}, this.options.context, context) as C;\n if (!this.componentRef) return;\n for (const key in this.options.context) {\n if (this.componentInputs?.[key]) {\n this.componentRef.setInput(key, this.options.context[key]);\n }\n }\n }\n\n /**\n * Retrieves the current context used for the component's inputs.\n *\n * @returns {GetDynamicViewContext<T>} The current context object.\n */\n public getContext(): GetDynamicViewContext<T> {\n return this.options.context ?? {};\n }\n\n /**\n * Retrieves the view reference associated with the dynamically created component.\n *\n * @returns {ViewRef | null} The view reference, or null if the component has not been created or has been destroyed.\n */\n public getView(): ViewRef | null {\n return this.componentRef?.hostView ?? null;\n }\n}\n","import { ApplicationRef, EmbeddedViewRef, TemplateRef as NgTemplateRef, ViewRef } from '@angular/core';\nimport { deepmerge } from '@odx/angular/internal';\nimport { isViewContainer } from '@odx/angular/utils';\nimport { DynamicViewRef, GetDynamicViewContext } from '../facade';\nimport { DynamicViewOptions } from './dynamic-view-options';\n\nexport interface DynamicTemplateOptions<T extends NgTemplateRef<unknown>> extends DynamicViewOptions<T> {\n template: T;\n}\n\n/**\n * A reference to a dynamically created template, offering methods to manage its lifecycle,\n * detect changes, and update its context. It encapsulates the logic for creating and manipulating\n * an `EmbeddedViewRef` from a given `TemplateRef`.\n *\n * @template T - The type of the `NgTemplateRef` being managed.\n */\nexport class DynamicTemplateRef<T extends NgTemplateRef<unknown> = NgTemplateRef<unknown>> implements DynamicViewRef<T> {\n private readonly application = this.options.injector.get(ApplicationRef);\n private embeddedViewRef: EmbeddedViewRef<unknown> | null = null;\n\n constructor(private readonly options: DynamicTemplateOptions<T>) {\n this.create(options);\n }\n\n /**\n * Triggers change detection on the embedded view created from the template, ensuring that any updates\n * to the context or internal state are reflected in the view.\n */\n public detectChanges(): void {\n this.embeddedViewRef?.detectChanges();\n }\n\n /**\n * Destroys the embedded view associated with the template, cleaning up resources and detaching it from the\n * application view if necessary.\n */\n public destroy(): void {\n if (this.embeddedViewRef?.destroyed) {\n this.embeddedViewRef = null;\n return;\n }\n if (!isViewContainer(this.options.host) && this.embeddedViewRef) {\n this.application.detachView(this.embeddedViewRef);\n }\n this.embeddedViewRef?.destroy();\n this.embeddedViewRef = null;\n }\n\n /**\n * Retrieves the native element associated with the template's embedded view's root node.\n *\n * @returns {Element} The native DOM element of the embedded view's root node, if available.\n */\n public getElement(): Element {\n return this.embeddedViewRef?.rootNodes?.[0] ?? null;\n }\n\n /**\n * Updates the context of the embedded view based on the provided context object. Merges the new context\n * with the existing one and applies the combined context to the embedded view.\n *\n * @param {GetDynamicViewContext<T>} context - The context containing new values for the template's view.\n */\n public update(context: GetDynamicViewContext<T>): void {\n this.options.context = deepmerge({}, this.options.context, context) as GetDynamicViewContext<T>;\n if (this.embeddedViewRef) {\n this.embeddedViewRef.context = this.options.context;\n this.detectChanges();\n }\n }\n\n /**\n * Retrieves the current context used for the template's view.\n *\n * @returns {GetDynamicViewContext<T>} The current context object.\n */\n public getContext(): GetDynamicViewContext<T> {\n return this.options.context ?? {};\n }\n\n /**\n * Retrieves the view reference (`ViewRef`) associated with the dynamically created template's embedded view.\n *\n * @returns {ViewRef | null} The view reference, or null if the template has not been instantiated or has been destroyed.\n */\n public getView(): ViewRef | null {\n return this.embeddedViewRef;\n }\n\n private create({ context, template, host }: DynamicTemplateOptions<T>) {\n if (isViewContainer(host)) {\n this.embeddedViewRef = host.createEmbeddedView(template, context, { injector: this.options.injector });\n } else {\n this.embeddedViewRef = template.createEmbeddedView(context ?? {}, this.options.injector);\n this.application.attachView(this.embeddedViewRef);\n }\n }\n}\n","import { DynamicContent, DynamicViewRef } from '../facade';\nimport { DynamicComponentRef, DynamicTemplateRef } from '../models';\n\n/**\n * Type guard function to check if a given value is a reference to a dynamically created view.\n * This helps in distinguishing between dynamic view references (`DynamicComponentRef` or `DynamicTemplateRef`)\n * and other types of values, facilitating type-safe operations on dynamic views.\n *\n * @param {unknown} value - The value to check.\n * @returns {value is DynamicViewRef<DynamicContent>} `true` if the value is an instance of `DynamicComponentRef`\n * or `DynamicTemplateRef`, indicating it is a dynamic view reference; otherwise, `false`.\n *\n * @example\n * ```ts\n * // Given a value that could be a dynamic view reference or something else\n * const value: unknown = getSomeValue();\n *\n * if (isDynamicView(value)) {\n * // TypeScript now knows `value` is a dynamic view reference, so you can access its methods safely\n * value.detectChanges();\n * } else {\n * console.log('Value is not a dynamic view reference');\n * }\n * ```\n */\nexport function isDynamicView(value: unknown): value is DynamicViewRef<DynamicContent> {\n return value instanceof DynamicComponentRef || value instanceof DynamicTemplateRef;\n}\n","import { InjectionToken, TemplateRef } from '@angular/core';\n\nexport interface DynamicViewContextWithImplicitTemplate<T = unknown> {\n $implicit: TemplateRef<T>;\n}\n\n/**\n * @internal\n * Injection token for the dynamic view context.\n */\nexport const DYNAMIC_VIEW_CONTEXT = new InjectionToken('@odx/angular/cdk/dynamic-view::DynamicViewContext');\n","import { DOCUMENT } from '@angular/common';\nimport { inject, InjectionToken } from '@angular/core';\n\n/**\n * @internal\n * Injection token for the default host element for dynamic views.\n */\nexport const ODX_DYNAMIC_VIEW_DEFAULT_HOST = new InjectionToken<Element>('@odx/angular/cdk/dynamic-view::DynamicViewDefaultHost', {\n providedIn: 'root',\n factory: () => inject(DOCUMENT).body,\n});\n\n/**\n * @internal\n * Retrieves the default host for dynamic views.\n *\n * @returns {Element} The default host element for dynamic views.\n */\nexport function getDynamicViewDefaultHost(): Element {\n return inject(ODX_DYNAMIC_VIEW_DEFAULT_HOST);\n}\n","import { inject, Injectable, Injector } from '@angular/core';\nimport { isComponent, isTemplateRef } from '@odx/angular/utils';\nimport { DynamicViewComponent } from './dynamic-view.component';\nimport { DynamicContent, DynamicViewRef } from './facade';\nimport { isDynamicTextContent } from './helpers';\nimport { DynamicComponentRef, DynamicViewOptions } from './models';\nimport { DynamicTemplateRef } from './models/dynamic-template-ref';\nimport { DYNAMIC_VIEW_CONTEXT, getDynamicViewDefaultHost } from './tokens';\n\n/**\n * A service for creating and managing dynamic views in an Angular application.\n * It supports rendering Angular components, templates, and text content dynamically,\n * allowing for flexible and dynamic content composition.\n */\n@Injectable({ providedIn: 'root' })\nexport class DynamicViewService {\n private readonly injector = inject(Injector);\n private readonly defaultHost = getDynamicViewDefaultHost();\n\n /**\n * Creates and returns a reference to a dynamic view based on the provided content and options.\n * The method supports dynamic creation of components, template references, and text content,\n * providing a unified API for dynamic content rendering.\n *\n * @template T - The type of the content to be dynamically rendered.\n * @param {T} content - The content to be rendered dynamically. This can be a component class,\n * a template reference, or text content.\n * @param {Partial<DynamicViewOptions<T>>} [options={}] - Optional configuration for the dynamic view creation,\n * including a custom injector, context, host element, and additional providers for the dynamic component's injector.\n * @returns {DynamicViewRef<T>} A reference to the dynamically created view, encapsulating the rendered content\n * and providing methods for interaction and management.\n * @throws {Error} Throws an error if the content type is not supported.\n * @example\n * ```ts\n * // Create a dynamic view for a component\n * const componentRef = dynamicViewService.createView(MyComponent, { context: { ... } });\n *\n * // Create a dynamic view for a template reference\n * const templateRef = dynamicViewService.createView(myTemplate, { context: { ... } });\n *\n * // Create a dynamic view for text content\n * const textRef = dynamicViewService.createView('Dynamic text content', {});\n * ```\n */\n public createView<T extends DynamicContent>(content: T, options: Partial<DynamicViewOptions<T>> = {}): DynamicViewRef<T> {\n const viewOptions: DynamicViewOptions<T> = {\n ...options,\n host: options.host ?? this.defaultHost,\n injector: Injector.create({\n providers: [{ provide: DYNAMIC_VIEW_CONTEXT, useValue: options.context }, options.providers ?? []],\n parent: options.injector ?? this.injector,\n }),\n };\n if (isTemplateRef(content)) {\n return new DynamicTemplateRef({ ...viewOptions, template: content });\n }\n if (isComponent(content)) {\n return new DynamicComponentRef({ ...viewOptions, context: options.context, component: content });\n }\n if (isDynamicTextContent(content)) {\n return new DynamicComponentRef({\n ...viewOptions,\n component: DynamicViewComponent,\n context: { content },\n }) as never;\n }\n throw new Error('Content type is not supported');\n }\n}\n","import { Directive, EmbeddedViewRef, inject, Injector, Input, OnChanges, OnDestroy, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { hasChanged, isComponent, NgChanges } from '@odx/angular/utils';\nimport { DynamicViewService } from './dynamic-view.service';\nimport { DynamicContent, DynamicViewRef, GetDynamicViewContext } from './facade';\nimport { createProjectableNodes, isDynamicTextContent, isDynamicView } from './helpers';\n\n/**\n * A directive that dynamically renders content based on the provided input. It supports rendering\n * Angular components, templates, and text content, allowing for dynamic and flexible content\n * management within Angular applications.\n *\n * @template T - A type parameter that extends `DynamicContent<unknown>`, representing the type of content to be dynamically rendered.\n */\n@Directive({\n selector: 'ng-template[odxDynamicView]',\n standalone: true,\n})\nexport class DynamicViewDirective<T extends DynamicContent<unknown> = DynamicContent<unknown>> implements OnDestroy, OnInit, OnChanges {\n private readonly dynamicViewService = inject(DynamicViewService);\n private readonly viewContainer = inject(ViewContainerRef);\n private readonly template = inject(TemplateRef);\n private viewRef: DynamicViewRef<T> | null = null;\n private contentViewRef: DynamicViewRef<TemplateRef<unknown>> | null = null;\n\n /**\n * The content to be dynamically rendered. This can be a component, template reference, or text content.\n * The content is wrapped in a `DynamicViewRef`, providing additional control over the dynamically rendered view.\n *\n * @type {T | DynamicViewRef<T> | null}\n * @default null\n */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxDynamicView')\n public content?: T | DynamicViewRef<T> | null = null;\n\n /**\n * An optional injector to be used for dynamically created components.\n * This allows for custom dependency injection\n * into dynamically rendered components.\n *\n * @type {Injector | undefined}\n */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxDynamicViewInjector')\n public injector?: Injector;\n\n /**\n * An optional context providing function for dynamically created views. This function returns the context\n * object to be passed to the dynamically rendered content, allowing for dynamic interaction with the content.\n *\n * @type {GetDynamicViewContext<T> | undefined}\n */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('odxDynamicViewContext')\n public context?: GetDynamicViewContext<T>;\n\n public ngOnInit(): void {\n this.render();\n }\n\n public ngOnChanges(changes: NgChanges<DynamicViewDirective<DynamicContent>>): void {\n if (hasChanged(changes, 'injector')) {\n this.render();\n }\n if (hasChanged(changes, 'content')) {\n const hasChangedTextContent = isDynamicTextContent(changes.content?.previousValue) && isDynamicTextContent(changes.content?.currentValue);\n this.render(!hasChangedTextContent);\n }\n if (hasChanged(changes, 'context')) {\n this.viewRef?.update(changes.context?.currentValue ?? {});\n }\n }\n\n public ngOnDestroy(): void {\n this.destroy();\n }\n\n /**\n * Retrieves the current `DynamicViewRef` associated with the rendered content, providing access\n * to the view reference for additional operations like updating context or manual destruction.\n *\n * @returns {DynamicViewRef<T> | null} The current view reference for the dynamically rendered content, if available.\n */\n public getView(): DynamicViewRef<T> | null {\n return this.viewRef;\n }\n\n private render(reRender = true) {\n if (!this.content) {\n this.destroy();\n return;\n }\n if (!reRender && this.viewRef) {\n this.viewRef?.update({ content: this.content } as object);\n return;\n }\n this.viewRef?.destroy();\n if (isDynamicView(this.content)) {\n this.viewRef = this.content;\n const hostView = this.viewRef.getView();\n if (hostView) {\n this.viewContainer.insert(hostView);\n }\n } else {\n let projectableNodes: Node[][] = [];\n if (isComponent(this.content)) {\n this.contentViewRef = this.dynamicViewService.createView(this.template, { injector: this.injector });\n const rootNodes = (this.contentViewRef.getView() as EmbeddedViewRef<unknown>).rootNodes;\n projectableNodes = createProjectableNodes(this.content, rootNodes);\n }\n this.viewRef = this.dynamicViewService.createView(this.content, {\n context: this.context ?? undefined,\n injector: this.injector ?? this.viewContainer.injector,\n projectableNodes,\n host: this.viewContainer,\n });\n }\n }\n\n private destroy() {\n this.contentViewRef?.destroy();\n this.viewRef?.destroy();\n this.contentViewRef = null;\n this.viewRef = null;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAYa,oBAAoB,CAAA;AAPjC,IAAA,WAAA,GAAA;QAQmB,IAAO,CAAA,OAAA,GAAG,aAAa,EAAE;QAClC,IAAmB,CAAA,mBAAA,GAAwB,IAAI;AAsBxD;IApBC,IACW,OAAO,CAAC,KAAyB,EAAA;AAC1C,QAAA,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE;YACvB,IAAI,CAAC,WAAW,EAAE;AAClB,YAAA,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,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AAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,6BAA6B;AACvC,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;8BAiBQ,OAAO,EAAA,CAAA;sBADb,KAAK;uBAAC,gBAAgB;gBAYhB,QAAQ,EAAA,CAAA;sBADd,KAAK;uBAAC,wBAAwB;gBAWxB,OAAO,EAAA,CAAA;sBADb,KAAK;uBAAC,uBAAuB;;;ACrDhC;;AAEG;;;;"}
|
|
@@ -63,7 +63,7 @@ class EventPlugin {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/* istanbul ignore file */
|
|
66
|
-
/* eslint-disable @typescript-eslint/
|
|
66
|
+
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
|
|
67
67
|
const DEFAULT_DELAY = 250;
|
|
68
68
|
/**
|
|
69
69
|
* A service that extends `EventPlugin` for debouncing events. This service wraps event listeners
|
|
@@ -118,15 +118,15 @@ class DebounceEventPlugin extends EventPlugin {
|
|
|
118
118
|
});
|
|
119
119
|
return this.teardown(listener);
|
|
120
120
|
}
|
|
121
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
122
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
121
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DebounceEventPlugin, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
122
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DebounceEventPlugin }); }
|
|
123
123
|
}
|
|
124
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DebounceEventPlugin, decorators: [{
|
|
125
125
|
type: Injectable
|
|
126
126
|
}] });
|
|
127
127
|
|
|
128
128
|
/* istanbul ignore file */
|
|
129
|
-
/* eslint-disable @typescript-eslint/
|
|
129
|
+
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
|
|
130
130
|
/**
|
|
131
131
|
* A service that extends `EventPlugin` to allow event handlers to be deferred until the end of the current call stack.
|
|
132
132
|
* This can improve performance by avoiding triggering Angular's change detection unnecessarily.
|
|
@@ -166,10 +166,10 @@ class DeferEventPlugin extends EventPlugin {
|
|
|
166
166
|
setTimeout(() => this.getZone().runGuarded(() => originalHandler(event)), 0);
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
170
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
169
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DeferEventPlugin, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
170
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DeferEventPlugin }); }
|
|
171
171
|
}
|
|
172
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DeferEventPlugin, decorators: [{
|
|
173
173
|
type: Injectable
|
|
174
174
|
}] });
|
|
175
175
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odx-angular-cdk-event-plugins.mjs","sources":["../../../../libs/angular/cdk/event-plugins/src/lib/models/event-plugin.ts","../../../../libs/angular/cdk/event-plugins/src/lib/plugins/debounce-event-plugin.ts","../../../../libs/angular/cdk/event-plugins/src/lib/plugins/defer-event-plugin.ts","../../../../libs/angular/cdk/event-plugins/src/lib/event-plugins.config.ts","../../../../libs/angular/cdk/event-plugins/src/odx-angular-cdk-event-plugins.ts"],"sourcesContent":["/* istanbul ignore file */\n/* eslint-disable @typescript-eslint/ban-types */\nimport { NgZone } from '@angular/core';\nimport { EventManager } from '@angular/platform-browser';\nimport { isFunction } from '@odx/angular/utils';\n\ntype EventManagerArg = ConstructorParameters<typeof EventManager>[0][0];\n\ntype EventManagerPlugin = {\n [K in keyof EventManagerArg]: EventManagerArg[K];\n};\n\n/**\n * An abstract class for implementing custom event plugins in Angular. This class provides\n * the core functionality required to create a custom event listener with specific behavior,\n * allowing developers to extend Angular's native event handling capabilities.\n *\n * @example\n * Extending EventPlugin to create a custom event plugin:\n * ```ts\n * @Injectable()\n * class CustomEventPlugin extends EventPlugin {\n * public readonly modifier = /custom/;\n *\n * public addEventListener(element: HTMLElement, eventName: string, handler: EventListener): Function {\n * // Custom logic for adding an event listener\n * }\n * }\n * ```\n *\n * ```html\n * <div (click.custom)=\"handleClick($event)\"></div>\n * ```\n */\nexport abstract class EventPlugin implements EventManagerPlugin {\n protected abstract readonly modifier: RegExp;\n\n /**\n * The event manager for handling events.\n *\n * @type {EventManager}\n */\n public manager!: EventManager;\n\n /**\n * Adds an event listener to the given element.\n *\n * @param {HTMLElement} element - The element to attach the event listener to.\n * @param {string} eventName - The name of the event.\n * @param {EventListener} handler - The event listener function.\n * @returns {Function} - A function that can be called to remove the event listener.\n */\n public abstract addEventListener(element: HTMLElement, eventName: string, handler: EventListener): Function;\n\n /**\n * Adds a global event listener.\n *\n * @returns {Function} - A function that does nothing.\n */\n public addGlobalEventListener(): Function {\n return () => void 0;\n }\n\n /**\n * Checks if the event plugin supports the given event name.\n *\n * @param {string} eventName - The name of the event.\n * @returns {boolean} - `true` if the event plugin supports the event, `false` otherwise.\n */\n public supports(eventName: string): boolean {\n return this.modifier.test(eventName);\n }\n\n /**\n * Gets the NgZone instance from the event manager.\n *\n * @returns {NgZone} - The NgZone instance.\n */\n protected getZone(): NgZone {\n return this.manager.getZone();\n }\n\n /**\n * Tears down the event listener.\n *\n * @param {Function | null} listener - The event listener function.\n * @returns {Function} - A function that can be called to clean up the listener.\n */\n protected teardown(listener: Function | null): () => void {\n return () => (isFunction(listener) ? listener() : void 0);\n }\n}\n","/* istanbul ignore file */\n/* eslint-disable @typescript-eslint/ban-types */\nimport { Injectable, numberAttribute } from '@angular/core';\nimport { debounce } from '@odx/angular/utils';\nimport { EventPlugin } from '../models';\n\nconst DEFAULT_DELAY = 250;\n\n/**\n * A service that extends `EventPlugin` for debouncing events. This service wraps event listeners\n * and ensures that they are triggered no more than once per specified delay period. It is\n * particularly useful for handling events that fire frequently, such as mouse movements\n * or keystrokes, in a performant manner.\n *\n * The delay period can be specified directly in the event name using the syntax\n * `(eventName.debounce.delay)`, where `delay` is the debounce duration in milliseconds.\n * If no delay is specified, a default delay of 250 milliseconds is used.\n *\n * @example\n * Provide the `DebounceEventPlugin` in an Angular module:\n * ```ts\n * @NgModule({\n * providers: [\n * ...\n * provideEventPlugins(),\n * ...\n * ],\n * })\n * export class AppModule {}\n * ```\n *\n * In a component template, apply the debounce modifier to an event, specifying a custom delay:\n * ```html\n * <button (click.debounce.400)=\"handleClick($event)\"></button>\n * ```\n * In a component template, apply the debounce modifier with the default delay:\n * ```html\n * <input (keyup.debounce)=\"onKeyUp($event)\" placeholder=\"Type here...\">\n * ```\n */\n@Injectable()\nexport class DebounceEventPlugin extends EventPlugin {\n public readonly modifier = /debounce/;\n\n public addEventListener(element: HTMLElement, eventName: string, originalHandler: EventListener): Function {\n const [name, , delay] = eventName.split('.');\n const handler = this.createHandler(originalHandler, numberAttribute(delay, DEFAULT_DELAY));\n\n return this.runOutsideAngular(() => this.manager.addEventListener(element, name, handler));\n }\n\n private createHandler(originalHandler: EventListener, delay: number): (event: Event) => void {\n const innerHandler = (event: Event): void => this.getZone().runGuarded(() => originalHandler(event));\n\n return debounce(innerHandler, delay);\n }\n\n private runOutsideAngular(addListener: () => Function): () => void {\n let listener: Function | null = null;\n this.getZone().runOutsideAngular(() => {\n listener = addListener();\n });\n\n return this.teardown(listener);\n }\n}\n","/* istanbul ignore file */\n/* eslint-disable @typescript-eslint/ban-types */\nimport { Injectable } from '@angular/core';\nimport { EventPlugin } from '../models';\n\n/**\n * A service that extends `EventPlugin` to allow event handlers to be deferred until the end of the current call stack.\n * This can improve performance by avoiding triggering Angular's change detection unnecessarily.\n *\n * @example\n * Provide the `DeferEventPlugin` in an Angular module:\n * ```ts\n * @NgModule({\n * providers: [\n * ...\n * provideEventPlugins(),\n * ...\n * ],\n * })\n * export class AppModule {}\n * ```\n *\n * In your Angular component:\n * ```html\n * <button (click.defer)=\"handleClick($event)\"></button>\n * ```\n *\n * The `.defer` modifier in the event name `click.defer` indicates that the event handler should be deferred.\n */\n@Injectable()\nexport class DeferEventPlugin extends EventPlugin {\n public readonly modifier = /defer/;\n\n public addEventListener(element: HTMLElement, eventName: string, originalHandler: EventListener): Function {\n const [name] = eventName.split('.');\n const handler = this.createHandler(originalHandler);\n\n return this.getZone().runOutsideAngular(() => this.manager.addEventListener(element, name, handler));\n }\n\n private createHandler(originalHandler: EventListener): (event: Event) => void {\n return (event: Event): void => {\n setTimeout(() => this.getZone().runGuarded(() => originalHandler(event)), 0);\n };\n }\n}\n","import { EnvironmentProviders, Provider, makeEnvironmentProviders } from '@angular/core';\nimport { EVENT_MANAGER_PLUGINS } from '@angular/platform-browser';\nimport { DebounceEventPlugin, DeferEventPlugin } from './plugins';\n\nconst PLUGINS = [DebounceEventPlugin, DeferEventPlugin];\n\nexport const EVENT_PLUGINS: Provider[] = PLUGINS.map((useClass) => ({\n provide: EVENT_MANAGER_PLUGINS,\n useClass,\n multi: true,\n}));\n\n/**\n * Provides a set of custom event plugins to Angular's event handling system. This function\n * registers custom event plugins like `DebounceEventPlugin` and `DeferEventPlugin`, enhancing\n * the capabilities of Angular's native event management. By using `EVENT_MANAGER_PLUGINS`, these\n * plugins are integrated into Angular's event system and can be utilized in templates and components\n * to handle events with custom behaviors such as debouncing or deferring event execution.\n *\n * @example\n * Registering the event plugins in an Angular module:\n * ```ts\n * @NgModule({\n * imports: [\n * BrowserModule,\n * BrowserAnimationsModule,\n * // other imports...\n * ],\n * declarations: [AppComponent],\n * providers: [\n * provideEventPlugins(),\n * ],\n * bootstrap: [AppComponent],\n * })\n * export class AppModule {}\n * ```\n * Assuming `DebounceEventPlugin` modifies event names with a `.debounce` modifier:\n * ```html\n * <button (click.debounce)=\"handleDebouncedClick($event)\">Click Me</button>\n * ```\n * Assuming `DeferEventPlugin` modifies event names with a `.defer` modifier:\n * ```html\n * <div (mouseenter.defer)=\"handleDeferredMouseEnter($event)\"></div>\n * ```\n *\n * @returns {EnvironmentProviders} - A configuration object for Angular's DI system, to be used with `makeEnvironmentProviders`.\n */\nexport function provideEventPlugins(): EnvironmentProviders {\n return makeEnvironmentProviders(EVENT_PLUGINS);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAYA;;;;;;;;;;;;;;;;;;;;;AAqBG;MACmB,WAAW,CAAA;AAoB/B;;;;AAIG;IACI,sBAAsB,GAAA;AAC3B,QAAA,OAAO,MAAM,KAAK,CAAC,CAAC;KACrB;AAED;;;;;AAKG;AACI,IAAA,QAAQ,CAAC,SAAiB,EAAA;QAC/B,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KACtC;AAED;;;;AAIG;IACO,OAAO,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;KAC/B;AAED;;;;;AAKG;AACO,IAAA,QAAQ,CAAC,QAAyB,EAAA;AAC1C,QAAA,OAAO,OAAO,UAAU,CAAC,QAAQ,CAAC,GAAG,QAAQ,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC;KAC3D;AACF;;AC3FD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AM;AAClE,IAAA,OAAO,EAAE,qBAAqB;IAC9B,QAAQ;AACR,IAAA,KAAK,EAAE,IAAI;AACZ,CAAA,CAAC,EAAE;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;SACa,mBAAmB,GAAA;AACjC,IAAA,OAAO,wBAAwB,CAAC,aAAa,CAAC,CAAC;AACjD;;ACjDA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"odx-angular-cdk-event-plugins.mjs","sources":["../../../../libs/angular/cdk/event-plugins/src/lib/models/event-plugin.ts","../../../../libs/angular/cdk/event-plugins/src/lib/plugins/debounce-event-plugin.ts","../../../../libs/angular/cdk/event-plugins/src/lib/plugins/defer-event-plugin.ts","../../../../libs/angular/cdk/event-plugins/src/lib/event-plugins.config.ts","../../../../libs/angular/cdk/event-plugins/src/odx-angular-cdk-event-plugins.ts"],"sourcesContent":["/* istanbul ignore file */\n/* eslint-disable @typescript-eslint/no-unsafe-function-type */\nimport { NgZone } from '@angular/core';\nimport { EventManager } from '@angular/platform-browser';\nimport { isFunction } from '@odx/angular/utils';\n\ntype EventManagerArg = ConstructorParameters<typeof EventManager>[0][0];\n\ntype EventManagerPlugin = {\n [K in keyof EventManagerArg]: EventManagerArg[K];\n};\n\n/**\n * An abstract class for implementing custom event plugins in Angular. This class provides\n * the core functionality required to create a custom event listener with specific behavior,\n * allowing developers to extend Angular's native event handling capabilities.\n *\n * @example\n * Extending EventPlugin to create a custom event plugin:\n * ```ts\n * @Injectable()\n * class CustomEventPlugin extends EventPlugin {\n * public readonly modifier = /custom/;\n *\n * public addEventListener(element: HTMLElement, eventName: string, handler: EventListener): Function {\n * // Custom logic for adding an event listener\n * }\n * }\n * ```\n *\n * ```html\n * <div (click.custom)=\"handleClick($event)\"></div>\n * ```\n */\nexport abstract class EventPlugin implements EventManagerPlugin {\n protected abstract readonly modifier: RegExp;\n\n /**\n * The event manager for handling events.\n *\n * @type {EventManager}\n */\n public manager!: EventManager;\n\n /**\n * Adds an event listener to the given element.\n *\n * @param {HTMLElement} element - The element to attach the event listener to.\n * @param {string} eventName - The name of the event.\n * @param {EventListener} handler - The event listener function.\n * @returns {Function} - A function that can be called to remove the event listener.\n */\n public abstract addEventListener(element: HTMLElement, eventName: string, handler: EventListener): Function;\n\n /**\n * Adds a global event listener.\n *\n * @returns {Function} - A function that does nothing.\n */\n public addGlobalEventListener(): Function {\n return () => void 0;\n }\n\n /**\n * Checks if the event plugin supports the given event name.\n *\n * @param {string} eventName - The name of the event.\n * @returns {boolean} - `true` if the event plugin supports the event, `false` otherwise.\n */\n public supports(eventName: string): boolean {\n return this.modifier.test(eventName);\n }\n\n /**\n * Gets the NgZone instance from the event manager.\n *\n * @returns {NgZone} - The NgZone instance.\n */\n protected getZone(): NgZone {\n return this.manager.getZone();\n }\n\n /**\n * Tears down the event listener.\n *\n * @param {Function | null} listener - The event listener function.\n * @returns {Function} - A function that can be called to clean up the listener.\n */\n protected teardown(listener: Function | null): () => void {\n return () => (isFunction(listener) ? listener() : void 0);\n }\n}\n","/* istanbul ignore file */\n/* eslint-disable @typescript-eslint/no-unsafe-function-type */\nimport { Injectable, numberAttribute } from '@angular/core';\nimport { debounce } from '@odx/angular/utils';\nimport { EventPlugin } from '../models';\n\nconst DEFAULT_DELAY = 250;\n\n/**\n * A service that extends `EventPlugin` for debouncing events. This service wraps event listeners\n * and ensures that they are triggered no more than once per specified delay period. It is\n * particularly useful for handling events that fire frequently, such as mouse movements\n * or keystrokes, in a performant manner.\n *\n * The delay period can be specified directly in the event name using the syntax\n * `(eventName.debounce.delay)`, where `delay` is the debounce duration in milliseconds.\n * If no delay is specified, a default delay of 250 milliseconds is used.\n *\n * @example\n * Provide the `DebounceEventPlugin` in an Angular module:\n * ```ts\n * @NgModule({\n * providers: [\n * ...\n * provideEventPlugins(),\n * ...\n * ],\n * })\n * export class AppModule {}\n * ```\n *\n * In a component template, apply the debounce modifier to an event, specifying a custom delay:\n * ```html\n * <button (click.debounce.400)=\"handleClick($event)\"></button>\n * ```\n * In a component template, apply the debounce modifier with the default delay:\n * ```html\n * <input (keyup.debounce)=\"onKeyUp($event)\" placeholder=\"Type here...\">\n * ```\n */\n@Injectable()\nexport class DebounceEventPlugin extends EventPlugin {\n public readonly modifier = /debounce/;\n\n public addEventListener(element: HTMLElement, eventName: string, originalHandler: EventListener): Function {\n const [name, , delay] = eventName.split('.');\n const handler = this.createHandler(originalHandler, numberAttribute(delay, DEFAULT_DELAY));\n\n return this.runOutsideAngular(() => this.manager.addEventListener(element, name, handler));\n }\n\n private createHandler(originalHandler: EventListener, delay: number): (event: Event) => void {\n const innerHandler = (event: Event): void => this.getZone().runGuarded(() => originalHandler(event));\n\n return debounce(innerHandler, delay);\n }\n\n private runOutsideAngular(addListener: () => Function): () => void {\n let listener: Function | null = null;\n this.getZone().runOutsideAngular(() => {\n listener = addListener();\n });\n\n return this.teardown(listener);\n }\n}\n","/* istanbul ignore file */\n/* eslint-disable @typescript-eslint/no-unsafe-function-type */\nimport { Injectable } from '@angular/core';\nimport { EventPlugin } from '../models';\n\n/**\n * A service that extends `EventPlugin` to allow event handlers to be deferred until the end of the current call stack.\n * This can improve performance by avoiding triggering Angular's change detection unnecessarily.\n *\n * @example\n * Provide the `DeferEventPlugin` in an Angular module:\n * ```ts\n * @NgModule({\n * providers: [\n * ...\n * provideEventPlugins(),\n * ...\n * ],\n * })\n * export class AppModule {}\n * ```\n *\n * In your Angular component:\n * ```html\n * <button (click.defer)=\"handleClick($event)\"></button>\n * ```\n *\n * The `.defer` modifier in the event name `click.defer` indicates that the event handler should be deferred.\n */\n@Injectable()\nexport class DeferEventPlugin extends EventPlugin {\n public readonly modifier = /defer/;\n\n public addEventListener(element: HTMLElement, eventName: string, originalHandler: EventListener): Function {\n const [name] = eventName.split('.');\n const handler = this.createHandler(originalHandler);\n\n return this.getZone().runOutsideAngular(() => this.manager.addEventListener(element, name, handler));\n }\n\n private createHandler(originalHandler: EventListener): (event: Event) => void {\n return (event: Event): void => {\n setTimeout(() => this.getZone().runGuarded(() => originalHandler(event)), 0);\n };\n }\n}\n","import { EnvironmentProviders, Provider, makeEnvironmentProviders } from '@angular/core';\nimport { EVENT_MANAGER_PLUGINS } from '@angular/platform-browser';\nimport { DebounceEventPlugin, DeferEventPlugin } from './plugins';\n\nconst PLUGINS = [DebounceEventPlugin, DeferEventPlugin];\n\nexport const EVENT_PLUGINS: Provider[] = PLUGINS.map((useClass) => ({\n provide: EVENT_MANAGER_PLUGINS,\n useClass,\n multi: true,\n}));\n\n/**\n * Provides a set of custom event plugins to Angular's event handling system. This function\n * registers custom event plugins like `DebounceEventPlugin` and `DeferEventPlugin`, enhancing\n * the capabilities of Angular's native event management. By using `EVENT_MANAGER_PLUGINS`, these\n * plugins are integrated into Angular's event system and can be utilized in templates and components\n * to handle events with custom behaviors such as debouncing or deferring event execution.\n *\n * @example\n * Registering the event plugins in an Angular module:\n * ```ts\n * @NgModule({\n * imports: [\n * BrowserModule,\n * BrowserAnimationsModule,\n * // other imports...\n * ],\n * declarations: [AppComponent],\n * providers: [\n * provideEventPlugins(),\n * ],\n * bootstrap: [AppComponent],\n * })\n * export class AppModule {}\n * ```\n * Assuming `DebounceEventPlugin` modifies event names with a `.debounce` modifier:\n * ```html\n * <button (click.debounce)=\"handleDebouncedClick($event)\">Click Me</button>\n * ```\n * Assuming `DeferEventPlugin` modifies event names with a `.defer` modifier:\n * ```html\n * <div (mouseenter.defer)=\"handleDeferredMouseEnter($event)\"></div>\n * ```\n *\n * @returns {EnvironmentProviders} - A configuration object for Angular's DI system, to be used with `makeEnvironmentProviders`.\n */\nexport function provideEventPlugins(): EnvironmentProviders {\n return makeEnvironmentProviders(EVENT_PLUGINS);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAYA;;;;;;;;;;;;;;;;;;;;;AAqBG;MACmB,WAAW,CAAA;AAoB/B;;;;AAIG;IACI,sBAAsB,GAAA;AAC3B,QAAA,OAAO,MAA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;mHAAhB,gBAAgB,EAAA,CAAA,CAAA;;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B;;;ACzBD,MAAM,OAAO,GAAG,CAAC,mBAAmB,EAAE,gBAAgB,CAAC;AAEhD,MAAM,aAAa,GAAe,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,MAAM;AAClE,IAAA,OAAO,EAAE,qBAAqB;IAC9B,QAAQ;AACR,IAAA,KAAK,EAAE,IAAI;AACZ,CAAA,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;SACa,mBAAmB,GAAA;AACjC,IAAA,OAAO,wBAAwB,CAAC,aAAa,CAAC;AAChD;;ACjDA;;AAEG;;;;"}
|
|
@@ -90,10 +90,10 @@ class ExpandableContainerDirective {
|
|
|
90
90
|
hasExpandedItem() {
|
|
91
91
|
return this.expandedItems.size > 0;
|
|
92
92
|
}
|
|
93
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
94
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "
|
|
93
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ExpandableContainerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
94
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.12", type: ExpandableContainerDirective, isStandalone: true, selector: "[odxExpandableContainer]", inputs: { multiple: ["multiple", "multiple", booleanAttribute] }, providers: [{ provide: ODX_EXPANDABLE_CONTAINER, useExisting: ExpandableContainerDirective }], exportAs: ["odxExpandableContainer"], ngImport: i0 }); }
|
|
95
95
|
}
|
|
96
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
96
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ExpandableContainerDirective, decorators: [{
|
|
97
97
|
type: Directive,
|
|
98
98
|
args: [{
|
|
99
99
|
standalone: true,
|
|
@@ -201,10 +201,10 @@ class ExpandableItemDirective {
|
|
|
201
201
|
closeAllChildren() {
|
|
202
202
|
this.childContainers.forEach((container) => container.collapseAll());
|
|
203
203
|
}
|
|
204
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
205
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "
|
|
204
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ExpandableItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
205
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.12", type: ExpandableItemDirective, isStandalone: true, selector: "[odxExpandableItem]", inputs: { container: "container", id: "id", expanded: ["expanded", "expanded", booleanAttribute] }, providers: [{ provide: ODX_EXPANDABLE_ITEM, useExisting: ExpandableItemDirective }], exportAs: ["odxExpandableItem"], ngImport: i0 }); }
|
|
206
206
|
}
|
|
207
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
207
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ExpandableItemDirective, decorators: [{
|
|
208
208
|
type: Directive,
|
|
209
209
|
args: [{
|
|
210
210
|
standalone: true,
|
|
@@ -223,11 +223,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
223
223
|
|
|
224
224
|
const modules = [ExpandableContainerDirective, ExpandableItemDirective];
|
|
225
225
|
class ExpandableModule {
|
|
226
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
227
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
228
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
226
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ExpandableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
227
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.12", ngImport: i0, type: ExpandableModule, imports: [ExpandableContainerDirective, ExpandableItemDirective], exports: [ExpandableContainerDirective, ExpandableItemDirective] }); }
|
|
228
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ExpandableModule }); }
|
|
229
229
|
}
|
|
230
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
230
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ExpandableModule, decorators: [{
|
|
231
231
|
type: NgModule,
|
|
232
232
|
args: [{
|
|
233
233
|
imports: modules,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odx-angular-cdk-expandable.mjs","sources":["../../../../libs/angular/cdk/expandable/src/lib/expandable.tokens.ts","../../../../libs/angular/cdk/expandable/src/lib/directives/expandable-container.directive.ts","../../../../libs/angular/cdk/expandable/src/lib/directives/expandable-item.directive.ts","../../../../libs/angular/cdk/expandable/src/lib/expandable.module.ts","../../../../libs/angular/cdk/expandable/src/odx-angular-cdk-expandable.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { ExpandableContainer, ExpandableItem } from './facade';\n\nexport const ODX_EXPANDABLE_CONTAINER = new InjectionToken<ExpandableContainer>('@odx/angular/cdk/expandable::ExpandableContainer');\nexport const ODX_EXPANDABLE_ITEM = new InjectionToken<ExpandableItem>('@odx/angular/cdk/expandable::ExpandableItem');\n","import { booleanAttribute, Directive, inject, Input, OnDestroy, OnInit } from '@angular/core';\nimport { ODX_EXPANDABLE_CONTAINER, ODX_EXPANDABLE_ITEM } from '../expandable.tokens';\nimport type { ExpandableContainer, ExpandableItem } from '../facade';\n\n/**\n * `ExpandableContainerDirective` provides a container for managing a group of expandable items,\n * allowing them to expand or collapse. It supports the functionality to either allow multiple\n * items to be expanded simultaneously or restrict to a single item at a time.\n *\n * This directive uses Angular's dependency injection to optionally inject a parent `ExpandableItem` or `ExpandableContainer`,\n * enabling nested expandable structures. The `multiple` property can be set to dictate the expand/collapse behavior.\n */\n@Directive({\n standalone: true,\n selector: '[odxExpandableContainer]',\n exportAs: 'odxExpandableContainer',\n providers: [{ provide: ODX_EXPANDABLE_CONTAINER, useExisting: ExpandableContainerDirective }],\n})\nexport class ExpandableContainerDirective implements ExpandableContainer, OnInit, OnDestroy {\n private readonly expandedItems = new Set<ExpandableItem>();\n private readonly parentItem = inject(ODX_EXPANDABLE_ITEM, { optional: true, skipSelf: true });\n private readonly parentContainer = inject(ODX_EXPANDABLE_CONTAINER, { optional: true, skipSelf: true });\n\n /**\n * Determines whether multiple items can be expanded within the container.\n *\n * @type {boolean}\n * @default false\n */\n @Input({ transform: booleanAttribute })\n public multiple = this.parentContainer?.multiple ?? false;\n\n public ngOnInit(): void {\n this.parentItem?.addChild(this);\n }\n\n public ngOnDestroy(): void {\n this.parentItem?.removeChild(this);\n }\n\n /**\n * Collapses all the expanded items within the expandable container.\n */\n public collapseAll(): void {\n this.expandedItems.forEach((item) => item.collapse());\n }\n\n /**\n * Collapses the specified item.\n *\n * @param {ExpandableItem} item - The item to collapse.\n */\n public collapse(item: ExpandableItem): void {\n this.expandedItems.delete(item);\n }\n\n /**\n * Expands the specified item.\n * If `multiple` is set to `false`, it collapses all other items before expanding the specified item.\n * @param {ExpandableItem} item - The item to expand.\n */\n public expand(item: ExpandableItem): void {\n if (!this.multiple) {\n this.collapseAll();\n }\n this.expandedItems.add(item);\n }\n\n /**\n * Toggles the expansion state of the specified item.\n * If `forceState` is provided, it will set the expansion state to the specified value.\n * If `forceState` is not provided, it will toggle the expansion state of the item.\n *\n * @param {ExpandableItem} item - The item to toggle the expansion state for.\n * @param {boolean} forceState - Optional. The desired expansion state to set for the item.\n */\n public toggle(item: ExpandableItem, forceState?: boolean): void {\n const shouldExpand = forceState ?? !this.isExpanded(item);\n if (shouldExpand) {\n this.expand(item);\n } else {\n this.collapse(item);\n }\n }\n\n /**\n * Checks if the specified item is expanded.\n * @param {ExpandableItem} item - The item to check.\n * @returns `true` if the item is expanded, `false` otherwise.\n */\n public isExpanded(item: ExpandableItem): boolean {\n return this.expandedItems.has(item);\n }\n\n /**\n * Checks if there is any expanded item.\n *\n * @returns {boolean} True if there is at least one expanded item, false otherwise.\n */\n public hasExpandedItem(): boolean {\n return this.expandedItems.size > 0;\n }\n}\n","import { booleanAttribute, ChangeDetectorRef, Directive, inject, Input } from '@angular/core';\nimport { getUniqueId } from '@odx/angular/utils';\nimport { ODX_EXPANDABLE_CONTAINER, ODX_EXPANDABLE_ITEM } from '../expandable.tokens';\nimport type { ExpandableContainer, ExpandableItem } from '../facade';\n\n/**\n * `ExpandableItemDirective` allows you to manage the expansion state of an item within an expandable container, such as an accordion or a nested list. It provides methods to expand, collapse, and toggle the item, and automatically registers itself with a parent expandable container if one is available.\n *\n * You can control the expanded state programmatically by binding to the `expanded` property.\n */\n@Directive({\n standalone: true,\n selector: '[odxExpandableItem]',\n exportAs: 'odxExpandableItem',\n providers: [{ provide: ODX_EXPANDABLE_ITEM, useExisting: ExpandableItemDirective }],\n})\nexport class ExpandableItemDirective implements ExpandableItem {\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n private readonly childContainers = new Set<ExpandableContainer>();\n private _expanded = false;\n\n /**\n * Container which can be set manually.\n */\n @Input()\n public container: ExpandableContainer | null = inject(ODX_EXPANDABLE_CONTAINER, { optional: true, skipSelf: true });\n\n /** Unique identifier for the expandable item.\n *\n * @type {string}\n */\n @Input()\n public id = getUniqueId('odx-expandable-item');\n\n /**\n * Controls the expanded state of the item.\n *\n * @param {boolean} value - When `true`, expands the item; when `false`, collapses the item.\n *\n * @example\n * Bind to the expanded state:\n * ```html\n * <div odxExpandableItem [expanded]=\"isItemExpanded\"></div>\n * ```\n */\n @Input({ transform: booleanAttribute })\n public set expanded(value: boolean) {\n if (this._expanded === value) return;\n this._expanded = value;\n if (this._expanded) {\n this.container?.expand(this);\n } else {\n this.closeAllChildren();\n this.container?.collapse(this);\n }\n this.changeDetectorRef.markForCheck();\n }\n\n /**\n * Gets a value indicating whether the item is expanded.\n * If the item is contained within a container, it checks the container's `isExpanded` method.\n * Otherwise, it returns the value of the `_expanded` property.\n *\n * @type {boolean} `true` if the item is expanded; otherwise, `false`.\n */\n public get expanded(): boolean {\n return this.container?.isExpanded(this) ?? this._expanded;\n }\n\n /**\n * Toggles the expansion state of the item, optionally forcing a specific state.\n *\n * @param {boolean} forceState - When provided, forces the expansion state to the specified value.\n */\n public toggle(forceState?: boolean): void {\n this.expanded = forceState ?? !this.expanded;\n }\n\n /** Expands the item.\n *\n * @returns {void}\n */\n public expand(): void {\n this.toggle(true);\n }\n\n /** Collapses the item.\n *\n * @returns {void}\n */\n public collapse(): void {\n this.toggle(false);\n }\n\n /** Adds a child container to the item.\n *\n * @param {ExpandableContainer} container - The child container to add.\n * @returns {void}\n */\n public addChild(container: ExpandableContainer): void {\n this.childContainers.add(container);\n }\n\n /** Removes a child container from the item.\n *\n * @param {ExpandableContainer} container - The child container to remove.\n * @returns {void}\n */\n public removeChild(container: ExpandableContainer): void {\n this.childContainers.delete(container);\n }\n\n private closeAllChildren(): void {\n this.childContainers.forEach((container) => container.collapseAll());\n }\n}\n","import { NgModule } from '@angular/core';\nimport { ExpandableContainerDirective, ExpandableItemDirective } from './directives';\n\nconst modules = [ExpandableContainerDirective, ExpandableItemDirective];\n\n@NgModule({\n imports: modules,\n exports: modules,\n})\nexport class ExpandableModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":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AAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,OAAO;AAChB,oBAAA,OAAO,EAAE,OAAO;AACjB,iBAAA,CAAA;;;ACRD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"odx-angular-cdk-expandable.mjs","sources":["../../../../libs/angular/cdk/expandable/src/lib/expandable.tokens.ts","../../../../libs/angular/cdk/expandable/src/lib/directives/expandable-container.directive.ts","../../../../libs/angular/cdk/expandable/src/lib/directives/expandable-item.directive.ts","../../../../libs/angular/cdk/expandable/src/lib/expandable.module.ts","../../../../libs/angular/cdk/expandable/src/odx-angular-cdk-expandable.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { ExpandableContainer, ExpandableItem } from './facade';\n\nexport const ODX_EXPANDABLE_CONTAINER = new InjectionToken<ExpandableContainer>('@odx/angular/cdk/expandable::ExpandableContainer');\nexport const ODX_EXPANDABLE_ITEM = new InjectionToken<ExpandableItem>('@odx/angular/cdk/expandable::ExpandableItem');\n","import { booleanAttribute, Directive, inject, Input, OnDestroy, OnInit } from '@angular/core';\nimport { ODX_EXPANDABLE_CONTAINER, ODX_EXPANDABLE_ITEM } from '../expandable.tokens';\nimport type { ExpandableContainer, ExpandableItem } from '../facade';\n\n/**\n * `ExpandableContainerDirective` provides a container for managing a group of expandable items,\n * allowing them to expand or collapse. It supports the functionality to either allow multiple\n * items to be expanded simultaneously or restrict to a single item at a time.\n *\n * This directive uses Angular's dependency injection to optionally inject a parent `ExpandableItem` or `ExpandableContainer`,\n * enabling nested expandable structures. The `multiple` property can be set to dictate the expand/collapse behavior.\n */\n@Directive({\n standalone: true,\n selector: '[odxExpandableContainer]',\n exportAs: 'odxExpandableContainer',\n providers: [{ provide: ODX_EXPANDABLE_CONTAINER, useExisting: ExpandableContainerDirective }],\n})\nexport class ExpandableContainerDirective implements ExpandableContainer, OnInit, OnDestroy {\n private readonly expandedItems = new Set<ExpandableItem>();\n private readonly parentItem = inject(ODX_EXPANDABLE_ITEM, { optional: true, skipSelf: true });\n private readonly parentContainer = inject(ODX_EXPANDABLE_CONTAINER, { optional: true, skipSelf: true });\n\n /**\n * Determines whether multiple items can be expanded within the container.\n *\n * @type {boolean}\n * @default false\n */\n @Input({ transform: booleanAttribute })\n public multiple = this.parentContainer?.multiple ?? false;\n\n public ngOnInit(): void {\n this.parentItem?.addChild(this);\n }\n\n public ngOnDestroy(): void {\n this.parentItem?.removeChild(this);\n }\n\n /**\n * Collapses all the expanded items within the expandable container.\n */\n public collapseAll(): void {\n this.expandedItems.forEach((item) => item.collapse());\n }\n\n /**\n * Collapses the specified item.\n *\n * @param {ExpandableItem} item - The item to collapse.\n */\n public collapse(item: ExpandableItem): void {\n this.expandedItems.delete(item);\n }\n\n /**\n * Expands the specified item.\n * If `multiple` is set to `false`, it collapses all other items before expanding the specified item.\n * @param {ExpandableItem} item - The item to expand.\n */\n public expand(item: ExpandableItem): void {\n if (!this.multiple) {\n this.collapseAll();\n }\n this.expandedItems.add(item);\n }\n\n /**\n * Toggles the expansion state of the specified item.\n * If `forceState` is provided, it will set the expansion state to the specified value.\n * If `forceState` is not provided, it will toggle the expansion state of the item.\n *\n * @param {ExpandableItem} item - The item to toggle the expansion state for.\n * @param {boolean} forceState - Optional. The desired expansion state to set for the item.\n */\n public toggle(item: ExpandableItem, forceState?: boolean): void {\n const shouldExpand = forceState ?? !this.isExpanded(item);\n if (shouldExpand) {\n this.expand(item);\n } else {\n this.collapse(item);\n }\n }\n\n /**\n * Checks if the specified item is expanded.\n * @param {ExpandableItem} item - The item to check.\n * @returns `true` if the item is expanded, `false` otherwise.\n */\n public isExpanded(item: ExpandableItem): boolean {\n return this.expandedItems.has(item);\n }\n\n /**\n * Checks if there is any expanded item.\n *\n * @returns {boolean} True if there is at least one expanded item, false otherwise.\n */\n public hasExpandedItem(): boolean {\n return this.expandedItems.size > 0;\n }\n}\n","import { booleanAttribute, ChangeDetectorRef, Directive, inject, Input } from '@angular/core';\nimport { getUniqueId } from '@odx/angular/utils';\nimport { ODX_EXPANDABLE_CONTAINER, ODX_EXPANDABLE_ITEM } from '../expandable.tokens';\nimport type { ExpandableContainer, ExpandableItem } from '../facade';\n\n/**\n * `ExpandableItemDirective` allows you to manage the expansion state of an item within an expandable container, such as an accordion or a nested list. It provides methods to expand, collapse, and toggle the item, and automatically registers itself with a parent expandable container if one is available.\n *\n * You can control the expanded state programmatically by binding to the `expanded` property.\n */\n@Directive({\n standalone: true,\n selector: '[odxExpandableItem]',\n exportAs: 'odxExpandableItem',\n providers: [{ provide: ODX_EXPANDABLE_ITEM, useExisting: ExpandableItemDirective }],\n})\nexport class ExpandableItemDirective implements ExpandableItem {\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n private readonly childContainers = new Set<ExpandableContainer>();\n private _expanded = false;\n\n /**\n * Container which can be set manually.\n */\n @Input()\n public container: ExpandableContainer | null = inject(ODX_EXPANDABLE_CONTAINER, { optional: true, skipSelf: true });\n\n /** Unique identifier for the expandable item.\n *\n * @type {string}\n */\n @Input()\n public id = getUniqueId('odx-expandable-item');\n\n /**\n * Controls the expanded state of the item.\n *\n * @param {boolean} value - When `true`, expands the item; when `false`, collapses the item.\n *\n * @example\n * Bind to the expanded state:\n * ```html\n * <div odxExpandableItem [expanded]=\"isItemExpanded\"></div>\n * ```\n */\n @Input({ transform: booleanAttribute })\n public set expanded(value: boolean) {\n if (this._expanded === value) return;\n this._expanded = value;\n if (this._expanded) {\n this.container?.expand(this);\n } else {\n this.closeAllChildren();\n this.container?.collapse(this);\n }\n this.changeDetectorRef.markForCheck();\n }\n\n /**\n * Gets a value indicating whether the item is expanded.\n * If the item is contained within a container, it checks the container's `isExpanded` method.\n * Otherwise, it returns the value of the `_expanded` property.\n *\n * @type {boolean} `true` if the item is expanded; otherwise, `false`.\n */\n public get expanded(): boolean {\n return this.container?.isExpanded(this) ?? this._expanded;\n }\n\n /**\n * Toggles the expansion state of the item, optionally forcing a specific state.\n *\n * @param {boolean} forceState - When provided, forces the expansion state to the specified value.\n */\n public toggle(forceState?: boolean): void {\n this.expanded = forceState ?? !this.expanded;\n }\n\n /** Expands the item.\n *\n * @returns {void}\n */\n public expand(): void {\n this.toggle(true);\n }\n\n /** Collapses the item.\n *\n * @returns {void}\n */\n public collapse(): void {\n this.toggle(false);\n }\n\n /** Adds a child container to the item.\n *\n * @param {ExpandableContainer} container - The child container to add.\n * @returns {void}\n */\n public addChild(container: ExpandableContainer): void {\n this.childContainers.add(container);\n }\n\n /** Removes a child container from the item.\n *\n * @param {ExpandableContainer} container - The child container to remove.\n * @returns {void}\n */\n public removeChild(container: ExpandableContainer): void {\n this.childContainers.delete(container);\n }\n\n private closeAllChildren(): void {\n this.childContainers.forEach((container) => container.collapseAll());\n }\n}\n","import { NgModule } from '@angular/core';\nimport { ExpandableContainerDirective, ExpandableItemDirective } from './directives';\n\nconst modules = [ExpandableContainerDirective, ExpandableItemDirective];\n\n@NgModule({\n imports: modules,\n exports: modules,\n})\nexport class ExpandableModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAGa,wBAAwB,GAAG,IAAI,cAAc,CAAsB,kDAAkD;MACrH,mBAAmB,GAAG,IAAI,cAAc,CAAiB,6CAA6C;;ACAnH;;;;;;;AAOG;MAOU,4BAA4B,CAAA;AANzC,IAAA,WAAA,GAAA;AAOmB,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,GAAG,EAAkB;AACzC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC5E,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,wBAAwB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAEvG;;;;;AAKG;QAEI,IAAQ,CAAA,QAAA,GAAG,IA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AA,CAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YANZ,4BAA4B,EAAE,uBAAuB,CAArD,EAAA,OAAA,EAAA,CAAA,4BAA4B,EAAE,uBAAuB,CAAA,EAAA,CAAA,CAAA;gHAMzD,gBAAgB,EAAA,CAAA,CAAA;;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,OAAO;AAChB,oBAAA,OAAO,EAAE,OAAO;AACjB,iBAAA;;;ACRD;;AAEG;;;;"}
|
|
@@ -68,10 +68,10 @@ class OptionControl {
|
|
|
68
68
|
event.preventDefault();
|
|
69
69
|
this.selectOption();
|
|
70
70
|
}
|
|
71
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
72
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
71
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: OptionControl, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
72
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.12", type: OptionControl, isStandalone: true, inputs: { value: "value" }, host: { attributes: { "role": "option" }, listeners: { "click": "select($event)" }, properties: { "class.odx-option": "true", "class.is-active": "isActive", "attr.aria-selected": "isSelected", "class.is-selected": "isSelected" } }, ngImport: i0 }); }
|
|
73
73
|
}
|
|
74
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: OptionControl, decorators: [{
|
|
75
75
|
type: Directive,
|
|
76
76
|
args: [{
|
|
77
77
|
standalone: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odx-angular-cdk-option-control.mjs","sources":["../../../../libs/angular/cdk/option-control/src/lib/option-control.ts","../../../../libs/angular/cdk/option-control/src/odx-angular-cdk-option-control.ts"],"sourcesContent":["import { Highlightable } from '@angular/cdk/a11y';\nimport { ChangeDetectorRef, Directive, ElementRef, HostListener, inject, Input } from '@angular/core';\nimport { deferFn, injectElement, untilDestroyed } from '@odx/angular/utils';\n\n/**\n * `OptionControl` is an abstract directive that serves as a base class for implementing selectable options in a dropdown\n * list or a similar component. It integrates with CDK's `Highlightable` interface to provide keyboard navigation support.\n *\n * @param {T} - The type of the value.\n *\n * This base class handles the visual feedback for active and selected states and provides a structure for defining\n * how an option is selected.\n *\n * Extend `OptionControl` to create a concrete option component:\n * @example\n * ```ts\n * @Component({\n * selector: 'my-option',\n * templateUrl: './my-option.component.html',\n * providers: [{ provide: OptionControl, useExisting: forwardRef(() => MyOptionComponent) }],\n * })\n * class MyOptionComponent extends OptionControl<MyDataType> {\n * @Input() override value: MyDataType | null = null;\n *\n * protected override selectOption(): void {\n * // Custom logic for when this option is selected\n * }\n * }\n * ```\n *\n * Implement `selectOption` in subclasses to define what happens when an option is selected, such as updating a model\n * or closing a dropdown.\n */\n@Directive({\n standalone: true,\n host: {\n role: 'option',\n '[class.odx-option]': 'true',\n '[class.is-active]': 'isActive',\n '[attr.aria-selected]': 'isSelected',\n '[class.is-selected]': 'isSelected',\n },\n})\nexport abstract class OptionControl<T> implements Highlightable {\n protected readonly takeUntilDestroyed = untilDestroyed();\n protected readonly cdr = inject(ChangeDetectorRef);\n\n protected isActive = false;\n\n /**\n * Represents the value of the option control.\n *\n * @type {T} - The type of the value.\n */\n @Input()\n public value: T | null = null;\n\n public readonly element: ElementRef<HTMLElement> = injectElement();\n\n /**\n * Sets the active styles for the option control.\n *\n * @returns {void}\n */\n public abstract setActiveStyles(): void;\n\n /**\n * Sets the inactive styles for the option control.\n *\n * @returns {void}\n */\n public setInactiveStyles(): void {\n deferFn(() => {\n this.isActive = false;\n this.cdr.markForCheck();\n });\n }\n\n /**\n * Retrieves the label of the option control.\n *\n * @returns {string} - The label of the option control.\n */\n public getLabel(): string {\n return this.element.nativeElement.textContent?.trim() ?? '';\n }\n\n protected abstract selectOption(): void;\n\n @HostListener('click', ['$event'])\n protected select(event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n\n this.selectOption();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;MAWmB,aAAa,CAAA;AAVnC,IAAA,WAAA,GAAA;QAWqB,IAAkB,CAAA,kBAAA,GAAG,cAAc,EAAE
|
|
1
|
+
{"version":3,"file":"odx-angular-cdk-option-control.mjs","sources":["../../../../libs/angular/cdk/option-control/src/lib/option-control.ts","../../../../libs/angular/cdk/option-control/src/odx-angular-cdk-option-control.ts"],"sourcesContent":["import { Highlightable } from '@angular/cdk/a11y';\nimport { ChangeDetectorRef, Directive, ElementRef, HostListener, inject, Input } from '@angular/core';\nimport { deferFn, injectElement, untilDestroyed } from '@odx/angular/utils';\n\n/**\n * `OptionControl` is an abstract directive that serves as a base class for implementing selectable options in a dropdown\n * list or a similar component. It integrates with CDK's `Highlightable` interface to provide keyboard navigation support.\n *\n * @param {T} - The type of the value.\n *\n * This base class handles the visual feedback for active and selected states and provides a structure for defining\n * how an option is selected.\n *\n * Extend `OptionControl` to create a concrete option component:\n * @example\n * ```ts\n * @Component({\n * selector: 'my-option',\n * templateUrl: './my-option.component.html',\n * providers: [{ provide: OptionControl, useExisting: forwardRef(() => MyOptionComponent) }],\n * })\n * class MyOptionComponent extends OptionControl<MyDataType> {\n * @Input() override value: MyDataType | null = null;\n *\n * protected override selectOption(): void {\n * // Custom logic for when this option is selected\n * }\n * }\n * ```\n *\n * Implement `selectOption` in subclasses to define what happens when an option is selected, such as updating a model\n * or closing a dropdown.\n */\n@Directive({\n standalone: true,\n host: {\n role: 'option',\n '[class.odx-option]': 'true',\n '[class.is-active]': 'isActive',\n '[attr.aria-selected]': 'isSelected',\n '[class.is-selected]': 'isSelected',\n },\n})\nexport abstract class OptionControl<T> implements Highlightable {\n protected readonly takeUntilDestroyed = untilDestroyed();\n protected readonly cdr = inject(ChangeDetectorRef);\n\n protected isActive = false;\n\n /**\n * Represents the value of the option control.\n *\n * @type {T} - The type of the value.\n */\n @Input()\n public value: T | null = null;\n\n public readonly element: ElementRef<HTMLElement> = injectElement();\n\n /**\n * Sets the active styles for the option control.\n *\n * @returns {void}\n */\n public abstract setActiveStyles(): void;\n\n /**\n * Sets the inactive styles for the option control.\n *\n * @returns {void}\n */\n public setInactiveStyles(): void {\n deferFn(() => {\n this.isActive = false;\n this.cdr.markForCheck();\n });\n }\n\n /**\n * Retrieves the label of the option control.\n *\n * @returns {string} - The label of the option control.\n */\n public getLabel(): string {\n return this.element.nativeElement.textContent?.trim() ?? '';\n }\n\n protected abstract selectOption(): void;\n\n @HostListener('click', ['$event'])\n protected select(event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n\n this.selectOption();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;MAWmB,aAAa,CAAA;AAVnC,IAAA,WAAA,GAAA;QAWqB,IAAkB,CAAA,kBAAA,GAAG,cAAc,EAAE;AACrC,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;QAExC,IAAQ,CAAA,QAAA,GAAG,KAAK;AAE1B;;;;AAIG;QAEI,IAAK,CAAA,KAAA,GAAa,IAAI;QAEb,IAAO,CAAA,OAAA,GAA4B,aAAa,EAAE;AAuCnE;AA9BC;;;;AAIG;IACI,iBAAiB,GAAA;QACtB,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CS,MAAM,EAAA,CAAA;sBADf,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;ACzFnC;;AAEG;;;;"}
|
|
@@ -28,8 +28,8 @@ class RadioGroupControlDirective extends CustomFormControl {
|
|
|
28
28
|
this.onTouched();
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
32
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
31
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: RadioGroupControlDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
32
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.12", type: RadioGroupControlDirective, isStandalone: true, selector: "[odxRadioGroupControl]", host: { listeners: { "focusout": "onFocusOut($event)" } }, providers: [
|
|
33
33
|
{
|
|
34
34
|
provide: RADIO_GROUP_CONTROL,
|
|
35
35
|
useExisting: forwardRef(() => RadioGroupControlDirective),
|
|
@@ -39,7 +39,7 @@ class RadioGroupControlDirective extends CustomFormControl {
|
|
|
39
39
|
ReadonlyController.connect(),
|
|
40
40
|
], usesInheritance: true, ngImport: i0 }); }
|
|
41
41
|
}
|
|
42
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: RadioGroupControlDirective, decorators: [{
|
|
43
43
|
type: Directive,
|
|
44
44
|
args: [{
|
|
45
45
|
standalone: true,
|
|
@@ -99,10 +99,10 @@ class RadioControlDirective {
|
|
|
99
99
|
this.value = null;
|
|
100
100
|
detectControllerChanges(this.radioGroupControl).subscribe();
|
|
101
101
|
}
|
|
102
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
103
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
102
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: RadioControlDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
103
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.12", type: RadioControlDirective, isStandalone: true, selector: "[odxRadioControl]", inputs: { value: "value" }, host: { properties: { "class.is-active": "isActive", "class.is-disabled": "disabledController?.disabled", "class.is-readonly": "readonlyController?.readonly", "class.has-error": "radioGroupControl.hasError" } }, providers: [DisabledController.connect(), ReadonlyController.connect()], ngImport: i0 }); }
|
|
104
104
|
}
|
|
105
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: RadioControlDirective, decorators: [{
|
|
106
106
|
type: Directive,
|
|
107
107
|
args: [{
|
|
108
108
|
standalone: true,
|
|
@@ -121,11 +121,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
121
121
|
|
|
122
122
|
const modules = [RadioGroupControlDirective, RadioControlDirective];
|
|
123
123
|
class RadioGroupControlModule {
|
|
124
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
125
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
126
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
124
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: RadioGroupControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
125
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.12", ngImport: i0, type: RadioGroupControlModule, imports: [RadioGroupControlDirective, RadioControlDirective], exports: [CoreModule, RadioGroupControlDirective, RadioControlDirective] }); }
|
|
126
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: RadioGroupControlModule, imports: [CoreModule] }); }
|
|
127
127
|
}
|
|
128
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
128
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: RadioGroupControlModule, decorators: [{
|
|
129
129
|
type: NgModule,
|
|
130
130
|
args: [{
|
|
131
131
|
imports: modules,
|