@mediusinc/mng-commons 5.0.0-rc.0-c31d5206 → 5.0.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/README.md +1 -0
- package/core/README.md +8 -0
- package/core/action/action-data.model.d.ts +3 -0
- package/core/action/action-parameters.model.d.ts +17 -0
- package/core/components/pages/error/error.page.component.d.ts +8 -0
- package/core/components/pages/not-found/not-found.page.component.d.ts +8 -0
- package/core/data-list/data-list-params-helpers.d.ts +82 -0
- package/core/data-providers/base.data-provider.d.ts +32 -0
- package/core/data-providers/lookup.data-provider.d.ts +10 -0
- package/core/descriptors/action.descriptor.d.ts +12 -0
- package/core/descriptors/column.descriptor.d.ts +3 -0
- package/core/descriptors/editor.descriptor.d.ts +11 -0
- package/core/descriptors/enum.descriptor.d.ts +6 -0
- package/core/descriptors/filter.descriptor.d.ts +3 -0
- package/core/descriptors/lookup.descriptor.d.ts +12 -0
- package/core/descriptors/model.descriptor.d.ts +8 -0
- package/core/descriptors/table.descriptor.d.ts +9 -0
- package/core/descriptors/tableview.descriptor.d.ts +11 -0
- package/core/directives/component.directive.d.ts +20 -0
- package/core/directives/dialog-keydown-handler.directive.d.ts +12 -0
- package/core/directives/template.directive.d.ts +12 -0
- package/core/enum/enum-helpers.d.ts +49 -0
- package/core/enum/enum.model.d.ts +8 -0
- package/core/error/error-handler.d.ts +6 -0
- package/core/error/error-helpers.d.ts +114 -0
- package/core/error/error.model.d.ts +47 -0
- package/core/helpers/coercion.d.ts +9 -0
- package/core/helpers/date.d.ts +14 -0
- package/core/helpers/notification.d.ts +2 -0
- package/core/helpers/object.d.ts +27 -0
- package/core/helpers/route.d.ts +35 -0
- package/core/helpers/string.d.ts +7 -0
- package/core/helpers/templates.d.ts +3 -0
- package/core/helpers/type-helpers.d.ts +16 -0
- package/core/i18n/i18n-common.d.ts +6 -0
- package/core/i18n/i18n-error.d.ts +4 -0
- package/core/i18n/i18n-type.d.ts +20 -0
- package/core/index.d.ts +83 -0
- package/core/log/log-publisher-console.service.d.ts +4 -0
- package/core/log/log.model.d.ts +40 -0
- package/core/log/logger.service.d.ts +33 -0
- package/core/models/class-service.model.d.ts +7 -0
- package/core/models/getter.model.d.ts +2 -0
- package/core/models/i18n.model.d.ts +1 -0
- package/core/models/menu.model.d.ts +32 -0
- package/core/models/user.model.d.ts +8 -0
- package/core/pipes/boolean.pipe.d.ts +7 -0
- package/core/pipes/class-map.pipe.d.ts +7 -0
- package/core/pipes/enum.pipe.d.ts +8 -0
- package/core/pipes/enumerate-async.pipe.d.ts +9 -0
- package/core/pipes/enumerate.pipe.d.ts +16 -0
- package/core/pipes/getter.pipe.d.ts +8 -0
- package/core/pipes/i18n-property.pipe.d.ts +8 -0
- package/core/pipes/json-path.pipe.d.ts +13 -0
- package/core/pipes/parametrize.pipe.d.ts +12 -0
- package/core/pipes/template.pipe.d.ts +8 -0
- package/core/provide.d.ts +12 -0
- package/core/reflect/type-enum-metadata.d.ts +32 -0
- package/core/registry/registry.model.d.ts +8 -0
- package/core/registry/type-registry.d.ts +27 -0
- package/core/router/route-builder.d.ts +65 -0
- package/core/router/router.model.d.ts +13 -0
- package/core/router/routes-builder.d.ts +18 -0
- package/core/rxjs/map-data-list-result-operator.d.ts +9 -0
- package/core/security/permission-helpers.d.ts +3 -0
- package/core/security/permission.guard.d.ts +2 -0
- package/core/security/permission.service.d.ts +16 -0
- package/core/security/permissions.model.d.ts +55 -0
- package/core/services/commons-configuration.service.d.ts +69 -0
- package/core/services/commons-init.service.d.ts +30 -0
- package/core/services/commons-router.service.d.ts +37 -0
- package/core/services/commons.service.d.ts +66 -0
- package/core/services/local-storage-config.service.d.ts +11 -0
- package/core/services/providers/commons-init.provider.d.ts +4 -0
- package/core/services/tokens/browser-storage.token.d.ts +2 -0
- package/core/services/tokens/commons-init.token.d.ts +3 -0
- package/core/services/tokens/log-publisher.token.d.ts +3 -0
- package/core/services/tokens/module-config.token.d.ts +34 -0
- package/core/styles/style-constants.d.ts +10 -0
- package/core/styles/style.model.d.ts +17 -0
- package/dev-scripts/version-info.js +1 -1
- package/esm2022/core/action/action-data.model.mjs +2 -0
- package/esm2022/core/action/action-parameters.model.mjs +2 -0
- package/esm2022/core/components/notification/notification-wrapper.component.mjs +50 -0
- package/esm2022/core/components/pages/error/error.page.component.mjs +21 -0
- package/esm2022/core/components/pages/not-found/not-found.page.component.mjs +21 -0
- package/esm2022/core/data-list/data-list-params-helpers.mjs +415 -0
- package/esm2022/core/data-list/data-list.model.mjs +2 -0
- package/esm2022/core/data-list/filter-match.model.mjs +105 -0
- package/esm2022/core/data-providers/base.data-provider.mjs +48 -0
- package/esm2022/core/data-providers/lookup.data-provider.mjs +2 -0
- package/esm2022/core/descriptors/action.descriptor.mjs +2 -0
- package/esm2022/core/descriptors/column.descriptor.mjs +2 -0
- package/esm2022/core/descriptors/editor.descriptor.mjs +2 -0
- package/esm2022/core/descriptors/enum.descriptor.mjs +2 -0
- package/esm2022/core/descriptors/filter.descriptor.mjs +2 -0
- package/esm2022/core/descriptors/lookup.descriptor.mjs +2 -0
- package/esm2022/core/descriptors/model.descriptor.mjs +2 -0
- package/esm2022/core/descriptors/table.descriptor.mjs +2 -0
- package/esm2022/core/descriptors/tableview.descriptor.mjs +2 -0
- package/esm2022/core/directives/component.directive.mjs +72 -0
- package/esm2022/core/directives/dialog-keydown-handler.directive.mjs +49 -0
- package/esm2022/core/directives/template.directive.mjs +29 -0
- package/esm2022/core/enum/enum-helpers.mjs +81 -0
- package/esm2022/core/enum/enum.model.mjs +2 -0
- package/esm2022/core/error/error-handler.mjs +20 -0
- package/esm2022/core/error/error-helpers.mjs +247 -0
- package/esm2022/core/error/error.model.mjs +32 -0
- package/esm2022/core/helpers/coercion.mjs +52 -0
- package/esm2022/core/helpers/date.mjs +119 -0
- package/esm2022/core/helpers/notification.mjs +6 -0
- package/esm2022/core/helpers/object.mjs +145 -0
- package/esm2022/core/helpers/route.mjs +58 -0
- package/esm2022/core/helpers/string.mjs +57 -0
- package/esm2022/core/helpers/templates.mjs +4 -0
- package/esm2022/core/helpers/type-helpers.mjs +2 -0
- package/esm2022/core/i18n/i18n-common.mjs +24 -0
- package/esm2022/core/i18n/i18n-error.mjs +27 -0
- package/esm2022/core/i18n/i18n-type.mjs +79 -0
- package/esm2022/core/index.mjs +105 -0
- package/esm2022/core/log/log-publisher-console.service.mjs +40 -0
- package/esm2022/core/log/log.model.mjs +10 -0
- package/esm2022/core/log/logger.service.mjs +131 -0
- package/esm2022/core/mediusinc-mng-commons-core.mjs +5 -0
- package/esm2022/core/models/class-attribute.model.mjs +2 -0
- package/esm2022/core/models/class-service.model.mjs +2 -0
- package/esm2022/core/models/getter.model.mjs +2 -0
- package/esm2022/core/models/i18n.model.mjs +2 -0
- package/esm2022/core/models/menu.model.mjs +2 -0
- package/esm2022/core/models/user.model.mjs +2 -0
- package/esm2022/core/models/version.model.mjs +2 -0
- package/esm2022/core/pipes/boolean.pipe.mjs +28 -0
- package/esm2022/core/pipes/class-map.pipe.mjs +23 -0
- package/esm2022/core/pipes/enum.pipe.mjs +27 -0
- package/esm2022/core/pipes/enumerate-async.pipe.mjs +36 -0
- package/esm2022/core/pipes/enumerate.pipe.mjs +49 -0
- package/esm2022/core/pipes/getter.pipe.mjs +21 -0
- package/esm2022/core/pipes/i18n-property.pipe.mjs +19 -0
- package/esm2022/core/pipes/json-path.pipe.mjs +25 -0
- package/esm2022/core/pipes/parametrize.pipe.mjs +86 -0
- package/esm2022/core/pipes/template.pipe.mjs +25 -0
- package/esm2022/core/provide.mjs +78 -0
- package/esm2022/core/reflect/type-enum-decorator.mjs +12 -0
- package/esm2022/core/reflect/type-enum-metadata.mjs +62 -0
- package/esm2022/core/registry/registry.model.mjs +2 -0
- package/esm2022/core/registry/type-registry.mjs +106 -0
- package/esm2022/core/router/route-builder.mjs +320 -0
- package/esm2022/core/router/router.model.mjs +2 -0
- package/esm2022/core/router/routes-builder.mjs +54 -0
- package/esm2022/core/rxjs/map-data-list-result-operator.mjs +19 -0
- package/esm2022/core/security/permission-helpers.mjs +14 -0
- package/esm2022/core/security/permission.guard.mjs +15 -0
- package/esm2022/core/security/permission.service.mjs +49 -0
- package/esm2022/core/security/permissions.model.mjs +93 -0
- package/esm2022/core/services/commons-configuration.service.mjs +174 -0
- package/esm2022/core/services/commons-init.service.mjs +111 -0
- package/esm2022/core/services/commons-router.service.mjs +180 -0
- package/esm2022/core/services/commons.service.mjs +390 -0
- package/esm2022/core/services/local-storage-config.service.mjs +29 -0
- package/esm2022/core/services/providers/commons-init.provider.mjs +4 -0
- package/esm2022/core/services/tokens/browser-storage.token.mjs +3 -0
- package/esm2022/core/services/tokens/commons-init.token.mjs +3 -0
- package/esm2022/core/services/tokens/log-publisher.token.mjs +3 -0
- package/esm2022/core/services/tokens/module-config.token.mjs +3 -0
- package/esm2022/core/styles/style-constants.mjs +11 -0
- package/esm2022/core/styles/style.model.mjs +20 -0
- package/esm2022/filter/descriptors/filter-lookup.descriptor.mjs +185 -0
- package/esm2022/filter/descriptors/filter.descriptor.mjs +197 -0
- package/esm2022/filter/index.mjs +6 -0
- package/esm2022/filter/mediusinc-mng-commons-filter.mjs +5 -0
- package/esm2022/filter/models/filter.model.mjs +15 -0
- package/esm2022/form/api/data-providers/lookup.data-provider.mjs +45 -0
- package/esm2022/form/api/descriptors/action-button.descriptor.mjs +68 -0
- package/esm2022/form/api/descriptors/button-style.builder.mjs +174 -0
- package/esm2022/form/api/index.mjs +8 -0
- package/esm2022/form/api/mediusinc-mng-commons-form-api.mjs +5 -0
- package/esm2022/form/api/models/trim.model.mjs +2 -0
- package/esm2022/form/components/autocomplete/autocomplete.component.mjs +404 -0
- package/esm2022/form/components/date-range/date-range.component.mjs +110 -0
- package/esm2022/form/components/dropdown/dropdown.component.mjs +213 -0
- package/esm2022/form/directives/input-trim.directive.mjs +55 -0
- package/esm2022/form/index.mjs +7 -0
- package/esm2022/form/mediusinc-mng-commons-form.mjs +5 -0
- package/esm2022/index.mjs +2 -74
- package/esm2022/model/descriptors/enum.descriptor.mjs +31 -0
- package/esm2022/model/descriptors/model.descriptor.mjs +78 -0
- package/esm2022/model/descriptors/type.descriptor.mjs +21 -0
- package/esm2022/model/helpers/i18n.mjs +45 -0
- package/esm2022/model/helpers/model.mjs +71 -0
- package/esm2022/model/index.mjs +8 -0
- package/esm2022/model/mediusinc-mng-commons-model.mjs +5 -0
- package/esm2022/provide.mjs +6 -0
- package/esm2022/table/api/data-providers/table.data-provider.mjs +63 -0
- package/esm2022/table/api/descriptors/column.descriptor.mjs +359 -0
- package/esm2022/table/api/descriptors/sort.descriptor.mjs +45 -0
- package/esm2022/table/api/descriptors/table.descriptor.mjs +778 -0
- package/esm2022/table/api/helpers/class-attribute-converter.mjs +104 -0
- package/esm2022/table/api/index.mjs +16 -0
- package/esm2022/table/api/mediusinc-mng-commons-table-api.mjs +5 -0
- package/esm2022/table/api/models/class-table-attribute.model.mjs +2 -0
- package/esm2022/table/api/models/column-value.model.mjs +2 -0
- package/esm2022/table/api/models/column.model.mjs +21 -0
- package/esm2022/table/api/models/table-columns.model.mjs +2 -0
- package/esm2022/table/api/models/table-event.model.mjs +2 -0
- package/esm2022/table/api/models/table.model.mjs +22 -0
- package/esm2022/table/components/column-filter-full/column-filter-full.component.mjs +594 -0
- package/esm2022/table/components/column-value/column-value.component.mjs +86 -0
- package/esm2022/table/components/table/table.component.mjs +630 -0
- package/esm2022/table/helpers/notification.mjs +15 -0
- package/esm2022/table/helpers/table-layout-prefs.mjs +10 -0
- package/esm2022/table/index.mjs +13 -0
- package/esm2022/table/mediusinc-mng-commons-table.mjs +5 -0
- package/esm2022/table/models/column-preferences.model.mjs +2 -0
- package/esm2022/table/pipes/locale-default-row-class.pipe.mjs +27 -0
- package/esm2022/table/pipes/table-column-filter-class.pipe.mjs +25 -0
- package/esm2022/table/services/data-list.service.mjs +23 -0
- package/esm2022/tableview/action/components/action/action.component.mjs +323 -0
- package/esm2022/tableview/action/components/editor/action-editor.component.mjs +97 -0
- package/esm2022/tableview/action/components/editor/injector-context/action-editor-injector-context.component.mjs +398 -0
- package/esm2022/tableview/action/components/localization/data-language-dropdown.component.mjs +53 -0
- package/esm2022/tableview/action/components/route/action-route.component.mjs +152 -0
- package/esm2022/tableview/action/components/table/action-table.component.mjs +146 -0
- package/esm2022/tableview/action/guards/unsaved-changes.guard.mjs +4 -0
- package/esm2022/tableview/action/helpers/i18n.mjs +82 -0
- package/esm2022/tableview/action/helpers/notification.mjs +17 -0
- package/esm2022/tableview/action/helpers/styles.mjs +32 -0
- package/esm2022/tableview/action/models/action-editor-dialog-data.model.mjs +2 -0
- package/esm2022/tableview/action/models/can-component-deactivate.model.mjs +2 -0
- package/esm2022/tableview/action/models/execution/action-context.model.mjs +56 -0
- package/esm2022/tableview/action/models/execution/action-instance-state.model.mjs +32 -0
- package/esm2022/tableview/action/models/execution/action-instance.model.mjs +170 -0
- package/esm2022/tableview/action/services/action-error-mapper.service.mjs +20 -0
- package/esm2022/tableview/action/services/action-executor.service.mjs +767 -0
- package/esm2022/tableview/action/services/component-action-executor.service.mjs +19 -0
- package/esm2022/tableview/action/services/data-provider-executor.service.mjs +26 -0
- package/esm2022/tableview/action/services/navigation.service.mjs +52 -0
- package/esm2022/tableview/action/services/providers/provide-action-executor.mjs +9 -0
- package/esm2022/tableview/action/services/providers/provide-view-container.mjs +17 -0
- package/esm2022/tableview/action/services/root-action-executor.service.mjs +18 -0
- package/esm2022/tableview/action/services/tokens/action-editor.token.mjs +3 -0
- package/esm2022/tableview/action/services/view-container.service.mjs +56 -0
- package/esm2022/tableview/api/action/descriptors/action-confirmation.descriptor.mjs +76 -0
- package/esm2022/tableview/api/action/descriptors/action-editor.descriptor.mjs +264 -0
- package/esm2022/tableview/api/action/descriptors/action-link.descriptor.mjs +89 -0
- package/esm2022/tableview/api/action/descriptors/action.descriptor.mjs +385 -0
- package/esm2022/tableview/api/action/helpers/data-provider-executors.mjs +80 -0
- package/esm2022/tableview/api/action/models/action-component.model.mjs +2 -0
- package/esm2022/tableview/api/action/models/action-descriptor.types.mjs +2 -0
- package/esm2022/tableview/api/action/models/action-editor.model.mjs +2 -0
- package/esm2022/tableview/api/action/models/action-error.model.mjs +14 -0
- package/esm2022/tableview/api/action/models/action.type.mjs +26 -0
- package/esm2022/tableview/api/action/models/execution/action-context-validation.model.mjs +2 -0
- package/esm2022/tableview/api/action/models/execution/action-context.model.mjs +2 -0
- package/esm2022/tableview/api/action/models/execution/action-execution-error.model.mjs +2 -0
- package/esm2022/tableview/api/action/models/execution/action-instance-state.model.mjs +32 -0
- package/esm2022/tableview/api/action/models/execution/action-instance.model.mjs +2 -0
- package/esm2022/tableview/api/action/models/execution/view-container.model.mjs +2 -0
- package/esm2022/tableview/api/action/models/tableview-action-default-categories.model.mjs +11 -0
- package/esm2022/tableview/api/action/services/data-provider-executor.service.mjs +28 -0
- package/esm2022/tableview/api/action/services/tokens/data-language-dropdown.token.mjs +3 -0
- package/esm2022/tableview/api/editor/data-providers/editor.data-provider.mjs +104 -0
- package/esm2022/tableview/api/editor/descriptors/editor.descriptor.mjs +626 -0
- package/esm2022/tableview/api/editor/descriptors/field-action.descriptor.mjs +49 -0
- package/esm2022/tableview/api/editor/descriptors/field-base.descriptor.mjs +288 -0
- package/esm2022/tableview/api/editor/descriptors/field-group.descriptor.mjs +97 -0
- package/esm2022/tableview/api/editor/descriptors/field-lookup.descriptor.mjs +213 -0
- package/esm2022/tableview/api/editor/descriptors/field-many.descriptor.mjs +153 -0
- package/esm2022/tableview/api/editor/descriptors/field-validation.descriptor.mjs +25 -0
- package/esm2022/tableview/api/editor/descriptors/field.descriptor.mjs +343 -0
- package/esm2022/tableview/api/editor/helpers/class-attribute-converter.mjs +85 -0
- package/esm2022/tableview/api/editor/helpers/field-validators.mjs +33 -0
- package/esm2022/tableview/api/editor/models/class-tableview-attribute.model.mjs +2 -0
- package/esm2022/tableview/api/editor/models/editor-fields.model.mjs +2 -0
- package/esm2022/tableview/api/editor/models/editor.model.mjs +9 -0
- package/esm2022/tableview/api/editor/models/field-action-context.model.mjs +2 -0
- package/esm2022/tableview/api/editor/models/field.model.mjs +56 -0
- package/esm2022/tableview/api/editor/models/form-editor.event.mjs +27 -0
- package/esm2022/tableview/api/editor/models/form-editor.interface.mjs +2 -0
- package/esm2022/tableview/api/editor/models/formly-custom-field.model.mjs +69 -0
- package/esm2022/tableview/api/editor/models/formly-field.model.mjs +2 -0
- package/esm2022/tableview/api/editor/models/radio.model.mjs +2 -0
- package/esm2022/tableview/api/index.mjs +64 -0
- package/esm2022/tableview/api/mediusinc-mng-commons-tableview-api.mjs +5 -0
- package/esm2022/tableview/api/tableview/data-providers/tableview.data-provider.mjs +105 -0
- package/esm2022/tableview/api/tableview/descriptors/tableview.descriptor.mjs +672 -0
- package/esm2022/tableview/api/tableview/helpers/class-attribute-converter.mjs +34 -0
- package/esm2022/tableview/api/tableview/helpers/files-export.mjs +34 -0
- package/esm2022/tableview/api/tableview/helpers/tableview-create.mjs +24 -0
- package/esm2022/tableview/api/tableview/helpers/tableview-default-actions.mjs +240 -0
- package/esm2022/tableview/api/tableview/helpers/tableview-input-builder.mjs +162 -0
- package/esm2022/tableview/api/tableview/models/class-tableview-attribute.model.mjs +2 -0
- package/esm2022/tableview/api/tableview/models/tableview-input.model.mjs +2 -0
- package/esm2022/tableview/api/tableview/models/tableview-route.model.mjs +2 -0
- package/esm2022/tableview/editor/components/editor/form-editor.component.mjs +285 -0
- package/esm2022/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.mjs +61 -0
- package/esm2022/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +54 -0
- package/esm2022/tableview/editor/components/formly/fields/formly-field-custom/formly-field-custom.component.mjs +39 -0
- package/esm2022/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +49 -0
- package/esm2022/tableview/editor/components/formly/fields/formly-field-fieldset/formly-field-fieldset.component.mjs +27 -0
- package/esm2022/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.mjs +220 -0
- package/esm2022/tableview/editor/components/formly/fields/formly-field-label/formly-field-label.component.mjs +24 -0
- package/esm2022/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +215 -0
- package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +217 -0
- package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +196 -0
- package/esm2022/tableview/editor/components/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +18 -0
- package/esm2022/tableview/editor/components/formly/wrappers/formly-field-no-label-wrapper/formly-field-no-label-wrapper.component.mjs +33 -0
- package/esm2022/tableview/editor/components/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +30 -0
- package/esm2022/tableview/editor/helpers/editor-formly.mjs +335 -0
- package/esm2022/tableview/editor/helpers/formly-config.mjs +260 -0
- package/esm2022/tableview/editor/helpers/notification.mjs +11 -0
- package/esm2022/tableview/editor/models/formly-config.model.mjs +2 -0
- package/esm2022/tableview/editor/services/formly-config.provider.mjs +31 -0
- package/esm2022/tableview/index.mjs +62 -0
- package/esm2022/tableview/mediusinc-mng-commons-tableview.mjs +5 -0
- package/esm2022/tableview/provide.mjs +62 -0
- package/esm2022/tableview/tableview/components/route/tableview-route.component.mjs +15 -0
- package/esm2022/tableview/tableview/components/tableview/tableview.component.mjs +75 -0
- package/esm2022/tableview/tableview/router/tableview-route-builder.mjs +201 -0
- package/esm2022/tableview/tableview/services/tableview-feature-config.token.mjs +3 -0
- package/fesm2022/mediusinc-mng-commons-core.mjs +3882 -0
- package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons-filter.mjs +402 -0
- package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons-form-api.mjs +294 -0
- package/fesm2022/mediusinc-mng-commons-form-api.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons-form.mjs +770 -0
- package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons-model.mjs +251 -0
- package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons-table-api.mjs +1391 -0
- package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons-table.mjs +1376 -0
- package/fesm2022/mediusinc-mng-commons-table.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +4372 -0
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons-tableview.mjs +4691 -0
- package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons.mjs +5 -18605
- package/fesm2022/mediusinc-mng-commons.mjs.map +1 -1
- package/filter/README.md +9 -0
- package/filter/descriptors/filter-lookup.descriptor.d.ts +67 -0
- package/filter/descriptors/filter.descriptor.d.ts +67 -0
- package/filter/index.d.ts +3 -0
- package/form/README.md +8 -0
- package/form/api/README.md +7 -0
- package/form/api/data-providers/lookup.data-provider.d.ts +19 -0
- package/form/api/descriptors/action-button.descriptor.d.ts +25 -0
- package/form/api/descriptors/button-style.builder.d.ts +68 -0
- package/form/api/index.d.ts +4 -0
- package/form/components/autocomplete/autocomplete.component.d.ts +82 -0
- package/form/components/date-range/date-range.component.d.ts +28 -0
- package/form/components/dropdown/dropdown.component.d.ts +55 -0
- package/form/directives/input-trim.directive.d.ts +14 -0
- package/form/index.d.ts +4 -0
- package/index.d.ts +1 -50
- package/model/README.md +7 -0
- package/model/descriptors/enum.descriptor.d.ts +14 -0
- package/model/descriptors/model.descriptor.d.ts +31 -0
- package/model/descriptors/type.descriptor.d.ts +10 -0
- package/model/helpers/i18n.d.ts +10 -0
- package/model/helpers/model.d.ts +5 -0
- package/model/index.d.ts +5 -0
- package/package.json +61 -25
- package/provide.d.ts +7 -0
- package/table/README.md +11 -0
- package/table/api/README.md +9 -0
- package/table/api/data-providers/table.data-provider.d.ts +38 -0
- package/table/api/descriptors/column.descriptor.d.ts +148 -0
- package/table/api/descriptors/table.descriptor.d.ts +281 -0
- package/table/api/helpers/class-attribute-converter.d.ts +22 -0
- package/table/api/index.d.ts +11 -0
- package/table/api/models/class-table-attribute.model.d.ts +8 -0
- package/table/api/models/column-value.model.d.ts +7 -0
- package/table/api/models/table-columns.model.d.ts +42 -0
- package/table/api/models/table-event.model.d.ts +17 -0
- package/table/api/models/table.model.d.ts +35 -0
- package/table/components/column-filter-full/column-filter-full.component.d.ts +100 -0
- package/table/components/column-value/column-value.component.d.ts +32 -0
- package/table/components/table/table.component.d.ts +114 -0
- package/table/helpers/notification.d.ts +4 -0
- package/table/helpers/table-layout-prefs.d.ts +7 -0
- package/table/index.d.ts +8 -0
- package/table/models/column-preferences.model.d.ts +12 -0
- package/table/pipes/locale-default-row-class.pipe.d.ts +10 -0
- package/table/pipes/table-column-filter-class.pipe.d.ts +8 -0
- package/table/services/data-list.service.d.ts +16 -0
- package/tableview/README.md +13 -0
- package/tableview/action/components/action/action.component.d.ts +73 -0
- package/tableview/action/components/editor/action-editor.component.d.ts +31 -0
- package/tableview/action/components/editor/injector-context/action-editor-injector-context.component.d.ts +76 -0
- package/tableview/action/components/localization/data-language-dropdown.component.d.ts +22 -0
- package/tableview/action/components/route/action-route.component.d.ts +31 -0
- package/tableview/action/components/table/action-table.component.d.ts +48 -0
- package/tableview/action/guards/unsaved-changes.guard.d.ts +3 -0
- package/tableview/action/helpers/i18n.d.ts +22 -0
- package/tableview/action/helpers/notification.d.ts +6 -0
- package/tableview/action/helpers/styles.d.ts +5 -0
- package/tableview/action/models/action-editor-dialog-data.model.d.ts +11 -0
- package/tableview/action/models/execution/action-context.model.d.ts +36 -0
- package/tableview/action/models/execution/action-instance-state.model.d.ts +30 -0
- package/tableview/action/models/execution/action-instance.model.d.ts +56 -0
- package/tableview/action/services/action-error-mapper.service.d.ts +18 -0
- package/tableview/action/services/action-executor.service.d.ts +175 -0
- package/tableview/action/services/component-action-executor.service.d.ts +9 -0
- package/tableview/action/services/data-provider-executor.service.d.ts +23 -0
- package/tableview/action/services/navigation.service.d.ts +15 -0
- package/tableview/action/services/root-action-executor.service.d.ts +9 -0
- package/tableview/action/services/tokens/action-editor.token.d.ts +2 -0
- package/tableview/action/services/view-container.service.d.ts +30 -0
- package/tableview/api/README.md +11 -0
- package/tableview/api/action/descriptors/action-confirmation.descriptor.d.ts +36 -0
- package/tableview/api/action/descriptors/action-editor.descriptor.d.ts +117 -0
- package/tableview/api/action/descriptors/action-link.descriptor.d.ts +34 -0
- package/tableview/api/action/descriptors/action.descriptor.d.ts +151 -0
- package/tableview/api/action/helpers/data-provider-executors.d.ts +18 -0
- package/tableview/api/action/models/action-component.model.d.ts +12 -0
- package/tableview/api/action/models/action-descriptor.types.d.ts +5 -0
- package/tableview/api/action/models/action-editor.model.d.ts +4 -0
- package/tableview/api/action/models/action-error.model.d.ts +14 -0
- package/tableview/api/action/models/action.type.d.ts +21 -0
- package/tableview/api/action/models/execution/action-context-validation.model.d.ts +11 -0
- package/tableview/api/action/models/execution/action-context.model.d.ts +24 -0
- package/tableview/api/action/models/execution/action-execution-error.model.d.ts +4 -0
- package/tableview/api/action/models/execution/action-instance-state.model.d.ts +30 -0
- package/tableview/api/action/models/execution/action-instance.model.d.ts +31 -0
- package/tableview/api/action/models/execution/view-container.model.d.ts +38 -0
- package/tableview/api/action/services/data-provider-executor.service.d.ts +38 -0
- package/tableview/api/action/services/tokens/data-language-dropdown.token.d.ts +2 -0
- package/tableview/api/editor/data-providers/editor.data-provider.d.ts +87 -0
- package/tableview/api/editor/descriptors/editor.descriptor.d.ts +366 -0
- package/tableview/api/editor/descriptors/field-action.descriptor.d.ts +22 -0
- package/tableview/api/editor/descriptors/field-base.descriptor.d.ts +120 -0
- package/tableview/api/editor/descriptors/field-group.descriptor.d.ts +41 -0
- package/tableview/api/editor/descriptors/field-lookup.descriptor.d.ts +80 -0
- package/tableview/api/editor/descriptors/field-many.descriptor.d.ts +61 -0
- package/tableview/api/editor/descriptors/field-validation.descriptor.d.ts +19 -0
- package/tableview/api/editor/descriptors/field.descriptor.d.ts +168 -0
- package/tableview/api/editor/helpers/class-attribute-converter.d.ts +21 -0
- package/tableview/api/editor/helpers/field-validators.d.ts +3 -0
- package/tableview/api/editor/models/class-tableview-attribute.model.d.ts +7 -0
- package/tableview/api/editor/models/editor-fields.model.d.ts +34 -0
- package/tableview/api/editor/models/editor.model.d.ts +7 -0
- package/tableview/api/editor/models/field-action-context.model.d.ts +24 -0
- package/tableview/api/editor/models/field.model.d.ts +66 -0
- package/tableview/api/editor/models/form-editor.event.d.ts +55 -0
- package/tableview/api/editor/models/formly-custom-field.model.d.ts +27 -0
- package/tableview/api/editor/models/formly-field.model.d.ts +18 -0
- package/tableview/api/index.d.ts +50 -0
- package/tableview/api/tableview/data-providers/tableview.data-provider.d.ts +43 -0
- package/tableview/api/tableview/descriptors/tableview.descriptor.d.ts +296 -0
- package/tableview/api/tableview/helpers/class-attribute-converter.d.ts +8 -0
- package/tableview/api/tableview/helpers/files-export.d.ts +4 -0
- package/tableview/api/tableview/helpers/tableview-create.d.ts +16 -0
- package/tableview/api/tableview/helpers/tableview-default-actions.d.ts +38 -0
- package/tableview/api/tableview/helpers/tableview-input-builder.d.ts +114 -0
- package/tableview/api/tableview/models/class-tableview-attribute.model.d.ts +3 -0
- package/tableview/api/tableview/models/tableview-input.model.d.ts +8 -0
- package/tableview/api/tableview/models/tableview-route.model.d.ts +20 -0
- package/tableview/editor/components/editor/form-editor.component.d.ts +50 -0
- package/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.d.ts +14 -0
- package/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.d.ts +15 -0
- package/tableview/editor/components/formly/fields/formly-field-custom/formly-field-custom.component.d.ts +11 -0
- package/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.d.ts +14 -0
- package/tableview/editor/components/formly/fields/formly-field-fieldset/formly-field-fieldset.component.d.ts +12 -0
- package/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.d.ts +37 -0
- package/tableview/editor/components/formly/fields/formly-field-label/formly-field-label.component.d.ts +11 -0
- package/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +43 -0
- package/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +23 -0
- package/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +41 -0
- package/tableview/editor/components/formly/fields/formly-field-tabs/formly-field-tabs.component.d.ts +7 -0
- package/tableview/editor/components/formly/wrappers/formly-field-no-label-wrapper/formly-field-no-label-wrapper.component.d.ts +11 -0
- package/tableview/editor/components/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.d.ts +9 -0
- package/tableview/editor/helpers/editor-formly.d.ts +10 -0
- package/tableview/editor/helpers/formly-config.d.ts +18 -0
- package/tableview/editor/helpers/notification.d.ts +4 -0
- package/tableview/editor/models/formly-config.model.d.ts +5 -0
- package/tableview/editor/services/formly-config.provider.d.ts +5 -0
- package/tableview/index.d.ts +48 -0
- package/tableview/provide.d.ts +8 -0
- package/tableview/tableview/components/route/tableview-route.component.d.ts +7 -0
- package/tableview/tableview/components/tableview/tableview.component.d.ts +26 -0
- package/tableview/tableview/router/tableview-route-builder.d.ts +42 -0
- package/tableview/tableview/services/tableview-feature-config.token.d.ts +18 -0
- package/assets/fonts/poppins-v20-latin-500.woff +0 -0
- package/assets/fonts/poppins-v20-latin-500.woff2 +0 -0
- package/assets/fonts/poppins-v20-latin-600.woff +0 -0
- package/assets/fonts/poppins-v20-latin-600.woff2 +0 -0
- package/assets/fonts/poppins-v20-latin-700.woff +0 -0
- package/assets/fonts/poppins-v20-latin-700.woff2 +0 -0
- package/assets/fonts/poppins-v20-latin-regular.woff +0 -0
- package/assets/fonts/poppins-v20-latin-regular.woff2 +0 -0
- package/assets/images/effect-ondark.png +0 -0
- package/assets/images/effect-ondark.svg +0 -38
- package/assets/images/effect-ondark@2x.png +0 -0
- package/assets/images/effect-onlight.png +0 -0
- package/assets/images/effect-onlight.svg +0 -38
- package/assets/images/effect-onlight@2x.png +0 -0
- package/assets/images/pages/exception-ondark.png +0 -0
- package/assets/images/pages/exception-onlight.png +0 -0
- package/assets/images/pages/login-ondark.png +0 -0
- package/assets/images/pages/login-onlight.png +0 -0
- package/data-api/README.md +0 -3
- package/data-api/class-dto/README.md +0 -3
- package/data-api/class-dto/helpers/tableview-crud-create.d.ts +0 -40
- package/data-api/class-dto/index.d.ts +0 -7
- package/data-api/class-dto/models/query-result.model.d.ts +0 -13
- package/data-api/class-dto/obsolete/README.md +0 -3
- package/data-api/class-dto/obsolete/helpers/query-param-convert.d.ts +0 -23
- package/data-api/class-dto/obsolete/helpers/tableview-crud-create.d.ts +0 -22
- package/data-api/class-dto/obsolete/index.d.ts +0 -14
- package/data-api/class-dto/obsolete/models/builders/query-param.builder.d.ts +0 -36
- package/data-api/class-dto/obsolete/models/filter-match-type.model.d.ts +0 -25
- package/data-api/class-dto/obsolete/models/filter-param.model.d.ts +0 -23
- package/data-api/class-dto/obsolete/models/query-mode.model.d.ts +0 -16
- package/data-api/class-dto/obsolete/models/query-param.model.d.ts +0 -31
- package/data-api/class-dto/obsolete/models/query-result.model.d.ts +0 -24
- package/data-api/class-dto/obsolete/provide.d.ts +0 -9
- package/data-api/class-dto/obsolete/services/api.abstract.service.d.ts +0 -36
- package/data-api/class-dto/obsolete/services/crud-api.abstract.service.d.ts +0 -37
- package/data-api/class-dto/obsolete/services/get-all-api.abstract.service.d.ts +0 -30
- package/data-api/class-dto/obsolete/tableview/tableview-crud.data-provider.d.ts +0 -28
- package/data-api/class-dto/obsolete/utils/query-param-map.util.d.ts +0 -22
- package/data-api/class-dto/serder/object-serializer.d.ts +0 -26
- package/data-api/class-dto/services/api.abstract.service.d.ts +0 -22
- package/data-api/class-dto/services/crud-api.abstract.service.d.ts +0 -25
- package/data-api/class-dto/services/get-all-api.abstract.service.d.ts +0 -14
- package/data-api/class-dto/tableview/tableview-crud.data-provider.d.ts +0 -17
- package/data-api/helpers/get-all-params.d.ts +0 -69
- package/data-api/helpers/tableview-get-all-params-create.d.ts +0 -14
- package/data-api/index.d.ts +0 -5
- package/data-api/models/request-params.model.d.ts +0 -61
- package/data-api/rxjs/map-to-data-list.operator.d.ts +0 -9
- package/data-api/types/extract-get-all-params.type.d.ts +0 -14
- package/esm2022/data-api/class-dto/helpers/tableview-crud-create.mjs +0 -40
- package/esm2022/data-api/class-dto/index.mjs +0 -13
- package/esm2022/data-api/class-dto/mediusinc-mng-commons-data-api-class-dto.mjs +0 -5
- package/esm2022/data-api/class-dto/models/query-result.model.mjs +0 -24
- package/esm2022/data-api/class-dto/obsolete/helpers/query-param-convert.mjs +0 -103
- package/esm2022/data-api/class-dto/obsolete/helpers/tableview-crud-create.mjs +0 -21
- package/esm2022/data-api/class-dto/obsolete/index.mjs +0 -21
- package/esm2022/data-api/class-dto/obsolete/mediusinc-mng-commons-data-api-class-dto-obsolete.mjs +0 -5
- package/esm2022/data-api/class-dto/obsolete/models/builders/query-param.builder.mjs +0 -83
- package/esm2022/data-api/class-dto/obsolete/models/filter-match-type.model.mjs +0 -27
- package/esm2022/data-api/class-dto/obsolete/models/filter-param.model.mjs +0 -33
- package/esm2022/data-api/class-dto/obsolete/models/query-mode.model.mjs +0 -18
- package/esm2022/data-api/class-dto/obsolete/models/query-param.model.mjs +0 -68
- package/esm2022/data-api/class-dto/obsolete/models/query-result.model.mjs +0 -24
- package/esm2022/data-api/class-dto/obsolete/provide.mjs +0 -40
- package/esm2022/data-api/class-dto/obsolete/services/api.abstract.service.mjs +0 -70
- package/esm2022/data-api/class-dto/obsolete/services/crud-api.abstract.service.mjs +0 -83
- package/esm2022/data-api/class-dto/obsolete/services/get-all-api.abstract.service.mjs +0 -38
- package/esm2022/data-api/class-dto/obsolete/tableview/tableview-crud.data-provider.mjs +0 -51
- package/esm2022/data-api/class-dto/obsolete/utils/query-param-map.util.mjs +0 -57
- package/esm2022/data-api/class-dto/serder/object-serializer.mjs +0 -184
- package/esm2022/data-api/class-dto/services/api.abstract.service.mjs +0 -55
- package/esm2022/data-api/class-dto/services/crud-api.abstract.service.mjs +0 -82
- package/esm2022/data-api/class-dto/services/get-all-api.abstract.service.mjs +0 -49
- package/esm2022/data-api/class-dto/tableview/tableview-crud.data-provider.mjs +0 -49
- package/esm2022/data-api/helpers/get-all-params.mjs +0 -180
- package/esm2022/data-api/helpers/tableview-get-all-params-create.mjs +0 -18
- package/esm2022/data-api/index.mjs +0 -10
- package/esm2022/data-api/mediusinc-mng-commons-data-api.mjs +0 -5
- package/esm2022/data-api/models/request-params.model.mjs +0 -2
- package/esm2022/data-api/rxjs/map-to-data-list.operator.mjs +0 -19
- package/esm2022/data-api/types/extract-get-all-params.type.mjs +0 -2
- package/esm2022/lib/components/action/action.component.mjs +0 -314
- package/esm2022/lib/components/action/editor/action-editor.component.mjs +0 -98
- package/esm2022/lib/components/action/editor/injector-context/action-editor-injector-context.component.mjs +0 -394
- package/esm2022/lib/components/action/index.mjs +0 -6
- package/esm2022/lib/components/action/localization/data-language-dropdown.component.mjs +0 -53
- package/esm2022/lib/components/action/models/action-component.model.mjs +0 -2
- package/esm2022/lib/components/action/models/action-execution.model.mjs +0 -323
- package/esm2022/lib/components/action/models/index.mjs +0 -4
- package/esm2022/lib/components/action/models/tableview-action-default-categories.model.mjs +0 -11
- package/esm2022/lib/components/action/route/action-route.component.mjs +0 -141
- package/esm2022/lib/components/action/table/action-table.component.mjs +0 -152
- package/esm2022/lib/components/form/autocomplete/autocomplete.component.mjs +0 -408
- package/esm2022/lib/components/form/date-range/date-range.component.mjs +0 -110
- package/esm2022/lib/components/form/dropdown/dropdown.component.mjs +0 -210
- package/esm2022/lib/components/form/editor/form-editor.component.mjs +0 -281
- package/esm2022/lib/components/form/formly/fields/formly-field-action/formly-field-action.component.mjs +0 -61
- package/esm2022/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +0 -54
- package/esm2022/lib/components/form/formly/fields/formly-field-custom/formly-custom-field-base.model.mjs +0 -69
- package/esm2022/lib/components/form/formly/fields/formly-field-custom/formly-field-custom.component.mjs +0 -39
- package/esm2022/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +0 -49
- package/esm2022/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.mjs +0 -27
- package/esm2022/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +0 -220
- package/esm2022/lib/components/form/formly/fields/formly-field-label/formly-field-label.component.mjs +0 -24
- package/esm2022/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +0 -219
- package/esm2022/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +0 -221
- package/esm2022/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +0 -212
- package/esm2022/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +0 -18
- package/esm2022/lib/components/form/formly/fields/index.mjs +0 -13
- package/esm2022/lib/components/form/formly/formly.config.mjs +0 -250
- package/esm2022/lib/components/form/formly/index.mjs +0 -2
- package/esm2022/lib/components/form/formly/models/formly-config.model.mjs +0 -2
- package/esm2022/lib/components/form/formly/models/formly-field.model.mjs +0 -2
- package/esm2022/lib/components/form/formly/models/index.mjs +0 -3
- package/esm2022/lib/components/form/formly/wrappers/formly-field-no-label-wrapper/formly-field-no-label-wrapper.component.mjs +0 -33
- package/esm2022/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +0 -31
- package/esm2022/lib/components/form/formly/wrappers/index.mjs +0 -3
- package/esm2022/lib/components/form/index.mjs +0 -5
- package/esm2022/lib/components/form/models/field-action-context.model.mjs +0 -2
- package/esm2022/lib/components/form/models/form-editor.event.mjs +0 -49
- package/esm2022/lib/components/form/models/form-editor.interface.mjs +0 -2
- package/esm2022/lib/components/form/models/index.mjs +0 -4
- package/esm2022/lib/components/layout/breadcrumb.component.mjs +0 -34
- package/esm2022/lib/components/layout/footer.component.mjs +0 -19
- package/esm2022/lib/components/layout/index.mjs +0 -9
- package/esm2022/lib/components/layout/main-layout.component.mjs +0 -53
- package/esm2022/lib/components/layout/menu-item.component.mjs +0 -296
- package/esm2022/lib/components/layout/menu.component.mjs +0 -34
- package/esm2022/lib/components/layout/services/index.mjs +0 -2
- package/esm2022/lib/components/layout/services/main-layout.component.service.mjs +0 -196
- package/esm2022/lib/components/layout/topbar-user.component.mjs +0 -46
- package/esm2022/lib/components/layout/topbar.component.mjs +0 -66
- package/esm2022/lib/components/layout/version.component.mjs +0 -60
- package/esm2022/lib/components/layoutV2/breadcrumb.component.mjs +0 -30
- package/esm2022/lib/components/layoutV2/footer.component.mjs +0 -29
- package/esm2022/lib/components/layoutV2/index.mjs +0 -8
- package/esm2022/lib/components/layoutV2/main-layout.component.mjs +0 -95
- package/esm2022/lib/components/layoutV2/menu-item.component.mjs +0 -275
- package/esm2022/lib/components/layoutV2/menu.component.mjs +0 -39
- package/esm2022/lib/components/layoutV2/model/index.mjs +0 -3
- package/esm2022/lib/components/layoutV2/model/layout-state.model.mjs +0 -2
- package/esm2022/lib/components/layoutV2/model/menu.model.mjs +0 -2
- package/esm2022/lib/components/layoutV2/services/index.mjs +0 -3
- package/esm2022/lib/components/layoutV2/services/main-layout.component.service.mjs +0 -71
- package/esm2022/lib/components/layoutV2/services/menu.service.mjs +0 -122
- package/esm2022/lib/components/layoutV2/sidebar.component.mjs +0 -62
- package/esm2022/lib/components/layoutV2/topbar-user.component.mjs +0 -40
- package/esm2022/lib/components/layoutV2/topbar.component.mjs +0 -69
- package/esm2022/lib/components/layoutV2/version.component.mjs +0 -63
- package/esm2022/lib/components/notification/notification-wrapper.component.mjs +0 -50
- package/esm2022/lib/components/pages/error/error.page.component.mjs +0 -21
- package/esm2022/lib/components/pages/index.mjs +0 -3
- package/esm2022/lib/components/pages/not-found/not-found.page.component.mjs +0 -21
- package/esm2022/lib/components/table/column-filter-full/column-filter-full.component.mjs +0 -597
- package/esm2022/lib/components/table/column-value/column-value.component.mjs +0 -90
- package/esm2022/lib/components/table/models/table.event.mjs +0 -16
- package/esm2022/lib/components/table/models/table.interface.mjs +0 -2
- package/esm2022/lib/components/table/table-column-filter-class/table-column-filter-class.pipe.mjs +0 -25
- package/esm2022/lib/components/table/table.component.mjs +0 -643
- package/esm2022/lib/components/tableview/actions/tableview-default-actions.mjs +0 -215
- package/esm2022/lib/components/tableview/builders/tableview-builder.mjs +0 -162
- package/esm2022/lib/components/tableview/helpers/tableview-create.mjs +0 -24
- package/esm2022/lib/components/tableview/index.mjs +0 -7
- package/esm2022/lib/components/tableview/models/tableview.model.mjs +0 -2
- package/esm2022/lib/components/tableview/route/tableview-route.component.mjs +0 -15
- package/esm2022/lib/components/tableview/tableview.component.mjs +0 -82
- package/esm2022/lib/data-providers/base.data-provider.mjs +0 -48
- package/esm2022/lib/data-providers/editor.data-provider.mjs +0 -105
- package/esm2022/lib/data-providers/index.mjs +0 -6
- package/esm2022/lib/data-providers/lookup.data-provider.mjs +0 -45
- package/esm2022/lib/data-providers/table.data-provider.mjs +0 -64
- package/esm2022/lib/data-providers/tableview.data-provider.mjs +0 -105
- package/esm2022/lib/descriptors/action/action-button.descriptor.mjs +0 -68
- package/esm2022/lib/descriptors/action/action-confirmation.descriptor.mjs +0 -77
- package/esm2022/lib/descriptors/action/action-editor.descriptor.mjs +0 -266
- package/esm2022/lib/descriptors/action/action-link.descriptor.mjs +0 -89
- package/esm2022/lib/descriptors/action/action.descriptor.mjs +0 -383
- package/esm2022/lib/descriptors/action/index.mjs +0 -6
- package/esm2022/lib/descriptors/editor/editor.descriptor.mjs +0 -510
- package/esm2022/lib/descriptors/editor/field-action.descriptor.mjs +0 -50
- package/esm2022/lib/descriptors/editor/field-base.descriptor.mjs +0 -285
- package/esm2022/lib/descriptors/editor/field-group.descriptor.mjs +0 -97
- package/esm2022/lib/descriptors/editor/field-lookup.descriptor.mjs +0 -212
- package/esm2022/lib/descriptors/editor/field-many.descriptor.mjs +0 -153
- package/esm2022/lib/descriptors/editor/field-validation.descriptor.mjs +0 -25
- package/esm2022/lib/descriptors/editor/field.descriptor.mjs +0 -343
- package/esm2022/lib/descriptors/editor/index.mjs +0 -9
- package/esm2022/lib/descriptors/editor/internal/editor-fields.model.mjs +0 -2
- package/esm2022/lib/descriptors/editor/internal/editor.model.mjs +0 -2
- package/esm2022/lib/descriptors/filter/filter-lookup.descriptor.mjs +0 -186
- package/esm2022/lib/descriptors/filter/filter.descriptor.mjs +0 -198
- package/esm2022/lib/descriptors/filter/index.mjs +0 -3
- package/esm2022/lib/descriptors/interfaces/field-config.interface.mjs +0 -2
- package/esm2022/lib/descriptors/interfaces/index.mjs +0 -3
- package/esm2022/lib/descriptors/interfaces/lookup-descriptor.interface.mjs +0 -2
- package/esm2022/lib/descriptors/model/enum.descriptor.mjs +0 -31
- package/esm2022/lib/descriptors/model/index.mjs +0 -4
- package/esm2022/lib/descriptors/model/model.descriptor.mjs +0 -79
- package/esm2022/lib/descriptors/model/type.descriptor.mjs +0 -11
- package/esm2022/lib/descriptors/table/column.descriptor.mjs +0 -359
- package/esm2022/lib/descriptors/table/index.mjs +0 -4
- package/esm2022/lib/descriptors/table/internal/table-columns.model.mjs +0 -2
- package/esm2022/lib/descriptors/table/internal/table.model.mjs +0 -2
- package/esm2022/lib/descriptors/table/sort.descriptor.mjs +0 -45
- package/esm2022/lib/descriptors/table/table.descriptor.mjs +0 -751
- package/esm2022/lib/descriptors/tableview/index.mjs +0 -2
- package/esm2022/lib/descriptors/tableview/internal/tableview.model.mjs +0 -2
- package/esm2022/lib/descriptors/tableview/tableview.descriptor.mjs +0 -558
- package/esm2022/lib/descriptors/types/action.type.mjs +0 -26
- package/esm2022/lib/descriptors/types/column.type.mjs +0 -21
- package/esm2022/lib/descriptors/types/editor.type.mjs +0 -8
- package/esm2022/lib/descriptors/types/field.type.mjs +0 -56
- package/esm2022/lib/descriptors/types/filter.type.mjs +0 -15
- package/esm2022/lib/descriptors/types/index.mjs +0 -8
- package/esm2022/lib/descriptors/types/table.type.mjs +0 -22
- package/esm2022/lib/descriptors/types/trim.type.mjs +0 -2
- package/esm2022/lib/directives/component.directive.mjs +0 -66
- package/esm2022/lib/directives/dialog-keydown-handler.directive.mjs +0 -49
- package/esm2022/lib/directives/index.mjs +0 -5
- package/esm2022/lib/directives/input-trim.directive.mjs +0 -55
- package/esm2022/lib/directives/template.directive.mjs +0 -29
- package/esm2022/lib/error/error.handler.mjs +0 -20
- package/esm2022/lib/error/index.mjs +0 -2
- package/esm2022/lib/guards/index.mjs +0 -2
- package/esm2022/lib/guards/unsaved-changes.guard.mjs +0 -4
- package/esm2022/lib/helpers/coercion.mjs +0 -52
- package/esm2022/lib/helpers/data-provider-executors.mjs +0 -80
- package/esm2022/lib/models/action-editor.model.mjs +0 -2
- package/esm2022/lib/models/can-component-deactivate.model.mjs +0 -2
- package/esm2022/lib/models/class.model.mjs +0 -2
- package/esm2022/lib/models/column-value.model.mjs +0 -2
- package/esm2022/lib/models/common-init-event-enum.model.mjs +0 -11
- package/esm2022/lib/models/config.model.mjs +0 -2
- package/esm2022/lib/models/data-list.model.mjs +0 -2
- package/esm2022/lib/models/enum.model.mjs +0 -2
- package/esm2022/lib/models/error.model.mjs +0 -44
- package/esm2022/lib/models/filter-match.model.mjs +0 -105
- package/esm2022/lib/models/index.mjs +0 -20
- package/esm2022/lib/models/layout-config.model.mjs +0 -2
- package/esm2022/lib/models/log.model.mjs +0 -10
- package/esm2022/lib/models/menu.model.mjs +0 -2
- package/esm2022/lib/models/radio.model.mjs +0 -2
- package/esm2022/lib/models/tableview-attr.model.mjs +0 -2
- package/esm2022/lib/models/type-registry.model.mjs +0 -2
- package/esm2022/lib/models/user.model.mjs +0 -2
- package/esm2022/lib/models/version.model.mjs +0 -2
- package/esm2022/lib/models/view-container.model.mjs +0 -2
- package/esm2022/lib/pipes/boolean.pipe.mjs +0 -28
- package/esm2022/lib/pipes/class-map.pipe.mjs +0 -23
- package/esm2022/lib/pipes/enum.pipe.mjs +0 -26
- package/esm2022/lib/pipes/enumerate-async.pipe.mjs +0 -41
- package/esm2022/lib/pipes/enumerate.pipe.mjs +0 -58
- package/esm2022/lib/pipes/getter.pipe.mjs +0 -21
- package/esm2022/lib/pipes/i18n-property.pipe.mjs +0 -19
- package/esm2022/lib/pipes/index.mjs +0 -12
- package/esm2022/lib/pipes/json-path.pipe.mjs +0 -25
- package/esm2022/lib/pipes/locale-default-row-class.pipe.mjs +0 -27
- package/esm2022/lib/pipes/models/internal/enumrate-pipe-i18n.model.mjs +0 -2
- package/esm2022/lib/pipes/models/internal/index.mjs +0 -2
- package/esm2022/lib/pipes/parametrize.pipe.mjs +0 -86
- package/esm2022/lib/pipes/template.pipe.mjs +0 -26
- package/esm2022/lib/provide.mjs +0 -101
- package/esm2022/lib/registry/type.registry.mjs +0 -106
- package/esm2022/lib/router/index.mjs +0 -4
- package/esm2022/lib/router/models/index.mjs +0 -2
- package/esm2022/lib/router/models/router.model.mjs +0 -2
- package/esm2022/lib/router/route-builder.mjs +0 -347
- package/esm2022/lib/router/routes-builder.mjs +0 -69
- package/esm2022/lib/router/tableview-route-builder.mjs +0 -201
- package/esm2022/lib/security/authorization.guard.mjs +0 -15
- package/esm2022/lib/security/authorization.service.mjs +0 -51
- package/esm2022/lib/security/authorization.util.mjs +0 -16
- package/esm2022/lib/security/index.mjs +0 -4
- package/esm2022/lib/security/model/authorization.type.mjs +0 -8
- package/esm2022/lib/security/model/index.mjs +0 -4
- package/esm2022/lib/security/model/permission-service.interface.mjs +0 -2
- package/esm2022/lib/security/model/permissions.model.mjs +0 -87
- package/esm2022/lib/services/action/action-executor.service.mjs +0 -747
- package/esm2022/lib/services/action/component-action-executor.service.mjs +0 -19
- package/esm2022/lib/services/action/index.mjs +0 -5
- package/esm2022/lib/services/action/provide-action-executor.mjs +0 -9
- package/esm2022/lib/services/action/root-action-executor.service.mjs +0 -18
- package/esm2022/lib/services/action-error-mapper.service.mjs +0 -20
- package/esm2022/lib/services/commons-init.service.mjs +0 -100
- package/esm2022/lib/services/commons.service.mjs +0 -459
- package/esm2022/lib/services/configuration.service.mjs +0 -174
- package/esm2022/lib/services/data-provider-executor.service.mjs +0 -52
- package/esm2022/lib/services/index.mjs +0 -12
- package/esm2022/lib/services/internal/commons-init.provider.mjs +0 -4
- package/esm2022/lib/services/internal/index.mjs +0 -2
- package/esm2022/lib/services/log-publisher-console.service.mjs +0 -40
- package/esm2022/lib/services/logger.service.mjs +0 -130
- package/esm2022/lib/services/mng-localstorage-config.service.mjs +0 -30
- package/esm2022/lib/services/navigation.service.mjs +0 -55
- package/esm2022/lib/services/providers/formly-config.provider.mjs +0 -31
- package/esm2022/lib/services/providers/index.mjs +0 -2
- package/esm2022/lib/services/router.service.mjs +0 -183
- package/esm2022/lib/services/tokens/browser-storage.token.mjs +0 -6
- package/esm2022/lib/services/tokens/commons-init.token.mjs +0 -3
- package/esm2022/lib/services/tokens/default-setting.token.mjs +0 -3
- package/esm2022/lib/services/tokens/index.mjs +0 -6
- package/esm2022/lib/services/tokens/log-publisher.token.mjs +0 -3
- package/esm2022/lib/services/tokens/module-config.token.mjs +0 -3
- package/esm2022/lib/services/version.service.mjs +0 -49
- package/esm2022/lib/services/view/index.mjs +0 -3
- package/esm2022/lib/services/view/provide-view-container.mjs +0 -17
- package/esm2022/lib/services/view/view-container.service.mjs +0 -59
- package/esm2022/lib/styles/button-style.builder.mjs +0 -174
- package/esm2022/lib/styles/index.mjs +0 -3
- package/esm2022/lib/styles/models/index.mjs +0 -3
- package/esm2022/lib/styles/models/style-level.enum.mjs +0 -12
- package/esm2022/lib/styles/models/style-size.enum.mjs +0 -9
- package/esm2022/lib/styles/styles.util.mjs +0 -42
- package/esm2022/lib/types/action-descriptor.types.mjs +0 -2
- package/esm2022/lib/types/data-provider.types.mjs +0 -2
- package/esm2022/lib/types/getter.type.mjs +0 -2
- package/esm2022/lib/types/i18n.type.mjs +0 -2
- package/esm2022/lib/types/index.mjs +0 -8
- package/esm2022/lib/types/localstorage-config-value.type.mjs +0 -2
- package/esm2022/lib/types/type.decorator.mjs +0 -12
- package/esm2022/lib/types/type.model.mjs +0 -2
- package/esm2022/lib/utils/data-list-params.util.mjs +0 -416
- package/esm2022/lib/utils/date.util.mjs +0 -136
- package/esm2022/lib/utils/decorator-metadata.util.mjs +0 -61
- package/esm2022/lib/utils/editor-formly.util.mjs +0 -339
- package/esm2022/lib/utils/enum.util.mjs +0 -83
- package/esm2022/lib/utils/error.util.mjs +0 -247
- package/esm2022/lib/utils/export.util.mjs +0 -21
- package/esm2022/lib/utils/file.util.mjs +0 -18
- package/esm2022/lib/utils/i18n.util.mjs +0 -274
- package/esm2022/lib/utils/index.mjs +0 -14
- package/esm2022/lib/utils/model.util.mjs +0 -73
- package/esm2022/lib/utils/notification.util.mjs +0 -45
- package/esm2022/lib/utils/object.util.mjs +0 -135
- package/esm2022/lib/utils/route.util.mjs +0 -60
- package/esm2022/lib/utils/string.util.mjs +0 -59
- package/esm2022/lib/utils/tableview.util.mjs +0 -193
- package/esm2022/lib/validators/field.validator.mjs +0 -33
- package/esm2022/lib/validators/index.mjs +0 -2
- package/fesm2022/mediusinc-mng-commons-data-api-class-dto-obsolete.mjs +0 -698
- package/fesm2022/mediusinc-mng-commons-data-api-class-dto-obsolete.mjs.map +0 -1
- package/fesm2022/mediusinc-mng-commons-data-api-class-dto.mjs +0 -480
- package/fesm2022/mediusinc-mng-commons-data-api-class-dto.mjs.map +0 -1
- package/fesm2022/mediusinc-mng-commons-data-api.mjs +0 -224
- package/fesm2022/mediusinc-mng-commons-data-api.mjs.map +0 -1
- package/lib/components/action/action.component.d.ts +0 -76
- package/lib/components/action/editor/action-editor.component.d.ts +0 -33
- package/lib/components/action/editor/injector-context/action-editor-injector-context.component.d.ts +0 -80
- package/lib/components/action/index.d.ts +0 -5
- package/lib/components/action/localization/data-language-dropdown.component.d.ts +0 -24
- package/lib/components/action/models/action-component.model.d.ts +0 -13
- package/lib/components/action/models/action-execution.model.d.ts +0 -169
- package/lib/components/action/models/index.d.ts +0 -3
- package/lib/components/action/route/action-route.component.d.ts +0 -31
- package/lib/components/action/table/action-table.component.d.ts +0 -49
- package/lib/components/form/autocomplete/autocomplete.component.d.ts +0 -83
- package/lib/components/form/date-range/date-range.component.d.ts +0 -28
- package/lib/components/form/dropdown/dropdown.component.d.ts +0 -54
- package/lib/components/form/editor/form-editor.component.d.ts +0 -51
- package/lib/components/form/formly/fields/formly-field-action/formly-field-action.component.d.ts +0 -16
- package/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.d.ts +0 -16
- package/lib/components/form/formly/fields/formly-field-custom/formly-custom-field-base.model.d.ts +0 -27
- package/lib/components/form/formly/fields/formly-field-custom/formly-field-custom.component.d.ts +0 -12
- package/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.d.ts +0 -15
- package/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.d.ts +0 -14
- package/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.d.ts +0 -39
- package/lib/components/form/formly/fields/formly-field-label/formly-field-label.component.d.ts +0 -11
- package/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +0 -45
- package/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +0 -25
- package/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +0 -42
- package/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.d.ts +0 -7
- package/lib/components/form/formly/fields/index.d.ts +0 -12
- package/lib/components/form/formly/formly.config.d.ts +0 -17
- package/lib/components/form/formly/index.d.ts +0 -1
- package/lib/components/form/formly/models/formly-config.model.d.ts +0 -11
- package/lib/components/form/formly/models/formly-field.model.d.ts +0 -17
- package/lib/components/form/formly/models/index.d.ts +0 -2
- package/lib/components/form/formly/wrappers/formly-field-no-label-wrapper/formly-field-no-label-wrapper.component.d.ts +0 -11
- package/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.d.ts +0 -11
- package/lib/components/form/formly/wrappers/index.d.ts +0 -2
- package/lib/components/form/index.d.ts +0 -4
- package/lib/components/form/models/field-action-context.model.d.ts +0 -24
- package/lib/components/form/models/form-editor.event.d.ts +0 -58
- package/lib/components/form/models/index.d.ts +0 -3
- package/lib/components/layout/breadcrumb.component.d.ts +0 -13
- package/lib/components/layout/footer.component.d.ts +0 -9
- package/lib/components/layout/index.d.ts +0 -8
- package/lib/components/layout/main-layout.component.d.ts +0 -19
- package/lib/components/layout/menu-item.component.d.ts +0 -55
- package/lib/components/layout/menu.component.d.ts +0 -16
- package/lib/components/layout/services/index.d.ts +0 -1
- package/lib/components/layout/services/main-layout.component.service.d.ts +0 -65
- package/lib/components/layout/topbar-user.component.d.ts +0 -22
- package/lib/components/layout/topbar.component.d.ts +0 -26
- package/lib/components/layout/version.component.d.ts +0 -19
- package/lib/components/layoutV2/breadcrumb.component.d.ts +0 -10
- package/lib/components/layoutV2/footer.component.d.ts +0 -12
- package/lib/components/layoutV2/index.d.ts +0 -7
- package/lib/components/layoutV2/main-layout.component.d.ts +0 -24
- package/lib/components/layoutV2/menu-item.component.d.ts +0 -42
- package/lib/components/layoutV2/menu.component.d.ts +0 -14
- package/lib/components/layoutV2/model/index.d.ts +0 -2
- package/lib/components/layoutV2/model/layout-state.model.d.ts +0 -10
- package/lib/components/layoutV2/model/menu.model.d.ts +0 -4
- package/lib/components/layoutV2/services/index.d.ts +0 -2
- package/lib/components/layoutV2/services/main-layout.component.service.d.ts +0 -17
- package/lib/components/layoutV2/services/menu.service.d.ts +0 -22
- package/lib/components/layoutV2/sidebar.component.d.ts +0 -19
- package/lib/components/layoutV2/topbar-user.component.d.ts +0 -16
- package/lib/components/layoutV2/topbar.component.d.ts +0 -22
- package/lib/components/layoutV2/version.component.d.ts +0 -19
- package/lib/components/pages/error/error.page.component.d.ts +0 -8
- package/lib/components/pages/index.d.ts +0 -2
- package/lib/components/pages/not-found/not-found.page.component.d.ts +0 -8
- package/lib/components/table/column-filter-full/column-filter-full.component.d.ts +0 -101
- package/lib/components/table/column-value/column-value.component.d.ts +0 -35
- package/lib/components/table/models/table.event.d.ts +0 -17
- package/lib/components/table/models/table.interface.d.ts +0 -17
- package/lib/components/table/table-column-filter-class/table-column-filter-class.pipe.d.ts +0 -8
- package/lib/components/table/table.component.d.ts +0 -123
- package/lib/components/tableview/actions/tableview-default-actions.d.ts +0 -36
- package/lib/components/tableview/builders/tableview-builder.d.ts +0 -115
- package/lib/components/tableview/helpers/tableview-create.d.ts +0 -16
- package/lib/components/tableview/index.d.ts +0 -6
- package/lib/components/tableview/models/tableview.model.d.ts +0 -8
- package/lib/components/tableview/route/tableview-route.component.d.ts +0 -7
- package/lib/components/tableview/tableview.component.d.ts +0 -29
- package/lib/data-providers/base.data-provider.d.ts +0 -32
- package/lib/data-providers/editor.data-provider.d.ts +0 -88
- package/lib/data-providers/index.d.ts +0 -5
- package/lib/data-providers/lookup.data-provider.d.ts +0 -27
- package/lib/data-providers/table.data-provider.d.ts +0 -40
- package/lib/data-providers/tableview.data-provider.d.ts +0 -45
- package/lib/descriptors/action/action-button.descriptor.d.ts +0 -25
- package/lib/descriptors/action/action-confirmation.descriptor.d.ts +0 -36
- package/lib/descriptors/action/action-editor.descriptor.d.ts +0 -118
- package/lib/descriptors/action/action-link.descriptor.d.ts +0 -34
- package/lib/descriptors/action/action.descriptor.d.ts +0 -149
- package/lib/descriptors/action/index.d.ts +0 -5
- package/lib/descriptors/editor/editor.descriptor.d.ts +0 -270
- package/lib/descriptors/editor/field-action.descriptor.d.ts +0 -23
- package/lib/descriptors/editor/field-base.descriptor.d.ts +0 -122
- package/lib/descriptors/editor/field-group.descriptor.d.ts +0 -42
- package/lib/descriptors/editor/field-lookup.descriptor.d.ts +0 -83
- package/lib/descriptors/editor/field-many.descriptor.d.ts +0 -63
- package/lib/descriptors/editor/field-validation.descriptor.d.ts +0 -19
- package/lib/descriptors/editor/field.descriptor.d.ts +0 -167
- package/lib/descriptors/editor/index.d.ts +0 -8
- package/lib/descriptors/editor/internal/editor-fields.model.d.ts +0 -33
- package/lib/descriptors/editor/internal/editor.model.d.ts +0 -15
- package/lib/descriptors/filter/filter-lookup.descriptor.d.ts +0 -70
- package/lib/descriptors/filter/filter.descriptor.d.ts +0 -66
- package/lib/descriptors/filter/index.d.ts +0 -2
- package/lib/descriptors/interfaces/field-config.interface.d.ts +0 -9
- package/lib/descriptors/interfaces/index.d.ts +0 -2
- package/lib/descriptors/interfaces/lookup-descriptor.interface.d.ts +0 -12
- package/lib/descriptors/model/enum.descriptor.d.ts +0 -14
- package/lib/descriptors/model/index.d.ts +0 -3
- package/lib/descriptors/model/model.descriptor.d.ts +0 -31
- package/lib/descriptors/model/type.descriptor.d.ts +0 -5
- package/lib/descriptors/table/column.descriptor.d.ts +0 -148
- package/lib/descriptors/table/index.d.ts +0 -3
- package/lib/descriptors/table/internal/table-columns.model.d.ts +0 -42
- package/lib/descriptors/table/internal/table.model.d.ts +0 -12
- package/lib/descriptors/table/table.descriptor.d.ts +0 -272
- package/lib/descriptors/tableview/index.d.ts +0 -1
- package/lib/descriptors/tableview/internal/tableview.model.d.ts +0 -11
- package/lib/descriptors/tableview/tableview.descriptor.d.ts +0 -193
- package/lib/descriptors/types/action.type.d.ts +0 -21
- package/lib/descriptors/types/editor.type.d.ts +0 -6
- package/lib/descriptors/types/field.type.d.ts +0 -47
- package/lib/descriptors/types/index.d.ts +0 -7
- package/lib/descriptors/types/table.type.d.ts +0 -18
- package/lib/directives/component.directive.d.ts +0 -20
- package/lib/directives/dialog-keydown-handler.directive.d.ts +0 -12
- package/lib/directives/index.d.ts +0 -4
- package/lib/directives/input-trim.directive.d.ts +0 -14
- package/lib/directives/template.directive.d.ts +0 -12
- package/lib/error/error.handler.d.ts +0 -6
- package/lib/error/index.d.ts +0 -1
- package/lib/guards/index.d.ts +0 -1
- package/lib/guards/unsaved-changes.guard.d.ts +0 -3
- package/lib/helpers/coercion.d.ts +0 -9
- package/lib/helpers/data-provider-executors.d.ts +0 -19
- package/lib/models/action-editor.model.d.ts +0 -15
- package/lib/models/column-value.model.d.ts +0 -4
- package/lib/models/common-init-event-enum.model.d.ts +0 -9
- package/lib/models/config.model.d.ts +0 -53
- package/lib/models/enum.model.d.ts +0 -7
- package/lib/models/error.model.d.ts +0 -50
- package/lib/models/index.d.ts +0 -19
- package/lib/models/layout-config.model.d.ts +0 -34
- package/lib/models/log.model.d.ts +0 -40
- package/lib/models/menu.model.d.ts +0 -32
- package/lib/models/tableview-attr.model.d.ts +0 -10
- package/lib/models/type-registry.model.d.ts +0 -7
- package/lib/models/user.model.d.ts +0 -8
- package/lib/models/view-container.model.d.ts +0 -24
- package/lib/pipes/boolean.pipe.d.ts +0 -7
- package/lib/pipes/class-map.pipe.d.ts +0 -7
- package/lib/pipes/enum.pipe.d.ts +0 -8
- package/lib/pipes/enumerate-async.pipe.d.ts +0 -14
- package/lib/pipes/enumerate.pipe.d.ts +0 -21
- package/lib/pipes/getter.pipe.d.ts +0 -8
- package/lib/pipes/i18n-property.pipe.d.ts +0 -8
- package/lib/pipes/index.d.ts +0 -11
- package/lib/pipes/json-path.pipe.d.ts +0 -13
- package/lib/pipes/locale-default-row-class.pipe.d.ts +0 -10
- package/lib/pipes/models/internal/enumrate-pipe-i18n.model.d.ts +0 -5
- package/lib/pipes/models/internal/index.d.ts +0 -1
- package/lib/pipes/parametrize.pipe.d.ts +0 -13
- package/lib/pipes/template.pipe.d.ts +0 -10
- package/lib/provide.d.ts +0 -10
- package/lib/registry/type.registry.d.ts +0 -25
- package/lib/router/index.d.ts +0 -3
- package/lib/router/models/index.d.ts +0 -1
- package/lib/router/models/router.model.d.ts +0 -31
- package/lib/router/route-builder.d.ts +0 -75
- package/lib/router/routes-builder.d.ts +0 -28
- package/lib/router/tableview-route-builder.d.ts +0 -44
- package/lib/security/authorization.guard.d.ts +0 -2
- package/lib/security/authorization.service.d.ts +0 -17
- package/lib/security/authorization.util.d.ts +0 -5
- package/lib/security/index.d.ts +0 -3
- package/lib/security/model/authorization.type.d.ts +0 -6
- package/lib/security/model/index.d.ts +0 -3
- package/lib/security/model/permission-service.interface.d.ts +0 -6
- package/lib/security/model/permissions.model.d.ts +0 -37
- package/lib/services/action/action-executor.service.d.ts +0 -177
- package/lib/services/action/component-action-executor.service.d.ts +0 -9
- package/lib/services/action/index.d.ts +0 -4
- package/lib/services/action/root-action-executor.service.d.ts +0 -9
- package/lib/services/action-error-mapper.service.d.ts +0 -18
- package/lib/services/commons-init.service.d.ts +0 -22
- package/lib/services/commons.service.d.ts +0 -90
- package/lib/services/configuration.service.d.ts +0 -68
- package/lib/services/data-provider-executor.service.d.ts +0 -60
- package/lib/services/index.d.ts +0 -11
- package/lib/services/internal/commons-init.provider.d.ts +0 -4
- package/lib/services/internal/index.d.ts +0 -1
- package/lib/services/log-publisher-console.service.d.ts +0 -4
- package/lib/services/logger.service.d.ts +0 -33
- package/lib/services/mng-localstorage-config.service.d.ts +0 -11
- package/lib/services/navigation.service.d.ts +0 -15
- package/lib/services/providers/formly-config.provider.d.ts +0 -5
- package/lib/services/providers/index.d.ts +0 -1
- package/lib/services/router.service.d.ts +0 -37
- package/lib/services/tokens/browser-storage.token.d.ts +0 -2
- package/lib/services/tokens/commons-init.token.d.ts +0 -3
- package/lib/services/tokens/default-setting.token.d.ts +0 -2
- package/lib/services/tokens/index.d.ts +0 -5
- package/lib/services/tokens/log-publisher.token.d.ts +0 -3
- package/lib/services/tokens/module-config.token.d.ts +0 -3
- package/lib/services/version.service.d.ts +0 -14
- package/lib/services/view/index.d.ts +0 -2
- package/lib/services/view/view-container.service.d.ts +0 -32
- package/lib/styles/button-style.builder.d.ts +0 -68
- package/lib/styles/index.d.ts +0 -2
- package/lib/styles/models/index.d.ts +0 -2
- package/lib/styles/models/style-level.enum.d.ts +0 -10
- package/lib/styles/models/style-size.enum.d.ts +0 -7
- package/lib/styles/styles.util.d.ts +0 -15
- package/lib/types/action-descriptor.types.d.ts +0 -4
- package/lib/types/data-provider.types.d.ts +0 -3
- package/lib/types/getter.type.d.ts +0 -2
- package/lib/types/i18n.type.d.ts +0 -1
- package/lib/types/index.d.ts +0 -7
- package/lib/types/localstorage-config-value.type.d.ts +0 -1
- package/lib/types/type.model.d.ts +0 -31
- package/lib/utils/data-list-params.util.d.ts +0 -84
- package/lib/utils/date.util.d.ts +0 -20
- package/lib/utils/decorator-metadata.util.d.ts +0 -33
- package/lib/utils/editor-formly.util.d.ts +0 -13
- package/lib/utils/enum.util.d.ts +0 -51
- package/lib/utils/error.util.d.ts +0 -116
- package/lib/utils/export.util.d.ts +0 -5
- package/lib/utils/file.util.d.ts +0 -3
- package/lib/utils/i18n.util.d.ts +0 -85
- package/lib/utils/index.d.ts +0 -13
- package/lib/utils/model.util.d.ts +0 -10
- package/lib/utils/notification.util.d.ts +0 -13
- package/lib/utils/object.util.d.ts +0 -30
- package/lib/utils/route.util.d.ts +0 -37
- package/lib/utils/string.util.d.ts +0 -9
- package/lib/utils/tableview.util.d.ts +0 -53
- package/lib/validators/field.validator.d.ts +0 -3
- package/lib/validators/index.d.ts +0 -1
- package/openapi/angular/README.mustache +0 -226
- package/openapi/angular/api.module.mustache +0 -39
- package/openapi/angular/api.service.mustache +0 -253
- package/openapi/angular/apiInterface.mustache +0 -47
- package/openapi/angular/apis.mustache +0 -12
- package/openapi/angular/config.yaml +0 -23
- package/openapi/angular/configuration.mustache +0 -128
- package/openapi/angular/custom/base-api.service.mustache +0 -14
- package/openapi/angular/custom/helpers.mustache +0 -71
- package/openapi/angular/custom/modelSchema.mustache +0 -46
- package/openapi/angular/custom/schema.mustache +0 -18
- package/openapi/angular/encoder.mustache +0 -20
- package/openapi/angular/git_push.sh.mustache +0 -57
- package/openapi/angular/index.mustache +0 -0
- package/openapi/angular/licenseInfo.mustache +0 -11
- package/openapi/angular/model.mustache +0 -16
- package/openapi/angular/modelAlias.mustache +0 -1
- package/openapi/angular/modelEnum.mustache +0 -21
- package/openapi/angular/modelGeneric.mustache +0 -14
- package/openapi/angular/modelGenericAdditionalProperties.mustache +0 -5
- package/openapi/angular/modelGenericEnums.mustache +0 -30
- package/openapi/angular/modelOneOf.mustache +0 -14
- package/openapi/angular/modelTaggedUnion.mustache +0 -21
- package/openapi/angular/models.mustache +0 -5
- package/openapi/angular/ng-package.mustache +0 -6
- package/openapi/angular/package.mustache +0 -39
- package/openapi/angular/param.mustache +0 -69
- package/openapi/angular/tsconfig.mustache +0 -28
- package/openapi/angular/variables.mustache +0 -9
- package/openapi/node/model.mustache +0 -83
- package/openapi/node/models.mustache +0 -6
- package/scss/common/layout/_breadcrumb.scss +0 -99
- package/scss/common/layout/_config.scss +0 -100
- package/scss/common/layout/_dashboard.scss +0 -16
- package/scss/common/layout/_exception.scss +0 -133
- package/scss/common/layout/_footer.scss +0 -29
- package/scss/common/layout/_help.scss +0 -156
- package/scss/common/layout/_inlinemenu.scss +0 -68
- package/scss/common/layout/_invoice.scss +0 -176
- package/scss/common/layout/_landing.scss +0 -636
- package/scss/common/layout/_layout_dark.scss +0 -23
- package/scss/common/layout/_layout_light.scss +0 -23
- package/scss/common/layout/_loader.scss +0 -17
- package/scss/common/layout/_login.scss +0 -106
- package/scss/common/layout/_main.scss +0 -45
- package/scss/common/layout/_mixins.scss +0 -222
- package/scss/common/layout/_rightmenu.scss +0 -130
- package/scss/common/layout/_topbar.scss +0 -191
- package/scss/common/layout/_typography.scss +0 -68
- package/scss/common/layout/_utils.scss +0 -96
- package/scss/common/layout/_widgets.scss +0 -392
- package/scss/common/layout/menu/_menu.scss +0 -7
- package/scss/common/layout/menu/_menu_common.scss +0 -183
- package/scss/common/layout/menu/_menu_overlay.scss +0 -52
- package/scss/common/layout/menu/_menu_sidebar.scss +0 -233
- package/scss/common/layout/menu/_menu_slim.scss +0 -137
- package/scss/common/layout/menu/_menu_static.scss +0 -70
- package/scss/common/layout/menu/_menu_theme.scss +0 -364
- package/scss/common/theme/_theme_dark.scss +0 -5
- package/scss/common/theme/_theme_light.scss +0 -5
- package/scss/common/theme/designer/_colors.scss +0 -17
- package/scss/common/theme/designer/_common.scss +0 -41
- package/scss/common/theme/designer/_components.scss +0 -102
- package/scss/common/theme/designer/_mixins.scss +0 -203
- package/scss/common/theme/designer/components/button/_button.scss +0 -572
- package/scss/common/theme/designer/components/button/_speeddial.scss +0 -81
- package/scss/common/theme/designer/components/button/_splitbutton.scss +0 -2
- package/scss/common/theme/designer/components/data/_carousel.scss +0 -37
- package/scss/common/theme/designer/components/data/_datatable.scss +0 -266
- package/scss/common/theme/designer/components/data/_dataview.scss +0 -55
- package/scss/common/theme/designer/components/data/_filter.scss +0 -137
- package/scss/common/theme/designer/components/data/_fullcalendar.scss +0 -324
- package/scss/common/theme/designer/components/data/_orderlist.scss +0 -91
- package/scss/common/theme/designer/components/data/_organizationchart.scss +0 -50
- package/scss/common/theme/designer/components/data/_paginator.scss +0 -83
- package/scss/common/theme/designer/components/data/_picklist.scss +0 -91
- package/scss/common/theme/designer/components/data/_timeline.scss +0 -35
- package/scss/common/theme/designer/components/data/_tree.scss +0 -144
- package/scss/common/theme/designer/components/data/_treetable.scss +0 -241
- package/scss/common/theme/designer/components/data/_virtualscroller.scss +0 -28
- package/scss/common/theme/designer/components/file/_fileupload.scss +0 -58
- package/scss/common/theme/designer/components/input/_autocomplete.scss +0 -105
- package/scss/common/theme/designer/components/input/_calendar.scss +0 -212
- package/scss/common/theme/designer/components/input/_cascadeselect.scss +0 -98
- package/scss/common/theme/designer/components/input/_checkbox.scss +0 -85
- package/scss/common/theme/designer/components/input/_chips.scss +0 -43
- package/scss/common/theme/designer/components/input/_colorpicker.scss +0 -19
- package/scss/common/theme/designer/components/input/_dropdown.scss +0 -136
- package/scss/common/theme/designer/components/input/_editor.scss +0 -122
- package/scss/common/theme/designer/components/input/_inputgroup.scss +0 -69
- package/scss/common/theme/designer/components/input/_inputmask.scss +0 -3
- package/scss/common/theme/designer/components/input/_inputnumber.scss +0 -3
- package/scss/common/theme/designer/components/input/_inputswitch.scss +0 -60
- package/scss/common/theme/designer/components/input/_inputtext.scss +0 -97
- package/scss/common/theme/designer/components/input/_listbox.scss +0 -82
- package/scss/common/theme/designer/components/input/_multiselect.scss +0 -165
- package/scss/common/theme/designer/components/input/_password.scss +0 -33
- package/scss/common/theme/designer/components/input/_radiobutton.scss +0 -78
- package/scss/common/theme/designer/components/input/_rating.scss +0 -48
- package/scss/common/theme/designer/components/input/_selectbutton.scss +0 -50
- package/scss/common/theme/designer/components/input/_slider.scss +0 -71
- package/scss/common/theme/designer/components/input/_togglebutton.scss +0 -48
- package/scss/common/theme/designer/components/input/_treeselect.scss +0 -91
- package/scss/common/theme/designer/components/menu/_breadcrumb.scss +0 -42
- package/scss/common/theme/designer/components/menu/_contextmenu.scss +0 -51
- package/scss/common/theme/designer/components/menu/_dock.scss +0 -51
- package/scss/common/theme/designer/components/menu/_megamenu.scss +0 -103
- package/scss/common/theme/designer/components/menu/_menu.scss +0 -41
- package/scss/common/theme/designer/components/menu/_menubar.scss +0 -180
- package/scss/common/theme/designer/components/menu/_panelmenu.scss +0 -136
- package/scss/common/theme/designer/components/menu/_slidemenu.scss +0 -56
- package/scss/common/theme/designer/components/menu/_steps.scss +0 -56
- package/scss/common/theme/designer/components/menu/_tabmenu.scss +0 -49
- package/scss/common/theme/designer/components/menu/_tieredmenu.scss +0 -57
- package/scss/common/theme/designer/components/messages/_inlinemessage.scss +0 -64
- package/scss/common/theme/designer/components/messages/_message.scss +0 -102
- package/scss/common/theme/designer/components/messages/_toast.scss +0 -94
- package/scss/common/theme/designer/components/misc/_avatar.scss +0 -30
- package/scss/common/theme/designer/components/misc/_badge.scss +0 -48
- package/scss/common/theme/designer/components/misc/_blockui.scss +0 -3
- package/scss/common/theme/designer/components/misc/_chip.scss +0 -38
- package/scss/common/theme/designer/components/misc/_inplace.scss +0 -16
- package/scss/common/theme/designer/components/misc/_progressbar.scss +0 -17
- package/scss/common/theme/designer/components/misc/_scrolltop.scss +0 -20
- package/scss/common/theme/designer/components/misc/_skeleton.scss +0 -8
- package/scss/common/theme/designer/components/misc/_tag.scss +0 -35
- package/scss/common/theme/designer/components/misc/_terminal.scss +0 -11
- package/scss/common/theme/designer/components/multimedia/_galleria.scss +0 -141
- package/scss/common/theme/designer/components/multimedia/_image.scss +0 -44
- package/scss/common/theme/designer/components/overlay/_confirmpopup.scss +0 -65
- package/scss/common/theme/designer/components/overlay/_dialog.scss +0 -63
- package/scss/common/theme/designer/components/overlay/_overlaypanel.scss +0 -62
- package/scss/common/theme/designer/components/overlay/_sidebar.scss +0 -27
- package/scss/common/theme/designer/components/overlay/_tooltip.scss +0 -33
- package/scss/common/theme/designer/components/panel/_accordion.scss +0 -119
- package/scss/common/theme/designer/components/panel/_card.scss +0 -30
- package/scss/common/theme/designer/components/panel/_divider.scss +0 -31
- package/scss/common/theme/designer/components/panel/_fieldset.scss +0 -47
- package/scss/common/theme/designer/components/panel/_panel.scss +0 -42
- package/scss/common/theme/designer/components/panel/_scrollpanel.scss +0 -6
- package/scss/common/theme/designer/components/panel/_splitter.scss +0 -19
- package/scss/common/theme/designer/components/panel/_tabview.scss +0 -66
- package/scss/common/theme/designer/components/panel/_toolbar.scss +0 -10
- package/scss/common/theme/extensions/_button.scss +0 -111
- package/scss/common/theme/extensions/_calendar.scss +0 -18
- package/scss/common/theme/extensions/_card.scss +0 -6
- package/scss/common/theme/extensions/_carousel.scss +0 -13
- package/scss/common/theme/extensions/_checkbox.scss +0 -10
- package/scss/common/theme/extensions/_contextmenu.scss +0 -16
- package/scss/common/theme/extensions/_datatable.scss +0 -83
- package/scss/common/theme/extensions/_dialog.scss +0 -14
- package/scss/common/theme/extensions/_fieldset.scss +0 -6
- package/scss/common/theme/extensions/_galleria.scss +0 -25
- package/scss/common/theme/extensions/_megamenu.scss +0 -18
- package/scss/common/theme/extensions/_menu.scss +0 -14
- package/scss/common/theme/extensions/_menubar.scss +0 -14
- package/scss/common/theme/extensions/_orderlist.scss +0 -37
- package/scss/common/theme/extensions/_paginator.scss +0 -19
- package/scss/common/theme/extensions/_panelmenu.scss +0 -20
- package/scss/common/theme/extensions/_password.scss +0 -5
- package/scss/common/theme/extensions/_picklist.scss +0 -37
- package/scss/common/theme/extensions/_radiobutton.scss +0 -8
- package/scss/common/theme/extensions/_sidebar.scss +0 -19
- package/scss/common/theme/extensions/_slidemenu.scss +0 -10
- package/scss/common/theme/extensions/_slider.scss +0 -6
- package/scss/common/theme/extensions/_steps.scss +0 -50
- package/scss/common/theme/extensions/_tieredmenu.scss +0 -14
- package/scss/common/theme/extensions/_toast.scss +0 -6
- package/scss/common/theme/extensions/_tree.scss +0 -35
- package/scss/common/theme/extensions/_treetable.scss +0 -35
- package/scss/common/theme/extensions/_vendor_extensions.scss +0 -27
- package/scss/common/variables/layout/_common.scss +0 -12
- package/scss/common/variables/layout/_layout_dark.scss +0 -70
- package/scss/common/variables/layout/_layout_light.scss +0 -70
- package/scss/common/variables/theme/_theme_dark.scss +0 -937
- package/scss/common/variables/theme/_theme_light.scss +0 -936
- package/scss/layout/default/_mng-variables-layout-dark.scss +0 -2
- package/scss/layout/default/_mng-variables-layout-light.scss +0 -2
- package/scss/layout/default/layout-dark.scss +0 -2
- package/scss/layout/default/layout-light.scss +0 -2
- package/scss/mng-commons-dark-v2.scss +0 -9
- package/scss/mng-commons-dark.scss +0 -5
- package/scss/mng-commons-light-v2.scss +0 -9
- package/scss/mng-commons-light.scss +0 -8
- package/scss/mng-overrides/_layout_action.scss +0 -10
- package/scss/mng-overrides/_layout_dialog.scss +0 -91
- package/scss/mng-overrides/_layout_forms.scss +0 -38
- package/scss/mng-overrides/_layout_menu.scss +0 -10
- package/scss/mng-overrides/_layout_radio.scss +0 -3
- package/scss/mng-overrides/_layout_styles.scss +0 -35
- package/scss/mng-overrides/_layout_topbar.scss +0 -21
- package/scss/mng-overrides/_mixins.scss +0 -69
- package/scss/mng-overrides/_theme_autocomplete.scss +0 -29
- package/scss/mng-overrides/_theme_button.scss +0 -61
- package/scss/mng-overrides/_theme_datatable.scss +0 -160
- package/scss/mng-overrides/_theme_datepicker.scss +0 -21
- package/scss/mng-overrides/_theme_dialog.scss +0 -108
- package/scss/mng-overrides/_theme_dropdown.scss +0 -22
- package/scss/mng-overrides/_theme_fileupload.scss +0 -24
- package/scss/mng-overrides/_theme_forms.scss +0 -29
- package/scss/mng-overrides/_theme_image.scss +0 -27
- package/scss/mng-overrides/_theme_input.scss +0 -27
- package/scss/mng-overrides/_theme_menu.scss +0 -5
- package/scss/mng-overrides/_theme_multiselect.scss +0 -20
- package/scss/mng-overrides/_theme_styles.scss +0 -17
- package/scss/mng-overrides/_theme_tableview.scss +0 -79
- package/scss/mng-overrides/_theme_tabview.scss +0 -11
- package/scss/mng-overrides/_theme_toast.scss +0 -3
- package/scss/mng-overrides/_theme_toolbar.scss +0 -5
- package/scss/mng-overrides/_variables.scss +0 -15
- package/scss/theme/default/_mng-variables-theme-dark.scss +0 -11
- package/scss/theme/default/_mng-variables-theme-light.scss +0 -13
- package/scss/theme/default/theme-dark.scss +0 -2
- package/scss/theme/default/theme-light.scss +0 -2
- package/scss/v2/layout/_animation.scss +0 -53
- package/scss/v2/layout/_breadcrumb.scss +0 -97
- package/scss/v2/layout/_config.scss +0 -42
- package/scss/v2/layout/_content.scss +0 -3
- package/scss/v2/layout/_fonts.scss +0 -32
- package/scss/v2/layout/_layout_dark.scss +0 -12
- package/scss/v2/layout/_layout_light.scss +0 -12
- package/scss/v2/layout/_main.scss +0 -54
- package/scss/v2/layout/_profile.scss +0 -10
- package/scss/v2/layout/_responsive.scss +0 -131
- package/scss/v2/layout/_sidebar_drawer.scss +0 -283
- package/scss/v2/layout/_sidebar_horizontal.scss +0 -168
- package/scss/v2/layout/_sidebar_reveal.scss +0 -201
- package/scss/v2/layout/_sidebar_slim.scss +0 -157
- package/scss/v2/layout/_sidebar_slim_plus.scss +0 -167
- package/scss/v2/layout/_sidebar_vertical.scss +0 -176
- package/scss/v2/layout/_topbar.scss +0 -174
- package/scss/v2/layout/_typography.scss +0 -62
- package/scss/v2/layout/_utils.scss +0 -33
- package/scss/v2/layout/layout.scss +0 -24
- package/scss/v2/layout/mng/_mng_layout_footer.scss +0 -39
- package/scss/v2/layout/mng/_mng_layout_menu.scss +0 -10
- package/scss/v2/layout/mng/_mng_layout_styles.scss +0 -3
- package/scss/v2/layout/mng/_mng_layout_topbar.scss +0 -18
- package/scss/v2/layout/preloading.scss +0 -84
- package/scss/v2/theme/extensions/_fullcalendar.scss +0 -328
- package/scss/v2/theme/theme-base/_colors.scss +0 -17
- package/scss/v2/theme/theme-base/_common.scss +0 -76
- package/scss/v2/theme/theme-base/_components.scss +0 -110
- package/scss/v2/theme/theme-base/_mixins.scss +0 -337
- package/scss/v2/theme/theme-base/components/button/_button.scss +0 -576
- package/scss/v2/theme/theme-base/components/button/_speeddial.scss +0 -96
- package/scss/v2/theme/theme-base/components/button/_splitbutton.scss +0 -348
- package/scss/v2/theme/theme-base/components/data/_carousel.scss +0 -37
- package/scss/v2/theme/theme-base/components/data/_datatable.scss +0 -338
- package/scss/v2/theme/theme-base/components/data/_dataview.scss +0 -46
- package/scss/v2/theme/theme-base/components/data/_filter.scss +0 -137
- package/scss/v2/theme/theme-base/components/data/_orderlist.scss +0 -114
- package/scss/v2/theme/theme-base/components/data/_organizationchart.scss +0 -50
- package/scss/v2/theme/theme-base/components/data/_paginator.scss +0 -92
- package/scss/v2/theme/theme-base/components/data/_picklist.scss +0 -114
- package/scss/v2/theme/theme-base/components/data/_timeline.scss +0 -35
- package/scss/v2/theme/theme-base/components/data/_tree.scss +0 -150
- package/scss/v2/theme/theme-base/components/data/_treetable.scss +0 -255
- package/scss/v2/theme/theme-base/components/data/_virtualscroller.scss +0 -28
- package/scss/v2/theme/theme-base/components/file/_fileupload.scss +0 -64
- package/scss/v2/theme/theme-base/components/input/_autocomplete.scss +0 -136
- package/scss/v2/theme/theme-base/components/input/_calendar.scss +0 -267
- package/scss/v2/theme/theme-base/components/input/_cascadeselect.scss +0 -135
- package/scss/v2/theme/theme-base/components/input/_checkbox.scss +0 -94
- package/scss/v2/theme/theme-base/components/input/_chips.scss +0 -65
- package/scss/v2/theme/theme-base/components/input/_colorpicker.scss +0 -19
- package/scss/v2/theme/theme-base/components/input/_dropdown.scss +0 -151
- package/scss/v2/theme/theme-base/components/input/_editor.scss +0 -122
- package/scss/v2/theme/theme-base/components/input/_inputgroup.scss +0 -74
- package/scss/v2/theme/theme-base/components/input/_inputmask.scss +0 -16
- package/scss/v2/theme/theme-base/components/input/_inputnumber.scss +0 -28
- package/scss/v2/theme/theme-base/components/input/_inputswitch.scss +0 -60
- package/scss/v2/theme/theme-base/components/input/_inputtext.scss +0 -100
- package/scss/v2/theme/theme-base/components/input/_listbox.scss +0 -97
- package/scss/v2/theme/theme-base/components/input/_multiselect.scss +0 -177
- package/scss/v2/theme/theme-base/components/input/_password.scss +0 -52
- package/scss/v2/theme/theme-base/components/input/_radiobutton.scss +0 -78
- package/scss/v2/theme/theme-base/components/input/_rating.scss +0 -60
- package/scss/v2/theme/theme-base/components/input/_selectbutton.scss +0 -50
- package/scss/v2/theme/theme-base/components/input/_slider.scss +0 -71
- package/scss/v2/theme/theme-base/components/input/_togglebutton.scss +0 -48
- package/scss/v2/theme/theme-base/components/input/_treeselect.scss +0 -139
- package/scss/v2/theme/theme-base/components/menu/_breadcrumb.scss +0 -42
- package/scss/v2/theme/theme-base/components/menu/_contextmenu.scss +0 -39
- package/scss/v2/theme/theme-base/components/menu/_dock.scss +0 -95
- package/scss/v2/theme/theme-base/components/menu/_megamenu.scss +0 -55
- package/scss/v2/theme/theme-base/components/menu/_menu.scss +0 -37
- package/scss/v2/theme/theme-base/components/menu/_menubar.scss +0 -140
- package/scss/v2/theme/theme-base/components/menu/_panelmenu.scss +0 -153
- package/scss/v2/theme/theme-base/components/menu/_slidemenu.scss +0 -59
- package/scss/v2/theme/theme-base/components/menu/_steps.scss +0 -56
- package/scss/v2/theme/theme-base/components/menu/_tabmenu.scss +0 -73
- package/scss/v2/theme/theme-base/components/menu/_tieredmenu.scss +0 -43
- package/scss/v2/theme/theme-base/components/messages/_inlinemessage.scss +0 -69
- package/scss/v2/theme/theme-base/components/messages/_message.scss +0 -107
- package/scss/v2/theme/theme-base/components/messages/_toast.scss +0 -99
- package/scss/v2/theme/theme-base/components/misc/_avatar.scss +0 -30
- package/scss/v2/theme/theme-base/components/misc/_badge.scss +0 -48
- package/scss/v2/theme/theme-base/components/misc/_blockui.scss +0 -0
- package/scss/v2/theme/theme-base/components/misc/_chip.scss +0 -42
- package/scss/v2/theme/theme-base/components/misc/_inplace.scss +0 -16
- package/scss/v2/theme/theme-base/components/misc/_progressbar.scss +0 -17
- package/scss/v2/theme/theme-base/components/misc/_scrolltop.scss +0 -25
- package/scss/v2/theme/theme-base/components/misc/_skeleton.scss +0 -8
- package/scss/v2/theme/theme-base/components/misc/_tag.scss +0 -40
- package/scss/v2/theme/theme-base/components/misc/_terminal.scss +0 -12
- package/scss/v2/theme/theme-base/components/multimedia/_galleria.scss +0 -155
- package/scss/v2/theme/theme-base/components/multimedia/_image.scss +0 -49
- package/scss/v2/theme/theme-base/components/overlay/_confirmpopup.scss +0 -70
- package/scss/v2/theme/theme-base/components/overlay/_dialog.scss +0 -69
- package/scss/v2/theme/theme-base/components/overlay/_overlaypanel.scss +0 -64
- package/scss/v2/theme/theme-base/components/overlay/_sidebar.scss +0 -27
- package/scss/v2/theme/theme-base/components/overlay/_tooltip.scss +0 -33
- package/scss/v2/theme/theme-base/components/panel/_accordion.scss +0 -119
- package/scss/v2/theme/theme-base/components/panel/_card.scss +0 -30
- package/scss/v2/theme/theme-base/components/panel/_divider.scss +0 -31
- package/scss/v2/theme/theme-base/components/panel/_fieldset.scss +0 -47
- package/scss/v2/theme/theme-base/components/panel/_panel.scss +0 -63
- package/scss/v2/theme/theme-base/components/panel/_scrollpanel.scss +0 -6
- package/scss/v2/theme/theme-base/components/panel/_splitter.scss +0 -19
- package/scss/v2/theme/theme-base/components/panel/_tabview.scss +0 -82
- package/scss/v2/theme/theme-base/components/panel/_toolbar.scss +0 -11
- package/scss/v2/theme/theme-base/mng/_mng_mixins.scss +0 -69
- package/scss/v2/theme/theme-base/mng/_mng_theme_autocomplete.scss +0 -34
- package/scss/v2/theme/theme-base/mng/_mng_theme_button.scss +0 -68
- package/scss/v2/theme/theme-base/mng/_mng_theme_datatable.scss +0 -153
- package/scss/v2/theme/theme-base/mng/_mng_theme_datepicker.scss +0 -21
- package/scss/v2/theme/theme-base/mng/_mng_theme_dialog.scss +0 -206
- package/scss/v2/theme/theme-base/mng/_mng_theme_dropdown.scss +0 -32
- package/scss/v2/theme/theme-base/mng/_mng_theme_fileupload.scss +0 -24
- package/scss/v2/theme/theme-base/mng/_mng_theme_forms.scss +0 -66
- package/scss/v2/theme/theme-base/mng/_mng_theme_image.scss +0 -27
- package/scss/v2/theme/theme-base/mng/_mng_theme_input.scss +0 -31
- package/scss/v2/theme/theme-base/mng/_mng_theme_menu.scss +0 -5
- package/scss/v2/theme/theme-base/mng/_mng_theme_multiselect.scss +0 -20
- package/scss/v2/theme/theme-base/mng/_mng_theme_styles.scss +0 -17
- package/scss/v2/theme/theme-base/mng/_mng_theme_tableview.scss +0 -97
- package/scss/v2/theme/theme-base/mng/_mng_theme_tabview.scss +0 -11
- package/scss/v2/theme/theme-base/mng/_mng_theme_toast.scss +0 -3
- package/scss/v2/theme/theme-base/mng/_mng_theme_toolbar.scss +0 -5
- package/scss/v2/theme/theme-base/mng/_mng_variables.scss +0 -15
- package/scss/v2/theme/theme-dark/_extensions.scss +0 -100
- package/scss/v2/theme/theme-dark/_variables.scss +0 -940
- package/scss/v2/theme/theme-dark/blue/theme.scss +0 -14
- package/scss/v2/theme/theme-light/_extensions.scss +0 -100
- package/scss/v2/theme/theme-light/_variables.scss +0 -936
- package/scss/v2/theme/theme-light/blue/theme.scss +0 -14
- /package/{lib → core}/components/notification/notification-wrapper.component.d.ts +0 -0
- /package/{lib/models → core/data-list}/data-list.model.d.ts +0 -0
- /package/{lib/models → core/data-list}/filter-match.model.d.ts +0 -0
- /package/{lib/models/class.model.d.ts → core/models/class-attribute.model.d.ts} +0 -0
- /package/{lib → core}/models/version.model.d.ts +0 -0
- /package/{lib/types/type.decorator.d.ts → core/reflect/type-enum-decorator.d.ts} +0 -0
- /package/{lib/descriptors/types/filter.type.d.ts → filter/models/filter.model.d.ts} +0 -0
- /package/{lib/descriptors/types/trim.type.d.ts → form/api/models/trim.model.d.ts} +0 -0
- /package/{assets/i18n → i18n}/en.json +0 -0
- /package/{assets/i18n → i18n}/sl.json +0 -0
- /package/{lib/descriptors/table → table/api/descriptors}/sort.descriptor.d.ts +0 -0
- /package/{lib/descriptors/types/column.type.d.ts → table/api/models/column.model.d.ts} +0 -0
- /package/{lib → tableview/action}/models/can-component-deactivate.model.d.ts +0 -0
- /package/{lib/services/action → tableview/action/services/providers}/provide-action-executor.d.ts +0 -0
- /package/{lib/services/view → tableview/action/services/providers}/provide-view-container.d.ts +0 -0
- /package/{lib/components → tableview/api}/action/models/tableview-action-default-categories.model.d.ts +0 -0
- /package/{lib/components/form → tableview/api/editor}/models/form-editor.interface.d.ts +0 -0
- /package/{lib → tableview/api/editor}/models/radio.model.d.ts +0 -0
|
@@ -0,0 +1,4372 @@
|
|
|
1
|
+
import { of, throwError, isObservable, Subject, tap } from 'rxjs';
|
|
2
|
+
import { StyleLevelEnum, CommonsInternalError, findReflectTypeName, DataProvider, LoggerService, StyleSizeEnum, DataProviderInst, ACommonsErrorBase, toObservable, TypeRegistry, getI18nTypePropertyKey, fromEnumValuesAsValueArray, fromEnumConstantsAsValueArray, getEnumConstantName, getI18nTypeTabKey, getI18nTypeGroupKey, GetterPipe, copyDataListParams } from '@mediusinc/mng-commons/core';
|
|
3
|
+
import { ActionButtonDescriptor, ButtonStyleBuilder, LookupDataProvider, ButtonStyleRoundedEnum } from '@mediusinc/mng-commons/form/api';
|
|
4
|
+
import { ModelDescriptor, trySetLookupItemsProperties, enumModelGeneric, findClassTitleAttribute } from '@mediusinc/mng-commons/model';
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { InjectionToken, Directive, Input, inject, Injector } from '@angular/core';
|
|
7
|
+
import { ColumnTypeEnum, ColumnDisplayTypeEnum, TableDataProvider, getColumnTypeFromClassAttributeDefType, getColumnDisplayTypeFromColumnType, TableDescriptor, TableDynamicDescriptor } from '@mediusinc/mng-commons/table/api';
|
|
8
|
+
import { Validators } from '@angular/forms';
|
|
9
|
+
import { FieldType } from '@ngx-formly/core';
|
|
10
|
+
import { ActivatedRoute } from '@angular/router';
|
|
11
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
12
|
+
import { map } from 'rxjs/operators';
|
|
13
|
+
|
|
14
|
+
var ActionPositionEnum;
|
|
15
|
+
(function (ActionPositionEnum) {
|
|
16
|
+
ActionPositionEnum[ActionPositionEnum["ToolbarLeft"] = 0] = "ToolbarLeft";
|
|
17
|
+
ActionPositionEnum[ActionPositionEnum["ToolbarRight"] = 1] = "ToolbarRight";
|
|
18
|
+
ActionPositionEnum[ActionPositionEnum["TableHeader"] = 2] = "TableHeader";
|
|
19
|
+
ActionPositionEnum[ActionPositionEnum["RowInline"] = 3] = "RowInline";
|
|
20
|
+
ActionPositionEnum[ActionPositionEnum["RowClick"] = 4] = "RowClick";
|
|
21
|
+
ActionPositionEnum[ActionPositionEnum["FooterLeft"] = 5] = "FooterLeft";
|
|
22
|
+
ActionPositionEnum[ActionPositionEnum["FooterRight"] = 6] = "FooterRight";
|
|
23
|
+
})(ActionPositionEnum || (ActionPositionEnum = {}));
|
|
24
|
+
var ActionActivationTriggerEnum;
|
|
25
|
+
(function (ActionActivationTriggerEnum) {
|
|
26
|
+
ActionActivationTriggerEnum[ActionActivationTriggerEnum["OnClick"] = 0] = "OnClick";
|
|
27
|
+
ActionActivationTriggerEnum[ActionActivationTriggerEnum["OnRoute"] = 1] = "OnRoute"; // action is triggered for activation by route url
|
|
28
|
+
})(ActionActivationTriggerEnum || (ActionActivationTriggerEnum = {}));
|
|
29
|
+
var ActionTypeEnum;
|
|
30
|
+
(function (ActionTypeEnum) {
|
|
31
|
+
ActionTypeEnum[ActionTypeEnum["Direct"] = 0] = "Direct";
|
|
32
|
+
ActionTypeEnum[ActionTypeEnum["Editor"] = 1] = "Editor"; // editor providing middle step for activation
|
|
33
|
+
})(ActionTypeEnum || (ActionTypeEnum = {}));
|
|
34
|
+
var ActionEditorSubmitTypeEnum;
|
|
35
|
+
(function (ActionEditorSubmitTypeEnum) {
|
|
36
|
+
ActionEditorSubmitTypeEnum[ActionEditorSubmitTypeEnum["Submit"] = 0] = "Submit";
|
|
37
|
+
ActionEditorSubmitTypeEnum[ActionEditorSubmitTypeEnum["Cancel"] = 1] = "Cancel";
|
|
38
|
+
})(ActionEditorSubmitTypeEnum || (ActionEditorSubmitTypeEnum = {}));
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Default categories for tableview actions
|
|
42
|
+
*/
|
|
43
|
+
class TableviewActionDefaultCategories {
|
|
44
|
+
static { this.READ = 'read'; }
|
|
45
|
+
static { this.ADD = 'add'; }
|
|
46
|
+
static { this.EDIT = 'edit'; }
|
|
47
|
+
static { this.DELETE = 'delete'; }
|
|
48
|
+
static { this.DETAILS = 'details'; }
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
class ActionConfirmationDescriptor {
|
|
52
|
+
constructor() {
|
|
53
|
+
this._closeOnEscape = true; // Defines if dialog closes when esc key is pressed.
|
|
54
|
+
this._closable = true; // Defines if dialog is closable.
|
|
55
|
+
this._acceptButton = new ActionButtonDescriptor().withIcon('pi pi-check').withStyleClass(new ButtonStyleBuilder(StyleLevelEnum.Default));
|
|
56
|
+
this._rejectButton = new ActionButtonDescriptor().withIcon('pi pi-times').withStyleClass(new ButtonStyleBuilder(StyleLevelEnum.Default).withTextButton());
|
|
57
|
+
this._icon = 'pi pi-exclamation-triangle';
|
|
58
|
+
}
|
|
59
|
+
withIcon(icon) {
|
|
60
|
+
this._icon = icon;
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
withTitle(title) {
|
|
64
|
+
this._title = title;
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
withMessage(message) {
|
|
68
|
+
this._message = message;
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
withAcceptButton(actionButtonDescriptor) {
|
|
72
|
+
this._acceptButton = actionButtonDescriptor;
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
75
|
+
withRejectButton(actionButtonDescriptor) {
|
|
76
|
+
this._rejectButton = actionButtonDescriptor;
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* set if dialog can be closed on escaped pressed
|
|
81
|
+
* if true, then closable is also set to true
|
|
82
|
+
* @param closeOnEscape
|
|
83
|
+
*/
|
|
84
|
+
withCloseOnEscape(closeOnEscape) {
|
|
85
|
+
if (closeOnEscape) {
|
|
86
|
+
this._closable = true;
|
|
87
|
+
}
|
|
88
|
+
this._closeOnEscape = closeOnEscape;
|
|
89
|
+
return this;
|
|
90
|
+
}
|
|
91
|
+
withClosable(closable) {
|
|
92
|
+
this._closable = closable;
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
withRunConfirmationConfigMapFn(runConfirmationConfigMapFn) {
|
|
96
|
+
this._runConfirmationConfigMapFn = runConfirmationConfigMapFn;
|
|
97
|
+
return this;
|
|
98
|
+
}
|
|
99
|
+
get icon() {
|
|
100
|
+
return this._icon;
|
|
101
|
+
}
|
|
102
|
+
get title() {
|
|
103
|
+
return this._title;
|
|
104
|
+
}
|
|
105
|
+
get message() {
|
|
106
|
+
return this._message;
|
|
107
|
+
}
|
|
108
|
+
get closeOnEscape() {
|
|
109
|
+
return this._closeOnEscape;
|
|
110
|
+
}
|
|
111
|
+
get closable() {
|
|
112
|
+
return this._closable;
|
|
113
|
+
}
|
|
114
|
+
get runConfirmationConfigMapFn() {
|
|
115
|
+
return this._runConfirmationConfigMapFn;
|
|
116
|
+
}
|
|
117
|
+
get acceptButton() {
|
|
118
|
+
return this._acceptButton;
|
|
119
|
+
}
|
|
120
|
+
get rejectButton() {
|
|
121
|
+
return this._rejectButton;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const actionGetProviderCfgObj = (serviceOrDataProvider) => {
|
|
126
|
+
const cfg = {};
|
|
127
|
+
if (serviceOrDataProvider) {
|
|
128
|
+
if (serviceOrDataProvider.isDataProvider) {
|
|
129
|
+
// type casting needed, cause there was no other way found to differentiate the types
|
|
130
|
+
cfg.dataProvider = serviceOrDataProvider;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
cfg.serviceType = serviceOrDataProvider;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return cfg;
|
|
137
|
+
};
|
|
138
|
+
class ActionDescriptorInst {
|
|
139
|
+
constructor(actionName, cfg) {
|
|
140
|
+
this._type = ActionTypeEnum.Direct;
|
|
141
|
+
this._activationTrigger = ActionActivationTriggerEnum.OnClick;
|
|
142
|
+
this._position = ActionPositionEnum.ToolbarRight;
|
|
143
|
+
this._level = StyleLevelEnum.Default;
|
|
144
|
+
this._routeUrl = null;
|
|
145
|
+
this._hasRunNotificationSuccess = true;
|
|
146
|
+
this._hasRunNotificationError = true;
|
|
147
|
+
//button
|
|
148
|
+
this._button = new ActionButtonDescriptor();
|
|
149
|
+
// multiple row selection
|
|
150
|
+
this._hasItemsSelection = false;
|
|
151
|
+
// subactions
|
|
152
|
+
this._subactionsAsMenu = false;
|
|
153
|
+
this._subactions = [];
|
|
154
|
+
this._model = cfg?.model;
|
|
155
|
+
this._actionName = actionName;
|
|
156
|
+
if ((cfg?.parentType && !cfg?.parentProperty) || (!cfg?.parentProperty && cfg?.parentProperty)) {
|
|
157
|
+
throw new CommonsInternalError(`Provide both the parent type and parent property or none: ${this._actionName}, ${cfg?.parentType}, ${cfg?.parentProperty}.`);
|
|
158
|
+
}
|
|
159
|
+
this._parentType = cfg?.parentType;
|
|
160
|
+
this._parentTypeName = cfg?.parentType ? findReflectTypeName(cfg?.parentType) ?? undefined : undefined;
|
|
161
|
+
this._parentProperty = cfg?.parentProperty;
|
|
162
|
+
this.setI18nModelActionBaseKey();
|
|
163
|
+
if (cfg?.serviceType) {
|
|
164
|
+
this._dataProvider = DataProvider.fromAnyParam(this._model?.type, cfg.serviceType);
|
|
165
|
+
}
|
|
166
|
+
else if (cfg?.dataProvider) {
|
|
167
|
+
this._dataProvider = cfg.dataProvider;
|
|
168
|
+
}
|
|
169
|
+
let displayName = actionName;
|
|
170
|
+
if (this._model)
|
|
171
|
+
displayName = `${this._model.typeName ?? this._model.i18nBaseKey ?? 'NoModelName'}.${displayName}`;
|
|
172
|
+
if (this._parentTypeName) {
|
|
173
|
+
displayName = `${this._parentTypeName}.${this._parentProperty}_${displayName}`;
|
|
174
|
+
}
|
|
175
|
+
this._actionNameLong = displayName;
|
|
176
|
+
}
|
|
177
|
+
get model() {
|
|
178
|
+
return this._model;
|
|
179
|
+
}
|
|
180
|
+
get parentTypeName() {
|
|
181
|
+
return this._parentTypeName;
|
|
182
|
+
}
|
|
183
|
+
get parentProperty() {
|
|
184
|
+
return this._parentProperty;
|
|
185
|
+
}
|
|
186
|
+
get i18nModelActionBaseKey() {
|
|
187
|
+
return this._i18nModelActionBaseKey;
|
|
188
|
+
}
|
|
189
|
+
get type() {
|
|
190
|
+
return this._type;
|
|
191
|
+
}
|
|
192
|
+
get activationTrigger() {
|
|
193
|
+
return this._activationTrigger;
|
|
194
|
+
}
|
|
195
|
+
get position() {
|
|
196
|
+
return this._position;
|
|
197
|
+
}
|
|
198
|
+
get level() {
|
|
199
|
+
return this._level;
|
|
200
|
+
}
|
|
201
|
+
get routeUrl() {
|
|
202
|
+
return this._routeUrl;
|
|
203
|
+
}
|
|
204
|
+
get dataProvider() {
|
|
205
|
+
return this._dataProvider;
|
|
206
|
+
}
|
|
207
|
+
get hasRunFunction() {
|
|
208
|
+
return typeof this._runFunction === 'function';
|
|
209
|
+
}
|
|
210
|
+
get runFunction() {
|
|
211
|
+
if (!this._runFunction) {
|
|
212
|
+
throw new CommonsInternalError(`Run function is not defined for action ${this._actionNameLong} and cannot be invoked`);
|
|
213
|
+
}
|
|
214
|
+
return this._runFunction;
|
|
215
|
+
}
|
|
216
|
+
get isVisibleFunction() {
|
|
217
|
+
return this._isVisibleFunction;
|
|
218
|
+
}
|
|
219
|
+
get isEnabledFunction() {
|
|
220
|
+
return this._isEnabledFunction;
|
|
221
|
+
}
|
|
222
|
+
get actionName() {
|
|
223
|
+
return this._actionName;
|
|
224
|
+
}
|
|
225
|
+
get actionNameLong() {
|
|
226
|
+
return this._actionNameLong;
|
|
227
|
+
}
|
|
228
|
+
get className() {
|
|
229
|
+
return this.button.styleClass.customClass;
|
|
230
|
+
}
|
|
231
|
+
get runConfirmationDialogDescriptor() {
|
|
232
|
+
return this._runConfirmationDialogDescriptor;
|
|
233
|
+
}
|
|
234
|
+
get hasRunConfirmation() {
|
|
235
|
+
return this._runConfirmationDialogDescriptor !== null && this._runConfirmationDialogDescriptor !== undefined;
|
|
236
|
+
}
|
|
237
|
+
get hasRunNotificationSuccess() {
|
|
238
|
+
return this._hasRunNotificationSuccess;
|
|
239
|
+
}
|
|
240
|
+
get runNotificationSuccessTitle() {
|
|
241
|
+
return this._runNotificationSuccessTitle;
|
|
242
|
+
}
|
|
243
|
+
get runNotificationSuccessMessage() {
|
|
244
|
+
return this._runNotificationSuccessMessage;
|
|
245
|
+
}
|
|
246
|
+
get hasRunNotificationError() {
|
|
247
|
+
return this._hasRunNotificationError;
|
|
248
|
+
}
|
|
249
|
+
get runNotificationErrorTitle() {
|
|
250
|
+
return this._runNotificationErrorTitle;
|
|
251
|
+
}
|
|
252
|
+
get runNotificationErrorMessage() {
|
|
253
|
+
return this._runNotificationErrorMessage;
|
|
254
|
+
}
|
|
255
|
+
get afterRunAction() {
|
|
256
|
+
return this._afterRunAction;
|
|
257
|
+
}
|
|
258
|
+
get onRunErrorAction() {
|
|
259
|
+
return this._onRunErrorAction;
|
|
260
|
+
}
|
|
261
|
+
get permissions() {
|
|
262
|
+
return this._permissions;
|
|
263
|
+
}
|
|
264
|
+
get tableviewCategory() {
|
|
265
|
+
return this._tableviewCategory;
|
|
266
|
+
}
|
|
267
|
+
get hasItemsSelection() {
|
|
268
|
+
return this._hasItemsSelection;
|
|
269
|
+
}
|
|
270
|
+
get button() {
|
|
271
|
+
return this._button;
|
|
272
|
+
}
|
|
273
|
+
get component() {
|
|
274
|
+
return this._component;
|
|
275
|
+
}
|
|
276
|
+
get componentFromDi() {
|
|
277
|
+
return this._componentFromDi;
|
|
278
|
+
}
|
|
279
|
+
get positionTableviewCategories() {
|
|
280
|
+
return this._positionTableviewCategories;
|
|
281
|
+
}
|
|
282
|
+
get subactionsAsMenu() {
|
|
283
|
+
return this._subactionsAsMenu;
|
|
284
|
+
}
|
|
285
|
+
get subactions() {
|
|
286
|
+
return this._subactions;
|
|
287
|
+
}
|
|
288
|
+
setI18nModelActionBaseKey(base) {
|
|
289
|
+
if (this._parentTypeName || this._model) {
|
|
290
|
+
this._i18nModelActionBaseKey = this._parentTypeName
|
|
291
|
+
? `${this._parentTypeName}.actions.${this._parentProperty}_${this._actionName}`
|
|
292
|
+
: `${base ?? this._model.i18nBaseKey}.actions.${this._actionName}`;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
withRunFunction(fn) {
|
|
296
|
+
this._runFunction = fn;
|
|
297
|
+
return this;
|
|
298
|
+
}
|
|
299
|
+
withIsVisibleFunction(fn) {
|
|
300
|
+
this._isVisibleFunction = fn;
|
|
301
|
+
return this;
|
|
302
|
+
}
|
|
303
|
+
withIsEnabledFunction(fn) {
|
|
304
|
+
this._isEnabledFunction = fn;
|
|
305
|
+
return this;
|
|
306
|
+
}
|
|
307
|
+
withRouteTrigger(routeUrl) {
|
|
308
|
+
this._activationTrigger = ActionActivationTriggerEnum.OnRoute;
|
|
309
|
+
this._routeUrl = routeUrl;
|
|
310
|
+
return this;
|
|
311
|
+
}
|
|
312
|
+
withPosition(position) {
|
|
313
|
+
this._position = position;
|
|
314
|
+
return this;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* creates confirmation action with default style based on action descriptor
|
|
318
|
+
*/
|
|
319
|
+
withRunConfirmation() {
|
|
320
|
+
this._runConfirmationDialogDescriptor = new ActionConfirmationDescriptor();
|
|
321
|
+
this._runConfirmationDialogDescriptor.acceptButton.styleClass.withActionLevel(this._level);
|
|
322
|
+
this._runConfirmationDialogDescriptor.rejectButton?.styleClass.withActionLevel(this._level);
|
|
323
|
+
return this._runConfirmationDialogDescriptor;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Add a configuration dialogue to action using ActionConfigurationDescriptor
|
|
327
|
+
* @param runConfirmationDialogDescriptor descriptor with customizable information for dialog
|
|
328
|
+
*/
|
|
329
|
+
withRunConfirmationDescriptor(runConfirmationDialogDescriptor) {
|
|
330
|
+
this._runConfirmationDialogDescriptor = runConfirmationDialogDescriptor;
|
|
331
|
+
return this;
|
|
332
|
+
}
|
|
333
|
+
withRunNotificationSuccess(title, message, hasNotification = true) {
|
|
334
|
+
this._hasRunNotificationSuccess = hasNotification;
|
|
335
|
+
this._runNotificationSuccessTitle = title;
|
|
336
|
+
this._runNotificationSuccessMessage = message;
|
|
337
|
+
return this;
|
|
338
|
+
}
|
|
339
|
+
withRunNotificationError(title, message, hasNotification = true) {
|
|
340
|
+
this._hasRunNotificationError = hasNotification;
|
|
341
|
+
this._runNotificationErrorTitle = title;
|
|
342
|
+
this._runNotificationErrorMessage = message;
|
|
343
|
+
return this;
|
|
344
|
+
}
|
|
345
|
+
withAfterRunAction(action) {
|
|
346
|
+
this._afterRunAction = action;
|
|
347
|
+
return this;
|
|
348
|
+
}
|
|
349
|
+
withOnRunErrorAction(action) {
|
|
350
|
+
this._onRunErrorAction = action;
|
|
351
|
+
return this;
|
|
352
|
+
}
|
|
353
|
+
withPermissions(permissions) {
|
|
354
|
+
if (this._tableviewCategory) {
|
|
355
|
+
LoggerService.get().debug(`WARNING: Permissions set on action ${this._actionNameLong} with route type '${this._tableviewCategory}' will be omitted in route guard validation.`);
|
|
356
|
+
}
|
|
357
|
+
this._permissions = permissions;
|
|
358
|
+
return this;
|
|
359
|
+
}
|
|
360
|
+
withTableviewCategory(permissionsRouteType) {
|
|
361
|
+
this._tableviewCategory = permissionsRouteType;
|
|
362
|
+
return this;
|
|
363
|
+
}
|
|
364
|
+
withButtonDescriptor(button) {
|
|
365
|
+
this._button = button;
|
|
366
|
+
return this;
|
|
367
|
+
}
|
|
368
|
+
withButton(label, icon = null, styleLevel = StyleLevelEnum.Default, styleText = false) {
|
|
369
|
+
this._button = new ActionButtonDescriptor().withLabel(label).withIcon(icon).withStyleClass(new ButtonStyleBuilder(styleLevel).withTextButton(styleText));
|
|
370
|
+
return this;
|
|
371
|
+
}
|
|
372
|
+
withItemsSelection(hasSelection = true) {
|
|
373
|
+
this._hasItemsSelection = hasSelection;
|
|
374
|
+
this._isEnabledFunction = this._isEnabledFunction ?? (ctx => of((ctx.parameters.selectedItems?.length ?? 0) > 0));
|
|
375
|
+
return this;
|
|
376
|
+
}
|
|
377
|
+
withComponent(component) {
|
|
378
|
+
this._component = component;
|
|
379
|
+
return this;
|
|
380
|
+
}
|
|
381
|
+
withComponentFromDi(injectionToken) {
|
|
382
|
+
this._componentFromDi = injectionToken;
|
|
383
|
+
return this;
|
|
384
|
+
}
|
|
385
|
+
withPositionTableviewCategories(positionTableviewCategories) {
|
|
386
|
+
this._positionTableviewCategories = positionTableviewCategories;
|
|
387
|
+
return this;
|
|
388
|
+
}
|
|
389
|
+
withI18nBase(base) {
|
|
390
|
+
if (typeof base !== 'string') {
|
|
391
|
+
const typeName = findReflectTypeName(base);
|
|
392
|
+
if (!typeName) {
|
|
393
|
+
throw new CommonsInternalError(`Could not find define i18nBaseKey for ${base} on action ${this.actionNameLong}`);
|
|
394
|
+
}
|
|
395
|
+
base = typeName;
|
|
396
|
+
}
|
|
397
|
+
this.setI18nModelActionBaseKey(base);
|
|
398
|
+
return this;
|
|
399
|
+
}
|
|
400
|
+
withSubactionsAsMenu(subactionsAsMenu = true) {
|
|
401
|
+
this._subactionsAsMenu = subactionsAsMenu;
|
|
402
|
+
return this;
|
|
403
|
+
}
|
|
404
|
+
withSubactions(...subactions) {
|
|
405
|
+
this._subactions.push(...subactions);
|
|
406
|
+
return this;
|
|
407
|
+
}
|
|
408
|
+
copyTo(descriptor) {
|
|
409
|
+
descriptor._i18nModelActionBaseKey = this._i18nModelActionBaseKey;
|
|
410
|
+
descriptor._type = this._type;
|
|
411
|
+
descriptor._activationTrigger = this._activationTrigger;
|
|
412
|
+
descriptor._position = this._position;
|
|
413
|
+
descriptor._level = this._level;
|
|
414
|
+
descriptor._positionTableviewCategories = this._positionTableviewCategories;
|
|
415
|
+
descriptor._tableviewCategory = this._tableviewCategory;
|
|
416
|
+
descriptor._routeUrl = this._routeUrl;
|
|
417
|
+
descriptor._runFunction = this._runFunction;
|
|
418
|
+
descriptor._isVisibleFunction = this._isVisibleFunction;
|
|
419
|
+
descriptor._isEnabledFunction = this._isEnabledFunction;
|
|
420
|
+
descriptor._runConfirmationDialogDescriptor = this._runConfirmationDialogDescriptor;
|
|
421
|
+
descriptor._hasRunNotificationSuccess = this._hasRunNotificationSuccess;
|
|
422
|
+
descriptor._runNotificationSuccessTitle = this._runNotificationSuccessTitle;
|
|
423
|
+
descriptor._runNotificationSuccessMessage = this._runNotificationSuccessMessage;
|
|
424
|
+
descriptor._hasRunNotificationError = this._hasRunNotificationError;
|
|
425
|
+
descriptor._runNotificationErrorTitle = this._runNotificationErrorTitle;
|
|
426
|
+
descriptor._runNotificationErrorMessage = this._runNotificationErrorMessage;
|
|
427
|
+
descriptor._afterRunAction = this._afterRunAction;
|
|
428
|
+
descriptor._onRunErrorAction = this._onRunErrorAction;
|
|
429
|
+
descriptor._permissions = this._permissions;
|
|
430
|
+
descriptor._button = this._button.copy();
|
|
431
|
+
descriptor._hasItemsSelection = this._hasItemsSelection;
|
|
432
|
+
descriptor._component = this._component;
|
|
433
|
+
descriptor._subactionsAsMenu = this._subactionsAsMenu;
|
|
434
|
+
descriptor._subactions = this._subactions;
|
|
435
|
+
return descriptor;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
class ActionDescriptor extends ActionDescriptorInst {
|
|
439
|
+
constructor() {
|
|
440
|
+
super('internal');
|
|
441
|
+
}
|
|
442
|
+
static create(actionName, cfg) {
|
|
443
|
+
return new ActionDescriptorInst(actionName, {
|
|
444
|
+
...cfg
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
static createWithProvider(serviceProvider, actionName, cfg) {
|
|
448
|
+
return new ActionDescriptorInst(actionName, {
|
|
449
|
+
...actionGetProviderCfgObj(serviceProvider),
|
|
450
|
+
...cfg
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
static fromModel(model, actionName, cfg) {
|
|
454
|
+
return new ActionDescriptorInst(actionName, {
|
|
455
|
+
model,
|
|
456
|
+
...cfg
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
static fromModelWithProvider(model, serviceProvider, actionName, cfg) {
|
|
460
|
+
return new ActionDescriptorInst(actionName, {
|
|
461
|
+
model,
|
|
462
|
+
...actionGetProviderCfgObj(serviceProvider),
|
|
463
|
+
...cfg
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
static fromClass(type, actionName, cfg) {
|
|
467
|
+
return new ActionDescriptorInst(actionName, {
|
|
468
|
+
model: ModelDescriptor.fromClass(type, cfg?.idProperty, cfg?.titleProperty, cfg?.i18nBaseKey),
|
|
469
|
+
...cfg
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
static fromClassWithProvider(classType, serviceProvider, actionName, cfg) {
|
|
473
|
+
return new ActionDescriptorInst(actionName, {
|
|
474
|
+
model: ModelDescriptor.fromClass(classType, cfg?.idProperty, cfg?.titleProperty, cfg?.i18nBaseKey),
|
|
475
|
+
...actionGetProviderCfgObj(serviceProvider),
|
|
476
|
+
...cfg
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
class ActionDeleteDescriptorInst extends ActionDescriptorInst {
|
|
481
|
+
static { this.ACTION_NAME = 'delete'; }
|
|
482
|
+
constructor(model, cfg) {
|
|
483
|
+
super(ActionDeleteDescriptorInst.ACTION_NAME, { model, ...cfg });
|
|
484
|
+
this.withPosition(ActionPositionEnum.RowInline);
|
|
485
|
+
this.button.styleClass.withSize(StyleSizeEnum.Small);
|
|
486
|
+
this.button.styleClass.withActionLevel(StyleLevelEnum.Danger);
|
|
487
|
+
this.withRunConfirmation();
|
|
488
|
+
this.withTableviewCategory(TableviewActionDefaultCategories.DELETE);
|
|
489
|
+
this.button.withLabel(null).withIcon('pi pi-trash');
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
class ActionDeleteDescriptor {
|
|
493
|
+
static create(model) {
|
|
494
|
+
return new ActionDeleteDescriptorInst(model);
|
|
495
|
+
}
|
|
496
|
+
static createWithProvider(model, serviceProvider) {
|
|
497
|
+
return new ActionDeleteDescriptorInst(model, {
|
|
498
|
+
...actionGetProviderCfgObj(serviceProvider)
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
class EditorDataProviderInst extends DataProviderInst {
|
|
504
|
+
constructor(type, serviceType) {
|
|
505
|
+
super(type, serviceType);
|
|
506
|
+
this._fetch = id => throwError(() => new CommonsInternalError(`No fetch function provided for id ${id}.`));
|
|
507
|
+
}
|
|
508
|
+
get fetch() {
|
|
509
|
+
return this._fetch;
|
|
510
|
+
}
|
|
511
|
+
get create() {
|
|
512
|
+
return this._create;
|
|
513
|
+
}
|
|
514
|
+
get update() {
|
|
515
|
+
return this._update;
|
|
516
|
+
}
|
|
517
|
+
get delete() {
|
|
518
|
+
return this._delete;
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* Sets the fetch function for the EditorDataProvider instance.
|
|
522
|
+
*
|
|
523
|
+
* @param {EditorDataProviderFetchFnType<Model, Service>} fn - The fetch function to be set.
|
|
524
|
+
* @returns {this} - The instance of the EditorDataProvider with the fetch function set.
|
|
525
|
+
*
|
|
526
|
+
* @typeparam Model The type of data this DataProvider will handle.
|
|
527
|
+
* @typeparam Service The type of service used by this DataProvider.
|
|
528
|
+
*/
|
|
529
|
+
withFetch(fn) {
|
|
530
|
+
this._fetch = fn;
|
|
531
|
+
return this;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Sets the create function for the EditorDataProvider.
|
|
535
|
+
*
|
|
536
|
+
* @param {EditorDataProviderCreateFnType<Model, Service>} fn - The function used for creating new items.
|
|
537
|
+
* @returns {this} - Returns the instance of the class.
|
|
538
|
+
*
|
|
539
|
+
* @typeparam Model The type of data this DataProvider will handle.
|
|
540
|
+
* @typeparam Service The type of service used by this DataProvider.
|
|
541
|
+
*/
|
|
542
|
+
withCreate(fn) {
|
|
543
|
+
this._create = fn;
|
|
544
|
+
return this;
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* Sets the update function for the EditorDataProvider.
|
|
548
|
+
*
|
|
549
|
+
* @param {EditorDataProviderUpdateFnType<Model, Service>} fn - The update function to be set.
|
|
550
|
+
* @returns {this} - Returns the instance of the object calling this method.
|
|
551
|
+
*
|
|
552
|
+
* @typeparam Model The type of data this DataProvider will handle.
|
|
553
|
+
* @typeparam Service The type of service used by this DataProvider.
|
|
554
|
+
*/
|
|
555
|
+
withUpdate(fn) {
|
|
556
|
+
this._update = fn;
|
|
557
|
+
return this;
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Sets the delete function for the editor data provider.
|
|
561
|
+
*
|
|
562
|
+
* @param {EditorDataProviderDeleteFnType<Model, Service>} fn - The delete function to be set.
|
|
563
|
+
*
|
|
564
|
+
* @returns {this} - Returns the instance of the current class.
|
|
565
|
+
*
|
|
566
|
+
* @typeparam Model The type of data this DataProvider will handle.
|
|
567
|
+
* @typeparam Service The type of service used by this DataProvider.
|
|
568
|
+
*/
|
|
569
|
+
withDelete(fn) {
|
|
570
|
+
this._delete = fn;
|
|
571
|
+
return this;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
class EditorDataProvider extends EditorDataProviderInst {
|
|
575
|
+
constructor() {
|
|
576
|
+
super(undefined, undefined);
|
|
577
|
+
}
|
|
578
|
+
static create() {
|
|
579
|
+
return new EditorDataProviderInst(undefined, undefined);
|
|
580
|
+
}
|
|
581
|
+
static fromClass(type) {
|
|
582
|
+
return new EditorDataProviderInst(type, undefined);
|
|
583
|
+
}
|
|
584
|
+
static fromClassWithService(type, serviceType) {
|
|
585
|
+
return new EditorDataProviderInst(type, serviceType);
|
|
586
|
+
}
|
|
587
|
+
static fromService(serviceType) {
|
|
588
|
+
return new EditorDataProviderInst(undefined, serviceType);
|
|
589
|
+
}
|
|
590
|
+
static fromAnyParam(type, serviceType) {
|
|
591
|
+
if (typeof type !== 'undefined') {
|
|
592
|
+
return typeof serviceType !== 'undefined'
|
|
593
|
+
? EditorDataProvider.fromClassWithService(type, serviceType)
|
|
594
|
+
: EditorDataProvider.fromClass(type);
|
|
595
|
+
}
|
|
596
|
+
else if (typeof serviceType !== 'undefined') {
|
|
597
|
+
return EditorDataProvider.fromService(serviceType);
|
|
598
|
+
}
|
|
599
|
+
else {
|
|
600
|
+
return EditorDataProvider.create();
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
const actionEditorGetProviderCfgObj = (serviceOrDataProvider) => {
|
|
606
|
+
const cfg = {};
|
|
607
|
+
if (serviceOrDataProvider) {
|
|
608
|
+
if (serviceOrDataProvider.isDataProvider) {
|
|
609
|
+
// type casting needed, cause there was no other way found to differentiate the types
|
|
610
|
+
cfg.dataProvider = serviceOrDataProvider;
|
|
611
|
+
}
|
|
612
|
+
else {
|
|
613
|
+
cfg.serviceType = serviceOrDataProvider;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
return cfg;
|
|
617
|
+
};
|
|
618
|
+
class ActionEditorDescriptorInst extends ActionDescriptorInst {
|
|
619
|
+
constructor(editorDescriptor, actionName, cfg) {
|
|
620
|
+
super(actionName, {
|
|
621
|
+
model: editorDescriptor.model,
|
|
622
|
+
...cfg
|
|
623
|
+
});
|
|
624
|
+
this._dataProvider = undefined;
|
|
625
|
+
this._editorActions = [];
|
|
626
|
+
this._editorTitle = undefined;
|
|
627
|
+
this._editorTitleParams = undefined;
|
|
628
|
+
this._hasFetchNotificationSuccess = false;
|
|
629
|
+
this._dialogSize = StyleSizeEnum.Normal;
|
|
630
|
+
this._resubmitRefetch = true;
|
|
631
|
+
this._unsavedChangesConfirmation = false;
|
|
632
|
+
if (cfg?.serviceType) {
|
|
633
|
+
this._dataProvider = EditorDataProvider.fromAnyParam(this._model?.type, cfg.serviceType);
|
|
634
|
+
}
|
|
635
|
+
else if (cfg?.dataProvider) {
|
|
636
|
+
this._dataProvider = cfg.dataProvider;
|
|
637
|
+
}
|
|
638
|
+
this._type = ActionTypeEnum.Editor;
|
|
639
|
+
this._editorDescriptor = editorDescriptor;
|
|
640
|
+
this._editorActions.push(ActionEditorSubmitDescriptor.forPrimary(this), ActionEditorSubmitDescriptor.forSecondary(this));
|
|
641
|
+
}
|
|
642
|
+
get editorTitle() {
|
|
643
|
+
return this._editorTitle;
|
|
644
|
+
}
|
|
645
|
+
get editorTitleParams() {
|
|
646
|
+
return this._editorTitleParams;
|
|
647
|
+
}
|
|
648
|
+
get editorDescriptor() {
|
|
649
|
+
return this._editorDescriptor;
|
|
650
|
+
}
|
|
651
|
+
get dialogSize() {
|
|
652
|
+
return this._dialogSize;
|
|
653
|
+
}
|
|
654
|
+
get dialogClassName() {
|
|
655
|
+
return this._dialogClassName;
|
|
656
|
+
}
|
|
657
|
+
get hasFetchNotificationSuccess() {
|
|
658
|
+
return this._hasFetchNotificationSuccess;
|
|
659
|
+
}
|
|
660
|
+
get fetchNotificationSuccessTitle() {
|
|
661
|
+
return this._fetchNotificationSuccessTitle;
|
|
662
|
+
}
|
|
663
|
+
get fetchNotificationSuccessMessage() {
|
|
664
|
+
return this._fetchNotificationSuccessMessage;
|
|
665
|
+
}
|
|
666
|
+
get dataProvider() {
|
|
667
|
+
return this._dataProvider;
|
|
668
|
+
}
|
|
669
|
+
get hasRunFunction() {
|
|
670
|
+
throw new CommonsInternalError(`Run function cannot be used in editor action for ${this._actionNameLong}. Use submit function instead`);
|
|
671
|
+
}
|
|
672
|
+
get runFunction() {
|
|
673
|
+
throw new CommonsInternalError(`Run function cannot be used in editor action for ${this._actionNameLong}. Use submit function instead`);
|
|
674
|
+
}
|
|
675
|
+
get hasFetchFunction() {
|
|
676
|
+
return typeof this._fetchFunction === 'function';
|
|
677
|
+
}
|
|
678
|
+
get fetchFunction() {
|
|
679
|
+
return this._fetchFunction;
|
|
680
|
+
}
|
|
681
|
+
get hasSubmitFunction() {
|
|
682
|
+
return typeof this._fetchFunction === 'function';
|
|
683
|
+
}
|
|
684
|
+
get submitFunction() {
|
|
685
|
+
return this._submitFunction;
|
|
686
|
+
}
|
|
687
|
+
get editorActions() {
|
|
688
|
+
return this._editorActions;
|
|
689
|
+
}
|
|
690
|
+
get editorComponent() {
|
|
691
|
+
return this._editorComponent;
|
|
692
|
+
}
|
|
693
|
+
get resubmitEnabled() {
|
|
694
|
+
return this._resubmitEnabled;
|
|
695
|
+
}
|
|
696
|
+
get resubmitRefetch() {
|
|
697
|
+
return this._resubmitRefetch;
|
|
698
|
+
}
|
|
699
|
+
get unsavedChangesConfirmation() {
|
|
700
|
+
return this._unsavedChangesConfirmation;
|
|
701
|
+
}
|
|
702
|
+
withEditorTitle(title, params) {
|
|
703
|
+
this._editorTitle = title;
|
|
704
|
+
this._editorTitleParams = params;
|
|
705
|
+
return this;
|
|
706
|
+
}
|
|
707
|
+
withDialogSize(size = StyleSizeEnum.Normal) {
|
|
708
|
+
this._dialogSize = size;
|
|
709
|
+
return this;
|
|
710
|
+
}
|
|
711
|
+
withDialogClassName(className) {
|
|
712
|
+
this._dialogClassName = className;
|
|
713
|
+
return this;
|
|
714
|
+
}
|
|
715
|
+
withRunFunction(fn) {
|
|
716
|
+
return this.withSubmitFunction(fn);
|
|
717
|
+
}
|
|
718
|
+
withFetchFunction(fn) {
|
|
719
|
+
this._fetchFunction = fn;
|
|
720
|
+
return this;
|
|
721
|
+
}
|
|
722
|
+
withSubmitFunction(fn) {
|
|
723
|
+
this._submitFunction = fn;
|
|
724
|
+
return this;
|
|
725
|
+
}
|
|
726
|
+
withFetchNotificationError(title, message, hasNotification = true) {
|
|
727
|
+
this._hasFetchNotificationSuccess = hasNotification;
|
|
728
|
+
this._fetchNotificationSuccessTitle = title;
|
|
729
|
+
this._fetchNotificationSuccessMessage = message;
|
|
730
|
+
return this;
|
|
731
|
+
}
|
|
732
|
+
withEditorAction(action) {
|
|
733
|
+
this._editorActions.push(action);
|
|
734
|
+
return this;
|
|
735
|
+
}
|
|
736
|
+
withEditorActions(actions) {
|
|
737
|
+
this._editorActions = actions;
|
|
738
|
+
return this;
|
|
739
|
+
}
|
|
740
|
+
withEditorComponent(editorComponent) {
|
|
741
|
+
this._editorComponent = editorComponent;
|
|
742
|
+
return this;
|
|
743
|
+
}
|
|
744
|
+
withResubmit(enabled, refetch = true) {
|
|
745
|
+
this._resubmitEnabled = enabled;
|
|
746
|
+
this._resubmitRefetch = refetch;
|
|
747
|
+
return this;
|
|
748
|
+
}
|
|
749
|
+
withUnsavedChangesConfirmation(unsavedChangesConfirmation = true) {
|
|
750
|
+
this._unsavedChangesConfirmation = unsavedChangesConfirmation;
|
|
751
|
+
return this;
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
class ActionEditorDescriptor {
|
|
755
|
+
static create(editor, actionName, cfg) {
|
|
756
|
+
return new ActionEditorDescriptorInst(editor, actionName, {
|
|
757
|
+
parentType: cfg?.parentType,
|
|
758
|
+
parentProperty: cfg?.parentProperty
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
static createWithProvider(editor, serviceProvider, actionName, cfg) {
|
|
762
|
+
return new ActionEditorDescriptorInst(editor, actionName, {
|
|
763
|
+
...actionEditorGetProviderCfgObj(serviceProvider),
|
|
764
|
+
parentType: cfg?.parentType,
|
|
765
|
+
parentProperty: cfg?.parentProperty
|
|
766
|
+
});
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
class ActionEditorSubmitDescriptorInst extends ActionDescriptorInst {
|
|
770
|
+
constructor(editorAction, submitType = ActionEditorSubmitTypeEnum.Submit) {
|
|
771
|
+
super(submitType === ActionEditorSubmitTypeEnum.Submit ? `${editorAction.actionName}.submit` : `${editorAction.actionName}.cancel`, { model: editorAction.model });
|
|
772
|
+
this._editorAction = editorAction;
|
|
773
|
+
this._submitType = submitType;
|
|
774
|
+
this._position = ActionPositionEnum.FooterRight;
|
|
775
|
+
this.button.styleClass.withActionLevel(editorAction.level).withTextButton();
|
|
776
|
+
}
|
|
777
|
+
get submitType() {
|
|
778
|
+
return this._submitType;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
class ActionEditorSubmitDescriptor {
|
|
782
|
+
/**
|
|
783
|
+
* creates primary action with primary button style
|
|
784
|
+
* @param editorAction
|
|
785
|
+
* @param submitType
|
|
786
|
+
*/
|
|
787
|
+
static forPrimary(editorAction, submitType = ActionEditorSubmitTypeEnum.Submit) {
|
|
788
|
+
return new ActionEditorSubmitDescriptorInst(editorAction, submitType).withButtonDescriptor(new ActionButtonDescriptor().withStyleClass(new ButtonStyleBuilder()));
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* creates secondary button with text button style
|
|
792
|
+
* @param editorAction
|
|
793
|
+
* @param submitType
|
|
794
|
+
*/
|
|
795
|
+
static forSecondary(editorAction, submitType = ActionEditorSubmitTypeEnum.Cancel) {
|
|
796
|
+
return new ActionEditorSubmitDescriptorInst(editorAction, submitType).withButtonDescriptor(new ActionButtonDescriptor().withStyleClass(new ButtonStyleBuilder().withTextButton()));
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
class ActionEditorDetailsDescriptorInst extends ActionEditorDescriptorInst {
|
|
800
|
+
static { this.ACTION_NAME = 'details'; }
|
|
801
|
+
constructor(editorDescriptor, cfg) {
|
|
802
|
+
super(editorDescriptor, ActionEditorDetailsDescriptorInst.ACTION_NAME, cfg);
|
|
803
|
+
this.withPosition(ActionPositionEnum.RowClick);
|
|
804
|
+
this.withRouteTrigger(':itemId');
|
|
805
|
+
this.withEditorActions([ActionEditorSubmitDescriptor.forSecondary(this, ActionEditorSubmitTypeEnum.Cancel)]);
|
|
806
|
+
this.withTableviewCategory(TableviewActionDefaultCategories.DETAILS);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
class ActionEditorDetailsDescriptor {
|
|
810
|
+
static create(editor) {
|
|
811
|
+
return new ActionEditorDetailsDescriptorInst(editor);
|
|
812
|
+
}
|
|
813
|
+
static createWithProvider(editor, serviceProvider) {
|
|
814
|
+
return new ActionEditorDetailsDescriptorInst(editor, {
|
|
815
|
+
...actionEditorGetProviderCfgObj(serviceProvider)
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
class ActionEditorAddDescriptorInst extends ActionEditorDescriptorInst {
|
|
820
|
+
static { this.ACTION_NAME = 'add'; }
|
|
821
|
+
constructor(editorDescriptor, cfg) {
|
|
822
|
+
super(editorDescriptor, ActionEditorAddDescriptorInst.ACTION_NAME, cfg);
|
|
823
|
+
this.withPosition(ActionPositionEnum.ToolbarLeft);
|
|
824
|
+
this.withRouteTrigger('add');
|
|
825
|
+
this.button.withIcon('pi pi-plus');
|
|
826
|
+
this.withTableviewCategory(TableviewActionDefaultCategories.ADD);
|
|
827
|
+
this.withUnsavedChangesConfirmation();
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
class ActionEditorAddDescriptor {
|
|
831
|
+
static create(editor) {
|
|
832
|
+
return new ActionEditorAddDescriptorInst(editor);
|
|
833
|
+
}
|
|
834
|
+
static createWithProvider(editor, serviceProvider) {
|
|
835
|
+
return new ActionEditorAddDescriptorInst(editor, {
|
|
836
|
+
...actionEditorGetProviderCfgObj(serviceProvider)
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
class ActionEditorEditDescriptorInst extends ActionEditorDescriptorInst {
|
|
841
|
+
static { this.ACTION_NAME = 'edit'; }
|
|
842
|
+
constructor(editorDescriptor, cfg) {
|
|
843
|
+
super(editorDescriptor, ActionEditorEditDescriptorInst.ACTION_NAME, cfg);
|
|
844
|
+
this.withPosition(ActionPositionEnum.RowInline);
|
|
845
|
+
this.button.styleClass.withSize(StyleSizeEnum.Small);
|
|
846
|
+
this.withRouteTrigger(':itemId/edit');
|
|
847
|
+
this.withTableviewCategory(TableviewActionDefaultCategories.EDIT);
|
|
848
|
+
this.button.withLabel(null).withIcon('pi pi-pencil');
|
|
849
|
+
this.withUnsavedChangesConfirmation();
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
class ActionEditorEditDescriptor {
|
|
853
|
+
static create(editor) {
|
|
854
|
+
return new ActionEditorEditDescriptorInst(editor);
|
|
855
|
+
}
|
|
856
|
+
static createWithProvider(editor, serviceProvider) {
|
|
857
|
+
return new ActionEditorEditDescriptorInst(editor, {
|
|
858
|
+
...actionEditorGetProviderCfgObj(serviceProvider)
|
|
859
|
+
});
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
class ActionLinkDescriptorInst extends ActionDescriptorInst {
|
|
864
|
+
constructor(actionName = 'link', cfg) {
|
|
865
|
+
super(actionName, cfg);
|
|
866
|
+
this._url = '';
|
|
867
|
+
this._pathSegments = [];
|
|
868
|
+
this._replaceUrl = false;
|
|
869
|
+
this._target = '_self';
|
|
870
|
+
this._isStyleLink = false;
|
|
871
|
+
}
|
|
872
|
+
get url() {
|
|
873
|
+
return this._url;
|
|
874
|
+
}
|
|
875
|
+
get pathSegments() {
|
|
876
|
+
return this._pathSegments;
|
|
877
|
+
}
|
|
878
|
+
get queryParams() {
|
|
879
|
+
return this._queryParams;
|
|
880
|
+
}
|
|
881
|
+
get queryParamsHandling() {
|
|
882
|
+
return this._queryParamsHandling;
|
|
883
|
+
}
|
|
884
|
+
get replaceUrl() {
|
|
885
|
+
return this._replaceUrl;
|
|
886
|
+
}
|
|
887
|
+
get target() {
|
|
888
|
+
return this._target;
|
|
889
|
+
}
|
|
890
|
+
get isStyleLink() {
|
|
891
|
+
return this._isStyleLink;
|
|
892
|
+
}
|
|
893
|
+
withHref(url) {
|
|
894
|
+
this._url = url;
|
|
895
|
+
return this;
|
|
896
|
+
}
|
|
897
|
+
withRouterLink(...pathSegments) {
|
|
898
|
+
this._pathSegments = pathSegments;
|
|
899
|
+
return this;
|
|
900
|
+
}
|
|
901
|
+
withQueryParams(queryParams, queryParamsHandling) {
|
|
902
|
+
this._queryParams = queryParams;
|
|
903
|
+
this._queryParamsHandling = queryParamsHandling;
|
|
904
|
+
return this;
|
|
905
|
+
}
|
|
906
|
+
withReplaceUrl(replaceUrl = false) {
|
|
907
|
+
this._replaceUrl = replaceUrl;
|
|
908
|
+
return this;
|
|
909
|
+
}
|
|
910
|
+
withTarget(target = '_self') {
|
|
911
|
+
this._target = target;
|
|
912
|
+
return this;
|
|
913
|
+
}
|
|
914
|
+
withStyleLink(isStyleLink) {
|
|
915
|
+
this._isStyleLink = isStyleLink;
|
|
916
|
+
return this;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
class ActionLinkDescriptor {
|
|
920
|
+
static create(actionName, cfg) {
|
|
921
|
+
return new ActionLinkDescriptorInst(actionName, {
|
|
922
|
+
...cfg
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
static fromModel(model, actionName, cfg) {
|
|
926
|
+
return new ActionLinkDescriptorInst(actionName, {
|
|
927
|
+
model,
|
|
928
|
+
...cfg
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
static fromClass(type, actionName, cfg) {
|
|
932
|
+
return new ActionLinkDescriptorInst(actionName, {
|
|
933
|
+
model: ModelDescriptor.fromClass(type, cfg?.idProperty, cfg?.titleProperty, cfg?.i18nBaseKey),
|
|
934
|
+
...cfg
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
static fromAction(action) {
|
|
938
|
+
const descriptor = new ActionLinkDescriptorInst(action.actionName, { model: action.model });
|
|
939
|
+
action.copyTo(descriptor);
|
|
940
|
+
descriptor.withRunConfirmationDescriptor();
|
|
941
|
+
descriptor.withRunNotificationSuccess(undefined, undefined, false);
|
|
942
|
+
descriptor.withRunNotificationError(undefined, undefined, false);
|
|
943
|
+
descriptor.withAfterRunAction();
|
|
944
|
+
descriptor.withOnRunErrorAction();
|
|
945
|
+
descriptor.withSubactionsAsMenu(false);
|
|
946
|
+
return descriptor;
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
class CommonsActionError extends ACommonsErrorBase {
|
|
951
|
+
constructor(message, actionName, options) {
|
|
952
|
+
super(message, {
|
|
953
|
+
name: 'CommonsActionError_' + actionName,
|
|
954
|
+
...options
|
|
955
|
+
});
|
|
956
|
+
this.type = 'CommonsActionError';
|
|
957
|
+
this.actionId = actionName;
|
|
958
|
+
this.actionContext = options?.actionContext;
|
|
959
|
+
this.httpError = options?.httpError;
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
function runFnFromDataProviderOrFallback(ctx, fn, fallback) {
|
|
964
|
+
const dataProviderExec = fn(ctx);
|
|
965
|
+
if (isObservable(dataProviderExec)) {
|
|
966
|
+
return dataProviderExec;
|
|
967
|
+
}
|
|
968
|
+
return fallback;
|
|
969
|
+
}
|
|
970
|
+
function runFnFromDataProviderOrFail(ctx, fn) {
|
|
971
|
+
const dataProviderExec = fn(ctx);
|
|
972
|
+
if (isObservable(dataProviderExec)) {
|
|
973
|
+
return dataProviderExec;
|
|
974
|
+
}
|
|
975
|
+
return throwError(() => new CommonsActionError(`Data provider could not extract function to execute in action ${ctx.instance.action.actionNameLong} (${ctx.instance.action.model?.typeName}) for item id ${ctx.parameters?.itemId}.`, ctx.contextLongName, { actionContext: ctx }));
|
|
976
|
+
}
|
|
977
|
+
function runGetAllFromDataProvider(ctx) {
|
|
978
|
+
if (typeof ctx.dataProvider !== 'undefined' && typeof ctx.dataProvider['getAll'] === 'function') {
|
|
979
|
+
const tableDataProvider = ctx.dataProvider;
|
|
980
|
+
const queryParam = ctx.parameters?.dataListParams ?? {};
|
|
981
|
+
return toObservable(tableDataProvider.getAll(queryParam, ctx.serviceInstance));
|
|
982
|
+
}
|
|
983
|
+
return null;
|
|
984
|
+
}
|
|
985
|
+
function runFetchFromDataProvider(ctx) {
|
|
986
|
+
if (typeof ctx.dataProvider !== 'undefined') {
|
|
987
|
+
const editorDataProvider = ctx.dataProvider;
|
|
988
|
+
if (typeof editorDataProvider.fetch === 'function') {
|
|
989
|
+
return ctx.parameters?.itemId ? toObservable(editorDataProvider.fetch(ctx.parameters.itemId, ctx.serviceInstance, ctx.parameters.locale)) : null;
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
return null;
|
|
993
|
+
}
|
|
994
|
+
function runCreateFromDataProvider(ctx) {
|
|
995
|
+
if (typeof ctx.dataProvider !== 'undefined') {
|
|
996
|
+
const editorDataProvider = ctx.dataProvider;
|
|
997
|
+
if (typeof editorDataProvider.create === 'function') {
|
|
998
|
+
return ctx.parameters?.item ? toObservable(editorDataProvider.create(ctx.parameters.item, ctx.serviceInstance)) : null;
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
return null;
|
|
1002
|
+
}
|
|
1003
|
+
function runUpdateFromDataProvider(ctx) {
|
|
1004
|
+
if (typeof ctx.dataProvider !== 'undefined') {
|
|
1005
|
+
const editorDataProvider = ctx.dataProvider;
|
|
1006
|
+
if (typeof editorDataProvider.update === 'function') {
|
|
1007
|
+
return ctx.parameters?.itemId ? toObservable(editorDataProvider.update(ctx.parameters.itemId, ctx.parameters.item, ctx.serviceInstance)) : null;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
return null;
|
|
1011
|
+
}
|
|
1012
|
+
function runDeleteFromDataProvider(ctx) {
|
|
1013
|
+
if (typeof ctx.dataProvider !== 'undefined') {
|
|
1014
|
+
const editorDataProvider = ctx.dataProvider;
|
|
1015
|
+
if (typeof editorDataProvider.delete === 'function') {
|
|
1016
|
+
return ctx.parameters?.itemId ? toObservable(editorDataProvider.delete(ctx.parameters.itemId, ctx.parameters.item, ctx.serviceInstance)) : null;
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
return null;
|
|
1020
|
+
}
|
|
1021
|
+
/**
|
|
1022
|
+
* Gets service instance of data provider.
|
|
1023
|
+
*
|
|
1024
|
+
* @param injector Injector instance
|
|
1025
|
+
* @param dataProvider Data provider instance.
|
|
1026
|
+
*/
|
|
1027
|
+
function getDataProviderService(injector, dataProvider) {
|
|
1028
|
+
if (dataProvider?.serviceType) {
|
|
1029
|
+
const service = injector.get(dataProvider.serviceType, undefined, { optional: true });
|
|
1030
|
+
if (!service) {
|
|
1031
|
+
throw new CommonsInternalError(`Data provider service type ${dataProvider.serviceType} could not be injected.`);
|
|
1032
|
+
}
|
|
1033
|
+
return service;
|
|
1034
|
+
}
|
|
1035
|
+
else {
|
|
1036
|
+
return null;
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
/**
|
|
1041
|
+
* States of action. Enums ending with `*Final` are supposed to be final.
|
|
1042
|
+
*/
|
|
1043
|
+
var ActionInstanceStateEnum;
|
|
1044
|
+
(function (ActionInstanceStateEnum) {
|
|
1045
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["TriggerStart"] = 0] = "TriggerStart";
|
|
1046
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["TriggerEnd"] = 1] = "TriggerEnd";
|
|
1047
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["ActivationStart"] = 2] = "ActivationStart";
|
|
1048
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["ActivationEnd"] = 3] = "ActivationEnd";
|
|
1049
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["FetchStart"] = 4] = "FetchStart";
|
|
1050
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["FetchEnd"] = 5] = "FetchEnd";
|
|
1051
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["FetchError"] = 6] = "FetchError";
|
|
1052
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["RunConfirmationStart"] = 7] = "RunConfirmationStart";
|
|
1053
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["RunConfirmationEndAccept"] = 8] = "RunConfirmationEndAccept";
|
|
1054
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["RunConfirmationEndReject"] = 9] = "RunConfirmationEndReject";
|
|
1055
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["RunStart"] = 10] = "RunStart";
|
|
1056
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["RunEnd"] = 11] = "RunEnd";
|
|
1057
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["RunError"] = 12] = "RunError";
|
|
1058
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["NextActionStart"] = 13] = "NextActionStart";
|
|
1059
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["NextActionEnd"] = 14] = "NextActionEnd";
|
|
1060
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["ErrorActionStart"] = 15] = "ErrorActionStart";
|
|
1061
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["ErrorActionEnd"] = 16] = "ErrorActionEnd";
|
|
1062
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishSuccessFinal"] = 17] = "FinishSuccessFinal";
|
|
1063
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishErrorFinal"] = 18] = "FinishErrorFinal";
|
|
1064
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishDismissedFinal"] = 19] = "FinishDismissedFinal";
|
|
1065
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishSuccessReactivateFinal"] = 20] = "FinishSuccessReactivateFinal";
|
|
1066
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishComponentDestroyFinal"] = 21] = "FinishComponentDestroyFinal";
|
|
1067
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishRouteUntriggerStart"] = 22] = "FinishRouteUntriggerStart";
|
|
1068
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishRouteUntriggerEndFinal"] = 23] = "FinishRouteUntriggerEndFinal";
|
|
1069
|
+
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishRouteUntriggerTimeoutFinal"] = 24] = "FinishRouteUntriggerTimeoutFinal";
|
|
1070
|
+
})(ActionInstanceStateEnum || (ActionInstanceStateEnum = {}));
|
|
1071
|
+
|
|
1072
|
+
const DATA_LANGUAGE_DROPDOWN_COMPONENT_IT = new InjectionToken('DATA_LANGUAGE_DROPDOWN_COMPONENT');
|
|
1073
|
+
|
|
1074
|
+
class DataProviderExecutor {
|
|
1075
|
+
runGetAllOrFail(ctx) {
|
|
1076
|
+
return runFnFromDataProviderOrFail(ctx, this.runGetAll.bind(this));
|
|
1077
|
+
}
|
|
1078
|
+
runFetchOrFail(ctx) {
|
|
1079
|
+
return runFnFromDataProviderOrFail(ctx, this.runFetch.bind(this));
|
|
1080
|
+
}
|
|
1081
|
+
runCreateOrFail(ctx) {
|
|
1082
|
+
return runFnFromDataProviderOrFail(ctx, this.runCreate.bind(this));
|
|
1083
|
+
}
|
|
1084
|
+
runUpdateOrFail(ctx) {
|
|
1085
|
+
return runFnFromDataProviderOrFail(ctx, this.runUpdate.bind(this));
|
|
1086
|
+
}
|
|
1087
|
+
runDeleteOrFail(ctx) {
|
|
1088
|
+
return runFnFromDataProviderOrFail(ctx, this.runDelete.bind(this));
|
|
1089
|
+
}
|
|
1090
|
+
/**
|
|
1091
|
+
* Gets service instance of data provider.
|
|
1092
|
+
*
|
|
1093
|
+
* @param injector Injector instance
|
|
1094
|
+
* @param dataProvider Data provider instance.
|
|
1095
|
+
*/
|
|
1096
|
+
getDataProviderService(injector, dataProvider) {
|
|
1097
|
+
return getDataProviderService(injector, dataProvider);
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
var FieldSizeEnum;
|
|
1102
|
+
(function (FieldSizeEnum) {
|
|
1103
|
+
FieldSizeEnum[FieldSizeEnum["Small"] = 0] = "Small";
|
|
1104
|
+
FieldSizeEnum[FieldSizeEnum["Normal"] = 1] = "Normal";
|
|
1105
|
+
FieldSizeEnum[FieldSizeEnum["Large"] = 2] = "Large";
|
|
1106
|
+
})(FieldSizeEnum || (FieldSizeEnum = {}));
|
|
1107
|
+
var FieldInputTypeEnum;
|
|
1108
|
+
(function (FieldInputTypeEnum) {
|
|
1109
|
+
FieldInputTypeEnum[FieldInputTypeEnum["Hidden"] = 0] = "Hidden";
|
|
1110
|
+
FieldInputTypeEnum[FieldInputTypeEnum["Label"] = 1] = "Label";
|
|
1111
|
+
FieldInputTypeEnum[FieldInputTypeEnum["Text"] = 2] = "Text";
|
|
1112
|
+
FieldInputTypeEnum[FieldInputTypeEnum["Textarea"] = 3] = "Textarea";
|
|
1113
|
+
FieldInputTypeEnum[FieldInputTypeEnum["Number"] = 4] = "Number";
|
|
1114
|
+
FieldInputTypeEnum[FieldInputTypeEnum["Currency"] = 5] = "Currency";
|
|
1115
|
+
FieldInputTypeEnum[FieldInputTypeEnum["Switch"] = 6] = "Switch";
|
|
1116
|
+
FieldInputTypeEnum[FieldInputTypeEnum["Radio"] = 7] = "Radio";
|
|
1117
|
+
FieldInputTypeEnum[FieldInputTypeEnum["Datepicker"] = 8] = "Datepicker";
|
|
1118
|
+
FieldInputTypeEnum[FieldInputTypeEnum["Mask"] = 9] = "Mask";
|
|
1119
|
+
FieldInputTypeEnum[FieldInputTypeEnum["File"] = 10] = "File";
|
|
1120
|
+
FieldInputTypeEnum[FieldInputTypeEnum["ImageFile"] = 11] = "ImageFile";
|
|
1121
|
+
FieldInputTypeEnum[FieldInputTypeEnum["ImageUrl"] = 12] = "ImageUrl";
|
|
1122
|
+
FieldInputTypeEnum[FieldInputTypeEnum["Custom"] = 13] = "Custom";
|
|
1123
|
+
})(FieldInputTypeEnum || (FieldInputTypeEnum = {}));
|
|
1124
|
+
var FieldLookupTypeEnum;
|
|
1125
|
+
(function (FieldLookupTypeEnum) {
|
|
1126
|
+
FieldLookupTypeEnum[FieldLookupTypeEnum["Dropdown"] = 0] = "Dropdown";
|
|
1127
|
+
FieldLookupTypeEnum[FieldLookupTypeEnum["Autocomplete"] = 1] = "Autocomplete";
|
|
1128
|
+
FieldLookupTypeEnum[FieldLookupTypeEnum["Dialog"] = 2] = "Dialog";
|
|
1129
|
+
FieldLookupTypeEnum[FieldLookupTypeEnum["Custom"] = 3] = "Custom";
|
|
1130
|
+
})(FieldLookupTypeEnum || (FieldLookupTypeEnum = {}));
|
|
1131
|
+
var FieldManyToManyEditorTypeEnum;
|
|
1132
|
+
(function (FieldManyToManyEditorTypeEnum) {
|
|
1133
|
+
FieldManyToManyEditorTypeEnum[FieldManyToManyEditorTypeEnum["DialogTableMultiselect"] = 0] = "DialogTableMultiselect";
|
|
1134
|
+
})(FieldManyToManyEditorTypeEnum || (FieldManyToManyEditorTypeEnum = {}));
|
|
1135
|
+
var FieldManyToManyEditorActionEnum;
|
|
1136
|
+
(function (FieldManyToManyEditorActionEnum) {
|
|
1137
|
+
FieldManyToManyEditorActionEnum[FieldManyToManyEditorActionEnum["Add"] = 0] = "Add";
|
|
1138
|
+
FieldManyToManyEditorActionEnum[FieldManyToManyEditorActionEnum["Delete"] = 1] = "Delete";
|
|
1139
|
+
})(FieldManyToManyEditorActionEnum || (FieldManyToManyEditorActionEnum = {}));
|
|
1140
|
+
var FieldManyEditorTypeEnum;
|
|
1141
|
+
(function (FieldManyEditorTypeEnum) {
|
|
1142
|
+
FieldManyEditorTypeEnum[FieldManyEditorTypeEnum["DialogEditor"] = 0] = "DialogEditor";
|
|
1143
|
+
})(FieldManyEditorTypeEnum || (FieldManyEditorTypeEnum = {}));
|
|
1144
|
+
var FieldManyEditorActionEnum;
|
|
1145
|
+
(function (FieldManyEditorActionEnum) {
|
|
1146
|
+
FieldManyEditorActionEnum[FieldManyEditorActionEnum["View"] = 0] = "View";
|
|
1147
|
+
FieldManyEditorActionEnum[FieldManyEditorActionEnum["Add"] = 1] = "Add";
|
|
1148
|
+
FieldManyEditorActionEnum[FieldManyEditorActionEnum["Edit"] = 2] = "Edit";
|
|
1149
|
+
FieldManyEditorActionEnum[FieldManyEditorActionEnum["Delete"] = 3] = "Delete";
|
|
1150
|
+
})(FieldManyEditorActionEnum || (FieldManyEditorActionEnum = {}));
|
|
1151
|
+
var FieldGroupTypeEnum;
|
|
1152
|
+
(function (FieldGroupTypeEnum) {
|
|
1153
|
+
FieldGroupTypeEnum[FieldGroupTypeEnum["Fieldset"] = 0] = "Fieldset";
|
|
1154
|
+
FieldGroupTypeEnum[FieldGroupTypeEnum["Logical"] = 1] = "Logical";
|
|
1155
|
+
})(FieldGroupTypeEnum || (FieldGroupTypeEnum = {}));
|
|
1156
|
+
|
|
1157
|
+
/**
|
|
1158
|
+
* converts string type to type enum, default is text
|
|
1159
|
+
* @param attributeType
|
|
1160
|
+
*/
|
|
1161
|
+
function getFieldInputTypeFromClassAttributeDefType(attributeType) {
|
|
1162
|
+
switch (attributeType) {
|
|
1163
|
+
case 'hidden':
|
|
1164
|
+
return FieldInputTypeEnum.Hidden;
|
|
1165
|
+
case 'label':
|
|
1166
|
+
return FieldInputTypeEnum.Label;
|
|
1167
|
+
case 'textarea':
|
|
1168
|
+
return FieldInputTypeEnum.Textarea;
|
|
1169
|
+
case 'number':
|
|
1170
|
+
return FieldInputTypeEnum.Number;
|
|
1171
|
+
case 'currency':
|
|
1172
|
+
return FieldInputTypeEnum.Currency;
|
|
1173
|
+
case 'switch':
|
|
1174
|
+
case 'boolean':
|
|
1175
|
+
return FieldInputTypeEnum.Switch;
|
|
1176
|
+
case 'radio':
|
|
1177
|
+
return FieldInputTypeEnum.Radio;
|
|
1178
|
+
case 'datepicker':
|
|
1179
|
+
return FieldInputTypeEnum.Datepicker;
|
|
1180
|
+
case 'mask':
|
|
1181
|
+
return FieldInputTypeEnum.Mask;
|
|
1182
|
+
case 'file':
|
|
1183
|
+
return FieldInputTypeEnum.File;
|
|
1184
|
+
case 'custom':
|
|
1185
|
+
return FieldInputTypeEnum.Custom;
|
|
1186
|
+
case 'text':
|
|
1187
|
+
default:
|
|
1188
|
+
return FieldInputTypeEnum.Text;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
/**
|
|
1192
|
+
* convert column type to equivalent field input type
|
|
1193
|
+
* @param type column type
|
|
1194
|
+
* @param displayType column display type
|
|
1195
|
+
*/
|
|
1196
|
+
function getFieldInputTypeFromColumnType(type, displayType) {
|
|
1197
|
+
switch (type) {
|
|
1198
|
+
case ColumnTypeEnum.Number:
|
|
1199
|
+
return displayType === ColumnDisplayTypeEnum.Currency ? FieldInputTypeEnum.Currency : FieldInputTypeEnum.Number;
|
|
1200
|
+
case ColumnTypeEnum.Boolean:
|
|
1201
|
+
return FieldInputTypeEnum.Switch;
|
|
1202
|
+
case ColumnTypeEnum.Date:
|
|
1203
|
+
return FieldInputTypeEnum.Datepicker;
|
|
1204
|
+
case ColumnTypeEnum.Custom:
|
|
1205
|
+
return FieldInputTypeEnum.Custom;
|
|
1206
|
+
case ColumnTypeEnum.String:
|
|
1207
|
+
case ColumnTypeEnum.Enum:
|
|
1208
|
+
default:
|
|
1209
|
+
return FieldInputTypeEnum.Text;
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
function expandClassAttributeDefWithEditorDef(attributes) {
|
|
1213
|
+
if (!attributes) {
|
|
1214
|
+
throw new CommonsInternalError('Class attribute definition is null, problem with TypeRegistry::findAttributesDefinitionByClassType?', { name: 'TableviewUtilsError' });
|
|
1215
|
+
}
|
|
1216
|
+
const typeRegistry = TypeRegistry.get();
|
|
1217
|
+
const editorClassAttributeDef = [];
|
|
1218
|
+
for (const attribute of attributes) {
|
|
1219
|
+
editorClassAttributeDef.push({
|
|
1220
|
+
name: attribute.name,
|
|
1221
|
+
baseName: attribute.baseName,
|
|
1222
|
+
type: attribute.type,
|
|
1223
|
+
subtype: attribute.subtype,
|
|
1224
|
+
fieldType: getFieldInputTypeFromClassAttributeDefType(attribute.type),
|
|
1225
|
+
classType: typeRegistry.findType(attribute.type),
|
|
1226
|
+
enumType: typeRegistry.findEnum(attribute.type)
|
|
1227
|
+
});
|
|
1228
|
+
}
|
|
1229
|
+
return editorClassAttributeDef;
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* returns attributes from class type and extends to typed def with column and field enum type
|
|
1233
|
+
* @param type class type
|
|
1234
|
+
*/
|
|
1235
|
+
function getEditorClassAttributeDef(type) {
|
|
1236
|
+
return expandClassAttributeDefWithEditorDef(TypeRegistry.get().findAttributesDefinitionByClassType(type));
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
var TableviewEditorTypeEnum;
|
|
1240
|
+
(function (TableviewEditorTypeEnum) {
|
|
1241
|
+
TableviewEditorTypeEnum[TableviewEditorTypeEnum["None"] = 0] = "None";
|
|
1242
|
+
TableviewEditorTypeEnum[TableviewEditorTypeEnum["Details"] = 1] = "Details";
|
|
1243
|
+
TableviewEditorTypeEnum[TableviewEditorTypeEnum["Edit"] = 2] = "Edit";
|
|
1244
|
+
TableviewEditorTypeEnum[TableviewEditorTypeEnum["Add"] = 3] = "Add";
|
|
1245
|
+
})(TableviewEditorTypeEnum || (TableviewEditorTypeEnum = {}));
|
|
1246
|
+
const EDITOR_DEFAULT_GROUP_NAME = '_default';
|
|
1247
|
+
|
|
1248
|
+
class FieldValidationDescriptor {
|
|
1249
|
+
constructor(name, validator, message, options) {
|
|
1250
|
+
this._name = name;
|
|
1251
|
+
this._validator = validator;
|
|
1252
|
+
this._message = message;
|
|
1253
|
+
this._options = options;
|
|
1254
|
+
}
|
|
1255
|
+
get name() {
|
|
1256
|
+
return this._name;
|
|
1257
|
+
}
|
|
1258
|
+
get validator() {
|
|
1259
|
+
return this._validator;
|
|
1260
|
+
}
|
|
1261
|
+
get message() {
|
|
1262
|
+
return this._message;
|
|
1263
|
+
}
|
|
1264
|
+
get options() {
|
|
1265
|
+
return this._options;
|
|
1266
|
+
}
|
|
1267
|
+
copy() {
|
|
1268
|
+
const opt = this._options ? { ...this._options } : undefined;
|
|
1269
|
+
return new FieldValidationDescriptor(this._name, this._validator, this._message, opt);
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
class AGenericFieldDescriptor {
|
|
1274
|
+
constructor(editor) {
|
|
1275
|
+
this._config = {};
|
|
1276
|
+
this._editor = editor;
|
|
1277
|
+
}
|
|
1278
|
+
get editor() {
|
|
1279
|
+
return this._editor;
|
|
1280
|
+
}
|
|
1281
|
+
get config() {
|
|
1282
|
+
return this._config;
|
|
1283
|
+
}
|
|
1284
|
+
withConfig(config) {
|
|
1285
|
+
this._config = config;
|
|
1286
|
+
return this;
|
|
1287
|
+
}
|
|
1288
|
+
/**
|
|
1289
|
+
* Override toJSON implementation to prevent overflow with circular dependency.
|
|
1290
|
+
* @ignore
|
|
1291
|
+
*/
|
|
1292
|
+
toJSON() {
|
|
1293
|
+
const jsonObj = {
|
|
1294
|
+
...this,
|
|
1295
|
+
_editor: undefined
|
|
1296
|
+
};
|
|
1297
|
+
const jsonObjStr = JSON.stringify(jsonObj);
|
|
1298
|
+
return jsonObjStr;
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
1302
|
+
constructor(editor, property) {
|
|
1303
|
+
super(editor);
|
|
1304
|
+
/** @ignore */ this._required = false;
|
|
1305
|
+
/** @ignore */ this._requiredHideLabelMarker = false;
|
|
1306
|
+
/** @ignore */ this._disabled = false;
|
|
1307
|
+
/** @ignore */ this._validations = [];
|
|
1308
|
+
/** @ignore */ this._asyncValidations = [];
|
|
1309
|
+
/** @ignore */ this._updateOn = 'change';
|
|
1310
|
+
/** @ignore */ this._className = '';
|
|
1311
|
+
/** @ignore */ this._labelClassName = '';
|
|
1312
|
+
/** @ignore */ this._inputClassName = '';
|
|
1313
|
+
/** @ignore */ this._size = FieldSizeEnum.Normal;
|
|
1314
|
+
// localization
|
|
1315
|
+
/** @ignore */ this._isLocalized = false;
|
|
1316
|
+
/** @ignore */ this._eventsSubject = new Subject();
|
|
1317
|
+
this._property = property;
|
|
1318
|
+
this._label = getI18nTypePropertyKey(this._editor.model.i18nBaseKey, property);
|
|
1319
|
+
}
|
|
1320
|
+
get property() {
|
|
1321
|
+
return this._property;
|
|
1322
|
+
}
|
|
1323
|
+
get label() {
|
|
1324
|
+
return this._label;
|
|
1325
|
+
}
|
|
1326
|
+
get placeholder() {
|
|
1327
|
+
return this._placeholder;
|
|
1328
|
+
}
|
|
1329
|
+
get helpText() {
|
|
1330
|
+
return this._helpText;
|
|
1331
|
+
}
|
|
1332
|
+
get required() {
|
|
1333
|
+
return this._required;
|
|
1334
|
+
}
|
|
1335
|
+
get requiredHideLabelMarker() {
|
|
1336
|
+
return this._requiredHideLabelMarker;
|
|
1337
|
+
}
|
|
1338
|
+
get disabled() {
|
|
1339
|
+
return this._disabled;
|
|
1340
|
+
}
|
|
1341
|
+
get defaultValue() {
|
|
1342
|
+
return this._defaultValue;
|
|
1343
|
+
}
|
|
1344
|
+
get getter() {
|
|
1345
|
+
return this._getter;
|
|
1346
|
+
}
|
|
1347
|
+
get setter() {
|
|
1348
|
+
return this._setter;
|
|
1349
|
+
}
|
|
1350
|
+
get validations() {
|
|
1351
|
+
return this._validations;
|
|
1352
|
+
}
|
|
1353
|
+
get asyncValidations() {
|
|
1354
|
+
return this._asyncValidations;
|
|
1355
|
+
}
|
|
1356
|
+
get requiredExpression() {
|
|
1357
|
+
return this._requiredExpression;
|
|
1358
|
+
}
|
|
1359
|
+
get disabledExpression() {
|
|
1360
|
+
return this._disabledExpression;
|
|
1361
|
+
}
|
|
1362
|
+
get hiddenExpression() {
|
|
1363
|
+
return this._hiddenExpression;
|
|
1364
|
+
}
|
|
1365
|
+
get updateOn() {
|
|
1366
|
+
return this._updateOn;
|
|
1367
|
+
}
|
|
1368
|
+
get onInit() {
|
|
1369
|
+
return this._onInit;
|
|
1370
|
+
}
|
|
1371
|
+
get onChanges() {
|
|
1372
|
+
return this._onChanges;
|
|
1373
|
+
}
|
|
1374
|
+
get afterContentInit() {
|
|
1375
|
+
return this._afterContentInit;
|
|
1376
|
+
}
|
|
1377
|
+
get afterViewInit() {
|
|
1378
|
+
return this._afterViewInit;
|
|
1379
|
+
}
|
|
1380
|
+
get onDestroy() {
|
|
1381
|
+
return this._onDestroy;
|
|
1382
|
+
}
|
|
1383
|
+
get onValueChange() {
|
|
1384
|
+
return this._onValueChange;
|
|
1385
|
+
}
|
|
1386
|
+
get className() {
|
|
1387
|
+
return this._className;
|
|
1388
|
+
}
|
|
1389
|
+
get fieldClassName() {
|
|
1390
|
+
return this._fieldClassName;
|
|
1391
|
+
}
|
|
1392
|
+
get labelClassName() {
|
|
1393
|
+
return this._labelClassName;
|
|
1394
|
+
}
|
|
1395
|
+
get inputClassName() {
|
|
1396
|
+
return this._inputClassName;
|
|
1397
|
+
}
|
|
1398
|
+
get size() {
|
|
1399
|
+
return this._size;
|
|
1400
|
+
}
|
|
1401
|
+
get isSizeSmall() {
|
|
1402
|
+
return this._size === FieldSizeEnum.Small;
|
|
1403
|
+
}
|
|
1404
|
+
get isSizeLarge() {
|
|
1405
|
+
return this._size === FieldSizeEnum.Large;
|
|
1406
|
+
}
|
|
1407
|
+
get isLocalized() {
|
|
1408
|
+
return this._isLocalized;
|
|
1409
|
+
}
|
|
1410
|
+
withLabel(label) {
|
|
1411
|
+
this._label = label;
|
|
1412
|
+
return this;
|
|
1413
|
+
}
|
|
1414
|
+
withPlaceholder(placeholder) {
|
|
1415
|
+
this._placeholder = placeholder;
|
|
1416
|
+
return this;
|
|
1417
|
+
}
|
|
1418
|
+
withHelpText(helpText) {
|
|
1419
|
+
this._helpText = helpText;
|
|
1420
|
+
return this;
|
|
1421
|
+
}
|
|
1422
|
+
withRequired(required = true, requiredExpression, hideLabelMarker = false) {
|
|
1423
|
+
this._required = required;
|
|
1424
|
+
if (requiredExpression) {
|
|
1425
|
+
this._requiredExpression = requiredExpression;
|
|
1426
|
+
}
|
|
1427
|
+
this._requiredHideLabelMarker = hideLabelMarker;
|
|
1428
|
+
return this;
|
|
1429
|
+
}
|
|
1430
|
+
withDisabled(disabled = true, disabledExpression) {
|
|
1431
|
+
this._disabled = disabled;
|
|
1432
|
+
if (disabledExpression) {
|
|
1433
|
+
this._disabledExpression = disabledExpression;
|
|
1434
|
+
}
|
|
1435
|
+
return this;
|
|
1436
|
+
}
|
|
1437
|
+
withHidden(hiddenExpression) {
|
|
1438
|
+
this._hiddenExpression = hiddenExpression;
|
|
1439
|
+
return this;
|
|
1440
|
+
}
|
|
1441
|
+
withUpdateOn(updateOn) {
|
|
1442
|
+
this._updateOn = updateOn;
|
|
1443
|
+
return this;
|
|
1444
|
+
}
|
|
1445
|
+
withOnInit(onInit) {
|
|
1446
|
+
this._onInit = onInit;
|
|
1447
|
+
return this;
|
|
1448
|
+
}
|
|
1449
|
+
withOnChanges(onChanges) {
|
|
1450
|
+
this._onChanges = onChanges;
|
|
1451
|
+
return this;
|
|
1452
|
+
}
|
|
1453
|
+
withAfterContentInit(afterContentInit) {
|
|
1454
|
+
this._afterContentInit = afterContentInit;
|
|
1455
|
+
return this;
|
|
1456
|
+
}
|
|
1457
|
+
withAfterViewInit(afterViewInit) {
|
|
1458
|
+
this._afterViewInit = afterViewInit;
|
|
1459
|
+
return this;
|
|
1460
|
+
}
|
|
1461
|
+
withOnDestroy(onDestroy) {
|
|
1462
|
+
this._onDestroy = onDestroy;
|
|
1463
|
+
return this;
|
|
1464
|
+
}
|
|
1465
|
+
withOnValueChange(onValueChange) {
|
|
1466
|
+
this._onValueChange = onValueChange;
|
|
1467
|
+
return this;
|
|
1468
|
+
}
|
|
1469
|
+
withDefaultValue(defaultValue) {
|
|
1470
|
+
this._defaultValue = defaultValue;
|
|
1471
|
+
return this;
|
|
1472
|
+
}
|
|
1473
|
+
withGetter(fn) {
|
|
1474
|
+
this._getter = fn;
|
|
1475
|
+
return this;
|
|
1476
|
+
}
|
|
1477
|
+
withSetter(fn) {
|
|
1478
|
+
this._setter = fn;
|
|
1479
|
+
return this;
|
|
1480
|
+
}
|
|
1481
|
+
withValidation(name, validator, message) {
|
|
1482
|
+
this._validations.push(new FieldValidationDescriptor(name, validator, message));
|
|
1483
|
+
return this;
|
|
1484
|
+
}
|
|
1485
|
+
removeValidation(name) {
|
|
1486
|
+
this._validations = this._validations.filter(v => v.name !== name);
|
|
1487
|
+
return this;
|
|
1488
|
+
}
|
|
1489
|
+
withAsyncValidation(name, asyncValidator, message) {
|
|
1490
|
+
this._asyncValidations.push(new FieldValidationDescriptor(name, asyncValidator, message));
|
|
1491
|
+
return this;
|
|
1492
|
+
}
|
|
1493
|
+
removeAsyncValidation(name) {
|
|
1494
|
+
this._asyncValidations = this._asyncValidations.filter(v => v.name !== name);
|
|
1495
|
+
return this;
|
|
1496
|
+
}
|
|
1497
|
+
withClassName(className, labelClassName = '', inputClassName = '', fieldClassName) {
|
|
1498
|
+
this._className = className;
|
|
1499
|
+
this._labelClassName = labelClassName;
|
|
1500
|
+
this._inputClassName = inputClassName;
|
|
1501
|
+
this._fieldClassName = fieldClassName;
|
|
1502
|
+
return this;
|
|
1503
|
+
}
|
|
1504
|
+
withSize(size = FieldSizeEnum.Normal) {
|
|
1505
|
+
this._size = size;
|
|
1506
|
+
return this;
|
|
1507
|
+
}
|
|
1508
|
+
/**
|
|
1509
|
+
* This method adds an icon with text Show all translations above the field and after clicking on it, it displays a new dialog with tableview.
|
|
1510
|
+
* This new table view shows all available translations for specific property and allows editing it.
|
|
1511
|
+
*/
|
|
1512
|
+
localized() {
|
|
1513
|
+
if (!this.editor.isLocalized) {
|
|
1514
|
+
throw new CommonsInternalError(`Localization cannot be set for field ${this.property}, localization must be enabled on editor first.`);
|
|
1515
|
+
}
|
|
1516
|
+
this._isLocalized = true;
|
|
1517
|
+
return this;
|
|
1518
|
+
}
|
|
1519
|
+
nextEvent(type, cmpType, cmpInstance, data) {
|
|
1520
|
+
this._eventsSubject.next({
|
|
1521
|
+
type: type,
|
|
1522
|
+
componentType: cmpType,
|
|
1523
|
+
componentInstance: cmpInstance,
|
|
1524
|
+
data: data
|
|
1525
|
+
});
|
|
1526
|
+
}
|
|
1527
|
+
get events$() {
|
|
1528
|
+
return this._eventsSubject.asObservable();
|
|
1529
|
+
}
|
|
1530
|
+
copyFieldsTo(obj) {
|
|
1531
|
+
obj._label = this._label;
|
|
1532
|
+
obj._placeholder = this._placeholder;
|
|
1533
|
+
obj._helpText = this._helpText;
|
|
1534
|
+
obj._required = this._required;
|
|
1535
|
+
obj._disabled = this._disabled;
|
|
1536
|
+
obj._defaultValue = this._defaultValue;
|
|
1537
|
+
obj._requiredExpression = this._requiredExpression;
|
|
1538
|
+
obj._hiddenExpression = this._hiddenExpression;
|
|
1539
|
+
obj._updateOn = this._updateOn;
|
|
1540
|
+
obj._onInit = this._onInit;
|
|
1541
|
+
obj._onChanges = this._onChanges;
|
|
1542
|
+
obj._onDestroy = this._onDestroy;
|
|
1543
|
+
obj._afterContentInit = this._afterContentInit;
|
|
1544
|
+
obj._afterViewInit = this._afterViewInit;
|
|
1545
|
+
obj._onValueChange = this._onValueChange;
|
|
1546
|
+
obj._disabledExpression = this._disabledExpression;
|
|
1547
|
+
obj._className = this._className;
|
|
1548
|
+
obj._size = this.size;
|
|
1549
|
+
obj._getter = this._getter;
|
|
1550
|
+
obj._setter = this._setter;
|
|
1551
|
+
obj._isLocalized = this._isLocalized;
|
|
1552
|
+
obj._validations = this._validations.map(value => value.copy());
|
|
1553
|
+
obj._asyncValidations = this._asyncValidations.map(value => value.copy());
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
class FieldActionDescriptor extends AFieldDescriptor {
|
|
1558
|
+
constructor(editor, property) {
|
|
1559
|
+
super(editor, property);
|
|
1560
|
+
this._button = new ActionButtonDescriptor();
|
|
1561
|
+
this._wrappers = ['field'];
|
|
1562
|
+
this._fieldActionName = property;
|
|
1563
|
+
let displayName = property;
|
|
1564
|
+
if (this._editor.model)
|
|
1565
|
+
displayName = `${this._editor.model.typeName}.${displayName}`;
|
|
1566
|
+
this._fieldActionNameLong = displayName;
|
|
1567
|
+
}
|
|
1568
|
+
get button() {
|
|
1569
|
+
return this._button;
|
|
1570
|
+
}
|
|
1571
|
+
get runFunction() {
|
|
1572
|
+
return this._runFunction;
|
|
1573
|
+
}
|
|
1574
|
+
get wrappers() {
|
|
1575
|
+
return this._wrappers;
|
|
1576
|
+
}
|
|
1577
|
+
withButtonDescriptor(button) {
|
|
1578
|
+
this._button = button;
|
|
1579
|
+
return this;
|
|
1580
|
+
}
|
|
1581
|
+
withButton(label, icon = null, styleLevel = StyleLevelEnum.Default, styleText = false) {
|
|
1582
|
+
this._button = new ActionButtonDescriptor().withLabel(label).withIcon(icon).withStyleClass(new ButtonStyleBuilder(styleLevel).withTextButton(styleText));
|
|
1583
|
+
return this;
|
|
1584
|
+
}
|
|
1585
|
+
withRunFunction(fn) {
|
|
1586
|
+
this._runFunction = fn;
|
|
1587
|
+
return this;
|
|
1588
|
+
}
|
|
1589
|
+
withWrappers(wrappers) {
|
|
1590
|
+
this._wrappers = wrappers;
|
|
1591
|
+
return this;
|
|
1592
|
+
}
|
|
1593
|
+
copy() {
|
|
1594
|
+
const field = new FieldActionDescriptor(this._editor, this._property);
|
|
1595
|
+
this.copyFieldsTo(field);
|
|
1596
|
+
field._button = this._button.copy();
|
|
1597
|
+
field._runFunction = this._runFunction?.bind(field);
|
|
1598
|
+
field._wrappers = [...this._wrappers];
|
|
1599
|
+
return field;
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
class AFieldGroupDescriptor extends AGenericFieldDescriptor {
|
|
1604
|
+
constructor(editor, name) {
|
|
1605
|
+
super(editor);
|
|
1606
|
+
this._fields = [];
|
|
1607
|
+
this._validations = [];
|
|
1608
|
+
this._name = `${this.baseName}${name}`;
|
|
1609
|
+
this._default = name === EDITOR_DEFAULT_GROUP_NAME;
|
|
1610
|
+
}
|
|
1611
|
+
removeField(property, filterFunction) {
|
|
1612
|
+
this._fields = filterFunction(this._fields);
|
|
1613
|
+
return this._fields;
|
|
1614
|
+
}
|
|
1615
|
+
get title() {
|
|
1616
|
+
return this._title;
|
|
1617
|
+
}
|
|
1618
|
+
get validations() {
|
|
1619
|
+
return this._validations;
|
|
1620
|
+
}
|
|
1621
|
+
get baseName() {
|
|
1622
|
+
return `${this.groupName()}_`;
|
|
1623
|
+
}
|
|
1624
|
+
get name() {
|
|
1625
|
+
return this._name;
|
|
1626
|
+
}
|
|
1627
|
+
get default() {
|
|
1628
|
+
return this._default;
|
|
1629
|
+
}
|
|
1630
|
+
withTitle(title) {
|
|
1631
|
+
this._title = title;
|
|
1632
|
+
return this;
|
|
1633
|
+
}
|
|
1634
|
+
withValidation(name, validator, message) {
|
|
1635
|
+
this._validations.push(new FieldValidationDescriptor(name, validator, message));
|
|
1636
|
+
return this;
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
class FieldTabGroupDescriptor extends AFieldGroupDescriptor {
|
|
1640
|
+
constructor(editor, name) {
|
|
1641
|
+
super(editor, name);
|
|
1642
|
+
}
|
|
1643
|
+
get fields() {
|
|
1644
|
+
return this._fields;
|
|
1645
|
+
}
|
|
1646
|
+
groupName() {
|
|
1647
|
+
return 'tab';
|
|
1648
|
+
}
|
|
1649
|
+
addField(field) {
|
|
1650
|
+
this._fields.push(field);
|
|
1651
|
+
return this;
|
|
1652
|
+
}
|
|
1653
|
+
copy() {
|
|
1654
|
+
const tab = new FieldTabGroupDescriptor(this._editor, this.name.substring(this.baseName.length));
|
|
1655
|
+
tab._title = this._title;
|
|
1656
|
+
tab._fields = this.fields.map(f => f.copy());
|
|
1657
|
+
tab._validations = this.validations.map(v => v.copy());
|
|
1658
|
+
return tab;
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
class FieldGroupDescriptor extends AFieldGroupDescriptor {
|
|
1662
|
+
constructor(editor, name) {
|
|
1663
|
+
super(editor, name);
|
|
1664
|
+
this._type = FieldGroupTypeEnum.Fieldset;
|
|
1665
|
+
if (this._default) {
|
|
1666
|
+
this.asLogical();
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
get type() {
|
|
1670
|
+
return this._type;
|
|
1671
|
+
}
|
|
1672
|
+
get fields() {
|
|
1673
|
+
return this._fields;
|
|
1674
|
+
}
|
|
1675
|
+
groupName() {
|
|
1676
|
+
return 'group';
|
|
1677
|
+
}
|
|
1678
|
+
addField(field) {
|
|
1679
|
+
this._fields.push(field);
|
|
1680
|
+
return this;
|
|
1681
|
+
}
|
|
1682
|
+
asLogical() {
|
|
1683
|
+
this._type = FieldGroupTypeEnum.Logical;
|
|
1684
|
+
return this;
|
|
1685
|
+
}
|
|
1686
|
+
copy() {
|
|
1687
|
+
const group = new FieldGroupDescriptor(this._editor, this.name.substring(this.baseName.length));
|
|
1688
|
+
group._type = this._type;
|
|
1689
|
+
group._title = this._title;
|
|
1690
|
+
group._fields = this.fields.map(f => f.copy());
|
|
1691
|
+
group._validations = this.validations.map(v => v.copy());
|
|
1692
|
+
return group;
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
const fieldLookupGetProviderCfgObj = (serviceOrDataProvider) => {
|
|
1697
|
+
const cfg = {};
|
|
1698
|
+
if (serviceOrDataProvider) {
|
|
1699
|
+
if (serviceOrDataProvider.isDataProvider) {
|
|
1700
|
+
// type casting needed, cause there was no other way found to differentiate the types
|
|
1701
|
+
cfg.dataProvider = serviceOrDataProvider;
|
|
1702
|
+
}
|
|
1703
|
+
else {
|
|
1704
|
+
cfg.serviceType = serviceOrDataProvider;
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
return cfg;
|
|
1708
|
+
};
|
|
1709
|
+
class FieldLookupDescriptor extends AFieldDescriptor {
|
|
1710
|
+
constructor(editor, property, cfg) {
|
|
1711
|
+
super(editor, property);
|
|
1712
|
+
this._lookupType = FieldLookupTypeEnum.Dropdown;
|
|
1713
|
+
this._optionsLabelTranslate = false;
|
|
1714
|
+
this._dropdownClassName = 'mng-filter-lookup-dropdown';
|
|
1715
|
+
if (cfg?.dataProvider) {
|
|
1716
|
+
this._dataProvider = cfg.dataProvider;
|
|
1717
|
+
}
|
|
1718
|
+
else {
|
|
1719
|
+
this._dataProvider = LookupDataProvider.fromAnyParam(cfg?.type, cfg?.serviceType);
|
|
1720
|
+
}
|
|
1721
|
+
this._optionsValueProperty = cfg?.optionsValueProperty;
|
|
1722
|
+
trySetLookupItemsProperties(this);
|
|
1723
|
+
}
|
|
1724
|
+
get lookupType() {
|
|
1725
|
+
return this._lookupType;
|
|
1726
|
+
}
|
|
1727
|
+
get optionsLabelProperty() {
|
|
1728
|
+
return this._optionsLabelProperty;
|
|
1729
|
+
}
|
|
1730
|
+
get optionsLabelTranslate() {
|
|
1731
|
+
return this._optionsLabelTranslate;
|
|
1732
|
+
}
|
|
1733
|
+
get optionsValueProperty() {
|
|
1734
|
+
return this._optionsValueProperty;
|
|
1735
|
+
}
|
|
1736
|
+
get optionsDisabledProperty() {
|
|
1737
|
+
return this._optionsDisabledProperty;
|
|
1738
|
+
}
|
|
1739
|
+
get optionsTrackProperty() {
|
|
1740
|
+
return this._optionsTrackProperty;
|
|
1741
|
+
}
|
|
1742
|
+
get dataProvider() {
|
|
1743
|
+
return this._dataProvider;
|
|
1744
|
+
}
|
|
1745
|
+
get autocompleteOpenOnFocus() {
|
|
1746
|
+
return this._autocompleteOpenOnFocus;
|
|
1747
|
+
}
|
|
1748
|
+
get autocompleteInlineSearch() {
|
|
1749
|
+
return this._autocompleteInlineSearch;
|
|
1750
|
+
}
|
|
1751
|
+
get autocompleteAutoClear() {
|
|
1752
|
+
return this._autocompleteAutoClear;
|
|
1753
|
+
}
|
|
1754
|
+
get autocompleteSelectFirst() {
|
|
1755
|
+
return this._autocompleteSelectFirst;
|
|
1756
|
+
}
|
|
1757
|
+
get dropdownClassName() {
|
|
1758
|
+
return this._dropdownClassName;
|
|
1759
|
+
}
|
|
1760
|
+
get dialogTableDescriptor() {
|
|
1761
|
+
return this._dialogTableDescriptor;
|
|
1762
|
+
}
|
|
1763
|
+
get dialogTableDataProvider() {
|
|
1764
|
+
return this._dialogTableDataProvider;
|
|
1765
|
+
}
|
|
1766
|
+
get customComponentName() {
|
|
1767
|
+
return this._customComponentName;
|
|
1768
|
+
}
|
|
1769
|
+
get trimOption() {
|
|
1770
|
+
return this._autocompleteInputTrim;
|
|
1771
|
+
}
|
|
1772
|
+
withOptionsLabelProperty(property, translate = false) {
|
|
1773
|
+
return this.withOptionsLabelPropertyUnsafe(property, translate);
|
|
1774
|
+
}
|
|
1775
|
+
withOptionsLabelPropertyUnsafe(property, translate = false) {
|
|
1776
|
+
this._optionsLabelProperty = property;
|
|
1777
|
+
this._optionsLabelTranslate = translate;
|
|
1778
|
+
return this;
|
|
1779
|
+
}
|
|
1780
|
+
withOptionsDisabledProperty(property) {
|
|
1781
|
+
return this.withOptionsDisabledPropertyUnsafe(property);
|
|
1782
|
+
}
|
|
1783
|
+
withOptionsDisabledPropertyUnsafe(property) {
|
|
1784
|
+
this._optionsDisabledProperty = property;
|
|
1785
|
+
return this;
|
|
1786
|
+
}
|
|
1787
|
+
withOptionsTrackProperty(property) {
|
|
1788
|
+
return this.withOptionsTrackPropertyUnsafe(property);
|
|
1789
|
+
}
|
|
1790
|
+
withOptionsTrackPropertyUnsafe(property) {
|
|
1791
|
+
if (this._optionsValueProperty) {
|
|
1792
|
+
return this;
|
|
1793
|
+
}
|
|
1794
|
+
this._optionsTrackProperty = property;
|
|
1795
|
+
return this;
|
|
1796
|
+
}
|
|
1797
|
+
withLookup(lookup) {
|
|
1798
|
+
this._dataProvider.withLookup(lookup);
|
|
1799
|
+
return this;
|
|
1800
|
+
}
|
|
1801
|
+
withInputTrim(trimOption = 'both') {
|
|
1802
|
+
this._autocompleteInputTrim = trimOption;
|
|
1803
|
+
return this;
|
|
1804
|
+
}
|
|
1805
|
+
withConfig(config) {
|
|
1806
|
+
return super.withConfig(config);
|
|
1807
|
+
}
|
|
1808
|
+
asAutocomplete(opts) {
|
|
1809
|
+
this._lookupType = FieldLookupTypeEnum.Autocomplete;
|
|
1810
|
+
this._autocompleteAutoClear = opts?.autoClear;
|
|
1811
|
+
this._autocompleteSelectFirst = opts?.selectFirst;
|
|
1812
|
+
this._autocompleteOpenOnFocus = opts?.openOnFocus;
|
|
1813
|
+
this._autocompleteInlineSearch = opts?.inlineSearch;
|
|
1814
|
+
return this;
|
|
1815
|
+
}
|
|
1816
|
+
asDialog(lookupTableDescriptor, tableDataProvider) {
|
|
1817
|
+
this._lookupType = FieldLookupTypeEnum.Dialog;
|
|
1818
|
+
this._dialogTableDescriptor = lookupTableDescriptor;
|
|
1819
|
+
this._dialogTableDataProvider = tableDataProvider;
|
|
1820
|
+
return this;
|
|
1821
|
+
}
|
|
1822
|
+
asCustomComponent(customComponentName) {
|
|
1823
|
+
this._lookupType = FieldLookupTypeEnum.Custom;
|
|
1824
|
+
this._customComponentName = customComponentName;
|
|
1825
|
+
return this;
|
|
1826
|
+
}
|
|
1827
|
+
copy() {
|
|
1828
|
+
const field = new FieldLookupDescriptor(this._editor, this._property, {
|
|
1829
|
+
dataProvider: this._dataProvider,
|
|
1830
|
+
optionsValueProperty: this._optionsValueProperty
|
|
1831
|
+
});
|
|
1832
|
+
this.copyFieldsTo(field);
|
|
1833
|
+
field._lookupType = this._lookupType;
|
|
1834
|
+
field._optionsLabelProperty = this._optionsLabelProperty;
|
|
1835
|
+
field._optionsLabelTranslate = this._optionsLabelTranslate;
|
|
1836
|
+
field._optionsDisabledProperty = this._optionsDisabledProperty;
|
|
1837
|
+
field._optionsTrackProperty = this._optionsTrackProperty;
|
|
1838
|
+
field._dropdownClassName = this._dropdownClassName;
|
|
1839
|
+
field._autocompleteOpenOnFocus = this._autocompleteOpenOnFocus;
|
|
1840
|
+
field._autocompleteInlineSearch = this._autocompleteInlineSearch;
|
|
1841
|
+
field._dialogTableDescriptor = this._dialogTableDescriptor;
|
|
1842
|
+
return field;
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
class FieldLookupEnumDescriptor extends FieldLookupDescriptor {
|
|
1846
|
+
constructor(editor, property, enumModel, options) {
|
|
1847
|
+
super(editor, property, {
|
|
1848
|
+
dataProvider: LookupDataProvider.create(),
|
|
1849
|
+
optionsValueProperty: 'value'
|
|
1850
|
+
});
|
|
1851
|
+
this._enumModel = enumModel;
|
|
1852
|
+
this._optionEnumValues = Array.isArray(options)
|
|
1853
|
+
? fromEnumValuesAsValueArray(this._enumModel.type, options, this._enumModel.nameAsValue, this._enumModel.i18nBaseKey ?? undefined)
|
|
1854
|
+
: fromEnumConstantsAsValueArray(this._enumModel.type, this._enumModel.nameAsValue, this._enumModel.i18nBaseKey ?? undefined);
|
|
1855
|
+
this.withLookup(() => of(this._optionEnumValues));
|
|
1856
|
+
this.withOptionsLabelProperty('title', this._enumModel.i18nBaseKey !== null);
|
|
1857
|
+
this.withOptionsDisabledProperty('disabled');
|
|
1858
|
+
}
|
|
1859
|
+
get enumModel() {
|
|
1860
|
+
return this._enumModel;
|
|
1861
|
+
}
|
|
1862
|
+
withDisabledOptions(...disabledOptions) {
|
|
1863
|
+
for (const disabledOption of disabledOptions) {
|
|
1864
|
+
const disabledOptionValue = this._enumModel.nameAsValue ? getEnumConstantName(this._enumModel.type, disabledOption) : disabledOption;
|
|
1865
|
+
if (disabledOptionValue) {
|
|
1866
|
+
const option = this._optionEnumValues.find(o => o.value === disabledOptionValue);
|
|
1867
|
+
if (option) {
|
|
1868
|
+
option.disabled = true;
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
return this;
|
|
1873
|
+
}
|
|
1874
|
+
withDefaultValueEnum(defaultValue) {
|
|
1875
|
+
const defaultOptionValue = this._enumModel.nameAsValue ? getEnumConstantName(this._enumModel.type, defaultValue) : defaultValue;
|
|
1876
|
+
if (defaultOptionValue) {
|
|
1877
|
+
const option = this._optionEnumValues.find(o => o.value === defaultOptionValue);
|
|
1878
|
+
if (option) {
|
|
1879
|
+
this.withDefaultValue(option[this._optionsValueProperty]);
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
return this;
|
|
1883
|
+
}
|
|
1884
|
+
asAutocomplete(opts) {
|
|
1885
|
+
super.asAutocomplete({
|
|
1886
|
+
...opts,
|
|
1887
|
+
openOnFocus: opts?.openOnFocus ?? true,
|
|
1888
|
+
inlineSearch: opts?.inlineSearch ?? true
|
|
1889
|
+
});
|
|
1890
|
+
return this;
|
|
1891
|
+
}
|
|
1892
|
+
copy() {
|
|
1893
|
+
const field = new FieldLookupEnumDescriptor(this._editor, this._property, this._enumModel, []);
|
|
1894
|
+
this.copyFieldsTo(field);
|
|
1895
|
+
field._lookupType = this._lookupType;
|
|
1896
|
+
field._optionsLabelProperty = this._optionsLabelProperty;
|
|
1897
|
+
field._optionsDisabledProperty = this._optionsDisabledProperty;
|
|
1898
|
+
field._optionsTrackProperty = this._optionsTrackProperty;
|
|
1899
|
+
return field;
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
const fieldManyToManyGetProviderCfgObj = (serviceOrDataProvider) => {
|
|
1904
|
+
const cfg = {};
|
|
1905
|
+
if (serviceOrDataProvider) {
|
|
1906
|
+
if (serviceOrDataProvider.isDataProvider) {
|
|
1907
|
+
// type casting needed, cause there was no other way found to differentiate the types
|
|
1908
|
+
cfg.lookupDataProvider = serviceOrDataProvider;
|
|
1909
|
+
}
|
|
1910
|
+
else {
|
|
1911
|
+
cfg.lookupServiceType = serviceOrDataProvider;
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
return cfg;
|
|
1915
|
+
};
|
|
1916
|
+
class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
|
|
1917
|
+
constructor(editor, property, mainTableDescriptor, lookupTableDescriptor, cfg) {
|
|
1918
|
+
super(editor, property);
|
|
1919
|
+
this._fieldType = FieldManyToManyEditorTypeEnum.DialogTableMultiselect;
|
|
1920
|
+
this._actions = [FieldManyToManyEditorActionEnum.Add, FieldManyToManyEditorActionEnum.Delete];
|
|
1921
|
+
this._hasLookupExcludeValues = false;
|
|
1922
|
+
this._excludeFilterProperty = '';
|
|
1923
|
+
this._excludeValueProperty = '';
|
|
1924
|
+
this._searchEnabled = false;
|
|
1925
|
+
this._mainTableDescriptor = mainTableDescriptor;
|
|
1926
|
+
this._lookupTableDescriptor = lookupTableDescriptor;
|
|
1927
|
+
if (cfg?.lookupDataProvider) {
|
|
1928
|
+
this._lookupTableDataProvider = cfg.lookupDataProvider;
|
|
1929
|
+
}
|
|
1930
|
+
else {
|
|
1931
|
+
this._lookupTableDataProvider = TableDataProvider.fromAnyParam(lookupTableDescriptor.model.type, cfg?.lookupServiceType);
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
get fieldType() {
|
|
1935
|
+
return this._fieldType;
|
|
1936
|
+
}
|
|
1937
|
+
get actions() {
|
|
1938
|
+
return this._actions;
|
|
1939
|
+
}
|
|
1940
|
+
get hasLookupExcludeValues() {
|
|
1941
|
+
return this._hasLookupExcludeValues;
|
|
1942
|
+
}
|
|
1943
|
+
get excludeFilterProperty() {
|
|
1944
|
+
return this._excludeFilterProperty;
|
|
1945
|
+
}
|
|
1946
|
+
get excludeValueProperty() {
|
|
1947
|
+
return this._excludeValueProperty;
|
|
1948
|
+
}
|
|
1949
|
+
get mainTableDescriptor() {
|
|
1950
|
+
return this._mainTableDescriptor;
|
|
1951
|
+
}
|
|
1952
|
+
get lookupTableDescriptor() {
|
|
1953
|
+
return this._lookupTableDescriptor;
|
|
1954
|
+
}
|
|
1955
|
+
get lookupTableDataProvider() {
|
|
1956
|
+
return this._lookupTableDataProvider;
|
|
1957
|
+
}
|
|
1958
|
+
get searchEnabled() {
|
|
1959
|
+
return this._searchEnabled;
|
|
1960
|
+
}
|
|
1961
|
+
get searchFields() {
|
|
1962
|
+
return this._searchFields;
|
|
1963
|
+
}
|
|
1964
|
+
withLookup(fn) {
|
|
1965
|
+
this._lookupTableDataProvider.withGetAll(fn);
|
|
1966
|
+
return this;
|
|
1967
|
+
}
|
|
1968
|
+
withActions(actions = []) {
|
|
1969
|
+
this.actions.push(...actions);
|
|
1970
|
+
return this;
|
|
1971
|
+
}
|
|
1972
|
+
withLookupExclude(filterProperty, valueProperty, hasLookupExclude = true) {
|
|
1973
|
+
return this.withLookupExcludeUnsafe(filterProperty, valueProperty, hasLookupExclude);
|
|
1974
|
+
}
|
|
1975
|
+
withLookupExcludeUnsafe(filterProperty, valueProperty, hasLookupExclude = true) {
|
|
1976
|
+
this._hasLookupExcludeValues = hasLookupExclude;
|
|
1977
|
+
this._excludeFilterProperty = filterProperty;
|
|
1978
|
+
this._excludeValueProperty = valueProperty;
|
|
1979
|
+
return this;
|
|
1980
|
+
}
|
|
1981
|
+
withSearch(enabled = true, searchFields) {
|
|
1982
|
+
this._searchEnabled = enabled;
|
|
1983
|
+
this._searchFields = searchFields;
|
|
1984
|
+
return this;
|
|
1985
|
+
}
|
|
1986
|
+
copy() {
|
|
1987
|
+
const field = new FieldManyToManyEditorDescriptor(this._editor, this._property, this._mainTableDescriptor.copy(), this._lookupTableDescriptor.copy(), {
|
|
1988
|
+
lookupDataProvider: this.lookupTableDataProvider
|
|
1989
|
+
});
|
|
1990
|
+
this.copyFieldsTo(field);
|
|
1991
|
+
field._fieldType = this._fieldType;
|
|
1992
|
+
field._actions = this._actions.map(a => a);
|
|
1993
|
+
field._hasLookupExcludeValues = this._hasLookupExcludeValues;
|
|
1994
|
+
field._excludeFilterProperty = this._excludeFilterProperty;
|
|
1995
|
+
field._excludeValueProperty = this._excludeValueProperty;
|
|
1996
|
+
return field;
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
class FieldManyEditorDescriptor extends AFieldDescriptor {
|
|
2000
|
+
constructor(editor, property, tableviewDescriptor) {
|
|
2001
|
+
super(editor, property);
|
|
2002
|
+
this._fieldType = FieldManyEditorTypeEnum.DialogEditor;
|
|
2003
|
+
this._fieldActions = [];
|
|
2004
|
+
this._actions = [];
|
|
2005
|
+
this._tableviewDescriptor = tableviewDescriptor;
|
|
2006
|
+
this._fieldActions.push(FieldManyEditorActionEnum.View, FieldManyEditorActionEnum.Add, FieldManyEditorActionEnum.Edit, FieldManyEditorActionEnum.Delete);
|
|
2007
|
+
}
|
|
2008
|
+
get fieldType() {
|
|
2009
|
+
return this._fieldType;
|
|
2010
|
+
}
|
|
2011
|
+
get fieldActions() {
|
|
2012
|
+
return this._fieldActions;
|
|
2013
|
+
}
|
|
2014
|
+
get actions() {
|
|
2015
|
+
return this._actions;
|
|
2016
|
+
}
|
|
2017
|
+
get tableviewDescriptor() {
|
|
2018
|
+
return this._tableviewDescriptor;
|
|
2019
|
+
}
|
|
2020
|
+
get tableDescriptor() {
|
|
2021
|
+
return this._tableviewDescriptor.table;
|
|
2022
|
+
}
|
|
2023
|
+
get editorForCreate() {
|
|
2024
|
+
return this._tableviewDescriptor.addEditor;
|
|
2025
|
+
}
|
|
2026
|
+
get editorForRead() {
|
|
2027
|
+
return this._tableviewDescriptor.detailsEditor;
|
|
2028
|
+
}
|
|
2029
|
+
get editorForUpdate() {
|
|
2030
|
+
return this._tableviewDescriptor.editEditor;
|
|
2031
|
+
}
|
|
2032
|
+
withFieldAction(action) {
|
|
2033
|
+
this._fieldActions.push(action);
|
|
2034
|
+
return this;
|
|
2035
|
+
}
|
|
2036
|
+
withFieldActions(actions) {
|
|
2037
|
+
this._fieldActions = actions;
|
|
2038
|
+
return this;
|
|
2039
|
+
}
|
|
2040
|
+
withAction(action) {
|
|
2041
|
+
this._actions.push(action);
|
|
2042
|
+
return this;
|
|
2043
|
+
}
|
|
2044
|
+
copy() {
|
|
2045
|
+
const field = new FieldManyEditorDescriptor(this._editor, this._property, this._tableviewDescriptor.copy());
|
|
2046
|
+
this.copyFieldsTo(field);
|
|
2047
|
+
field._fieldType = this._fieldType;
|
|
2048
|
+
field._fieldActions = this._fieldActions.map(a => a);
|
|
2049
|
+
return field;
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
const minDateValidator = (min) => {
|
|
2054
|
+
return (c) => {
|
|
2055
|
+
const date = c?.value;
|
|
2056
|
+
const valid = !date || date >= min;
|
|
2057
|
+
if (!valid) {
|
|
2058
|
+
const newErrors = { ...c.errors, minDate: true };
|
|
2059
|
+
c?.markAsDirty();
|
|
2060
|
+
c.setErrors(newErrors);
|
|
2061
|
+
return newErrors;
|
|
2062
|
+
}
|
|
2063
|
+
if (c?.hasError('minDate')) {
|
|
2064
|
+
c.setErrors({ ...c.errors, minDate: null });
|
|
2065
|
+
}
|
|
2066
|
+
return null;
|
|
2067
|
+
};
|
|
2068
|
+
};
|
|
2069
|
+
const maxDateValidator = (max) => {
|
|
2070
|
+
return (c) => {
|
|
2071
|
+
const date = c?.value;
|
|
2072
|
+
const valid = !date || date <= max;
|
|
2073
|
+
if (!valid) {
|
|
2074
|
+
const newErrors = { ...c.errors, maxDate: true };
|
|
2075
|
+
c?.markAsDirty();
|
|
2076
|
+
c.setErrors(newErrors);
|
|
2077
|
+
return newErrors;
|
|
2078
|
+
}
|
|
2079
|
+
if (c?.hasError('maxDate')) {
|
|
2080
|
+
c.setErrors({ ...c.errors, maxDate: null });
|
|
2081
|
+
}
|
|
2082
|
+
return null;
|
|
2083
|
+
};
|
|
2084
|
+
};
|
|
2085
|
+
|
|
2086
|
+
class FieldInputDescriptor extends AFieldDescriptor {
|
|
2087
|
+
constructor(editor, property) {
|
|
2088
|
+
super(editor, property);
|
|
2089
|
+
this._fieldType = FieldInputTypeEnum.Text;
|
|
2090
|
+
this._numberUseGrouping = true;
|
|
2091
|
+
this._currencyDisplay = 'symbol';
|
|
2092
|
+
// radio specific properties
|
|
2093
|
+
this._radioOptions = [];
|
|
2094
|
+
}
|
|
2095
|
+
/**
|
|
2096
|
+
* converts field to given type with additional arguments
|
|
2097
|
+
* @param fieldType field type enum
|
|
2098
|
+
* @param args any additional arguments for field (optional)
|
|
2099
|
+
*/
|
|
2100
|
+
asType(fieldType, ...args) {
|
|
2101
|
+
switch (fieldType) {
|
|
2102
|
+
case FieldInputTypeEnum.Hidden:
|
|
2103
|
+
return this.asHidden();
|
|
2104
|
+
case FieldInputTypeEnum.Label:
|
|
2105
|
+
return this.asLabel();
|
|
2106
|
+
case FieldInputTypeEnum.Textarea:
|
|
2107
|
+
return this.asTextarea(...args);
|
|
2108
|
+
case FieldInputTypeEnum.Number:
|
|
2109
|
+
return this.asNumber(...args);
|
|
2110
|
+
case FieldInputTypeEnum.Currency:
|
|
2111
|
+
return this.asCurrency(...args);
|
|
2112
|
+
case FieldInputTypeEnum.Switch:
|
|
2113
|
+
return this.asSwitch();
|
|
2114
|
+
case FieldInputTypeEnum.Radio:
|
|
2115
|
+
return this.asRadio(args[0], args[1]);
|
|
2116
|
+
case FieldInputTypeEnum.Datepicker:
|
|
2117
|
+
return this.asDatePicker(...args);
|
|
2118
|
+
case FieldInputTypeEnum.Mask:
|
|
2119
|
+
return this.asMask(args[0], args[1]);
|
|
2120
|
+
case FieldInputTypeEnum.File:
|
|
2121
|
+
return this.asFile(...args);
|
|
2122
|
+
case FieldInputTypeEnum.ImageFile:
|
|
2123
|
+
return this.asImageFile(...args);
|
|
2124
|
+
case FieldInputTypeEnum.ImageUrl:
|
|
2125
|
+
return this.asImageUrl(...args);
|
|
2126
|
+
case FieldInputTypeEnum.Custom:
|
|
2127
|
+
return this.asCustomComponent(args[0], args[1]);
|
|
2128
|
+
case FieldInputTypeEnum.Text:
|
|
2129
|
+
return this.asText(args[0]);
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
get fieldType() {
|
|
2133
|
+
return this._fieldType;
|
|
2134
|
+
}
|
|
2135
|
+
get rows() {
|
|
2136
|
+
return this._rows;
|
|
2137
|
+
}
|
|
2138
|
+
get numberMin() {
|
|
2139
|
+
return this._numberMin;
|
|
2140
|
+
}
|
|
2141
|
+
get numberMax() {
|
|
2142
|
+
return this._numberMax;
|
|
2143
|
+
}
|
|
2144
|
+
get numberStep() {
|
|
2145
|
+
return this._numberStep;
|
|
2146
|
+
}
|
|
2147
|
+
get numberAutoCorrect() {
|
|
2148
|
+
return this._numberAutoCorrect;
|
|
2149
|
+
}
|
|
2150
|
+
get numberMinFractionDigits() {
|
|
2151
|
+
return this._numberMinFractionDigits;
|
|
2152
|
+
}
|
|
2153
|
+
get numberMaxFractionDigits() {
|
|
2154
|
+
return this._numberMaxFractionDigits;
|
|
2155
|
+
}
|
|
2156
|
+
get numberUseGrouping() {
|
|
2157
|
+
return this._numberUseGrouping;
|
|
2158
|
+
}
|
|
2159
|
+
get radioOptions() {
|
|
2160
|
+
return this._radioOptions;
|
|
2161
|
+
}
|
|
2162
|
+
get datePickerFormat() {
|
|
2163
|
+
return this._datePickerFormat;
|
|
2164
|
+
}
|
|
2165
|
+
get datePickerMin() {
|
|
2166
|
+
return this._datePickerMin;
|
|
2167
|
+
}
|
|
2168
|
+
get datePickerMax() {
|
|
2169
|
+
return this._datePickerMax;
|
|
2170
|
+
}
|
|
2171
|
+
get datePickerShowTime() {
|
|
2172
|
+
return this._datePickerShowTime;
|
|
2173
|
+
}
|
|
2174
|
+
get datePickerShowSeconds() {
|
|
2175
|
+
return this._datePickerShowSeconds;
|
|
2176
|
+
}
|
|
2177
|
+
get maxLength() {
|
|
2178
|
+
return this._maxLength;
|
|
2179
|
+
}
|
|
2180
|
+
get minLength() {
|
|
2181
|
+
return this._minLength;
|
|
2182
|
+
}
|
|
2183
|
+
get pattern() {
|
|
2184
|
+
return this._pattern;
|
|
2185
|
+
}
|
|
2186
|
+
get trimOption() {
|
|
2187
|
+
return this._inputTrim;
|
|
2188
|
+
}
|
|
2189
|
+
get mask() {
|
|
2190
|
+
return this._mask;
|
|
2191
|
+
}
|
|
2192
|
+
get slotChar() {
|
|
2193
|
+
return this._slotChar;
|
|
2194
|
+
}
|
|
2195
|
+
get fileMultiple() {
|
|
2196
|
+
return this._fileMultiple;
|
|
2197
|
+
}
|
|
2198
|
+
get fileMaxFileSize() {
|
|
2199
|
+
return this._fileMaxFileSize;
|
|
2200
|
+
}
|
|
2201
|
+
get fileAccept() {
|
|
2202
|
+
return this._fileAccept;
|
|
2203
|
+
}
|
|
2204
|
+
get fileOnSelectHandler() {
|
|
2205
|
+
return this._fileOnSelectHandler;
|
|
2206
|
+
}
|
|
2207
|
+
get imagePreview() {
|
|
2208
|
+
return this._imagePreview;
|
|
2209
|
+
}
|
|
2210
|
+
get imageUrlInputVisibleOnDisabled() {
|
|
2211
|
+
return this._imageUrlInputHiddenOnDisabled;
|
|
2212
|
+
}
|
|
2213
|
+
get customComponentType() {
|
|
2214
|
+
return this._customComponentType;
|
|
2215
|
+
}
|
|
2216
|
+
get customComponentInputs() {
|
|
2217
|
+
return this._customComponentInputs;
|
|
2218
|
+
}
|
|
2219
|
+
get customComponentWrappers() {
|
|
2220
|
+
return this._customComponentWrappers;
|
|
2221
|
+
}
|
|
2222
|
+
get locale() {
|
|
2223
|
+
return this._locale;
|
|
2224
|
+
}
|
|
2225
|
+
get currency() {
|
|
2226
|
+
return this._currency;
|
|
2227
|
+
}
|
|
2228
|
+
get currencyFromProperty() {
|
|
2229
|
+
return this._currencyFromProperty;
|
|
2230
|
+
}
|
|
2231
|
+
get currencyDisplay() {
|
|
2232
|
+
return this._currencyDisplay;
|
|
2233
|
+
}
|
|
2234
|
+
asHidden() {
|
|
2235
|
+
this._fieldType = FieldInputTypeEnum.Hidden;
|
|
2236
|
+
return this;
|
|
2237
|
+
}
|
|
2238
|
+
asLabel() {
|
|
2239
|
+
this._fieldType = FieldInputTypeEnum.Label;
|
|
2240
|
+
return this;
|
|
2241
|
+
}
|
|
2242
|
+
asText(opts) {
|
|
2243
|
+
this._fieldType = FieldInputTypeEnum.Text;
|
|
2244
|
+
return this.withTextValidation(opts).withTextValidationEmail(opts?.email ?? false);
|
|
2245
|
+
}
|
|
2246
|
+
asTextarea(opts) {
|
|
2247
|
+
this._fieldType = FieldInputTypeEnum.Textarea;
|
|
2248
|
+
this._rows = opts?.rows;
|
|
2249
|
+
return this.withTextValidation(opts);
|
|
2250
|
+
}
|
|
2251
|
+
asNumber(opts) {
|
|
2252
|
+
this._fieldType = FieldInputTypeEnum.Number;
|
|
2253
|
+
return this.withNumberGrouping(opts?.groupSeparator ?? false)
|
|
2254
|
+
.withNumberFractions(opts)
|
|
2255
|
+
.withNumberValidation(opts)
|
|
2256
|
+
.withLocale(opts?.locale);
|
|
2257
|
+
}
|
|
2258
|
+
asCurrency(opts) {
|
|
2259
|
+
return this.asCurrencyUnsafe({
|
|
2260
|
+
...opts,
|
|
2261
|
+
currencyProperty: opts?.currencyProperty ? opts.currencyProperty : undefined
|
|
2262
|
+
});
|
|
2263
|
+
}
|
|
2264
|
+
asCurrencyUnsafe(opts) {
|
|
2265
|
+
this._fieldType = FieldInputTypeEnum.Currency;
|
|
2266
|
+
this._currencyFromProperty = opts?.currencyProperty;
|
|
2267
|
+
this._currency = opts?.currency ?? this._currency;
|
|
2268
|
+
this._currencyDisplay = opts?.currencyDisplay ?? this._currencyDisplay;
|
|
2269
|
+
return this.withNumberGrouping(opts?.groupSeparator ?? false)
|
|
2270
|
+
.withNumberFractions({
|
|
2271
|
+
maxFractionDigits: opts?.maxFractionDigits ?? 2,
|
|
2272
|
+
minFractionDigits: opts?.minFractionDigits ?? 2
|
|
2273
|
+
})
|
|
2274
|
+
.withNumberValidation(opts)
|
|
2275
|
+
.withLocale(opts?.locale);
|
|
2276
|
+
}
|
|
2277
|
+
asSwitch() {
|
|
2278
|
+
this._fieldType = FieldInputTypeEnum.Switch;
|
|
2279
|
+
return this;
|
|
2280
|
+
}
|
|
2281
|
+
asRadio(options, optionsTitlePath) {
|
|
2282
|
+
this._fieldType = FieldInputTypeEnum.Radio;
|
|
2283
|
+
this._radioOptions = options.map(o => ({ value: o, title: `${optionsTitlePath ? `${optionsTitlePath}.` : ''}${o}` }));
|
|
2284
|
+
return this;
|
|
2285
|
+
}
|
|
2286
|
+
asRadioFromEnum(enumModel, values) {
|
|
2287
|
+
this._fieldType = FieldInputTypeEnum.Radio;
|
|
2288
|
+
this._radioOptions = Array.isArray(values)
|
|
2289
|
+
? fromEnumValuesAsValueArray(enumModel.type, values, enumModel.nameAsValue, enumModel.i18nBaseKey ?? undefined)
|
|
2290
|
+
: fromEnumConstantsAsValueArray(enumModel.type, enumModel.nameAsValue, enumModel.i18nBaseKey ?? undefined);
|
|
2291
|
+
return this;
|
|
2292
|
+
}
|
|
2293
|
+
asDatePicker(opts) {
|
|
2294
|
+
this._fieldType = FieldInputTypeEnum.Datepicker;
|
|
2295
|
+
this._datePickerFormat = opts?.format;
|
|
2296
|
+
this._datePickerMin = opts?.min;
|
|
2297
|
+
this._datePickerMax = opts?.max;
|
|
2298
|
+
this._datePickerShowTime = opts?.showTime;
|
|
2299
|
+
this._datePickerShowSeconds = opts?.showSeconds;
|
|
2300
|
+
if (opts?.min != undefined) {
|
|
2301
|
+
this.withValidation('minDate', minDateValidator(opts.min));
|
|
2302
|
+
}
|
|
2303
|
+
if (opts?.max !== undefined) {
|
|
2304
|
+
this.withValidation('maxDate', maxDateValidator(opts.max));
|
|
2305
|
+
}
|
|
2306
|
+
return this;
|
|
2307
|
+
}
|
|
2308
|
+
asMask(mask, slotChar) {
|
|
2309
|
+
this._fieldType = FieldInputTypeEnum.Mask;
|
|
2310
|
+
this._mask = mask;
|
|
2311
|
+
this._slotChar = slotChar;
|
|
2312
|
+
return this;
|
|
2313
|
+
}
|
|
2314
|
+
asFile(opts) {
|
|
2315
|
+
this._fieldType = FieldInputTypeEnum.File;
|
|
2316
|
+
this._fileMultiple = opts?.multiple;
|
|
2317
|
+
this._fileMaxFileSize = opts?.maxFileSize;
|
|
2318
|
+
this._fileAccept = opts?.accept;
|
|
2319
|
+
return this.withFileOnSelectHandler(opts?.onFileSelectHandlerFn);
|
|
2320
|
+
}
|
|
2321
|
+
asImageFile(opts) {
|
|
2322
|
+
this.asFile(opts);
|
|
2323
|
+
this._fieldType = FieldInputTypeEnum.ImageFile;
|
|
2324
|
+
return this;
|
|
2325
|
+
}
|
|
2326
|
+
asImageUrl(opts) {
|
|
2327
|
+
this._fieldType = FieldInputTypeEnum.ImageUrl;
|
|
2328
|
+
this._fileMultiple = opts?.multiple;
|
|
2329
|
+
this._imagePreview = opts?.preview;
|
|
2330
|
+
this._imageUrlInputHiddenOnDisabled = opts?.inputVisibleOnDisabled;
|
|
2331
|
+
return this;
|
|
2332
|
+
}
|
|
2333
|
+
asCustomComponent(component, opts) {
|
|
2334
|
+
this._fieldType = FieldInputTypeEnum.Custom;
|
|
2335
|
+
this._customComponentType = component;
|
|
2336
|
+
this._customComponentInputs = opts?.inputs;
|
|
2337
|
+
this._customComponentWrappers = opts?.fieldWrappers;
|
|
2338
|
+
return this;
|
|
2339
|
+
}
|
|
2340
|
+
withNumberValidation(opts) {
|
|
2341
|
+
this._numberStep = opts?.step;
|
|
2342
|
+
this._numberAutoCorrect = opts?.autoCorrect;
|
|
2343
|
+
this._numberMin = opts?.min;
|
|
2344
|
+
this._numberMax = opts?.max;
|
|
2345
|
+
return this;
|
|
2346
|
+
}
|
|
2347
|
+
withLocale(locale) {
|
|
2348
|
+
this._locale = locale;
|
|
2349
|
+
return this;
|
|
2350
|
+
}
|
|
2351
|
+
withNumberFractions(opts) {
|
|
2352
|
+
this._numberMinFractionDigits = opts?.minFractionDigits;
|
|
2353
|
+
this._numberMaxFractionDigits = opts?.maxFractionDigits;
|
|
2354
|
+
return this;
|
|
2355
|
+
}
|
|
2356
|
+
withNumberGrouping(useGrouping = true) {
|
|
2357
|
+
this._numberUseGrouping = useGrouping;
|
|
2358
|
+
return this;
|
|
2359
|
+
}
|
|
2360
|
+
withTextValidation(opts) {
|
|
2361
|
+
this._minLength = opts?.minLength;
|
|
2362
|
+
this._maxLength = opts?.maxLength;
|
|
2363
|
+
this._pattern = opts?.pattern;
|
|
2364
|
+
return this;
|
|
2365
|
+
}
|
|
2366
|
+
withInputTrim(trimOption = 'both') {
|
|
2367
|
+
this._inputTrim = trimOption;
|
|
2368
|
+
return this;
|
|
2369
|
+
}
|
|
2370
|
+
withTextValidationEmail(email = true) {
|
|
2371
|
+
if (this.fieldType === FieldInputTypeEnum.Text && email) {
|
|
2372
|
+
this.withValidation('email', Validators.email);
|
|
2373
|
+
}
|
|
2374
|
+
else if (!email) {
|
|
2375
|
+
this.removeValidation('email');
|
|
2376
|
+
}
|
|
2377
|
+
return this;
|
|
2378
|
+
}
|
|
2379
|
+
withFileOnSelectHandler(fn) {
|
|
2380
|
+
this._fileOnSelectHandler = fn;
|
|
2381
|
+
return this;
|
|
2382
|
+
}
|
|
2383
|
+
copy() {
|
|
2384
|
+
const field = new FieldInputDescriptor(this._editor, this._property);
|
|
2385
|
+
this.copyFieldsTo(field);
|
|
2386
|
+
field._fieldType = this._fieldType;
|
|
2387
|
+
field._rows = this._rows;
|
|
2388
|
+
field._numberMin = this._numberMin;
|
|
2389
|
+
field._numberMax = this._numberMax;
|
|
2390
|
+
field._numberStep = this._numberStep;
|
|
2391
|
+
field._numberAutoCorrect = this._numberAutoCorrect;
|
|
2392
|
+
field._numberMinFractionDigits = this._numberMinFractionDigits;
|
|
2393
|
+
field._numberMaxFractionDigits = this._numberMaxFractionDigits;
|
|
2394
|
+
field._numberUseGrouping = this._numberUseGrouping;
|
|
2395
|
+
field._radioOptions = [...this._radioOptions];
|
|
2396
|
+
field._datePickerFormat = this._datePickerFormat;
|
|
2397
|
+
field._datePickerMin = this._datePickerMin;
|
|
2398
|
+
field._datePickerMax = this._datePickerMax;
|
|
2399
|
+
field._datePickerShowTime = this._datePickerShowTime;
|
|
2400
|
+
field._datePickerShowSeconds = this._datePickerShowSeconds;
|
|
2401
|
+
field._maxLength = this._maxLength;
|
|
2402
|
+
field._minLength = this._minLength;
|
|
2403
|
+
field._pattern = this._pattern;
|
|
2404
|
+
field._mask = this._mask;
|
|
2405
|
+
field._slotChar = this._slotChar;
|
|
2406
|
+
field._fileMultiple = this._fileMultiple;
|
|
2407
|
+
field._fileMaxFileSize = this._fileMaxFileSize;
|
|
2408
|
+
field._fileAccept = this._fileAccept;
|
|
2409
|
+
field._fileOnSelectHandler = this._fileOnSelectHandler;
|
|
2410
|
+
field._imagePreview = this._imagePreview;
|
|
2411
|
+
field._imageUrlInputHiddenOnDisabled = this._imageUrlInputHiddenOnDisabled;
|
|
2412
|
+
field._customComponentType = this._customComponentType;
|
|
2413
|
+
field._customComponentInputs = this._customComponentInputs;
|
|
2414
|
+
field._customComponentWrappers = this._customComponentWrappers;
|
|
2415
|
+
field._locale = this._locale;
|
|
2416
|
+
field._currency = this._currency;
|
|
2417
|
+
field._currencyDisplay = this._currencyDisplay;
|
|
2418
|
+
field._currencyFromProperty = this._currencyFromProperty;
|
|
2419
|
+
field._inputTrim = this._inputTrim;
|
|
2420
|
+
return field;
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
class EditorDescriptorInst {
|
|
2425
|
+
static { this.defaultGroupName = EDITOR_DEFAULT_GROUP_NAME; }
|
|
2426
|
+
/**
|
|
2427
|
+
* Creates new instance of editor descriptor.
|
|
2428
|
+
* @param model Model descriptor.
|
|
2429
|
+
* @param tableviewEditorType Type of editor in tableview (add, edit, view or none).
|
|
2430
|
+
*/
|
|
2431
|
+
constructor(model, tableviewEditorType = TableviewEditorTypeEnum.None) {
|
|
2432
|
+
/** @ignore */ this._tabs = [];
|
|
2433
|
+
/** @ignore */ this._groups = [];
|
|
2434
|
+
/** @ignore */ this._fields = [];
|
|
2435
|
+
/** @ignore */ this._disabled = false;
|
|
2436
|
+
/** @ignore */ this._isLocalized = false;
|
|
2437
|
+
/** @ignore */ this._eventsSubject = new Subject();
|
|
2438
|
+
this._model = model;
|
|
2439
|
+
this._tableviewEditorType = tableviewEditorType;
|
|
2440
|
+
}
|
|
2441
|
+
/**
|
|
2442
|
+
* Model descriptor for editor.
|
|
2443
|
+
*/
|
|
2444
|
+
get model() {
|
|
2445
|
+
return this._model;
|
|
2446
|
+
}
|
|
2447
|
+
/**
|
|
2448
|
+
* Editor's tabs.
|
|
2449
|
+
*/
|
|
2450
|
+
get tabs() {
|
|
2451
|
+
return this._tabs;
|
|
2452
|
+
}
|
|
2453
|
+
/**
|
|
2454
|
+
* Editor's fields.
|
|
2455
|
+
*/
|
|
2456
|
+
get fields() {
|
|
2457
|
+
return this._fields;
|
|
2458
|
+
}
|
|
2459
|
+
/**
|
|
2460
|
+
* Type of editor for tableview.
|
|
2461
|
+
*/
|
|
2462
|
+
get tableviewEditorType() {
|
|
2463
|
+
return this._tableviewEditorType;
|
|
2464
|
+
}
|
|
2465
|
+
/**
|
|
2466
|
+
* If editor is disabled.
|
|
2467
|
+
*/
|
|
2468
|
+
get disabled() {
|
|
2469
|
+
return this._disabled;
|
|
2470
|
+
}
|
|
2471
|
+
get isLocalized() {
|
|
2472
|
+
return this._isLocalized;
|
|
2473
|
+
}
|
|
2474
|
+
get localizationLocaleProperty() {
|
|
2475
|
+
return this._localizationLocaleProperty;
|
|
2476
|
+
}
|
|
2477
|
+
get localizationLocalizationProperty() {
|
|
2478
|
+
return this._localizationLocalizationProperty;
|
|
2479
|
+
}
|
|
2480
|
+
get localizationModel() {
|
|
2481
|
+
return this._localizationModel;
|
|
2482
|
+
}
|
|
2483
|
+
/**
|
|
2484
|
+
* Creates new tab group. Next added fields are added to newly created tab group.
|
|
2485
|
+
* @param name Name of the group.
|
|
2486
|
+
* @param title Title key for the tab.
|
|
2487
|
+
*/
|
|
2488
|
+
createTabGroup(name, title) {
|
|
2489
|
+
const tabGroup = new FieldTabGroupDescriptor(this, name);
|
|
2490
|
+
if (!title) {
|
|
2491
|
+
title = getI18nTypeTabKey(this.model.i18nBaseKey, name);
|
|
2492
|
+
}
|
|
2493
|
+
tabGroup.withTitle(title);
|
|
2494
|
+
this.createTabGroupDescriptor(tabGroup);
|
|
2495
|
+
return tabGroup;
|
|
2496
|
+
}
|
|
2497
|
+
/**
|
|
2498
|
+
* Creates new field group. Next added fields are added to newly created field group.
|
|
2499
|
+
* @param name Name of the group.
|
|
2500
|
+
* @param title Title key for the group.
|
|
2501
|
+
*/
|
|
2502
|
+
createFieldGroup(name, title) {
|
|
2503
|
+
const fieldGroup = new FieldGroupDescriptor(this, name);
|
|
2504
|
+
if (title !== null) {
|
|
2505
|
+
if (!title) {
|
|
2506
|
+
title = getI18nTypeGroupKey(this.model.i18nBaseKey, name);
|
|
2507
|
+
}
|
|
2508
|
+
fieldGroup.withTitle(title);
|
|
2509
|
+
}
|
|
2510
|
+
this.createFieldGroupDescriptor(fieldGroup);
|
|
2511
|
+
return fieldGroup;
|
|
2512
|
+
}
|
|
2513
|
+
/**
|
|
2514
|
+
* Gets field by the model property name.
|
|
2515
|
+
* @param property Model property name.
|
|
2516
|
+
*/
|
|
2517
|
+
getField(property) {
|
|
2518
|
+
return this.getFieldUnsafe(property);
|
|
2519
|
+
}
|
|
2520
|
+
/**
|
|
2521
|
+
* Gets field by the model property name (UNSAFE).
|
|
2522
|
+
* @param property Model property name.
|
|
2523
|
+
*/
|
|
2524
|
+
getFieldUnsafe(property) {
|
|
2525
|
+
return this._fields.find(f => f.property === property) ?? null;
|
|
2526
|
+
}
|
|
2527
|
+
/**
|
|
2528
|
+
* Removes field by the model property name.
|
|
2529
|
+
* @param property Model property name.
|
|
2530
|
+
*/
|
|
2531
|
+
removeField(property) {
|
|
2532
|
+
return this.removeFieldUnsafe(property);
|
|
2533
|
+
}
|
|
2534
|
+
/**
|
|
2535
|
+
* Removes field by the model property name (UNSAFE).
|
|
2536
|
+
* @param property Model property name.
|
|
2537
|
+
*/
|
|
2538
|
+
removeFieldUnsafe(property) {
|
|
2539
|
+
const fieldIdx = this._fields.findIndex(f => f.property === property);
|
|
2540
|
+
if (fieldIdx < 0) {
|
|
2541
|
+
throw new CommonsInternalError(`Field ${property} does not exist.`, { name: 'EditorDescriptorError' });
|
|
2542
|
+
}
|
|
2543
|
+
for (const group of this._groups) {
|
|
2544
|
+
const groupFieldIdx = group.fields.findIndex(f => f instanceof AFieldDescriptor && f.property === property);
|
|
2545
|
+
if (groupFieldIdx >= 0) {
|
|
2546
|
+
group.fields.splice(groupFieldIdx, 1);
|
|
2547
|
+
break;
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
this._fields.splice(fieldIdx, 1);
|
|
2551
|
+
}
|
|
2552
|
+
/**
|
|
2553
|
+
* Adds field by the descriptor.
|
|
2554
|
+
* @param field Field descriptor.
|
|
2555
|
+
*/
|
|
2556
|
+
addFieldDescriptor(field) {
|
|
2557
|
+
this.createDefaultGroup();
|
|
2558
|
+
this._fields.push(field);
|
|
2559
|
+
this._currentGroup?.addField(field);
|
|
2560
|
+
return this;
|
|
2561
|
+
}
|
|
2562
|
+
/**
|
|
2563
|
+
* Adds field by the model property name.
|
|
2564
|
+
* @param property Model property name.
|
|
2565
|
+
*/
|
|
2566
|
+
addField(property) {
|
|
2567
|
+
const field = new FieldInputDescriptor(this, property);
|
|
2568
|
+
this.addFieldDescriptor(field);
|
|
2569
|
+
return field;
|
|
2570
|
+
}
|
|
2571
|
+
/**
|
|
2572
|
+
* Adds field by the model property name (UNSAFE). Property is not checked on editor model.
|
|
2573
|
+
* Use {addField} for safe usage.
|
|
2574
|
+
* @param property Model property name.
|
|
2575
|
+
*/
|
|
2576
|
+
addFieldUnsafe(property) {
|
|
2577
|
+
const field = new FieldInputDescriptor(this, property);
|
|
2578
|
+
this.addFieldDescriptor(field);
|
|
2579
|
+
return field;
|
|
2580
|
+
}
|
|
2581
|
+
addFields(...properties) {
|
|
2582
|
+
properties.forEach(p => this.addField(p));
|
|
2583
|
+
return this;
|
|
2584
|
+
}
|
|
2585
|
+
addFieldAction(actionName) {
|
|
2586
|
+
const field = new FieldActionDescriptor(this, actionName);
|
|
2587
|
+
this.addFieldDescriptor(field);
|
|
2588
|
+
return field;
|
|
2589
|
+
}
|
|
2590
|
+
/**
|
|
2591
|
+
* Adds lookup field.
|
|
2592
|
+
*
|
|
2593
|
+
* @param {Property} property - The property key of the editor.
|
|
2594
|
+
* @param {TypeDescriptor<FieldModel>} type - The type descriptor for the lookup model.
|
|
2595
|
+
* @typeparam Property - The property key of the EditorModel.
|
|
2596
|
+
* @typeparam LookupModel - The field model type, defaults to the non-nullable type of the editor's property.
|
|
2597
|
+
* @typeparam FieldValue - The value type of field on editor.
|
|
2598
|
+
*
|
|
2599
|
+
* @returns {FieldLookupDescriptor<LookupModel, EditorModel, undefined, FieldValue>} - The field lookup descriptor.
|
|
2600
|
+
*/
|
|
2601
|
+
addFieldLookup(property, type) {
|
|
2602
|
+
return this.addFieldLookupUnsafe(property, type);
|
|
2603
|
+
}
|
|
2604
|
+
/**
|
|
2605
|
+
* [UNSAFE] Adds lookup field.
|
|
2606
|
+
* This method is UNSAFE because property is not type-checked.
|
|
2607
|
+
*
|
|
2608
|
+
* @param {string} property Model property name.
|
|
2609
|
+
* @param {TypeDescriptor<FieldModel>} type - The type descriptor for the lookup model (defines 2nd generic).
|
|
2610
|
+
* @typeparam LookupModel - The field model type, defaults to the non-nullable type of the editor's property.
|
|
2611
|
+
* @typeparam FieldValue - The value type of field on editor.
|
|
2612
|
+
*
|
|
2613
|
+
* @returns {FieldLookupDescriptor<LookupModel, EditorModel, undefined, FieldValue>} - The field lookup descriptor.
|
|
2614
|
+
*/
|
|
2615
|
+
addFieldLookupUnsafe(property, type) {
|
|
2616
|
+
const field = new FieldLookupDescriptor(this, property, {
|
|
2617
|
+
type: type?.classType
|
|
2618
|
+
});
|
|
2619
|
+
this.addFieldDescriptor(field);
|
|
2620
|
+
return field;
|
|
2621
|
+
}
|
|
2622
|
+
/**
|
|
2623
|
+
* Adds a field lookup with options value property for lookup model.
|
|
2624
|
+
*
|
|
2625
|
+
* @param {Property} property - The property key of the editor.
|
|
2626
|
+
* @param {TypeDescriptor<FieldModel>} type - The type descriptor for the lookup model.
|
|
2627
|
+
* @param {LookupValueProperty} lookupOptionsValueProperty - The value property used as value in the lookup options.
|
|
2628
|
+
* @typeparam Property - The property key of the EditorModel.
|
|
2629
|
+
* @typeparam LookupModel - The field model type, defaults to the non-nullable type of the editor's property.
|
|
2630
|
+
* @typeparam LookupValueProperty - The property of lookup model type.
|
|
2631
|
+
* @typeparam FieldValue - The value type of field on editor.
|
|
2632
|
+
*
|
|
2633
|
+
* @returns {FieldLookupDescriptor<LookupModel, EditorModel, undefined, FieldValue>} - The field lookup descriptor.
|
|
2634
|
+
*/
|
|
2635
|
+
addFieldLookupWithOptionsValueProperty(property, type, lookupOptionsValueProperty) {
|
|
2636
|
+
return this.addFieldLookupWithOptionsValuePropertyUnsafe(property, type, lookupOptionsValueProperty);
|
|
2637
|
+
}
|
|
2638
|
+
/**
|
|
2639
|
+
* [UNSAFE] Adds a field lookup with options value property for lookup model.
|
|
2640
|
+
* This method is UNSAFE because property is not type-checked.
|
|
2641
|
+
*
|
|
2642
|
+
* @param {Property} property - The property key of the editor.
|
|
2643
|
+
* @param {TypeDescriptor<FieldModel>} type - The type descriptor for the lookup model.
|
|
2644
|
+
* @param {LookupValueProperty} lookupOptionsValueProperty - The value property used as value in the lookup options.
|
|
2645
|
+
* @typeparam Property - The property key of the EditorModel.
|
|
2646
|
+
* @typeparam LookupModel - The field model type, defaults to the non-nullable type of the editor's property.
|
|
2647
|
+
* @typeparam LookupValueProperty - The property of lookup model type.
|
|
2648
|
+
* @typeparam FieldValue - The value type of field on editor.
|
|
2649
|
+
*
|
|
2650
|
+
* @returns {FieldLookupDescriptor<LookupModel, EditorModel, undefined, FieldValue>} - The field lookup descriptor.
|
|
2651
|
+
*/
|
|
2652
|
+
addFieldLookupWithOptionsValuePropertyUnsafe(property, type, lookupOptionsValueProperty) {
|
|
2653
|
+
const field = new FieldLookupDescriptor(this, property, {
|
|
2654
|
+
type: type?.classType,
|
|
2655
|
+
optionsValueProperty: lookupOptionsValueProperty
|
|
2656
|
+
});
|
|
2657
|
+
this.addFieldDescriptor(field);
|
|
2658
|
+
return field;
|
|
2659
|
+
}
|
|
2660
|
+
/**
|
|
2661
|
+
* Adds a field lookup with a data provider or service to the editor model.
|
|
2662
|
+
*
|
|
2663
|
+
* @param {Property} property - The property key of the editor.
|
|
2664
|
+
* @param {FieldLookupProviderType<LookupModel, Service>} provider - The field lookup data provider or service.
|
|
2665
|
+
* @param {TypeDescriptor<LookupModel>} [type] - The type of lookup - if data provider is passed as previous parameter, type can be omitted. If service is provider, type parameter is proposed in favour of correct typing.
|
|
2666
|
+
* @typeparam Property - The property key of the EditorModel.
|
|
2667
|
+
* @typeparam Service - The lookup service type.
|
|
2668
|
+
* @typeparam LookupModel - The field model type, defaults to the non-nullable type of the editor's property.
|
|
2669
|
+
* @typeparam FieldValue - The field value type, defaults to the editor's property type.
|
|
2670
|
+
*
|
|
2671
|
+
* @returns {FieldLookupDescriptor<LookupModel, EditorModel, Service, FieldValue>} Created field lookup descriptor.
|
|
2672
|
+
*/
|
|
2673
|
+
addFieldLookupWithProvider(property, provider, type) {
|
|
2674
|
+
return this.addFieldLookupWithProviderUnsafe(property, provider, type);
|
|
2675
|
+
}
|
|
2676
|
+
/**
|
|
2677
|
+
* [UNSAFE] Adds a field lookup with a data provider or service to the editor model.
|
|
2678
|
+
* This method is UNSAFE because property is not type-checked.
|
|
2679
|
+
*
|
|
2680
|
+
* @param {string} property - The property key of the editor.
|
|
2681
|
+
* @param {FieldLookupProviderType<LookupModel, Service>} provider - The lookup provider or service for the field lookup.
|
|
2682
|
+
* @param {TypeDescriptor<LookupModel>?} type - Optional type descriptor for the field lookup.
|
|
2683
|
+
* @typeparam LookupModel - The field lookup model type.
|
|
2684
|
+
* @typeparam Service - The lookup service type.
|
|
2685
|
+
* @typeparam FieldValue - The value type of field on editor.
|
|
2686
|
+
*
|
|
2687
|
+
* @returns {FieldLookupDescriptor<LookupModel, EditorModel, Service, FieldValue>} - The field lookup descriptor added to the instance.
|
|
2688
|
+
*/
|
|
2689
|
+
addFieldLookupWithProviderUnsafe(property, provider, type) {
|
|
2690
|
+
const cfg = fieldLookupGetProviderCfgObj(provider);
|
|
2691
|
+
const field = new FieldLookupDescriptor(this, property, {
|
|
2692
|
+
type: type?.classType,
|
|
2693
|
+
...cfg
|
|
2694
|
+
});
|
|
2695
|
+
this.addFieldDescriptor(field);
|
|
2696
|
+
return field;
|
|
2697
|
+
}
|
|
2698
|
+
/**
|
|
2699
|
+
* Adds a field lookup with data provider or service and options value property for lookup model.
|
|
2700
|
+
*
|
|
2701
|
+
* @param {Property} property - The property key of the editor.
|
|
2702
|
+
* @param {FieldLookupProviderType<FieldModel, Service>} provider - The lookup provider.
|
|
2703
|
+
* @param {TypeDescriptor<FieldModel>} type - The type descriptor for the lookup model.
|
|
2704
|
+
* @param {LookupValueProperty} lookupOptionsValueProperty - The value property used as value in the lookup options.
|
|
2705
|
+
* @typeparam Property - The property key of the EditorModel.
|
|
2706
|
+
* @typeparam Service - The lookup service type.
|
|
2707
|
+
* @typeparam LookupModel - The field model type, defaults to the non-nullable type of the editor's property.
|
|
2708
|
+
* @typeparam LookupValueProperty - The property of lookup model type.
|
|
2709
|
+
* @typeparam FieldValue - The value type of field on editor.
|
|
2710
|
+
*
|
|
2711
|
+
* @returns {FieldLookupDescriptor<LookupModel, EditorModel, Service, FieldValue>} - The field lookup descriptor.
|
|
2712
|
+
*/
|
|
2713
|
+
addFieldLookupWithProviderAndOptionsValueProperty(property, provider, type, lookupOptionsValueProperty) {
|
|
2714
|
+
return this.addFieldLookupWithProviderAndOptionsValuePropertyUnsafe(property, provider, type, lookupOptionsValueProperty);
|
|
2715
|
+
}
|
|
2716
|
+
/**
|
|
2717
|
+
* [UNSAFE] Adds a field lookup with data provider or service and options value property for lookup model.
|
|
2718
|
+
* This method is UNSAFE because property is not type-checked.
|
|
2719
|
+
*
|
|
2720
|
+
* @param {string} property - The property key of the editor.
|
|
2721
|
+
* @param {FieldLookupProviderType<FieldModel, Service>} provider - The lookup provider.
|
|
2722
|
+
* @param {TypeDescriptor<FieldModel>} type - The type descriptor for the lookup model.
|
|
2723
|
+
* @param {string} lookupOptionsValueProperty - The value property used in the lookup options.
|
|
2724
|
+
* @typeparam Service - The service type.
|
|
2725
|
+
* @typeparam LookupModel - The field model type, defaults to the non-nullable type of the editor's property.
|
|
2726
|
+
* @typeparam FieldValue - The value type of field on editor.
|
|
2727
|
+
*
|
|
2728
|
+
* @returns {FieldLookupDescriptor<LookupModel, EditorModel, Service, FieldValue>} - The field lookup descriptor.
|
|
2729
|
+
*/
|
|
2730
|
+
addFieldLookupWithProviderAndOptionsValuePropertyUnsafe(property, provider, type, lookupOptionsValueProperty) {
|
|
2731
|
+
const cfg = fieldLookupGetProviderCfgObj(provider);
|
|
2732
|
+
const field = new FieldLookupDescriptor(this, property, {
|
|
2733
|
+
type: type?.classType,
|
|
2734
|
+
optionsValueProperty: lookupOptionsValueProperty,
|
|
2735
|
+
...cfg
|
|
2736
|
+
});
|
|
2737
|
+
this.addFieldDescriptor(field);
|
|
2738
|
+
return field;
|
|
2739
|
+
}
|
|
2740
|
+
addFieldLookupEnum(property, enumDesc, options) {
|
|
2741
|
+
return this.addFieldLookupEnumUnsafe(property, enumDesc, options);
|
|
2742
|
+
}
|
|
2743
|
+
/**
|
|
2744
|
+
* Adds enum lookup field.
|
|
2745
|
+
* @param property Model's property name.
|
|
2746
|
+
* @param enumDesc Type of enum or enum descriptor.
|
|
2747
|
+
* @param options Provides subset of enum's available constants.
|
|
2748
|
+
*/
|
|
2749
|
+
addFieldLookupEnumUnsafe(property, enumDesc, options) {
|
|
2750
|
+
const field = new FieldLookupEnumDescriptor(this, property, enumDesc, options);
|
|
2751
|
+
this.addFieldDescriptor(field);
|
|
2752
|
+
return field;
|
|
2753
|
+
}
|
|
2754
|
+
/**
|
|
2755
|
+
* Adds table/details/add/edit field for one-to-many (1:n) relations.
|
|
2756
|
+
* @param property Model's property name.
|
|
2757
|
+
* @param tableviewDescriptor Tableview descriptor for related model.
|
|
2758
|
+
*/
|
|
2759
|
+
addFieldManyEditor(property, tableviewDescriptor) {
|
|
2760
|
+
return this.addFieldManyEditorUnsafe(property, tableviewDescriptor);
|
|
2761
|
+
}
|
|
2762
|
+
/**
|
|
2763
|
+
* Adds table/details/add/edit field for one-to-many (1:n) relations (UNSAFE).
|
|
2764
|
+
* @param property Model's property name.
|
|
2765
|
+
* @param tableviewDescriptor Tableview descriptor for related model.
|
|
2766
|
+
*/
|
|
2767
|
+
addFieldManyEditorUnsafe(property, tableviewDescriptor) {
|
|
2768
|
+
const field = new FieldManyEditorDescriptor(this, property, tableviewDescriptor);
|
|
2769
|
+
this.addFieldDescriptor(field);
|
|
2770
|
+
return field;
|
|
2771
|
+
}
|
|
2772
|
+
/**
|
|
2773
|
+
* Adds tables for many-to-many (m:n) relations.
|
|
2774
|
+
* @param property Model's property name.
|
|
2775
|
+
* @param mainTableDescriptor Main table descriptor for displaying items added to main model's property.
|
|
2776
|
+
* @param lookupTableDescriptor Lookup table descriptor for displaying items to be added to main model's property.
|
|
2777
|
+
*/
|
|
2778
|
+
addFieldManyToManyEditor(property, mainTableDescriptor, lookupTableDescriptor) {
|
|
2779
|
+
return this.addFieldManyToManyEditorUnsafe(property, mainTableDescriptor, lookupTableDescriptor);
|
|
2780
|
+
}
|
|
2781
|
+
/**
|
|
2782
|
+
* Adds tables for many-to-many (m:n) relations (UNSAFE).
|
|
2783
|
+
* @param property Model's property name.
|
|
2784
|
+
* @param mainTableDescriptor Main table descriptor for displaying items added to main model's property.
|
|
2785
|
+
* @param lookupTableDescriptor Lookup table descriptor for displaying items to be added to main model's property.
|
|
2786
|
+
*/
|
|
2787
|
+
addFieldManyToManyEditorUnsafe(property, mainTableDescriptor, lookupTableDescriptor) {
|
|
2788
|
+
const field = new FieldManyToManyEditorDescriptor(this, property, mainTableDescriptor, lookupTableDescriptor);
|
|
2789
|
+
this.addFieldDescriptor(field);
|
|
2790
|
+
return field;
|
|
2791
|
+
}
|
|
2792
|
+
addFieldManyToManyEditorWithProvider(property, mainTableDescriptor, lookupTableDescriptor, lookupDataProvider) {
|
|
2793
|
+
return this.addFieldManyToManyEditorWithProviderUnsafe(property, mainTableDescriptor, lookupTableDescriptor, lookupDataProvider);
|
|
2794
|
+
}
|
|
2795
|
+
addFieldManyToManyEditorWithProviderUnsafe(property, mainTableDescriptor, lookupTableDescriptor, lookupDataProvider) {
|
|
2796
|
+
const cfg = fieldManyToManyGetProviderCfgObj(lookupDataProvider);
|
|
2797
|
+
const field = new FieldManyToManyEditorDescriptor(this, property, mainTableDescriptor, lookupTableDescriptor, {
|
|
2798
|
+
...cfg
|
|
2799
|
+
});
|
|
2800
|
+
this.addFieldDescriptor(field);
|
|
2801
|
+
return field;
|
|
2802
|
+
}
|
|
2803
|
+
/**
|
|
2804
|
+
* Disables field on editor.
|
|
2805
|
+
* @param disabled
|
|
2806
|
+
*/
|
|
2807
|
+
withDisabled(disabled = true) {
|
|
2808
|
+
this._disabled = disabled;
|
|
2809
|
+
return this;
|
|
2810
|
+
}
|
|
2811
|
+
/**
|
|
2812
|
+
* Adds group validator to editor.
|
|
2813
|
+
* @param name Name of the validation.
|
|
2814
|
+
* @param validator Field validator function.
|
|
2815
|
+
* @param message Field validation message.
|
|
2816
|
+
*/
|
|
2817
|
+
addValidation(name, validator, message) {
|
|
2818
|
+
if (this._currentGroup) {
|
|
2819
|
+
this._currentGroup.withValidation(name, validator, message);
|
|
2820
|
+
}
|
|
2821
|
+
}
|
|
2822
|
+
/**
|
|
2823
|
+
* Creates a copy of editor descriptor object.
|
|
2824
|
+
*/
|
|
2825
|
+
copy() {
|
|
2826
|
+
const editor = new EditorDescriptorInst(this.model.copy(), this.tableviewEditorType);
|
|
2827
|
+
for (const tabGroup of this._tabs) {
|
|
2828
|
+
editor.createTabGroupDescriptor(tabGroup.copy());
|
|
2829
|
+
}
|
|
2830
|
+
for (const tabGroup of editor._tabs) {
|
|
2831
|
+
for (const fieldGroup of tabGroup.fields) {
|
|
2832
|
+
editor._fields.push(...fieldGroup.fields);
|
|
2833
|
+
}
|
|
2834
|
+
editor._groups.push(...tabGroup.fields);
|
|
2835
|
+
}
|
|
2836
|
+
editor._currentTabGroup = editor._tabs[editor._tabs.length - 1];
|
|
2837
|
+
editor._currentGroup = editor._currentTabGroup.fields[editor._currentTabGroup.fields.length - 1];
|
|
2838
|
+
editor._disabled = this._disabled;
|
|
2839
|
+
return editor;
|
|
2840
|
+
}
|
|
2841
|
+
/**
|
|
2842
|
+
* Created group from field group descriptor.
|
|
2843
|
+
* @param fieldGroup Field group descriptor.
|
|
2844
|
+
* @internal
|
|
2845
|
+
*/
|
|
2846
|
+
createFieldGroupDescriptor(fieldGroup) {
|
|
2847
|
+
this.createDefaultTabGroup();
|
|
2848
|
+
this._currentGroup = fieldGroup;
|
|
2849
|
+
this._groups.push(fieldGroup);
|
|
2850
|
+
this._currentTabGroup?.addField(fieldGroup);
|
|
2851
|
+
return this;
|
|
2852
|
+
}
|
|
2853
|
+
/**
|
|
2854
|
+
* Creates tab group from tab group descriptor.
|
|
2855
|
+
* @param tabGroup Tab group descriptor.
|
|
2856
|
+
* @internal
|
|
2857
|
+
*/
|
|
2858
|
+
createTabGroupDescriptor(tabGroup) {
|
|
2859
|
+
this._currentTabGroup = tabGroup;
|
|
2860
|
+
this._tabs.push(tabGroup);
|
|
2861
|
+
return this;
|
|
2862
|
+
}
|
|
2863
|
+
/**
|
|
2864
|
+
* Creates default field group.
|
|
2865
|
+
* @internal
|
|
2866
|
+
*/
|
|
2867
|
+
createDefaultGroup() {
|
|
2868
|
+
this.createDefaultTabGroup();
|
|
2869
|
+
if (this._currentTabGroup?.fields.length === 0) {
|
|
2870
|
+
this.createFieldGroup(EditorDescriptorInst.defaultGroupName, null);
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
/**
|
|
2874
|
+
* Creates default tab group.
|
|
2875
|
+
* @internal
|
|
2876
|
+
*/
|
|
2877
|
+
createDefaultTabGroup() {
|
|
2878
|
+
if (this._tabs.length === 0) {
|
|
2879
|
+
this.createTabGroup(EditorDescriptorInst.defaultGroupName, 'general.general');
|
|
2880
|
+
}
|
|
2881
|
+
}
|
|
2882
|
+
/**
|
|
2883
|
+
* Modifies selected field by field property. For enums use {withFieldModifiedEnum} instead.
|
|
2884
|
+
* @param property Model's property name.
|
|
2885
|
+
* @param fieldType new field type for selected field
|
|
2886
|
+
* @param args additional parameters for field
|
|
2887
|
+
*/
|
|
2888
|
+
withFieldModifiedType(property, fieldType, ...args) {
|
|
2889
|
+
return this.withFieldModifiedTypeUnsafe(property, fieldType, ...args);
|
|
2890
|
+
}
|
|
2891
|
+
withFieldModifiedTypeUnsafe(property, fieldType, ...args) {
|
|
2892
|
+
if (!this.model.type) {
|
|
2893
|
+
throw new CommonsInternalError(`withFieldModifiedType cannot be executed for property ${property}: Model type is not defined.`);
|
|
2894
|
+
}
|
|
2895
|
+
const attribute = getEditorClassAttributeDef(this.model.type).find(attribute => attribute.name === property);
|
|
2896
|
+
if (attribute) {
|
|
2897
|
+
attribute.fieldType = fieldType;
|
|
2898
|
+
EditorDescriptorInst.upsertFieldFromAttributeDef(this, attribute, this.fields.find(fi => fi.property === property), ...args);
|
|
2899
|
+
}
|
|
2900
|
+
return this;
|
|
2901
|
+
}
|
|
2902
|
+
/**
|
|
2903
|
+
* Modifies selected field with enum type.
|
|
2904
|
+
* @param property Model's property name.
|
|
2905
|
+
* @param enumModel Enum descriptor.
|
|
2906
|
+
* @param values
|
|
2907
|
+
*/
|
|
2908
|
+
withFieldModifiedEnum(property, enumModel, values) {
|
|
2909
|
+
return this.withFieldModifiedEnumUnsafe(property, enumModel, values);
|
|
2910
|
+
}
|
|
2911
|
+
withFieldModifiedEnumUnsafe(property, enumDesc, values) {
|
|
2912
|
+
if (!this.model.type) {
|
|
2913
|
+
throw new CommonsInternalError(`withFieldModifiedEnum cannot be executed for property ${property}: Model type is not defined.`);
|
|
2914
|
+
}
|
|
2915
|
+
const attribute = getEditorClassAttributeDef(this.model.type).find(a => a.name === property);
|
|
2916
|
+
if (attribute) {
|
|
2917
|
+
attribute.fieldType = FieldInputTypeEnum.Radio;
|
|
2918
|
+
const field = this.fields.find(f => f.property === property);
|
|
2919
|
+
if (field && field instanceof FieldInputDescriptor) {
|
|
2920
|
+
field.asRadioFromEnum(enumDesc ?? enumModelGeneric(TypeRegistry.get().findEnum(attribute.type)), values);
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
return this;
|
|
2924
|
+
}
|
|
2925
|
+
/**
|
|
2926
|
+
* Modifies selected field with lookup field.
|
|
2927
|
+
* @param property Model's property name.
|
|
2928
|
+
* @param lookupProvider provider to be added to field
|
|
2929
|
+
* @param titleProperty
|
|
2930
|
+
*/
|
|
2931
|
+
withFieldModifiedLookupWithProvider(property, lookupProvider, titleProperty) {
|
|
2932
|
+
return this.withFieldModifiedLookupWithProviderUnsafe(property, lookupProvider, titleProperty);
|
|
2933
|
+
}
|
|
2934
|
+
withFieldModifiedLookupWithProviderUnsafe(property, lookupProvider, titleProperty) {
|
|
2935
|
+
this.removeFieldUnsafe(property);
|
|
2936
|
+
const field = this.addFieldLookupWithProviderUnsafe(property, lookupProvider).asAutocomplete();
|
|
2937
|
+
if (titleProperty) {
|
|
2938
|
+
field.withOptionsLabelProperty(titleProperty);
|
|
2939
|
+
}
|
|
2940
|
+
return this;
|
|
2941
|
+
}
|
|
2942
|
+
/**
|
|
2943
|
+
* This method takes care of displaying correct/localized data in the editor
|
|
2944
|
+
* @param property property that tells us where on the model are localizations accessible
|
|
2945
|
+
* @param model Model for localizations
|
|
2946
|
+
* @param localeProperty property by which we find the locale
|
|
2947
|
+
*/
|
|
2948
|
+
localized(property, model, localeProperty) {
|
|
2949
|
+
return this.localizedUnsafe(property, model, localeProperty);
|
|
2950
|
+
}
|
|
2951
|
+
localizedUnsafe(property, model, localeProperty) {
|
|
2952
|
+
this._localizationLocalizationProperty = property;
|
|
2953
|
+
this._localizationModel = model;
|
|
2954
|
+
this._localizationLocaleProperty = localeProperty;
|
|
2955
|
+
this._isLocalized = true;
|
|
2956
|
+
return this;
|
|
2957
|
+
}
|
|
2958
|
+
nextEvent(type, cmpType, cmpInstance, data) {
|
|
2959
|
+
this._eventsSubject.next({
|
|
2960
|
+
type: type,
|
|
2961
|
+
componentType: cmpType,
|
|
2962
|
+
componentInstance: cmpInstance,
|
|
2963
|
+
data: data
|
|
2964
|
+
});
|
|
2965
|
+
}
|
|
2966
|
+
completeEvents() {
|
|
2967
|
+
this._eventsSubject.complete();
|
|
2968
|
+
}
|
|
2969
|
+
get events$() {
|
|
2970
|
+
return this._eventsSubject.asObservable();
|
|
2971
|
+
}
|
|
2972
|
+
/**
|
|
2973
|
+
* Generates field based on attribute definition, used for auto model
|
|
2974
|
+
* @param descriptor Editor descriptor instance.
|
|
2975
|
+
* @param attribute Attribute definition.
|
|
2976
|
+
* @param field Optional, if defined will be replaced, otherwise new will be generated.
|
|
2977
|
+
* @param args Optional additional arguments mapped to filed type. Arguments depend on possible arguments on fields.
|
|
2978
|
+
* @internal
|
|
2979
|
+
*/
|
|
2980
|
+
static upsertFieldFromAttributeDef(descriptor, attribute, field, ...args) {
|
|
2981
|
+
if (field == null) {
|
|
2982
|
+
field = descriptor.addFieldUnsafe(attribute.name);
|
|
2983
|
+
}
|
|
2984
|
+
if (field instanceof FieldInputDescriptor) {
|
|
2985
|
+
if (attribute.enumType) {
|
|
2986
|
+
return field.asRadioFromEnum(enumModelGeneric(attribute.enumType));
|
|
2987
|
+
}
|
|
2988
|
+
else {
|
|
2989
|
+
const tableColumnType = getColumnTypeFromClassAttributeDefType(attribute.type);
|
|
2990
|
+
const tableColumnDisplayType = getColumnDisplayTypeFromColumnType(tableColumnType, attribute.type);
|
|
2991
|
+
return field.asType(attribute.fieldType ?? getFieldInputTypeFromColumnType(tableColumnType, tableColumnDisplayType), ...args);
|
|
2992
|
+
}
|
|
2993
|
+
}
|
|
2994
|
+
return field;
|
|
2995
|
+
}
|
|
2996
|
+
}
|
|
2997
|
+
class EditorDescriptor extends EditorDescriptorInst {
|
|
2998
|
+
constructor() {
|
|
2999
|
+
super(ModelDescriptor.create());
|
|
3000
|
+
}
|
|
3001
|
+
static create(idProperty, titleProperty, i18nBaseKey, tableviewEditorType = TableviewEditorTypeEnum.None) {
|
|
3002
|
+
return new EditorDescriptorInst(ModelDescriptor.create(idProperty, titleProperty, i18nBaseKey), tableviewEditorType);
|
|
3003
|
+
}
|
|
3004
|
+
static fromClass(type, idProperty, titleProperty, i18nBaseKey, tableviewEditorType = TableviewEditorTypeEnum.None) {
|
|
3005
|
+
return new EditorDescriptorInst(ModelDescriptor.fromClass(type, idProperty, titleProperty, i18nBaseKey), tableviewEditorType);
|
|
3006
|
+
}
|
|
3007
|
+
static fromModel(model, tableviewEditorType = TableviewEditorTypeEnum.None) {
|
|
3008
|
+
return new EditorDescriptorInst(model, tableviewEditorType);
|
|
3009
|
+
}
|
|
3010
|
+
/**
|
|
3011
|
+
* Creates editor descriptor automatically based on openapi model's attributes definition which is automatically extracted. All fields will be included.
|
|
3012
|
+
* @param type Model's class.
|
|
3013
|
+
* @param idProperty Id property representing model (optional).
|
|
3014
|
+
* @param titleProperty Title property representing model (optional). If not provided, it will be automatically chosen.
|
|
3015
|
+
* @param tableEditorType Type of editor in tableview (add, edit, view or none).
|
|
3016
|
+
*/
|
|
3017
|
+
static fromClassWithAutoAttrsDef(type, idProperty, titleProperty, tableEditorType = TableviewEditorTypeEnum.None) {
|
|
3018
|
+
return EditorDescriptor.fromClassWithCustomAttrsDef(type, getEditorClassAttributeDef(type), idProperty, titleProperty, tableEditorType);
|
|
3019
|
+
}
|
|
3020
|
+
/**
|
|
3021
|
+
* Creates editor descriptor automatically based on openapi model's attributes definition provided in parameters. Only fields for provided attributes will be included.
|
|
3022
|
+
* @param type Model's class.
|
|
3023
|
+
* @param attributes List of attribute definitions from which fields should be created.
|
|
3024
|
+
* @param idProperty Id property representing model (optional).
|
|
3025
|
+
* @param titleProperty Title property representing model (optional). If not provided, it will be automatically chosen.
|
|
3026
|
+
* @param tableEditorType Type of editor in tableview (add, edit, view or none).
|
|
3027
|
+
*/
|
|
3028
|
+
static fromClassWithCustomAttrsDef(type, attributes, idProperty, titleProperty, tableEditorType = TableviewEditorTypeEnum.None) {
|
|
3029
|
+
const descriptor = EditorDescriptor.fromClass(type, idProperty, titleProperty, undefined, tableEditorType);
|
|
3030
|
+
attributes
|
|
3031
|
+
.filter(attr => !attr.type.includes('Set') && !attr.type.includes('Array'))
|
|
3032
|
+
.forEach(attr => EditorDescriptorInst.upsertFieldFromAttributeDef(descriptor, attr, descriptor.fields.find(col => col.property === attr.name)));
|
|
3033
|
+
return descriptor;
|
|
3034
|
+
}
|
|
3035
|
+
}
|
|
3036
|
+
|
|
3037
|
+
var FormFieldEventTypeEnum;
|
|
3038
|
+
(function (FormFieldEventTypeEnum) {
|
|
3039
|
+
FormFieldEventTypeEnum["ComponentLifecycle"] = "ComponentLifecycle";
|
|
3040
|
+
FormFieldEventTypeEnum["ValueChange"] = "ValueChange";
|
|
3041
|
+
FormFieldEventTypeEnum["DataProvider"] = "DataProvider";
|
|
3042
|
+
FormFieldEventTypeEnum["DialogLifecycle"] = "DialogLifecycle";
|
|
3043
|
+
FormFieldEventTypeEnum["Other"] = "Other";
|
|
3044
|
+
})(FormFieldEventTypeEnum || (FormFieldEventTypeEnum = {}));
|
|
3045
|
+
var FormEventTypeEnum;
|
|
3046
|
+
(function (FormEventTypeEnum) {
|
|
3047
|
+
FormEventTypeEnum["ComponentLifecycle"] = "ComponentLifecycle";
|
|
3048
|
+
FormEventTypeEnum["ValueChange"] = "ValueChange";
|
|
3049
|
+
FormEventTypeEnum["Submit"] = "Submit";
|
|
3050
|
+
FormEventTypeEnum["Other"] = "Other";
|
|
3051
|
+
})(FormEventTypeEnum || (FormEventTypeEnum = {}));
|
|
3052
|
+
class FormFieldEventComponentSubtype {
|
|
3053
|
+
static { this.ON_INIT = 'Component.OnInit'; }
|
|
3054
|
+
static { this.ON_VIEW_INIT = 'Component.OnViewInit'; }
|
|
3055
|
+
static { this.ON_CONTENT_INIT = 'Component.OnContentInit'; }
|
|
3056
|
+
static { this.ON_DESTROY = 'Component.OnDestroy'; }
|
|
3057
|
+
}
|
|
3058
|
+
class FormFieldEventDialogSubtype {
|
|
3059
|
+
static { this.VISIBILITY = 'Dialog.Visibility'; }
|
|
3060
|
+
static { this.TABLE_CAPTION_COMPONENT_INSTANCE = 'Dialog.MngTable.CaptionComponentInstance'; }
|
|
3061
|
+
static { this.TABLE_COLUMN_ACTIONS_COMPONENT_INSTANCE = 'Dialog.MngTable.ColumnActionsComponentInstance'; }
|
|
3062
|
+
}
|
|
3063
|
+
|
|
3064
|
+
class AFormlyCustomFieldComponent extends FieldType {
|
|
3065
|
+
get model() {
|
|
3066
|
+
return this._model;
|
|
3067
|
+
}
|
|
3068
|
+
get form() {
|
|
3069
|
+
return this._form;
|
|
3070
|
+
}
|
|
3071
|
+
get options() {
|
|
3072
|
+
return this._options;
|
|
3073
|
+
}
|
|
3074
|
+
get key() {
|
|
3075
|
+
return this._key;
|
|
3076
|
+
}
|
|
3077
|
+
get formControl() {
|
|
3078
|
+
return this._formControl;
|
|
3079
|
+
}
|
|
3080
|
+
get props() {
|
|
3081
|
+
return this._props;
|
|
3082
|
+
}
|
|
3083
|
+
get showError() {
|
|
3084
|
+
return this._showError;
|
|
3085
|
+
}
|
|
3086
|
+
get id() {
|
|
3087
|
+
return this._id;
|
|
3088
|
+
}
|
|
3089
|
+
get formState() {
|
|
3090
|
+
return this._formState;
|
|
3091
|
+
}
|
|
3092
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AFormlyCustomFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3093
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.2", type: AFormlyCustomFieldComponent, inputs: { field: "field", _model: ["model", "_model"], _form: ["form", "_form"], _options: ["options", "_options"], _key: ["key", "_key"], _formControl: ["formControl", "_formControl"], _props: ["props", "_props"], _showError: ["showError", "_showError"], _id: ["id", "_id"], _formState: ["formState", "_formState"] }, usesInheritance: true, ngImport: i0 }); }
|
|
3094
|
+
}
|
|
3095
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AFormlyCustomFieldComponent, decorators: [{
|
|
3096
|
+
type: Directive
|
|
3097
|
+
}], propDecorators: { field: [{
|
|
3098
|
+
type: Input,
|
|
3099
|
+
args: ['field']
|
|
3100
|
+
}], _model: [{
|
|
3101
|
+
type: Input,
|
|
3102
|
+
args: ['model']
|
|
3103
|
+
}], _form: [{
|
|
3104
|
+
type: Input,
|
|
3105
|
+
args: ['form']
|
|
3106
|
+
}], _options: [{
|
|
3107
|
+
type: Input,
|
|
3108
|
+
args: ['options']
|
|
3109
|
+
}], _key: [{
|
|
3110
|
+
type: Input,
|
|
3111
|
+
args: ['key']
|
|
3112
|
+
}], _formControl: [{
|
|
3113
|
+
type: Input,
|
|
3114
|
+
args: ['formControl']
|
|
3115
|
+
}], _props: [{
|
|
3116
|
+
type: Input,
|
|
3117
|
+
args: ['props']
|
|
3118
|
+
}], _showError: [{
|
|
3119
|
+
type: Input,
|
|
3120
|
+
args: ['showError']
|
|
3121
|
+
}], _id: [{
|
|
3122
|
+
type: Input,
|
|
3123
|
+
args: ['id']
|
|
3124
|
+
}], _formState: [{
|
|
3125
|
+
type: Input,
|
|
3126
|
+
args: ['formState']
|
|
3127
|
+
}] } });
|
|
3128
|
+
|
|
3129
|
+
class TableviewDataProviderInst extends DataProviderInst {
|
|
3130
|
+
constructor(type, serviceType) {
|
|
3131
|
+
super(type, serviceType);
|
|
3132
|
+
this.editorDataProvider = EditorDataProvider.fromAnyParam(type, serviceType);
|
|
3133
|
+
this.tableDataProvider = TableDataProvider.fromAnyParam(type, serviceType);
|
|
3134
|
+
}
|
|
3135
|
+
get isLazy() {
|
|
3136
|
+
return this.tableDataProvider.isLazy;
|
|
3137
|
+
}
|
|
3138
|
+
get getAllReload$() {
|
|
3139
|
+
return this.tableDataProvider.getAllReload$;
|
|
3140
|
+
}
|
|
3141
|
+
get getAll() {
|
|
3142
|
+
return this.tableDataProvider.getAll;
|
|
3143
|
+
}
|
|
3144
|
+
get fetch() {
|
|
3145
|
+
return this.editorDataProvider.fetch;
|
|
3146
|
+
}
|
|
3147
|
+
get create() {
|
|
3148
|
+
return this.editorDataProvider.create;
|
|
3149
|
+
}
|
|
3150
|
+
get update() {
|
|
3151
|
+
return this.editorDataProvider.update;
|
|
3152
|
+
}
|
|
3153
|
+
get delete() {
|
|
3154
|
+
return this.editorDataProvider.delete;
|
|
3155
|
+
}
|
|
3156
|
+
getAllReload(queryParam) {
|
|
3157
|
+
this.tableDataProvider.getAllReload(queryParam);
|
|
3158
|
+
}
|
|
3159
|
+
withGetAll(fn) {
|
|
3160
|
+
this.tableDataProvider.withGetAll(fn);
|
|
3161
|
+
return this;
|
|
3162
|
+
}
|
|
3163
|
+
withGetAllEagerly(fn) {
|
|
3164
|
+
this.tableDataProvider.withGetAllEagerly(fn);
|
|
3165
|
+
return this;
|
|
3166
|
+
}
|
|
3167
|
+
withFetch(fn) {
|
|
3168
|
+
this.editorDataProvider.withFetch(fn);
|
|
3169
|
+
return this;
|
|
3170
|
+
}
|
|
3171
|
+
withCreate(fn) {
|
|
3172
|
+
this.editorDataProvider.withCreate(fn);
|
|
3173
|
+
return this;
|
|
3174
|
+
}
|
|
3175
|
+
withUpdate(fn) {
|
|
3176
|
+
this.editorDataProvider.withUpdate(fn);
|
|
3177
|
+
return this;
|
|
3178
|
+
}
|
|
3179
|
+
withDelete(fn) {
|
|
3180
|
+
this.editorDataProvider.withDelete(fn);
|
|
3181
|
+
return this;
|
|
3182
|
+
}
|
|
3183
|
+
}
|
|
3184
|
+
class TableviewDataProvider extends TableviewDataProviderInst {
|
|
3185
|
+
constructor() {
|
|
3186
|
+
super(undefined, undefined);
|
|
3187
|
+
}
|
|
3188
|
+
static create() {
|
|
3189
|
+
return new TableviewDataProviderInst(undefined, undefined);
|
|
3190
|
+
}
|
|
3191
|
+
static fromClass(type) {
|
|
3192
|
+
return new TableviewDataProviderInst(type, undefined);
|
|
3193
|
+
}
|
|
3194
|
+
static fromClassWithService(type, serviceType) {
|
|
3195
|
+
return new TableviewDataProviderInst(type, serviceType);
|
|
3196
|
+
}
|
|
3197
|
+
static fromService(serviceType) {
|
|
3198
|
+
return new TableviewDataProviderInst(undefined, serviceType);
|
|
3199
|
+
}
|
|
3200
|
+
static fromAnyParam(type, serviceType) {
|
|
3201
|
+
if (typeof type !== 'undefined') {
|
|
3202
|
+
return typeof serviceType !== 'undefined'
|
|
3203
|
+
? TableviewDataProvider.fromClassWithService(type, serviceType)
|
|
3204
|
+
: TableviewDataProvider.fromClass(type);
|
|
3205
|
+
}
|
|
3206
|
+
else if (typeof serviceType !== 'undefined') {
|
|
3207
|
+
return TableviewDataProvider.fromService(serviceType);
|
|
3208
|
+
}
|
|
3209
|
+
else {
|
|
3210
|
+
return TableviewDataProvider.create();
|
|
3211
|
+
}
|
|
3212
|
+
}
|
|
3213
|
+
}
|
|
3214
|
+
class DynamicTableviewDataProviderInst extends TableviewDataProviderInst {
|
|
3215
|
+
constructor(serviceType) {
|
|
3216
|
+
super(undefined, serviceType);
|
|
3217
|
+
}
|
|
3218
|
+
}
|
|
3219
|
+
class DynamicTableviewDataProvider extends DynamicTableviewDataProviderInst {
|
|
3220
|
+
constructor() {
|
|
3221
|
+
super(undefined);
|
|
3222
|
+
}
|
|
3223
|
+
static create() {
|
|
3224
|
+
return new DynamicTableviewDataProviderInst(undefined);
|
|
3225
|
+
}
|
|
3226
|
+
static fromService(serviceType) {
|
|
3227
|
+
return new DynamicTableviewDataProviderInst(serviceType);
|
|
3228
|
+
}
|
|
3229
|
+
}
|
|
3230
|
+
|
|
3231
|
+
function expandClassAttributeDefWithTableviewDef(attributes) {
|
|
3232
|
+
if (!attributes) {
|
|
3233
|
+
throw new CommonsInternalError('Class attribute definition is null, problem with TypeRegistry::findAttributesDefinitionByClassType?', { name: 'TableviewUtilsError' });
|
|
3234
|
+
}
|
|
3235
|
+
const typeRegistry = TypeRegistry.get();
|
|
3236
|
+
const tableClassAttributeDef = [];
|
|
3237
|
+
for (const attribute of attributes) {
|
|
3238
|
+
const enumType = typeRegistry.findEnum(attribute.type);
|
|
3239
|
+
const columnType = enumType ? ColumnTypeEnum.Enum : getColumnTypeFromClassAttributeDefType(attribute.type);
|
|
3240
|
+
tableClassAttributeDef.push({
|
|
3241
|
+
name: attribute.name,
|
|
3242
|
+
baseName: attribute.baseName,
|
|
3243
|
+
type: attribute.type,
|
|
3244
|
+
subtype: attribute.subtype,
|
|
3245
|
+
columnType: enumType ? ColumnTypeEnum.Enum : getColumnTypeFromClassAttributeDefType(attribute.type),
|
|
3246
|
+
columnDisplayType: getColumnDisplayTypeFromColumnType(columnType, attribute.type),
|
|
3247
|
+
fieldType: getFieldInputTypeFromClassAttributeDefType(attribute.type),
|
|
3248
|
+
enumType: typeRegistry.findEnum(attribute.type),
|
|
3249
|
+
classType: typeRegistry.findType(attribute.type)
|
|
3250
|
+
});
|
|
3251
|
+
}
|
|
3252
|
+
return tableClassAttributeDef;
|
|
3253
|
+
}
|
|
3254
|
+
/**
|
|
3255
|
+
* returns attributes from class type and extends to typed def with column and field enum type
|
|
3256
|
+
* @param type class type
|
|
3257
|
+
*/
|
|
3258
|
+
function getTableviewClassAttributeDef(type) {
|
|
3259
|
+
return expandClassAttributeDefWithTableviewDef(TypeRegistry.get().findAttributesDefinitionByClassType(type));
|
|
3260
|
+
}
|
|
3261
|
+
|
|
3262
|
+
class TableviewDescriptorInst {
|
|
3263
|
+
constructor(model) {
|
|
3264
|
+
this._isLocalized = false;
|
|
3265
|
+
this._model = model;
|
|
3266
|
+
this._table = TableDescriptor.fromModel(model);
|
|
3267
|
+
this._tableTitle = `${this._model.i18nBaseKey}.name`;
|
|
3268
|
+
this._detailsEditor = EditorDescriptor.fromModel(model, TableviewEditorTypeEnum.Details);
|
|
3269
|
+
this._detailsEditor.withDisabled();
|
|
3270
|
+
this._addEditor = EditorDescriptor.fromModel(model, TableviewEditorTypeEnum.Add);
|
|
3271
|
+
this._editEditor = EditorDescriptor.fromModel(model, TableviewEditorTypeEnum.Edit);
|
|
3272
|
+
}
|
|
3273
|
+
get table() {
|
|
3274
|
+
return this._table;
|
|
3275
|
+
}
|
|
3276
|
+
get detailsEditor() {
|
|
3277
|
+
return this._detailsEditor;
|
|
3278
|
+
}
|
|
3279
|
+
get addEditor() {
|
|
3280
|
+
return this._addEditor;
|
|
3281
|
+
}
|
|
3282
|
+
get editEditor() {
|
|
3283
|
+
return this._editEditor;
|
|
3284
|
+
}
|
|
3285
|
+
get tableTitle() {
|
|
3286
|
+
return this._tableTitle;
|
|
3287
|
+
}
|
|
3288
|
+
get model() {
|
|
3289
|
+
return this._model;
|
|
3290
|
+
}
|
|
3291
|
+
isLocalized() {
|
|
3292
|
+
return this._isLocalized;
|
|
3293
|
+
}
|
|
3294
|
+
withTableDescriptor(descriptor) {
|
|
3295
|
+
this._table = descriptor;
|
|
3296
|
+
return this;
|
|
3297
|
+
}
|
|
3298
|
+
withEditorDescriptors(descriptor) {
|
|
3299
|
+
this._detailsEditor = descriptor;
|
|
3300
|
+
this._editEditor = descriptor;
|
|
3301
|
+
this._addEditor = descriptor;
|
|
3302
|
+
return this;
|
|
3303
|
+
}
|
|
3304
|
+
withDetailsDescriptor(descriptor) {
|
|
3305
|
+
this._detailsEditor = descriptor;
|
|
3306
|
+
return this;
|
|
3307
|
+
}
|
|
3308
|
+
withAddDescriptor(descriptor) {
|
|
3309
|
+
this._addEditor = descriptor;
|
|
3310
|
+
return this;
|
|
3311
|
+
}
|
|
3312
|
+
withEditDescriptor(descriptor) {
|
|
3313
|
+
this._editEditor = descriptor;
|
|
3314
|
+
return this;
|
|
3315
|
+
}
|
|
3316
|
+
/**
|
|
3317
|
+
* creates new copy of editor descriptor and makes it disabled
|
|
3318
|
+
* usable in combination with this::withEditorDescriptors, where detailsDescriptor is made non-disabled
|
|
3319
|
+
* @param type which editor type to set to disabled
|
|
3320
|
+
*/
|
|
3321
|
+
withDisabledEditorDescriptor(type = TableviewEditorTypeEnum.Details) {
|
|
3322
|
+
if (type === TableviewEditorTypeEnum.Edit) {
|
|
3323
|
+
this._editEditor = this._editEditor.copy().withDisabled();
|
|
3324
|
+
}
|
|
3325
|
+
else if (type === TableviewEditorTypeEnum.Details) {
|
|
3326
|
+
this._detailsEditor = this._detailsEditor.copy().withDisabled();
|
|
3327
|
+
}
|
|
3328
|
+
else if (type === TableviewEditorTypeEnum.Add) {
|
|
3329
|
+
this._addEditor = this._addEditor.copy().withDisabled();
|
|
3330
|
+
}
|
|
3331
|
+
return this;
|
|
3332
|
+
}
|
|
3333
|
+
withTableTitle(title) {
|
|
3334
|
+
this._tableTitle = title;
|
|
3335
|
+
return this;
|
|
3336
|
+
}
|
|
3337
|
+
withValidator(name, expression) {
|
|
3338
|
+
this._detailsEditor.addValidation(name, expression);
|
|
3339
|
+
this._addEditor.addValidation(name, expression);
|
|
3340
|
+
this._editEditor.addValidation(name, expression);
|
|
3341
|
+
return this;
|
|
3342
|
+
}
|
|
3343
|
+
getColumn(property) {
|
|
3344
|
+
return this._table.getColumn(property);
|
|
3345
|
+
}
|
|
3346
|
+
getColumnUnsafe(property) {
|
|
3347
|
+
return this._table.getColumnUnsafe(property);
|
|
3348
|
+
}
|
|
3349
|
+
removeColumn(property) {
|
|
3350
|
+
this._table.removeColumn(property);
|
|
3351
|
+
}
|
|
3352
|
+
removeColumnUnsafe(property) {
|
|
3353
|
+
this._table.removeColumnUnsafe(property);
|
|
3354
|
+
}
|
|
3355
|
+
withColumn(column) {
|
|
3356
|
+
this._table.withColumn(column);
|
|
3357
|
+
return this;
|
|
3358
|
+
}
|
|
3359
|
+
addColumn(property) {
|
|
3360
|
+
return this._table.addColumn(property);
|
|
3361
|
+
}
|
|
3362
|
+
addColumnEnum(property, enumDesc) {
|
|
3363
|
+
return this._table.addColumnEnum(property, enumDesc);
|
|
3364
|
+
}
|
|
3365
|
+
addColumnUnsafe(property) {
|
|
3366
|
+
return this._table.addColumnUnsafe(property);
|
|
3367
|
+
}
|
|
3368
|
+
withColumns(...properties) {
|
|
3369
|
+
this._table.withColumns(...properties);
|
|
3370
|
+
return this;
|
|
3371
|
+
}
|
|
3372
|
+
getSort(property) {
|
|
3373
|
+
return this._table.getSort(property);
|
|
3374
|
+
}
|
|
3375
|
+
getSortUnsafe(property) {
|
|
3376
|
+
return this._table.getSortUnsafe(property);
|
|
3377
|
+
}
|
|
3378
|
+
removeSort(property) {
|
|
3379
|
+
this._table.removeSort(property);
|
|
3380
|
+
}
|
|
3381
|
+
removeSortUnsafe(property) {
|
|
3382
|
+
this._table.removeSortUnsafe(property);
|
|
3383
|
+
}
|
|
3384
|
+
addSort(property, isDefault = false, ascending) {
|
|
3385
|
+
return this._table.addSort(property, isDefault, ascending);
|
|
3386
|
+
}
|
|
3387
|
+
addSortUnsafe(property, isDefault = false, ascending) {
|
|
3388
|
+
return this._table.addSortUnsafe(property, isDefault, ascending);
|
|
3389
|
+
}
|
|
3390
|
+
withSort(property, isDefault = false, ascending) {
|
|
3391
|
+
this._table.withSort(property, isDefault, ascending);
|
|
3392
|
+
return this;
|
|
3393
|
+
}
|
|
3394
|
+
withSortUnsafe(property, isDefault = false, ascending) {
|
|
3395
|
+
this._table.withSortUnsafe(property, isDefault, ascending);
|
|
3396
|
+
return this;
|
|
3397
|
+
}
|
|
3398
|
+
withDefaultSort(property, ascending, order, enabled) {
|
|
3399
|
+
this._table.withDefaultSort(property, ascending, order, enabled);
|
|
3400
|
+
return this;
|
|
3401
|
+
}
|
|
3402
|
+
withDefaultSortUnsafe(property, ascending, order, enabled) {
|
|
3403
|
+
this._table.withDefaultSortUnsafe(property, ascending, order, enabled);
|
|
3404
|
+
return this;
|
|
3405
|
+
}
|
|
3406
|
+
withSorts(...properties) {
|
|
3407
|
+
this._table.withSorts(...properties);
|
|
3408
|
+
return this;
|
|
3409
|
+
}
|
|
3410
|
+
withSortsUnsafe(...properties) {
|
|
3411
|
+
this._table.withSortsUnsafe(...properties);
|
|
3412
|
+
return this;
|
|
3413
|
+
}
|
|
3414
|
+
getFilter(property) {
|
|
3415
|
+
return this._table.getFilter(property);
|
|
3416
|
+
}
|
|
3417
|
+
getFilterUnsafe(property) {
|
|
3418
|
+
return this._table.getFilterUnsafe(property);
|
|
3419
|
+
}
|
|
3420
|
+
removeFilter(property) {
|
|
3421
|
+
this._table.removeFilter(property);
|
|
3422
|
+
}
|
|
3423
|
+
removeFilterUnsafe(property) {
|
|
3424
|
+
this._table.removeFilterUnsafe(property);
|
|
3425
|
+
}
|
|
3426
|
+
addFilter(property) {
|
|
3427
|
+
return this._table.addFilter(property);
|
|
3428
|
+
}
|
|
3429
|
+
addFilterUnsafe(property) {
|
|
3430
|
+
return this._table.addFilterUnsafe(property);
|
|
3431
|
+
}
|
|
3432
|
+
addFilterLookup(property, provider, optionsValueProperty) {
|
|
3433
|
+
return this._table.addFilterLookup(property, provider, optionsValueProperty);
|
|
3434
|
+
}
|
|
3435
|
+
addFilterLookupUnsafe(property, provider, optionsValueProperty) {
|
|
3436
|
+
return this._table.addFilterLookupUnsafe(property, provider, optionsValueProperty);
|
|
3437
|
+
}
|
|
3438
|
+
addFilterLookupEnum(property, enumDesc, options) {
|
|
3439
|
+
return this._table.addFilterLookupEnum(property, enumDesc, options);
|
|
3440
|
+
}
|
|
3441
|
+
addFilterLookupEnumUnsafe(property, enumDesc, options) {
|
|
3442
|
+
return this._table.addFilterLookupEnumUnsafe(property, enumDesc, options);
|
|
3443
|
+
}
|
|
3444
|
+
addFilterFromColumn(property, forceSimple = false) {
|
|
3445
|
+
return this._table.addFilterFromColumn(property, forceSimple);
|
|
3446
|
+
}
|
|
3447
|
+
withFiltersFromColumns(...properties) {
|
|
3448
|
+
this._table.withFiltersFromColumns(...properties);
|
|
3449
|
+
return this;
|
|
3450
|
+
}
|
|
3451
|
+
withFiltersFromColumnsUnsafe(...properties) {
|
|
3452
|
+
this._table.withFiltersFromColumnsUnsafe(...properties);
|
|
3453
|
+
return this;
|
|
3454
|
+
}
|
|
3455
|
+
addFilterFromColumnUnsafe(property, forceSimple = false) {
|
|
3456
|
+
return this._table.addFilterFromColumnUnsafe(property, forceSimple);
|
|
3457
|
+
}
|
|
3458
|
+
withFilter(property, filter) {
|
|
3459
|
+
this._table.withFilter(property, filter);
|
|
3460
|
+
return this;
|
|
3461
|
+
}
|
|
3462
|
+
withFilterUnsafe(filter) {
|
|
3463
|
+
this._table.withFilterUnsafe(filter);
|
|
3464
|
+
return this;
|
|
3465
|
+
}
|
|
3466
|
+
getField(property, editorType) {
|
|
3467
|
+
return this.getFieldUnsafe(property, editorType);
|
|
3468
|
+
}
|
|
3469
|
+
getFieldUnsafe(property, editorType) {
|
|
3470
|
+
switch (editorType) {
|
|
3471
|
+
case TableviewEditorTypeEnum.Edit:
|
|
3472
|
+
return this._editEditor.getFieldUnsafe(property);
|
|
3473
|
+
case TableviewEditorTypeEnum.Add:
|
|
3474
|
+
return this._addEditor.getFieldUnsafe(property);
|
|
3475
|
+
case TableviewEditorTypeEnum.Details:
|
|
3476
|
+
return this._detailsEditor.getFieldUnsafe(property);
|
|
3477
|
+
case TableviewEditorTypeEnum.None:
|
|
3478
|
+
return null;
|
|
3479
|
+
}
|
|
3480
|
+
}
|
|
3481
|
+
removeField(property) {
|
|
3482
|
+
this.removeFieldUnsafe(property);
|
|
3483
|
+
}
|
|
3484
|
+
removeFieldUnsafe(property) {
|
|
3485
|
+
this._editEditor.removeFieldUnsafe(property);
|
|
3486
|
+
this._addEditor.removeFieldUnsafe(property);
|
|
3487
|
+
this._detailsEditor.removeFieldUnsafe(property);
|
|
3488
|
+
}
|
|
3489
|
+
addFieldDescriptor(field) {
|
|
3490
|
+
this._detailsEditor.addFieldDescriptor(field);
|
|
3491
|
+
this._addEditor.addFieldDescriptor(field);
|
|
3492
|
+
this._editEditor.addFieldDescriptor(field);
|
|
3493
|
+
return this;
|
|
3494
|
+
}
|
|
3495
|
+
addField(property) {
|
|
3496
|
+
const field = this._detailsEditor.addField(property);
|
|
3497
|
+
this.addFieldToEditAndAdd(field);
|
|
3498
|
+
return field;
|
|
3499
|
+
}
|
|
3500
|
+
addFieldUnsafe(property) {
|
|
3501
|
+
const field = this._detailsEditor.addFieldUnsafe(property);
|
|
3502
|
+
this.addFieldToEditAndAdd(field);
|
|
3503
|
+
return field;
|
|
3504
|
+
}
|
|
3505
|
+
addFields(...properties) {
|
|
3506
|
+
properties.forEach(p => this.addField(p));
|
|
3507
|
+
return this;
|
|
3508
|
+
}
|
|
3509
|
+
addFieldToEditAndAdd(field) {
|
|
3510
|
+
this._addEditor.addFieldDescriptor(field);
|
|
3511
|
+
this._editEditor.addFieldDescriptor(field);
|
|
3512
|
+
}
|
|
3513
|
+
/**
|
|
3514
|
+
* Adds lookup field.
|
|
3515
|
+
*
|
|
3516
|
+
* @param {Property} property - The property key of the editor.
|
|
3517
|
+
* @param {TypeDescriptor<FieldModel>} type - The type descriptor for the lookup model.
|
|
3518
|
+
* @typeparam Property - The property key of the EditorModel.
|
|
3519
|
+
* @typeparam LookupModel - The field model type, defaults to the non-nullable type of the editor's property.
|
|
3520
|
+
* @typeparam FieldValue - The value type of field on editor.
|
|
3521
|
+
*
|
|
3522
|
+
* @returns {FieldLookupDescriptor<LookupModel, TableviewModel, undefined, FieldValue>} - The field lookup descriptor.
|
|
3523
|
+
*/
|
|
3524
|
+
addFieldLookup(property, type) {
|
|
3525
|
+
const field = this._detailsEditor.addFieldLookup(property, type);
|
|
3526
|
+
this.addFieldToEditAndAdd(field);
|
|
3527
|
+
return field;
|
|
3528
|
+
}
|
|
3529
|
+
/**
|
|
3530
|
+
* [UNSAFE] Adds lookup field.
|
|
3531
|
+
* This method is UNSAFE because property is not type-checked.
|
|
3532
|
+
*
|
|
3533
|
+
* @param {string} property Model property name.
|
|
3534
|
+
* @param {TypeDescriptor<FieldModel>} type - The type descriptor for the lookup model (defines 2nd generic).
|
|
3535
|
+
* @typeparam LookupModel - The field model type, defaults to the non-nullable type of the editor's property.
|
|
3536
|
+
* @typeparam FieldValue - The value type of field on editor.
|
|
3537
|
+
*
|
|
3538
|
+
* @returns {FieldLookupDescriptor<LookupModel, TableviewModel, undefined, FieldValue>} - The field lookup descriptor.
|
|
3539
|
+
*/
|
|
3540
|
+
addFieldLookupUnsafe(property, type) {
|
|
3541
|
+
const field = this._detailsEditor.addFieldLookupUnsafe(property, type);
|
|
3542
|
+
this.addFieldToEditAndAdd(field);
|
|
3543
|
+
return field;
|
|
3544
|
+
}
|
|
3545
|
+
/**
|
|
3546
|
+
* Adds a field lookup with options value property for lookup model.
|
|
3547
|
+
*
|
|
3548
|
+
* @param {Property} property - The property key of the editor.
|
|
3549
|
+
* @param {TypeDescriptor<FieldModel>} type - The type descriptor for the lookup model.
|
|
3550
|
+
* @param {LookupValueProperty} lookupOptionsValueProperty - The value property used as value in the lookup options.
|
|
3551
|
+
* @typeparam Property - The property key of the EditorModel.
|
|
3552
|
+
* @typeparam LookupModel - The field model type, defaults to the non-nullable type of the editor's property.
|
|
3553
|
+
* @typeparam LookupValueProperty - The property of lookup model type.
|
|
3554
|
+
* @typeparam FieldValue - The value type of field on editor.
|
|
3555
|
+
*
|
|
3556
|
+
* @returns {FieldLookupDescriptor<LookupModel, TableviewModel, undefined, FieldValue>} - The field lookup descriptor.
|
|
3557
|
+
*/
|
|
3558
|
+
addFieldLookupWithOptionsValueProperty(property, type, lookupOptionsValueProperty) {
|
|
3559
|
+
const field = this._detailsEditor.addFieldLookupWithOptionsValueProperty(property, type, lookupOptionsValueProperty);
|
|
3560
|
+
this.addFieldToEditAndAdd(field);
|
|
3561
|
+
return field;
|
|
3562
|
+
}
|
|
3563
|
+
/**
|
|
3564
|
+
* [UNSAFE] Adds a field lookup with options value property for lookup model.
|
|
3565
|
+
* This method is UNSAFE because property is not type-checked.
|
|
3566
|
+
*
|
|
3567
|
+
* @param {Property} property - The property key of the editor.
|
|
3568
|
+
* @param {TypeDescriptor<FieldModel>} type - The type descriptor for the lookup model.
|
|
3569
|
+
* @param {LookupValueProperty} lookupOptionsValueProperty - The value property used as value in the lookup options.
|
|
3570
|
+
* @typeparam Property - The property key of the EditorModel.
|
|
3571
|
+
* @typeparam LookupModel - The field model type, defaults to the non-nullable type of the editor's property.
|
|
3572
|
+
* @typeparam LookupValueProperty - The property of lookup model type.
|
|
3573
|
+
* @typeparam FieldValue - The value type of field on editor.
|
|
3574
|
+
*
|
|
3575
|
+
* @returns {FieldLookupDescriptor<LookupModel, TableviewModel, undefined, FieldValue>} - The field lookup descriptor.
|
|
3576
|
+
*/
|
|
3577
|
+
addFieldLookupWithOptionsValuePropertyUnsafe(property, type, lookupOptionsValueProperty) {
|
|
3578
|
+
const field = this._detailsEditor.addFieldLookupWithOptionsValuePropertyUnsafe(property, type, lookupOptionsValueProperty);
|
|
3579
|
+
this.addFieldToEditAndAdd(field);
|
|
3580
|
+
return field;
|
|
3581
|
+
}
|
|
3582
|
+
/**
|
|
3583
|
+
* Adds a field lookup with a data provider or service to the editor model.
|
|
3584
|
+
*
|
|
3585
|
+
* @param {Property} property - The property key of the editor.
|
|
3586
|
+
* @param {FieldLookupProviderType<LookupModel, Service>} provider - The field lookup data provider or service.
|
|
3587
|
+
* @param {TypeDescriptor<LookupModel>} [type] - The type of lookup - if data provider is passed as previous parameter, type can be omitted. If service is provider, type parameter is proposed in favour of correct typing.
|
|
3588
|
+
* @typeparam Property - The property key of the EditorModel.
|
|
3589
|
+
* @typeparam Service - The lookup service type.
|
|
3590
|
+
* @typeparam LookupModel - The field model type, defaults to the non-nullable type of the editor's property.
|
|
3591
|
+
* @typeparam FieldValue - The field value type, defaults to the editor's property type.
|
|
3592
|
+
*
|
|
3593
|
+
* @returns {FieldLookupDescriptor<LookupModel, EditorModel, Service, FieldValue>} Created field lookup descriptor.
|
|
3594
|
+
*/
|
|
3595
|
+
addFieldLookupWithProvider(property, provider, type) {
|
|
3596
|
+
const field = this._detailsEditor.addFieldLookupWithProvider(property, provider, type);
|
|
3597
|
+
this.addFieldToEditAndAdd(field);
|
|
3598
|
+
return field;
|
|
3599
|
+
}
|
|
3600
|
+
/**
|
|
3601
|
+
* [UNSAFE] Adds a field lookup with a data provider or service to the editor model.
|
|
3602
|
+
* This method is UNSAFE because property is not type-checked.
|
|
3603
|
+
*
|
|
3604
|
+
* @param {string} property - The property key of the editor.
|
|
3605
|
+
* @param {FieldLookupProviderType<LookupModel, Service>} provider - The lookup provider or service for the field lookup.
|
|
3606
|
+
* @param {TypeDescriptor<LookupModel>?} type - Optional type descriptor for the field lookup.
|
|
3607
|
+
* @typeparam LookupModel - The field lookup model type.
|
|
3608
|
+
* @typeparam Service - The lookup service type.
|
|
3609
|
+
* @typeparam FieldValue - The value type of field on editor.
|
|
3610
|
+
*
|
|
3611
|
+
* @returns {FieldLookupDescriptor<LookupModel, TableviewModel, Service, FieldValue>} - The field lookup descriptor added to the instance.
|
|
3612
|
+
*/
|
|
3613
|
+
addFieldLookupWithProviderUnsafe(property, provider, type) {
|
|
3614
|
+
const field = this._detailsEditor.addFieldLookupWithProviderUnsafe(property, provider, type);
|
|
3615
|
+
this.addFieldToEditAndAdd(field);
|
|
3616
|
+
return field;
|
|
3617
|
+
}
|
|
3618
|
+
/**
|
|
3619
|
+
* Adds a field lookup with data provider or service and options value property for lookup model.
|
|
3620
|
+
*
|
|
3621
|
+
* @param {Property} property - The property key of the editor.
|
|
3622
|
+
* @param {FieldLookupProviderType<FieldModel, Service>} provider - The lookup provider.
|
|
3623
|
+
* @param {TypeDescriptor<FieldModel>} type - The type descriptor for the lookup model.
|
|
3624
|
+
* @param {LookupValueProperty} lookupOptionsValueProperty - The value property used as value in the lookup options.
|
|
3625
|
+
* @typeparam Property - The property key of the EditorModel.
|
|
3626
|
+
* @typeparam Service - The lookup service type.
|
|
3627
|
+
* @typeparam LookupModel - The field model type, defaults to the non-nullable type of the editor's property.
|
|
3628
|
+
* @typeparam LookupValueProperty - The property of lookup model type.
|
|
3629
|
+
* @typeparam FieldValue - The value type of field on editor.
|
|
3630
|
+
*
|
|
3631
|
+
* @returns {FieldLookupDescriptor<LookupModel, TableviewModel, Service, FieldValue>} - The field lookup descriptor.
|
|
3632
|
+
*/
|
|
3633
|
+
addFieldLookupWithProviderAndOptionsValueProperty(property, provider, type, lookupOptionsValueProperty) {
|
|
3634
|
+
const field = this._detailsEditor.addFieldLookupWithProviderAndOptionsValueProperty(property, provider, type, lookupOptionsValueProperty);
|
|
3635
|
+
this.addFieldToEditAndAdd(field);
|
|
3636
|
+
return field;
|
|
3637
|
+
}
|
|
3638
|
+
/**
|
|
3639
|
+
* [UNSAFE] Adds a field lookup with data provider or service and options value property for lookup model.
|
|
3640
|
+
* This method is UNSAFE because property is not type-checked.
|
|
3641
|
+
*
|
|
3642
|
+
* @param {string} property - The property key of the editor.
|
|
3643
|
+
* @param {FieldLookupProviderType<FieldModel, Service>} provider - The lookup provider.
|
|
3644
|
+
* @param {TypeDescriptor<FieldModel>} type - The type descriptor for the lookup model.
|
|
3645
|
+
* @param {string} lookupOptionsValueProperty - The value property used in the lookup options.
|
|
3646
|
+
* @typeparam Service - The service type.
|
|
3647
|
+
* @typeparam LookupModel - The field model type, defaults to the non-nullable type of the editor's property.
|
|
3648
|
+
* @typeparam FieldValue - The value type of field on editor.
|
|
3649
|
+
*
|
|
3650
|
+
* @returns {FieldLookupDescriptor<LookupModel, EditorModel, Service, FieldValue>} - The field lookup descriptor.
|
|
3651
|
+
*/
|
|
3652
|
+
addFieldLookupWithProviderAndOptionsValuePropertyUnsafe(property, provider, type, lookupOptionsValueProperty) {
|
|
3653
|
+
const field = this._detailsEditor.addFieldLookupWithProviderAndOptionsValuePropertyUnsafe(property, provider, type, lookupOptionsValueProperty);
|
|
3654
|
+
this.addFieldToEditAndAdd(field);
|
|
3655
|
+
return field;
|
|
3656
|
+
}
|
|
3657
|
+
addFieldLookupEnum(property, enumDesc, options) {
|
|
3658
|
+
const field = this._detailsEditor.addFieldLookupEnum(property, enumDesc, options);
|
|
3659
|
+
this.addFieldToEditAndAdd(field);
|
|
3660
|
+
return field;
|
|
3661
|
+
}
|
|
3662
|
+
addFieldLookupEnumUnsafe(property, enumDesc, options) {
|
|
3663
|
+
const field = this._detailsEditor.addFieldLookupEnumUnsafe(property, enumDesc, options);
|
|
3664
|
+
this.addFieldToEditAndAdd(field);
|
|
3665
|
+
return field;
|
|
3666
|
+
}
|
|
3667
|
+
addFieldManyEditor(property, tableviewDescriptor) {
|
|
3668
|
+
const field = this._detailsEditor.addFieldManyEditor(property, tableviewDescriptor);
|
|
3669
|
+
this.addFieldToEditAndAdd(field);
|
|
3670
|
+
return field;
|
|
3671
|
+
}
|
|
3672
|
+
addFieldManyEditorUnsafe(property, tableviewDescriptor) {
|
|
3673
|
+
const field = this._detailsEditor.addFieldManyEditorUnsafe(property, tableviewDescriptor);
|
|
3674
|
+
this.addFieldToEditAndAdd(field);
|
|
3675
|
+
return field;
|
|
3676
|
+
}
|
|
3677
|
+
addFieldManyToManyEditor(property, mainTableDescriptor, lookupTableDescriptor) {
|
|
3678
|
+
const field = this._detailsEditor.addFieldManyToManyEditor(property, mainTableDescriptor, lookupTableDescriptor);
|
|
3679
|
+
this.addFieldToEditAndAdd(field);
|
|
3680
|
+
return field;
|
|
3681
|
+
}
|
|
3682
|
+
addFieldManyToManyEditorUnsafe(property, mainTableDescriptor, lookupTableDescriptor) {
|
|
3683
|
+
const field = this._detailsEditor.addFieldManyToManyEditorUnsafe(property, mainTableDescriptor, lookupTableDescriptor);
|
|
3684
|
+
this.addFieldToEditAndAdd(field);
|
|
3685
|
+
return field;
|
|
3686
|
+
}
|
|
3687
|
+
addFieldManyToManyEditorWithProvider(property, mainTableDescriptor, lookupTableDescriptor, lookupDataProvider) {
|
|
3688
|
+
const field = this._detailsEditor.addFieldManyToManyEditorWithProvider(property, mainTableDescriptor, lookupTableDescriptor, lookupDataProvider);
|
|
3689
|
+
this.addFieldToEditAndAdd(field);
|
|
3690
|
+
return field;
|
|
3691
|
+
}
|
|
3692
|
+
addFieldManyToManyEditorWithProviderUnsafe(property, mainTableDescriptor, lookupTableDescriptor, lookupDataProvider) {
|
|
3693
|
+
const field = this._detailsEditor.addFieldManyToManyEditorWithProviderUnsafe(property, mainTableDescriptor, lookupTableDescriptor, lookupDataProvider);
|
|
3694
|
+
this.addFieldToEditAndAdd(field);
|
|
3695
|
+
return field;
|
|
3696
|
+
}
|
|
3697
|
+
createTabGroup(name, title) {
|
|
3698
|
+
this._detailsEditor.createTabGroup(name, title);
|
|
3699
|
+
this._addEditor.createTabGroup(name, title);
|
|
3700
|
+
this._editEditor.createTabGroup(name, title);
|
|
3701
|
+
return this;
|
|
3702
|
+
}
|
|
3703
|
+
createFieldGroup(name, title) {
|
|
3704
|
+
this._detailsEditor.createFieldGroup(name, title);
|
|
3705
|
+
this._addEditor.createFieldGroup(name, title);
|
|
3706
|
+
this._editEditor.createFieldGroup(name, title);
|
|
3707
|
+
return this;
|
|
3708
|
+
}
|
|
3709
|
+
copy() {
|
|
3710
|
+
const tableview = new TableviewDescriptorInst(this._model.copy());
|
|
3711
|
+
tableview._table = this._table.copy();
|
|
3712
|
+
tableview._detailsEditor = this._detailsEditor.copy();
|
|
3713
|
+
tableview._addEditor = this._addEditor.copy();
|
|
3714
|
+
tableview._editEditor = this._editEditor.copy();
|
|
3715
|
+
tableview._tableTitle = this._tableTitle;
|
|
3716
|
+
tableview._isLocalized = this._isLocalized;
|
|
3717
|
+
return tableview;
|
|
3718
|
+
}
|
|
3719
|
+
/**
|
|
3720
|
+
* creates column and field with custom type, for example currency
|
|
3721
|
+
* if field exists, it is replaced
|
|
3722
|
+
* DO NOT USE WITH TYPES WHERE ARGS ARE REQUIRED - ERROR WILL BE THROWN
|
|
3723
|
+
* for enum use withEnumType
|
|
3724
|
+
* for custom class use withClassType
|
|
3725
|
+
* @param property name of field
|
|
3726
|
+
* @param columnType required column type
|
|
3727
|
+
* @param fieldType optional, if not provided it is converted from column type
|
|
3728
|
+
* @param columnDisplayType optional
|
|
3729
|
+
*/
|
|
3730
|
+
withModifiedType(property, columnType, fieldType, columnDisplayType) {
|
|
3731
|
+
return this.withModifiedTypeUnsafe(property, columnType, fieldType, columnDisplayType);
|
|
3732
|
+
}
|
|
3733
|
+
withModifiedTypeUnsafe(property, columnType, fieldType, columnDisplayType) {
|
|
3734
|
+
if (!this.model.type) {
|
|
3735
|
+
throw new CommonsInternalError(`withModifiedType cannot be executed for property ${property}: Model type is not defined.`);
|
|
3736
|
+
}
|
|
3737
|
+
if (columnType === ColumnTypeEnum.Enum) {
|
|
3738
|
+
throw new CommonsInternalError('Do not use with types where args are required', { name: 'TableviewDescriptorError' });
|
|
3739
|
+
}
|
|
3740
|
+
const attributeDef = getTableviewClassAttributeDef(this.model.type).find(attr => attr.name === property);
|
|
3741
|
+
if (attributeDef != null) {
|
|
3742
|
+
fieldType ??= getFieldInputTypeFromColumnType(columnType, columnDisplayType);
|
|
3743
|
+
attributeDef.fieldType = fieldType;
|
|
3744
|
+
this._table.withColumnModifiedTypeUnsafe(property, columnType, columnDisplayType);
|
|
3745
|
+
this._editEditor.withFieldModifiedTypeUnsafe(property, fieldType);
|
|
3746
|
+
this._addEditor.withFieldModifiedTypeUnsafe(property, fieldType);
|
|
3747
|
+
this._detailsEditor.withFieldModifiedTypeUnsafe(property, fieldType);
|
|
3748
|
+
}
|
|
3749
|
+
return this;
|
|
3750
|
+
}
|
|
3751
|
+
/**
|
|
3752
|
+
* creates column with enum type
|
|
3753
|
+
* if fields exists, it is replaced
|
|
3754
|
+
* @param property property name
|
|
3755
|
+
* @param enumDesc type of enum
|
|
3756
|
+
* @param fieldType type of field, optional, default is Text
|
|
3757
|
+
*/
|
|
3758
|
+
withModifiedEnum(property, enumDesc, fieldType) {
|
|
3759
|
+
return this.withModifiedEnumUnsafe(property, enumDesc, fieldType);
|
|
3760
|
+
}
|
|
3761
|
+
withModifiedEnumUnsafe(property, enumDesc, fieldType) {
|
|
3762
|
+
if (!this.model.type) {
|
|
3763
|
+
throw new CommonsInternalError(`withModifiedEnum cannot be executed for property ${property}: Model type is not defined.`);
|
|
3764
|
+
}
|
|
3765
|
+
const attributeDef = getTableviewClassAttributeDef(this.model.type).find(attr => attr.name === property);
|
|
3766
|
+
if (attributeDef != null) {
|
|
3767
|
+
attributeDef.fieldType = fieldType ?? FieldInputTypeEnum.Text;
|
|
3768
|
+
this._table.withColumnModifiedEnumUnsafe(property, enumDesc);
|
|
3769
|
+
this._editEditor.withFieldModifiedEnumUnsafe(property, enumDesc);
|
|
3770
|
+
this._detailsEditor.withFieldModifiedEnumUnsafe(property, enumDesc);
|
|
3771
|
+
this._addEditor.withFieldModifiedEnumUnsafe(property, enumDesc);
|
|
3772
|
+
}
|
|
3773
|
+
return this;
|
|
3774
|
+
}
|
|
3775
|
+
/**
|
|
3776
|
+
* generates column with custom class type
|
|
3777
|
+
* field is generated only if lookupProvider is provided
|
|
3778
|
+
* @param property property name
|
|
3779
|
+
* @param type class type of object
|
|
3780
|
+
* @param titleProperty
|
|
3781
|
+
* @param lookupProvider
|
|
3782
|
+
* @param optionsLabelProperty
|
|
3783
|
+
* @param filterProperty
|
|
3784
|
+
*/
|
|
3785
|
+
withModifiedLookup(property, type, lookupProvider, titleProperty, optionsLabelProperty, filterProperty) {
|
|
3786
|
+
return this.withModifiedLookupUnsafe(property, type, lookupProvider, titleProperty, optionsLabelProperty, filterProperty);
|
|
3787
|
+
}
|
|
3788
|
+
withModifiedLookupUnsafe(property, type, lookupProvider, titleProperty, optionsLabelProperty, filterProperty) {
|
|
3789
|
+
if (!this.model.type) {
|
|
3790
|
+
throw new CommonsInternalError(`withModifiedLookup cannot be executed for property ${property}: Model type is not defined.`);
|
|
3791
|
+
}
|
|
3792
|
+
const attributeDef = getTableviewClassAttributeDef(this.model.type).find(attr => attr.name === property);
|
|
3793
|
+
if (attributeDef != null) {
|
|
3794
|
+
type ??= attributeDef.classType ?? TypeRegistry.get().findType(attributeDef.type);
|
|
3795
|
+
titleProperty ??= type ? findClassTitleAttribute(type) ?? undefined : undefined;
|
|
3796
|
+
optionsLabelProperty ??= titleProperty;
|
|
3797
|
+
attributeDef.columnType = ColumnTypeEnum.String;
|
|
3798
|
+
attributeDef.fieldType = FieldInputTypeEnum.Text;
|
|
3799
|
+
if (lookupProvider != null) {
|
|
3800
|
+
this._table.withColumnModifiedLookupUnsafe(property, lookupProvider, optionsLabelProperty, filterProperty);
|
|
3801
|
+
this._addEditor.withFieldModifiedLookupWithProviderUnsafe(property, lookupProvider, optionsLabelProperty);
|
|
3802
|
+
this._detailsEditor.withFieldModifiedLookupWithProviderUnsafe(property, lookupProvider, optionsLabelProperty);
|
|
3803
|
+
this._editEditor.withFieldModifiedLookupWithProviderUnsafe(property, lookupProvider, optionsLabelProperty);
|
|
3804
|
+
}
|
|
3805
|
+
else {
|
|
3806
|
+
const column = this._table.getColumnUnsafe(property) ?? this.addColumnUnsafe(property);
|
|
3807
|
+
if (titleProperty) {
|
|
3808
|
+
column.withGetter(value => value?.[titleProperty]);
|
|
3809
|
+
}
|
|
3810
|
+
}
|
|
3811
|
+
}
|
|
3812
|
+
return this;
|
|
3813
|
+
}
|
|
3814
|
+
localized(property, model, localeProperty) {
|
|
3815
|
+
return this.localizedUnsafe(property, model, localeProperty);
|
|
3816
|
+
}
|
|
3817
|
+
localizedUnsafe(property, model, localeProperty) {
|
|
3818
|
+
this._isLocalized = true;
|
|
3819
|
+
this._table.withLocalizationLocaleProperty(localeProperty);
|
|
3820
|
+
this.detailsEditor.localizedUnsafe(property, model, localeProperty);
|
|
3821
|
+
this.addEditor.localizedUnsafe(property, model, localeProperty);
|
|
3822
|
+
this.editEditor.localizedUnsafe(property, model, localeProperty);
|
|
3823
|
+
return this;
|
|
3824
|
+
}
|
|
3825
|
+
}
|
|
3826
|
+
class TableviewDescriptor extends TableviewDescriptorInst {
|
|
3827
|
+
constructor() {
|
|
3828
|
+
super(ModelDescriptor.create());
|
|
3829
|
+
}
|
|
3830
|
+
static create(idProperty, titleProperty, i18nBaseKey) {
|
|
3831
|
+
return new TableviewDescriptorInst(ModelDescriptor.create(idProperty, titleProperty, i18nBaseKey));
|
|
3832
|
+
}
|
|
3833
|
+
static fromClass(type, idProperty, titleProperty, i18nBaseKey) {
|
|
3834
|
+
return new TableviewDescriptorInst(ModelDescriptor.fromClass(type, idProperty, titleProperty, i18nBaseKey));
|
|
3835
|
+
}
|
|
3836
|
+
static fromModel(model) {
|
|
3837
|
+
return new TableviewDescriptorInst(model);
|
|
3838
|
+
}
|
|
3839
|
+
/**
|
|
3840
|
+
* generates descriptor from attribute definition of openapi model
|
|
3841
|
+
* @param type class type
|
|
3842
|
+
* @param idProperty
|
|
3843
|
+
* @param titleProperty
|
|
3844
|
+
*/
|
|
3845
|
+
static fromClassWithAutoAttrsDef(type, idProperty, titleProperty) {
|
|
3846
|
+
const model = ModelDescriptor.fromClass(type, idProperty, titleProperty);
|
|
3847
|
+
const descriptor = TableviewDescriptor.fromModel(model);
|
|
3848
|
+
descriptor.withTableDescriptor(TableDescriptor.fromClassWithAutoAttrsDef(type, idProperty, titleProperty));
|
|
3849
|
+
descriptor.withEditDescriptor(EditorDescriptor.fromClassWithAutoAttrsDef(type, idProperty, titleProperty, TableviewEditorTypeEnum.Edit));
|
|
3850
|
+
descriptor.withDetailsDescriptor(EditorDescriptor.fromClassWithAutoAttrsDef(type, idProperty, titleProperty, TableviewEditorTypeEnum.Details).withDisabled());
|
|
3851
|
+
descriptor.withAddDescriptor(EditorDescriptor.fromClassWithAutoAttrsDef(type, idProperty, titleProperty, TableviewEditorTypeEnum.Add));
|
|
3852
|
+
return descriptor;
|
|
3853
|
+
}
|
|
3854
|
+
/**
|
|
3855
|
+
* generates descriptor from given attribute definition
|
|
3856
|
+
* @param type class type
|
|
3857
|
+
* @param columnAttributes attribute definition to generate columns
|
|
3858
|
+
* @param fieldAttributes attribute definition to generate fields, if undefined columnDefinition is used, if null editors are not generated
|
|
3859
|
+
* @param idProperty
|
|
3860
|
+
* @param titleProperty
|
|
3861
|
+
*/
|
|
3862
|
+
static fromClassWithCustomAttrsDef(type, columnAttributes, fieldAttributes, idProperty, titleProperty) {
|
|
3863
|
+
const descriptor = TableviewDescriptor.fromModel(ModelDescriptor.fromClass(type, idProperty, titleProperty));
|
|
3864
|
+
descriptor.withTableDescriptor(TableDescriptor.fromClassWithCustomAttrsDef(type, columnAttributes, idProperty, titleProperty));
|
|
3865
|
+
if (fieldAttributes !== null) {
|
|
3866
|
+
descriptor.withEditDescriptor(EditorDescriptor.fromClassWithCustomAttrsDef(type, fieldAttributes ?? columnAttributes, idProperty, titleProperty, TableviewEditorTypeEnum.Edit));
|
|
3867
|
+
descriptor.withDetailsDescriptor(EditorDescriptor.fromClassWithCustomAttrsDef(type, fieldAttributes ?? columnAttributes, idProperty, titleProperty, TableviewEditorTypeEnum.Details));
|
|
3868
|
+
descriptor.withAddDescriptor(EditorDescriptor.fromClassWithCustomAttrsDef(type, fieldAttributes ?? columnAttributes, idProperty, titleProperty, TableviewEditorTypeEnum.Add));
|
|
3869
|
+
}
|
|
3870
|
+
return descriptor;
|
|
3871
|
+
}
|
|
3872
|
+
}
|
|
3873
|
+
class TableviewDynamicDescriptorInt extends TableviewDescriptorInst {
|
|
3874
|
+
constructor(model) {
|
|
3875
|
+
super(model);
|
|
3876
|
+
this._table = TableDynamicDescriptor.fromModel(this.model);
|
|
3877
|
+
this._tableTitle = undefined;
|
|
3878
|
+
}
|
|
3879
|
+
get table() {
|
|
3880
|
+
return this._table;
|
|
3881
|
+
}
|
|
3882
|
+
/**
|
|
3883
|
+
* sets custom table descriptor
|
|
3884
|
+
* @param descriptor
|
|
3885
|
+
*/
|
|
3886
|
+
withTableDescriptor(descriptor) {
|
|
3887
|
+
this._table = descriptor;
|
|
3888
|
+
return this;
|
|
3889
|
+
}
|
|
3890
|
+
/**
|
|
3891
|
+
* sets visibility hidden state to column with given property
|
|
3892
|
+
* equals to be removing in auto and base tableview descriptor
|
|
3893
|
+
* * @param property column's property
|
|
3894
|
+
*/
|
|
3895
|
+
removeColumn(property) {
|
|
3896
|
+
this._table.removeColumn(property);
|
|
3897
|
+
return this;
|
|
3898
|
+
}
|
|
3899
|
+
withEntityForTranslations(i18nBaseKey) {
|
|
3900
|
+
this._table.model.withI18nBase(i18nBaseKey);
|
|
3901
|
+
this._detailsEditor.model.withI18nBase(i18nBaseKey);
|
|
3902
|
+
return this;
|
|
3903
|
+
}
|
|
3904
|
+
/**
|
|
3905
|
+
* creates deep copy of tableview object and its children
|
|
3906
|
+
*/
|
|
3907
|
+
copy() {
|
|
3908
|
+
const descriptor = new TableviewDynamicDescriptorInt(this.model.copy());
|
|
3909
|
+
descriptor._table = this._table.copy();
|
|
3910
|
+
descriptor._tableTitle = this._tableTitle;
|
|
3911
|
+
return descriptor;
|
|
3912
|
+
}
|
|
3913
|
+
}
|
|
3914
|
+
class TableviewDynamicDescriptor extends TableviewDynamicDescriptorInt {
|
|
3915
|
+
constructor() {
|
|
3916
|
+
super(ModelDescriptor.create());
|
|
3917
|
+
}
|
|
3918
|
+
static create(idProperty, titleProperty, i18nBaseKey) {
|
|
3919
|
+
return new TableviewDynamicDescriptorInt(ModelDescriptor.create(idProperty, titleProperty, i18nBaseKey));
|
|
3920
|
+
}
|
|
3921
|
+
static fromModel(model) {
|
|
3922
|
+
return new TableviewDynamicDescriptorInt(model);
|
|
3923
|
+
}
|
|
3924
|
+
}
|
|
3925
|
+
|
|
3926
|
+
function convertDataToStringWithDelimiter(data, delimiter, descriptor, translate) {
|
|
3927
|
+
const replaceNullValue = (key, value) => (value === null ? '' : value);
|
|
3928
|
+
const getterPipe = new GetterPipe();
|
|
3929
|
+
return [
|
|
3930
|
+
descriptor.table.columns.map(col => translate.instant(descriptor.model.typeName + '.properties.' + col.property)).join(delimiter),
|
|
3931
|
+
...data.map((row) => descriptor.table.columns
|
|
3932
|
+
.map(column => {
|
|
3933
|
+
if (typeof column.getter === 'function') {
|
|
3934
|
+
return JSON.stringify(getterPipe.transform(row[column.property], column.getter, row), replaceNullValue);
|
|
3935
|
+
}
|
|
3936
|
+
else {
|
|
3937
|
+
return JSON.stringify(row[column.property], replaceNullValue);
|
|
3938
|
+
}
|
|
3939
|
+
})
|
|
3940
|
+
.join(delimiter))
|
|
3941
|
+
].join('\r\n');
|
|
3942
|
+
}
|
|
3943
|
+
function saveFileAs(blob, filename) {
|
|
3944
|
+
const blobUrl = URL.createObjectURL(blob);
|
|
3945
|
+
const link = document.createElement('a');
|
|
3946
|
+
link.style.display = 'none';
|
|
3947
|
+
link.target = '_blank';
|
|
3948
|
+
link.href = blobUrl;
|
|
3949
|
+
link.download = filename;
|
|
3950
|
+
document.body.appendChild(link);
|
|
3951
|
+
link.dispatchEvent(new MouseEvent('click', {
|
|
3952
|
+
bubbles: true,
|
|
3953
|
+
cancelable: true,
|
|
3954
|
+
view: window
|
|
3955
|
+
}));
|
|
3956
|
+
document.body.removeChild(link);
|
|
3957
|
+
}
|
|
3958
|
+
|
|
3959
|
+
var TableviewDefaultActionsEnum;
|
|
3960
|
+
(function (TableviewDefaultActionsEnum) {
|
|
3961
|
+
TableviewDefaultActionsEnum[TableviewDefaultActionsEnum["Details"] = 0] = "Details";
|
|
3962
|
+
TableviewDefaultActionsEnum[TableviewDefaultActionsEnum["Add"] = 1] = "Add";
|
|
3963
|
+
TableviewDefaultActionsEnum[TableviewDefaultActionsEnum["Edit"] = 2] = "Edit";
|
|
3964
|
+
TableviewDefaultActionsEnum[TableviewDefaultActionsEnum["EditOnDetails"] = 3] = "EditOnDetails";
|
|
3965
|
+
TableviewDefaultActionsEnum[TableviewDefaultActionsEnum["Delete"] = 4] = "Delete";
|
|
3966
|
+
TableviewDefaultActionsEnum[TableviewDefaultActionsEnum["DeleteOnDetails"] = 5] = "DeleteOnDetails";
|
|
3967
|
+
TableviewDefaultActionsEnum[TableviewDefaultActionsEnum["Refresh"] = 6] = "Refresh";
|
|
3968
|
+
TableviewDefaultActionsEnum[TableviewDefaultActionsEnum["Export"] = 7] = "Export";
|
|
3969
|
+
TableviewDefaultActionsEnum[TableviewDefaultActionsEnum["ExportJson"] = 8] = "ExportJson";
|
|
3970
|
+
TableviewDefaultActionsEnum[TableviewDefaultActionsEnum["ExportCsv"] = 9] = "ExportCsv";
|
|
3971
|
+
TableviewDefaultActionsEnum[TableviewDefaultActionsEnum["LocalizationLanguageSelect"] = 10] = "LocalizationLanguageSelect";
|
|
3972
|
+
})(TableviewDefaultActionsEnum || (TableviewDefaultActionsEnum = {}));
|
|
3973
|
+
const tableviewDefaultActions = [
|
|
3974
|
+
TableviewDefaultActionsEnum.Details,
|
|
3975
|
+
TableviewDefaultActionsEnum.Add,
|
|
3976
|
+
TableviewDefaultActionsEnum.Edit,
|
|
3977
|
+
TableviewDefaultActionsEnum.EditOnDetails,
|
|
3978
|
+
TableviewDefaultActionsEnum.Delete,
|
|
3979
|
+
TableviewDefaultActionsEnum.DeleteOnDetails,
|
|
3980
|
+
TableviewDefaultActionsEnum.Refresh,
|
|
3981
|
+
TableviewDefaultActionsEnum.Export,
|
|
3982
|
+
TableviewDefaultActionsEnum.ExportJson,
|
|
3983
|
+
TableviewDefaultActionsEnum.ExportCsv,
|
|
3984
|
+
TableviewDefaultActionsEnum.LocalizationLanguageSelect
|
|
3985
|
+
];
|
|
3986
|
+
function getTableviewDefaultActions() {
|
|
3987
|
+
return [...tableviewDefaultActions];
|
|
3988
|
+
}
|
|
3989
|
+
function createTableviewActions(tableview, defaultActions, defaultActionsOverrides, injector) {
|
|
3990
|
+
return (defaultActions ?? getTableviewDefaultActions())
|
|
3991
|
+
.map(t => createTableviewAction(t, tableview, defaultActions, defaultActionsOverrides, injector))
|
|
3992
|
+
.filter(e => e != null);
|
|
3993
|
+
}
|
|
3994
|
+
function createTableviewAction(type, tableview, defaultActions, defaultActionsOverrides, injector) {
|
|
3995
|
+
if (defaultActionsOverrides != null && defaultActionsOverrides[type] !== undefined) {
|
|
3996
|
+
return defaultActionsOverrides[type];
|
|
3997
|
+
}
|
|
3998
|
+
switch (type) {
|
|
3999
|
+
// table row actions
|
|
4000
|
+
case TableviewDefaultActionsEnum.Details:
|
|
4001
|
+
return tableviewDetailsAction(tableview.detailsEditor, injector);
|
|
4002
|
+
case TableviewDefaultActionsEnum.Edit:
|
|
4003
|
+
return tableviewEditAction(tableview.editEditor, injector);
|
|
4004
|
+
case TableviewDefaultActionsEnum.Delete:
|
|
4005
|
+
return tableviewDeleteAction(tableview.model, injector);
|
|
4006
|
+
// table toolbar actions
|
|
4007
|
+
case TableviewDefaultActionsEnum.Add:
|
|
4008
|
+
return tableviewAddAction(tableview.addEditor, injector);
|
|
4009
|
+
case TableviewDefaultActionsEnum.LocalizationLanguageSelect:
|
|
4010
|
+
return tableviewLocalizationLanguageSelectAction(tableview);
|
|
4011
|
+
case TableviewDefaultActionsEnum.Refresh:
|
|
4012
|
+
return tableviewRefreshAction(tableview.model);
|
|
4013
|
+
case TableviewDefaultActionsEnum.Export:
|
|
4014
|
+
return defaultActions == null || defaultActions.includes(TableviewDefaultActionsEnum.ExportJson) || defaultActions.includes(TableviewDefaultActionsEnum.ExportCsv)
|
|
4015
|
+
? tableviewExportAction(tableview, injector, defaultActions)
|
|
4016
|
+
: null;
|
|
4017
|
+
//details actions
|
|
4018
|
+
case TableviewDefaultActionsEnum.EditOnDetails:
|
|
4019
|
+
return defaultActions == null || defaultActions.includes(TableviewDefaultActionsEnum.Edit)
|
|
4020
|
+
? tableviewEditOnDetailsAction(tableview.model, tableviewEditAction(tableview.editEditor, injector), injector)
|
|
4021
|
+
: null;
|
|
4022
|
+
case TableviewDefaultActionsEnum.DeleteOnDetails:
|
|
4023
|
+
return defaultActions == null || defaultActions.includes(TableviewDefaultActionsEnum.Delete) ? tableviewDeleteOnDetailsAction(tableview.model, injector) : null;
|
|
4024
|
+
// subactions
|
|
4025
|
+
case TableviewDefaultActionsEnum.ExportJson:
|
|
4026
|
+
case TableviewDefaultActionsEnum.ExportCsv:
|
|
4027
|
+
return null;
|
|
4028
|
+
default:
|
|
4029
|
+
throw new CommonsInternalError(`Tableview default action of type ${type} not supported`);
|
|
4030
|
+
}
|
|
4031
|
+
}
|
|
4032
|
+
function getInjector(injector) {
|
|
4033
|
+
return injector === undefined ? inject(Injector) : injector;
|
|
4034
|
+
}
|
|
4035
|
+
function getRouteData(injector) {
|
|
4036
|
+
return getInjector(injector)?.get(ActivatedRoute)?.snapshot.data;
|
|
4037
|
+
}
|
|
4038
|
+
function tableviewDetailsAction(descriptor, injector) {
|
|
4039
|
+
const routeData = getRouteData(injector);
|
|
4040
|
+
return !routeData?.tableviewActions || routeData.tableviewActions.hasDetails ? ActionEditorDetailsDescriptor.create(descriptor) : null;
|
|
4041
|
+
}
|
|
4042
|
+
function tableviewDetailsActionWithProvider(descriptor, serviceProvider, injector) {
|
|
4043
|
+
const routeData = getRouteData(injector);
|
|
4044
|
+
return !routeData?.tableviewActions || routeData.tableviewActions.hasDetails ? ActionEditorDetailsDescriptor.createWithProvider(descriptor, serviceProvider) : null;
|
|
4045
|
+
}
|
|
4046
|
+
function tableviewAddAction(descriptor, injector) {
|
|
4047
|
+
const routeData = getRouteData(injector);
|
|
4048
|
+
return !routeData?.tableviewActions || routeData.tableviewActions.hasAdd ? ActionEditorAddDescriptor.create(descriptor) : null;
|
|
4049
|
+
}
|
|
4050
|
+
function tableviewAddActionWithProvider(descriptor, serviceProvider, injector) {
|
|
4051
|
+
const routeData = getRouteData(injector);
|
|
4052
|
+
return !routeData?.tableviewActions || routeData.tableviewActions.hasAdd ? ActionEditorAddDescriptor.createWithProvider(descriptor, serviceProvider) : null;
|
|
4053
|
+
}
|
|
4054
|
+
function tableviewEditAction(descriptor, injector) {
|
|
4055
|
+
const routeData = getRouteData(injector);
|
|
4056
|
+
return !routeData?.tableviewActions || routeData.tableviewActions.hasEdit ? ActionEditorEditDescriptor.create(descriptor) : null;
|
|
4057
|
+
}
|
|
4058
|
+
function tableviewEditActionWithProvider(descriptor, serviceProvider, injector) {
|
|
4059
|
+
const routeData = getRouteData(injector);
|
|
4060
|
+
return !routeData?.tableviewActions || routeData.tableviewActions.hasEdit ? ActionEditorEditDescriptor.createWithProvider(descriptor, serviceProvider) : null;
|
|
4061
|
+
}
|
|
4062
|
+
function tableviewEditOnDetailsAction(descriptor, editDescriptor, injector) {
|
|
4063
|
+
const routeData = getRouteData(injector);
|
|
4064
|
+
if (routeData?.tableviewActions && !routeData.tableviewActions.hasEdit) {
|
|
4065
|
+
return null;
|
|
4066
|
+
}
|
|
4067
|
+
const action = editDescriptor ? ActionLinkDescriptor.fromAction(editDescriptor) : ActionLinkDescriptor.fromModel(descriptor, ActionEditorEditDescriptorInst.ACTION_NAME);
|
|
4068
|
+
action
|
|
4069
|
+
.withTableviewCategory(TableviewActionDefaultCategories.EDIT)
|
|
4070
|
+
.withPositionTableviewCategories([TableviewActionDefaultCategories.DETAILS])
|
|
4071
|
+
.withPosition(ActionPositionEnum.FooterLeft)
|
|
4072
|
+
.withRouterLink('./edit');
|
|
4073
|
+
action.button.styleClass.withActionLevel(StyleLevelEnum.Secondary);
|
|
4074
|
+
action.button.styleClass.withSize(StyleSizeEnum.Normal);
|
|
4075
|
+
action.button.styleClass.withRoundedButton(ButtonStyleRoundedEnum.DEFAULT);
|
|
4076
|
+
action.button.withLabel();
|
|
4077
|
+
if (!editDescriptor)
|
|
4078
|
+
action.button.withIcon('pi pi-pencil');
|
|
4079
|
+
return action;
|
|
4080
|
+
}
|
|
4081
|
+
function tableviewDeleteAction(descriptor, injector) {
|
|
4082
|
+
const routeData = getRouteData(injector);
|
|
4083
|
+
return !routeData?.tableviewActions || routeData.tableviewActions.hasDelete ? ActionDeleteDescriptor.create(descriptor) : null;
|
|
4084
|
+
}
|
|
4085
|
+
function tableviewDeleteActionWithProvider(descriptor, serviceProvider, injector) {
|
|
4086
|
+
const routeData = getRouteData(injector);
|
|
4087
|
+
return !routeData?.tableviewActions || routeData.tableviewActions.hasDelete ? ActionDeleteDescriptor.createWithProvider(descriptor, serviceProvider) : null;
|
|
4088
|
+
}
|
|
4089
|
+
function tableviewDeleteOnDetailsAction(model, injector) {
|
|
4090
|
+
const action = tableviewDeleteAction(model, injector);
|
|
4091
|
+
const dataProviderExecutor = getInjector(injector)?.get(DataProviderExecutor);
|
|
4092
|
+
if (action) {
|
|
4093
|
+
action
|
|
4094
|
+
.withTableviewCategory(TableviewActionDefaultCategories.DELETE)
|
|
4095
|
+
.withPositionTableviewCategories([TableviewActionDefaultCategories.DETAILS])
|
|
4096
|
+
.withPosition(ActionPositionEnum.FooterLeft)
|
|
4097
|
+
.withRunFunction(ctx => dataProviderExecutor
|
|
4098
|
+
? dataProviderExecutor.runDeleteOrFail(ctx).pipe(tap(() => {
|
|
4099
|
+
ctx.viewContainer?.reloadTable({});
|
|
4100
|
+
ctx.viewContainer?.closeEditor();
|
|
4101
|
+
}))
|
|
4102
|
+
: null);
|
|
4103
|
+
action.button.withLabel(undefined);
|
|
4104
|
+
action.button.styleClass.withSize(StyleSizeEnum.Normal);
|
|
4105
|
+
return action;
|
|
4106
|
+
}
|
|
4107
|
+
return null;
|
|
4108
|
+
}
|
|
4109
|
+
function tableviewExportAction(descriptor, injector, defaultActions) {
|
|
4110
|
+
const exportAction = ActionDescriptor.fromModel(descriptor.model, 'export')
|
|
4111
|
+
.withButtonDescriptor(new ActionButtonDescriptor().withIcon('pi pi-download'))
|
|
4112
|
+
.withSubactionsAsMenu();
|
|
4113
|
+
const subactions = [];
|
|
4114
|
+
if (defaultActions == null || defaultActions.includes(TableviewDefaultActionsEnum.ExportJson))
|
|
4115
|
+
subactions.push(tableviewExportJsonAction(descriptor, injector));
|
|
4116
|
+
if (defaultActions == null || defaultActions.includes(TableviewDefaultActionsEnum.ExportCsv))
|
|
4117
|
+
subactions.push(tableviewExportCsvAction(descriptor, injector));
|
|
4118
|
+
exportAction.withSubactions(...subactions);
|
|
4119
|
+
return exportAction;
|
|
4120
|
+
}
|
|
4121
|
+
function tableviewExportJsonAction(descriptor, injector) {
|
|
4122
|
+
const dataProviderExecutor = getInjector(injector)?.get(DataProviderExecutor);
|
|
4123
|
+
return ActionDescriptor.fromModel(descriptor.model, 'exportJson')
|
|
4124
|
+
.withRunFunction(ctx => {
|
|
4125
|
+
const params = ctx.parameters.dataListParams ? copyDataListParams(ctx.parameters.dataListParams) : {};
|
|
4126
|
+
params.offset = 0;
|
|
4127
|
+
params.limit = 500;
|
|
4128
|
+
ctx.parameters.dataListParams = params;
|
|
4129
|
+
return dataProviderExecutor
|
|
4130
|
+
? dataProviderExecutor.runGetAllOrFail(ctx).pipe(map(res => {
|
|
4131
|
+
const blob = new Blob([JSON.stringify(res.data, undefined, 4)], { type: 'application/json;charset=utf-8' });
|
|
4132
|
+
const typeName = ctx.instance.action.model?.typeName ?? '';
|
|
4133
|
+
saveFileAs(blob, `${typeName ? typeName + '_' : ''}${ctx.instance.action.actionName}.json`);
|
|
4134
|
+
return undefined;
|
|
4135
|
+
}))
|
|
4136
|
+
: ctx.parameters.item;
|
|
4137
|
+
})
|
|
4138
|
+
.withButtonDescriptor(new ActionButtonDescriptor().withIcon('pi pi-code'))
|
|
4139
|
+
.withPosition(ActionPositionEnum.ToolbarRight);
|
|
4140
|
+
}
|
|
4141
|
+
function tableviewExportCsvAction(descriptor, injector) {
|
|
4142
|
+
const dataProviderExecutor = getInjector(injector)?.get(DataProviderExecutor);
|
|
4143
|
+
return ActionDescriptor.fromModel(descriptor.model, 'exportCsv')
|
|
4144
|
+
.withRunFunction(ctx => {
|
|
4145
|
+
const params = ctx.parameters.dataListParams ? copyDataListParams(ctx.parameters.dataListParams) : {};
|
|
4146
|
+
params.offset = 0;
|
|
4147
|
+
params.limit = 500;
|
|
4148
|
+
ctx.parameters.dataListParams = params;
|
|
4149
|
+
return dataProviderExecutor
|
|
4150
|
+
? dataProviderExecutor.runGetAllOrFail(ctx).pipe(map(res => {
|
|
4151
|
+
if (!res.data) {
|
|
4152
|
+
return undefined;
|
|
4153
|
+
}
|
|
4154
|
+
const blob = new Blob([convertDataToStringWithDelimiter(res.data, ',', descriptor, ctx.injector.get(TranslateService))], {
|
|
4155
|
+
type: 'text/csv;charset=utf-8'
|
|
4156
|
+
});
|
|
4157
|
+
const typeName = ctx.instance.action.model?.typeName ?? '';
|
|
4158
|
+
saveFileAs(blob, `${typeName ? typeName + '_' : ''}${ctx.instance.action.actionName}.csv`);
|
|
4159
|
+
return undefined;
|
|
4160
|
+
}))
|
|
4161
|
+
: ctx.parameters.item;
|
|
4162
|
+
})
|
|
4163
|
+
.withButtonDescriptor(new ActionButtonDescriptor().withIcon('pi pi-file'))
|
|
4164
|
+
.withPosition(ActionPositionEnum.ToolbarRight);
|
|
4165
|
+
}
|
|
4166
|
+
function tableviewRefreshAction(descriptor) {
|
|
4167
|
+
const action = ActionDescriptor.fromModel(descriptor, 'refresh')
|
|
4168
|
+
.withPosition(ActionPositionEnum.ToolbarRight)
|
|
4169
|
+
.withTableviewCategory(TableviewActionDefaultCategories.READ)
|
|
4170
|
+
.withRunNotificationSuccess(undefined, undefined, false)
|
|
4171
|
+
.withRunFunction(ctx => {
|
|
4172
|
+
ctx.viewContainer?.reloadTable({});
|
|
4173
|
+
return of(null);
|
|
4174
|
+
});
|
|
4175
|
+
action.button.withIcon('pi pi-refresh').styleClass.withActionLevel(StyleLevelEnum.Secondary);
|
|
4176
|
+
return action;
|
|
4177
|
+
}
|
|
4178
|
+
function tableviewLocalizationLanguageSelectAction(descriptor) {
|
|
4179
|
+
return descriptor.isLocalized()
|
|
4180
|
+
? ActionDescriptor.fromModel(descriptor.model, 'translator').withPosition(ActionPositionEnum.ToolbarLeft).withComponentFromDi(DATA_LANGUAGE_DROPDOWN_COMPONENT_IT)
|
|
4181
|
+
: null;
|
|
4182
|
+
}
|
|
4183
|
+
|
|
4184
|
+
/**
|
|
4185
|
+
* The `TableviewBuilder` class is used to build a tableview configuration.
|
|
4186
|
+
* It allows you to set various options such as the descriptor, data provider,
|
|
4187
|
+
* default actions, and custom actions for the tableview.
|
|
4188
|
+
*
|
|
4189
|
+
* @typeparam Model - The main model type.
|
|
4190
|
+
* @typeparam Service - The API service type.
|
|
4191
|
+
* @typeparam Descriptor - The descriptor type.
|
|
4192
|
+
* @typeparam DataProvider - The data provider type.
|
|
4193
|
+
* @typeparam Sorts - The sort type representing available sort keys.
|
|
4194
|
+
* @typeparam Filters - The filter type representing available filter keys.
|
|
4195
|
+
*/
|
|
4196
|
+
class TableviewInputBuilder {
|
|
4197
|
+
constructor(_descriptor, _dataProvider, injector) {
|
|
4198
|
+
this._descriptor = _descriptor;
|
|
4199
|
+
this._dataProvider = _dataProvider;
|
|
4200
|
+
this.injector = injector;
|
|
4201
|
+
this.defaultActions = getTableviewDefaultActions().map(a => ({ type: a, descriptor: undefined }));
|
|
4202
|
+
this._customActions = [];
|
|
4203
|
+
}
|
|
4204
|
+
prepareSetterParams() {
|
|
4205
|
+
return { descriptor: this._descriptor, dataProvider: this._dataProvider, injector: this.injector };
|
|
4206
|
+
}
|
|
4207
|
+
/**
|
|
4208
|
+
* Sets a descriptor instead of the default one.
|
|
4209
|
+
*
|
|
4210
|
+
* @param {TvBuilderDescriptorSetterFnType<Descriptor, DataProvider>} fn - The function that returns the new descriptor. It should accept a single parameter of type `TvBuilderSetterParamsType<Descriptor, DataProvider>`.
|
|
4211
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
4212
|
+
*/
|
|
4213
|
+
withDescriptor(fn) {
|
|
4214
|
+
this._descriptor = fn(this.prepareSetterParams());
|
|
4215
|
+
return this;
|
|
4216
|
+
}
|
|
4217
|
+
/**
|
|
4218
|
+
* Adjusts the descriptor using the provided adjust function.
|
|
4219
|
+
*
|
|
4220
|
+
* @param {(descriptor: Descriptor) => void} adjustFn - The function used to adjust the descriptor. It accepts a single parameter of type `Descriptor`.
|
|
4221
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
4222
|
+
*/
|
|
4223
|
+
withAdjustDescriptor(adjustFn) {
|
|
4224
|
+
adjustFn(this._descriptor);
|
|
4225
|
+
return this;
|
|
4226
|
+
}
|
|
4227
|
+
/**
|
|
4228
|
+
* Sets the data provider for the TvBuilder instance
|
|
4229
|
+
*
|
|
4230
|
+
* @param {TvBuilderDataProviderSetterFnType<Descriptor, DataProvider>} fn - The function that returns the new data provider. It accepts a single parameter of type `TvBuilderSetterParamsType<Descriptor, DataProvider>`.
|
|
4231
|
+
* * @returns {this} - Returns the current instance of the builder.
|
|
4232
|
+
*/
|
|
4233
|
+
withDataProvider(fn) {
|
|
4234
|
+
this._dataProvider = fn(this.prepareSetterParams());
|
|
4235
|
+
return this;
|
|
4236
|
+
}
|
|
4237
|
+
/**
|
|
4238
|
+
* Adjusts the data provider using the provided adjust function.
|
|
4239
|
+
*
|
|
4240
|
+
* @param {(dataProvider: DataProvider) => void} adjustFn - The function used to adjust the data provider. It accepts a single parameter of type `DataProvider`.
|
|
4241
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
4242
|
+
*/
|
|
4243
|
+
withAdjustDataProvider(adjustFn) {
|
|
4244
|
+
adjustFn(this._dataProvider);
|
|
4245
|
+
return this;
|
|
4246
|
+
}
|
|
4247
|
+
/**
|
|
4248
|
+
* Adjusts the data provider and/or descriptor using the provided adjust function.
|
|
4249
|
+
*
|
|
4250
|
+
* @param {(params: TvBuilderSetterParamsType<Descriptor, DataProvider>) => void} adjustFn - The function used to adjust the data provider. It accepts a single parameter of type `TvBuilderSetterParamsType<Descriptor, DataProvider>`.
|
|
4251
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
4252
|
+
*/
|
|
4253
|
+
withAdjust(adjustFn) {
|
|
4254
|
+
adjustFn(this.prepareSetterParams());
|
|
4255
|
+
return this;
|
|
4256
|
+
}
|
|
4257
|
+
/**
|
|
4258
|
+
* Removes all the default tableview actions.
|
|
4259
|
+
*
|
|
4260
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
4261
|
+
*/
|
|
4262
|
+
withNoDefaultActions() {
|
|
4263
|
+
this.defaultActions.forEach(a => (a.descriptor = null));
|
|
4264
|
+
return this;
|
|
4265
|
+
}
|
|
4266
|
+
/**
|
|
4267
|
+
* Adds the default actions specified in parameters.
|
|
4268
|
+
*
|
|
4269
|
+
* @param {TableviewDefaultActionsEnum[]} types - The default actions to add.
|
|
4270
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
4271
|
+
*/
|
|
4272
|
+
withDefaultActions(...types) {
|
|
4273
|
+
types.forEach(type => {
|
|
4274
|
+
const action = this.defaultActions.find(a => a.type === type);
|
|
4275
|
+
if (action?.descriptor === null) {
|
|
4276
|
+
action.descriptor = undefined;
|
|
4277
|
+
}
|
|
4278
|
+
});
|
|
4279
|
+
return this;
|
|
4280
|
+
}
|
|
4281
|
+
/**
|
|
4282
|
+
* Removes the default actions specified in parameters.
|
|
4283
|
+
*
|
|
4284
|
+
* @param {TableviewDefaultActionsEnum[]} types - The default actions to remove.
|
|
4285
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
4286
|
+
*/
|
|
4287
|
+
withoutDefaultActions(...types) {
|
|
4288
|
+
types.forEach(type => {
|
|
4289
|
+
const action = this.defaultActions.find(a => a.type === type);
|
|
4290
|
+
if (action) {
|
|
4291
|
+
action.descriptor = null;
|
|
4292
|
+
}
|
|
4293
|
+
});
|
|
4294
|
+
return this;
|
|
4295
|
+
}
|
|
4296
|
+
/**
|
|
4297
|
+
* Overrides the default action.
|
|
4298
|
+
*
|
|
4299
|
+
* @param {TableviewDefaultActionsEnum} type - The default actions to override.
|
|
4300
|
+
* @param {TvBuilderActionSetterFnType<Model, ActionService, Descriptor, DataProvider>} fn - The function that returns the new action descriptor. It accepts a single parameter of type `TvBuilderSetterParamsType<Descriptor, DataProvider>`.
|
|
4301
|
+
* @typeParam ActionService - The service type (same as build `Service` by default).
|
|
4302
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
4303
|
+
*/
|
|
4304
|
+
withDefaultActionOverride(type, fn) {
|
|
4305
|
+
const action = this.defaultActions.find(a => a.type === type);
|
|
4306
|
+
if (action) {
|
|
4307
|
+
action.descriptor = fn(this.prepareSetterParams()) ?? null;
|
|
4308
|
+
}
|
|
4309
|
+
return this;
|
|
4310
|
+
}
|
|
4311
|
+
/**
|
|
4312
|
+
* Adds a custom action.
|
|
4313
|
+
*
|
|
4314
|
+
* @param {TvBuilderActionSetterFnType<Model, ActionService, Descriptor, DataProvider>} fn - The function that returns the new action descriptor. It accepts a single parameter of type `TvBuilderSetterParamsType<Descriptor, DataProvider>`.
|
|
4315
|
+
* @typeParam ActionService - The service type (same as build `Service` by default).
|
|
4316
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
4317
|
+
*/
|
|
4318
|
+
withAction(fn) {
|
|
4319
|
+
const action = fn(this.prepareSetterParams());
|
|
4320
|
+
if (action) {
|
|
4321
|
+
this._customActions.push(action);
|
|
4322
|
+
}
|
|
4323
|
+
return this;
|
|
4324
|
+
}
|
|
4325
|
+
/**
|
|
4326
|
+
* Builds and returns an instance of ITableview.
|
|
4327
|
+
* DO NOT CALL this within tableview create callback function!
|
|
4328
|
+
*
|
|
4329
|
+
* @return {ITableview<Model, Service, Sorts, Filters, Descriptor, DataProvider>} - The built ITableview instance.
|
|
4330
|
+
*/
|
|
4331
|
+
build() {
|
|
4332
|
+
return {
|
|
4333
|
+
actions: createTableviewActions(this._descriptor, this.defaultActions.filter(a => a.descriptor !== null).map(a => a.type), this.defaultActions
|
|
4334
|
+
.filter(a => a.descriptor != null)
|
|
4335
|
+
.reduce((acc, a) => ({
|
|
4336
|
+
...acc,
|
|
4337
|
+
[a.type]: a.descriptor
|
|
4338
|
+
}), {}), this.injector).concat(this._customActions),
|
|
4339
|
+
dataProvider: this._dataProvider,
|
|
4340
|
+
descriptor: this._descriptor
|
|
4341
|
+
};
|
|
4342
|
+
}
|
|
4343
|
+
}
|
|
4344
|
+
|
|
4345
|
+
/**
|
|
4346
|
+
* Creates a tableview with the given model, service.
|
|
4347
|
+
*
|
|
4348
|
+
* @param {ModelDescriptor<Model>} model - The model descriptor.
|
|
4349
|
+
* @param {ServiceClassType<Service>} service - The class type of the service.
|
|
4350
|
+
* @param {(builder: TableviewBuilder) => void} [buildFn] - The optional callback function to customize the tableview using the prepared builder.
|
|
4351
|
+
*
|
|
4352
|
+
* @returns A tableview instance with descriptor, data provider and actions.
|
|
4353
|
+
*/
|
|
4354
|
+
function tableview(model, service, buildFn) {
|
|
4355
|
+
const builder = new TableviewInputBuilder(TableviewDescriptor.fromModel(model), TableviewDataProvider.fromService(service), inject(Injector));
|
|
4356
|
+
buildFn?.(builder);
|
|
4357
|
+
return builder.build();
|
|
4358
|
+
}
|
|
4359
|
+
function tableviewWithSortAndFilter(model, service, sorts, filters, buildFn) {
|
|
4360
|
+
const builder = new TableviewInputBuilder(TableviewDescriptor.fromModel(model), TableviewDataProvider.fromService(service), inject(Injector));
|
|
4361
|
+
buildFn?.(builder);
|
|
4362
|
+
return builder.build();
|
|
4363
|
+
}
|
|
4364
|
+
|
|
4365
|
+
// action descriptors
|
|
4366
|
+
|
|
4367
|
+
/**
|
|
4368
|
+
* Generated bundle index. Do not edit.
|
|
4369
|
+
*/
|
|
4370
|
+
|
|
4371
|
+
export { AFieldDescriptor, AFieldGroupDescriptor, AFormlyCustomFieldComponent, AGenericFieldDescriptor, ActionActivationTriggerEnum, ActionConfirmationDescriptor, ActionDeleteDescriptor, ActionDeleteDescriptorInst, ActionDescriptor, ActionDescriptorInst, ActionEditorAddDescriptor, ActionEditorAddDescriptorInst, ActionEditorDescriptor, ActionEditorDescriptorInst, ActionEditorDetailsDescriptor, ActionEditorDetailsDescriptorInst, ActionEditorEditDescriptor, ActionEditorEditDescriptorInst, ActionEditorSubmitDescriptor, ActionEditorSubmitDescriptorInst, ActionEditorSubmitTypeEnum, ActionInstanceStateEnum, ActionLinkDescriptor, ActionLinkDescriptorInst, ActionPositionEnum, ActionTypeEnum, CommonsActionError, DATA_LANGUAGE_DROPDOWN_COMPONENT_IT, DataProviderExecutor, DynamicTableviewDataProvider, DynamicTableviewDataProviderInst, EDITOR_DEFAULT_GROUP_NAME, EditorDataProvider, EditorDataProviderInst, EditorDescriptor, EditorDescriptorInst, FieldActionDescriptor, FieldGroupDescriptor, FieldGroupTypeEnum, FieldInputDescriptor, FieldInputTypeEnum, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldLookupTypeEnum, FieldManyEditorActionEnum, FieldManyEditorDescriptor, FieldManyEditorTypeEnum, FieldManyToManyEditorActionEnum, FieldManyToManyEditorDescriptor, FieldManyToManyEditorTypeEnum, FieldSizeEnum, FieldTabGroupDescriptor, FieldValidationDescriptor, FormEventTypeEnum, FormFieldEventComponentSubtype, FormFieldEventDialogSubtype, FormFieldEventTypeEnum, TableviewActionDefaultCategories, TableviewDataProvider, TableviewDataProviderInst, TableviewDefaultActionsEnum, TableviewDescriptor, TableviewDescriptorInst, TableviewDynamicDescriptor, TableviewDynamicDescriptorInt, TableviewEditorTypeEnum, TableviewInputBuilder, actionEditorGetProviderCfgObj, actionGetProviderCfgObj, convertDataToStringWithDelimiter, createTableviewAction, createTableviewActions, expandClassAttributeDefWithEditorDef, expandClassAttributeDefWithTableviewDef, fieldLookupGetProviderCfgObj, fieldManyToManyGetProviderCfgObj, getDataProviderService, getEditorClassAttributeDef, getFieldInputTypeFromClassAttributeDefType, getFieldInputTypeFromColumnType, getTableviewClassAttributeDef, getTableviewDefaultActions, maxDateValidator, minDateValidator, runCreateFromDataProvider, runDeleteFromDataProvider, runFetchFromDataProvider, runFnFromDataProviderOrFail, runFnFromDataProviderOrFallback, runGetAllFromDataProvider, runUpdateFromDataProvider, saveFileAs, tableview, tableviewAddAction, tableviewAddActionWithProvider, tableviewDeleteAction, tableviewDeleteActionWithProvider, tableviewDeleteOnDetailsAction, tableviewDetailsAction, tableviewDetailsActionWithProvider, tableviewEditAction, tableviewEditActionWithProvider, tableviewEditOnDetailsAction, tableviewExportAction, tableviewExportCsvAction, tableviewExportJsonAction, tableviewLocalizationLanguageSelectAction, tableviewRefreshAction, tableviewWithSortAndFilter };
|
|
4372
|
+
//# sourceMappingURL=mediusinc-mng-commons-tableview-api.mjs.map
|