@odx/angular 1.0.0-rc.4 → 1.0.0-rc.6
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/animations/index.d.ts +1 -0
- package/animations/lib/wait-for-child-animations.d.ts +1 -0
- package/cdk/active-indicator/README.md +3 -0
- package/cdk/active-indicator/index.d.ts +2 -0
- package/cdk/active-indicator/lib/active-indicator.directive.d.ts +24 -0
- package/cdk/active-indicator/lib/models/active-indicator-direction.d.ts +5 -0
- package/cdk/active-indicator/lib/models/active-indicator-position.d.ts +6 -0
- package/cdk/active-indicator/lib/models/index.d.ts +2 -0
- package/cdk/checkbox-control/lib/checkbox-control.directive.d.ts +2 -3
- package/cdk/custom-form-control/lib/custom-form-control.d.ts +7 -14
- package/cdk/dynamic-view/lib/dynamic-view.service.d.ts +1 -0
- package/cdk/dynamic-view/lib/facade/dynamic-view-ref.d.ts +1 -0
- package/cdk/dynamic-view/lib/models/dynamic-component-ref.d.ts +1 -0
- package/cdk/dynamic-view/lib/models/dynamic-template-ref.d.ts +1 -0
- package/cdk/dynamic-view/lib/models/dynamic-view-options.d.ts +6 -3
- package/cdk/dynamic-view/lib/tokens/dynamic-view-default-host.d.ts +3 -0
- package/cdk/dynamic-view/lib/tokens/index.d.ts +1 -0
- package/components/checkbox/index.d.ts +2 -0
- package/components/checkbox/lib/checkbox.module.d.ts +9 -0
- package/components/checkbox/lib/checkbox.validator.d.ts +6 -0
- package/components/form-field/lib/components/form-group/form-group.component.d.ts +0 -1
- package/components/form-field/lib/directives/form-field-control.directive.d.ts +3 -4
- package/components/form-field/lib/form-field.config.d.ts +0 -5
- package/components/list/README.md +3 -0
- package/components/list/index.d.ts +3 -0
- package/components/list/lib/components/index.d.ts +1 -0
- package/components/list/lib/components/list-item.component.d.ts +14 -0
- package/components/list/lib/list.component.d.ts +5 -0
- package/components/list/lib/list.module.d.ts +9 -0
- package/components/main-menu/lib/directives/main-menu-item.directive.d.ts +1 -1
- package/components/modal/lib/modal.component.d.ts +2 -2
- package/components/modal/lib/modal.service.d.ts +0 -2
- package/components/modal/lib/models/index.d.ts +1 -0
- package/components/modal/lib/models/modal-options.d.ts +2 -0
- package/components/modal/lib/models/modal-variant.d.ts +5 -0
- package/components/rail-navigation/README.md +3 -0
- package/components/rail-navigation/index.d.ts +3 -0
- package/components/rail-navigation/lib/components/rail-navigation-item.component.d.ts +15 -0
- package/components/rail-navigation/lib/rail-navigation.component.d.ts +14 -0
- package/components/rail-navigation/lib/rail-navigation.module.d.ts +9 -0
- package/components/slider/README.md +3 -0
- package/components/slider/index.d.ts +1 -0
- package/components/slider/lib/slider.directive.d.ts +13 -0
- package/components/switch/index.d.ts +2 -0
- package/components/switch/lib/switch.module.d.ts +9 -0
- package/components/switch/lib/switch.validator.d.ts +6 -0
- package/components/toggle-button-group/lib/toggle-button-group.component.d.ts +5 -1
- package/esm2020/animations/index.mjs +2 -1
- package/esm2020/animations/lib/expand.mjs +4 -4
- package/esm2020/animations/lib/wait-for-child-animations.mjs +3 -0
- package/esm2020/cdk/active-indicator/index.mjs +3 -0
- package/esm2020/cdk/active-indicator/lib/active-indicator.directive.mjs +127 -0
- package/esm2020/cdk/active-indicator/lib/models/active-indicator-direction.mjs +5 -0
- package/esm2020/cdk/active-indicator/lib/models/active-indicator-position.mjs +6 -0
- package/esm2020/cdk/active-indicator/lib/models/index.mjs +3 -0
- package/esm2020/cdk/active-indicator/odx-angular-cdk-active-indicator.mjs +5 -0
- package/esm2020/cdk/checkbox-control/lib/checkbox-control.directive.mjs +11 -13
- package/esm2020/cdk/custom-form-control/lib/control.directive.mjs +4 -4
- package/esm2020/cdk/custom-form-control/lib/custom-form-control.mjs +20 -47
- package/esm2020/cdk/dynamic-view/lib/dynamic-view.component.mjs +4 -4
- package/esm2020/cdk/dynamic-view/lib/dynamic-view.directive.mjs +5 -5
- package/esm2020/cdk/dynamic-view/lib/dynamic-view.service.mjs +11 -9
- package/esm2020/cdk/dynamic-view/lib/facade/dynamic-view-ref.mjs +1 -1
- package/esm2020/cdk/dynamic-view/lib/models/dynamic-component-ref.mjs +12 -5
- package/esm2020/cdk/dynamic-view/lib/models/dynamic-template-ref.mjs +9 -5
- package/esm2020/cdk/dynamic-view/lib/models/dynamic-view-options.mjs +1 -1
- package/esm2020/cdk/dynamic-view/lib/tokens/dynamic-view-default-host.mjs +10 -0
- package/esm2020/cdk/dynamic-view/lib/tokens/index.mjs +2 -1
- package/esm2020/cdk/expandable/lib/directives/expandable-item.directive.mjs +4 -4
- package/esm2020/cdk/expandable/lib/directives/extandable-container.directive.mjs +4 -4
- package/esm2020/cdk/expandable/lib/expandable.module.mjs +5 -5
- package/esm2020/cdk/radio-group-control/lib/radio-control.directive.mjs +5 -5
- package/esm2020/cdk/radio-group-control/lib/radio-group-control.directive.mjs +4 -4
- package/esm2020/cdk/radio-group-control/lib/radio-group-control.module.mjs +5 -5
- package/esm2020/components/accordion/lib/accordion.component.mjs +4 -4
- package/esm2020/components/accordion/lib/accordion.module.mjs +5 -5
- package/esm2020/components/accordion/lib/components/accordion-item/accordion-item.component.mjs +4 -4
- package/esm2020/components/accordion/lib/directives/accordion-item-title.mjs +4 -4
- package/esm2020/components/action-group/action-group.component.mjs +4 -4
- package/esm2020/components/area-header/area-header.component.mjs +5 -5
- package/esm2020/components/area-header/area-header.module.mjs +5 -5
- package/esm2020/components/area-header/directives/area-header-content.directive.mjs +4 -4
- package/esm2020/components/area-header/directives/area-header-subtitle.directive.mjs +4 -4
- package/esm2020/components/avatar/lib/avatar.component.mjs +4 -4
- package/esm2020/components/badge/lib/badge.component.mjs +6 -6
- package/esm2020/components/badge/lib/badge.directive.mjs +7 -7
- package/esm2020/components/button/lib/button.component.mjs +5 -5
- package/esm2020/components/button-group/lib/button-group.component.mjs +4 -4
- package/esm2020/components/checkbox/index.mjs +3 -1
- package/esm2020/components/checkbox/lib/checkbox.component.mjs +5 -5
- package/esm2020/components/checkbox/lib/checkbox.module.mjs +19 -0
- package/esm2020/components/checkbox/lib/checkbox.validator.mjs +28 -0
- package/esm2020/components/chip/lib/chip.component.mjs +4 -4
- package/esm2020/components/circular-progress/lib/circular-progress.component.mjs +4 -4
- package/esm2020/components/content-box/lib/content-box.component.mjs +4 -4
- package/esm2020/components/content-box/lib/content-box.module.mjs +5 -5
- package/esm2020/components/content-box/lib/directives/content-box-footer-directive.mjs +4 -4
- package/esm2020/components/content-box/lib/directives/content-box-header-directive.mjs +4 -4
- package/esm2020/components/form-field/lib/components/form-field-info/form-field-info.component.mjs +4 -4
- package/esm2020/components/form-field/lib/components/form-group/form-group.component.mjs +11 -13
- package/esm2020/components/form-field/lib/directives/form-field-control.directive.mjs +20 -13
- package/esm2020/components/form-field/lib/directives/form-field-error.directive.mjs +4 -4
- package/esm2020/components/form-field/lib/directives/form-field-hint.directive.mjs +4 -4
- package/esm2020/components/form-field/lib/directives/form-field-label.directive.mjs +4 -4
- package/esm2020/components/form-field/lib/directives/form.directive.mjs +4 -4
- package/esm2020/components/form-field/lib/form-field.component.mjs +4 -4
- package/esm2020/components/form-field/lib/form-field.config.mjs +1 -2
- package/esm2020/components/form-field/lib/form-field.module.mjs +5 -5
- package/esm2020/components/form-field/lib/form-field.service.mjs +4 -4
- package/esm2020/components/form-field/lib/services/form-field-error.service.mjs +4 -4
- package/esm2020/components/header/lib/directives/header-avatar.directive.mjs +4 -4
- package/esm2020/components/header/lib/directives/header-title.directive.mjs +4 -4
- package/esm2020/components/header/lib/header.component.mjs +4 -4
- package/esm2020/components/header/lib/header.module.mjs +5 -5
- package/esm2020/components/icon/lib/icon.component.mjs +4 -4
- package/esm2020/components/link/link.directive.mjs +4 -4
- package/esm2020/components/list/index.mjs +4 -0
- package/esm2020/components/list/lib/components/index.mjs +2 -0
- package/esm2020/components/list/lib/components/list-item.component.mjs +46 -0
- package/esm2020/components/list/lib/list.component.mjs +13 -0
- package/esm2020/components/list/lib/list.module.mjs +19 -0
- package/esm2020/components/list/odx-angular-components-list.mjs +5 -0
- package/esm2020/components/loading-spinner/lib/loading-spinner.component.mjs +4 -4
- package/esm2020/components/loading-spinner/lib/loading-spinner.directive.mjs +7 -7
- package/esm2020/components/loading-spinner/lib/loading-spinner.module.mjs +5 -5
- package/esm2020/components/loading-spinner/lib/loading-spinner.service.mjs +4 -4
- package/esm2020/components/logo/logo.directive.mjs +4 -4
- package/esm2020/components/main-menu/lib/directives/main-menu-button.directive.mjs +4 -4
- package/esm2020/components/main-menu/lib/directives/main-menu-item.directive.mjs +4 -4
- package/esm2020/components/main-menu/lib/main-menu.component.mjs +4 -4
- package/esm2020/components/main-menu/lib/main-menu.module.mjs +5 -5
- package/esm2020/components/main-menu/lib/main-menu.service.mjs +4 -4
- package/esm2020/components/modal/lib/components/modal-footer/modal-footer.component.mjs +4 -4
- package/esm2020/components/modal/lib/components/modal-header/modal-header.component.mjs +4 -4
- package/esm2020/components/modal/lib/directives/modal-close.directive.mjs +4 -4
- package/esm2020/components/modal/lib/directives/modal-content.directive.mjs +4 -4
- package/esm2020/components/modal/lib/directives/modal-dismiss.directive.mjs +4 -4
- package/esm2020/components/modal/lib/modal.component.mjs +23 -14
- package/esm2020/components/modal/lib/modal.config.mjs +3 -1
- package/esm2020/components/modal/lib/modal.directive.mjs +4 -4
- package/esm2020/components/modal/lib/modal.module.mjs +5 -5
- package/esm2020/components/modal/lib/modal.service.mjs +8 -21
- package/esm2020/components/modal/lib/models/index.mjs +2 -1
- package/esm2020/components/modal/lib/models/modal-options.mjs +1 -1
- package/esm2020/components/modal/lib/models/modal-variant.mjs +5 -0
- package/esm2020/components/modal/lib/services/open-modal-manager.service.mjs +4 -4
- package/esm2020/components/progress/lib/progress.component.mjs +4 -4
- package/esm2020/components/radio-group/lib/components/radio-button/radio-button.component.mjs +5 -5
- package/esm2020/components/radio-group/lib/radio-group.component.mjs +4 -4
- package/esm2020/components/radio-group/lib/radio-group.module.mjs +5 -5
- package/esm2020/components/rail-navigation/index.mjs +4 -0
- package/esm2020/components/rail-navigation/lib/components/rail-navigation-item.component.mjs +43 -0
- package/esm2020/components/rail-navigation/lib/rail-navigation.component.mjs +47 -0
- package/esm2020/components/rail-navigation/lib/rail-navigation.module.mjs +19 -0
- package/esm2020/components/rail-navigation/odx-angular-components-rail-navigation.mjs +5 -0
- package/esm2020/components/slider/index.mjs +2 -0
- package/esm2020/components/slider/lib/slider.directive.mjs +45 -0
- package/esm2020/components/slider/odx-angular-components-slider.mjs +5 -0
- package/esm2020/components/switch/index.mjs +3 -1
- package/esm2020/components/switch/lib/switch.component.mjs +5 -5
- package/esm2020/components/switch/lib/switch.module.mjs +19 -0
- package/esm2020/components/switch/lib/switch.validator.mjs +28 -0
- package/esm2020/components/toggle-button-group/lib/components/toggle-button/toggle-button.component.mjs +5 -5
- package/esm2020/components/toggle-button-group/lib/toggle-button-group.component.mjs +20 -11
- package/esm2020/components/toggle-button-group/lib/toggle-button-group.module.mjs +5 -5
- package/esm2020/lib/controllers/controller.mjs +10 -9
- package/esm2020/lib/controllers/disabled.controller.mjs +7 -6
- package/esm2020/lib/controllers/readonly.controller.mjs +7 -6
- package/esm2020/lib/core.module.mjs +5 -5
- package/esm2020/lib/directives/click-outside.directive.mjs +4 -4
- package/esm2020/lib/services/window-ref.mjs +4 -4
- package/esm2020/rxjs/index.mjs +2 -2
- package/esm2020/rxjs/lib/from-element-resize.mjs +14 -0
- package/esm2020/utils/lib/helpers/angular.mjs +5 -2
- package/esm2020/utils/lib/helpers/dom.mjs +24 -1
- package/fesm2015/odx-angular-animations.mjs +7 -5
- package/fesm2015/odx-angular-animations.mjs.map +1 -1
- package/fesm2015/odx-angular-cdk-active-indicator.mjs +142 -0
- package/fesm2015/odx-angular-cdk-active-indicator.mjs.map +1 -0
- package/fesm2015/odx-angular-cdk-checkbox-control.mjs +10 -12
- package/fesm2015/odx-angular-cdk-checkbox-control.mjs.map +1 -1
- package/fesm2015/odx-angular-cdk-custom-form-control.mjs +24 -51
- package/fesm2015/odx-angular-cdk-custom-form-control.mjs.map +1 -1
- package/fesm2015/odx-angular-cdk-dynamic-view.mjs +46 -25
- package/fesm2015/odx-angular-cdk-dynamic-view.mjs.map +1 -1
- package/fesm2015/odx-angular-cdk-expandable.mjs +10 -10
- package/fesm2015/odx-angular-cdk-expandable.mjs.map +1 -1
- package/fesm2015/odx-angular-cdk-radio-group-control.mjs +11 -11
- package/fesm2015/odx-angular-cdk-radio-group-control.mjs.map +1 -1
- package/fesm2015/odx-angular-components-accordion.mjs +13 -13
- package/fesm2015/odx-angular-components-accordion.mjs.map +1 -1
- package/fesm2015/odx-angular-components-action-group.mjs +3 -3
- package/fesm2015/odx-angular-components-action-group.mjs.map +1 -1
- package/fesm2015/odx-angular-components-area-header.mjs +14 -14
- package/fesm2015/odx-angular-components-area-header.mjs.map +1 -1
- package/fesm2015/odx-angular-components-avatar.mjs +3 -3
- package/fesm2015/odx-angular-components-avatar.mjs.map +1 -1
- package/fesm2015/odx-angular-components-badge.mjs +10 -10
- package/fesm2015/odx-angular-components-badge.mjs.map +1 -1
- package/fesm2015/odx-angular-components-button-group.mjs +3 -3
- package/fesm2015/odx-angular-components-button-group.mjs.map +1 -1
- package/fesm2015/odx-angular-components-button.mjs +4 -5
- package/fesm2015/odx-angular-components-button.mjs.map +1 -1
- package/fesm2015/odx-angular-components-checkbox.mjs +47 -7
- package/fesm2015/odx-angular-components-checkbox.mjs.map +1 -1
- package/fesm2015/odx-angular-components-chip.mjs +3 -3
- package/fesm2015/odx-angular-components-chip.mjs.map +1 -1
- package/fesm2015/odx-angular-components-circular-progress.mjs +3 -3
- package/fesm2015/odx-angular-components-circular-progress.mjs.map +1 -1
- package/fesm2015/odx-angular-components-content-box.mjs +13 -13
- package/fesm2015/odx-angular-components-content-box.mjs.map +1 -1
- package/fesm2015/odx-angular-components-form-field.mjs +52 -51
- package/fesm2015/odx-angular-components-form-field.mjs.map +1 -1
- package/fesm2015/odx-angular-components-header.mjs +13 -13
- package/fesm2015/odx-angular-components-header.mjs.map +1 -1
- package/fesm2015/odx-angular-components-icon.mjs +3 -3
- package/fesm2015/odx-angular-components-icon.mjs.map +1 -1
- package/fesm2015/odx-angular-components-link.mjs +3 -3
- package/fesm2015/odx-angular-components-link.mjs.map +1 -1
- package/fesm2015/odx-angular-components-list.mjs +79 -0
- package/fesm2015/odx-angular-components-list.mjs.map +1 -0
- package/fesm2015/odx-angular-components-loading-spinner.mjs +16 -16
- package/fesm2015/odx-angular-components-loading-spinner.mjs.map +1 -1
- package/fesm2015/odx-angular-components-logo.mjs +3 -3
- package/fesm2015/odx-angular-components-logo.mjs.map +1 -1
- package/fesm2015/odx-angular-components-main-menu.mjs +16 -16
- package/fesm2015/odx-angular-components-main-menu.mjs.map +1 -1
- package/fesm2015/odx-angular-components-modal.mjs +61 -58
- package/fesm2015/odx-angular-components-modal.mjs.map +1 -1
- package/fesm2015/odx-angular-components-progress.mjs +3 -3
- package/fesm2015/odx-angular-components-progress.mjs.map +1 -1
- package/fesm2015/odx-angular-components-radio-group.mjs +11 -11
- package/fesm2015/odx-angular-components-radio-group.mjs.map +1 -1
- package/fesm2015/odx-angular-components-rail-navigation.mjs +103 -0
- package/fesm2015/odx-angular-components-rail-navigation.mjs.map +1 -0
- package/fesm2015/odx-angular-components-slider.mjs +51 -0
- package/fesm2015/odx-angular-components-slider.mjs.map +1 -0
- package/fesm2015/odx-angular-components-switch.mjs +47 -7
- package/fesm2015/odx-angular-components-switch.mjs.map +1 -1
- package/fesm2015/odx-angular-components-toggle-button-group.mjs +26 -18
- package/fesm2015/odx-angular-components-toggle-button-group.mjs.map +1 -1
- package/fesm2015/odx-angular-rxjs.mjs +15 -6
- package/fesm2015/odx-angular-rxjs.mjs.map +1 -1
- package/fesm2015/odx-angular-utils.mjs +28 -2
- package/fesm2015/odx-angular-utils.mjs.map +1 -1
- package/fesm2015/odx-angular.mjs +32 -28
- package/fesm2015/odx-angular.mjs.map +1 -1
- package/fesm2020/odx-angular-animations.mjs +7 -5
- package/fesm2020/odx-angular-animations.mjs.map +1 -1
- package/fesm2020/odx-angular-cdk-active-indicator.mjs +142 -0
- package/fesm2020/odx-angular-cdk-active-indicator.mjs.map +1 -0
- package/fesm2020/odx-angular-cdk-checkbox-control.mjs +10 -12
- package/fesm2020/odx-angular-cdk-checkbox-control.mjs.map +1 -1
- package/fesm2020/odx-angular-cdk-custom-form-control.mjs +22 -49
- package/fesm2020/odx-angular-cdk-custom-form-control.mjs.map +1 -1
- package/fesm2020/odx-angular-cdk-dynamic-view.mjs +42 -22
- package/fesm2020/odx-angular-cdk-dynamic-view.mjs.map +1 -1
- package/fesm2020/odx-angular-cdk-expandable.mjs +10 -10
- package/fesm2020/odx-angular-cdk-expandable.mjs.map +1 -1
- package/fesm2020/odx-angular-cdk-radio-group-control.mjs +11 -11
- package/fesm2020/odx-angular-cdk-radio-group-control.mjs.map +1 -1
- package/fesm2020/odx-angular-components-accordion.mjs +13 -13
- package/fesm2020/odx-angular-components-accordion.mjs.map +1 -1
- package/fesm2020/odx-angular-components-action-group.mjs +3 -3
- package/fesm2020/odx-angular-components-action-group.mjs.map +1 -1
- package/fesm2020/odx-angular-components-area-header.mjs +14 -14
- package/fesm2020/odx-angular-components-area-header.mjs.map +1 -1
- package/fesm2020/odx-angular-components-avatar.mjs +3 -3
- package/fesm2020/odx-angular-components-avatar.mjs.map +1 -1
- package/fesm2020/odx-angular-components-badge.mjs +10 -10
- package/fesm2020/odx-angular-components-badge.mjs.map +1 -1
- package/fesm2020/odx-angular-components-button-group.mjs +3 -3
- package/fesm2020/odx-angular-components-button-group.mjs.map +1 -1
- package/fesm2020/odx-angular-components-button.mjs +4 -4
- package/fesm2020/odx-angular-components-button.mjs.map +1 -1
- package/fesm2020/odx-angular-components-checkbox.mjs +47 -7
- package/fesm2020/odx-angular-components-checkbox.mjs.map +1 -1
- package/fesm2020/odx-angular-components-chip.mjs +3 -3
- package/fesm2020/odx-angular-components-chip.mjs.map +1 -1
- package/fesm2020/odx-angular-components-circular-progress.mjs +3 -3
- package/fesm2020/odx-angular-components-circular-progress.mjs.map +1 -1
- package/fesm2020/odx-angular-components-content-box.mjs +13 -13
- package/fesm2020/odx-angular-components-content-box.mjs.map +1 -1
- package/fesm2020/odx-angular-components-form-field.mjs +52 -51
- package/fesm2020/odx-angular-components-form-field.mjs.map +1 -1
- package/fesm2020/odx-angular-components-header.mjs +13 -13
- package/fesm2020/odx-angular-components-header.mjs.map +1 -1
- package/fesm2020/odx-angular-components-icon.mjs +3 -3
- package/fesm2020/odx-angular-components-icon.mjs.map +1 -1
- package/fesm2020/odx-angular-components-link.mjs +3 -3
- package/fesm2020/odx-angular-components-link.mjs.map +1 -1
- package/fesm2020/odx-angular-components-list.mjs +78 -0
- package/fesm2020/odx-angular-components-list.mjs.map +1 -0
- package/fesm2020/odx-angular-components-loading-spinner.mjs +16 -16
- package/fesm2020/odx-angular-components-loading-spinner.mjs.map +1 -1
- package/fesm2020/odx-angular-components-logo.mjs +3 -3
- package/fesm2020/odx-angular-components-logo.mjs.map +1 -1
- package/fesm2020/odx-angular-components-main-menu.mjs +16 -16
- package/fesm2020/odx-angular-components-main-menu.mjs.map +1 -1
- package/fesm2020/odx-angular-components-modal.mjs +61 -58
- package/fesm2020/odx-angular-components-modal.mjs.map +1 -1
- package/fesm2020/odx-angular-components-progress.mjs +3 -3
- package/fesm2020/odx-angular-components-progress.mjs.map +1 -1
- package/fesm2020/odx-angular-components-radio-group.mjs +11 -11
- package/fesm2020/odx-angular-components-radio-group.mjs.map +1 -1
- package/fesm2020/odx-angular-components-rail-navigation.mjs +102 -0
- package/fesm2020/odx-angular-components-rail-navigation.mjs.map +1 -0
- package/fesm2020/odx-angular-components-slider.mjs +51 -0
- package/fesm2020/odx-angular-components-slider.mjs.map +1 -0
- package/fesm2020/odx-angular-components-switch.mjs +47 -7
- package/fesm2020/odx-angular-components-switch.mjs.map +1 -1
- package/fesm2020/odx-angular-components-toggle-button-group.mjs +26 -18
- package/fesm2020/odx-angular-components-toggle-button-group.mjs.map +1 -1
- package/fesm2020/odx-angular-rxjs.mjs +15 -6
- package/fesm2020/odx-angular-rxjs.mjs.map +1 -1
- package/fesm2020/odx-angular-utils.mjs +28 -2
- package/fesm2020/odx-angular-utils.mjs.map +1 -1
- package/fesm2020/odx-angular.mjs +32 -28
- package/fesm2020/odx-angular.mjs.map +1 -1
- package/package.json +34 -2
- package/rxjs/index.d.ts +1 -1
- package/rxjs/lib/from-element-resize.d.ts +2 -0
- package/utils/lib/helpers/angular.d.ts +2 -1
- package/utils/lib/helpers/dom.d.ts +5 -1
- package/esm2020/rxjs/lib/mark-for-check.mjs +0 -5
- package/rxjs/lib/mark-for-check.d.ts +0 -3
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { __decorate, __metadata } from 'tslib';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Directive, Input } from '@angular/core';
|
|
4
|
+
import { CSSModifier, CSSComponent } from '@odx/angular/internal';
|
|
5
|
+
import { fromElementResize$ } from '@odx/angular/rxjs';
|
|
6
|
+
import { untilDestroyed, injectElement, hasChanged, px, disableCSSTransitions, applyStyles } from '@odx/angular/utils';
|
|
7
|
+
import { BehaviorSubject, distinctUntilChanged, switchMap, EMPTY } from 'rxjs';
|
|
8
|
+
|
|
9
|
+
const ActiveIndicatorDirection = {
|
|
10
|
+
HORIZONTAL: 'horizontal',
|
|
11
|
+
VERTICAL: 'vertical',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const ActiveIndicatorPosition = {
|
|
15
|
+
START: 'start',
|
|
16
|
+
CENTER: 'center',
|
|
17
|
+
END: 'end',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
let ActiveIndicatorDirective = class ActiveIndicatorDirective {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.takeUntilDestroyed = untilDestroyed();
|
|
23
|
+
this.parentElement$$ = new BehaviorSubject(null);
|
|
24
|
+
this.onResize$ = this.parentElement$$.pipe(distinctUntilChanged(), switchMap((parentElement) => {
|
|
25
|
+
return parentElement ? fromElementResize$(parentElement) : EMPTY;
|
|
26
|
+
}));
|
|
27
|
+
this.element = injectElement();
|
|
28
|
+
this.isActive = false;
|
|
29
|
+
this.activeElement = null;
|
|
30
|
+
this.direction = ActiveIndicatorDirection.HORIZONTAL;
|
|
31
|
+
this.position = ActiveIndicatorPosition.CENTER;
|
|
32
|
+
}
|
|
33
|
+
set parent(value) {
|
|
34
|
+
this.parentElement$$.next(value);
|
|
35
|
+
}
|
|
36
|
+
ngAfterViewInit() {
|
|
37
|
+
this.onResize$.pipe(this.takeUntilDestroyed()).subscribe(() => this.updateStyles(true));
|
|
38
|
+
if (!this.parentElement$$.getValue()) {
|
|
39
|
+
this.parentElement$$.next(this.element.nativeElement.parentElement);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
ngOnChanges(changes) {
|
|
43
|
+
if (hasChanged(changes, 'activeElement', false)) {
|
|
44
|
+
this.isActive = !!this.activeElement;
|
|
45
|
+
}
|
|
46
|
+
if (hasChanged(changes, ['activeElement', 'direction', 'position'])) {
|
|
47
|
+
this.updateStyles();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
updateStyles(disableTransition = false) {
|
|
51
|
+
if (!this.activeElement)
|
|
52
|
+
return;
|
|
53
|
+
const isHorizontal = this.direction === ActiveIndicatorDirection.HORIZONTAL;
|
|
54
|
+
const isVertical = this.direction === ActiveIndicatorDirection.VERTICAL;
|
|
55
|
+
const relativeOffset = this.getIndicatorRelativeOffset();
|
|
56
|
+
let transform = null;
|
|
57
|
+
if (isHorizontal) {
|
|
58
|
+
const positionX = this.getIndicatorPositionX(this.activeElement);
|
|
59
|
+
transform = `translateX(${px(positionX)}) translateX(${relativeOffset}%)`;
|
|
60
|
+
}
|
|
61
|
+
if (isVertical) {
|
|
62
|
+
const positionY = this.getIndicatorPositionY(this.activeElement);
|
|
63
|
+
transform = `translateY(${px(positionY)}) translateY(${relativeOffset}%)`;
|
|
64
|
+
}
|
|
65
|
+
disableTransition && disableCSSTransitions(this.element.nativeElement, true);
|
|
66
|
+
applyStyles(this.element.nativeElement, {
|
|
67
|
+
transform,
|
|
68
|
+
width: isHorizontal ? px(this.activeElement.offsetWidth) : null,
|
|
69
|
+
height: isVertical ? px(this.activeElement.offsetHeight) : null,
|
|
70
|
+
});
|
|
71
|
+
disableTransition && disableCSSTransitions(this.element.nativeElement, false);
|
|
72
|
+
}
|
|
73
|
+
getIndicatorPositionX(activeElement) {
|
|
74
|
+
switch (this.position) {
|
|
75
|
+
case ActiveIndicatorPosition.START:
|
|
76
|
+
return activeElement.offsetLeft;
|
|
77
|
+
case ActiveIndicatorPosition.CENTER:
|
|
78
|
+
return activeElement.offsetLeft + activeElement.offsetWidth / 2;
|
|
79
|
+
case ActiveIndicatorPosition.END:
|
|
80
|
+
return activeElement.offsetLeft + activeElement.offsetWidth;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
getIndicatorPositionY(activeElement) {
|
|
84
|
+
switch (this.position) {
|
|
85
|
+
case ActiveIndicatorPosition.START:
|
|
86
|
+
return activeElement.offsetTop;
|
|
87
|
+
case ActiveIndicatorPosition.CENTER:
|
|
88
|
+
return activeElement.offsetTop + activeElement.offsetHeight / 2;
|
|
89
|
+
case ActiveIndicatorPosition.END:
|
|
90
|
+
return activeElement.offsetTop + activeElement.offsetHeight;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
getIndicatorRelativeOffset() {
|
|
94
|
+
switch (this.position) {
|
|
95
|
+
case ActiveIndicatorPosition.START:
|
|
96
|
+
return 0;
|
|
97
|
+
case ActiveIndicatorPosition.CENTER:
|
|
98
|
+
return -50;
|
|
99
|
+
case ActiveIndicatorPosition.END:
|
|
100
|
+
return -100;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
ActiveIndicatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ActiveIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
105
|
+
ActiveIndicatorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: ActiveIndicatorDirective, isStandalone: true, selector: "[odxActiveIndicator]", inputs: { activeElement: ["odxActiveIndicator", "activeElement"], parent: ["odxActiveIndicatorParent", "parent"], direction: ["odxActiveIndicatorDirection", "direction"], position: ["odxActiveIndicatorPosition", "position"] }, usesOnChanges: true, ngImport: i0 });
|
|
106
|
+
__decorate([
|
|
107
|
+
CSSModifier(),
|
|
108
|
+
__metadata("design:type", Object)
|
|
109
|
+
], ActiveIndicatorDirective.prototype, "isActive", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
CSSModifier(),
|
|
112
|
+
__metadata("design:type", String)
|
|
113
|
+
], ActiveIndicatorDirective.prototype, "direction", void 0);
|
|
114
|
+
ActiveIndicatorDirective = __decorate([
|
|
115
|
+
CSSComponent('cdk-active-indicator')
|
|
116
|
+
], ActiveIndicatorDirective);
|
|
117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ActiveIndicatorDirective, decorators: [{
|
|
118
|
+
type: Directive,
|
|
119
|
+
args: [{
|
|
120
|
+
standalone: true,
|
|
121
|
+
selector: '[odxActiveIndicator]',
|
|
122
|
+
}]
|
|
123
|
+
}], propDecorators: { isActive: [], activeElement: [{
|
|
124
|
+
type: Input,
|
|
125
|
+
args: ['odxActiveIndicator']
|
|
126
|
+
}], parent: [{
|
|
127
|
+
type: Input,
|
|
128
|
+
args: ['odxActiveIndicatorParent']
|
|
129
|
+
}], direction: [{
|
|
130
|
+
type: Input,
|
|
131
|
+
args: ['odxActiveIndicatorDirection']
|
|
132
|
+
}], position: [{
|
|
133
|
+
type: Input,
|
|
134
|
+
args: ['odxActiveIndicatorPosition']
|
|
135
|
+
}] } });
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Generated bundle index. Do not edit.
|
|
139
|
+
*/
|
|
140
|
+
|
|
141
|
+
export { ActiveIndicatorDirection, ActiveIndicatorDirective, ActiveIndicatorPosition };
|
|
142
|
+
//# sourceMappingURL=odx-angular-cdk-active-indicator.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"odx-angular-cdk-active-indicator.mjs","sources":["../../../../libs/angular/cdk/active-indicator/src/lib/models/active-indicator-direction.ts","../../../../libs/angular/cdk/active-indicator/src/lib/models/active-indicator-position.ts","../../../../libs/angular/cdk/active-indicator/src/lib/active-indicator.directive.ts","../../../../libs/angular/cdk/active-indicator/src/odx-angular-cdk-active-indicator.ts"],"sourcesContent":["export type ActiveIndicatorDirection = typeof ActiveIndicatorDirection[keyof typeof ActiveIndicatorDirection];\n\nexport const ActiveIndicatorDirection = {\n HORIZONTAL: 'horizontal',\n VERTICAL: 'vertical',\n} as const;\n","export type ActiveIndicatorPosition = typeof ActiveIndicatorPosition[keyof typeof ActiveIndicatorPosition];\n\nexport const ActiveIndicatorPosition = {\n START: 'start',\n CENTER: 'center',\n END: 'end',\n} as const;\n","import { AfterViewInit, Directive, Input, OnChanges } from '@angular/core';\nimport { CSSComponent, CSSModifier } from '@odx/angular/internal';\nimport { fromElementResize$ } from '@odx/angular/rxjs';\nimport { applyStyles, disableCSSTransitions, hasChanged, injectElement, NgChanges, px, untilDestroyed } from '@odx/angular/utils';\nimport { BehaviorSubject, distinctUntilChanged, EMPTY, switchMap } from 'rxjs';\nimport { ActiveIndicatorPosition } from './models';\nimport { ActiveIndicatorDirection } from './models/active-indicator-direction';\n\n@CSSComponent('cdk-active-indicator')\n@Directive({\n standalone: true,\n selector: '[odxActiveIndicator]',\n})\nexport class ActiveIndicatorDirective implements OnChanges, AfterViewInit {\n private readonly takeUntilDestroyed = untilDestroyed();\n private readonly parentElement$$ = new BehaviorSubject<HTMLElement | null>(null);\n private readonly onResize$ = this.parentElement$$.pipe(\n distinctUntilChanged(),\n switchMap((parentElement) => {\n return parentElement ? fromElementResize$(parentElement) : EMPTY;\n })\n );\n public readonly element = injectElement();\n\n @CSSModifier()\n protected isActive = false;\n\n @Input('odxActiveIndicator')\n public activeElement?: HTMLElement | null = null;\n\n @Input('odxActiveIndicatorParent')\n public set parent(value: HTMLElement | null) {\n this.parentElement$$.next(value);\n }\n\n @CSSModifier()\n @Input('odxActiveIndicatorDirection')\n public direction: ActiveIndicatorDirection = ActiveIndicatorDirection.HORIZONTAL;\n\n @Input('odxActiveIndicatorPosition')\n public position: ActiveIndicatorPosition = ActiveIndicatorPosition.CENTER;\n\n public ngAfterViewInit(): void {\n this.onResize$.pipe(this.takeUntilDestroyed()).subscribe(() => this.updateStyles(true));\n if (!this.parentElement$$.getValue()) {\n this.parentElement$$.next(this.element.nativeElement.parentElement);\n }\n }\n\n public ngOnChanges(changes: NgChanges<ActiveIndicatorDirective>): void {\n if (hasChanged(changes, 'activeElement', false)) {\n this.isActive = !!this.activeElement;\n }\n if (hasChanged(changes, ['activeElement', 'direction', 'position'])) {\n this.updateStyles();\n }\n }\n\n private updateStyles(disableTransition = false): void {\n if (!this.activeElement) return;\n const isHorizontal = this.direction === ActiveIndicatorDirection.HORIZONTAL;\n const isVertical = this.direction === ActiveIndicatorDirection.VERTICAL;\n const relativeOffset = this.getIndicatorRelativeOffset();\n\n let transform = null;\n if (isHorizontal) {\n const positionX = this.getIndicatorPositionX(this.activeElement);\n transform = `translateX(${px(positionX)}) translateX(${relativeOffset}%)`;\n }\n if (isVertical) {\n const positionY = this.getIndicatorPositionY(this.activeElement);\n transform = `translateY(${px(positionY)}) translateY(${relativeOffset}%)`;\n }\n\n disableTransition && disableCSSTransitions(this.element.nativeElement, true);\n applyStyles(this.element.nativeElement, {\n transform,\n width: isHorizontal ? px(this.activeElement.offsetWidth) : null,\n height: isVertical ? px(this.activeElement.offsetHeight) : null,\n });\n disableTransition && disableCSSTransitions(this.element.nativeElement, false);\n }\n\n private getIndicatorPositionX(activeElement: HTMLElement): number {\n switch (this.position) {\n case ActiveIndicatorPosition.START:\n return activeElement.offsetLeft;\n case ActiveIndicatorPosition.CENTER:\n return activeElement.offsetLeft + activeElement.offsetWidth / 2;\n case ActiveIndicatorPosition.END:\n return activeElement.offsetLeft + activeElement.offsetWidth;\n }\n }\n\n private getIndicatorPositionY(activeElement: HTMLElement): number {\n switch (this.position) {\n case ActiveIndicatorPosition.START:\n return activeElement.offsetTop;\n case ActiveIndicatorPosition.CENTER:\n return activeElement.offsetTop + activeElement.offsetHeight / 2;\n case ActiveIndicatorPosition.END:\n return activeElement.offsetTop + activeElement.offsetHeight;\n }\n }\n\n private getIndicatorRelativeOffset(): number {\n switch (this.position) {\n case ActiveIndicatorPosition.START:\n return 0;\n case ActiveIndicatorPosition.CENTER:\n return -50;\n case ActiveIndicatorPosition.END:\n return -100;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEa,MAAA,wBAAwB,GAAG;AACtC,IAAA,UAAU,EAAE,YAAY;AACxB,IAAA,QAAQ,EAAE,UAAU;;;ACFT,MAAA,uBAAuB,GAAG;AACrC,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,GAAG,EAAE,KAAK;;;ACQC,IAAA,wBAAwB,GAA9B,MAAM,wBAAwB,CAAA;AAA9B,IAAA,WAAA,GAAA;QACY,IAAkB,CAAA,kBAAA,GAAG,cAAc,EAAE,CAAC;AACtC,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,eAAe,CAAqB,IAAI,CAAC,CAAC;AAChE,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CACpD,oBAAoB,EAAE,EACtB,SAAS,CAAC,CAAC,aAAa,KAAI;AAC1B,YAAA,OAAO,aAAa,GAAG,kBAAkB,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC;SAClE,CAAC,CACH,CAAC;QACc,IAAO,CAAA,OAAA,GAAG,aAAa,EAAE,CAAC;QAGhC,IAAQ,CAAA,QAAA,GAAG,KAAK,C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A;AAWnC,UAAA,CAAA;AAAC,IAAA,WAAW,EAAE;;AACa,CAAA,EAAA,wBAAA,CAAA,SAAA,EAAA,UAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAU3B,UAAA,CAAA;AAAC,IAAA,WAAW,EAAE;;AAEmE,CAAA,EAAA,wBAAA,CAAA,SAAA,EAAA,WAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAxBtE,wBAAwB,GAAA,UAAA,CAAA;IALpC,YAAY,CAAC,sBAAsB,CAAC;AAKxB,CAAA,EAAA,wBAAwB,CAsGpC,CAAA;4FAtGY,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAJpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,sBAAsB;AACjC,iBAAA,CAAA;AAaW,SAAA,CAAA,EAAA,cAAA,EAAA,EAAA,QAAQ,MAGX,aAAa,EAAA,CAAA;sBADnB,KAAK;uBAAC,oBAAoB,CAAA;gBAIhB,MAAM,EAAA,CAAA;sBADhB,KAAK;uBAAC,0BAA0B,CAAA;gBAO1B,SAAS,EAAA,CAAA;sBADf,KAAK;uBAAC,6BAA6B,CAAA;gBAI7B,QAAQ,EAAA,CAAA;sBADd,KAAK;uBAAC,4BAA4B,CAAA;;;ACvCrC;;AAEG;;;;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Directive, Input } from '@angular/core';
|
|
3
|
-
import { Validators } from '@angular/forms';
|
|
4
3
|
import { detectControllerChanges } from '@odx/angular';
|
|
5
4
|
import { CustomFormControl } from '@odx/angular/cdk/custom-form-control';
|
|
6
5
|
import { injectElement, booleanToAttributeString } from '@odx/angular/utils';
|
|
@@ -9,14 +8,15 @@ class CheckBoxControl extends CustomFormControl {
|
|
|
9
8
|
constructor() {
|
|
10
9
|
super(false);
|
|
11
10
|
this.element = injectElement();
|
|
12
|
-
|
|
11
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
12
|
+
this.controlValue = null;
|
|
13
13
|
detectControllerChanges(this).subscribe();
|
|
14
14
|
}
|
|
15
15
|
set checked(value) {
|
|
16
|
-
this.
|
|
16
|
+
this.value = value;
|
|
17
17
|
}
|
|
18
18
|
get checked() {
|
|
19
|
-
return this.
|
|
19
|
+
return this.value;
|
|
20
20
|
}
|
|
21
21
|
get ariaChecked() {
|
|
22
22
|
return booleanToAttributeString(this.checked);
|
|
@@ -25,21 +25,19 @@ class CheckBoxControl extends CustomFormControl {
|
|
|
25
25
|
event.stopPropagation();
|
|
26
26
|
super.updateValue(event.target.checked);
|
|
27
27
|
}
|
|
28
|
-
updateRequiredValidator() {
|
|
29
|
-
this.toggleValidator(Validators.requiredTrue, this.required);
|
|
30
|
-
}
|
|
31
28
|
}
|
|
32
|
-
CheckBoxControl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
33
|
-
CheckBoxControl.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.
|
|
34
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
29
|
+
CheckBoxControl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CheckBoxControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
30
|
+
CheckBoxControl.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: CheckBoxControl, selector: "[odxCheckBoxControl]", inputs: { checked: "checked", controlValue: ["value", "controlValue"] }, usesInheritance: true, ngImport: i0 });
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CheckBoxControl, decorators: [{
|
|
35
32
|
type: Directive,
|
|
36
33
|
args: [{
|
|
37
34
|
selector: '[odxCheckBoxControl]',
|
|
38
35
|
}]
|
|
39
36
|
}], ctorParameters: function () { return []; }, propDecorators: { checked: [{
|
|
40
37
|
type: Input
|
|
41
|
-
}],
|
|
42
|
-
type: Input
|
|
38
|
+
}], controlValue: [{
|
|
39
|
+
type: Input,
|
|
40
|
+
args: ['value']
|
|
43
41
|
}] } });
|
|
44
42
|
|
|
45
43
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odx-angular-cdk-checkbox-control.mjs","sources":["../../../../libs/angular/cdk/checkbox-control/src/lib/checkbox-control.directive.ts","../../../../libs/angular/cdk/checkbox-control/src/odx-angular-cdk-checkbox-control.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, Input } from '@angular/core';\nimport {
|
|
1
|
+
{"version":3,"file":"odx-angular-cdk-checkbox-control.mjs","sources":["../../../../libs/angular/cdk/checkbox-control/src/lib/checkbox-control.directive.ts","../../../../libs/angular/cdk/checkbox-control/src/odx-angular-cdk-checkbox-control.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, Input } from '@angular/core';\nimport { detectControllerChanges } from '@odx/angular';\nimport { CustomFormControl } from '@odx/angular/cdk/custom-form-control';\nimport { booleanToAttributeString, injectElement } from '@odx/angular/utils';\n\n@Directive({\n selector: '[odxCheckBoxControl]',\n})\nexport class CheckBoxControl extends CustomFormControl<boolean> {\n public static ngAcceptInputType_checked: BooleanInput;\n\n public readonly element = injectElement();\n\n @Input()\n public set checked(value: boolean) {\n this.value = value;\n }\n public get checked(): boolean {\n return this.value;\n }\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('value')\n public controlValue: string | null = null;\n\n public get ariaChecked(): string {\n return booleanToAttributeString(this.checked);\n }\n\n constructor() {\n super(false);\n detectControllerChanges(this).subscribe();\n }\n\n public onChanged(event: Event): void {\n event.stopPropagation();\n super.updateValue((event.target as HTMLInputElement).checked);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";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vBhB;;AAEG;;;;"}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Directive, inject, Input, ViewChild } from '@angular/core';
|
|
3
3
|
import { injectElement } from '@odx/angular/utils';
|
|
4
|
-
import {
|
|
5
|
-
import { NgControl, Validators } from '@angular/forms';
|
|
4
|
+
import { RequiredValidator, NgControl, Validators } from '@angular/forms';
|
|
6
5
|
import { Controller, DisabledController, ReadonlyController } from '@odx/angular';
|
|
7
|
-
import { filter, EMPTY } from 'rxjs';
|
|
8
6
|
|
|
9
7
|
class ControlDirective {
|
|
10
8
|
constructor() {
|
|
11
9
|
this.element = injectElement();
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
|
-
ControlDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
15
|
-
ControlDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.
|
|
16
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
12
|
+
ControlDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ControlDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
13
|
+
ControlDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: ControlDirective, isStandalone: true, selector: "[odxControl]", exportAs: ["odxControl"], ngImport: i0 });
|
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ControlDirective, decorators: [{
|
|
17
15
|
type: Directive,
|
|
18
16
|
args: [{
|
|
19
17
|
standalone: true,
|
|
@@ -25,10 +23,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImpor
|
|
|
25
23
|
class CustomFormControl extends Controller {
|
|
26
24
|
constructor(initialValue) {
|
|
27
25
|
super();
|
|
28
|
-
this.
|
|
26
|
+
this.requiredValidator = inject(RequiredValidator, { optional: true, self: true });
|
|
29
27
|
this.disabledController = DisabledController.inject();
|
|
30
28
|
this.readonlyController = ReadonlyController.inject();
|
|
31
|
-
this.enabled$ = this.disabledController?.change$.pipe(filter(() => !this.isDisabled)) ?? EMPTY;
|
|
32
29
|
this.ngControl = inject(NgControl, { self: true, optional: true });
|
|
33
30
|
this.id = null;
|
|
34
31
|
this.name = `odx-form-control-${CustomFormControl.CURRENT_INDEX++}`;
|
|
@@ -37,22 +34,14 @@ class CustomFormControl extends Controller {
|
|
|
37
34
|
if (this.ngControl) {
|
|
38
35
|
this.ngControl.valueAccessor = this;
|
|
39
36
|
}
|
|
40
|
-
this.enabled$.subscribe(() => this.updateRequiredValidator());
|
|
41
37
|
}
|
|
42
|
-
set
|
|
43
|
-
this.isRequired = coerceBooleanProperty(value);
|
|
44
|
-
this.updateRequiredValidator();
|
|
45
|
-
}
|
|
46
|
-
get required() {
|
|
47
|
-
return this.isRequired;
|
|
48
|
-
}
|
|
49
|
-
set controlValue(value) {
|
|
38
|
+
set value(value) {
|
|
50
39
|
if (this.internalValue !== value) {
|
|
51
40
|
this.internalValue = value;
|
|
52
41
|
this.triggerControllerChange();
|
|
53
42
|
}
|
|
54
43
|
}
|
|
55
|
-
get
|
|
44
|
+
get value() {
|
|
56
45
|
return this.internalValue;
|
|
57
46
|
}
|
|
58
47
|
get hasError() {
|
|
@@ -64,14 +53,14 @@ class CustomFormControl extends Controller {
|
|
|
64
53
|
get isReadonly() {
|
|
65
54
|
return !!this.readonlyController?.readonly;
|
|
66
55
|
}
|
|
67
|
-
|
|
68
|
-
this.
|
|
56
|
+
get isRequired() {
|
|
57
|
+
return !!this.requiredValidator?.required || this.hasValidator(Validators.required) || this.hasValidator(Validators.requiredTrue);
|
|
69
58
|
}
|
|
70
59
|
onTouched() {
|
|
71
|
-
//
|
|
60
|
+
// implemented by control value accessor
|
|
72
61
|
}
|
|
73
62
|
onChange(_value) {
|
|
74
|
-
//
|
|
63
|
+
// implemented by control value accessor
|
|
75
64
|
}
|
|
76
65
|
registerOnChange(fn) {
|
|
77
66
|
this.onChange = fn;
|
|
@@ -83,39 +72,25 @@ class CustomFormControl extends Controller {
|
|
|
83
72
|
this.disabledController?.setDisabledState(isDisabled);
|
|
84
73
|
}
|
|
85
74
|
writeValue(value) {
|
|
86
|
-
this.
|
|
75
|
+
if (this.isDisabled)
|
|
76
|
+
return;
|
|
77
|
+
this.value = value;
|
|
78
|
+
this.onChange(value);
|
|
87
79
|
}
|
|
88
80
|
updateValue(value) {
|
|
81
|
+
if (this.isDisabled)
|
|
82
|
+
return;
|
|
89
83
|
this.writeValue(value);
|
|
90
|
-
this.onChange(value);
|
|
91
84
|
this.onTouched();
|
|
92
85
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (!control)
|
|
96
|
-
return;
|
|
97
|
-
const hasValidator = control.hasValidator(validator);
|
|
98
|
-
if (state && hasValidator)
|
|
99
|
-
return;
|
|
100
|
-
if (!state && !hasValidator)
|
|
101
|
-
return;
|
|
102
|
-
if (state) {
|
|
103
|
-
control.addValidators(validator);
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
control.removeValidators(validator);
|
|
107
|
-
}
|
|
108
|
-
control.updateValueAndValidity();
|
|
109
|
-
control.markAsUntouched();
|
|
110
|
-
}
|
|
111
|
-
updateRequiredValidator() {
|
|
112
|
-
this.toggleValidator(Validators.required, this.isRequired);
|
|
86
|
+
hasValidator(validator) {
|
|
87
|
+
return !!this.ngControl?.control?.hasValidator(validator);
|
|
113
88
|
}
|
|
114
89
|
}
|
|
115
90
|
CustomFormControl.CURRENT_INDEX = 0;
|
|
116
|
-
CustomFormControl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
117
|
-
CustomFormControl.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.
|
|
118
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
91
|
+
CustomFormControl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CustomFormControl, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
|
92
|
+
CustomFormControl.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: CustomFormControl, inputs: { id: "id", name: "name" }, host: { properties: { "class.has-error": "hasError", "class.is-disabled": "isDisabled", "class.is-readonly": "isReadonly", "class.is-required": "required" } }, viewQueries: [{ propertyName: "control", first: true, predicate: ControlDirective, descendants: true }], usesInheritance: true, ngImport: i0 });
|
|
93
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CustomFormControl, decorators: [{
|
|
119
94
|
type: Directive,
|
|
120
95
|
args: [{
|
|
121
96
|
host: {
|
|
@@ -129,8 +104,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImpor
|
|
|
129
104
|
type: Input
|
|
130
105
|
}], name: [{
|
|
131
106
|
type: Input
|
|
132
|
-
}], required: [{
|
|
133
|
-
type: Input
|
|
134
107
|
}], control: [{
|
|
135
108
|
type: ViewChild,
|
|
136
109
|
args: [ControlDirective]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odx-angular-cdk-custom-form-control.mjs","sources":["../../../../libs/angular/cdk/custom-form-control/src/lib/control.directive.ts","../../../../libs/angular/cdk/custom-form-control/src/lib/custom-form-control.ts","../../../../libs/angular/cdk/custom-form-control/src/odx-angular-cdk-custom-form-control.ts"],"sourcesContent":["import { Directive } from '@angular/core';\nimport { injectElement } from '@odx/angular/utils';\n\n@Directive({\n standalone: true,\n selector: '[odxControl]',\n exportAs: 'odxControl',\n})\nexport class ControlDirective {\n public readonly element = injectElement();\n}\n","import {
|
|
1
|
+
{"version":3,"file":"odx-angular-cdk-custom-form-control.mjs","sources":["../../../../libs/angular/cdk/custom-form-control/src/lib/control.directive.ts","../../../../libs/angular/cdk/custom-form-control/src/lib/custom-form-control.ts","../../../../libs/angular/cdk/custom-form-control/src/odx-angular-cdk-custom-form-control.ts"],"sourcesContent":["import { Directive } from '@angular/core';\nimport { injectElement } from '@odx/angular/utils';\n\n@Directive({\n standalone: true,\n selector: '[odxControl]',\n exportAs: 'odxControl',\n})\nexport class ControlDirective {\n public readonly element = injectElement();\n}\n","import { Directive, inject, Input, ViewChild } from '@angular/core';\nimport { ControlValueAccessor, NgControl, RequiredValidator, ValidatorFn, Validators } from '@angular/forms';\nimport { Controller, DisabledController, ReadonlyController } from '@odx/angular';\nimport { ControlDirective } from './control.directive';\n\n@Directive({\n host: {\n '[class.has-error]': 'hasError',\n '[class.is-disabled]': 'isDisabled',\n '[class.is-readonly]': 'isReadonly',\n '[class.is-required]': 'required',\n },\n})\nexport abstract class CustomFormControl<T> extends Controller implements ControlValueAccessor {\n private static CURRENT_INDEX = 0;\n\n private readonly requiredValidator = inject(RequiredValidator, { optional: true, self: true });\n private internalValue: T;\n protected readonly disabledController = DisabledController.inject();\n protected readonly readonlyController = ReadonlyController.inject();\n protected readonly ngControl = inject(NgControl, { self: true, optional: true });\n\n @Input()\n public id: string | null = null;\n\n @Input()\n public name = `odx-form-control-${CustomFormControl.CURRENT_INDEX++}`;\n\n public set value(value: T) {\n if (this.internalValue !== value) {\n this.internalValue = value;\n this.triggerControllerChange();\n }\n }\n public get value(): T {\n return this.internalValue;\n }\n\n public get hasError(): boolean {\n return !!this.ngControl?.touched && !!this.ngControl?.invalid;\n }\n\n public get isDisabled(): boolean {\n return !!this.disabledController?.disabled;\n }\n\n public get isReadonly(): boolean {\n return !!this.readonlyController?.readonly;\n }\n\n public get isRequired(): boolean {\n return !!this.requiredValidator?.required || this.hasValidator(Validators.required) || this.hasValidator(Validators.requiredTrue);\n }\n\n @ViewChild(ControlDirective)\n public readonly control: ControlDirective | null = null;\n\n constructor(initialValue: T) {\n super();\n this.internalValue = initialValue;\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n public onTouched() {\n // implemented by control value accessor\n }\n\n public onChange(_value: T) {\n // implemented by control value accessor\n }\n\n public registerOnChange(fn: (value: T) => void): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n public setDisabledState(isDisabled: boolean): void {\n this.disabledController?.setDisabledState(isDisabled);\n }\n\n public writeValue(value: T): void {\n if (this.isDisabled) return;\n this.value = value;\n this.onChange(value);\n }\n\n public updateValue(value: T): void {\n if (this.isDisabled) return;\n this.writeValue(value);\n this.onTouched();\n }\n\n protected hasValidator(validator: ValidatorFn): boolean {\n return !!this.ngControl?.control?.hasValidator(validator);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAQa,gBAAgB,CAAA;AAL7B,IAAA,WAAA,GAAA;QAMkB,IAAO,CAAA,OAAA,GAAG,aAAa,EAAE,CAAC;AAC3C,KAAA;;8GAFY,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAL5B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;AACvB,iBAAA,CAAA;;;ACMK,MAAgB,iBAAqB,SAAQ,UAAU,CAAA;AA4C3D,IAAA,WAAA,CAAY,YAAe,EAAA;AACzB,QAAA,KAAK,EAAE,CAAC;AA1CO,QAAA,IAAA,C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AAa,CAAA,aAAA,GAAG,CAAC,CAAC;+GADb,iBAAiB,EAAA,IAAA,EAAA,SAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAjB,iBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,iBAAiB,uQAyC1B,gBAAgB,EAAA,WAAA,EAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAzCP,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBARtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,IAAI,EAAE;AACJ,wBAAA,mBAAmB,EAAE,UAAU;AAC/B,wBAAA,qBAAqB,EAAE,YAAY;AACnC,wBAAA,qBAAqB,EAAE,YAAY;AACnC,wBAAA,qBAAqB,EAAE,UAAU;AAClC,qBAAA;AACF,iBAAA,CAAA;6FAWQ,EAAE,EAAA,CAAA;sBADR,KAAK;gBAIC,IAAI,EAAA,CAAA;sBADV,KAAK;gBA8BU,OAAO,EAAA,CAAA;sBADtB,SAAS;uBAAC,gBAAgB,CAAA;;;ACtD7B;;AAEG;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, reflectComponentType, ApplicationRef, createComponent, EnvironmentInjector, InjectionToken, inject, Injector, Injectable, ViewContainerRef, TemplateRef, Directive } from '@angular/core';
|
|
3
|
-
import { injectElement, isString, isTemplateRef, isComponent, hasChanged } from '@odx/angular/utils';
|
|
3
|
+
import { injectElement, isString, isViewContainer, getInjector, isTemplateRef, isComponent, hasChanged } from '@odx/angular/utils';
|
|
4
4
|
import { isObservable, distinctUntilChanged } from 'rxjs';
|
|
5
|
+
import { DOCUMENT } from '@angular/common';
|
|
5
6
|
|
|
6
7
|
class DynamicViewComponent {
|
|
7
8
|
constructor() {
|
|
@@ -27,9 +28,9 @@ class DynamicViewComponent {
|
|
|
27
28
|
this.element.nativeElement.innerHTML = value;
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
|
-
DynamicViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
31
|
-
DynamicViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.
|
|
32
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
31
|
+
DynamicViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DynamicViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32
|
+
DynamicViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.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
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DynamicViewComponent, decorators: [{
|
|
33
34
|
type: Component,
|
|
34
35
|
args: [{
|
|
35
36
|
selector: 'odx-dynamic-view',
|
|
@@ -59,17 +60,20 @@ class DynamicComponentRef {
|
|
|
59
60
|
this.options = options;
|
|
60
61
|
this.application = this.options.injector.get(ApplicationRef);
|
|
61
62
|
this.componentRef = null;
|
|
62
|
-
const { component, context, injector, projectableNodes,
|
|
63
|
+
const { component, context, injector, projectableNodes, host } = options;
|
|
63
64
|
this.componentRef = createComponent(component, {
|
|
64
65
|
environmentInjector: injector.get(EnvironmentInjector),
|
|
65
66
|
elementInjector: injector,
|
|
66
67
|
projectableNodes,
|
|
67
68
|
});
|
|
68
|
-
if (
|
|
69
|
-
|
|
69
|
+
if (isViewContainer(host)) {
|
|
70
|
+
host.insert(this.componentRef.hostView);
|
|
70
71
|
}
|
|
71
72
|
else {
|
|
72
73
|
this.application.attachView(this.componentRef.hostView);
|
|
74
|
+
if (host) {
|
|
75
|
+
host.appendChild(this.getElement());
|
|
76
|
+
}
|
|
73
77
|
}
|
|
74
78
|
if (context) {
|
|
75
79
|
this.update(context);
|
|
@@ -83,7 +87,7 @@ class DynamicComponentRef {
|
|
|
83
87
|
this.componentRef = null;
|
|
84
88
|
return;
|
|
85
89
|
}
|
|
86
|
-
if (this.componentRef && !this.options.
|
|
90
|
+
if (this.componentRef && !isViewContainer(this.options.host)) {
|
|
87
91
|
this.application.detachView(this.componentRef.hostView);
|
|
88
92
|
}
|
|
89
93
|
this.componentRef?.destroy();
|
|
@@ -97,6 +101,9 @@ class DynamicComponentRef {
|
|
|
97
101
|
this.componentRef?.setInput(key, context[key]);
|
|
98
102
|
}
|
|
99
103
|
}
|
|
104
|
+
getContext() {
|
|
105
|
+
return this.options.context ?? {};
|
|
106
|
+
}
|
|
100
107
|
getView() {
|
|
101
108
|
return this.componentRef?.hostView ?? null;
|
|
102
109
|
}
|
|
@@ -117,7 +124,7 @@ class DynamicTemplateRef {
|
|
|
117
124
|
this.embeddedViewRef = null;
|
|
118
125
|
return;
|
|
119
126
|
}
|
|
120
|
-
if (!this.options.
|
|
127
|
+
if (!isViewContainer(this.options.host) && this.embeddedViewRef) {
|
|
121
128
|
this.application.detachView(this.embeddedViewRef);
|
|
122
129
|
}
|
|
123
130
|
this.embeddedViewRef?.destroy();
|
|
@@ -132,12 +139,15 @@ class DynamicTemplateRef {
|
|
|
132
139
|
this.detectChanges();
|
|
133
140
|
}
|
|
134
141
|
}
|
|
142
|
+
getContext() {
|
|
143
|
+
return this.options.context ?? {};
|
|
144
|
+
}
|
|
135
145
|
getView() {
|
|
136
146
|
return this.embeddedViewRef;
|
|
137
147
|
}
|
|
138
|
-
create({ context, template,
|
|
139
|
-
if (
|
|
140
|
-
this.embeddedViewRef =
|
|
148
|
+
create({ context, template, host }) {
|
|
149
|
+
if (isViewContainer(host)) {
|
|
150
|
+
this.embeddedViewRef = host.createEmbeddedView(template, context, { injector: this.options.injector });
|
|
141
151
|
}
|
|
142
152
|
else {
|
|
143
153
|
this.embeddedViewRef = template.createEmbeddedView(context ?? {}, this.options.injector);
|
|
@@ -152,15 +162,25 @@ function isDynamicView(value) {
|
|
|
152
162
|
|
|
153
163
|
const DYNAMIC_VIEW_CONTEXT = new InjectionToken('@odx/angular/cdk/dynamic-view::DynamicViewContext');
|
|
154
164
|
|
|
165
|
+
const ODX_DYNAMIC_VIEW_DEFAULT_HOST = new InjectionToken('@odx/angular/cdk/dynamic-view::DynamicViewDefaultHost', {
|
|
166
|
+
providedIn: 'root',
|
|
167
|
+
factory: () => inject(DOCUMENT).body,
|
|
168
|
+
});
|
|
169
|
+
function getDynamicViewDefaultHost() {
|
|
170
|
+
return inject(ODX_DYNAMIC_VIEW_DEFAULT_HOST);
|
|
171
|
+
}
|
|
172
|
+
|
|
155
173
|
class DynamicViewService {
|
|
156
174
|
constructor() {
|
|
157
|
-
this.injector =
|
|
175
|
+
this.injector = getInjector();
|
|
176
|
+
this.defaultHost = getDynamicViewDefaultHost();
|
|
158
177
|
}
|
|
159
178
|
createView(content, options = {}) {
|
|
160
179
|
const viewOptions = {
|
|
161
180
|
...options,
|
|
181
|
+
host: options.host ?? this.defaultHost,
|
|
162
182
|
injector: Injector.create({
|
|
163
|
-
providers: [{ provide: DYNAMIC_VIEW_CONTEXT, useValue: options.context }],
|
|
183
|
+
providers: [{ provide: DYNAMIC_VIEW_CONTEXT, useValue: options.context }, options.providers ?? []],
|
|
164
184
|
parent: options.injector ?? this.injector,
|
|
165
185
|
}),
|
|
166
186
|
};
|
|
@@ -180,9 +200,9 @@ class DynamicViewService {
|
|
|
180
200
|
throw new Error('Content type is not supported');
|
|
181
201
|
}
|
|
182
202
|
}
|
|
183
|
-
DynamicViewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
184
|
-
DynamicViewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.
|
|
185
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
203
|
+
DynamicViewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DynamicViewService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
204
|
+
DynamicViewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DynamicViewService, providedIn: 'root' });
|
|
205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DynamicViewService, decorators: [{
|
|
186
206
|
type: Injectable,
|
|
187
207
|
args: [{ providedIn: 'root' }]
|
|
188
208
|
}] });
|
|
@@ -244,7 +264,7 @@ class DynamicViewDirective {
|
|
|
244
264
|
context: this.context ?? undefined,
|
|
245
265
|
injector: this.injector ?? this.viewContainer.injector,
|
|
246
266
|
projectableNodes,
|
|
247
|
-
|
|
267
|
+
host: this.viewContainer,
|
|
248
268
|
});
|
|
249
269
|
}
|
|
250
270
|
}
|
|
@@ -255,9 +275,9 @@ class DynamicViewDirective {
|
|
|
255
275
|
this.viewRef = null;
|
|
256
276
|
}
|
|
257
277
|
}
|
|
258
|
-
DynamicViewDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
259
|
-
DynamicViewDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.
|
|
260
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
278
|
+
DynamicViewDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DynamicViewDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
279
|
+
DynamicViewDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: DynamicViewDirective, isStandalone: true, selector: "ng-template[odxDynamicView]", inputs: { content: ["odxDynamicView", "content"], injector: ["odxDynamicViewInjector", "injector"], context: ["odxDynamicViewContext", "context"] }, usesOnChanges: true, ngImport: i0 });
|
|
280
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DynamicViewDirective, decorators: [{
|
|
261
281
|
type: Directive,
|
|
262
282
|
args: [{
|
|
263
283
|
selector: 'ng-template[odxDynamicView]',
|
|
@@ -278,5 +298,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImpor
|
|
|
278
298
|
* Generated bundle index. Do not edit.
|
|
279
299
|
*/
|
|
280
300
|
|
|
281
|
-
export { DYNAMIC_VIEW_CONTEXT, DynamicComponentRef, DynamicTemplateRef, DynamicViewComponent, DynamicViewDirective, DynamicViewService, createProjectableNodes, isDynamicTextContent, isDynamicView };
|
|
301
|
+
export { DYNAMIC_VIEW_CONTEXT, DynamicComponentRef, DynamicTemplateRef, DynamicViewComponent, DynamicViewDirective, DynamicViewService, ODX_DYNAMIC_VIEW_DEFAULT_HOST, createProjectableNodes, getDynamicViewDefaultHost, isDynamicTextContent, isDynamicView };
|
|
282
302
|
//# sourceMappingURL=odx-angular-cdk-dynamic-view.mjs.map
|