@odx/angular 1.0.0-rc.1 → 1.0.0-rc.2
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/LICENSE +1 -0
- package/README.md +44 -0
- package/animations/index.d.ts +3 -2
- package/animations/{config.d.ts → lib/config.d.ts} +0 -0
- package/animations/lib/expand.d.ts +2 -0
- package/animations/{fade.d.ts → lib/fade.d.ts} +0 -0
- package/animations/{slide.d.ts → lib/slide.d.ts} +0 -0
- package/cdk/checkbox-control/README.md +3 -0
- package/cdk/checkbox-control/index.d.ts +1 -0
- package/cdk/checkbox-control/lib/checkbox-control.directive.d.ts +16 -0
- package/cdk/custom-form-control/README.md +3 -0
- package/cdk/custom-form-control/index.d.ts +2 -0
- package/{lib/directives → cdk/custom-form-control/lib}/control.directive.d.ts +1 -3
- package/{lib/controls → cdk/custom-form-control/lib}/custom-form-control.d.ts +7 -8
- package/cdk/dynamic-view/lib/dynamic-view.directive.d.ts +1 -1
- package/cdk/dynamic-view/lib/facade/dynamic-content.d.ts +1 -1
- package/cdk/dynamic-view/lib/facade/dynamic-view-ref.d.ts +1 -1
- package/cdk/dynamic-view/lib/facade/index.d.ts +0 -1
- package/cdk/dynamic-view/lib/helpers/index.d.ts +0 -2
- package/cdk/dynamic-view/lib/models/dynamic-component-ref.d.ts +5 -3
- package/cdk/dynamic-view/lib/models/dynamic-template-ref.d.ts +1 -1
- package/cdk/expandable/README.md +3 -0
- package/cdk/expandable/index.d.ts +3 -0
- package/cdk/expandable/lib/directives/expandable-item.directive.d.ts +18 -0
- package/cdk/expandable/lib/directives/extandable-container.directive.d.ts +13 -0
- package/cdk/expandable/lib/directives/index.d.ts +2 -0
- package/cdk/expandable/lib/expandable.module.d.ts +8 -0
- package/cdk/expandable/lib/facade/expandable-container.d.ts +6 -0
- package/cdk/expandable/lib/facade/expandable-item.d.ts +7 -0
- package/cdk/expandable/lib/facade/index.d.ts +2 -0
- package/cdk/radio-group-control/README.md +3 -0
- package/cdk/radio-group-control/index.d.ts +3 -0
- package/cdk/radio-group-control/lib/radio-control.directive.d.ts +13 -0
- package/cdk/radio-group-control/lib/radio-group-control.directive.d.ts +10 -0
- package/cdk/radio-group-control/lib/radio-group-control.module.d.ts +9 -0
- package/components/accordion/README.md +3 -0
- package/components/accordion/index.d.ts +4 -0
- package/components/accordion/lib/accordion.component.d.ts +7 -0
- package/components/accordion/lib/accordion.module.d.ts +10 -0
- package/components/accordion/lib/components/accordion-item/accordion-item.component.d.ts +16 -0
- package/components/accordion/lib/components/index.d.ts +1 -0
- package/components/accordion/lib/directives/accordion-item-title.d.ts +5 -0
- package/components/accordion/lib/directives/index.d.ts +1 -0
- package/components/action-group/action-group.component.d.ts +1 -3
- package/components/area-header/area-header.component.d.ts +1 -3
- package/components/area-header/area-header.module.d.ts +2 -1
- package/components/avatar/lib/avatar.component.d.ts +1 -3
- package/components/badge/lib/badge.component.d.ts +3 -5
- package/components/badge/lib/badge.directive.d.ts +4 -5
- package/components/button/lib/button.component.d.ts +8 -16
- package/components/button/lib/models/button-size.d.ts +5 -0
- package/components/button/lib/models/index.d.ts +1 -0
- package/components/button-group/README.md +3 -0
- package/components/button-group/index.d.ts +1 -0
- package/components/button-group/lib/button-group.component.d.ts +15 -0
- package/components/checkbox/lib/checkbox.component.d.ts +5 -12
- package/components/form-field/README.md +3 -0
- package/components/form-field/index.d.ts +6 -0
- package/components/form-field/lib/components/form-field-info/form-field-info.component.d.ts +9 -0
- package/components/form-field/lib/components/form-group/form-group.component.d.ts +14 -0
- package/components/form-field/lib/components/index.d.ts +2 -0
- package/components/form-field/lib/directives/form-field-control.directive.d.ts +22 -0
- package/components/form-field/lib/directives/form-field-error.directive.d.ts +10 -0
- package/components/form-field/lib/directives/form-field-hint.directive.d.ts +8 -0
- package/components/form-field/lib/directives/form-field-label.directive.d.ts +6 -0
- package/components/form-field/lib/directives/form.directive.d.ts +9 -0
- package/components/form-field/lib/directives/index.d.ts +5 -0
- package/components/form-field/lib/form-field.component.d.ts +18 -0
- package/components/form-field/lib/form-field.config.d.ts +19 -0
- package/components/form-field/lib/form-field.module.d.ts +18 -0
- package/components/form-field/lib/form-field.service.d.ts +30 -0
- package/components/form-field/lib/models/form-field-error-resolver.d.ts +27 -0
- package/components/form-field/lib/models/form-field-error.d.ts +7 -0
- package/components/form-field/lib/models/index.d.ts +2 -0
- package/components/form-field/lib/services/form-field-error.service.d.ts +18 -0
- package/components/form-field/lib/services/index.d.ts +1 -0
- package/components/header/lib/header.component.d.ts +1 -3
- package/components/header/lib/header.module.d.ts +2 -1
- package/components/icon/lib/icon.component.d.ts +9 -5
- package/components/link/link.directive.d.ts +4 -6
- package/components/logo/logo.directive.d.ts +1 -3
- package/components/main-menu/lib/directives/main-menu-button.directive.d.ts +1 -4
- package/components/main-menu/lib/directives/main-menu-item.directive.d.ts +3 -4
- package/components/main-menu/lib/main-menu.component.d.ts +2 -4
- package/components/main-menu/lib/main-menu.module.d.ts +6 -6
- package/components/modal/README.md +3 -0
- package/components/modal/index.d.ts +9 -0
- package/components/modal/lib/components/index.d.ts +2 -0
- package/components/modal/lib/components/modal-footer/modal-footer.component.d.ts +6 -0
- package/components/modal/lib/components/modal-header/modal-header.component.d.ts +11 -0
- package/components/modal/lib/directives/index.d.ts +3 -0
- package/components/modal/lib/directives/modal-close.directive.d.ts +8 -0
- package/components/modal/lib/directives/modal-content.directive.d.ts +6 -0
- package/components/modal/lib/directives/modal-dismiss.directive.d.ts +7 -0
- package/components/modal/lib/helpers/index.d.ts +2 -0
- package/components/modal/lib/helpers/inject-modal-ref.d.ts +2 -0
- package/components/modal/lib/helpers/provide-modal-ref.d.ts +3 -0
- package/components/modal/lib/modal.component.d.ts +16 -0
- package/components/modal/lib/modal.config.d.ts +3 -0
- package/components/modal/lib/modal.directive.d.ts +14 -0
- package/components/modal/lib/modal.module.d.ts +21 -0
- package/components/modal/lib/modal.service.d.ts +20 -0
- package/components/modal/lib/models/index.d.ts +4 -0
- package/components/modal/lib/models/modal-options.d.ts +13 -0
- package/components/modal/lib/models/modal-ref.d.ts +16 -0
- package/components/modal/lib/models/modal-size.d.ts +6 -0
- package/components/modal/lib/models/modal-type.d.ts +8 -0
- package/components/modal/lib/services/index.d.ts +1 -0
- package/components/modal/lib/services/open-modal-manager.service.d.ts +15 -0
- package/components/radio-group/lib/components/radio-button/radio-button.component.d.ts +4 -11
- package/components/radio-group/lib/radio-group.component.d.ts +3 -5
- package/components/radio-group/lib/radio-group.module.d.ts +4 -4
- package/components/switch/README.md +3 -0
- package/components/switch/index.d.ts +1 -0
- package/components/switch/lib/switch.component.d.ts +6 -0
- package/components/toggle-button-group/README.md +3 -0
- package/components/toggle-button-group/index.d.ts +3 -0
- package/components/toggle-button-group/lib/components/index.d.ts +1 -0
- package/components/toggle-button-group/lib/components/toggle-button/toggle-button.component.d.ts +7 -0
- package/components/toggle-button-group/lib/toggle-button-group.component.d.ts +7 -0
- package/components/toggle-button-group/lib/toggle-button-group.module.d.ts +9 -0
- package/esm2020/animations/index.mjs +4 -3
- package/esm2020/animations/lib/config.mjs +8 -0
- package/esm2020/animations/lib/expand.mjs +12 -0
- package/esm2020/animations/lib/fade.mjs +12 -0
- package/esm2020/animations/lib/slide.mjs +34 -0
- package/esm2020/cdk/checkbox-control/index.mjs +2 -0
- package/esm2020/cdk/checkbox-control/lib/checkbox-control.directive.mjs +43 -0
- package/esm2020/cdk/checkbox-control/odx-angular-cdk-checkbox-control.mjs +5 -0
- package/esm2020/cdk/custom-form-control/index.mjs +3 -0
- package/esm2020/cdk/custom-form-control/lib/control.directive.mjs +19 -0
- package/esm2020/cdk/custom-form-control/lib/custom-form-control.mjs +121 -0
- package/esm2020/cdk/custom-form-control/odx-angular-cdk-custom-form-control.mjs +5 -0
- package/esm2020/cdk/dynamic-view/lib/dynamic-view.component.mjs +3 -3
- package/esm2020/cdk/dynamic-view/lib/dynamic-view.directive.mjs +11 -10
- package/esm2020/cdk/dynamic-view/lib/dynamic-view.service.mjs +5 -5
- package/esm2020/cdk/dynamic-view/lib/facade/dynamic-content.mjs +1 -1
- package/esm2020/cdk/dynamic-view/lib/facade/dynamic-view-ref.mjs +1 -1
- package/esm2020/cdk/dynamic-view/lib/facade/index.mjs +1 -2
- package/esm2020/cdk/dynamic-view/lib/helpers/index.mjs +1 -3
- package/esm2020/cdk/dynamic-view/lib/helpers/is-dynamic-text-content.mjs +2 -2
- package/esm2020/cdk/dynamic-view/lib/models/dynamic-component-ref.mjs +18 -8
- package/esm2020/cdk/dynamic-view/lib/models/dynamic-template-ref.mjs +6 -2
- package/esm2020/cdk/expandable/index.mjs +4 -0
- package/esm2020/cdk/expandable/lib/directives/expandable-item.directive.mjs +48 -0
- package/esm2020/cdk/expandable/lib/directives/extandable-container.directive.mjs +43 -0
- package/esm2020/cdk/expandable/lib/directives/index.mjs +3 -0
- package/esm2020/cdk/expandable/lib/expandable.module.mjs +17 -0
- package/esm2020/cdk/expandable/lib/facade/expandable-container.mjs +3 -0
- package/esm2020/cdk/expandable/lib/facade/expandable-item.mjs +3 -0
- package/esm2020/cdk/expandable/lib/facade/index.mjs +3 -0
- package/esm2020/cdk/expandable/odx-angular-cdk-expandable.mjs +5 -0
- package/esm2020/cdk/radio-group-control/index.mjs +4 -0
- package/esm2020/cdk/radio-group-control/lib/radio-control.directive.mjs +39 -0
- package/esm2020/cdk/radio-group-control/lib/radio-group-control.directive.mjs +43 -0
- package/esm2020/cdk/radio-group-control/lib/radio-group-control.module.mjs +19 -0
- package/esm2020/cdk/radio-group-control/odx-angular-cdk-radio-group-control.mjs +5 -0
- package/esm2020/components/accordion/index.mjs +5 -0
- package/esm2020/components/accordion/lib/accordion.component.mjs +24 -0
- package/esm2020/components/accordion/lib/accordion.module.mjs +20 -0
- package/esm2020/components/accordion/lib/components/accordion-item/accordion-item.component.mjs +54 -0
- package/esm2020/components/accordion/lib/components/index.mjs +2 -0
- package/esm2020/components/accordion/lib/directives/accordion-item-title.mjs +14 -0
- package/esm2020/components/accordion/lib/directives/index.mjs +2 -0
- package/esm2020/components/accordion/odx-angular-components-accordion.mjs +5 -0
- package/esm2020/components/action-group/action-group.component.mjs +15 -18
- package/esm2020/components/area-header/area-header.component.mjs +10 -10
- package/esm2020/components/area-header/area-header.module.mjs +9 -8
- package/esm2020/components/area-header/directives/area-header-content.directive.mjs +4 -5
- package/esm2020/components/area-header/directives/area-header-subtitle.directive.mjs +4 -5
- package/esm2020/components/avatar/lib/avatar.component.mjs +10 -10
- package/esm2020/components/badge/lib/badge.component.mjs +20 -22
- package/esm2020/components/badge/lib/badge.directive.mjs +11 -11
- package/esm2020/components/button/lib/button.component.mjs +26 -33
- package/esm2020/components/button/lib/models/button-size.mjs +5 -0
- package/esm2020/components/button/lib/models/index.mjs +2 -1
- package/esm2020/components/button-group/index.mjs +2 -0
- package/esm2020/components/button-group/lib/button-group.component.mjs +54 -0
- package/esm2020/components/button-group/odx-angular-components-button-group.mjs +5 -0
- package/esm2020/components/checkbox/lib/checkbox.component.mjs +16 -33
- package/esm2020/components/content-box/lib/content-box.component.mjs +3 -3
- package/esm2020/components/content-box/lib/content-box.module.mjs +4 -4
- package/esm2020/components/content-box/lib/directives/content-box-footer-directive.mjs +4 -5
- package/esm2020/components/content-box/lib/directives/content-box-header-directive.mjs +4 -5
- package/esm2020/components/form-field/index.mjs +7 -0
- package/esm2020/components/form-field/lib/components/form-field-info/form-field-info.component.mjs +24 -0
- package/esm2020/components/form-field/lib/components/form-group/form-group.component.mjs +36 -0
- package/esm2020/components/form-field/lib/components/index.mjs +3 -0
- package/esm2020/components/form-field/lib/directives/form-field-control.directive.mjs +68 -0
- package/esm2020/components/form-field/lib/directives/form-field-error.directive.mjs +25 -0
- package/esm2020/components/form-field/lib/directives/form-field-hint.directive.mjs +23 -0
- package/esm2020/components/form-field/lib/directives/form-field-label.directive.mjs +24 -0
- package/esm2020/components/form-field/lib/directives/form.directive.mjs +28 -0
- package/esm2020/components/form-field/lib/directives/index.mjs +6 -0
- package/esm2020/components/form-field/lib/form-field.component.mjs +47 -0
- package/esm2020/components/form-field/lib/form-field.config.mjs +7 -0
- package/esm2020/components/form-field/lib/form-field.module.mjs +49 -0
- package/esm2020/components/form-field/lib/form-field.service.mjs +53 -0
- package/esm2020/components/form-field/lib/models/form-field-error-resolver.mjs +2 -0
- package/esm2020/components/form-field/lib/models/form-field-error.mjs +2 -0
- package/esm2020/components/form-field/lib/models/index.mjs +3 -0
- package/esm2020/components/form-field/lib/services/form-field-error.service.mjs +56 -0
- package/esm2020/components/form-field/lib/services/index.mjs +2 -0
- package/esm2020/components/form-field/odx-angular-components-form-field.mjs +5 -0
- package/esm2020/components/header/lib/directives/header-avatar.directive.mjs +3 -3
- package/esm2020/components/header/lib/directives/header-title.directive.mjs +4 -5
- package/esm2020/components/header/lib/header.component.mjs +11 -11
- package/esm2020/components/header/lib/header.module.mjs +9 -9
- package/esm2020/components/icon/lib/icon.component.mjs +36 -12
- package/esm2020/components/link/link.directive.mjs +14 -18
- package/esm2020/components/logo/logo.directive.mjs +10 -11
- package/esm2020/components/main-menu/lib/directives/main-menu-button.directive.mjs +12 -13
- package/esm2020/components/main-menu/lib/directives/main-menu-item.directive.mjs +14 -14
- package/esm2020/components/main-menu/lib/main-menu.component.mjs +21 -22
- package/esm2020/components/main-menu/lib/main-menu.module.mjs +7 -7
- package/esm2020/components/main-menu/lib/main-menu.service.mjs +5 -5
- package/esm2020/components/modal/index.mjs +10 -0
- package/esm2020/components/modal/lib/components/index.mjs +3 -0
- package/esm2020/components/modal/lib/components/modal-footer/modal-footer.component.mjs +21 -0
- package/esm2020/components/modal/lib/components/modal-header/modal-header.component.mjs +38 -0
- package/esm2020/components/modal/lib/directives/index.mjs +4 -0
- package/esm2020/components/modal/lib/directives/modal-close.directive.mjs +29 -0
- package/esm2020/components/modal/lib/directives/modal-content.directive.mjs +24 -0
- package/esm2020/components/modal/lib/directives/modal-dismiss.directive.mjs +24 -0
- package/esm2020/components/modal/lib/helpers/index.mjs +3 -0
- package/esm2020/components/modal/lib/helpers/inject-modal-ref.mjs +6 -0
- package/esm2020/components/modal/lib/helpers/provide-modal-ref.mjs +5 -0
- package/esm2020/components/modal/lib/modal.component.mjs +63 -0
- package/esm2020/components/modal/lib/modal.config.mjs +8 -0
- package/esm2020/components/modal/lib/modal.directive.mjs +33 -0
- package/esm2020/components/modal/lib/modal.module.mjs +32 -0
- package/esm2020/components/modal/lib/modal.service.mjs +70 -0
- package/esm2020/components/modal/lib/models/index.mjs +5 -0
- package/esm2020/components/modal/lib/models/modal-options.mjs +2 -0
- package/esm2020/components/modal/lib/models/modal-ref.mjs +33 -0
- package/esm2020/components/modal/lib/models/modal-size.mjs +6 -0
- package/esm2020/components/modal/lib/models/modal-type.mjs +2 -0
- package/esm2020/components/modal/lib/services/index.mjs +2 -0
- package/esm2020/components/modal/lib/services/open-modal-manager.service.mjs +42 -0
- package/esm2020/components/modal/odx-angular-components-modal.mjs +5 -0
- package/esm2020/components/radio-group/lib/components/radio-button/radio-button.component.mjs +19 -38
- package/esm2020/components/radio-group/lib/radio-group.component.mjs +33 -16
- package/esm2020/components/radio-group/lib/radio-group.module.mjs +7 -7
- package/esm2020/components/switch/index.mjs +2 -0
- package/esm2020/components/switch/lib/switch.component.mjs +22 -0
- package/esm2020/components/switch/odx-angular-components-switch.mjs +5 -0
- package/esm2020/components/toggle-button-group/index.mjs +4 -0
- package/esm2020/components/toggle-button-group/lib/components/index.mjs +2 -0
- package/esm2020/components/toggle-button-group/lib/components/toggle-button/toggle-button.component.mjs +30 -0
- package/esm2020/components/toggle-button-group/lib/toggle-button-group.component.mjs +33 -0
- package/esm2020/components/toggle-button-group/lib/toggle-button-group.module.mjs +19 -0
- package/esm2020/components/toggle-button-group/odx-angular-components-toggle-button-group.mjs +5 -0
- package/esm2020/index.mjs +1 -2
- package/esm2020/internal/decorators/css-modifier.mjs +6 -5
- package/esm2020/internal/helpers/camel-to-kebab-case.mjs +12 -0
- package/esm2020/internal/helpers/index.mjs +2 -4
- package/esm2020/internal/index.mjs +1 -4
- package/esm2020/lib/controllers/controller.mjs +37 -0
- package/esm2020/lib/controllers/disabled.controller.mjs +25 -19
- package/esm2020/lib/controllers/index.mjs +3 -1
- package/esm2020/lib/controllers/readonly.controller.mjs +68 -0
- package/esm2020/lib/core.module.mjs +11 -10
- package/esm2020/lib/directives/click-outside.directive.mjs +58 -0
- package/esm2020/lib/directives/index.mjs +2 -3
- package/esm2020/lib/services/index.mjs +1 -2
- package/esm2020/lib/services/window-ref.mjs +6 -6
- package/esm2020/rxjs/index.mjs +2 -1
- package/esm2020/rxjs/lib/mark-for-check.mjs +5 -0
- package/esm2020/utils/index.mjs +2 -1
- package/esm2020/utils/lib/helpers/angular.mjs +30 -0
- package/esm2020/utils/lib/helpers/dom.mjs +22 -0
- package/esm2020/utils/lib/helpers/index.mjs +6 -1
- package/esm2020/utils/lib/helpers/ng-changes.mjs +1 -1
- package/esm2020/utils/lib/helpers/provide-module-config.mjs +21 -0
- package/esm2020/utils/lib/helpers/type-guards.mjs +29 -0
- package/esm2020/utils/lib/helpers/until-destroyed.mjs +13 -0
- package/esm2020/utils/lib/types/get-properties.mjs +2 -0
- package/esm2020/utils/lib/types/index.mjs +2 -0
- package/fesm2015/odx-angular-animations.mjs +11 -1
- package/fesm2015/odx-angular-animations.mjs.map +1 -1
- package/fesm2015/odx-angular-cdk-checkbox-control.mjs +50 -0
- package/fesm2015/odx-angular-cdk-checkbox-control.mjs.map +1 -0
- package/fesm2015/odx-angular-cdk-custom-form-control.mjs +150 -0
- package/fesm2015/odx-angular-cdk-custom-form-control.mjs.map +1 -0
- package/fesm2015/odx-angular-cdk-dynamic-view.mjs +48 -55
- package/fesm2015/odx-angular-cdk-dynamic-view.mjs.map +1 -1
- package/fesm2015/odx-angular-cdk-expandable.mjs +114 -0
- package/fesm2015/odx-angular-cdk-expandable.mjs.map +1 -0
- package/fesm2015/odx-angular-cdk-radio-group-control.mjs +99 -0
- package/fesm2015/odx-angular-cdk-radio-group-control.mjs.map +1 -0
- package/fesm2015/odx-angular-components-accordion.mjs +104 -0
- package/fesm2015/odx-angular-components-accordion.mjs.map +1 -0
- package/fesm2015/odx-angular-components-action-group.mjs +14 -17
- package/fesm2015/odx-angular-components-action-group.mjs.map +1 -1
- package/fesm2015/odx-angular-components-area-header.mjs +23 -24
- package/fesm2015/odx-angular-components-area-header.mjs.map +1 -1
- package/fesm2015/odx-angular-components-avatar.mjs +9 -9
- package/fesm2015/odx-angular-components-avatar.mjs.map +1 -1
- package/fesm2015/odx-angular-components-badge.mjs +27 -29
- package/fesm2015/odx-angular-components-badge.mjs.map +1 -1
- package/fesm2015/odx-angular-components-button-group.mjs +60 -0
- package/fesm2015/odx-angular-components-button-group.mjs.map +1 -0
- package/fesm2015/odx-angular-components-button.mjs +30 -36
- package/fesm2015/odx-angular-components-button.mjs.map +1 -1
- package/fesm2015/odx-angular-components-checkbox.mjs +15 -31
- package/fesm2015/odx-angular-components-checkbox.mjs.map +1 -1
- package/fesm2015/odx-angular-components-content-box.mjs +13 -15
- package/fesm2015/odx-angular-components-content-box.mjs.map +1 -1
- package/fesm2015/odx-angular-components-form-field.mjs +381 -0
- package/fesm2015/odx-angular-components-form-field.mjs.map +1 -0
- package/fesm2015/odx-angular-components-header.mjs +24 -25
- package/fesm2015/odx-angular-components-header.mjs.map +1 -1
- package/fesm2015/odx-angular-components-icon.mjs +35 -11
- package/fesm2015/odx-angular-components-icon.mjs.map +1 -1
- package/fesm2015/odx-angular-components-link.mjs +13 -17
- package/fesm2015/odx-angular-components-link.mjs.map +1 -1
- package/fesm2015/odx-angular-components-logo.mjs +9 -10
- package/fesm2015/odx-angular-components-logo.mjs.map +1 -1
- package/fesm2015/odx-angular-components-main-menu.mjs +48 -50
- package/fesm2015/odx-angular-components-main-menu.mjs.map +1 -1
- package/fesm2015/odx-angular-components-modal.mjs +380 -0
- package/fesm2015/odx-angular-components-modal.mjs.map +1 -0
- package/fesm2015/odx-angular-components-radio-group.mjs +64 -67
- package/fesm2015/odx-angular-components-radio-group.mjs.map +1 -1
- package/fesm2015/odx-angular-components-switch.mjs +28 -0
- package/fesm2015/odx-angular-components-switch.mjs.map +1 -0
- package/fesm2015/odx-angular-components-toggle-button-group.mjs +75 -0
- package/fesm2015/odx-angular-components-toggle-button-group.mjs.map +1 -0
- package/fesm2015/odx-angular-internal.mjs +39 -104
- package/fesm2015/odx-angular-internal.mjs.map +1 -1
- package/fesm2015/odx-angular-rxjs.mjs +6 -2
- package/fesm2015/odx-angular-rxjs.mjs.map +1 -1
- package/fesm2015/odx-angular-utils.mjs +110 -1
- package/fesm2015/odx-angular-utils.mjs.map +1 -1
- package/fesm2015/odx-angular.mjs +179 -212
- package/fesm2015/odx-angular.mjs.map +1 -1
- package/fesm2020/odx-angular-animations.mjs +11 -1
- package/fesm2020/odx-angular-animations.mjs.map +1 -1
- package/fesm2020/odx-angular-cdk-checkbox-control.mjs +50 -0
- package/fesm2020/odx-angular-cdk-checkbox-control.mjs.map +1 -0
- package/fesm2020/odx-angular-cdk-custom-form-control.mjs +144 -0
- package/fesm2020/odx-angular-cdk-custom-form-control.mjs.map +1 -0
- package/fesm2020/odx-angular-cdk-dynamic-view.mjs +41 -37
- package/fesm2020/odx-angular-cdk-dynamic-view.mjs.map +1 -1
- package/fesm2020/odx-angular-cdk-expandable.mjs +113 -0
- package/fesm2020/odx-angular-cdk-expandable.mjs.map +1 -0
- package/fesm2020/odx-angular-cdk-radio-group-control.mjs +99 -0
- package/fesm2020/odx-angular-cdk-radio-group-control.mjs.map +1 -0
- package/fesm2020/odx-angular-components-accordion.mjs +103 -0
- package/fesm2020/odx-angular-components-accordion.mjs.map +1 -0
- package/fesm2020/odx-angular-components-action-group.mjs +14 -17
- package/fesm2020/odx-angular-components-action-group.mjs.map +1 -1
- package/fesm2020/odx-angular-components-area-header.mjs +23 -24
- package/fesm2020/odx-angular-components-area-header.mjs.map +1 -1
- package/fesm2020/odx-angular-components-avatar.mjs +9 -9
- package/fesm2020/odx-angular-components-avatar.mjs.map +1 -1
- package/fesm2020/odx-angular-components-badge.mjs +27 -29
- package/fesm2020/odx-angular-components-badge.mjs.map +1 -1
- package/fesm2020/odx-angular-components-button-group.mjs +60 -0
- package/fesm2020/odx-angular-components-button-group.mjs.map +1 -0
- package/fesm2020/odx-angular-components-button.mjs +30 -32
- package/fesm2020/odx-angular-components-button.mjs.map +1 -1
- package/fesm2020/odx-angular-components-checkbox.mjs +15 -31
- package/fesm2020/odx-angular-components-checkbox.mjs.map +1 -1
- package/fesm2020/odx-angular-components-content-box.mjs +13 -15
- package/fesm2020/odx-angular-components-content-box.mjs.map +1 -1
- package/fesm2020/odx-angular-components-form-field.mjs +378 -0
- package/fesm2020/odx-angular-components-form-field.mjs.map +1 -0
- package/fesm2020/odx-angular-components-header.mjs +24 -25
- package/fesm2020/odx-angular-components-header.mjs.map +1 -1
- package/fesm2020/odx-angular-components-icon.mjs +35 -11
- package/fesm2020/odx-angular-components-icon.mjs.map +1 -1
- package/fesm2020/odx-angular-components-link.mjs +13 -17
- package/fesm2020/odx-angular-components-link.mjs.map +1 -1
- package/fesm2020/odx-angular-components-logo.mjs +9 -10
- package/fesm2020/odx-angular-components-logo.mjs.map +1 -1
- package/fesm2020/odx-angular-components-main-menu.mjs +48 -50
- package/fesm2020/odx-angular-components-main-menu.mjs.map +1 -1
- package/fesm2020/odx-angular-components-modal.mjs +376 -0
- package/fesm2020/odx-angular-components-modal.mjs.map +1 -0
- package/fesm2020/odx-angular-components-radio-group.mjs +64 -66
- package/fesm2020/odx-angular-components-radio-group.mjs.map +1 -1
- package/fesm2020/odx-angular-components-switch.mjs +28 -0
- package/fesm2020/odx-angular-components-switch.mjs.map +1 -0
- package/fesm2020/odx-angular-components-toggle-button-group.mjs +75 -0
- package/fesm2020/odx-angular-components-toggle-button-group.mjs.map +1 -0
- package/fesm2020/odx-angular-internal.mjs +38 -102
- package/fesm2020/odx-angular-internal.mjs.map +1 -1
- package/fesm2020/odx-angular-rxjs.mjs +6 -2
- package/fesm2020/odx-angular-rxjs.mjs.map +1 -1
- package/fesm2020/odx-angular-utils.mjs +109 -1
- package/fesm2020/odx-angular-utils.mjs.map +1 -1
- package/fesm2020/odx-angular.mjs +175 -206
- package/fesm2020/odx-angular.mjs.map +1 -1
- package/index.d.ts +0 -1
- package/internal/helpers/camel-to-kebab-case.d.ts +2 -0
- package/internal/helpers/index.d.ts +1 -3
- package/internal/index.d.ts +0 -3
- package/{internal/abstract → lib/controllers}/controller.d.ts +3 -2
- package/lib/controllers/disabled.controller.d.ts +5 -3
- package/lib/controllers/index.d.ts +2 -0
- package/lib/controllers/readonly.controller.d.ts +18 -0
- package/lib/core.module.d.ts +3 -3
- package/lib/directives/click-outside.directive.d.ts +18 -0
- package/lib/directives/index.d.ts +1 -2
- package/lib/services/index.d.ts +0 -1
- package/package.json +94 -10
- package/rxjs/index.d.ts +1 -0
- package/rxjs/lib/mark-for-check.d.ts +3 -0
- package/utils/index.d.ts +1 -0
- package/utils/lib/helpers/angular.d.ts +5 -0
- package/utils/lib/helpers/dom.d.ts +5 -0
- package/utils/lib/helpers/index.d.ts +5 -0
- package/utils/lib/helpers/ng-changes.d.ts +1 -1
- package/utils/lib/helpers/provide-module-config.d.ts +12 -0
- package/{internal → utils/lib}/helpers/type-guards.d.ts +2 -1
- package/utils/lib/helpers/until-destroyed.d.ts +2 -0
- package/{internal → utils/lib}/types/get-properties.d.ts +1 -1
- package/{internal → utils/lib}/types/index.d.ts +0 -0
- package/cdk/dynamic-view/lib/facade/animated-component.d.ts +0 -4
- package/cdk/dynamic-view/lib/helpers/is-animated-component.d.ts +0 -3
- package/cdk/dynamic-view/lib/helpers/wait-for-animations.d.ts +0 -3
- package/esm2020/animations/config.mjs +0 -8
- package/esm2020/animations/fade.mjs +0 -12
- package/esm2020/animations/slide.mjs +0 -34
- package/esm2020/cdk/dynamic-view/lib/facade/animated-component.mjs +0 -2
- package/esm2020/cdk/dynamic-view/lib/helpers/is-animated-component.mjs +0 -5
- package/esm2020/cdk/dynamic-view/lib/helpers/wait-for-animations.mjs +0 -9
- package/esm2020/internal/abstract/controller.mjs +0 -29
- package/esm2020/internal/abstract/index.mjs +0 -2
- package/esm2020/internal/helpers/dom.mjs +0 -7
- package/esm2020/internal/helpers/type-guards.mjs +0 -27
- package/esm2020/internal/helpers/watch.mjs +0 -8
- package/esm2020/internal/providers/index.mjs +0 -2
- package/esm2020/internal/providers/watched-controller-provider.mjs +0 -9
- package/esm2020/internal/types/get-properties.mjs +0 -2
- package/esm2020/internal/types/index.mjs +0 -2
- package/esm2020/lib/controls/custom-form-control.mjs +0 -133
- package/esm2020/lib/controls/index.mjs +0 -2
- package/esm2020/lib/directives/control.directive.mjs +0 -18
- package/esm2020/lib/directives/monitor-focus.directive.mjs +0 -34
- package/esm2020/lib/services/destroy.service.mjs +0 -18
- package/internal/abstract/index.d.ts +0 -1
- package/internal/helpers/dom.d.ts +0 -2
- package/internal/helpers/watch.d.ts +0 -4
- package/internal/providers/index.d.ts +0 -1
- package/internal/providers/watched-controller-provider.d.ts +0 -5
- package/lib/controls/index.d.ts +0 -1
- package/lib/directives/monitor-focus.directive.d.ts +0 -12
- package/lib/services/destroy.service.d.ts +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odx-angular-animations.mjs","sources":["../../../../libs/angular/animations/src/config.ts","../../../../libs/angular/animations/src/fade.ts","../../../../libs/angular/animations/src/slide.ts","../../../../libs/angular/animations/src/odx-angular-animations.ts"],"sourcesContent":["export const DEFAULT_ANIMATION_TIMING_FN = 'ease';\nexport const DEFAULT_ANIMATION_DURATION = '250ms';\nexport const DEFAULT_ANIMATION_PARAMS = {\n timingFn: DEFAULT_ANIMATION_TIMING_FN,\n duration: DEFAULT_ANIMATION_DURATION,\n delay: '0ms',\n};\n","import { animate, animation, style } from '@angular/animations';\nimport { DEFAULT_ANIMATION_PARAMS } from './config';\n\nexport const fadeIn = (to = 1) =>\n animation([style({ opacity: 0 }), animate('{{duration}} {{ delay }} {{ timingFn }}', style({ opacity: to }))], {\n params: {\n ...DEFAULT_ANIMATION_PARAMS,\n to: 1,\n },\n });\n\nexport const fadeOut = (to = 0) =>\n animation([animate('{{duration}} {{ delay }} {{ timingFn }}', style({ opacity: to }))], {\n params: DEFAULT_ANIMATION_PARAMS,\n });\n","import { animate, animation, AnimationReferenceMetadata, style } from '@angular/animations';\nimport { DEFAULT_ANIMATION_PARAMS } from './config';\n\nfunction createSlideInAnimation(from: string, direction: 'X' | 'Y'): AnimationReferenceMetadata {\n return animation(\n [\n style({ transform: `translate${direction}({{ from }})` }),\n animate('{{duration}} {{ delay }} {{ timingFn }}', style({ transform: `translate${direction}(0)` })),\n ],\n {\n params: {\n ...DEFAULT_ANIMATION_PARAMS,\n from,\n },\n }\n );\n}\n\nfunction createSlideOutAnimation(to: string, direction: 'X' | 'Y'): AnimationReferenceMetadata {\n return animation([animate('{{duration}} {{ delay }} {{ timingFn }}', style({ transform: `translate${direction}({{ to }})` }))], {\n params: {\n ...DEFAULT_ANIMATION_PARAMS,\n to,\n },\n });\n}\n\nexport const slideInX = (from: string) => createSlideInAnimation(from, 'X');\nexport const slideInY = (from: string) => createSlideInAnimation(from, 'Y');\nexport const slideInDown = slideInY('-100%');\nexport const slideInUp = slideInY('100%');\nexport const slideInLeft = slideInX('-100%');\nexport const slideInRight = slideInX('100%');\n\nexport const slideOutX = (to: string) => createSlideOutAnimation(to, 'X');\nexport const slideOutY = (to: string) => createSlideOutAnimation(to, 'Y');\nexport const slideOutDown = slideOutY('100%');\nexport const slideOutUp = slideOutY('-100%');\nexport const slideOutLeft = slideOutX('-100%');\nexport const slideOutRight = slideOutX('100%');\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAO,MAAM,2BAA2B,GAAG,MAAM,CAAC;AAC3C,MAAM,0BAA0B,GAAG,OAAO,CAAC;AAC3C,MAAM,wBAAwB,GAAG;AACtC,IAAA,QAAQ,EAAE,2BAA2B;AACrC,IAAA,QAAQ,EAAE,0BAA0B;AACpC,IAAA,KAAK,EAAE,KAAK;CACb;;
|
|
1
|
+
{"version":3,"file":"odx-angular-animations.mjs","sources":["../../../../libs/angular/animations/src/lib/config.ts","../../../../libs/angular/animations/src/lib/expand.ts","../../../../libs/angular/animations/src/lib/fade.ts","../../../../libs/angular/animations/src/lib/slide.ts","../../../../libs/angular/animations/src/odx-angular-animations.ts"],"sourcesContent":["export const DEFAULT_ANIMATION_TIMING_FN = 'ease';\nexport const DEFAULT_ANIMATION_DURATION = '250ms';\nexport const DEFAULT_ANIMATION_PARAMS = {\n timingFn: DEFAULT_ANIMATION_TIMING_FN,\n duration: DEFAULT_ANIMATION_DURATION,\n delay: '0ms',\n};\n","import { animate, animation, style } from '@angular/animations';\nimport { DEFAULT_ANIMATION_PARAMS } from './config';\n\nexport const expand = animation(\n [\n style({ height: 0, minHeight: 0, paddingTop: 0, paddingBottom: 0 }),\n animate('{{duration}} {{ delay }} {{ timingFn }}', style({ height: '*', paddingTop: '*', paddingBottom: '*' })),\n ],\n {\n params: DEFAULT_ANIMATION_PARAMS,\n }\n);\n\nexport const collapse = animation([animate('{{duration}} {{ delay }} {{ timingFn }}', style({ height: 0, minHeight: 0, paddingTop: 0, paddingBottom: 0 }))], {\n params: DEFAULT_ANIMATION_PARAMS,\n});\n","import { animate, animation, style } from '@angular/animations';\nimport { DEFAULT_ANIMATION_PARAMS } from './config';\n\nexport const fadeIn = (to = 1) =>\n animation([style({ opacity: 0 }), animate('{{duration}} {{ delay }} {{ timingFn }}', style({ opacity: to }))], {\n params: {\n ...DEFAULT_ANIMATION_PARAMS,\n to: 1,\n },\n });\n\nexport const fadeOut = (to = 0) =>\n animation([animate('{{duration}} {{ delay }} {{ timingFn }}', style({ opacity: to }))], {\n params: DEFAULT_ANIMATION_PARAMS,\n });\n","import { animate, animation, AnimationReferenceMetadata, style } from '@angular/animations';\nimport { DEFAULT_ANIMATION_PARAMS } from './config';\n\nfunction createSlideInAnimation(from: string, direction: 'X' | 'Y'): AnimationReferenceMetadata {\n return animation(\n [\n style({ transform: `translate${direction}({{ from }})` }),\n animate('{{duration}} {{ delay }} {{ timingFn }}', style({ transform: `translate${direction}(0)` })),\n ],\n {\n params: {\n ...DEFAULT_ANIMATION_PARAMS,\n from,\n },\n }\n );\n}\n\nfunction createSlideOutAnimation(to: string, direction: 'X' | 'Y'): AnimationReferenceMetadata {\n return animation([animate('{{duration}} {{ delay }} {{ timingFn }}', style({ transform: `translate${direction}({{ to }})` }))], {\n params: {\n ...DEFAULT_ANIMATION_PARAMS,\n to,\n },\n });\n}\n\nexport const slideInX = (from: string) => createSlideInAnimation(from, 'X');\nexport const slideInY = (from: string) => createSlideInAnimation(from, 'Y');\nexport const slideInDown = slideInY('-100%');\nexport const slideInUp = slideInY('100%');\nexport const slideInLeft = slideInX('-100%');\nexport const slideInRight = slideInX('100%');\n\nexport const slideOutX = (to: string) => createSlideOutAnimation(to, 'X');\nexport const slideOutY = (to: string) => createSlideOutAnimation(to, 'Y');\nexport const slideOutDown = slideOutY('100%');\nexport const slideOutUp = slideOutY('-100%');\nexport const slideOutLeft = slideOutX('-100%');\nexport const slideOutRight = slideOutX('100%');\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAO,MAAM,2BAA2B,GAAG,MAAM,CAAC;AAC3C,MAAM,0BAA0B,GAAG,OAAO,CAAC;AAC3C,MAAM,wBAAwB,GAAG;AACtC,IAAA,QAAQ,EAAE,2BAA2B;AACrC,IAAA,QAAQ,EAAE,0BAA0B;AACpC,IAAA,KAAK,EAAE,KAAK;CACb;;ACHM,MAAM,MAAM,GAAG,SAAS,CAC7B;AACE,IAAA,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;AACnE,IAAA,OAAO,CAAC,yCAAyC,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,G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,GAAG,wBAAwB;YAC3B,IAAI;AACL,SAAA;AACF,KAAA,CACF,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,EAAU,EAAE,SAAoB,EAAA;AAC/D,IAAA,OAAO,SAAS,CAAC,CAAC,OAAO,CAAC,yCAAyC,EAAE,KAAK,CAAC,EAAE,SAAS,EAAE,YAAY,SAAS,CAAA,UAAA,CAAY,EAAE,CAAC,CAAC,CAAC,EAAE;AAC9H,QAAA,MAAM,EAAE;AACN,YAAA,GAAG,wBAAwB;YAC3B,EAAE;AACH,SAAA;AACF,KAAA,CAAC,CAAC;AACL,CAAC;AAEM,MAAM,QAAQ,GAAG,CAAC,IAAY,KAAK,sBAAsB,CAAC,IAAI,EAAE,GAAG,EAAE;AACrE,MAAM,QAAQ,GAAG,CAAC,IAAY,KAAK,sBAAsB,CAAC,IAAI,EAAE,GAAG,EAAE;MAC/D,WAAW,GAAG,QAAQ,CAAC,OAAO,EAAE;MAChC,SAAS,GAAG,QAAQ,CAAC,MAAM,EAAE;MAC7B,WAAW,GAAG,QAAQ,CAAC,OAAO,EAAE;MAChC,YAAY,GAAG,QAAQ,CAAC,MAAM,EAAE;AAEtC,MAAM,SAAS,GAAG,CAAC,EAAU,KAAK,uBAAuB,CAAC,EAAE,EAAE,GAAG,EAAE;AACnE,MAAM,SAAS,GAAG,CAAC,EAAU,KAAK,uBAAuB,CAAC,EAAE,EAAE,GAAG,EAAE;MAC7D,YAAY,GAAG,SAAS,CAAC,MAAM,EAAE;MACjC,UAAU,GAAG,SAAS,CAAC,OAAO,EAAE;MAChC,YAAY,GAAG,SAAS,CAAC,OAAO,EAAE;MAClC,aAAa,GAAG,SAAS,CAAC,MAAM;;ACvC7C;;AAEG;;;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ChangeDetectorRef, Directive, Input } from '@angular/core';
|
|
3
|
+
import { Validators } from '@angular/forms';
|
|
4
|
+
import { detectControllerChanges } from '@odx/angular';
|
|
5
|
+
import { CustomFormControl } from '@odx/angular/cdk/custom-form-control';
|
|
6
|
+
import { injectElement, booleanToAttributeString } from '@odx/angular/utils';
|
|
7
|
+
|
|
8
|
+
class CheckBoxControl extends CustomFormControl {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(false);
|
|
11
|
+
this.element = injectElement();
|
|
12
|
+
this.value = null;
|
|
13
|
+
detectControllerChanges(inject(ChangeDetectorRef), this).subscribe();
|
|
14
|
+
}
|
|
15
|
+
set checked(value) {
|
|
16
|
+
this.controlValue = value;
|
|
17
|
+
}
|
|
18
|
+
get checked() {
|
|
19
|
+
return this.controlValue;
|
|
20
|
+
}
|
|
21
|
+
get ariaChecked() {
|
|
22
|
+
return booleanToAttributeString(this.checked);
|
|
23
|
+
}
|
|
24
|
+
onChanged(event) {
|
|
25
|
+
event.stopPropagation();
|
|
26
|
+
super.updateValue(event.target.checked);
|
|
27
|
+
}
|
|
28
|
+
updateRequiredValidator() {
|
|
29
|
+
this.toggleValidator(Validators.requiredTrue, this.required);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
CheckBoxControl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CheckBoxControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
33
|
+
CheckBoxControl.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: CheckBoxControl, selector: "[odxCheckBoxControl]", inputs: { checked: "checked", value: "value" }, usesInheritance: true, ngImport: i0 });
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CheckBoxControl, decorators: [{
|
|
35
|
+
type: Directive,
|
|
36
|
+
args: [{
|
|
37
|
+
selector: '[odxCheckBoxControl]',
|
|
38
|
+
}]
|
|
39
|
+
}], ctorParameters: function () { return []; }, propDecorators: { checked: [{
|
|
40
|
+
type: Input
|
|
41
|
+
}], value: [{
|
|
42
|
+
type: Input
|
|
43
|
+
}] } });
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Generated bundle index. Do not edit.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
export { CheckBoxControl };
|
|
50
|
+
//# sourceMappingURL=odx-angular-cdk-checkbox-control.mjs.map
|
|
@@ -0,0 +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 { ChangeDetectorRef, Directive, inject, Input } from '@angular/core';\nimport { Validators } from '@angular/forms';\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.controlValue = value;\n }\n public get checked(): boolean {\n return this.controlValue;\n }\n\n @Input()\n public value: string | null = null;\n\n public get ariaChecked(): string {\n return booleanToAttributeString(this.checked);\n }\n\n constructor() {\n super(false);\n detectControllerChanges(inject(ChangeDetectorRef), this).subscribe();\n }\n\n public onChanged(event: Event): void {\n event.stopPropagation();\n super.updateValue((event.target as HTMLInputElement).checked);\n }\n\n protected override updateRequiredValidator(): void {\n this.toggleValidator(Validators.requiredTrue, this.required);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAUM,MAAO,eAAgB,SAAQ,iBAA0B,CAAA;AAoB7D,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,KAAK,CAAC,CAAC;QAlBC,IAAO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@@ -0,0 +1,144 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Directive, inject, Input, ViewChild } from '@angular/core';
|
|
3
|
+
import { injectElement } from '@odx/angular/utils';
|
|
4
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
5
|
+
import { NgControl, Validators } from '@angular/forms';
|
|
6
|
+
import { Controller, DisabledController, ReadonlyController } from '@odx/angular';
|
|
7
|
+
import { filter, EMPTY } from 'rxjs';
|
|
8
|
+
|
|
9
|
+
class ControlDirective {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.element = injectElement();
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
ControlDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ControlDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
15
|
+
ControlDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: ControlDirective, isStandalone: true, selector: "[odxControl]", exportAs: ["odxControl"], ngImport: i0 });
|
|
16
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ControlDirective, decorators: [{
|
|
17
|
+
type: Directive,
|
|
18
|
+
args: [{
|
|
19
|
+
standalone: true,
|
|
20
|
+
selector: '[odxControl]',
|
|
21
|
+
exportAs: 'odxControl',
|
|
22
|
+
}]
|
|
23
|
+
}] });
|
|
24
|
+
|
|
25
|
+
class CustomFormControl extends Controller {
|
|
26
|
+
constructor(initialValue) {
|
|
27
|
+
super();
|
|
28
|
+
this.isRequired = false;
|
|
29
|
+
this.disabledController = DisabledController.inject();
|
|
30
|
+
this.readonlyController = ReadonlyController.inject();
|
|
31
|
+
this.enabled$ = this.disabledController?.change$.pipe(filter(() => !this.isDisabled)) ?? EMPTY;
|
|
32
|
+
this.ngControl = inject(NgControl, { self: true, optional: true });
|
|
33
|
+
this.id = null;
|
|
34
|
+
this.name = `odx-form-control-${CustomFormControl.CURRENT_INDEX++}`;
|
|
35
|
+
this.control = null;
|
|
36
|
+
this.internalValue = initialValue;
|
|
37
|
+
if (this.ngControl) {
|
|
38
|
+
this.ngControl.valueAccessor = this;
|
|
39
|
+
}
|
|
40
|
+
this.enabled$.subscribe(() => this.updateRequiredValidator());
|
|
41
|
+
}
|
|
42
|
+
set required(value) {
|
|
43
|
+
this.isRequired = coerceBooleanProperty(value);
|
|
44
|
+
this.updateRequiredValidator();
|
|
45
|
+
}
|
|
46
|
+
get required() {
|
|
47
|
+
return this.isRequired;
|
|
48
|
+
}
|
|
49
|
+
set controlValue(value) {
|
|
50
|
+
if (this.internalValue !== value) {
|
|
51
|
+
this.internalValue = value;
|
|
52
|
+
this.triggerControllerChange();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
get controlValue() {
|
|
56
|
+
return this.internalValue;
|
|
57
|
+
}
|
|
58
|
+
get hasError() {
|
|
59
|
+
return !!this.ngControl?.touched && !!this.ngControl?.invalid;
|
|
60
|
+
}
|
|
61
|
+
get isDisabled() {
|
|
62
|
+
return !!this.disabledController?.disabled;
|
|
63
|
+
}
|
|
64
|
+
get isReadonly() {
|
|
65
|
+
return !!this.readonlyController?.readonly;
|
|
66
|
+
}
|
|
67
|
+
ngAfterContentInit() {
|
|
68
|
+
this.updateRequiredValidator();
|
|
69
|
+
}
|
|
70
|
+
onTouched() {
|
|
71
|
+
// empty;
|
|
72
|
+
}
|
|
73
|
+
onChange(_value) {
|
|
74
|
+
// empty
|
|
75
|
+
}
|
|
76
|
+
registerOnChange(fn) {
|
|
77
|
+
this.onChange = fn;
|
|
78
|
+
}
|
|
79
|
+
registerOnTouched(fn) {
|
|
80
|
+
this.onTouched = fn;
|
|
81
|
+
}
|
|
82
|
+
setDisabledState(isDisabled) {
|
|
83
|
+
this.disabledController?.setDisabledState(isDisabled);
|
|
84
|
+
}
|
|
85
|
+
writeValue(value) {
|
|
86
|
+
this.controlValue = value;
|
|
87
|
+
}
|
|
88
|
+
updateValue(value) {
|
|
89
|
+
this.writeValue(value);
|
|
90
|
+
this.onChange(value);
|
|
91
|
+
this.onTouched();
|
|
92
|
+
}
|
|
93
|
+
toggleValidator(validator, state) {
|
|
94
|
+
const control = this.ngControl?.control;
|
|
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);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
CustomFormControl.CURRENT_INDEX = 0;
|
|
116
|
+
CustomFormControl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CustomFormControl, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
|
117
|
+
CustomFormControl.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: CustomFormControl, inputs: { id: "id", name: "name", required: "required" }, 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 });
|
|
118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CustomFormControl, decorators: [{
|
|
119
|
+
type: Directive,
|
|
120
|
+
args: [{
|
|
121
|
+
host: {
|
|
122
|
+
'[class.has-error]': 'hasError',
|
|
123
|
+
'[class.is-disabled]': 'isDisabled',
|
|
124
|
+
'[class.is-readonly]': 'isReadonly',
|
|
125
|
+
'[class.is-required]': 'required',
|
|
126
|
+
},
|
|
127
|
+
}]
|
|
128
|
+
}], ctorParameters: function () { return [{ type: undefined }]; }, propDecorators: { id: [{
|
|
129
|
+
type: Input
|
|
130
|
+
}], name: [{
|
|
131
|
+
type: Input
|
|
132
|
+
}], required: [{
|
|
133
|
+
type: Input
|
|
134
|
+
}], control: [{
|
|
135
|
+
type: ViewChild,
|
|
136
|
+
args: [ControlDirective]
|
|
137
|
+
}] } });
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Generated bundle index. Do not edit.
|
|
141
|
+
*/
|
|
142
|
+
|
|
143
|
+
export { ControlDirective, CustomFormControl };
|
|
144
|
+
//# sourceMappingURL=odx-angular-cdk-custom-form-control.mjs.map
|
|
@@ -0,0 +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 { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { AfterContentInit, Directive, inject, Input, ViewChild } from '@angular/core';\nimport { ControlValueAccessor, NgControl, ValidatorFn, Validators } from '@angular/forms';\nimport { Controller, DisabledController, ReadonlyController } from '@odx/angular';\nimport { EMPTY, filter } from 'rxjs';\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, AfterContentInit {\n private static CURRENT_INDEX = 0;\n public static ngAcceptInputType_required: BooleanInput;\n\n private internalValue: T;\n private isRequired = false;\n protected readonly disabledController = DisabledController.inject();\n protected readonly readonlyController = ReadonlyController.inject();\n protected readonly enabled$ = this.disabledController?.change$.pipe(filter(() => !this.isDisabled)) ?? EMPTY;\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 @Input()\n public set required(value: unknown) {\n this.isRequired = coerceBooleanProperty(value);\n this.updateRequiredValidator();\n }\n public get required(): boolean {\n return this.isRequired;\n }\n\n public set controlValue(value: T) {\n if (this.internalValue !== value) {\n this.internalValue = value;\n this.triggerControllerChange();\n }\n }\n public get controlValue(): 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 @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 this.enabled$.subscribe(() => this.updateRequiredValidator());\n }\n\n public ngAfterContentInit(): void {\n this.updateRequiredValidator();\n }\n\n public onTouched() {\n // empty;\n }\n\n public onChange(_value: T) {\n // empty\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 this.controlValue = value;\n }\n\n public updateValue(value: T): void {\n this.writeValue(value);\n this.onChange(value);\n this.onTouched();\n }\n\n protected toggleValidator(validator: ValidatorFn, state: boolean): void {\n const control = this.ngControl?.control;\n if (!control) return;\n const hasValidator = control.hasValidator(validator);\n if (state && hasValidator) return;\n if (!state && !hasValidator) return;\n if (state) {\n control.addValidators(validator);\n } else {\n control.removeValidators(validator);\n }\n control.updateValueAndValidity();\n control.markAsUntouched();\n }\n\n protected updateRequiredValidator(): void {\n this.toggleValidator(Validators.required, this.isRequired);\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;;6GAFY,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;iGAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;2FAAhB,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;;;ACQK,MAAgB,iBAAqB,SAAQ,UAAU,CAAA;AAmD3D,IAAA,WAAA,CAAY,YAAe,EAAA;AACzB,QAAA,KAAK,EAAE,CAAC;QA/CF,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;AACR,QAAA,IAAA,CAAA,kBAAkB,GAAG,kBAAkB,CAAC,MAAM,EAAE,CAAC;AACjD,QAAA,IAAA,CAAA,kBAAkB,GAAG,kBAAkB,CAAC,MAAM,EAAE,CAAC;QACjD,IAAQ,CAAA,QAAA,GAAG,IAAI,CAAC,kBAAkB,EAAE,OAAO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,EAAA,CAAA;sBADlB,KAAK;gBAgCU,OAAO,EAAA,CAAA;sBADtB,SAAS;uBAAC,gBAAgB,CAAA;;;AC/D7B;;AAEG;;;;"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { AsyncPipe } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, ChangeDetectorRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, createComponent, EnvironmentInjector,
|
|
4
|
-
import { isObservable
|
|
5
|
-
import { hasChanged } from '@odx/angular/utils';
|
|
6
|
-
import { isString, isTemplateRef, isComponent } from '@odx/angular/internal';
|
|
3
|
+
import { inject, ChangeDetectorRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, ApplicationRef, createComponent, EnvironmentInjector, InjectionToken, Injector, Injectable, ViewContainerRef, Directive } from '@angular/core';
|
|
4
|
+
import { isObservable } from 'rxjs';
|
|
5
|
+
import { isString, isTemplateRef, isComponent, hasChanged } from '@odx/angular/utils';
|
|
7
6
|
|
|
8
7
|
class DynamicViewComponent {
|
|
9
8
|
constructor() {
|
|
@@ -17,9 +16,9 @@ class DynamicViewComponent {
|
|
|
17
16
|
this.asyncPipe?.ngOnDestroy();
|
|
18
17
|
}
|
|
19
18
|
}
|
|
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.
|
|
19
|
+
DynamicViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: DynamicViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
20
|
+
DynamicViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: DynamicViewComponent, isStandalone: true, selector: "odx-dynamic-view", inputs: { content: "content" }, host: { properties: { "innerHTML": "resolveContent()" } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: DynamicViewComponent, decorators: [{
|
|
23
22
|
type: Component,
|
|
24
23
|
args: [{
|
|
25
24
|
selector: 'odx-dynamic-view',
|
|
@@ -35,17 +34,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImpor
|
|
|
35
34
|
type: Input
|
|
36
35
|
}] } });
|
|
37
36
|
|
|
38
|
-
function isAnimatedComponent(component) {
|
|
39
|
-
return isObservable(component?.instance?.ngAnimationsDone$);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
37
|
function isDynamicTextContent(value) {
|
|
43
38
|
return isString(value) || isObservable(value);
|
|
44
39
|
}
|
|
45
40
|
|
|
46
41
|
class DynamicComponentRef {
|
|
47
|
-
constructor(
|
|
42
|
+
constructor(options) {
|
|
43
|
+
this.options = options;
|
|
44
|
+
this.application = this.options.injector.get(ApplicationRef);
|
|
48
45
|
this.componentRef = null;
|
|
46
|
+
const { component, context, injector, vcr } = options;
|
|
49
47
|
this.componentRef = createComponent(component, {
|
|
50
48
|
environmentInjector: injector.get(EnvironmentInjector),
|
|
51
49
|
elementInjector: injector,
|
|
@@ -53,6 +51,9 @@ class DynamicComponentRef {
|
|
|
53
51
|
if (vcr) {
|
|
54
52
|
vcr.insert(this.componentRef.hostView);
|
|
55
53
|
}
|
|
54
|
+
else {
|
|
55
|
+
this.application.attachView(this.componentRef.hostView);
|
|
56
|
+
}
|
|
56
57
|
if (context) {
|
|
57
58
|
this.update(context);
|
|
58
59
|
}
|
|
@@ -60,14 +61,19 @@ class DynamicComponentRef {
|
|
|
60
61
|
detectChanges() {
|
|
61
62
|
this.componentRef?.changeDetectorRef.detectChanges();
|
|
62
63
|
}
|
|
63
|
-
|
|
64
|
+
destroy() {
|
|
65
|
+
if (this.componentRef?.hostView.destroyed) {
|
|
66
|
+
this.componentRef = null;
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (this.componentRef && !this.options.vcr) {
|
|
70
|
+
this.application.detachView(this.componentRef.hostView);
|
|
71
|
+
}
|
|
64
72
|
this.componentRef?.destroy();
|
|
65
|
-
await waitForAnimations(this.componentRef).catch();
|
|
66
73
|
this.componentRef = null;
|
|
67
74
|
}
|
|
68
75
|
getElement() {
|
|
69
|
-
|
|
70
|
-
return this.componentRef.location.nativeElement;
|
|
76
|
+
return this.componentRef?.location.nativeElement ?? null;
|
|
71
77
|
}
|
|
72
78
|
update(context) {
|
|
73
79
|
for (const key in context) {
|
|
@@ -89,7 +95,11 @@ class DynamicTemplateRef {
|
|
|
89
95
|
detectChanges() {
|
|
90
96
|
this.embeddedViewRef?.detectChanges();
|
|
91
97
|
}
|
|
92
|
-
|
|
98
|
+
destroy() {
|
|
99
|
+
if (this.embeddedViewRef?.destroyed) {
|
|
100
|
+
this.embeddedViewRef = null;
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
93
103
|
if (!this.options.vcr && this.embeddedViewRef) {
|
|
94
104
|
this.application.detachView(this.embeddedViewRef);
|
|
95
105
|
}
|
|
@@ -123,13 +133,6 @@ function isDynamicView(value) {
|
|
|
123
133
|
return value instanceof DynamicComponentRef || value instanceof DynamicTemplateRef;
|
|
124
134
|
}
|
|
125
135
|
|
|
126
|
-
async function waitForAnimations(component) {
|
|
127
|
-
if (isAnimatedComponent(component)) {
|
|
128
|
-
await lastValueFrom(component.instance.ngAnimationsDone$);
|
|
129
|
-
}
|
|
130
|
-
return true;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
136
|
const DYNAMIC_VIEW_CONTEXT = new InjectionToken('@odx/angular/cdk/dynamic-view::DynamicViewContext');
|
|
134
137
|
|
|
135
138
|
class DynamicViewService {
|
|
@@ -160,9 +163,9 @@ class DynamicViewService {
|
|
|
160
163
|
throw new Error('Content type is not supported');
|
|
161
164
|
}
|
|
162
165
|
}
|
|
163
|
-
DynamicViewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
164
|
-
DynamicViewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.
|
|
165
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
166
|
+
DynamicViewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: DynamicViewService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
167
|
+
DynamicViewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: DynamicViewService, providedIn: 'root' });
|
|
168
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: DynamicViewService, decorators: [{
|
|
166
169
|
type: Injectable,
|
|
167
170
|
args: [{ providedIn: 'root' }]
|
|
168
171
|
}] });
|
|
@@ -182,14 +185,15 @@ class DynamicViewDirective {
|
|
|
182
185
|
this.render();
|
|
183
186
|
}
|
|
184
187
|
if (hasChanged(changes, 'content')) {
|
|
185
|
-
|
|
188
|
+
const hasChangedTextContent = isDynamicTextContent(changes.content?.previousValue) && isDynamicTextContent(changes.content?.currentValue);
|
|
189
|
+
this.render(!hasChangedTextContent);
|
|
186
190
|
}
|
|
187
191
|
if (hasChanged(changes, 'context')) {
|
|
188
192
|
this.viewRef?.update(changes.context?.currentValue ?? {});
|
|
189
193
|
}
|
|
190
194
|
}
|
|
191
|
-
|
|
192
|
-
|
|
195
|
+
ngOnDestroy() {
|
|
196
|
+
this.destroy();
|
|
193
197
|
}
|
|
194
198
|
getView() {
|
|
195
199
|
return this.viewRef;
|
|
@@ -197,7 +201,7 @@ class DynamicViewDirective {
|
|
|
197
201
|
render(reRender = true) {
|
|
198
202
|
if (!this.content)
|
|
199
203
|
return;
|
|
200
|
-
if (!reRender && this.viewRef
|
|
204
|
+
if (!reRender && this.viewRef) {
|
|
201
205
|
this.viewRef?.update({ content: this.content });
|
|
202
206
|
return;
|
|
203
207
|
}
|
|
@@ -217,14 +221,14 @@ class DynamicViewDirective {
|
|
|
217
221
|
});
|
|
218
222
|
}
|
|
219
223
|
}
|
|
220
|
-
|
|
221
|
-
|
|
224
|
+
destroy() {
|
|
225
|
+
this.viewRef?.destroy();
|
|
222
226
|
this.viewRef = null;
|
|
223
227
|
}
|
|
224
228
|
}
|
|
225
|
-
DynamicViewDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
226
|
-
DynamicViewDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.
|
|
227
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
229
|
+
DynamicViewDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: DynamicViewDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
230
|
+
DynamicViewDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: DynamicViewDirective, isStandalone: true, selector: "[odxDynamicView]", inputs: { content: ["odxDynamicView", "content"], injector: ["odxDynamicViewInjector", "injector"], context: ["odxDynamicViewContext", "context"] }, usesOnChanges: true, ngImport: i0 });
|
|
231
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: DynamicViewDirective, decorators: [{
|
|
228
232
|
type: Directive,
|
|
229
233
|
args: [{
|
|
230
234
|
selector: '[odxDynamicView]',
|
|
@@ -245,5 +249,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImpor
|
|
|
245
249
|
* Generated bundle index. Do not edit.
|
|
246
250
|
*/
|
|
247
251
|
|
|
248
|
-
export { DYNAMIC_VIEW_CONTEXT, DynamicComponentRef, DynamicTemplateRef, DynamicViewComponent, DynamicViewDirective, DynamicViewService,
|
|
252
|
+
export { DYNAMIC_VIEW_CONTEXT, DynamicComponentRef, DynamicTemplateRef, DynamicViewComponent, DynamicViewDirective, DynamicViewService, isDynamicTextContent, isDynamicView };
|
|
249
253
|
//# sourceMappingURL=odx-angular-cdk-dynamic-view.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odx-angular-cdk-dynamic-view.mjs","sources":["../../../../libs/angular/cdk/dynamic-view/src/lib/dynamic-view.component.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/helpers/is-animated-component.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/helpers/is-dynamic-text-content.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/models/dynamic-component-ref.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/models/dynamic-template-ref.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/helpers/is-dynamic-view.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/helpers/wait-for-animations.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/tokens/dynamic-view-context.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/dynamic-view.service.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/dynamic-view.directive.ts","../../../../libs/angular/cdk/dynamic-view/src/odx-angular-cdk-dynamic-view.ts"],"sourcesContent":["import { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, Input, OnDestroy, ViewEncapsulation } from '@angular/core';\nimport { isObservable } from 'rxjs';\nimport { DynamicTextContent } from './facade';\n\n@Component({\n selector: 'odx-dynamic-view',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n standalone: true,\n host: {\n '[innerHTML]': 'resolveContent()',\n },\n})\nexport class DynamicViewComponent implements OnDestroy {\n protected asyncPipe = new AsyncPipe(inject(ChangeDetectorRef));\n protected resolveContent: () => string | null = () => null;\n\n @Input()\n public set content(value: DynamicTextContent) {\n this.resolveContent = isObservable(value) ? () => this.asyncPipe.transform(value) : () => value;\n }\n\n public ngOnDestroy(): void {\n this.asyncPipe?.ngOnDestroy();\n }\n}\n","import { ComponentRef } from '@angular/core';\nimport { isObservable } from 'rxjs';\nimport { AnimatedComponent } from '../facade';\n\nexport function isAnimatedComponent<T>(component?: ComponentRef<T | AnimatedComponent> | null): component is ComponentRef<AnimatedComponent> {\n return isObservable((component?.instance as AnimatedComponent)?.ngAnimationsDone$);\n}\n","import { isString } from '@odx/angular/internal';\nimport { isObservable } from 'rxjs';\nimport { DynamicTextContent } from '../facade';\n\nexport function isDynamicTextContent(value: unknown): value is DynamicTextContent {\n return isString(value) || isObservable(value);\n}\n","import { ComponentRef, createComponent, EnvironmentInjector, Type, ViewRef } from '@angular/core';\nimport { GetDynamicViewContext } from '../facade';\nimport { DynamicViewRef } from '../facade/dynamic-view-ref';\nimport { waitForAnimations } from '../helpers';\nimport { DynamicViewOptions } from './dynamic-view-options';\n\nexport interface DynamicComponentOptions<T extends Type<unknown>> extends DynamicViewOptions<T> {\n component: T;\n}\n\nexport class DynamicComponentRef<T extends Type<unknown>, C extends GetDynamicViewContext<T>> implements DynamicViewRef<T> {\n private componentRef: ComponentRef<T> | null = null;\n\n constructor({ component, context, injector, vcr }: DynamicComponentOptions<T>) {\n this.componentRef = createComponent(component as Type<T>, {\n environmentInjector: injector.get(EnvironmentInjector),\n elementInjector: injector,\n });\n\n if (vcr) {\n vcr.insert(this.componentRef.hostView);\n }\n if (context) {\n this.update(context as C);\n }\n }\n\n public detectChanges(): void {\n this.componentRef?.changeDetectorRef.detectChanges();\n }\n\n public async destroy(): Promise<void> {\n this.componentRef?.destroy();\n await waitForAnimations(this.componentRef).catch();\n this.componentRef = null;\n }\n\n public getElement<T extends Element>(): T {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.componentRef!.location.nativeElement;\n }\n\n public update(context: C): void {\n for (const key in context) {\n this.componentRef?.setInput(key, context[key]);\n }\n }\n\n public getView(): ViewRef | null {\n return this.componentRef?.hostView ?? null;\n }\n}\n","import { ApplicationRef, EmbeddedViewRef, TemplateRef as NgTemplateRef, ViewRef } from '@angular/core';\nimport { DynamicViewRef, GetDynamicViewContext } from '../facade';\nimport { DynamicViewOptions } from './dynamic-view-options';\n\nexport interface DynamicTemplateOptions<T extends NgTemplateRef<unknown>> extends DynamicViewOptions<T> {\n template: T;\n}\n\nexport class DynamicTemplateRef<T extends NgTemplateRef<unknown> = NgTemplateRef<unknown>> implements DynamicViewRef<T> {\n private readonly application = this.options.injector.get(ApplicationRef);\n private embeddedViewRef: EmbeddedViewRef<unknown> | null = null;\n\n constructor(private readonly options: DynamicTemplateOptions<T>) {\n this.create(options);\n }\n\n public detectChanges(): void {\n this.embeddedViewRef?.detectChanges();\n }\n\n public async destroy(): Promise<void> {\n if (!this.options.vcr && this.embeddedViewRef) {\n this.application.detachView(this.embeddedViewRef);\n }\n this.embeddedViewRef?.destroy();\n this.embeddedViewRef = null;\n }\n\n public getElement(): Element {\n return this.embeddedViewRef?.rootNodes?.[0] ?? null;\n }\n\n public update(context: GetDynamicViewContext<T>): void {\n if (this.embeddedViewRef) {\n this.embeddedViewRef.context = context;\n this.detectChanges();\n }\n }\n\n public getView(): ViewRef | null {\n return this.embeddedViewRef;\n }\n\n private create({ context, template, vcr }: DynamicTemplateOptions<T>) {\n if (vcr) {\n this.embeddedViewRef = vcr.createEmbeddedView(template, context, { injector: this.options.injector });\n } else {\n this.embeddedViewRef = template.createEmbeddedView(context ?? {}, this.options.injector);\n this.application.attachView(this.embeddedViewRef);\n }\n }\n}\n","import { DynamicContent, DynamicViewRef } from '../facade';\nimport { DynamicComponentRef, DynamicTemplateRef } from '../models';\n\nexport function isDynamicView(value: unknown): value is DynamicViewRef<DynamicContent> {\n return value instanceof DynamicComponentRef || value instanceof DynamicTemplateRef;\n}\n","import { ComponentRef } from '@angular/core';\nimport { lastValueFrom } from 'rxjs';\nimport { AnimatedComponent } from '../facade';\nimport { isAnimatedComponent } from './is-animated-component';\n\nexport async function waitForAnimations<T>(component?: ComponentRef<T | AnimatedComponent> | null): Promise<boolean> {\n if (isAnimatedComponent(component)) {\n await lastValueFrom(component.instance.ngAnimationsDone$);\n }\n return true;\n}\n","import { InjectionToken, TemplateRef } from '@angular/core';\n\nexport interface DynamicViewContextWithImplicitTemplate<T = unknown> {\n $implicit: TemplateRef<T>;\n}\n\nexport const DYNAMIC_VIEW_CONTEXT = new InjectionToken('@odx/angular/cdk/dynamic-view::DynamicViewContext');\n","import { inject, Injectable, Injector } from '@angular/core';\nimport { isComponent, isTemplateRef } from '@odx/angular/internal';\nimport { DynamicViewComponent } from './dynamic-view.component';\nimport { DynamicContent, DynamicViewRef } from './facade';\nimport { isDynamicTextContent } from './helpers';\nimport { DynamicComponentRef, DynamicViewOptions } from './models';\nimport { DynamicTemplateRef } from './models/dynamic-template-ref';\nimport { DYNAMIC_VIEW_CONTEXT } from './tokens';\n\n@Injectable({ providedIn: 'root' })\nexport class DynamicViewService {\n private readonly injector = inject(Injector);\n\n public createView<T extends DynamicContent>(content: T, options: Partial<DynamicViewOptions<T>> = {}): DynamicViewRef<T> {\n const viewOptions = {\n ...options,\n injector: Injector.create({\n providers: [{ provide: DYNAMIC_VIEW_CONTEXT, useValue: options.context }],\n parent: options.injector ?? this.injector,\n }),\n };\n if (isTemplateRef(content)) {\n return new DynamicTemplateRef({ ...viewOptions, template: content });\n }\n if (isComponent(content)) {\n return new DynamicComponentRef({ ...viewOptions, context: options.context, component: content });\n }\n if (isDynamicTextContent(content)) {\n return new DynamicComponentRef({\n ...viewOptions,\n component: DynamicViewComponent,\n context: { content },\n });\n }\n throw new Error('Content type is not supported');\n }\n}\n","import { Directive, inject, Injector, Input, OnChanges, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';\nimport { hasChanged, NgChanges } from '@odx/angular/utils';\nimport { DynamicViewService } from './dynamic-view.service';\nimport { DynamicContent, DynamicViewRef, GetDynamicViewContext } from './facade';\nimport { isDynamicTextContent, isDynamicView } from './helpers';\n\n@Directive({\n selector: '[odxDynamicView]',\n standalone: true,\n})\nexport class DynamicViewDirective<T extends DynamicContent<unknown> = DynamicContent<unknown>> implements OnDestroy, OnInit, OnChanges {\n private readonly dynamicViewService = inject(DynamicViewService);\n private readonly viewContainer = inject(ViewContainerRef);\n private viewRef: DynamicViewRef<T> | null = null;\n\n @Input('odxDynamicView')\n public content?: T | DynamicViewRef<T> | null = null;\n\n @Input('odxDynamicViewInjector')\n public injector?: Injector;\n\n @Input('odxDynamicViewContext')\n public context?: GetDynamicViewContext<T>;\n\n public ngOnInit(): void {\n this.render();\n }\n\n public ngOnChanges(changes: NgChanges<DynamicViewDirective<DynamicContent>>): void {\n if (hasChanged(changes, 'injector')) {\n this.render();\n }\n if (hasChanged(changes, 'content')) {\n this.render(false);\n }\n if (hasChanged(changes, 'context')) {\n this.viewRef?.update(changes.context?.currentValue ?? {});\n }\n }\n\n public async ngOnDestroy(): Promise<void> {\n await this.destroy();\n }\n\n public getView(): DynamicViewRef<T> | null {\n return this.viewRef;\n }\n\n private render(reRender = true) {\n if (!this.content) return;\n if (!reRender && this.viewRef && isDynamicTextContent(this.content)) {\n this.viewRef?.update({ content: this.content } as object);\n return;\n }\n this.viewRef?.destroy();\n if (isDynamicView(this.content)) {\n this.viewRef = this.content;\n const hostView = this.viewRef.getView();\n if (hostView) {\n this.viewContainer.insert(hostView);\n }\n } else {\n this.viewRef = this.dynamicViewService.createView(this.content, {\n context: this.context ?? undefined,\n injector: this.injector ?? this.viewContainer.injector,\n vcr: this.viewContainer,\n });\n }\n }\n\n private async destroy() {\n await this.viewRef?.destroy();\n this.viewRef = null;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAea,oBAAoB,CAAA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AA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA,CAAA;8BAOQ,OAAO,EAAA,CAAA;sBADb,KAAK;uBAAC,gBAAgB,CAAA;gBAIhB,QAAQ,EAAA,CAAA;sBADd,KAAK;uBAAC,wBAAwB,CAAA;gBAIxB,OAAO,EAAA,CAAA;sBADb,KAAK;uBAAC,uBAAuB,CAAA;;;ACrBhC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"odx-angular-cdk-dynamic-view.mjs","sources":["../../../../libs/angular/cdk/dynamic-view/src/lib/dynamic-view.component.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/helpers/is-dynamic-text-content.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/models/dynamic-component-ref.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/models/dynamic-template-ref.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/helpers/is-dynamic-view.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/tokens/dynamic-view-context.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/dynamic-view.service.ts","../../../../libs/angular/cdk/dynamic-view/src/lib/dynamic-view.directive.ts","../../../../libs/angular/cdk/dynamic-view/src/odx-angular-cdk-dynamic-view.ts"],"sourcesContent":["import { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, Input, OnDestroy, ViewEncapsulation } from '@angular/core';\nimport { isObservable } from 'rxjs';\nimport { DynamicTextContent } from './facade';\n\n@Component({\n selector: 'odx-dynamic-view',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n standalone: true,\n host: {\n '[innerHTML]': 'resolveContent()',\n },\n})\nexport class DynamicViewComponent implements OnDestroy {\n protected asyncPipe = new AsyncPipe(inject(ChangeDetectorRef));\n protected resolveContent: () => string | null = () => null;\n\n @Input()\n public set content(value: DynamicTextContent) {\n this.resolveContent = isObservable(value) ? () => this.asyncPipe.transform(value) : () => value;\n }\n\n public ngOnDestroy(): void {\n this.asyncPipe?.ngOnDestroy();\n }\n}\n","import { isString } from '@odx/angular/utils';\nimport { isObservable } from 'rxjs';\nimport { DynamicTextContent } from '../facade';\n\nexport function isDynamicTextContent(value: unknown): value is DynamicTextContent {\n return isString(value) || isObservable(value);\n}\n","import { ApplicationRef, ComponentRef, createComponent, EnvironmentInjector, Type, ViewRef } from '@angular/core';\nimport { GetDynamicViewContext } from '../facade';\nimport { DynamicViewRef } from '../facade/dynamic-view-ref';\nimport { DynamicViewOptions } from './dynamic-view-options';\n\nexport interface DynamicComponentOptions<T extends Type<unknown>> extends DynamicViewOptions<T> {\n component: T;\n}\n\nexport class DynamicComponentRef<T extends Type<unknown>, C extends GetDynamicViewContext<T>> implements DynamicViewRef<T> {\n private readonly application = this.options.injector.get(ApplicationRef);\n private componentRef: ComponentRef<T> | null = null;\n\n constructor(private readonly options: DynamicComponentOptions<T>) {\n const { component, context, injector, vcr } = options;\n this.componentRef = createComponent(component as Type<T>, {\n environmentInjector: injector.get(EnvironmentInjector),\n elementInjector: injector,\n });\n\n if (vcr) {\n vcr.insert(this.componentRef.hostView);\n } else {\n this.application.attachView(this.componentRef.hostView);\n }\n if (context) {\n this.update(context as C);\n }\n }\n\n public detectChanges(): void {\n this.componentRef?.changeDetectorRef.detectChanges();\n }\n\n public destroy(): void {\n if (this.componentRef?.hostView.destroyed) {\n this.componentRef = null;\n return;\n }\n if (this.componentRef && !this.options.vcr) {\n this.application.detachView(this.componentRef.hostView);\n }\n this.componentRef?.destroy();\n this.componentRef = null;\n }\n\n public getElement(): Element {\n return this.componentRef?.location.nativeElement ?? null;\n }\n\n public update(context: C): void {\n for (const key in context) {\n this.componentRef?.setInput(key, context[key]);\n }\n }\n\n public getView(): ViewRef | null {\n return this.componentRef?.hostView ?? null;\n }\n}\n","import { ApplicationRef, EmbeddedViewRef, TemplateRef as NgTemplateRef, ViewRef } from '@angular/core';\nimport { DynamicViewRef, GetDynamicViewContext } from '../facade';\nimport { DynamicViewOptions } from './dynamic-view-options';\n\nexport interface DynamicTemplateOptions<T extends NgTemplateRef<unknown>> extends DynamicViewOptions<T> {\n template: T;\n}\n\nexport class DynamicTemplateRef<T extends NgTemplateRef<unknown> = NgTemplateRef<unknown>> implements DynamicViewRef<T> {\n private readonly application = this.options.injector.get(ApplicationRef);\n private embeddedViewRef: EmbeddedViewRef<unknown> | null = null;\n\n constructor(private readonly options: DynamicTemplateOptions<T>) {\n this.create(options);\n }\n\n public detectChanges(): void {\n this.embeddedViewRef?.detectChanges();\n }\n\n public destroy(): void {\n if (this.embeddedViewRef?.destroyed) {\n this.embeddedViewRef = null;\n return;\n }\n if (!this.options.vcr && this.embeddedViewRef) {\n this.application.detachView(this.embeddedViewRef);\n }\n this.embeddedViewRef?.destroy();\n this.embeddedViewRef = null;\n }\n\n public getElement(): Element {\n return this.embeddedViewRef?.rootNodes?.[0] ?? null;\n }\n\n public update(context: GetDynamicViewContext<T>): void {\n if (this.embeddedViewRef) {\n this.embeddedViewRef.context = context;\n this.detectChanges();\n }\n }\n\n public getView(): ViewRef | null {\n return this.embeddedViewRef;\n }\n\n private create({ context, template, vcr }: DynamicTemplateOptions<T>) {\n if (vcr) {\n this.embeddedViewRef = vcr.createEmbeddedView(template, context, { injector: this.options.injector });\n } else {\n this.embeddedViewRef = template.createEmbeddedView(context ?? {}, this.options.injector);\n this.application.attachView(this.embeddedViewRef);\n }\n }\n}\n","import { DynamicContent, DynamicViewRef } from '../facade';\nimport { DynamicComponentRef, DynamicTemplateRef } from '../models';\n\nexport function isDynamicView(value: unknown): value is DynamicViewRef<DynamicContent> {\n return value instanceof DynamicComponentRef || value instanceof DynamicTemplateRef;\n}\n","import { InjectionToken, TemplateRef } from '@angular/core';\n\nexport interface DynamicViewContextWithImplicitTemplate<T = unknown> {\n $implicit: TemplateRef<T>;\n}\n\nexport const DYNAMIC_VIEW_CONTEXT = new InjectionToken('@odx/angular/cdk/dynamic-view::DynamicViewContext');\n","import { inject, Injectable, Injector } from '@angular/core';\nimport { isComponent, isTemplateRef } from '@odx/angular/utils';\nimport { DynamicViewComponent } from './dynamic-view.component';\nimport { DynamicContent, DynamicViewRef } from './facade';\nimport { isDynamicTextContent } from './helpers';\nimport { DynamicComponentRef, DynamicViewOptions } from './models';\nimport { DynamicTemplateRef } from './models/dynamic-template-ref';\nimport { DYNAMIC_VIEW_CONTEXT } from './tokens';\n\n@Injectable({ providedIn: 'root' })\nexport class DynamicViewService {\n private readonly injector = inject(Injector);\n\n public createView<T extends DynamicContent>(content: T, options: Partial<DynamicViewOptions<T>> = {}): DynamicViewRef<T> {\n const viewOptions = {\n ...options,\n injector: Injector.create({\n providers: [{ provide: DYNAMIC_VIEW_CONTEXT, useValue: options.context }],\n parent: options.injector ?? this.injector,\n }),\n };\n if (isTemplateRef(content)) {\n return new DynamicTemplateRef({ ...viewOptions, template: content });\n }\n if (isComponent(content)) {\n return new DynamicComponentRef({ ...viewOptions, context: options.context, component: content });\n }\n if (isDynamicTextContent(content)) {\n return new DynamicComponentRef({\n ...viewOptions,\n component: DynamicViewComponent,\n context: { content },\n });\n }\n throw new Error('Content type is not supported');\n }\n}\n","import { Directive, inject, Injector, Input, OnChanges, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';\nimport { hasChanged, NgChanges } from '@odx/angular/utils';\nimport { DynamicViewService } from './dynamic-view.service';\nimport { DynamicContent, DynamicViewRef, GetDynamicViewContext } from './facade';\nimport { isDynamicTextContent, isDynamicView } from './helpers';\n\n@Directive({\n selector: '[odxDynamicView]',\n standalone: true,\n})\nexport class DynamicViewDirective<T extends DynamicContent<unknown> = DynamicContent<unknown>> implements OnDestroy, OnInit, OnChanges {\n private readonly dynamicViewService = inject(DynamicViewService);\n private readonly viewContainer = inject(ViewContainerRef);\n private viewRef: DynamicViewRef<T> | null = null;\n\n @Input('odxDynamicView')\n public content?: T | DynamicViewRef<T> | null = null;\n\n @Input('odxDynamicViewInjector')\n public injector?: Injector;\n\n @Input('odxDynamicViewContext')\n public context?: GetDynamicViewContext<T>;\n\n public ngOnInit(): void {\n this.render();\n }\n\n public ngOnChanges(changes: NgChanges<DynamicViewDirective<DynamicContent>>): void {\n if (hasChanged(changes, 'injector')) {\n this.render();\n }\n if (hasChanged(changes, 'content')) {\n const hasChangedTextContent = isDynamicTextContent(changes.content?.previousValue) && isDynamicTextContent(changes.content?.currentValue);\n this.render(!hasChangedTextContent);\n }\n if (hasChanged(changes, 'context')) {\n this.viewRef?.update(changes.context?.currentValue ?? {});\n }\n }\n\n public ngOnDestroy(): void {\n this.destroy();\n }\n\n public getView(): DynamicViewRef<T> | null {\n return this.viewRef;\n }\n\n private render(reRender = true) {\n if (!this.content) return;\n if (!reRender && this.viewRef) {\n this.viewRef?.update({ content: this.content } as object);\n return;\n }\n this.viewRef?.destroy();\n if (isDynamicView(this.content)) {\n this.viewRef = this.content;\n const hostView = this.viewRef.getView();\n if (hostView) {\n this.viewContainer.insert(hostView);\n }\n } else {\n this.viewRef = this.dynamicViewService.createView(this.content, {\n context: this.context ?? undefined,\n injector: this.injector ?? this.viewContainer.injector,\n vcr: this.viewContainer,\n });\n }\n }\n\n private destroy() {\n this.viewRef?.destroy();\n this.viewRef = null;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAea,oBAAoB,CAAA;AAVjC,IAAA,WAAA,GAAA;QAWY,IAAS,CAAA,SAAA,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;AACrD,QAAA,IAAA,CAAA,cAAc,GAAwB,MAAM,IAAI,CAAC;AAU5D,KAAA;IARC,IACW,OAAO,CAAC,KAAyB,EAAA;AAC1C,QAAA,IAAI,CAAC,cAAc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,CAAA,EAAA,QAAA,EAAA,CAAA,wBAAA,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,uBAAA,EAAA,SAAA,CAAA,EAAA,EAAA,aAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA,CAAA;8BAOQ,OAAO,EAAA,CAAA;sBADb,KAAK;uBAAC,gBAAgB,CAAA;gBAIhB,QAAQ,EAAA,CAAA;sBADd,KAAK;uBAAC,wBAAwB,CAAA;gBAIxB,OAAO,EAAA,CAAA;sBADb,KAAK;uBAAC,uBAAuB,CAAA;;;ACrBhC;;AAEG;;;;"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { inject, ChangeDetectorRef, Directive, Input, NgModule } from '@angular/core';
|
|
4
|
+
import { __decorate, __metadata } from 'tslib';
|
|
5
|
+
import { Transform } from '@odx/angular/utils';
|
|
6
|
+
|
|
7
|
+
class ExpandableContainer {
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
class ExpandableItem {
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
class ExpandableItemDirective extends ExpandableItem {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.container = inject(ExpandableContainer, { optional: true, skipSelf: true });
|
|
17
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
18
|
+
this._expanded = false;
|
|
19
|
+
this.id = `odx-expandable-item-${ExpandableItemDirective.ID++}`;
|
|
20
|
+
}
|
|
21
|
+
set expanded(value) {
|
|
22
|
+
this._expanded = coerceBooleanProperty(value);
|
|
23
|
+
if (this._expanded) {
|
|
24
|
+
this.container?.open(this);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
this.container?.close(this);
|
|
28
|
+
}
|
|
29
|
+
this.changeDetectorRef.markForCheck();
|
|
30
|
+
}
|
|
31
|
+
get expanded() {
|
|
32
|
+
return this._expanded;
|
|
33
|
+
}
|
|
34
|
+
toggle() {
|
|
35
|
+
this.expanded = !this.expanded;
|
|
36
|
+
}
|
|
37
|
+
open() {
|
|
38
|
+
this.expanded = true;
|
|
39
|
+
}
|
|
40
|
+
close() {
|
|
41
|
+
this.expanded = false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
ExpandableItemDirective.ID = 0;
|
|
45
|
+
ExpandableItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ExpandableItemDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
46
|
+
ExpandableItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: ExpandableItemDirective, isStandalone: true, selector: "[odxExpandableItem]", inputs: { expanded: "expanded" }, usesInheritance: true, ngImport: i0 });
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ExpandableItemDirective, decorators: [{
|
|
48
|
+
type: Directive,
|
|
49
|
+
args: [{
|
|
50
|
+
standalone: true,
|
|
51
|
+
selector: '[odxExpandableItem]',
|
|
52
|
+
}]
|
|
53
|
+
}], propDecorators: { expanded: [{
|
|
54
|
+
type: Input
|
|
55
|
+
}] } });
|
|
56
|
+
|
|
57
|
+
class ExpandableContainerDirective extends ExpandableContainer {
|
|
58
|
+
constructor() {
|
|
59
|
+
super(...arguments);
|
|
60
|
+
this.openItems = {};
|
|
61
|
+
this.multiple = false;
|
|
62
|
+
}
|
|
63
|
+
close(item) {
|
|
64
|
+
delete this.openItems[item.id];
|
|
65
|
+
}
|
|
66
|
+
closeAll() {
|
|
67
|
+
for (const item of Object.values(this.openItems)) {
|
|
68
|
+
item.close();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
open(item) {
|
|
72
|
+
if (!this.multiple) {
|
|
73
|
+
this.closeAll();
|
|
74
|
+
}
|
|
75
|
+
this.openItems[item.id] = item;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
ExpandableContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ExpandableContainerDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
79
|
+
ExpandableContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: ExpandableContainerDirective, isStandalone: true, selector: "[odxExpandableContainer]", inputs: { multiple: "multiple" }, usesInheritance: true, ngImport: i0 });
|
|
80
|
+
__decorate([
|
|
81
|
+
Transform(coerceBooleanProperty),
|
|
82
|
+
__metadata("design:type", Object)
|
|
83
|
+
], ExpandableContainerDirective.prototype, "multiple", void 0);
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ExpandableContainerDirective, decorators: [{
|
|
85
|
+
type: Directive,
|
|
86
|
+
args: [{
|
|
87
|
+
standalone: true,
|
|
88
|
+
selector: '[odxExpandableContainer]',
|
|
89
|
+
}]
|
|
90
|
+
}], propDecorators: { multiple: [{
|
|
91
|
+
type: Input
|
|
92
|
+
}] } });
|
|
93
|
+
|
|
94
|
+
const modules = [ExpandableContainerDirective, ExpandableItemDirective];
|
|
95
|
+
class ExpandableModule {
|
|
96
|
+
}
|
|
97
|
+
ExpandableModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ExpandableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
98
|
+
ExpandableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.7", ngImport: i0, type: ExpandableModule, imports: [ExpandableContainerDirective, ExpandableItemDirective], exports: [ExpandableContainerDirective, ExpandableItemDirective] });
|
|
99
|
+
ExpandableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ExpandableModule });
|
|
100
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ExpandableModule, decorators: [{
|
|
101
|
+
type: NgModule,
|
|
102
|
+
args: [{
|
|
103
|
+
imports: modules,
|
|
104
|
+
exports: modules,
|
|
105
|
+
}]
|
|
106
|
+
}] });
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Generated bundle index. Do not edit.
|
|
110
|
+
*/
|
|
111
|
+
|
|
112
|
+
export { ExpandableContainer, ExpandableContainerDirective, ExpandableItem, ExpandableItemDirective, ExpandableModule };
|
|
113
|
+
//# sourceMappingURL=odx-angular-cdk-expandable.mjs.map
|