@abp/ng.theme.shared 7.2.1 → 7.3.0-rc.1
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/{esm2020 → esm2022}/abp-ng.theme.shared.mjs +4 -4
- package/{esm2020 → esm2022}/extensions/abp-ng.theme.shared-extensions.mjs +4 -4
- package/esm2022/extensions/lib/adapters/date-time.adapter.mjs +45 -0
- package/esm2022/extensions/lib/adapters/date.adapter.mjs +42 -0
- package/esm2022/extensions/lib/adapters/time.adapter.mjs +37 -0
- package/esm2022/extensions/lib/components/abstract-actions/abstract-actions.component.mjs +26 -0
- package/esm2022/extensions/lib/components/date-time-picker/date-time-picker.component.mjs +110 -0
- package/esm2022/extensions/lib/components/extensible-form/extensible-form-prop.component.mjs +199 -0
- package/esm2022/extensions/lib/components/extensible-form/extensible-form.component.mjs +74 -0
- package/esm2022/extensions/lib/components/extensible-table/extensible-table.component.mjs +136 -0
- package/esm2022/extensions/lib/components/grid-actions/grid-actions.component.mjs +40 -0
- package/esm2022/extensions/lib/components/page-toolbar/page-toolbar.component.mjs +39 -0
- package/{esm2020 → esm2022}/extensions/lib/constants/extra-properties.mjs +1 -1
- package/esm2022/extensions/lib/directives/disabled.directive.mjs +30 -0
- package/esm2022/extensions/lib/directives/prop-data.directive.mjs +42 -0
- package/{esm2020 → esm2022}/extensions/lib/enums/components.mjs +1 -1
- package/{esm2020 → esm2022}/extensions/lib/enums/props.enum.mjs +1 -1
- package/{esm2020 → esm2022}/extensions/lib/models/actions.mjs +46 -46
- package/{esm2020 → esm2022}/extensions/lib/models/entity-actions.mjs +28 -28
- package/{esm2020 → esm2022}/extensions/lib/models/entity-props.mjs +42 -42
- package/esm2022/extensions/lib/models/form-props.mjs +76 -0
- package/{esm2020 → esm2022}/extensions/lib/models/internal/object-extensions.mjs +2 -2
- package/{esm2020 → esm2022}/extensions/lib/models/object-extensions.mjs +2 -2
- package/esm2022/extensions/lib/models/props.mjs +54 -0
- package/{esm2020 → esm2022}/extensions/lib/models/toolbar-actions.mjs +43 -43
- package/esm2022/extensions/lib/pipes/create-injector.pipe.mjs +37 -0
- package/esm2022/extensions/lib/services/extensions.service.mjs +25 -0
- package/{esm2020 → esm2022}/extensions/lib/tokens/extensible-form-view-provider.token.mjs +2 -2
- package/{esm2020 → esm2022}/extensions/lib/tokens/extensions.token.mjs +11 -11
- package/esm2022/extensions/lib/ui-extensions.module.mjs +97 -0
- package/{esm2020 → esm2022}/extensions/lib/utils/actions.util.mjs +8 -8
- package/{esm2020 → esm2022}/extensions/lib/utils/enum.util.mjs +41 -41
- package/{esm2020 → esm2022}/extensions/lib/utils/factory.util.mjs +3 -3
- package/esm2022/extensions/lib/utils/form-props.util.mjs +51 -0
- package/{esm2020 → esm2022}/extensions/lib/utils/localization.util.mjs +12 -12
- package/{esm2020 → esm2022}/extensions/lib/utils/props.util.mjs +13 -13
- package/esm2022/extensions/lib/utils/state.util.mjs +126 -0
- package/{esm2020 → esm2022}/extensions/lib/utils/typeahead.util.mjs +51 -51
- package/{esm2020 → esm2022}/extensions/lib/utils/validation.util.mjs +10 -10
- package/{esm2020 → esm2022}/extensions/public-api.mjs +30 -30
- package/{esm2020 → esm2022}/lib/animations/bounce.animations.mjs +16 -16
- package/{esm2020 → esm2022}/lib/animations/collapse.animations.mjs +49 -49
- package/{esm2020 → esm2022}/lib/animations/fade.animations.mjs +37 -37
- package/{esm2020 → esm2022}/lib/animations/index.mjs +6 -6
- package/{esm2020 → esm2022}/lib/animations/modal.animations.mjs +10 -10
- package/{esm2020 → esm2022}/lib/animations/slide.animations.mjs +7 -7
- package/{esm2020 → esm2022}/lib/animations/toast.animations.mjs +12 -12
- package/esm2022/lib/components/breadcrumb/breadcrumb.component.mjs +44 -0
- package/esm2022/lib/components/breadcrumb-items/breadcrumb-items.component.mjs +20 -0
- package/esm2022/lib/components/button/button.component.mjs +103 -0
- package/{esm2020 → esm2022}/lib/components/card/card-body.component.mjs +27 -26
- package/esm2022/lib/components/card/card-footer.component.mjs +31 -0
- package/esm2022/lib/components/card/card-header.component.mjs +31 -0
- package/esm2022/lib/components/card/card-header.directive.mjs +20 -0
- package/esm2022/lib/components/card/card-img-top.directive.mjs +20 -0
- package/esm2022/lib/components/card/card-subtitle.directive.mjs +20 -0
- package/esm2022/lib/components/card/card-title.directive.mjs +20 -0
- package/esm2022/lib/components/card/card.component.mjs +24 -0
- package/esm2022/lib/components/card/card.module.mjs +50 -0
- package/{esm2020 → esm2022}/lib/components/card/index.mjs +9 -9
- package/esm2022/lib/components/checkbox/checkbox.component.mjs +89 -0
- package/esm2022/lib/components/confirmation/confirmation.component.mjs +46 -0
- package/esm2022/lib/components/form-input/form-input.component.mjs +95 -0
- package/esm2022/lib/components/http-error-wrapper/http-error-wrapper.component.mjs +60 -0
- package/{esm2020 → esm2022}/lib/components/index.mjs +16 -16
- package/esm2022/lib/components/loader-bar/loader-bar.component.mjs +122 -0
- package/esm2022/lib/components/loading/loading.component.mjs +20 -0
- package/esm2022/lib/components/modal/modal-close.directive.mjs +28 -0
- package/esm2022/lib/components/modal/modal-ref.service.mjs +27 -0
- package/esm2022/lib/components/modal/modal.component.mjs +190 -0
- package/esm2022/lib/components/password/password.component.mjs +39 -0
- package/esm2022/lib/components/toast/toast.component.mjs +56 -0
- package/esm2022/lib/components/toast-container/toast-container.component.mjs +59 -0
- package/{esm2020 → esm2022}/lib/constants/styles.mjs +1 -1
- package/{esm2020 → esm2022}/lib/constants/validation.mjs +19 -19
- package/esm2022/lib/directives/ellipsis.directive.mjs +65 -0
- package/{esm2020 → esm2022}/lib/directives/index.mjs +5 -5
- package/esm2022/lib/directives/loading.directive.mjs +90 -0
- package/esm2022/lib/directives/ngx-datatable-default.directive.mjs +76 -0
- package/esm2022/lib/directives/ngx-datatable-list.directive.mjs +95 -0
- package/esm2022/lib/directives/visible.directive.mjs +63 -0
- package/{esm2020 → esm2022}/lib/enums/form.mjs +5 -5
- package/{esm2020 → esm2022}/lib/enums/index.mjs +2 -2
- package/{esm2020 → esm2022}/lib/enums/route-names.mjs +1 -1
- package/esm2022/lib/handlers/document-dir.handler.mjs +32 -0
- package/esm2022/lib/handlers/error.handler.mjs +294 -0
- package/{esm2020 → esm2022}/lib/handlers/index.mjs +2 -2
- package/{esm2020 → esm2022}/lib/models/common.mjs +1 -1
- package/{esm2020 → esm2022}/lib/models/confirmation.mjs +9 -9
- package/{esm2020 → esm2022}/lib/models/index.mjs +7 -7
- package/{esm2020 → esm2022}/lib/models/nav-item.mjs +5 -5
- package/{esm2020 → esm2022}/lib/models/statistics.mjs +1 -1
- package/{esm2020 → esm2022}/lib/models/toaster.mjs +1 -1
- package/{esm2020 → esm2022}/lib/models/user-menu.mjs +3 -3
- package/{esm2020 → esm2022}/lib/models/validation.mjs +1 -1
- package/{esm2020 → esm2022}/lib/providers/index.mjs +2 -2
- package/{esm2020 → esm2022}/lib/providers/ng-bootstrap-config.provider.mjs +16 -16
- package/{esm2020 → esm2022}/lib/providers/route.provider.mjs +17 -17
- package/{esm2020 → esm2022}/lib/services/abstract-menu.service.mjs +49 -49
- package/esm2022/lib/services/confirmation.service.mjs +69 -0
- package/{esm2020 → esm2022}/lib/services/index.mjs +5 -5
- package/esm2022/lib/services/nav-items.service.mjs +18 -0
- package/esm2022/lib/services/page-alert.service.mjs +29 -0
- package/esm2022/lib/services/toaster.service.mjs +104 -0
- package/esm2022/lib/services/user-menu.service.mjs +18 -0
- package/esm2022/lib/theme-shared.module.mjs +202 -0
- package/{esm2020 → esm2022}/lib/tokens/append-content.token.mjs +10 -10
- package/{esm2020 → esm2022}/lib/tokens/confirmation-icons.token.mjs +10 -10
- package/{esm2020 → esm2022}/lib/tokens/http-error.token.mjs +13 -13
- package/{esm2020 → esm2022}/lib/tokens/index.mjs +4 -4
- package/{esm2020 → esm2022}/lib/tokens/ngx-datatable-messages.token.mjs +7 -7
- package/{esm2020 → esm2022}/lib/tokens/suppress-unsaved-changes-warning.token.mjs +2 -2
- package/esm2022/lib/utils/date-parser-formatter.mjs +59 -0
- package/{esm2020 → esm2022}/lib/utils/index.mjs +2 -2
- package/{esm2020 → esm2022}/lib/utils/validation-utils.mjs +61 -61
- package/{esm2020 → esm2022}/public-api.mjs +15 -15
- package/{esm2020 → esm2022}/testing/abp-ng.theme.shared-testing.mjs +4 -4
- package/{esm2020 → esm2022}/testing/lib/models/config.mjs +1 -1
- package/{esm2020 → esm2022}/testing/lib/models/index.mjs +1 -1
- package/esm2022/testing/lib/theme-shared-testing.module.mjs +47 -0
- package/{esm2020 → esm2022}/testing/public-api.mjs +3 -3
- package/extensions/index.d.ts +5 -5
- package/extensions/lib/adapters/date-time.adapter.d.ts +11 -11
- package/extensions/lib/adapters/date.adapter.d.ts +9 -9
- package/extensions/lib/adapters/time.adapter.d.ts +8 -8
- package/extensions/lib/components/abstract-actions/abstract-actions.component.d.ts +12 -12
- package/extensions/lib/components/date-time-picker/date-time-picker.component.d.ts +16 -16
- package/extensions/lib/components/extensible-form/extensible-form-prop.component.d.ts +43 -43
- package/extensions/lib/components/extensible-form/extensible-form.component.d.ts +25 -25
- package/extensions/lib/components/extensible-table/extensible-table.component.d.ts +38 -38
- package/extensions/lib/components/grid-actions/grid-actions.component.d.ts +13 -13
- package/extensions/lib/components/page-toolbar/page-toolbar.component.d.ts +20 -20
- package/extensions/lib/constants/extra-properties.d.ts +1 -1
- package/extensions/lib/directives/disabled.directive.d.ts +11 -11
- package/extensions/lib/directives/prop-data.directive.d.ts +19 -19
- package/extensions/lib/enums/components.d.ts +3 -3
- package/extensions/lib/enums/props.enum.d.ts +16 -16
- package/extensions/lib/models/actions.d.ts +36 -36
- package/extensions/lib/models/entity-actions.d.ts +22 -22
- package/extensions/lib/models/entity-props.d.ts +29 -29
- package/extensions/lib/models/form-props.d.ts +59 -58
- package/extensions/lib/models/internal/object-extensions.d.ts +86 -85
- package/extensions/lib/models/object-extensions.d.ts +2 -2
- package/extensions/lib/models/props.d.ts +45 -44
- package/extensions/lib/models/toolbar-actions.d.ts +38 -38
- package/extensions/lib/pipes/create-injector.pipe.d.ts +8 -8
- package/extensions/lib/services/extensions.service.d.ts +14 -14
- package/extensions/lib/tokens/extensible-form-view-provider.token.d.ts +5 -5
- package/extensions/lib/tokens/extensions.token.d.ts +20 -24
- package/extensions/lib/ui-extensions.module.d.ts +24 -24
- package/extensions/lib/utils/actions.util.d.ts +7 -7
- package/extensions/lib/utils/enum.util.d.ts +7 -7
- package/extensions/lib/utils/factory.util.d.ts +1 -1
- package/extensions/lib/utils/form-props.util.d.ts +3 -3
- package/extensions/lib/utils/localization.util.d.ts +3 -3
- package/extensions/lib/utils/props.util.d.ts +9 -9
- package/extensions/lib/utils/state.util.d.ts +5 -5
- package/extensions/lib/utils/typeahead.util.d.ts +11 -11
- package/extensions/lib/utils/validation.util.d.ts +3 -3
- package/extensions/public-api.d.ts +30 -30
- package/{fesm2020 → fesm2022}/abp-ng.theme.shared-extensions.mjs +1335 -1330
- package/fesm2022/abp-ng.theme.shared-extensions.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/abp-ng.theme.shared-testing.mjs +40 -40
- package/{fesm2015 → fesm2022}/abp-ng.theme.shared-testing.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/abp-ng.theme.shared.mjs +2292 -2293
- package/fesm2022/abp-ng.theme.shared.mjs.map +1 -0
- package/index.d.ts +5 -5
- package/lib/animations/bounce.animations.d.ts +1 -1
- package/lib/animations/collapse.animations.d.ts +9 -9
- package/lib/animations/fade.animations.d.ts +10 -10
- package/lib/animations/index.d.ts +6 -6
- package/lib/animations/modal.animations.d.ts +2 -2
- package/lib/animations/slide.animations.d.ts +1 -1
- package/lib/animations/toast.animations.d.ts +1 -1
- package/lib/components/breadcrumb/breadcrumb.component.d.ts +16 -16
- package/lib/components/breadcrumb-items/breadcrumb-items.component.d.ts +7 -7
- package/lib/components/button/button.component.d.ts +26 -26
- package/lib/components/card/card-body.component.d.ts +8 -8
- package/lib/components/card/card-footer.component.d.ts +8 -8
- package/lib/components/card/card-header.component.d.ts +8 -8
- package/lib/components/card/card-header.directive.d.ts +6 -6
- package/lib/components/card/card-img-top.directive.d.ts +6 -6
- package/lib/components/card/card-subtitle.directive.d.ts +6 -6
- package/lib/components/card/card-title.directive.d.ts +6 -6
- package/lib/components/card/card.component.d.ts +7 -7
- package/lib/components/card/card.module.d.ts +15 -15
- package/lib/components/card/index.d.ts +9 -9
- package/lib/components/checkbox/checkbox.component.d.ts +18 -18
- package/lib/components/confirmation/confirmation.component.d.ts +19 -19
- package/lib/components/form-input/form-input.component.d.ts +19 -20
- package/lib/components/http-error-wrapper/http-error-wrapper.component.d.ts +27 -27
- package/lib/components/index.d.ts +16 -16
- package/lib/components/loader-bar/loader-bar.component.d.ts +33 -33
- package/lib/components/loading/loading.component.d.ts +5 -5
- package/lib/components/modal/modal-close.directive.d.ts +9 -9
- package/lib/components/modal/modal-ref.service.d.ts +13 -13
- package/lib/components/modal/modal.component.d.ts +50 -50
- package/lib/components/password/password.component.d.ts +12 -12
- package/lib/components/toast/toast.component.d.ts +14 -14
- package/lib/components/toast-container/toast-container.component.d.ts +22 -22
- package/lib/constants/styles.d.ts +2 -2
- package/lib/constants/validation.d.ts +19 -19
- package/lib/directives/ellipsis.directive.d.ts +21 -21
- package/lib/directives/index.d.ts +5 -5
- package/lib/directives/loading.directive.d.ts +25 -25
- package/lib/directives/ngx-datatable-default.directive.d.ts +30 -30
- package/lib/directives/ngx-datatable-list.directive.d.ts +24 -24
- package/lib/directives/visible.directive.d.ts +18 -18
- package/lib/enums/form.d.ts +4 -4
- package/lib/enums/index.d.ts +2 -2
- package/lib/enums/route-names.d.ts +3 -3
- package/lib/handlers/document-dir.handler.d.ts +13 -13
- package/lib/handlers/error.handler.d.ts +83 -83
- package/lib/handlers/index.d.ts +2 -2
- package/lib/models/common.d.ts +21 -21
- package/lib/models/confirmation.d.ts +27 -27
- package/lib/models/index.d.ts +7 -7
- package/lib/models/nav-item.d.ts +13 -13
- package/lib/models/statistics.d.ts +12 -12
- package/lib/models/toaster.d.ts +30 -30
- package/lib/models/user-menu.d.ts +8 -8
- package/lib/models/validation.d.ts +1 -1
- package/lib/providers/index.d.ts +2 -2
- package/lib/providers/ng-bootstrap-config.provider.d.ts +8 -8
- package/lib/providers/route.provider.d.ts +8 -8
- package/lib/services/abstract-menu.service.d.ts +13 -13
- package/lib/services/confirmation.service.d.ts +21 -21
- package/lib/services/index.d.ts +5 -5
- package/lib/services/nav-items.service.d.ts +8 -8
- package/lib/services/page-alert.service.d.ts +18 -18
- package/lib/services/toaster.service.d.ts +60 -60
- package/lib/services/user-menu.service.d.ts +8 -8
- package/lib/theme-shared.module.d.ts +38 -38
- package/lib/tokens/append-content.token.d.ts +2 -2
- package/lib/tokens/confirmation-icons.token.d.ts +11 -11
- package/lib/tokens/http-error.token.d.ts +5 -5
- package/lib/tokens/index.d.ts +4 -4
- package/lib/tokens/ngx-datatable-messages.token.d.ts +12 -12
- package/lib/tokens/suppress-unsaved-changes-warning.token.d.ts +2 -2
- package/lib/utils/date-parser-formatter.d.ts +12 -12
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/validation-utils.d.ts +5 -5
- package/package.json +14 -24
- package/public-api.d.ts +12 -12
- package/testing/index.d.ts +5 -5
- package/testing/lib/models/config.d.ts +4 -4
- package/testing/lib/models/index.d.ts +1 -1
- package/testing/lib/theme-shared-testing.module.d.ts +14 -14
- package/testing/public-api.d.ts +3 -3
- package/esm2020/extensions/lib/adapters/date-time.adapter.mjs +0 -44
- package/esm2020/extensions/lib/adapters/date.adapter.mjs +0 -41
- package/esm2020/extensions/lib/adapters/time.adapter.mjs +0 -36
- package/esm2020/extensions/lib/components/abstract-actions/abstract-actions.component.mjs +0 -25
- package/esm2020/extensions/lib/components/date-time-picker/date-time-picker.component.mjs +0 -109
- package/esm2020/extensions/lib/components/extensible-form/extensible-form-prop.component.mjs +0 -198
- package/esm2020/extensions/lib/components/extensible-form/extensible-form.component.mjs +0 -73
- package/esm2020/extensions/lib/components/extensible-table/extensible-table.component.mjs +0 -135
- package/esm2020/extensions/lib/components/grid-actions/grid-actions.component.mjs +0 -39
- package/esm2020/extensions/lib/components/page-toolbar/page-toolbar.component.mjs +0 -38
- package/esm2020/extensions/lib/directives/disabled.directive.mjs +0 -29
- package/esm2020/extensions/lib/directives/prop-data.directive.mjs +0 -41
- package/esm2020/extensions/lib/models/form-props.mjs +0 -75
- package/esm2020/extensions/lib/models/props.mjs +0 -53
- package/esm2020/extensions/lib/pipes/create-injector.pipe.mjs +0 -36
- package/esm2020/extensions/lib/services/extensions.service.mjs +0 -24
- package/esm2020/extensions/lib/ui-extensions.module.mjs +0 -95
- package/esm2020/extensions/lib/utils/form-props.util.mjs +0 -51
- package/esm2020/extensions/lib/utils/state.util.mjs +0 -123
- package/esm2020/lib/components/breadcrumb/breadcrumb.component.mjs +0 -43
- package/esm2020/lib/components/breadcrumb-items/breadcrumb-items.component.mjs +0 -19
- package/esm2020/lib/components/button/button.component.mjs +0 -102
- package/esm2020/lib/components/card/card-footer.component.mjs +0 -30
- package/esm2020/lib/components/card/card-header.component.mjs +0 -30
- package/esm2020/lib/components/card/card-header.directive.mjs +0 -19
- package/esm2020/lib/components/card/card-img-top.directive.mjs +0 -19
- package/esm2020/lib/components/card/card-subtitle.directive.mjs +0 -19
- package/esm2020/lib/components/card/card-title.directive.mjs +0 -19
- package/esm2020/lib/components/card/card.component.mjs +0 -23
- package/esm2020/lib/components/card/card.module.mjs +0 -49
- package/esm2020/lib/components/checkbox/checkbox.component.mjs +0 -88
- package/esm2020/lib/components/confirmation/confirmation.component.mjs +0 -45
- package/esm2020/lib/components/form-input/form-input.component.mjs +0 -97
- package/esm2020/lib/components/http-error-wrapper/http-error-wrapper.component.mjs +0 -59
- package/esm2020/lib/components/loader-bar/loader-bar.component.mjs +0 -121
- package/esm2020/lib/components/loading/loading.component.mjs +0 -19
- package/esm2020/lib/components/modal/modal-close.directive.mjs +0 -27
- package/esm2020/lib/components/modal/modal-ref.service.mjs +0 -26
- package/esm2020/lib/components/modal/modal.component.mjs +0 -189
- package/esm2020/lib/components/password/password.component.mjs +0 -38
- package/esm2020/lib/components/toast/toast.component.mjs +0 -55
- package/esm2020/lib/components/toast-container/toast-container.component.mjs +0 -58
- package/esm2020/lib/directives/ellipsis.directive.mjs +0 -63
- package/esm2020/lib/directives/loading.directive.mjs +0 -89
- package/esm2020/lib/directives/ngx-datatable-default.directive.mjs +0 -75
- package/esm2020/lib/directives/ngx-datatable-list.directive.mjs +0 -94
- package/esm2020/lib/directives/visible.directive.mjs +0 -62
- package/esm2020/lib/handlers/document-dir.handler.mjs +0 -31
- package/esm2020/lib/handlers/error.handler.mjs +0 -291
- package/esm2020/lib/services/confirmation.service.mjs +0 -68
- package/esm2020/lib/services/nav-items.service.mjs +0 -17
- package/esm2020/lib/services/page-alert.service.mjs +0 -28
- package/esm2020/lib/services/toaster.service.mjs +0 -103
- package/esm2020/lib/services/user-menu.service.mjs +0 -17
- package/esm2020/lib/theme-shared.module.mjs +0 -200
- package/esm2020/lib/utils/date-parser-formatter.mjs +0 -58
- package/esm2020/testing/lib/theme-shared-testing.module.mjs +0 -46
- package/fesm2015/abp-ng.theme.shared-extensions.mjs +0 -1460
- package/fesm2015/abp-ng.theme.shared-extensions.mjs.map +0 -1
- package/fesm2015/abp-ng.theme.shared-testing.mjs +0 -54
- package/fesm2015/abp-ng.theme.shared.mjs +0 -2770
- package/fesm2015/abp-ng.theme.shared.mjs.map +0 -1
- package/fesm2020/abp-ng.theme.shared-extensions.mjs.map +0 -1
- package/fesm2020/abp-ng.theme.shared-testing.mjs.map +0 -1
- package/fesm2020/abp-ng.theme.shared.mjs.map +0 -1
|
@@ -1,1460 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Optional, SkipSelf, Component, ChangeDetectionStrategy, Input, ViewChild, InjectionToken, Directive, Host, Injector, Inject, ViewChildren, EventEmitter, LOCALE_ID, Output, Pipe, NgModule } from '@angular/core';
|
|
3
|
-
import * as i3 from '@angular/common';
|
|
4
|
-
import { formatDate } from '@angular/common';
|
|
5
|
-
import * as i4$1 from '@ng-bootstrap/ng-bootstrap';
|
|
6
|
-
import { NgbDateAdapter, NgbTimeAdapter, NgbInputDatepicker, NgbTimepicker, NgbDatepickerModule, NgbDropdownModule, NgbTimepickerModule, NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap';
|
|
7
|
-
import * as i2 from '@angular/forms';
|
|
8
|
-
import { ControlContainer, FormGroupDirective, Validators, UntypedFormGroup, UntypedFormControl } from '@angular/forms';
|
|
9
|
-
import * as i4 from '@ngx-validate/core';
|
|
10
|
-
import { NgxValidateCoreModule } from '@ngx-validate/core';
|
|
11
|
-
import * as i1 from '@abp/ng.core';
|
|
12
|
-
import { RestService, AbpValidators, escapeHtmlChars, PermissionService, getShortDateShortTimeFormat, getShortTimeFormat, getShortDateFormat, CoreModule, LocalizationService, createLocalizationPipeKeyGenerator } from '@abp/ng.core';
|
|
13
|
-
import { of, merge, pipe, zip } from 'rxjs';
|
|
14
|
-
import { map, debounceTime, distinctUntilChanged, switchMap, filter, take } from 'rxjs/operators';
|
|
15
|
-
import * as i4$2 from '@abp/ng.theme.shared';
|
|
16
|
-
import { ThemeSharedModule } from '@abp/ng.theme.shared';
|
|
17
|
-
import { LinkedList } from '@abp/utils';
|
|
18
|
-
import * as i3$1 from '@swimlane/ngx-datatable';
|
|
19
|
-
|
|
20
|
-
class DateTimeAdapter {
|
|
21
|
-
fromModel(value) {
|
|
22
|
-
if (!value)
|
|
23
|
-
return null;
|
|
24
|
-
const date = new Date(value);
|
|
25
|
-
if (isNaN(date))
|
|
26
|
-
return null;
|
|
27
|
-
this.value = {
|
|
28
|
-
year: date.getFullYear(),
|
|
29
|
-
month: date.getMonth() + 1,
|
|
30
|
-
day: date.getDate(),
|
|
31
|
-
hour: date.getHours(),
|
|
32
|
-
minute: date.getMinutes(),
|
|
33
|
-
second: date.getSeconds(),
|
|
34
|
-
};
|
|
35
|
-
return this.value;
|
|
36
|
-
}
|
|
37
|
-
toModel(value) {
|
|
38
|
-
if (!value)
|
|
39
|
-
return '';
|
|
40
|
-
const now = new Date();
|
|
41
|
-
const newValue = Object.assign(Object.assign({
|
|
42
|
-
// TODO look for strict mode errors
|
|
43
|
-
year: now.getUTCFullYear(), month: now.getMonth() + 1, day: now.getDate(), hour: 0, minute: 0, second: 0 }, this.value), value);
|
|
44
|
-
const date = new Date(newValue.year, newValue.month - 1, newValue.day, newValue.hour, newValue.minute, newValue.second);
|
|
45
|
-
return new Date(date).toISOString();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
DateTimeAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DateTimeAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
49
|
-
DateTimeAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DateTimeAdapter });
|
|
50
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DateTimeAdapter, decorators: [{
|
|
51
|
-
type: Injectable
|
|
52
|
-
}] });
|
|
53
|
-
|
|
54
|
-
class DateAdapter extends NgbDateAdapter {
|
|
55
|
-
fromModel(value) {
|
|
56
|
-
if (!value)
|
|
57
|
-
return null;
|
|
58
|
-
let date;
|
|
59
|
-
if (typeof value === 'string') {
|
|
60
|
-
date = this.dateOf(value);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
date = new Date(value);
|
|
64
|
-
}
|
|
65
|
-
if (isNaN(date))
|
|
66
|
-
return null;
|
|
67
|
-
return {
|
|
68
|
-
day: date.getDate(),
|
|
69
|
-
month: date.getMonth() + 1,
|
|
70
|
-
year: date.getFullYear(),
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
toModel(value) {
|
|
74
|
-
if (!value)
|
|
75
|
-
return '';
|
|
76
|
-
const date = new Date(value.year, value.month - 1, value.day);
|
|
77
|
-
const formattedDate = formatDate(date, 'yyyy-MM-dd', 'en');
|
|
78
|
-
return formattedDate;
|
|
79
|
-
}
|
|
80
|
-
dateOf(value) {
|
|
81
|
-
const dateUtc = new Date(Date.parse(value));
|
|
82
|
-
return new Date(dateUtc.getTime() + Math.abs(dateUtc.getTimezoneOffset() * 60000));
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
DateAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DateAdapter, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
86
|
-
DateAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DateAdapter });
|
|
87
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DateAdapter, decorators: [{
|
|
88
|
-
type: Injectable
|
|
89
|
-
}] });
|
|
90
|
-
|
|
91
|
-
class TimeAdapter extends NgbTimeAdapter {
|
|
92
|
-
fromModel(value) {
|
|
93
|
-
if (!value)
|
|
94
|
-
return null;
|
|
95
|
-
const date = isTimeStr(value)
|
|
96
|
-
? new Date(0, 0, 1, ...value.split(':').map(Number))
|
|
97
|
-
: new Date(value);
|
|
98
|
-
if (isNaN(date))
|
|
99
|
-
return null;
|
|
100
|
-
return {
|
|
101
|
-
hour: date.getHours(),
|
|
102
|
-
minute: date.getMinutes(),
|
|
103
|
-
second: date.getSeconds(),
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
toModel(value) {
|
|
107
|
-
if (!value)
|
|
108
|
-
return '';
|
|
109
|
-
const date = new Date(0, 0, 1, value.hour, value.minute, value.second);
|
|
110
|
-
const formattedDate = formatDate(date, 'HH:mm', 'en');
|
|
111
|
-
return formattedDate;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
TimeAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: TimeAdapter, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
115
|
-
TimeAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: TimeAdapter });
|
|
116
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: TimeAdapter, decorators: [{
|
|
117
|
-
type: Injectable
|
|
118
|
-
}] });
|
|
119
|
-
function isTimeStr(value) {
|
|
120
|
-
return /^((2[123])|[01][0-9])(\:[0-5][0-9]){1,2}$/.test(String(value));
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function selfFactory(dependency) {
|
|
124
|
-
return dependency;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
class DateTimePickerComponent {
|
|
128
|
-
constructor(cdRef) {
|
|
129
|
-
this.cdRef = cdRef;
|
|
130
|
-
this.meridian = false;
|
|
131
|
-
}
|
|
132
|
-
setDate(datestr) {
|
|
133
|
-
this.date.writeValue(datestr);
|
|
134
|
-
}
|
|
135
|
-
setTime(datestr) {
|
|
136
|
-
this.time.writeValue(datestr);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
DateTimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DateTimePickerComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
140
|
-
DateTimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: DateTimePickerComponent, selector: "abp-date-time-picker", inputs: { prop: "prop", meridian: "meridian" }, viewQueries: [{ propertyName: "date", first: true, predicate: NgbInputDatepicker, descendants: true }, { propertyName: "time", first: true, predicate: NgbTimepicker, descendants: true }], exportAs: ["abpDateTimePicker"], ngImport: i0, template: `
|
|
141
|
-
<input
|
|
142
|
-
[id]="prop.id"
|
|
143
|
-
[formControlName]="prop.name"
|
|
144
|
-
(ngModelChange)="setTime($event)"
|
|
145
|
-
(click)="datepicker.open()"
|
|
146
|
-
(keyup.space)="datepicker.open()"
|
|
147
|
-
ngbDatepicker
|
|
148
|
-
#datepicker="ngbDatepicker"
|
|
149
|
-
type="text"
|
|
150
|
-
class="form-control"
|
|
151
|
-
/>
|
|
152
|
-
<ngb-timepicker
|
|
153
|
-
#timepicker
|
|
154
|
-
[formControlName]="prop.name"
|
|
155
|
-
(ngModelChange)="setDate($event)"
|
|
156
|
-
[meridian]="meridian"
|
|
157
|
-
></ngb-timepicker>
|
|
158
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i4.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "directive", type: i4$1.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["autoClose", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "popperOptions", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays", "disabled"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { kind: "component", type: i4$1.NgbTimepicker, selector: "ngb-timepicker", inputs: ["meridian", "spinners", "seconds", "hourStep", "minuteStep", "secondStep", "readonlyInputs", "size"], exportAs: ["ngbTimepicker"] }], viewProviders: [
|
|
159
|
-
{
|
|
160
|
-
provide: ControlContainer,
|
|
161
|
-
useFactory: selfFactory,
|
|
162
|
-
deps: [[new Optional(), new SkipSelf(), ControlContainer]],
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
provide: NgbDateAdapter,
|
|
166
|
-
useClass: DateTimeAdapter,
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
provide: NgbTimeAdapter,
|
|
170
|
-
useClass: DateTimeAdapter,
|
|
171
|
-
},
|
|
172
|
-
], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
173
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DateTimePickerComponent, decorators: [{
|
|
174
|
-
type: Component,
|
|
175
|
-
args: [{
|
|
176
|
-
exportAs: 'abpDateTimePicker',
|
|
177
|
-
selector: 'abp-date-time-picker',
|
|
178
|
-
template: `
|
|
179
|
-
<input
|
|
180
|
-
[id]="prop.id"
|
|
181
|
-
[formControlName]="prop.name"
|
|
182
|
-
(ngModelChange)="setTime($event)"
|
|
183
|
-
(click)="datepicker.open()"
|
|
184
|
-
(keyup.space)="datepicker.open()"
|
|
185
|
-
ngbDatepicker
|
|
186
|
-
#datepicker="ngbDatepicker"
|
|
187
|
-
type="text"
|
|
188
|
-
class="form-control"
|
|
189
|
-
/>
|
|
190
|
-
<ngb-timepicker
|
|
191
|
-
#timepicker
|
|
192
|
-
[formControlName]="prop.name"
|
|
193
|
-
(ngModelChange)="setDate($event)"
|
|
194
|
-
[meridian]="meridian"
|
|
195
|
-
></ngb-timepicker>
|
|
196
|
-
`,
|
|
197
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
198
|
-
viewProviders: [
|
|
199
|
-
{
|
|
200
|
-
provide: ControlContainer,
|
|
201
|
-
useFactory: selfFactory,
|
|
202
|
-
deps: [[new Optional(), new SkipSelf(), ControlContainer]],
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
provide: NgbDateAdapter,
|
|
206
|
-
useClass: DateTimeAdapter,
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
provide: NgbTimeAdapter,
|
|
210
|
-
useClass: DateTimeAdapter,
|
|
211
|
-
},
|
|
212
|
-
],
|
|
213
|
-
}]
|
|
214
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { prop: [{
|
|
215
|
-
type: Input
|
|
216
|
-
}], meridian: [{
|
|
217
|
-
type: Input
|
|
218
|
-
}], date: [{
|
|
219
|
-
type: ViewChild,
|
|
220
|
-
args: [NgbInputDatepicker]
|
|
221
|
-
}], time: [{
|
|
222
|
-
type: ViewChild,
|
|
223
|
-
args: [NgbTimepicker]
|
|
224
|
-
}] } });
|
|
225
|
-
|
|
226
|
-
const EXTENSIONS_IDENTIFIER = new InjectionToken('EXTENSIONS_IDENTIFIER');
|
|
227
|
-
const EXTENSIONS_ACTION_TYPE = new InjectionToken('EXTENSIONS_ACTION_TYPE');
|
|
228
|
-
const EXTENSIONS_ACTION_DATA = new InjectionToken('EXTENSIONS_ACTION_DATA');
|
|
229
|
-
const EXTENSIONS_ACTION_CALLBACK = new InjectionToken('EXTENSIONS_ACTION_DATA');
|
|
230
|
-
const PROP_DATA_STREAM = new InjectionToken('PROP_DATA_STREAM');
|
|
231
|
-
const ENTITY_PROP_TYPE_CLASSES = new InjectionToken('ENTITY_PROP_TYPE_CLASSES', {
|
|
232
|
-
factory: () => ({}),
|
|
233
|
-
});
|
|
234
|
-
const EXTENSIONS_FORM_PROP = new InjectionToken('EXTENSIONS_FORM_PROP');
|
|
235
|
-
const EXTENSIONS_FORM_PROP_DATA = new InjectionToken('EXTENSIONS_FORM_PROP_DATA');
|
|
236
|
-
|
|
237
|
-
const EXTRA_PROPERTIES_KEY = 'extraProperties';
|
|
238
|
-
|
|
239
|
-
const TYPEAHEAD_TEXT_SUFFIX = '_Text';
|
|
240
|
-
const TYPEAHEAD_TEXT_SUFFIX_REGEX = /_Text$/;
|
|
241
|
-
function createTypeaheadOptions(lookup) {
|
|
242
|
-
return (data, searchText) => searchText && data
|
|
243
|
-
? data
|
|
244
|
-
.getInjected(RestService)
|
|
245
|
-
.request({
|
|
246
|
-
method: 'GET',
|
|
247
|
-
url: lookup.url || '',
|
|
248
|
-
params: {
|
|
249
|
-
[lookup.filterParamName || '']: searchText,
|
|
250
|
-
},
|
|
251
|
-
}, { apiName: 'Default' })
|
|
252
|
-
.pipe(map((response) => {
|
|
253
|
-
const list = response[lookup.resultListPropertyName || ''];
|
|
254
|
-
const mapToOption = (item) => ({
|
|
255
|
-
key: item[lookup.displayPropertyName || ''],
|
|
256
|
-
value: item[lookup.valuePropertyName || ''],
|
|
257
|
-
});
|
|
258
|
-
return list.map(mapToOption);
|
|
259
|
-
}))
|
|
260
|
-
: of([]);
|
|
261
|
-
}
|
|
262
|
-
function getTypeaheadType(lookup, name) {
|
|
263
|
-
return Boolean(lookup.url)
|
|
264
|
-
? "typeahead" /* ePropType.Typeahead */
|
|
265
|
-
: name.endsWith(TYPEAHEAD_TEXT_SUFFIX)
|
|
266
|
-
? "hidden" /* ePropType.Hidden */
|
|
267
|
-
: undefined;
|
|
268
|
-
}
|
|
269
|
-
function createTypeaheadDisplayNameGenerator(displayNameGeneratorFn, properties) {
|
|
270
|
-
return (displayName, fallback) => {
|
|
271
|
-
const name = removeTypeaheadTextSuffix(fallback.name || '');
|
|
272
|
-
return displayNameGeneratorFn(displayName || properties[name].displayName, {
|
|
273
|
-
name,
|
|
274
|
-
resource: fallback.resource,
|
|
275
|
-
});
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
function addTypeaheadTextSuffix(name) {
|
|
279
|
-
return name + TYPEAHEAD_TEXT_SUFFIX;
|
|
280
|
-
}
|
|
281
|
-
function hasTypeaheadTextSuffix(name) {
|
|
282
|
-
return TYPEAHEAD_TEXT_SUFFIX_REGEX.test(name);
|
|
283
|
-
}
|
|
284
|
-
function removeTypeaheadTextSuffix(name) {
|
|
285
|
-
return name.replace(TYPEAHEAD_TEXT_SUFFIX_REGEX, '');
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
class DisabledDirective {
|
|
289
|
-
constructor(ngControl) {
|
|
290
|
-
this.ngControl = ngControl;
|
|
291
|
-
this.abpDisabled = false;
|
|
292
|
-
}
|
|
293
|
-
// Related issue: https://github.com/angular/angular/issues/35330
|
|
294
|
-
ngOnChanges({ abpDisabled }) {
|
|
295
|
-
if (this.ngControl.control && abpDisabled) {
|
|
296
|
-
this.ngControl.control[abpDisabled.currentValue ? 'disable' : 'enable']();
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
DisabledDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DisabledDirective, deps: [{ token: i2.NgControl, host: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
301
|
-
DisabledDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: DisabledDirective, selector: "[abpDisabled]", inputs: { abpDisabled: "abpDisabled" }, usesOnChanges: true, ngImport: i0 });
|
|
302
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DisabledDirective, decorators: [{
|
|
303
|
-
type: Directive,
|
|
304
|
-
args: [{
|
|
305
|
-
selector: '[abpDisabled]',
|
|
306
|
-
}]
|
|
307
|
-
}], ctorParameters: function () {
|
|
308
|
-
return [{ type: i2.NgControl, decorators: [{
|
|
309
|
-
type: Host
|
|
310
|
-
}] }];
|
|
311
|
-
}, propDecorators: { abpDisabled: [{
|
|
312
|
-
type: Input
|
|
313
|
-
}] } });
|
|
314
|
-
|
|
315
|
-
class ExtensibleFormPropComponent {
|
|
316
|
-
constructor(cdRef, track, configState, groupDirective, injector) {
|
|
317
|
-
this.cdRef = cdRef;
|
|
318
|
-
this.track = track;
|
|
319
|
-
this.configState = configState;
|
|
320
|
-
this.injector = injector;
|
|
321
|
-
this.asterisk = '';
|
|
322
|
-
this.containerClassName = 'mb-3';
|
|
323
|
-
this.options$ = of([]);
|
|
324
|
-
this.validators = [];
|
|
325
|
-
this.passwordKey = "ThemeShared.Extensions.PasswordComponent" /* eThemeSharedComponents.PasswordComponent */;
|
|
326
|
-
this.disabledFn = (data) => false;
|
|
327
|
-
this.search = (text$) => text$
|
|
328
|
-
? text$.pipe(debounceTime(300), distinctUntilChanged(), switchMap(text => { var _a, _b; return ((_b = (_a = this.prop) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.call(_a, this.data, text)) || of([]); }))
|
|
329
|
-
: of([]);
|
|
330
|
-
this.typeaheadFormatter = (option) => option.key;
|
|
331
|
-
this.form = groupDirective.form;
|
|
332
|
-
}
|
|
333
|
-
get disabled() {
|
|
334
|
-
return this.disabledFn(this.data);
|
|
335
|
-
}
|
|
336
|
-
setTypeaheadValue(selectedOption) {
|
|
337
|
-
this.typeaheadModel = selectedOption || { key: null, value: null };
|
|
338
|
-
const { key, value } = this.typeaheadModel;
|
|
339
|
-
const [keyControl, valueControl] = this.getTypeaheadControls();
|
|
340
|
-
if ((valueControl === null || valueControl === void 0 ? void 0 : valueControl.value) && !value)
|
|
341
|
-
valueControl.markAsDirty();
|
|
342
|
-
keyControl === null || keyControl === void 0 ? void 0 : keyControl.setValue(key);
|
|
343
|
-
valueControl === null || valueControl === void 0 ? void 0 : valueControl.setValue(value);
|
|
344
|
-
}
|
|
345
|
-
get meridian() {
|
|
346
|
-
return (this.configState.getDeep('localization.currentCulture.dateTimeFormat.shortTimePattern') || '').includes('tt');
|
|
347
|
-
}
|
|
348
|
-
get isInvalid() {
|
|
349
|
-
const control = this.form.get(this.prop.name);
|
|
350
|
-
return (control === null || control === void 0 ? void 0 : control.touched) && control.invalid;
|
|
351
|
-
}
|
|
352
|
-
getTypeaheadControls() {
|
|
353
|
-
const { name } = this.prop;
|
|
354
|
-
const extraPropName = `${EXTRA_PROPERTIES_KEY}.${name}`;
|
|
355
|
-
const keyControl = this.form.get(addTypeaheadTextSuffix(extraPropName)) ||
|
|
356
|
-
this.form.get(addTypeaheadTextSuffix(name));
|
|
357
|
-
const valueControl = this.form.get(extraPropName) || this.form.get(name);
|
|
358
|
-
return [keyControl, valueControl];
|
|
359
|
-
}
|
|
360
|
-
setAsterisk() {
|
|
361
|
-
this.asterisk = this.validators.some(isRequired) ? '*' : '';
|
|
362
|
-
}
|
|
363
|
-
ngAfterViewInit() {
|
|
364
|
-
if (this.first && this.fieldRef) {
|
|
365
|
-
this.fieldRef.nativeElement.focus();
|
|
366
|
-
this.cdRef.detectChanges();
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
getComponent(prop) {
|
|
370
|
-
if (prop.template) {
|
|
371
|
-
return 'template';
|
|
372
|
-
}
|
|
373
|
-
switch (prop.type) {
|
|
374
|
-
case "boolean" /* ePropType.Boolean */:
|
|
375
|
-
return 'checkbox';
|
|
376
|
-
case "date" /* ePropType.Date */:
|
|
377
|
-
return 'date';
|
|
378
|
-
case "datetime" /* ePropType.DateTime */:
|
|
379
|
-
return 'dateTime';
|
|
380
|
-
case "hidden" /* ePropType.Hidden */:
|
|
381
|
-
return 'hidden';
|
|
382
|
-
case "multiselect" /* ePropType.MultiSelect */:
|
|
383
|
-
return 'multiselect';
|
|
384
|
-
case "text" /* ePropType.Text */:
|
|
385
|
-
return 'textarea';
|
|
386
|
-
case "time" /* ePropType.Time */:
|
|
387
|
-
return 'time';
|
|
388
|
-
case "typeahead" /* ePropType.Typeahead */:
|
|
389
|
-
return 'typeahead';
|
|
390
|
-
case "passwordinputgroup" /* ePropType.PasswordInputGroup */:
|
|
391
|
-
return 'passwordinputgroup';
|
|
392
|
-
default:
|
|
393
|
-
return prop.options ? 'select' : 'input';
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
getType(prop) {
|
|
397
|
-
switch (prop.type) {
|
|
398
|
-
case "date" /* ePropType.Date */:
|
|
399
|
-
case "string" /* ePropType.String */:
|
|
400
|
-
return 'text';
|
|
401
|
-
case "boolean" /* ePropType.Boolean */:
|
|
402
|
-
return 'checkbox';
|
|
403
|
-
case "number" /* ePropType.Number */:
|
|
404
|
-
return 'number';
|
|
405
|
-
case "email" /* ePropType.Email */:
|
|
406
|
-
return 'email';
|
|
407
|
-
case "password" /* ePropType.Password */:
|
|
408
|
-
return 'password';
|
|
409
|
-
case "passwordinputgroup" /* ePropType.PasswordInputGroup */:
|
|
410
|
-
return 'passwordinputgroup';
|
|
411
|
-
default:
|
|
412
|
-
return 'hidden';
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
ngOnChanges({ prop, data }) {
|
|
416
|
-
var _a;
|
|
417
|
-
const currentProp = prop === null || prop === void 0 ? void 0 : prop.currentValue;
|
|
418
|
-
const { options, readonly, disabled, validators, className, template } = currentProp || {};
|
|
419
|
-
if (template) {
|
|
420
|
-
this.injectorForCustomComponent = Injector.create({
|
|
421
|
-
providers: [
|
|
422
|
-
{
|
|
423
|
-
provide: EXTENSIONS_FORM_PROP,
|
|
424
|
-
useValue: currentProp,
|
|
425
|
-
},
|
|
426
|
-
{
|
|
427
|
-
provide: EXTENSIONS_FORM_PROP_DATA,
|
|
428
|
-
useValue: (_a = data === null || data === void 0 ? void 0 : data.currentValue) === null || _a === void 0 ? void 0 : _a.record,
|
|
429
|
-
},
|
|
430
|
-
{ provide: ControlContainer, useExisting: FormGroupDirective },
|
|
431
|
-
],
|
|
432
|
-
parent: this.injector,
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
if (options)
|
|
436
|
-
this.options$ = options(this.data);
|
|
437
|
-
if (readonly)
|
|
438
|
-
this.readonly = readonly(this.data);
|
|
439
|
-
if (disabled) {
|
|
440
|
-
this.disabledFn = disabled;
|
|
441
|
-
}
|
|
442
|
-
if (validators) {
|
|
443
|
-
this.validators = validators(this.data);
|
|
444
|
-
this.setAsterisk();
|
|
445
|
-
}
|
|
446
|
-
if (className !== undefined) {
|
|
447
|
-
this.containerClassName = className;
|
|
448
|
-
}
|
|
449
|
-
const [keyControl, valueControl] = this.getTypeaheadControls();
|
|
450
|
-
if (keyControl && valueControl)
|
|
451
|
-
this.typeaheadModel = { key: keyControl.value, value: valueControl.value };
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
ExtensibleFormPropComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ExtensibleFormPropComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.TrackByService }, { token: i1.ConfigStateService }, { token: i2.FormGroupDirective }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
455
|
-
ExtensibleFormPropComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ExtensibleFormPropComponent, selector: "abp-extensible-form-prop", inputs: { data: "data", prop: "prop", first: "first" }, viewQueries: [{ propertyName: "fieldRef", first: true, predicate: ["field"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container\r\n [ngSwitch]=\"getComponent(prop)\"\r\n *abpPermission=\"prop.permission; runChangeDetection: false\"\r\n>\r\n <ng-template ngSwitchCase=\"template\">\r\n <ng-container *ngComponentOutlet=\"prop.template; injector: injectorForCustomComponent\">\r\n </ng-container>\r\n </ng-template>\r\n\r\n <div [ngClass]=\"containerClassName\" class=\"mb-3\">\r\n <ng-template ngSwitchCase=\"input\">\r\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\r\n <input\r\n #field\r\n [id]=\"prop.id\"\r\n [formControlName]=\"prop.name\"\r\n [autocomplete]=\"prop.autocomplete\"\r\n [type]=\"getType(prop)\"\r\n [abpDisabled]=\"disabled\"\r\n [readonly]=\"readonly\"\r\n class=\"form-control\"\r\n />\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"hidden\">\r\n <input [formControlName]=\"prop.name\" type=\"hidden\" />\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"checkbox\">\r\n <div class=\"form-check\" validationTarget>\r\n <input\r\n #field\r\n [id]=\"prop.id\"\r\n [formControlName]=\"prop.name\"\r\n [abpDisabled]=\"disabled\"\r\n type=\"checkbox\"\r\n class=\"form-check-input\"\r\n />\r\n <ng-template\r\n [ngTemplateOutlet]=\"label\"\r\n [ngTemplateOutletContext]=\"{ $implicit: 'form-check-label' }\"\r\n ></ng-template>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"select\">\r\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\r\n <select\r\n #field\r\n [id]=\"prop.id\"\r\n [formControlName]=\"prop.name\"\r\n [abpDisabled]=\"disabled\"\r\n class=\"form-select form-control\"\r\n >\r\n <option\r\n *ngFor=\"let option of options$ | async; trackBy: track.by('value')\"\r\n [ngValue]=\"option.value\"\r\n >\r\n {{ option.key }}\r\n </option>\r\n </select>\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"multiselect\">\r\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\r\n <select\r\n #field\r\n [id]=\"prop.id\"\r\n [formControlName]=\"prop.name\"\r\n [abpDisabled]=\"disabled\"\r\n multiple=\"multiple\"\r\n class=\"form-select form-control\"\r\n >\r\n <option\r\n *ngFor=\"let option of options$ | async; trackBy: track.by('value')\"\r\n [ngValue]=\"option.value\"\r\n >\r\n {{ option.key }}\r\n </option>\r\n </select>\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"typeahead\">\r\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\r\n <div #typeahead class=\"position-relative\" validationStyle validationTarget>\r\n <input\r\n #field\r\n [id]=\"prop.id\"\r\n [autocomplete]=\"prop.autocomplete\"\r\n [abpDisabled]=\"disabled\"\r\n [ngbTypeahead]=\"search\"\r\n [editable]=\"false\"\r\n [inputFormatter]=\"typeaheadFormatter\"\r\n [resultFormatter]=\"typeaheadFormatter\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n [(ngModel)]=\"typeaheadModel\"\r\n (selectItem)=\"setTypeaheadValue($event.item)\"\r\n (blur)=\"setTypeaheadValue(typeaheadModel)\"\r\n [class.is-invalid]=\"typeahead.classList.contains('is-invalid')\"\r\n class=\"form-control\"\r\n />\r\n <input [formControlName]=\"prop.name\" type=\"hidden\" />\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"date\">\r\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\r\n <input\r\n [id]=\"prop.id\"\r\n [formControlName]=\"prop.name\"\r\n (click)=\"datepicker.open()\"\r\n (keyup.space)=\"datepicker.open()\"\r\n ngbDatepicker\r\n #datepicker=\"ngbDatepicker\"\r\n type=\"text\"\r\n class=\"form-control\"\r\n />\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"time\">\r\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\r\n <ngb-timepicker [formControlName]=\"prop.name\"></ngb-timepicker>\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"dateTime\">\r\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\r\n <abp-date-time-picker [prop]=\"prop\" [meridian]=\"meridian\"></abp-date-time-picker>\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"textarea\">\r\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\r\n <textarea\r\n #field\r\n [id]=\"prop.id\"\r\n [formControlName]=\"prop.name\"\r\n [abpDisabled]=\"disabled\"\r\n [readonly]=\"readonly\"\r\n class=\"form-control\"\r\n ></textarea>\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"passwordinputgroup\">\r\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\r\n <abp-password\r\n *abpReplaceableTemplate=\"{\r\n componentKey: passwordKey,\r\n inputs: {\r\n inputId: { value: prop.id },\r\n formControlName: { value: prop.name }\r\n }\r\n }\"\r\n [inputId]=\"prop.id\"\r\n [formControlName]=\"prop.name\"\r\n ></abp-password>\r\n </ng-template>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-template #label let-classes>\r\n <label [htmlFor]=\"prop.id\" [ngClass]=\"classes || 'form-label'\">\r\n <ng-container *ngIf=\"prop.displayTextResolver; else displayNameTemplate\">\r\n {{ prop.displayTextResolver(data) | abpLocalization }}\r\n </ng-container>\r\n <ng-template #displayNameTemplate> {{ prop.displayName | abpLocalization }}</ng-template>\r\n {{ asterisk }}\r\n </label>\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.PermissionDirective, selector: "[abpPermission]", inputs: ["abpPermission", "abpPermissionRunChangeDetection"] }, { kind: "directive", type: i1.ReplaceableTemplateDirective, selector: "[abpReplaceableTemplate]", inputs: ["abpReplaceableTemplate"] }, { kind: "directive", type: i4.ValidationStyleDirective, selector: "[validationStyle]", exportAs: ["validationStyle"] }, { kind: "directive", type: i4.ValidationTargetDirective, selector: "[validationTarget]", exportAs: ["validationTarget"] }, { kind: "directive", type: i4.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i4$2.PasswordComponent, selector: "abp-password", inputs: ["inputId", "formControlName"] }, { kind: "directive", type: i4$1.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["autoClose", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "popperOptions", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays", "disabled"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { kind: "component", type: i4$1.NgbTimepicker, selector: "ngb-timepicker", inputs: ["meridian", "spinners", "seconds", "hourStep", "minuteStep", "secondStep", "readonlyInputs", "size"], exportAs: ["ngbTimepicker"] }, { kind: "directive", type: i4$1.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "container", "editable", "focusFirst", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate", "showHint", "placement", "popperOptions", "popupClass"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { kind: "component", type: DateTimePickerComponent, selector: "abp-date-time-picker", inputs: ["prop", "meridian"], exportAs: ["abpDateTimePicker"] }, { kind: "directive", type: DisabledDirective, selector: "[abpDisabled]", inputs: ["abpDisabled"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }], viewProviders: [
|
|
456
|
-
{
|
|
457
|
-
provide: ControlContainer,
|
|
458
|
-
useFactory: selfFactory,
|
|
459
|
-
deps: [[new Optional(), new SkipSelf(), ControlContainer]],
|
|
460
|
-
},
|
|
461
|
-
{ provide: NgbDateAdapter, useClass: DateAdapter },
|
|
462
|
-
{ provide: NgbTimeAdapter, useClass: TimeAdapter },
|
|
463
|
-
], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
464
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ExtensibleFormPropComponent, decorators: [{
|
|
465
|
-
type: Component,
|
|
466
|
-
args: [{ selector: 'abp-extensible-form-prop', changeDetection: ChangeDetectionStrategy.OnPush, viewProviders: [
|
|
467
|
-
{
|
|
468
|
-
provide: ControlContainer,
|
|
469
|
-
useFactory: selfFactory,
|
|
470
|
-
deps: [[new Optional(), new SkipSelf(), ControlContainer]],
|
|
471
|
-
},
|
|
472
|
-
{ provide: NgbDateAdapter, useClass: DateAdapter },
|
|
473
|
-
{ provide: NgbTimeAdapter, useClass: TimeAdapter },
|
|
474
|
-
], template: "<ng-container\r\n [ngSwitch]=\"getComponent(prop)\"\r\n *abpPermission=\"prop.permission; runChangeDetection: false\"\r\n>\r\n <ng-template ngSwitchCase=\"template\">\r\n <ng-container *ngComponentOutlet=\"prop.template; injector: injectorForCustomComponent\">\r\n </ng-container>\r\n </ng-template>\r\n\r\n <div [ngClass]=\"containerClassName\" class=\"mb-3\">\r\n <ng-template ngSwitchCase=\"input\">\r\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\r\n <input\r\n #field\r\n [id]=\"prop.id\"\r\n [formControlName]=\"prop.name\"\r\n [autocomplete]=\"prop.autocomplete\"\r\n [type]=\"getType(prop)\"\r\n [abpDisabled]=\"disabled\"\r\n [readonly]=\"readonly\"\r\n class=\"form-control\"\r\n />\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"hidden\">\r\n <input [formControlName]=\"prop.name\" type=\"hidden\" />\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"checkbox\">\r\n <div class=\"form-check\" validationTarget>\r\n <input\r\n #field\r\n [id]=\"prop.id\"\r\n [formControlName]=\"prop.name\"\r\n [abpDisabled]=\"disabled\"\r\n type=\"checkbox\"\r\n class=\"form-check-input\"\r\n />\r\n <ng-template\r\n [ngTemplateOutlet]=\"label\"\r\n [ngTemplateOutletContext]=\"{ $implicit: 'form-check-label' }\"\r\n ></ng-template>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"select\">\r\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\r\n <select\r\n #field\r\n [id]=\"prop.id\"\r\n [formControlName]=\"prop.name\"\r\n [abpDisabled]=\"disabled\"\r\n class=\"form-select form-control\"\r\n >\r\n <option\r\n *ngFor=\"let option of options$ | async; trackBy: track.by('value')\"\r\n [ngValue]=\"option.value\"\r\n >\r\n {{ option.key }}\r\n </option>\r\n </select>\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"multiselect\">\r\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\r\n <select\r\n #field\r\n [id]=\"prop.id\"\r\n [formControlName]=\"prop.name\"\r\n [abpDisabled]=\"disabled\"\r\n multiple=\"multiple\"\r\n class=\"form-select form-control\"\r\n >\r\n <option\r\n *ngFor=\"let option of options$ | async; trackBy: track.by('value')\"\r\n [ngValue]=\"option.value\"\r\n >\r\n {{ option.key }}\r\n </option>\r\n </select>\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"typeahead\">\r\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\r\n <div #typeahead class=\"position-relative\" validationStyle validationTarget>\r\n <input\r\n #field\r\n [id]=\"prop.id\"\r\n [autocomplete]=\"prop.autocomplete\"\r\n [abpDisabled]=\"disabled\"\r\n [ngbTypeahead]=\"search\"\r\n [editable]=\"false\"\r\n [inputFormatter]=\"typeaheadFormatter\"\r\n [resultFormatter]=\"typeaheadFormatter\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n [(ngModel)]=\"typeaheadModel\"\r\n (selectItem)=\"setTypeaheadValue($event.item)\"\r\n (blur)=\"setTypeaheadValue(typeaheadModel)\"\r\n [class.is-invalid]=\"typeahead.classList.contains('is-invalid')\"\r\n class=\"form-control\"\r\n />\r\n <input [formControlName]=\"prop.name\" type=\"hidden\" />\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"date\">\r\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\r\n <input\r\n [id]=\"prop.id\"\r\n [formControlName]=\"prop.name\"\r\n (click)=\"datepicker.open()\"\r\n (keyup.space)=\"datepicker.open()\"\r\n ngbDatepicker\r\n #datepicker=\"ngbDatepicker\"\r\n type=\"text\"\r\n class=\"form-control\"\r\n />\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"time\">\r\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\r\n <ngb-timepicker [formControlName]=\"prop.name\"></ngb-timepicker>\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"dateTime\">\r\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\r\n <abp-date-time-picker [prop]=\"prop\" [meridian]=\"meridian\"></abp-date-time-picker>\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"textarea\">\r\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\r\n <textarea\r\n #field\r\n [id]=\"prop.id\"\r\n [formControlName]=\"prop.name\"\r\n [abpDisabled]=\"disabled\"\r\n [readonly]=\"readonly\"\r\n class=\"form-control\"\r\n ></textarea>\r\n </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"passwordinputgroup\">\r\n <ng-template [ngTemplateOutlet]=\"label\"></ng-template>\r\n <abp-password\r\n *abpReplaceableTemplate=\"{\r\n componentKey: passwordKey,\r\n inputs: {\r\n inputId: { value: prop.id },\r\n formControlName: { value: prop.name }\r\n }\r\n }\"\r\n [inputId]=\"prop.id\"\r\n [formControlName]=\"prop.name\"\r\n ></abp-password>\r\n </ng-template>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-template #label let-classes>\r\n <label [htmlFor]=\"prop.id\" [ngClass]=\"classes || 'form-label'\">\r\n <ng-container *ngIf=\"prop.displayTextResolver; else displayNameTemplate\">\r\n {{ prop.displayTextResolver(data) | abpLocalization }}\r\n </ng-container>\r\n <ng-template #displayNameTemplate> {{ prop.displayName | abpLocalization }}</ng-template>\r\n {{ asterisk }}\r\n </label>\r\n</ng-template>\r\n" }]
|
|
475
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.TrackByService }, { type: i1.ConfigStateService }, { type: i2.FormGroupDirective }, { type: i0.Injector }]; }, propDecorators: { data: [{
|
|
476
|
-
type: Input
|
|
477
|
-
}], prop: [{
|
|
478
|
-
type: Input
|
|
479
|
-
}], first: [{
|
|
480
|
-
type: Input
|
|
481
|
-
}], fieldRef: [{
|
|
482
|
-
type: ViewChild,
|
|
483
|
-
args: ['field']
|
|
484
|
-
}] } });
|
|
485
|
-
function isRequired(validator) {
|
|
486
|
-
return (validator === Validators.required ||
|
|
487
|
-
validator === AbpValidators.required ||
|
|
488
|
-
validator.name === 'required');
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
class PropList extends LinkedList {
|
|
492
|
-
}
|
|
493
|
-
class PropData {
|
|
494
|
-
get data() {
|
|
495
|
-
return {
|
|
496
|
-
getInjected: this.getInjected,
|
|
497
|
-
index: this.index,
|
|
498
|
-
record: this.record,
|
|
499
|
-
};
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
class Prop {
|
|
503
|
-
constructor(type, name, displayName, permission, visible = _ => true, isExtra = false, template, className, displayTextResolver) {
|
|
504
|
-
this.type = type;
|
|
505
|
-
this.name = name;
|
|
506
|
-
this.displayName = displayName;
|
|
507
|
-
this.permission = permission;
|
|
508
|
-
this.visible = visible;
|
|
509
|
-
this.isExtra = isExtra;
|
|
510
|
-
this.template = template;
|
|
511
|
-
this.className = className;
|
|
512
|
-
this.displayTextResolver = displayTextResolver;
|
|
513
|
-
this.displayName = this.displayName || this.name;
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
class PropsFactory {
|
|
517
|
-
constructor() {
|
|
518
|
-
this.contributorCallbacks = {};
|
|
519
|
-
}
|
|
520
|
-
get(name) {
|
|
521
|
-
this.contributorCallbacks[name] = this.contributorCallbacks[name] || [];
|
|
522
|
-
return new this._ctor(this.contributorCallbacks[name]);
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
class Props {
|
|
526
|
-
constructor(callbackList) {
|
|
527
|
-
this.callbackList = callbackList;
|
|
528
|
-
}
|
|
529
|
-
get props() {
|
|
530
|
-
const propList = new this._ctor();
|
|
531
|
-
this.callbackList.forEach(callback => callback(propList));
|
|
532
|
-
return propList;
|
|
533
|
-
}
|
|
534
|
-
addContributor(contributeCallback) {
|
|
535
|
-
this.callbackList.push(contributeCallback);
|
|
536
|
-
}
|
|
537
|
-
clearContributors() {
|
|
538
|
-
while (this.callbackList.length)
|
|
539
|
-
this.callbackList.pop();
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
class FormPropList extends PropList {
|
|
544
|
-
}
|
|
545
|
-
class FormProps extends Props {
|
|
546
|
-
constructor() {
|
|
547
|
-
super(...arguments);
|
|
548
|
-
this._ctor = FormPropList;
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
class GroupedFormPropList {
|
|
552
|
-
constructor() {
|
|
553
|
-
this.items = [];
|
|
554
|
-
}
|
|
555
|
-
addItem(item) {
|
|
556
|
-
var _a;
|
|
557
|
-
const groupName = (_a = item.group) === null || _a === void 0 ? void 0 : _a.name;
|
|
558
|
-
let group = this.items.find(i => { var _a; return ((_a = i.group) === null || _a === void 0 ? void 0 : _a.name) === groupName; });
|
|
559
|
-
if (group) {
|
|
560
|
-
group.formPropList.addTail(item);
|
|
561
|
-
}
|
|
562
|
-
else {
|
|
563
|
-
group = {
|
|
564
|
-
formPropList: new FormPropList(),
|
|
565
|
-
group: item.group,
|
|
566
|
-
};
|
|
567
|
-
group.formPropList.addHead(item);
|
|
568
|
-
this.items.push(group);
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
class CreateFormPropsFactory extends PropsFactory {
|
|
573
|
-
constructor() {
|
|
574
|
-
super(...arguments);
|
|
575
|
-
this._ctor = FormProps;
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
class EditFormPropsFactory extends PropsFactory {
|
|
579
|
-
constructor() {
|
|
580
|
-
super(...arguments);
|
|
581
|
-
this._ctor = FormProps;
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
class FormProp extends Prop {
|
|
585
|
-
constructor(options) {
|
|
586
|
-
super(options.type, options.name, options.displayName || '', options.permission || '', options.visible, options.isExtra, options.template, options.className);
|
|
587
|
-
this.group = options.group;
|
|
588
|
-
this.className = options.className;
|
|
589
|
-
this.asyncValidators = options.asyncValidators || (_ => []);
|
|
590
|
-
this.validators = options.validators || (_ => []);
|
|
591
|
-
this.disabled = options.disabled || (_ => false);
|
|
592
|
-
this.readonly = options.readonly || (_ => false);
|
|
593
|
-
this.autocomplete = options.autocomplete || 'off';
|
|
594
|
-
this.options = options.options;
|
|
595
|
-
this.id = options.id || options.name;
|
|
596
|
-
const defaultValue = options.defaultValue;
|
|
597
|
-
this.defaultValue = isFalsyValue(defaultValue) ? defaultValue : defaultValue || '';
|
|
598
|
-
this.displayTextResolver = options.displayTextResolver;
|
|
599
|
-
}
|
|
600
|
-
static create(options) {
|
|
601
|
-
return new FormProp(options);
|
|
602
|
-
}
|
|
603
|
-
static createMany(arrayOfOptions) {
|
|
604
|
-
return arrayOfOptions.map(FormProp.create);
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
class FormPropData extends PropData {
|
|
608
|
-
constructor(injector, record) {
|
|
609
|
-
super();
|
|
610
|
-
this.record = record;
|
|
611
|
-
this.getInjected = injector.get.bind(injector);
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
function isFalsyValue(defaultValue) {
|
|
615
|
-
return [0, '', false].indexOf(defaultValue) > -1;
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
class ActionList extends LinkedList {
|
|
619
|
-
}
|
|
620
|
-
class ActionData {
|
|
621
|
-
get data() {
|
|
622
|
-
return {
|
|
623
|
-
getInjected: this.getInjected,
|
|
624
|
-
index: this.index,
|
|
625
|
-
record: this.record,
|
|
626
|
-
};
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
class Action {
|
|
630
|
-
constructor(permission, visible = () => true, action = () => { }) {
|
|
631
|
-
this.permission = permission;
|
|
632
|
-
this.visible = visible;
|
|
633
|
-
this.action = action;
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
class ActionsFactory {
|
|
637
|
-
constructor() {
|
|
638
|
-
this.contributorCallbacks = {};
|
|
639
|
-
}
|
|
640
|
-
get(name) {
|
|
641
|
-
this.contributorCallbacks[name] = this.contributorCallbacks[name] || [];
|
|
642
|
-
return new this._ctor(this.contributorCallbacks[name]);
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
class Actions {
|
|
646
|
-
constructor(callbackList) {
|
|
647
|
-
this.callbackList = callbackList;
|
|
648
|
-
}
|
|
649
|
-
get actions() {
|
|
650
|
-
const actionList = new this._ctor();
|
|
651
|
-
this.callbackList.forEach(callback => callback(actionList));
|
|
652
|
-
return actionList;
|
|
653
|
-
}
|
|
654
|
-
addContributor(contributeCallback) {
|
|
655
|
-
this.callbackList.push(contributeCallback);
|
|
656
|
-
}
|
|
657
|
-
clearContributors() {
|
|
658
|
-
while (this.callbackList.length)
|
|
659
|
-
this.callbackList.pop();
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
class EntityActionList extends ActionList {
|
|
664
|
-
}
|
|
665
|
-
class EntityActions extends Actions {
|
|
666
|
-
constructor() {
|
|
667
|
-
super(...arguments);
|
|
668
|
-
this._ctor = EntityActionList;
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
class EntityActionsFactory extends ActionsFactory {
|
|
672
|
-
constructor() {
|
|
673
|
-
super(...arguments);
|
|
674
|
-
this._ctor = EntityActions;
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
class EntityAction extends Action {
|
|
678
|
-
constructor(options) {
|
|
679
|
-
super(options.permission || '', options.visible, options.action);
|
|
680
|
-
this.text = options.text;
|
|
681
|
-
this.icon = options.icon || '';
|
|
682
|
-
}
|
|
683
|
-
static create(options) {
|
|
684
|
-
return new EntityAction(options);
|
|
685
|
-
}
|
|
686
|
-
static createMany(arrayOfOptions) {
|
|
687
|
-
return arrayOfOptions.map(EntityAction.create);
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
class EntityPropList extends PropList {
|
|
692
|
-
}
|
|
693
|
-
class EntityProps extends Props {
|
|
694
|
-
constructor() {
|
|
695
|
-
super(...arguments);
|
|
696
|
-
this._ctor = EntityPropList;
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
class EntityPropsFactory extends PropsFactory {
|
|
700
|
-
constructor() {
|
|
701
|
-
super(...arguments);
|
|
702
|
-
this._ctor = EntityProps;
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
class EntityProp extends Prop {
|
|
706
|
-
constructor(options) {
|
|
707
|
-
super(options.type, options.name, options.displayName || '', options.permission || '', options.visible, options.isExtra);
|
|
708
|
-
this.columnWidth = options.columnWidth;
|
|
709
|
-
this.sortable = options.sortable || false;
|
|
710
|
-
this.valueResolver =
|
|
711
|
-
options.valueResolver ||
|
|
712
|
-
(data => of(escapeHtmlChars(data.record[this.name])));
|
|
713
|
-
if (options.action) {
|
|
714
|
-
this.action = options.action;
|
|
715
|
-
}
|
|
716
|
-
if (options.component) {
|
|
717
|
-
this.component = options.component;
|
|
718
|
-
}
|
|
719
|
-
if (options.enumList) {
|
|
720
|
-
this.enumList = options.enumList;
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
static create(options) {
|
|
724
|
-
return new EntityProp(options);
|
|
725
|
-
}
|
|
726
|
-
static createMany(arrayOfOptions) {
|
|
727
|
-
return arrayOfOptions.map(EntityProp.create);
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
class ToolbarActionList extends ActionList {
|
|
732
|
-
}
|
|
733
|
-
class ToolbarActions extends Actions {
|
|
734
|
-
constructor() {
|
|
735
|
-
super(...arguments);
|
|
736
|
-
this._ctor = ToolbarActionList;
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
class ToolbarActionsFactory extends ActionsFactory {
|
|
740
|
-
constructor() {
|
|
741
|
-
super(...arguments);
|
|
742
|
-
this._ctor = ToolbarActions;
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
class ToolbarAction extends Action {
|
|
746
|
-
constructor(options) {
|
|
747
|
-
super(options.permission || '', options.visible, options.action);
|
|
748
|
-
this.text = options.text;
|
|
749
|
-
this.icon = options.icon || '';
|
|
750
|
-
if (options.btnClass) {
|
|
751
|
-
this.btnClass = options.btnClass;
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
static create(options) {
|
|
755
|
-
return new ToolbarAction(options);
|
|
756
|
-
}
|
|
757
|
-
static createMany(arrayOfOptions) {
|
|
758
|
-
return arrayOfOptions.map(ToolbarAction.create);
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
class ToolbarComponent extends Action {
|
|
762
|
-
constructor(options) {
|
|
763
|
-
super(options.permission || '', options.visible, options.action);
|
|
764
|
-
this.component = options.component;
|
|
765
|
-
}
|
|
766
|
-
static create(options) {
|
|
767
|
-
return new ToolbarComponent(options);
|
|
768
|
-
}
|
|
769
|
-
static createMany(arrayOfOptions) {
|
|
770
|
-
return arrayOfOptions.map(ToolbarComponent.create);
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
class ExtensionsService {
|
|
775
|
-
constructor() {
|
|
776
|
-
this.entityActions = new EntityActionsFactory();
|
|
777
|
-
this.toolbarActions = new ToolbarActionsFactory();
|
|
778
|
-
this.entityProps = new EntityPropsFactory();
|
|
779
|
-
this.createFormProps = new CreateFormPropsFactory();
|
|
780
|
-
this.editFormProps = new EditFormPropsFactory();
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
ExtensionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ExtensionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
784
|
-
ExtensionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ExtensionsService, providedIn: 'root' });
|
|
785
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ExtensionsService, decorators: [{
|
|
786
|
-
type: Injectable,
|
|
787
|
-
args: [{
|
|
788
|
-
providedIn: 'root',
|
|
789
|
-
}]
|
|
790
|
-
}] });
|
|
791
|
-
|
|
792
|
-
/* eslint-disable @angular-eslint/no-input-rename */
|
|
793
|
-
class PropDataDirective extends PropData {
|
|
794
|
-
constructor(tempRef, vcRef, injector) {
|
|
795
|
-
super();
|
|
796
|
-
this.tempRef = tempRef;
|
|
797
|
-
this.vcRef = vcRef;
|
|
798
|
-
this.getInjected = injector.get.bind(injector);
|
|
799
|
-
}
|
|
800
|
-
ngOnChanges() {
|
|
801
|
-
this.vcRef.clear();
|
|
802
|
-
this.vcRef.createEmbeddedView(this.tempRef, {
|
|
803
|
-
$implicit: this.data,
|
|
804
|
-
index: 0,
|
|
805
|
-
});
|
|
806
|
-
}
|
|
807
|
-
ngOnDestroy() {
|
|
808
|
-
this.vcRef.clear();
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
PropDataDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PropDataDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
812
|
-
PropDataDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: PropDataDirective, selector: "[abpPropData]", inputs: { propList: ["abpPropDataFromList", "propList"], record: ["abpPropDataWithRecord", "record"], index: ["abpPropDataAtIndex", "index"] }, exportAs: ["abpPropData"], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
813
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PropDataDirective, decorators: [{
|
|
814
|
-
type: Directive,
|
|
815
|
-
args: [{
|
|
816
|
-
exportAs: 'abpPropData',
|
|
817
|
-
selector: '[abpPropData]',
|
|
818
|
-
}]
|
|
819
|
-
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i0.Injector }]; }, propDecorators: { propList: [{
|
|
820
|
-
type: Input,
|
|
821
|
-
args: ['abpPropDataFromList']
|
|
822
|
-
}], record: [{
|
|
823
|
-
type: Input,
|
|
824
|
-
args: ['abpPropDataWithRecord']
|
|
825
|
-
}], index: [{
|
|
826
|
-
type: Input,
|
|
827
|
-
args: ['abpPropDataAtIndex']
|
|
828
|
-
}] } });
|
|
829
|
-
|
|
830
|
-
class ExtensibleFormComponent {
|
|
831
|
-
constructor(cdRef, track, container, extensions, identifier) {
|
|
832
|
-
this.cdRef = cdRef;
|
|
833
|
-
this.track = track;
|
|
834
|
-
this.container = container;
|
|
835
|
-
this.extensions = extensions;
|
|
836
|
-
this.identifier = identifier;
|
|
837
|
-
this.extraPropertiesKey = EXTRA_PROPERTIES_KEY;
|
|
838
|
-
}
|
|
839
|
-
set selectedRecord(record) {
|
|
840
|
-
const type = !record || JSON.stringify(record) === '{}' ? 'create' : 'edit';
|
|
841
|
-
const propList = this.extensions[`${type}FormProps`].get(this.identifier).props;
|
|
842
|
-
this.groupedPropList = this.createGroupedList(propList);
|
|
843
|
-
this.record = record;
|
|
844
|
-
}
|
|
845
|
-
createGroupedList(propList) {
|
|
846
|
-
const groupedFormPropList = new GroupedFormPropList();
|
|
847
|
-
propList.forEach(item => {
|
|
848
|
-
groupedFormPropList.addItem(item.value);
|
|
849
|
-
});
|
|
850
|
-
return groupedFormPropList;
|
|
851
|
-
}
|
|
852
|
-
get form() {
|
|
853
|
-
return (this.container ? this.container.control : { controls: {} });
|
|
854
|
-
}
|
|
855
|
-
get extraProperties() {
|
|
856
|
-
return (this.form.controls.extraProperties || { controls: {} });
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
ExtensibleFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ExtensibleFormComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.TrackByService }, { token: i2.ControlContainer }, { token: ExtensionsService }, { token: EXTENSIONS_IDENTIFIER }], target: i0.ɵɵFactoryTarget.Component });
|
|
860
|
-
ExtensibleFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ExtensibleFormComponent, selector: "abp-extensible-form", inputs: { selectedRecord: "selectedRecord" }, viewQueries: [{ propertyName: "formProps", predicate: ExtensibleFormPropComponent, descendants: true }], exportAs: ["abpExtensibleForm"], ngImport: i0, template: "<ng-container *ngIf=\"form\">\r\n\r\n <ng-container *ngFor=\"let groupedProp of groupedPropList.items\">\r\n <ng-container *abpPropData=\"let data; fromList: groupedProp.formPropList; withRecord: record\">\r\n\r\n <div *ngIf=\"groupedProp.group?.className; else withoutClassName\"\r\n [class]=\"groupedProp.group?.className\" [attr.data-name]=\"groupedProp.group?.className\">\r\n <ng-container [ngTemplateOutlet]=\"propListTemplate\" [ngTemplateOutletContext]=\"{groupedProp:groupedProp,data:data}\">\r\n </ng-container>\r\n </div>\r\n\r\n <ng-template #withoutClassName>\r\n <ng-container [ngTemplateOutlet]=\"propListTemplate\" [ngTemplateOutletContext]=\"{groupedProp:groupedProp,data:data}\">\r\n </ng-container>\r\n </ng-template>\r\n </ng-container>\r\n\r\n </ng-container>\r\n</ng-container>\r\n\r\n\r\n<ng-template let-groupedProp=\"groupedProp\" let-data=\"data\" #propListTemplate>\r\n <ng-container *ngFor=\"let prop of groupedProp.formPropList; let first = first; trackBy: track.by('name')\">\r\n <ng-container *ngIf=\"prop.visible(data)\">\r\n <ng-container\r\n [formGroupName]=\"extraPropertiesKey\"\r\n *ngIf=\"extraProperties.controls[prop.name]; else tempDefault\"\r\n >\r\n <abp-extensible-form-prop [prop]=\"prop\" [data]=\"data\"\r\n [class]=\"prop.className\">\r\n </abp-extensible-form-prop>\r\n </ng-container>\r\n\r\n <ng-template #tempDefault>\r\n <abp-extensible-form-prop\r\n [class]=\"prop.className\"\r\n *ngIf=\"form.get(prop.name)\"\r\n [prop]=\"prop\"\r\n [data]=\"data\"\r\n [first]=\"first\"\r\n ></abp-extensible-form-prop>\r\n </ng-template>\r\n </ng-container>\r\n </ng-container>\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i4.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: ExtensibleFormPropComponent, selector: "abp-extensible-form-prop", inputs: ["data", "prop", "first"] }, { kind: "directive", type: PropDataDirective, selector: "[abpPropData]", inputs: ["abpPropDataFromList", "abpPropDataWithRecord", "abpPropDataAtIndex"], exportAs: ["abpPropData"] }], viewProviders: [
|
|
861
|
-
{
|
|
862
|
-
provide: ControlContainer,
|
|
863
|
-
useFactory: selfFactory,
|
|
864
|
-
deps: [[new Optional(), new SkipSelf(), ControlContainer]],
|
|
865
|
-
},
|
|
866
|
-
], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
867
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ExtensibleFormComponent, decorators: [{
|
|
868
|
-
type: Component,
|
|
869
|
-
args: [{ exportAs: 'abpExtensibleForm', selector: 'abp-extensible-form', changeDetection: ChangeDetectionStrategy.OnPush, viewProviders: [
|
|
870
|
-
{
|
|
871
|
-
provide: ControlContainer,
|
|
872
|
-
useFactory: selfFactory,
|
|
873
|
-
deps: [[new Optional(), new SkipSelf(), ControlContainer]],
|
|
874
|
-
},
|
|
875
|
-
], template: "<ng-container *ngIf=\"form\">\r\n\r\n <ng-container *ngFor=\"let groupedProp of groupedPropList.items\">\r\n <ng-container *abpPropData=\"let data; fromList: groupedProp.formPropList; withRecord: record\">\r\n\r\n <div *ngIf=\"groupedProp.group?.className; else withoutClassName\"\r\n [class]=\"groupedProp.group?.className\" [attr.data-name]=\"groupedProp.group?.className\">\r\n <ng-container [ngTemplateOutlet]=\"propListTemplate\" [ngTemplateOutletContext]=\"{groupedProp:groupedProp,data:data}\">\r\n </ng-container>\r\n </div>\r\n\r\n <ng-template #withoutClassName>\r\n <ng-container [ngTemplateOutlet]=\"propListTemplate\" [ngTemplateOutletContext]=\"{groupedProp:groupedProp,data:data}\">\r\n </ng-container>\r\n </ng-template>\r\n </ng-container>\r\n\r\n </ng-container>\r\n</ng-container>\r\n\r\n\r\n<ng-template let-groupedProp=\"groupedProp\" let-data=\"data\" #propListTemplate>\r\n <ng-container *ngFor=\"let prop of groupedProp.formPropList; let first = first; trackBy: track.by('name')\">\r\n <ng-container *ngIf=\"prop.visible(data)\">\r\n <ng-container\r\n [formGroupName]=\"extraPropertiesKey\"\r\n *ngIf=\"extraProperties.controls[prop.name]; else tempDefault\"\r\n >\r\n <abp-extensible-form-prop [prop]=\"prop\" [data]=\"data\"\r\n [class]=\"prop.className\">\r\n </abp-extensible-form-prop>\r\n </ng-container>\r\n\r\n <ng-template #tempDefault>\r\n <abp-extensible-form-prop\r\n [class]=\"prop.className\"\r\n *ngIf=\"form.get(prop.name)\"\r\n [prop]=\"prop\"\r\n [data]=\"data\"\r\n [first]=\"first\"\r\n ></abp-extensible-form-prop>\r\n </ng-template>\r\n </ng-container>\r\n </ng-container>\r\n</ng-template>\r\n" }]
|
|
876
|
-
}], ctorParameters: function () {
|
|
877
|
-
return [{ type: i0.ChangeDetectorRef }, { type: i1.TrackByService }, { type: i2.ControlContainer }, { type: ExtensionsService }, { type: undefined, decorators: [{
|
|
878
|
-
type: Inject,
|
|
879
|
-
args: [EXTENSIONS_IDENTIFIER]
|
|
880
|
-
}] }];
|
|
881
|
-
}, propDecorators: { formProps: [{
|
|
882
|
-
type: ViewChildren,
|
|
883
|
-
args: [ExtensibleFormPropComponent]
|
|
884
|
-
}], selectedRecord: [{
|
|
885
|
-
type: Input
|
|
886
|
-
}] } });
|
|
887
|
-
|
|
888
|
-
// Fix for https://github.com/angular/angular/issues/23904
|
|
889
|
-
// @dynamic
|
|
890
|
-
class AbstractActionsComponent extends ActionData {
|
|
891
|
-
constructor(injector) {
|
|
892
|
-
super();
|
|
893
|
-
this.getInjected = injector.get.bind(injector);
|
|
894
|
-
const extensions = injector.get(ExtensionsService);
|
|
895
|
-
const name = injector.get(EXTENSIONS_IDENTIFIER);
|
|
896
|
-
const type = injector.get(EXTENSIONS_ACTION_TYPE);
|
|
897
|
-
this.actionList = extensions[type].get(name).actions;
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
AbstractActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AbstractActionsComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
901
|
-
AbstractActionsComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: AbstractActionsComponent, inputs: { record: "record" }, usesInheritance: true, ngImport: i0 });
|
|
902
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AbstractActionsComponent, decorators: [{
|
|
903
|
-
type: Directive
|
|
904
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { record: [{
|
|
905
|
-
type: Input
|
|
906
|
-
}] } });
|
|
907
|
-
|
|
908
|
-
class GridActionsComponent extends AbstractActionsComponent {
|
|
909
|
-
constructor(injector) {
|
|
910
|
-
super(injector);
|
|
911
|
-
this.icon = 'fa fa-cog';
|
|
912
|
-
this.text = '';
|
|
913
|
-
this.trackByFn = (_, item) => item.text;
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
GridActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: GridActionsComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
917
|
-
GridActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: GridActionsComponent, selector: "abp-grid-actions", inputs: { icon: "icon", index: "index", text: "text" }, providers: [
|
|
918
|
-
{
|
|
919
|
-
provide: EXTENSIONS_ACTION_TYPE,
|
|
920
|
-
useValue: 'entityActions',
|
|
921
|
-
},
|
|
922
|
-
], exportAs: ["abpGridActions"], usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"actionList.length > 1\" ngbDropdown container=\"body\" class=\"d-inline-block\">\r\n <button\r\n class=\"btn btn-primary btn-sm dropdown-toggle\"\r\n data-toggle=\"dropdown\"\r\n aria-haspopup=\"true\"\r\n ngbDropdownToggle\r\n >\r\n <i [ngClass]=\"icon\" [class.me-1]=\"icon\"></i>{{ text | abpLocalization }}\r\n </button>\r\n <div ngbDropdownMenu>\r\n <ng-container\r\n *ngFor=\"let action of actionList; trackBy: trackByFn\"\r\n [ngTemplateOutlet]=\"dropDownBtnItemTmp\"\r\n [ngTemplateOutletContext]=\"{ $implicit: action }\"\r\n >\r\n </ng-container>\r\n </div>\r\n</div>\r\n\r\n<ng-container\r\n *ngIf=\"actionList.length === 1\"\r\n [ngTemplateOutlet]=\"btnTmp\"\r\n [ngTemplateOutletContext]=\"{ $implicit: actionList.get(0).value }\"\r\n></ng-container>\r\n\r\n<ng-template #dropDownBtnItemTmp let-action>\r\n <ng-container *ngIf=\"action.visible(data)\">\r\n <button\r\n ngbDropdownItem\r\n *abpPermission=\"action.permission; runChangeDetection: false\"\r\n (click)=\"action.action(data)\"\r\n type=\"button\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"buttonContentTmp; context: { $implicit: action }\"\r\n ></ng-container>\r\n </button>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #buttonContentTmp let-action>\r\n <i [ngClass]=\"action.icon\" [class.me-1]=\"action.icon\"></i>\r\n <span *ngIf=\"action.icon; else ellipsis\">{{ action.text | abpLocalization }}</span>\r\n <ng-template #ellipsis>\r\n <div abpEllipsis>{{ action.text | abpLocalization }}</div>\r\n </ng-template>\r\n</ng-template>\r\n\r\n<ng-template #btnTmp let-action>\r\n <ng-container *ngIf=\"action.visible(data)\">\r\n <button\r\n *abpPermission=\"action.permission; runChangeDetection: false\"\r\n (click)=\"action.action(data)\"\r\n type=\"button\"\r\n class=\"btn btn-primary text-center\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"buttonContentTmp; context: { $implicit: action }\"\r\n ></ng-container>\r\n </button>\r\n </ng-container>\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.PermissionDirective, selector: "[abpPermission]", inputs: ["abpPermission", "abpPermissionRunChangeDetection"] }, { kind: "directive", type: i4$2.EllipsisDirective, selector: "[abpEllipsis]", inputs: ["abpEllipsis", "title", "abpEllipsisEnabled"] }, { kind: "directive", type: i4$1.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i4$1.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i4$1.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i4$1.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["disabled"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
923
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: GridActionsComponent, decorators: [{
|
|
924
|
-
type: Component,
|
|
925
|
-
args: [{ exportAs: 'abpGridActions', selector: 'abp-grid-actions', providers: [
|
|
926
|
-
{
|
|
927
|
-
provide: EXTENSIONS_ACTION_TYPE,
|
|
928
|
-
useValue: 'entityActions',
|
|
929
|
-
},
|
|
930
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"actionList.length > 1\" ngbDropdown container=\"body\" class=\"d-inline-block\">\r\n <button\r\n class=\"btn btn-primary btn-sm dropdown-toggle\"\r\n data-toggle=\"dropdown\"\r\n aria-haspopup=\"true\"\r\n ngbDropdownToggle\r\n >\r\n <i [ngClass]=\"icon\" [class.me-1]=\"icon\"></i>{{ text | abpLocalization }}\r\n </button>\r\n <div ngbDropdownMenu>\r\n <ng-container\r\n *ngFor=\"let action of actionList; trackBy: trackByFn\"\r\n [ngTemplateOutlet]=\"dropDownBtnItemTmp\"\r\n [ngTemplateOutletContext]=\"{ $implicit: action }\"\r\n >\r\n </ng-container>\r\n </div>\r\n</div>\r\n\r\n<ng-container\r\n *ngIf=\"actionList.length === 1\"\r\n [ngTemplateOutlet]=\"btnTmp\"\r\n [ngTemplateOutletContext]=\"{ $implicit: actionList.get(0).value }\"\r\n></ng-container>\r\n\r\n<ng-template #dropDownBtnItemTmp let-action>\r\n <ng-container *ngIf=\"action.visible(data)\">\r\n <button\r\n ngbDropdownItem\r\n *abpPermission=\"action.permission; runChangeDetection: false\"\r\n (click)=\"action.action(data)\"\r\n type=\"button\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"buttonContentTmp; context: { $implicit: action }\"\r\n ></ng-container>\r\n </button>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #buttonContentTmp let-action>\r\n <i [ngClass]=\"action.icon\" [class.me-1]=\"action.icon\"></i>\r\n <span *ngIf=\"action.icon; else ellipsis\">{{ action.text | abpLocalization }}</span>\r\n <ng-template #ellipsis>\r\n <div abpEllipsis>{{ action.text | abpLocalization }}</div>\r\n </ng-template>\r\n</ng-template>\r\n\r\n<ng-template #btnTmp let-action>\r\n <ng-container *ngIf=\"action.visible(data)\">\r\n <button\r\n *abpPermission=\"action.permission; runChangeDetection: false\"\r\n (click)=\"action.action(data)\"\r\n type=\"button\"\r\n class=\"btn btn-primary text-center\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"buttonContentTmp; context: { $implicit: action }\"\r\n ></ng-container>\r\n </button>\r\n </ng-container>\r\n</ng-template>\r\n" }]
|
|
931
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { icon: [{
|
|
932
|
-
type: Input
|
|
933
|
-
}], index: [{
|
|
934
|
-
type: Input
|
|
935
|
-
}], text: [{
|
|
936
|
-
type: Input
|
|
937
|
-
}] } });
|
|
938
|
-
|
|
939
|
-
const DEFAULT_ACTIONS_COLUMN_WIDTH = 150;
|
|
940
|
-
class ExtensibleTableComponent {
|
|
941
|
-
constructor(locale, config, injector) {
|
|
942
|
-
this.locale = locale;
|
|
943
|
-
this.config = config;
|
|
944
|
-
this.injector = injector;
|
|
945
|
-
this.tableActivate = new EventEmitter();
|
|
946
|
-
this.trackByFn = (_, item) => item.name;
|
|
947
|
-
this.entityPropTypeClasses = injector.get(ENTITY_PROP_TYPE_CLASSES);
|
|
948
|
-
this.getInjected = injector.get.bind(injector);
|
|
949
|
-
const extensions = injector.get(ExtensionsService);
|
|
950
|
-
const name = injector.get(EXTENSIONS_IDENTIFIER);
|
|
951
|
-
this.propList = extensions.entityProps.get(name).props;
|
|
952
|
-
this.actionList = extensions['entityActions'].get(name)
|
|
953
|
-
.actions;
|
|
954
|
-
const permissionService = injector.get(PermissionService);
|
|
955
|
-
this.hasAtLeastOnePermittedAction =
|
|
956
|
-
permissionService.filterItemsByPolicy(this.actionList.toArray().map(action => ({ requiredPolicy: action.permission }))).length > 0;
|
|
957
|
-
this.setColumnWidths(DEFAULT_ACTIONS_COLUMN_WIDTH);
|
|
958
|
-
}
|
|
959
|
-
set actionsText(value) {
|
|
960
|
-
this._actionsText = value;
|
|
961
|
-
}
|
|
962
|
-
get actionsText() {
|
|
963
|
-
var _a;
|
|
964
|
-
return (_a = this._actionsText) !== null && _a !== void 0 ? _a : (this.actionList.length > 1 ? 'AbpUi::Actions' : '');
|
|
965
|
-
}
|
|
966
|
-
set actionsColumnWidth(width) {
|
|
967
|
-
this.setColumnWidths(width ? Number(width) : undefined);
|
|
968
|
-
}
|
|
969
|
-
setColumnWidths(actionsColumn) {
|
|
970
|
-
const widths = [actionsColumn];
|
|
971
|
-
this.propList.forEach(({ value: prop }) => {
|
|
972
|
-
widths.push(prop.columnWidth);
|
|
973
|
-
});
|
|
974
|
-
this.columnWidths = widths;
|
|
975
|
-
}
|
|
976
|
-
getDate(value, format) {
|
|
977
|
-
return value && format ? formatDate(value, format, this.locale) : '';
|
|
978
|
-
}
|
|
979
|
-
getIcon(value) {
|
|
980
|
-
return value
|
|
981
|
-
? '<div class="text-success"><i class="fa fa-check"></i></div>'
|
|
982
|
-
: '<div class="text-danger"><i class="fa fa-times"></i></div>';
|
|
983
|
-
}
|
|
984
|
-
getEnum(rowValue, list) {
|
|
985
|
-
if (!list)
|
|
986
|
-
return rowValue;
|
|
987
|
-
const { key } = list.find(({ value }) => value === rowValue) || {};
|
|
988
|
-
return key;
|
|
989
|
-
}
|
|
990
|
-
getContent(prop, data) {
|
|
991
|
-
return prop.valueResolver(data).pipe(map(value => {
|
|
992
|
-
switch (prop.type) {
|
|
993
|
-
case "boolean" /* ePropType.Boolean */:
|
|
994
|
-
return this.getIcon(value);
|
|
995
|
-
case "date" /* ePropType.Date */:
|
|
996
|
-
return this.getDate(value, getShortDateFormat(this.config));
|
|
997
|
-
case "time" /* ePropType.Time */:
|
|
998
|
-
return this.getDate(value, getShortTimeFormat(this.config));
|
|
999
|
-
case "datetime" /* ePropType.DateTime */:
|
|
1000
|
-
return this.getDate(value, getShortDateShortTimeFormat(this.config));
|
|
1001
|
-
case "enum" /* ePropType.Enum */:
|
|
1002
|
-
return this.getEnum(value, prop.enumList || []);
|
|
1003
|
-
default:
|
|
1004
|
-
return value;
|
|
1005
|
-
// More types can be handled in the future
|
|
1006
|
-
}
|
|
1007
|
-
}));
|
|
1008
|
-
}
|
|
1009
|
-
ngOnChanges({ data }) {
|
|
1010
|
-
if (!(data === null || data === void 0 ? void 0 : data.currentValue))
|
|
1011
|
-
return;
|
|
1012
|
-
this.data = data.currentValue.map((record, index) => {
|
|
1013
|
-
this.propList.forEach(prop => {
|
|
1014
|
-
const propData = { getInjected: this.getInjected, record, index };
|
|
1015
|
-
const value = this.getContent(prop.value, propData);
|
|
1016
|
-
const propKey = `_${prop.value.name}`;
|
|
1017
|
-
record[propKey] = {
|
|
1018
|
-
visible: prop.value.visible(propData),
|
|
1019
|
-
value,
|
|
1020
|
-
};
|
|
1021
|
-
if (prop.value.component) {
|
|
1022
|
-
const injector = Injector.create({
|
|
1023
|
-
providers: [
|
|
1024
|
-
{
|
|
1025
|
-
provide: PROP_DATA_STREAM,
|
|
1026
|
-
useValue: value,
|
|
1027
|
-
},
|
|
1028
|
-
],
|
|
1029
|
-
parent: this.injector,
|
|
1030
|
-
});
|
|
1031
|
-
record[propKey].injector = injector;
|
|
1032
|
-
record[propKey].component = prop.value.component;
|
|
1033
|
-
}
|
|
1034
|
-
});
|
|
1035
|
-
return record;
|
|
1036
|
-
});
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
ExtensibleTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ExtensibleTableComponent, deps: [{ token: LOCALE_ID }, { token: i1.ConfigStateService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
1040
|
-
ExtensibleTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ExtensibleTableComponent, selector: "abp-extensible-table", inputs: { actionsText: "actionsText", data: "data", list: "list", recordsTotal: "recordsTotal", actionsColumnWidth: "actionsColumnWidth", actionsTemplate: "actionsTemplate" }, outputs: { tableActivate: "tableActivate" }, exportAs: ["abpExtensibleTable"], usesOnChanges: true, ngImport: i0, template: "<ngx-datatable\r\n default\r\n [rows]=\"data\"\r\n [count]=\"recordsTotal\"\r\n [list]=\"list\"\r\n (activate)=\"tableActivate.emit($event)\"\r\n>\r\n <ngx-datatable-column\r\n *ngIf=\"actionsTemplate || (actionList.length && hasAtLeastOnePermittedAction)\"\r\n [name]=\"actionsText | abpLocalization\"\r\n [maxWidth]=\"columnWidths[0]\"\r\n [width]=\"columnWidths[0]\"\r\n [sortable]=\"false\"\r\n >\r\n <ng-template let-row=\"row\" let-i=\"rowIndex\" ngx-datatable-cell-template>\r\n <ng-container\r\n *ngTemplateOutlet=\"actionsTemplate || gridActions; context: { $implicit: row, index: i }\"\r\n ></ng-container>\r\n <ng-template #gridActions>\r\n <abp-grid-actions [index]=\"i\" [record]=\"row\" text=\"AbpUi::Actions\"></abp-grid-actions>\r\n </ng-template>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ng-container *ngFor=\"let prop of propList; let i = index; trackBy: trackByFn\">\r\n <ngx-datatable-column\r\n [width]=\"columnWidths[i + 1] || 200\"\r\n [name]=\"prop.displayName | abpLocalization\"\r\n [prop]=\"prop.name\"\r\n [sortable]=\"prop.sortable\"\r\n >\r\n <ng-template let-row=\"row\" let-i=\"index\" ngx-datatable-cell-template>\r\n <ng-container *abpPermission=\"prop.permission; runChangeDetection: false\">\r\n <ng-container *ngIf=\"row['_' + prop.name]?.visible\">\r\n <div\r\n *ngIf=\"!row['_' + prop.name].component; else component\"\r\n [innerHTML]=\"row['_' + prop.name]?.value | async\"\r\n (click)=\"\r\n prop.action && prop.action({ getInjected: getInjected, record: row, index: i })\r\n \"\r\n [ngClass]=\"entityPropTypeClasses[prop.type]\"\r\n [class.pointer]=\"prop.action\"\r\n ></div>\r\n </ng-container>\r\n <ng-template #component>\r\n <ng-container\r\n *ngComponentOutlet=\"\r\n row['_' + prop.name].component;\r\n injector: row['_' + prop.name].injector\r\n \"\r\n ></ng-container>\r\n </ng-template>\r\n </ng-container>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n </ng-container>\r\n</ngx-datatable>\r\n", dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.PermissionDirective, selector: "[abpPermission]", inputs: ["abpPermission", "abpPermissionRunChangeDetection"] }, { kind: "component", type: i3$1.DatatableComponent, selector: "ngx-datatable", inputs: ["targetMarkerTemplate", "rows", "groupRowsBy", "groupedRows", "columns", "selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "limit", "count", "offset", "loadingIndicator", "selectionType", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "rowClass", "selectCheck", "displayCheck", "groupExpansionDefault", "trackByProp", "selectAllRowsOnPage", "virtualization", "treeFromRelation", "treeToRelation", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { kind: "directive", type: i3$1.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { kind: "directive", type: i3$1.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { kind: "directive", type: i4$2.NgxDatatableDefaultDirective, selector: "ngx-datatable[default]", inputs: ["class"], exportAs: ["ngxDatatableDefault"] }, { kind: "directive", type: i4$2.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { kind: "component", type: GridActionsComponent, selector: "abp-grid-actions", inputs: ["icon", "index", "text"], exportAs: ["abpGridActions"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1041
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ExtensibleTableComponent, decorators: [{
|
|
1042
|
-
type: Component,
|
|
1043
|
-
args: [{ exportAs: 'abpExtensibleTable', selector: 'abp-extensible-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ngx-datatable\r\n default\r\n [rows]=\"data\"\r\n [count]=\"recordsTotal\"\r\n [list]=\"list\"\r\n (activate)=\"tableActivate.emit($event)\"\r\n>\r\n <ngx-datatable-column\r\n *ngIf=\"actionsTemplate || (actionList.length && hasAtLeastOnePermittedAction)\"\r\n [name]=\"actionsText | abpLocalization\"\r\n [maxWidth]=\"columnWidths[0]\"\r\n [width]=\"columnWidths[0]\"\r\n [sortable]=\"false\"\r\n >\r\n <ng-template let-row=\"row\" let-i=\"rowIndex\" ngx-datatable-cell-template>\r\n <ng-container\r\n *ngTemplateOutlet=\"actionsTemplate || gridActions; context: { $implicit: row, index: i }\"\r\n ></ng-container>\r\n <ng-template #gridActions>\r\n <abp-grid-actions [index]=\"i\" [record]=\"row\" text=\"AbpUi::Actions\"></abp-grid-actions>\r\n </ng-template>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ng-container *ngFor=\"let prop of propList; let i = index; trackBy: trackByFn\">\r\n <ngx-datatable-column\r\n [width]=\"columnWidths[i + 1] || 200\"\r\n [name]=\"prop.displayName | abpLocalization\"\r\n [prop]=\"prop.name\"\r\n [sortable]=\"prop.sortable\"\r\n >\r\n <ng-template let-row=\"row\" let-i=\"index\" ngx-datatable-cell-template>\r\n <ng-container *abpPermission=\"prop.permission; runChangeDetection: false\">\r\n <ng-container *ngIf=\"row['_' + prop.name]?.visible\">\r\n <div\r\n *ngIf=\"!row['_' + prop.name].component; else component\"\r\n [innerHTML]=\"row['_' + prop.name]?.value | async\"\r\n (click)=\"\r\n prop.action && prop.action({ getInjected: getInjected, record: row, index: i })\r\n \"\r\n [ngClass]=\"entityPropTypeClasses[prop.type]\"\r\n [class.pointer]=\"prop.action\"\r\n ></div>\r\n </ng-container>\r\n <ng-template #component>\r\n <ng-container\r\n *ngComponentOutlet=\"\r\n row['_' + prop.name].component;\r\n injector: row['_' + prop.name].injector\r\n \"\r\n ></ng-container>\r\n </ng-template>\r\n </ng-container>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n </ng-container>\r\n</ngx-datatable>\r\n" }]
|
|
1044
|
-
}], ctorParameters: function () {
|
|
1045
|
-
return [{ type: undefined, decorators: [{
|
|
1046
|
-
type: Inject,
|
|
1047
|
-
args: [LOCALE_ID]
|
|
1048
|
-
}] }, { type: i1.ConfigStateService }, { type: i0.Injector }];
|
|
1049
|
-
}, propDecorators: { actionsText: [{
|
|
1050
|
-
type: Input
|
|
1051
|
-
}], data: [{
|
|
1052
|
-
type: Input
|
|
1053
|
-
}], list: [{
|
|
1054
|
-
type: Input
|
|
1055
|
-
}], recordsTotal: [{
|
|
1056
|
-
type: Input
|
|
1057
|
-
}], actionsColumnWidth: [{
|
|
1058
|
-
type: Input
|
|
1059
|
-
}], actionsTemplate: [{
|
|
1060
|
-
type: Input
|
|
1061
|
-
}], tableActivate: [{
|
|
1062
|
-
type: Output
|
|
1063
|
-
}] } });
|
|
1064
|
-
|
|
1065
|
-
class CreateInjectorPipe {
|
|
1066
|
-
transform(_, action, context) {
|
|
1067
|
-
const get = (token, notFoundValue, options) => {
|
|
1068
|
-
const componentData = context.getData();
|
|
1069
|
-
const componentDataCallback = (data) => {
|
|
1070
|
-
data = data !== null && data !== void 0 ? data : context.getData();
|
|
1071
|
-
return action.action(data);
|
|
1072
|
-
};
|
|
1073
|
-
let extensionData;
|
|
1074
|
-
switch (token) {
|
|
1075
|
-
case EXTENSIONS_ACTION_DATA:
|
|
1076
|
-
extensionData = componentData;
|
|
1077
|
-
break;
|
|
1078
|
-
case EXTENSIONS_ACTION_CALLBACK:
|
|
1079
|
-
extensionData = componentDataCallback;
|
|
1080
|
-
break;
|
|
1081
|
-
default:
|
|
1082
|
-
extensionData = context.getInjected.call(context.injector, token, notFoundValue, options);
|
|
1083
|
-
}
|
|
1084
|
-
return extensionData;
|
|
1085
|
-
};
|
|
1086
|
-
return { get };
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
CreateInjectorPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: CreateInjectorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1090
|
-
CreateInjectorPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: CreateInjectorPipe, name: "createInjector" });
|
|
1091
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: CreateInjectorPipe, decorators: [{
|
|
1092
|
-
type: Pipe,
|
|
1093
|
-
args: [{
|
|
1094
|
-
name: 'createInjector',
|
|
1095
|
-
}]
|
|
1096
|
-
}] });
|
|
1097
|
-
|
|
1098
|
-
class PageToolbarComponent extends AbstractActionsComponent {
|
|
1099
|
-
constructor(injector) {
|
|
1100
|
-
super(injector);
|
|
1101
|
-
this.injector = injector;
|
|
1102
|
-
this.defaultBtnClass = 'btn btn-sm btn-primary';
|
|
1103
|
-
this.getData = () => this.data;
|
|
1104
|
-
this.trackByFn = (_, item) => item.action || item.component;
|
|
1105
|
-
}
|
|
1106
|
-
asToolbarAction(value) {
|
|
1107
|
-
return {
|
|
1108
|
-
value: value,
|
|
1109
|
-
};
|
|
1110
|
-
}
|
|
1111
|
-
}
|
|
1112
|
-
PageToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PageToolbarComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
1113
|
-
PageToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: PageToolbarComponent, selector: "abp-page-toolbar", providers: [
|
|
1114
|
-
{
|
|
1115
|
-
provide: EXTENSIONS_ACTION_TYPE,
|
|
1116
|
-
useValue: 'toolbarActions',
|
|
1117
|
-
},
|
|
1118
|
-
], exportAs: ["abpPageToolbar"], usesInheritance: true, ngImport: i0, template: "<div class=\"row justify-content-end mx-0 gap-2\" id=\"AbpContentToolbar\">\r\n <div\r\n class=\"col-auto px-0 pt-0 \"\r\n [class.pe-0]=\"last\"\r\n *ngFor=\"let action of actionList; trackBy: trackByFn; let last = last\"\r\n >\r\n <ng-container *ngIf=\"action.visible(data)\">\r\n <ng-container *abpPermission=\"action.permission;runChangeDetection: false\">\r\n <ng-container *ngIf=\"action.component as component; else button\">\r\n <ng-container\r\n *ngComponentOutlet=\"component; injector: record | createInjector: action:this\"\r\n ></ng-container>\r\n </ng-container>\r\n\r\n <ng-template #button>\r\n <ng-container *ngIf=\"asToolbarAction(action).value as toolbarAction\">\r\n <button\r\n (click)=\"action.action(data)\"\r\n type=\"button\"\r\n [ngClass]=\"toolbarAction.btnClass ? toolbarAction.btnClass : defaultBtnClass\"\r\n class=\"d-inline-flex align-items-center gap-1\"\r\n >\r\n <i [ngClass]=\"toolbarAction.icon\" [class.me-1]=\"toolbarAction.icon\"></i>\r\n {{ toolbarAction.text | abpLocalization }}\r\n </button>\r\n </ng-container>\r\n </ng-template>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.PermissionDirective, selector: "[abpPermission]", inputs: ["abpPermission", "abpPermissionRunChangeDetection"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }, { kind: "pipe", type: CreateInjectorPipe, name: "createInjector" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1119
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PageToolbarComponent, decorators: [{
|
|
1120
|
-
type: Component,
|
|
1121
|
-
args: [{ exportAs: 'abpPageToolbar', selector: 'abp-page-toolbar', providers: [
|
|
1122
|
-
{
|
|
1123
|
-
provide: EXTENSIONS_ACTION_TYPE,
|
|
1124
|
-
useValue: 'toolbarActions',
|
|
1125
|
-
},
|
|
1126
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"row justify-content-end mx-0 gap-2\" id=\"AbpContentToolbar\">\r\n <div\r\n class=\"col-auto px-0 pt-0 \"\r\n [class.pe-0]=\"last\"\r\n *ngFor=\"let action of actionList; trackBy: trackByFn; let last = last\"\r\n >\r\n <ng-container *ngIf=\"action.visible(data)\">\r\n <ng-container *abpPermission=\"action.permission;runChangeDetection: false\">\r\n <ng-container *ngIf=\"action.component as component; else button\">\r\n <ng-container\r\n *ngComponentOutlet=\"component; injector: record | createInjector: action:this\"\r\n ></ng-container>\r\n </ng-container>\r\n\r\n <ng-template #button>\r\n <ng-container *ngIf=\"asToolbarAction(action).value as toolbarAction\">\r\n <button\r\n (click)=\"action.action(data)\"\r\n type=\"button\"\r\n [ngClass]=\"toolbarAction.btnClass ? toolbarAction.btnClass : defaultBtnClass\"\r\n class=\"d-inline-flex align-items-center gap-1\"\r\n >\r\n <i [ngClass]=\"toolbarAction.icon\" [class.me-1]=\"toolbarAction.icon\"></i>\r\n {{ toolbarAction.text | abpLocalization }}\r\n </button>\r\n </ng-container>\r\n </ng-template>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n</div>\r\n" }]
|
|
1127
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
1128
|
-
|
|
1129
|
-
var objectExtensions = /*#__PURE__*/Object.freeze({
|
|
1130
|
-
__proto__: null
|
|
1131
|
-
});
|
|
1132
|
-
|
|
1133
|
-
const EXTENSIBLE_FORM_VIEW_PROVIDER = { provide: ControlContainer, useExisting: FormGroupDirective };
|
|
1134
|
-
|
|
1135
|
-
class BaseUiExtensionsModule {
|
|
1136
|
-
}
|
|
1137
|
-
BaseUiExtensionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BaseUiExtensionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1138
|
-
BaseUiExtensionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: BaseUiExtensionsModule, declarations: [DateTimePickerComponent,
|
|
1139
|
-
PageToolbarComponent,
|
|
1140
|
-
GridActionsComponent,
|
|
1141
|
-
ExtensibleFormPropComponent,
|
|
1142
|
-
ExtensibleFormComponent,
|
|
1143
|
-
ExtensibleTableComponent,
|
|
1144
|
-
PropDataDirective,
|
|
1145
|
-
DisabledDirective,
|
|
1146
|
-
CreateInjectorPipe], imports: [CoreModule,
|
|
1147
|
-
ThemeSharedModule,
|
|
1148
|
-
NgxValidateCoreModule,
|
|
1149
|
-
NgbDatepickerModule,
|
|
1150
|
-
NgbDropdownModule,
|
|
1151
|
-
NgbTimepickerModule,
|
|
1152
|
-
NgbTypeaheadModule], exports: [DateTimePickerComponent,
|
|
1153
|
-
PageToolbarComponent,
|
|
1154
|
-
GridActionsComponent,
|
|
1155
|
-
ExtensibleFormComponent,
|
|
1156
|
-
ExtensibleTableComponent,
|
|
1157
|
-
PropDataDirective,
|
|
1158
|
-
DisabledDirective,
|
|
1159
|
-
CreateInjectorPipe] });
|
|
1160
|
-
BaseUiExtensionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BaseUiExtensionsModule, imports: [CoreModule,
|
|
1161
|
-
ThemeSharedModule,
|
|
1162
|
-
NgxValidateCoreModule,
|
|
1163
|
-
NgbDatepickerModule,
|
|
1164
|
-
NgbDropdownModule,
|
|
1165
|
-
NgbTimepickerModule,
|
|
1166
|
-
NgbTypeaheadModule] });
|
|
1167
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BaseUiExtensionsModule, decorators: [{
|
|
1168
|
-
type: NgModule,
|
|
1169
|
-
args: [{
|
|
1170
|
-
exports: [
|
|
1171
|
-
DateTimePickerComponent,
|
|
1172
|
-
PageToolbarComponent,
|
|
1173
|
-
GridActionsComponent,
|
|
1174
|
-
ExtensibleFormComponent,
|
|
1175
|
-
ExtensibleTableComponent,
|
|
1176
|
-
PropDataDirective,
|
|
1177
|
-
DisabledDirective,
|
|
1178
|
-
CreateInjectorPipe,
|
|
1179
|
-
],
|
|
1180
|
-
declarations: [
|
|
1181
|
-
DateTimePickerComponent,
|
|
1182
|
-
PageToolbarComponent,
|
|
1183
|
-
GridActionsComponent,
|
|
1184
|
-
ExtensibleFormPropComponent,
|
|
1185
|
-
ExtensibleFormComponent,
|
|
1186
|
-
ExtensibleTableComponent,
|
|
1187
|
-
PropDataDirective,
|
|
1188
|
-
DisabledDirective,
|
|
1189
|
-
CreateInjectorPipe,
|
|
1190
|
-
],
|
|
1191
|
-
imports: [
|
|
1192
|
-
CoreModule,
|
|
1193
|
-
ThemeSharedModule,
|
|
1194
|
-
NgxValidateCoreModule,
|
|
1195
|
-
NgbDatepickerModule,
|
|
1196
|
-
NgbDropdownModule,
|
|
1197
|
-
NgbTimepickerModule,
|
|
1198
|
-
NgbTypeaheadModule,
|
|
1199
|
-
],
|
|
1200
|
-
}]
|
|
1201
|
-
}] });
|
|
1202
|
-
class UiExtensionsModule {
|
|
1203
|
-
}
|
|
1204
|
-
UiExtensionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UiExtensionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1205
|
-
UiExtensionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: UiExtensionsModule, imports: [BaseUiExtensionsModule], exports: [BaseUiExtensionsModule] });
|
|
1206
|
-
UiExtensionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UiExtensionsModule, imports: [BaseUiExtensionsModule, BaseUiExtensionsModule] });
|
|
1207
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UiExtensionsModule, decorators: [{
|
|
1208
|
-
type: NgModule,
|
|
1209
|
-
args: [{
|
|
1210
|
-
exports: [BaseUiExtensionsModule],
|
|
1211
|
-
imports: [BaseUiExtensionsModule],
|
|
1212
|
-
}]
|
|
1213
|
-
}] });
|
|
1214
|
-
|
|
1215
|
-
function mergeWithDefaultActions(extension, defaultActions, ...contributors) {
|
|
1216
|
-
Object.keys(defaultActions).forEach((name) => {
|
|
1217
|
-
const actions = extension.get(name);
|
|
1218
|
-
actions.clearContributors();
|
|
1219
|
-
actions.addContributor((actionList) => actionList.addManyTail(defaultActions[name]));
|
|
1220
|
-
contributors.forEach(contributor => (contributor[name] || []).forEach((callback) => actions.addContributor(callback)));
|
|
1221
|
-
});
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
function generateFormFromProps(data) {
|
|
1225
|
-
const extensions = data.getInjected((ExtensionsService));
|
|
1226
|
-
const identifier = data.getInjected(EXTENSIONS_IDENTIFIER);
|
|
1227
|
-
const form = new UntypedFormGroup({});
|
|
1228
|
-
const extraForm = new UntypedFormGroup({});
|
|
1229
|
-
form.addControl(EXTRA_PROPERTIES_KEY, extraForm);
|
|
1230
|
-
const record = data.record || {};
|
|
1231
|
-
const type = JSON.stringify(record) === '{}' ? 'create' : 'edit';
|
|
1232
|
-
const props = extensions[`${type}FormProps`].get(identifier).props;
|
|
1233
|
-
const extraProperties = record[EXTRA_PROPERTIES_KEY] || {};
|
|
1234
|
-
props.forEach(({ value: prop }) => {
|
|
1235
|
-
const name = prop.name;
|
|
1236
|
-
const isExtraProperty = prop.isExtra || name in extraProperties;
|
|
1237
|
-
let value = isExtraProperty ? extraProperties[name] : name in record ? record[name] : undefined;
|
|
1238
|
-
if (typeof value === 'undefined')
|
|
1239
|
-
value = prop.defaultValue;
|
|
1240
|
-
if (value) {
|
|
1241
|
-
let adapter;
|
|
1242
|
-
switch (prop.type) {
|
|
1243
|
-
case "date" /* ePropType.Date */:
|
|
1244
|
-
adapter = new DateAdapter();
|
|
1245
|
-
value = adapter.toModel(adapter.fromModel(value));
|
|
1246
|
-
break;
|
|
1247
|
-
case "time" /* ePropType.Time */:
|
|
1248
|
-
adapter = new TimeAdapter();
|
|
1249
|
-
value = adapter.toModel(adapter.fromModel(value));
|
|
1250
|
-
break;
|
|
1251
|
-
case "datetime" /* ePropType.DateTime */:
|
|
1252
|
-
adapter = new DateTimeAdapter();
|
|
1253
|
-
value = adapter.toModel(adapter.fromModel(value));
|
|
1254
|
-
break;
|
|
1255
|
-
default:
|
|
1256
|
-
break;
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1259
|
-
const formControl = new UntypedFormControl(value, {
|
|
1260
|
-
asyncValidators: prop.asyncValidators(data),
|
|
1261
|
-
validators: prop.validators(data),
|
|
1262
|
-
});
|
|
1263
|
-
(isExtraProperty ? extraForm : form).addControl(name, formControl);
|
|
1264
|
-
});
|
|
1265
|
-
return form;
|
|
1266
|
-
}
|
|
1267
|
-
|
|
1268
|
-
function createExtraPropertyValueResolver(name) {
|
|
1269
|
-
return (data) => of(data.record[EXTRA_PROPERTIES_KEY][name]);
|
|
1270
|
-
}
|
|
1271
|
-
function mergeWithDefaultProps(extension, defaultProps, ...contributors) {
|
|
1272
|
-
Object.keys(defaultProps).forEach((name) => {
|
|
1273
|
-
const props = extension.get(name);
|
|
1274
|
-
props.clearContributors();
|
|
1275
|
-
props.addContributor((propList) => propList.addManyTail(defaultProps[name]));
|
|
1276
|
-
contributors.forEach(contributor => (contributor[name] || []).forEach((callback) => props.addContributor(callback)));
|
|
1277
|
-
});
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1280
|
-
function createEnum(members) {
|
|
1281
|
-
const enumObject = {};
|
|
1282
|
-
members.forEach(({ name = '', value }) => {
|
|
1283
|
-
enumObject[(enumObject[name] = value)] = name;
|
|
1284
|
-
});
|
|
1285
|
-
return enumObject;
|
|
1286
|
-
}
|
|
1287
|
-
function createEnumValueResolver(enumType, lookupEnum, propName) {
|
|
1288
|
-
return data => {
|
|
1289
|
-
const value = data.record[EXTRA_PROPERTIES_KEY][propName];
|
|
1290
|
-
const key = lookupEnum.transformed[value];
|
|
1291
|
-
const l10n = data.getInjected(LocalizationService);
|
|
1292
|
-
const localizeEnum = createEnumLocalizer(l10n, enumType, lookupEnum);
|
|
1293
|
-
return createLocalizationStream(l10n, localizeEnum(key));
|
|
1294
|
-
};
|
|
1295
|
-
}
|
|
1296
|
-
function createEnumOptions(enumType, lookupEnum) {
|
|
1297
|
-
return data => {
|
|
1298
|
-
const l10n = data.getInjected(LocalizationService);
|
|
1299
|
-
const localizeEnum = createEnumLocalizer(l10n, enumType, lookupEnum);
|
|
1300
|
-
return createLocalizationStream(l10n, lookupEnum.fields.map(({ name = '', value }) => ({
|
|
1301
|
-
key: localizeEnum(name),
|
|
1302
|
-
value,
|
|
1303
|
-
})));
|
|
1304
|
-
};
|
|
1305
|
-
}
|
|
1306
|
-
function createLocalizationStream(l10n, mapTarget) {
|
|
1307
|
-
return merge(of(null), l10n.languageChange$).pipe(map(() => mapTarget));
|
|
1308
|
-
}
|
|
1309
|
-
function createEnumLocalizer(l10n, enumType, lookupEnum) {
|
|
1310
|
-
const resource = lookupEnum.localizationResource;
|
|
1311
|
-
const shortType = getShortEnumType(enumType);
|
|
1312
|
-
return key => l10n.localizeWithFallbackSync([resource || ''], ['Enum:' + shortType + '.' + key, shortType + '.' + key, key], key);
|
|
1313
|
-
}
|
|
1314
|
-
function getShortEnumType(enumType) {
|
|
1315
|
-
return enumType.split('.').pop();
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
function createDisplayNameLocalizationPipeKeyGenerator(localization) {
|
|
1319
|
-
const generateLocalizationPipeKey = createLocalizationPipeKeyGenerator(localization);
|
|
1320
|
-
return (displayName, fallback) => {
|
|
1321
|
-
if (displayName && displayName.name)
|
|
1322
|
-
return generateLocalizationPipeKey([displayName.resource || ''], [displayName.name], displayName.name);
|
|
1323
|
-
const key = generateLocalizationPipeKey([fallback.resource || ''], ['DisplayName:' + fallback.name], undefined);
|
|
1324
|
-
if (key)
|
|
1325
|
-
return key;
|
|
1326
|
-
return generateLocalizationPipeKey([fallback.resource || ''], [fallback.name || ''], fallback.name);
|
|
1327
|
-
};
|
|
1328
|
-
}
|
|
1329
|
-
|
|
1330
|
-
function getValidatorsFromProperty(property) {
|
|
1331
|
-
const validators = [];
|
|
1332
|
-
property.attributes.forEach(attr => {
|
|
1333
|
-
if (attr.typeSimple && attr.typeSimple in AbpValidators) {
|
|
1334
|
-
validators.push(AbpValidators[attr.typeSimple](attr.config));
|
|
1335
|
-
}
|
|
1336
|
-
});
|
|
1337
|
-
return validators;
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
|
-
function selectObjectExtensions(configState) {
|
|
1341
|
-
return configState.getOne$('objectExtensions');
|
|
1342
|
-
}
|
|
1343
|
-
function selectLocalization(configState) {
|
|
1344
|
-
return configState.getOne$('localization');
|
|
1345
|
-
}
|
|
1346
|
-
function selectEnums(configState) {
|
|
1347
|
-
return selectObjectExtensions(configState).pipe(map((extensions) => Object.keys(extensions.enums).reduce((acc, key) => {
|
|
1348
|
-
const { fields, localizationResource } = extensions.enums[key];
|
|
1349
|
-
acc[key] = {
|
|
1350
|
-
fields,
|
|
1351
|
-
localizationResource,
|
|
1352
|
-
transformed: createEnum(fields),
|
|
1353
|
-
};
|
|
1354
|
-
return acc;
|
|
1355
|
-
}, {})));
|
|
1356
|
-
}
|
|
1357
|
-
function getObjectExtensionEntitiesFromStore(configState, moduleKey) {
|
|
1358
|
-
return selectObjectExtensions(configState).pipe(map(extensions => {
|
|
1359
|
-
if (!extensions)
|
|
1360
|
-
return null;
|
|
1361
|
-
return (extensions.modules[moduleKey] || {})
|
|
1362
|
-
.entities;
|
|
1363
|
-
}), map(entities => (isUndefined(entities) ? {} : entities)), filter(Boolean), take(1));
|
|
1364
|
-
}
|
|
1365
|
-
function mapEntitiesToContributors(configState, resource) {
|
|
1366
|
-
return pipe(switchMap((entities) => zip(selectLocalization(configState), selectEnums(configState)).pipe(map(([localization, enums]) => {
|
|
1367
|
-
const generateDisplayName = createDisplayNameLocalizationPipeKeyGenerator(localization);
|
|
1368
|
-
return Object.keys(entities).reduce((acc, key) => {
|
|
1369
|
-
acc.prop[key] = [];
|
|
1370
|
-
acc.createForm[key] = [];
|
|
1371
|
-
acc.editForm[key] = [];
|
|
1372
|
-
const entity = entities[key];
|
|
1373
|
-
if (!entity)
|
|
1374
|
-
return acc;
|
|
1375
|
-
const properties = entity.properties;
|
|
1376
|
-
if (!properties)
|
|
1377
|
-
return acc;
|
|
1378
|
-
const mapPropertiesToContributors = createPropertiesToContributorsMapper(generateDisplayName, resource, enums);
|
|
1379
|
-
return mapPropertiesToContributors(properties, acc, key);
|
|
1380
|
-
}, {
|
|
1381
|
-
prop: {},
|
|
1382
|
-
createForm: {},
|
|
1383
|
-
editForm: {},
|
|
1384
|
-
});
|
|
1385
|
-
}))), take(1));
|
|
1386
|
-
}
|
|
1387
|
-
function createPropertiesToContributorsMapper(generateDisplayName, resource, enums) {
|
|
1388
|
-
return (properties, contributors, key) => {
|
|
1389
|
-
const isExtra = true;
|
|
1390
|
-
const generateTypeaheadDisplayName = createTypeaheadDisplayNameGenerator(generateDisplayName, properties);
|
|
1391
|
-
Object.keys(properties).forEach((name) => {
|
|
1392
|
-
const property = properties[name];
|
|
1393
|
-
const propName = name;
|
|
1394
|
-
const lookup = property.ui.lookup || {};
|
|
1395
|
-
const type = getTypeaheadType(lookup, name) || getTypeFromProperty(property);
|
|
1396
|
-
const generateDN = hasTypeaheadTextSuffix(name)
|
|
1397
|
-
? generateTypeaheadDisplayName
|
|
1398
|
-
: generateDisplayName;
|
|
1399
|
-
const displayName = generateDN(property.displayName, { name, resource });
|
|
1400
|
-
if (property.ui.onTable.isVisible) {
|
|
1401
|
-
const sortable = Boolean(property.ui.onTable.isSortable);
|
|
1402
|
-
const columnWidth = type === "boolean" /* ePropType.Boolean */ ? 150 : 250;
|
|
1403
|
-
const valueResolver = type === "enum" /* ePropType.Enum */ && property.type
|
|
1404
|
-
? createEnumValueResolver(property.type, enums[property.type], propName)
|
|
1405
|
-
: createExtraPropertyValueResolver(propName);
|
|
1406
|
-
const entityProp = new EntityProp({
|
|
1407
|
-
type,
|
|
1408
|
-
name: propName,
|
|
1409
|
-
displayName,
|
|
1410
|
-
sortable,
|
|
1411
|
-
columnWidth,
|
|
1412
|
-
valueResolver,
|
|
1413
|
-
isExtra,
|
|
1414
|
-
});
|
|
1415
|
-
const contributor = (propList) => propList.addTail(entityProp);
|
|
1416
|
-
contributors.prop[key].push(contributor);
|
|
1417
|
-
}
|
|
1418
|
-
const isOnCreateForm = property.ui.onCreateForm.isVisible;
|
|
1419
|
-
const isOnEditForm = property.ui.onEditForm.isVisible;
|
|
1420
|
-
if (isOnCreateForm || isOnEditForm) {
|
|
1421
|
-
const defaultValue = property.defaultValue;
|
|
1422
|
-
const validators = () => getValidatorsFromProperty(property);
|
|
1423
|
-
let options;
|
|
1424
|
-
if (type === "enum" /* ePropType.Enum */)
|
|
1425
|
-
options = createEnumOptions(propName, enums[property.type || '']);
|
|
1426
|
-
else if (type === "typeahead" /* ePropType.Typeahead */)
|
|
1427
|
-
options = createTypeaheadOptions(lookup);
|
|
1428
|
-
const formProp = new FormProp({
|
|
1429
|
-
type,
|
|
1430
|
-
name: propName,
|
|
1431
|
-
displayName,
|
|
1432
|
-
options,
|
|
1433
|
-
defaultValue,
|
|
1434
|
-
validators,
|
|
1435
|
-
isExtra,
|
|
1436
|
-
});
|
|
1437
|
-
const formContributor = (propList) => propList.addTail(formProp);
|
|
1438
|
-
if (isOnCreateForm)
|
|
1439
|
-
contributors.createForm[key].push(formContributor);
|
|
1440
|
-
if (isOnEditForm)
|
|
1441
|
-
contributors.editForm[key].push(formContributor);
|
|
1442
|
-
}
|
|
1443
|
-
});
|
|
1444
|
-
return contributors;
|
|
1445
|
-
};
|
|
1446
|
-
}
|
|
1447
|
-
function getTypeFromProperty(property) {
|
|
1448
|
-
var _a;
|
|
1449
|
-
return (_a = property === null || property === void 0 ? void 0 : property.typeSimple) === null || _a === void 0 ? void 0 : _a.replace(/\?$/, '');
|
|
1450
|
-
}
|
|
1451
|
-
function isUndefined(obj) {
|
|
1452
|
-
return typeof obj === 'undefined';
|
|
1453
|
-
}
|
|
1454
|
-
|
|
1455
|
-
/**
|
|
1456
|
-
* Generated bundle index. Do not edit.
|
|
1457
|
-
*/
|
|
1458
|
-
|
|
1459
|
-
export { ActionList, BaseUiExtensionsModule, CreateFormPropsFactory, CreateInjectorPipe, DateAdapter, DateTimeAdapter, DateTimePickerComponent, DisabledDirective, ENTITY_PROP_TYPE_CLASSES, EXTENSIBLE_FORM_VIEW_PROVIDER, EXTENSIONS_ACTION_CALLBACK, EXTENSIONS_ACTION_DATA, EXTENSIONS_ACTION_TYPE, EXTENSIONS_FORM_PROP, EXTENSIONS_FORM_PROP_DATA, EXTENSIONS_IDENTIFIER, EXTRA_PROPERTIES_KEY, EditFormPropsFactory, EntityAction, EntityActionList, EntityActions, EntityActionsFactory, EntityProp, EntityPropList, EntityProps, EntityPropsFactory, ExtensibleFormComponent, ExtensibleFormPropComponent, ExtensibleTableComponent, ExtensionsService, FormProp, FormPropData, FormPropList, FormProps, GridActionsComponent, objectExtensions as ObjectExtensions, PROP_DATA_STREAM, PageToolbarComponent, PropDataDirective, PropList, TimeAdapter, ToolbarAction, ToolbarActionList, ToolbarActions, ToolbarActionsFactory, ToolbarComponent, UiExtensionsModule, createExtraPropertyValueResolver, generateFormFromProps, getObjectExtensionEntitiesFromStore, mapEntitiesToContributors, mergeWithDefaultActions, mergeWithDefaultProps };
|
|
1460
|
-
//# sourceMappingURL=abp-ng.theme.shared-extensions.mjs.map
|