@odx/angular 1.0.0-rc.3 → 1.0.0-rc.5
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.component.d.ts +3 -3
- package/cdk/dynamic-view/lib/dynamic-view.directive.d.ts +3 -1
- 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/helpers/create-projectable-nodes.d.ts +2 -0
- package/cdk/dynamic-view/lib/helpers/index.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 +7 -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/chip/README.md +3 -0
- package/components/chip/index.d.ts +2 -0
- package/components/chip/lib/chip.component.d.ts +15 -0
- package/components/chip/lib/models/chip-size.d.ts +5 -0
- package/components/chip/lib/models/chip-variant.d.ts +7 -0
- package/components/chip/lib/models/index.d.ts +2 -0
- package/components/circular-progress/README.md +3 -0
- package/components/circular-progress/index.d.ts +2 -0
- package/components/circular-progress/lib/circular-progress.component.d.ts +28 -0
- package/components/circular-progress/lib/models/circular-progress-size.d.ts +7 -0
- package/components/circular-progress/lib/models/index.d.ts +1 -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/loading-spinner/README.md +3 -0
- package/components/loading-spinner/index.d.ts +3 -0
- package/components/loading-spinner/lib/loading-spinner.component.d.ts +15 -0
- package/components/loading-spinner/lib/loading-spinner.directive.d.ts +26 -0
- package/components/loading-spinner/lib/loading-spinner.module.d.ts +9 -0
- package/components/loading-spinner/lib/loading-spinner.service.d.ts +9 -0
- package/components/main-menu/lib/directives/main-menu-item.directive.d.ts +6 -1
- package/components/main-menu/lib/main-menu.component.d.ts +3 -1
- package/components/modal/lib/components/modal-header/modal-header.component.d.ts +1 -0
- package/components/modal/lib/modal.component.d.ts +4 -3
- package/components/modal/lib/modal.directive.d.ts +8 -4
- 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-ref.d.ts +4 -2
- package/components/modal/lib/models/modal-variant.d.ts +5 -0
- package/components/progress/README.md +3 -0
- package/components/progress/index.d.ts +1 -0
- package/components/progress/lib/progress.component.d.ts +14 -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 +12 -0
- package/components/rail-navigation/lib/rail-navigation.module.d.ts +9 -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/fade.mjs +2 -5
- 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 +13 -15
- 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 +23 -14
- package/esm2020/cdk/dynamic-view/lib/dynamic-view.directive.mjs +21 -9
- 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/helpers/create-projectable-nodes.mjs +9 -0
- package/esm2020/cdk/dynamic-view/lib/helpers/index.mjs +2 -1
- package/esm2020/cdk/dynamic-view/lib/models/dynamic-component-ref.mjs +13 -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 +7 -7
- 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 +4 -4
- 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/index.mjs +3 -0
- package/esm2020/components/chip/lib/chip.component.mjs +54 -0
- package/esm2020/components/chip/lib/models/chip-size.mjs +5 -0
- package/esm2020/components/chip/lib/models/chip-variant.mjs +7 -0
- package/esm2020/components/chip/lib/models/index.mjs +3 -0
- package/esm2020/components/chip/odx-angular-components-chip.mjs +5 -0
- package/esm2020/components/circular-progress/index.mjs +3 -0
- package/esm2020/components/circular-progress/lib/circular-progress.component.mjs +91 -0
- package/esm2020/components/circular-progress/lib/models/circular-progress-size.mjs +7 -0
- package/esm2020/components/circular-progress/lib/models/index.mjs +2 -0
- package/esm2020/components/circular-progress/odx-angular-components-circular-progress.mjs +5 -0
- 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/index.mjs +4 -0
- package/esm2020/components/loading-spinner/lib/loading-spinner.component.mjs +58 -0
- package/esm2020/components/loading-spinner/lib/loading-spinner.directive.mjs +87 -0
- package/esm2020/components/loading-spinner/lib/loading-spinner.module.mjs +19 -0
- package/esm2020/components/loading-spinner/lib/loading-spinner.service.mjs +17 -0
- package/esm2020/components/loading-spinner/odx-angular-components-loading-spinner.mjs +5 -0
- 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 +20 -9
- package/esm2020/components/main-menu/lib/main-menu.component.mjs +7 -6
- 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 +10 -8
- 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 +29 -16
- package/esm2020/components/modal/lib/modal.config.mjs +3 -1
- package/esm2020/components/modal/lib/modal.directive.mjs +24 -6
- 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-ref.mjs +9 -2
- 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/index.mjs +2 -0
- package/esm2020/components/progress/lib/progress.component.mjs +51 -0
- package/esm2020/components/progress/odx-angular-components-progress.mjs +5 -0
- 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 +41 -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/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 +15 -13
- 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 +5 -3
- 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 +12 -14
- 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 +88 -38
- 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 +13 -13
- 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 +13 -13
- 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 +71 -0
- package/fesm2015/odx-angular-components-chip.mjs.map +1 -0
- package/fesm2015/odx-angular-components-circular-progress.mjs +103 -0
- package/fesm2015/odx-angular-components-circular-progress.mjs.map +1 -0
- 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 +173 -0
- package/fesm2015/odx-angular-components-loading-spinner.mjs.map +1 -0
- 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 +34 -23
- package/fesm2015/odx-angular-components-main-menu.mjs.map +1 -1
- package/fesm2015/odx-angular-components-modal.mjs +97 -66
- package/fesm2015/odx-angular-components-modal.mjs.map +1 -1
- package/fesm2015/odx-angular-components-progress.mjs +57 -0
- package/fesm2015/odx-angular-components-progress.mjs.map +1 -0
- 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 +97 -0
- package/fesm2015/odx-angular-components-rail-navigation.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 +38 -33
- package/fesm2015/odx-angular.mjs.map +1 -1
- package/fesm2020/odx-angular-animations.mjs +5 -6
- 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 +12 -14
- 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 +82 -33
- 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 +13 -13
- 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 +13 -13
- 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 +71 -0
- package/fesm2020/odx-angular-components-chip.mjs.map +1 -0
- package/fesm2020/odx-angular-components-circular-progress.mjs +103 -0
- package/fesm2020/odx-angular-components-circular-progress.mjs.map +1 -0
- 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 +172 -0
- package/fesm2020/odx-angular-components-loading-spinner.mjs.map +1 -0
- 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 +34 -23
- package/fesm2020/odx-angular-components-main-menu.mjs.map +1 -1
- package/fesm2020/odx-angular-components-modal.mjs +96 -65
- package/fesm2020/odx-angular-components-modal.mjs.map +1 -1
- package/fesm2020/odx-angular-components-progress.mjs +57 -0
- package/fesm2020/odx-angular-components-progress.mjs.map +1 -0
- 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 +96 -0
- package/fesm2020/odx-angular-components-rail-navigation.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 +38 -33
- package/fesm2020/odx-angular.mjs.map +1 -1
- package/lib/controllers/controller.d.ts +1 -2
- package/package.json +59 -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 @@
|
|
|
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;AACY,QAAA,IAAkB,CAAA,kBAAA,GAAG,cAAc,EAAE,CAAC;QACtC,IAAA,CAAA,eAAe,GAAG,IAA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
|
-
import {
|
|
3
|
-
import { Validators } from '@angular/forms';
|
|
2
|
+
import { Directive, Input } from '@angular/core';
|
|
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
|
-
|
|
13
|
-
|
|
11
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
12
|
+
this.controlValue = null;
|
|
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.10", ngImport: i0, type: CheckBoxControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
30
|
+
CheckBoxControl.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.10", type: CheckBoxControl, selector: "[odxCheckBoxControl]", inputs: { checked: "checked", controlValue: ["value", "controlValue"] }, usesInheritance: true, ngImport: i0 });
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", 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 {
|
|
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":";;;;;;AASM,MAAO,eAAgB,SAAQ,iBAA0B,CAAA;AAqB7D,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,KAAK,CAAC,CAAC;AAnBC,QAAA,IAAO,CAAA,OAAA,GAAG,aAAa,EAAE,CAAC;;AAYnC,QAAA,IAAY,CAAA,YAAA,GAAkB,IAAI,CAAC;AAQxC,QAAA,uBAAuB,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;KAC3C;IAnBD,IACW,OAAO,CAAC,KAAc,EAAA;AAC/B,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;KACpB;AACD,IAAA,IAAW,OAAO,GAAA;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC;KACnB;AAMD,IAAA,IAAW,WAAW,GAAA;AACpB,QAAA,OAAO,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC/C;AAOM,IAAA,SAAS,CAAC,KAAY,EAAA;QAC3B,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,KAAK,CAAC,WAAW,CAAE,KAAK,CAAC,MAA2B,CAAC,OAAO,CAAC,CAAC;KAC/D;;6GA7BU,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;iGAAf,eAAe,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,OAAA,EAAA,cAAA,CAAA,EAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;iBACjC,CAAA;0EAOY,OAAO,EAAA,CAAA;sBADjB,KAAK;gBAUC,YAAY,EAAA,CAAA;sBADlB,KAAK;uBAAC,OAAO,CAAA;;;ACvBhB;;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.10", ngImport: i0, type: ControlDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
13
|
+
ControlDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.10", type: ControlDirective, isStandalone: true, selector: "[odxControl]", exportAs: ["odxControl"], ngImport: i0 });
|
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: ControlDirective, decorators: [{
|
|
17
15
|
type: Directive,
|
|
18
16
|
args: [{
|
|
19
17
|
standalone: true,
|
|
@@ -24,12 +22,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
|
|
|
24
22
|
|
|
25
23
|
class CustomFormControl extends Controller {
|
|
26
24
|
constructor(initialValue) {
|
|
27
|
-
var _a, _b;
|
|
28
25
|
super();
|
|
29
|
-
this.
|
|
26
|
+
this.requiredValidator = inject(RequiredValidator, { optional: true, self: true });
|
|
30
27
|
this.disabledController = DisabledController.inject();
|
|
31
28
|
this.readonlyController = ReadonlyController.inject();
|
|
32
|
-
this.enabled$ = (_b = (_a = this.disabledController) === null || _a === void 0 ? void 0 : _a.change$.pipe(filter(() => !this.isDisabled))) !== null && _b !== void 0 ? _b : EMPTY;
|
|
33
29
|
this.ngControl = inject(NgControl, { self: true, optional: true });
|
|
34
30
|
this.id = null;
|
|
35
31
|
this.name = `odx-form-control-${CustomFormControl.CURRENT_INDEX++}`;
|
|
@@ -38,22 +34,14 @@ class CustomFormControl extends Controller {
|
|
|
38
34
|
if (this.ngControl) {
|
|
39
35
|
this.ngControl.valueAccessor = this;
|
|
40
36
|
}
|
|
41
|
-
this.enabled$.subscribe(() => this.updateRequiredValidator());
|
|
42
|
-
}
|
|
43
|
-
set required(value) {
|
|
44
|
-
this.isRequired = coerceBooleanProperty(value);
|
|
45
|
-
this.updateRequiredValidator();
|
|
46
|
-
}
|
|
47
|
-
get required() {
|
|
48
|
-
return this.isRequired;
|
|
49
37
|
}
|
|
50
|
-
set
|
|
38
|
+
set value(value) {
|
|
51
39
|
if (this.internalValue !== value) {
|
|
52
40
|
this.internalValue = value;
|
|
53
41
|
this.triggerControllerChange();
|
|
54
42
|
}
|
|
55
43
|
}
|
|
56
|
-
get
|
|
44
|
+
get value() {
|
|
57
45
|
return this.internalValue;
|
|
58
46
|
}
|
|
59
47
|
get hasError() {
|
|
@@ -68,14 +56,15 @@ class CustomFormControl extends Controller {
|
|
|
68
56
|
var _a;
|
|
69
57
|
return !!((_a = this.readonlyController) === null || _a === void 0 ? void 0 : _a.readonly);
|
|
70
58
|
}
|
|
71
|
-
|
|
72
|
-
|
|
59
|
+
get isRequired() {
|
|
60
|
+
var _a;
|
|
61
|
+
return !!((_a = this.requiredValidator) === null || _a === void 0 ? void 0 : _a.required) || this.hasValidator(Validators.required) || this.hasValidator(Validators.requiredTrue);
|
|
73
62
|
}
|
|
74
63
|
onTouched() {
|
|
75
|
-
//
|
|
64
|
+
// implemented by control value accessor
|
|
76
65
|
}
|
|
77
66
|
onChange(_value) {
|
|
78
|
-
//
|
|
67
|
+
// implemented by control value accessor
|
|
79
68
|
}
|
|
80
69
|
registerOnChange(fn) {
|
|
81
70
|
this.onChange = fn;
|
|
@@ -88,40 +77,26 @@ class CustomFormControl extends Controller {
|
|
|
88
77
|
(_a = this.disabledController) === null || _a === void 0 ? void 0 : _a.setDisabledState(isDisabled);
|
|
89
78
|
}
|
|
90
79
|
writeValue(value) {
|
|
91
|
-
this.
|
|
80
|
+
if (this.isDisabled)
|
|
81
|
+
return;
|
|
82
|
+
this.value = value;
|
|
83
|
+
this.onChange(value);
|
|
92
84
|
}
|
|
93
85
|
updateValue(value) {
|
|
86
|
+
if (this.isDisabled)
|
|
87
|
+
return;
|
|
94
88
|
this.writeValue(value);
|
|
95
|
-
this.onChange(value);
|
|
96
89
|
this.onTouched();
|
|
97
90
|
}
|
|
98
|
-
|
|
99
|
-
var _a;
|
|
100
|
-
|
|
101
|
-
if (!control)
|
|
102
|
-
return;
|
|
103
|
-
const hasValidator = control.hasValidator(validator);
|
|
104
|
-
if (state && hasValidator)
|
|
105
|
-
return;
|
|
106
|
-
if (!state && !hasValidator)
|
|
107
|
-
return;
|
|
108
|
-
if (state) {
|
|
109
|
-
control.addValidators(validator);
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
control.removeValidators(validator);
|
|
113
|
-
}
|
|
114
|
-
control.updateValueAndValidity();
|
|
115
|
-
control.markAsUntouched();
|
|
116
|
-
}
|
|
117
|
-
updateRequiredValidator() {
|
|
118
|
-
this.toggleValidator(Validators.required, this.isRequired);
|
|
91
|
+
hasValidator(validator) {
|
|
92
|
+
var _a, _b;
|
|
93
|
+
return !!((_b = (_a = this.ngControl) === null || _a === void 0 ? void 0 : _a.control) === null || _b === void 0 ? void 0 : _b.hasValidator(validator));
|
|
119
94
|
}
|
|
120
95
|
}
|
|
121
96
|
CustomFormControl.CURRENT_INDEX = 0;
|
|
122
|
-
CustomFormControl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
123
|
-
CustomFormControl.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.
|
|
124
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
97
|
+
CustomFormControl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: CustomFormControl, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
|
98
|
+
CustomFormControl.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.10", 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 });
|
|
99
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: CustomFormControl, decorators: [{
|
|
125
100
|
type: Directive,
|
|
126
101
|
args: [{
|
|
127
102
|
host: {
|
|
@@ -135,8 +110,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
|
|
|
135
110
|
type: Input
|
|
136
111
|
}], name: [{
|
|
137
112
|
type: Input
|
|
138
|
-
}], required: [{
|
|
139
|
-
type: Input
|
|
140
113
|
}], control: [{
|
|
141
114
|
type: ViewChild,
|
|
142
115
|
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;AAMkB,QAAA,IAAO,CAAA,OAAA,GAAG,aAAa,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AG,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;iBACF,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,25 +1,37 @@
|
|
|
1
|
-
import { AsyncPipe } from '@angular/common';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, reflectComponentType, ApplicationRef, createComponent, EnvironmentInjector, InjectionToken, inject, Injector, Injectable, ViewContainerRef, TemplateRef, Directive } from '@angular/core';
|
|
3
|
+
import { injectElement, isString, isViewContainer, getInjector, isTemplateRef, isComponent, hasChanged } from '@odx/angular/utils';
|
|
4
|
+
import { isObservable, distinctUntilChanged } from 'rxjs';
|
|
5
|
+
import { DOCUMENT } from '@angular/common';
|
|
6
6
|
|
|
7
7
|
class DynamicViewComponent {
|
|
8
8
|
constructor() {
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
9
|
+
this.element = injectElement();
|
|
10
|
+
this.currentSubscription = null;
|
|
11
11
|
}
|
|
12
12
|
set content(value) {
|
|
13
|
-
|
|
13
|
+
if (isObservable(value)) {
|
|
14
|
+
this.ngOnDestroy();
|
|
15
|
+
this.currentSubscription = value.pipe(distinctUntilChanged()).subscribe((innerValue) => {
|
|
16
|
+
this.setContent(innerValue);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
this.setContent(value);
|
|
21
|
+
}
|
|
14
22
|
}
|
|
15
23
|
ngOnDestroy() {
|
|
16
24
|
var _a;
|
|
17
|
-
(_a = this.
|
|
25
|
+
(_a = this.currentSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
26
|
+
this.currentSubscription = null;
|
|
27
|
+
}
|
|
28
|
+
setContent(value) {
|
|
29
|
+
this.element.nativeElement.innerHTML = value;
|
|
18
30
|
}
|
|
19
31
|
}
|
|
20
|
-
DynamicViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
21
|
-
DynamicViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.
|
|
22
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
32
|
+
DynamicViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: DynamicViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
33
|
+
DynamicViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.10", type: DynamicViewComponent, isStandalone: true, selector: "odx-dynamic-view", inputs: { content: "content" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: DynamicViewComponent, decorators: [{
|
|
23
35
|
type: Component,
|
|
24
36
|
args: [{
|
|
25
37
|
selector: 'odx-dynamic-view',
|
|
@@ -27,14 +39,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
|
|
|
27
39
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
28
40
|
encapsulation: ViewEncapsulation.None,
|
|
29
41
|
standalone: true,
|
|
30
|
-
host: {
|
|
31
|
-
'[innerHTML]': 'resolveContent()',
|
|
32
|
-
},
|
|
33
42
|
}]
|
|
34
43
|
}], propDecorators: { content: [{
|
|
35
44
|
type: Input
|
|
36
45
|
}] } });
|
|
37
46
|
|
|
47
|
+
function createProjectableNodes(component, nodes) {
|
|
48
|
+
const componentType = reflectComponentType(component);
|
|
49
|
+
if (componentType && componentType.ngContentSelectors.length > 0) {
|
|
50
|
+
return componentType.ngContentSelectors.map((selector) => (selector === '*' ? nodes : []));
|
|
51
|
+
}
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
|
|
38
55
|
function isDynamicTextContent(value) {
|
|
39
56
|
return isString(value) || isObservable(value);
|
|
40
57
|
}
|
|
@@ -44,16 +61,20 @@ class DynamicComponentRef {
|
|
|
44
61
|
this.options = options;
|
|
45
62
|
this.application = this.options.injector.get(ApplicationRef);
|
|
46
63
|
this.componentRef = null;
|
|
47
|
-
const { component, context, injector,
|
|
64
|
+
const { component, context, injector, projectableNodes, host } = options;
|
|
48
65
|
this.componentRef = createComponent(component, {
|
|
49
66
|
environmentInjector: injector.get(EnvironmentInjector),
|
|
50
67
|
elementInjector: injector,
|
|
68
|
+
projectableNodes,
|
|
51
69
|
});
|
|
52
|
-
if (
|
|
53
|
-
|
|
70
|
+
if (isViewContainer(host)) {
|
|
71
|
+
host.insert(this.componentRef.hostView);
|
|
54
72
|
}
|
|
55
73
|
else {
|
|
56
74
|
this.application.attachView(this.componentRef.hostView);
|
|
75
|
+
if (host) {
|
|
76
|
+
host.appendChild(this.getElement());
|
|
77
|
+
}
|
|
57
78
|
}
|
|
58
79
|
if (context) {
|
|
59
80
|
this.update(context);
|
|
@@ -69,7 +90,7 @@ class DynamicComponentRef {
|
|
|
69
90
|
this.componentRef = null;
|
|
70
91
|
return;
|
|
71
92
|
}
|
|
72
|
-
if (this.componentRef && !this.options.
|
|
93
|
+
if (this.componentRef && !isViewContainer(this.options.host)) {
|
|
73
94
|
this.application.detachView(this.componentRef.hostView);
|
|
74
95
|
}
|
|
75
96
|
(_b = this.componentRef) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
@@ -85,6 +106,10 @@ class DynamicComponentRef {
|
|
|
85
106
|
(_a = this.componentRef) === null || _a === void 0 ? void 0 : _a.setInput(key, context[key]);
|
|
86
107
|
}
|
|
87
108
|
}
|
|
109
|
+
getContext() {
|
|
110
|
+
var _a;
|
|
111
|
+
return (_a = this.options.context) !== null && _a !== void 0 ? _a : {};
|
|
112
|
+
}
|
|
88
113
|
getView() {
|
|
89
114
|
var _a, _b;
|
|
90
115
|
return (_b = (_a = this.componentRef) === null || _a === void 0 ? void 0 : _a.hostView) !== null && _b !== void 0 ? _b : null;
|
|
@@ -108,7 +133,7 @@ class DynamicTemplateRef {
|
|
|
108
133
|
this.embeddedViewRef = null;
|
|
109
134
|
return;
|
|
110
135
|
}
|
|
111
|
-
if (!this.options.
|
|
136
|
+
if (!isViewContainer(this.options.host) && this.embeddedViewRef) {
|
|
112
137
|
this.application.detachView(this.embeddedViewRef);
|
|
113
138
|
}
|
|
114
139
|
(_b = this.embeddedViewRef) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
@@ -124,12 +149,16 @@ class DynamicTemplateRef {
|
|
|
124
149
|
this.detectChanges();
|
|
125
150
|
}
|
|
126
151
|
}
|
|
152
|
+
getContext() {
|
|
153
|
+
var _a;
|
|
154
|
+
return (_a = this.options.context) !== null && _a !== void 0 ? _a : {};
|
|
155
|
+
}
|
|
127
156
|
getView() {
|
|
128
157
|
return this.embeddedViewRef;
|
|
129
158
|
}
|
|
130
|
-
create({ context, template,
|
|
131
|
-
if (
|
|
132
|
-
this.embeddedViewRef =
|
|
159
|
+
create({ context, template, host }) {
|
|
160
|
+
if (isViewContainer(host)) {
|
|
161
|
+
this.embeddedViewRef = host.createEmbeddedView(template, context, { injector: this.options.injector });
|
|
133
162
|
}
|
|
134
163
|
else {
|
|
135
164
|
this.embeddedViewRef = template.createEmbeddedView(context !== null && context !== void 0 ? context : {}, this.options.injector);
|
|
@@ -144,15 +173,24 @@ function isDynamicView(value) {
|
|
|
144
173
|
|
|
145
174
|
const DYNAMIC_VIEW_CONTEXT = new InjectionToken('@odx/angular/cdk/dynamic-view::DynamicViewContext');
|
|
146
175
|
|
|
176
|
+
const ODX_DYNAMIC_VIEW_DEFAULT_HOST = new InjectionToken('@odx/angular/cdk/dynamic-view::DynamicViewDefaultHost', {
|
|
177
|
+
providedIn: 'root',
|
|
178
|
+
factory: () => inject(DOCUMENT).body,
|
|
179
|
+
});
|
|
180
|
+
function getDynamicViewDefaultHost() {
|
|
181
|
+
return inject(ODX_DYNAMIC_VIEW_DEFAULT_HOST);
|
|
182
|
+
}
|
|
183
|
+
|
|
147
184
|
class DynamicViewService {
|
|
148
185
|
constructor() {
|
|
149
|
-
this.injector =
|
|
186
|
+
this.injector = getInjector();
|
|
187
|
+
this.defaultHost = getDynamicViewDefaultHost();
|
|
150
188
|
}
|
|
151
189
|
createView(content, options = {}) {
|
|
152
|
-
var _a;
|
|
153
|
-
const viewOptions = Object.assign(Object.assign({}, options), { injector: Injector.create({
|
|
154
|
-
providers: [{ provide: DYNAMIC_VIEW_CONTEXT, useValue: options.context }],
|
|
155
|
-
parent: (
|
|
190
|
+
var _a, _b, _c;
|
|
191
|
+
const viewOptions = Object.assign(Object.assign({}, options), { host: (_a = options.host) !== null && _a !== void 0 ? _a : this.defaultHost, injector: Injector.create({
|
|
192
|
+
providers: [{ provide: DYNAMIC_VIEW_CONTEXT, useValue: options.context }, (_b = options.providers) !== null && _b !== void 0 ? _b : []],
|
|
193
|
+
parent: (_c = options.injector) !== null && _c !== void 0 ? _c : this.injector,
|
|
156
194
|
}) });
|
|
157
195
|
if (isTemplateRef(content)) {
|
|
158
196
|
return new DynamicTemplateRef(Object.assign(Object.assign({}, viewOptions), { template: content }));
|
|
@@ -166,9 +204,9 @@ class DynamicViewService {
|
|
|
166
204
|
throw new Error('Content type is not supported');
|
|
167
205
|
}
|
|
168
206
|
}
|
|
169
|
-
DynamicViewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
170
|
-
DynamicViewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.
|
|
171
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
207
|
+
DynamicViewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: DynamicViewService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
208
|
+
DynamicViewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: DynamicViewService, providedIn: 'root' });
|
|
209
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: DynamicViewService, decorators: [{
|
|
172
210
|
type: Injectable,
|
|
173
211
|
args: [{ providedIn: 'root' }]
|
|
174
212
|
}] });
|
|
@@ -177,7 +215,10 @@ class DynamicViewDirective {
|
|
|
177
215
|
constructor() {
|
|
178
216
|
this.dynamicViewService = inject(DynamicViewService);
|
|
179
217
|
this.viewContainer = inject(ViewContainerRef);
|
|
218
|
+
this.template = inject(TemplateRef);
|
|
180
219
|
this.viewRef = null;
|
|
220
|
+
this.contentViewRef = null;
|
|
221
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
181
222
|
this.content = null;
|
|
182
223
|
}
|
|
183
224
|
ngOnInit() {
|
|
@@ -219,25 +260,34 @@ class DynamicViewDirective {
|
|
|
219
260
|
}
|
|
220
261
|
}
|
|
221
262
|
else {
|
|
263
|
+
let projectableNodes = [];
|
|
264
|
+
if (isComponent(this.content)) {
|
|
265
|
+
this.contentViewRef = this.dynamicViewService.createView(this.template, { injector: this.injector });
|
|
266
|
+
const rootNodes = this.contentViewRef.getView().rootNodes;
|
|
267
|
+
projectableNodes = createProjectableNodes(this.content, rootNodes);
|
|
268
|
+
}
|
|
222
269
|
this.viewRef = this.dynamicViewService.createView(this.content, {
|
|
223
270
|
context: (_c = this.context) !== null && _c !== void 0 ? _c : undefined,
|
|
224
271
|
injector: (_d = this.injector) !== null && _d !== void 0 ? _d : this.viewContainer.injector,
|
|
225
|
-
|
|
272
|
+
projectableNodes,
|
|
273
|
+
host: this.viewContainer,
|
|
226
274
|
});
|
|
227
275
|
}
|
|
228
276
|
}
|
|
229
277
|
destroy() {
|
|
230
|
-
var _a;
|
|
231
|
-
(_a = this.
|
|
278
|
+
var _a, _b;
|
|
279
|
+
(_a = this.contentViewRef) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
280
|
+
(_b = this.viewRef) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
281
|
+
this.contentViewRef = null;
|
|
232
282
|
this.viewRef = null;
|
|
233
283
|
}
|
|
234
284
|
}
|
|
235
|
-
DynamicViewDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
236
|
-
DynamicViewDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.
|
|
237
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
285
|
+
DynamicViewDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: DynamicViewDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
286
|
+
DynamicViewDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.10", type: DynamicViewDirective, isStandalone: true, selector: "ng-template[odxDynamicView]", inputs: { content: ["odxDynamicView", "content"], injector: ["odxDynamicViewInjector", "injector"], context: ["odxDynamicViewContext", "context"] }, usesOnChanges: true, ngImport: i0 });
|
|
287
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.10", ngImport: i0, type: DynamicViewDirective, decorators: [{
|
|
238
288
|
type: Directive,
|
|
239
289
|
args: [{
|
|
240
|
-
selector: '[odxDynamicView]',
|
|
290
|
+
selector: 'ng-template[odxDynamicView]',
|
|
241
291
|
standalone: true,
|
|
242
292
|
}]
|
|
243
293
|
}], propDecorators: { content: [{
|
|
@@ -255,5 +305,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
|
|
|
255
305
|
* Generated bundle index. Do not edit.
|
|
256
306
|
*/
|
|
257
307
|
|
|
258
|
-
export { DYNAMIC_VIEW_CONTEXT, DynamicComponentRef, DynamicTemplateRef, DynamicViewComponent, DynamicViewDirective, DynamicViewService, isDynamicTextContent, isDynamicView };
|
|
308
|
+
export { DYNAMIC_VIEW_CONTEXT, DynamicComponentRef, DynamicTemplateRef, DynamicViewComponent, DynamicViewDirective, DynamicViewService, ODX_DYNAMIC_VIEW_DEFAULT_HOST, createProjectableNodes, getDynamicViewDefaultHost, isDynamicTextContent, isDynamicView };
|
|
259
309
|
//# sourceMappingURL=odx-angular-cdk-dynamic-view.mjs.map
|