@mediusinc/mng-commons 6.2.0-rc.0 → 7.0.0-rc.0
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/core/index.d.ts +1743 -84
- package/fesm2022/mediusinc-mng-commons-core.mjs +104 -87
- package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form.mjs +97 -97
- package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-model-class.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table-api-class.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table-column-toggle.component-Dvenjj9n.mjs +30 -0
- package/fesm2022/mediusinc-mng-commons-table-column-toggle.component-Dvenjj9n.mjs.map +1 -0
- package/fesm2022/{mediusinc-mng-commons-table-mediusinc-mng-commons-table-8TdW6NCC.mjs → mediusinc-mng-commons-table-mediusinc-mng-commons-table-DFcdSUCN.mjs} +183 -186
- package/fesm2022/mediusinc-mng-commons-table-mediusinc-mng-commons-table-DFcdSUCN.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons-table.mjs +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api-class.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +3 -3
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview.mjs +305 -289
- package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons.mjs.map +1 -1
- package/filter/index.d.ts +398 -5
- package/form/api/index.d.ts +134 -7
- package/form/index.d.ts +301 -6
- package/index.d.ts +11 -1
- package/model/class/index.d.ts +25 -4
- package/model/index.d.ts +71 -5
- package/package.json +10 -10
- package/table/api/class/index.d.ts +77 -5
- package/table/api/index.d.ts +1161 -14
- package/table/index.d.ts +545 -17
- package/tableview/api/class/index.d.ts +141 -10
- package/tableview/api/index.d.ts +2542 -63
- package/tableview/index.d.ts +1274 -54
- package/version-info.json +5 -5
- package/core/action/action-data.model.d.ts +0 -3
- package/core/action/action-parameters.model.d.ts +0 -44
- package/core/components/notification/notification-wrapper.component.d.ts +0 -14
- package/core/data-list/data-list-params-helpers.d.ts +0 -93
- package/core/data-list/data-list.model.d.ts +0 -28
- package/core/data-list/filter-match.model.d.ts +0 -36
- package/core/data-list/filter-metadata.model.d.ts +0 -20
- package/core/data-providers/base.data-provider.d.ts +0 -17
- package/core/data-providers/lookup.data-provider.d.ts +0 -10
- package/core/descriptors/action.descriptor.d.ts +0 -12
- package/core/descriptors/column.descriptor.d.ts +0 -3
- package/core/descriptors/editor.descriptor.d.ts +0 -11
- package/core/descriptors/enum.descriptor.d.ts +0 -6
- package/core/descriptors/filter.descriptor.d.ts +0 -3
- package/core/descriptors/lookup.descriptor.d.ts +0 -12
- package/core/descriptors/model.descriptor.d.ts +0 -5
- package/core/descriptors/table.descriptor.d.ts +0 -11
- package/core/descriptors/tableview.descriptor.d.ts +0 -11
- package/core/directives/component.directive.d.ts +0 -18
- package/core/directives/rerender.directive.d.ts +0 -9
- package/core/directives/template.directive.d.ts +0 -8
- package/core/enum/enum-helpers.d.ts +0 -54
- package/core/enum/enum.model.d.ts +0 -8
- package/core/error/error-handler.d.ts +0 -6
- package/core/error/error-helpers.d.ts +0 -136
- package/core/error/error.model.d.ts +0 -53
- package/core/helpers/coercion.d.ts +0 -10
- package/core/helpers/date.d.ts +0 -14
- package/core/helpers/notification.d.ts +0 -18
- package/core/helpers/number.d.ts +0 -5
- package/core/helpers/object.d.ts +0 -27
- package/core/helpers/route.d.ts +0 -34
- package/core/helpers/string.d.ts +0 -7
- package/core/helpers/templates.d.ts +0 -3
- package/core/helpers/type-helpers.d.ts +0 -37
- package/core/i18n/i18n-common.d.ts +0 -6
- package/core/i18n/i18n-error.d.ts +0 -3
- package/core/i18n/i18n-type.d.ts +0 -11
- package/core/log/log-publisher-console.service.d.ts +0 -4
- package/core/log/log.model.d.ts +0 -40
- package/core/log/logger.service.d.ts +0 -33
- package/core/models/class-attribute.model.d.ts +0 -6
- package/core/models/class-service.model.d.ts +0 -7
- package/core/models/getter.model.d.ts +0 -2
- package/core/models/i18n.model.d.ts +0 -1
- package/core/models/menu.model.d.ts +0 -42
- package/core/models/user.model.d.ts +0 -8
- package/core/models/version.model.d.ts +0 -31
- package/core/pipes/boolean.pipe.d.ts +0 -7
- package/core/pipes/class-map.pipe.d.ts +0 -7
- package/core/pipes/enum.pipe.d.ts +0 -8
- package/core/pipes/enumerate-async.pipe.d.ts +0 -9
- package/core/pipes/enumerate.pipe.d.ts +0 -16
- package/core/pipes/getter.pipe.d.ts +0 -8
- package/core/pipes/i18n-property.pipe.d.ts +0 -8
- package/core/pipes/json-path.pipe.d.ts +0 -13
- package/core/pipes/parametrize.pipe.d.ts +0 -16
- package/core/pipes/template.pipe.d.ts +0 -8
- package/core/provide.d.ts +0 -13
- package/core/reactivity/effect.d.ts +0 -16
- package/core/reflect/type-enum-decorator.d.ts +0 -2
- package/core/reflect/type-enum-metadata.d.ts +0 -32
- package/core/registry/registry.model.d.ts +0 -8
- package/core/registry/type-registry.d.ts +0 -27
- package/core/router/route-builder.d.ts +0 -187
- package/core/router/router.model.d.ts +0 -13
- package/core/router/routes-builder.d.ts +0 -33
- package/core/rxjs/map-data-list-result-operator.d.ts +0 -9
- package/core/security/permission-helpers.d.ts +0 -3
- package/core/security/permission.guard.d.ts +0 -2
- package/core/security/permission.service.d.ts +0 -25
- package/core/security/permissions.model.d.ts +0 -82
- package/core/services/commons-configuration.service.d.ts +0 -81
- package/core/services/commons-init.service.d.ts +0 -30
- package/core/services/commons-router.service.d.ts +0 -37
- package/core/services/commons-storage.service.d.ts +0 -12
- package/core/services/commons.service.d.ts +0 -47
- package/core/services/providers/commons-init.provider.d.ts +0 -4
- package/core/services/tokens/browser-storage.token.d.ts +0 -2
- package/core/services/tokens/commons-init.token.d.ts +0 -3
- package/core/services/tokens/log-publisher.token.d.ts +0 -3
- package/core/services/tokens/module-config.token.d.ts +0 -28
- package/core/styles/style-constants.d.ts +0 -11
- package/core/styles/style.model.d.ts +0 -18
- package/fesm2022/mediusinc-mng-commons-table-column-toggle.component-CCyGSxaD.mjs +0 -30
- package/fesm2022/mediusinc-mng-commons-table-column-toggle.component-CCyGSxaD.mjs.map +0 -1
- package/fesm2022/mediusinc-mng-commons-table-mediusinc-mng-commons-table-8TdW6NCC.mjs.map +0 -1
- package/filter/descriptors/filter-generic.descriptor.d.ts +0 -14
- package/filter/descriptors/filter-lookup.descriptor.d.ts +0 -97
- package/filter/descriptors/filter.descriptor.d.ts +0 -264
- package/filter/models/filter-generic-property.model.d.ts +0 -7
- package/filter/models/filter.model.d.ts +0 -16
- package/form/api/data-providers/lookup-data-provider.factory.d.ts +0 -19
- package/form/api/data-providers/lookup.data-provider.d.ts +0 -7
- package/form/api/descriptors/action-button.descriptor.d.ts +0 -23
- package/form/api/descriptors/button-style.builder.d.ts +0 -54
- package/form/api/models/button.model.d.ts +0 -19
- package/form/api/models/empty-value.model.d.ts +0 -7
- package/form/api/models/trim.model.d.ts +0 -1
- package/form/components/autocomplete/autocomplete.component.d.ts +0 -99
- package/form/components/date-range/date-range.component.d.ts +0 -37
- package/form/components/dropdown/dropdown.component.d.ts +0 -89
- package/form/components/number-range/number-range.component.d.ts +0 -35
- package/form/directives/input-empty-value.directive.d.ts +0 -40
- package/form/directives/input-trim.directive.d.ts +0 -9
- package/model/class/data-providers/base-from-class-data-provider.factory.d.ts +0 -3
- package/model/class/descriptors/model-class.descriptor.d.ts +0 -12
- package/model/class/descriptors/type-class.descriptor.d.ts +0 -3
- package/model/class/helpers/model.d.ts +0 -4
- package/model/data-providers/base-from-type-data-provider.factory.d.ts +0 -15
- package/model/descriptors/enum.descriptor.d.ts +0 -13
- package/model/descriptors/model.descriptor.d.ts +0 -25
- package/model/descriptors/type.descriptor.d.ts +0 -3
- package/model/helpers/i18n.d.ts +0 -13
- package/provide.d.ts +0 -7
- package/table/api/class/class-table-attribute-converter.d.ts +0 -15
- package/table/api/class/class-table-attribute.model.d.ts +0 -8
- package/table/api/class/class-table-data-provider.factory.d.ts +0 -4
- package/table/api/class/class-table-descriptor-helpers.d.ts +0 -42
- package/table/api/class/class-table-descriptor.factory.d.ts +0 -11
- package/table/api/data-providers/table-data-provider.factory.d.ts +0 -19
- package/table/api/data-providers/table.data-provider.d.ts +0 -27
- package/table/api/descriptors/column.descriptor.d.ts +0 -269
- package/table/api/descriptors/sort.descriptor.d.ts +0 -39
- package/table/api/descriptors/table-descriptor.factory.d.ts +0 -12
- package/table/api/descriptors/table.descriptor.d.ts +0 -672
- package/table/api/helpers/column-converter.d.ts +0 -7
- package/table/api/helpers/table-data-provider-descriptor-convert.d.ts +0 -20
- package/table/api/models/column-value.model.d.ts +0 -7
- package/table/api/models/column.model.d.ts +0 -18
- package/table/api/models/row-expandable-component.model.d.ts +0 -4
- package/table/api/models/table-columns.model.d.ts +0 -42
- package/table/api/models/table-event.model.d.ts +0 -18
- package/table/api/models/table.model.d.ts +0 -22
- package/table/components/column-filter/column-filter.component.d.ts +0 -81
- package/table/components/column-toggle/column-toggle.component.d.ts +0 -12
- package/table/components/column-value/column-value.component.d.ts +0 -33
- package/table/components/filter/filter-active-tag/filter-active-tag.component.d.ts +0 -20
- package/table/components/filter/filter-form/filter-form.component.d.ts +0 -56
- package/table/components/filter/filter-overlay-with-tag/filter-overlay-with-tag.component.d.ts +0 -54
- package/table/components/table/table.component.d.ts +0 -83
- package/table/helpers/filters.d.ts +0 -37
- package/table/helpers/notification.d.ts +0 -13
- package/table/helpers/table-layout-prefs.d.ts +0 -7
- package/table/helpers/table.d.ts +0 -6
- package/table/models/column-preferences.model.d.ts +0 -12
- package/table/models/filter.model.d.ts +0 -36
- package/table/pipes/filter-value.pipe.d.ts +0 -19
- package/table/pipes/locale-default-row-class.pipe.d.ts +0 -10
- package/table/pipes/table-column-filter-class.pipe.d.ts +0 -8
- package/table/provide.d.ts +0 -15
- package/table/services/table-data.service.d.ts +0 -37
- package/table/services/table-feature-config.token.d.ts +0 -7
- package/table/services/table-metadata.service.d.ts +0 -31
- package/table/services/table-preferences.service.d.ts +0 -25
- package/tableview/action/components/action/action.component.d.ts +0 -63
- package/tableview/action/components/editor/action-editor.component.d.ts +0 -32
- package/tableview/action/components/editor/injector-context/action-editor-injector-context.component.d.ts +0 -79
- package/tableview/action/components/localization/data-language-dropdown.component.d.ts +0 -19
- package/tableview/action/components/route/action-route.component.d.ts +0 -26
- package/tableview/action/components/table/action-table.component.d.ts +0 -50
- package/tableview/action/guards/unsaved-changes.guard.d.ts +0 -3
- package/tableview/action/helpers/action-execution.d.ts +0 -7
- package/tableview/action/helpers/i18n.d.ts +0 -47
- package/tableview/action/helpers/inject.d.ts +0 -39
- package/tableview/action/helpers/notification.d.ts +0 -40
- package/tableview/action/helpers/styles.d.ts +0 -5
- package/tableview/action/models/action-editor-dialog-data.model.d.ts +0 -11
- package/tableview/action/models/can-component-deactivate.model.d.ts +0 -4
- package/tableview/action/models/execution/action-context.model.d.ts +0 -43
- package/tableview/action/models/execution/action-instance.model.d.ts +0 -56
- package/tableview/action/services/action-error-mapper.service.d.ts +0 -18
- package/tableview/action/services/action-executor.service.d.ts +0 -174
- package/tableview/action/services/component-action-executor.service.d.ts +0 -9
- package/tableview/action/services/data-provider-executor.service.d.ts +0 -23
- package/tableview/action/services/navigation.service.d.ts +0 -15
- package/tableview/action/services/providers/provide-action-executor.d.ts +0 -2
- package/tableview/action/services/providers/provide-view-container.d.ts +0 -2
- package/tableview/action/services/root-action-executor.service.d.ts +0 -9
- package/tableview/action/services/tokens/action-editor.token.d.ts +0 -2
- package/tableview/action/services/view-container.service.d.ts +0 -25
- package/tableview/api/action/descriptors/action-descriptor.factory.d.ts +0 -25
- package/tableview/api/action/descriptors/action-editor-descriptor.factory.d.ts +0 -24
- package/tableview/api/action/descriptors/action-editor.descriptor.d.ts +0 -105
- package/tableview/api/action/descriptors/action-link-descriptor.factory.d.ts +0 -23
- package/tableview/api/action/descriptors/action-link.descriptor.d.ts +0 -27
- package/tableview/api/action/descriptors/action.descriptor.d.ts +0 -118
- package/tableview/api/action/descriptors/editor-action-descriptor.factory.d.ts +0 -21
- package/tableview/api/action/descriptors/editor-action-editor-descriptor.factory.d.ts +0 -21
- package/tableview/api/action/descriptors/table-action-descriptor.factory.d.ts +0 -36
- package/tableview/api/action/descriptors/table-action-editor-descriptor.factory.d.ts +0 -40
- package/tableview/api/action/helpers/data-provider-executors.d.ts +0 -23
- package/tableview/api/action/models/action-component.model.d.ts +0 -12
- package/tableview/api/action/models/action-confirmation.model.d.ts +0 -16
- package/tableview/api/action/models/action-descriptor.types.d.ts +0 -10
- package/tableview/api/action/models/action-editor.model.d.ts +0 -4
- package/tableview/api/action/models/action-error.model.d.ts +0 -14
- package/tableview/api/action/models/action.type.d.ts +0 -21
- package/tableview/api/action/models/execution/action-context-validation.model.d.ts +0 -11
- package/tableview/api/action/models/execution/action-context.model.d.ts +0 -25
- package/tableview/api/action/models/execution/action-execution-error.model.d.ts +0 -4
- package/tableview/api/action/models/execution/action-instance-state.model.d.ts +0 -30
- package/tableview/api/action/models/execution/action-instance.model.d.ts +0 -32
- package/tableview/api/action/models/execution/view-container.model.d.ts +0 -22
- package/tableview/api/action/models/tableview-action-default-categories.model.d.ts +0 -10
- package/tableview/api/action/services/data-provider-executor.service.d.ts +0 -39
- package/tableview/api/action/services/tokens/data-language-dropdown.token.d.ts +0 -2
- package/tableview/api/class/editor/class-editor-attribute-converter.d.ts +0 -21
- package/tableview/api/class/editor/class-editor-attribute.model.d.ts +0 -7
- package/tableview/api/class/editor/class-editor-data-provider.factory.d.ts +0 -4
- package/tableview/api/class/editor/class-editor-descriptor-helpers.d.ts +0 -40
- package/tableview/api/class/editor/class-editor-descriptor.factory.d.ts +0 -11
- package/tableview/api/class/tableview/class-tableview-attribute-converter.d.ts +0 -8
- package/tableview/api/class/tableview/class-tableview-attribute.model.d.ts +0 -3
- package/tableview/api/class/tableview/class-tableview-data-provider.factory.d.ts +0 -4
- package/tableview/api/class/tableview/class-tableview-descriptor-helpers.d.ts +0 -41
- package/tableview/api/class/tableview/class-tableview-descriptor.factory.d.ts +0 -12
- package/tableview/api/editor/data-providers/editor-data-provider.factory.d.ts +0 -19
- package/tableview/api/editor/data-providers/editor.data-provider.d.ts +0 -119
- package/tableview/api/editor/descriptors/editor-descriptor.factory.d.ts +0 -11
- package/tableview/api/editor/descriptors/editor.descriptor.d.ts +0 -254
- package/tableview/api/editor/descriptors/field-action.descriptor.d.ts +0 -21
- package/tableview/api/editor/descriptors/field-base.descriptor.d.ts +0 -147
- package/tableview/api/editor/descriptors/field-group.descriptor.d.ts +0 -58
- package/tableview/api/editor/descriptors/field-lookup.descriptor.d.ts +0 -80
- package/tableview/api/editor/descriptors/field-many.descriptor.d.ts +0 -56
- package/tableview/api/editor/descriptors/field-validation.descriptor.d.ts +0 -16
- package/tableview/api/editor/descriptors/field.descriptor.d.ts +0 -239
- package/tableview/api/editor/descriptors/wrappers/editor-descriptor-nested-object-wrapper.d.ts +0 -25
- package/tableview/api/editor/models/editor-fields.model.d.ts +0 -42
- package/tableview/api/editor/models/editor.model.d.ts +0 -7
- package/tableview/api/editor/models/field-action-context.model.d.ts +0 -26
- package/tableview/api/editor/models/field-image-preview.model.d.ts +0 -4
- package/tableview/api/editor/models/field-validation.model.d.ts +0 -26
- package/tableview/api/editor/models/field.model.d.ts +0 -56
- package/tableview/api/editor/models/form-editor.event.d.ts +0 -74
- package/tableview/api/editor/models/form-editor.interface.d.ts +0 -53
- package/tableview/api/editor/models/formly-custom-field.model.d.ts +0 -30
- package/tableview/api/editor/models/formly-field.model.d.ts +0 -42
- package/tableview/api/editor/models/formly-options.model.d.ts +0 -15
- package/tableview/api/editor/models/radio.model.d.ts +0 -6
- package/tableview/api/tableview/data-providers/tableview-data-provider.factory.d.ts +0 -24
- package/tableview/api/tableview/data-providers/tableview.data-provider.d.ts +0 -33
- package/tableview/api/tableview/descriptors/tableview-descriptor.factory.d.ts +0 -23
- package/tableview/api/tableview/descriptors/tableview.descriptor.d.ts +0 -153
- package/tableview/api/tableview/helpers/files-export.d.ts +0 -4
- package/tableview/api/tableview/helpers/tableview-create.d.ts +0 -29
- package/tableview/api/tableview/helpers/tableview-data-provider-descriptor-convert.d.ts +0 -20
- package/tableview/api/tableview/helpers/tableview-default-actions.d.ts +0 -93
- package/tableview/api/tableview/helpers/tableview-input-builder.d.ts +0 -192
- package/tableview/api/tableview/models/tableview-descriptor-fields-manage-helper.type.d.ts +0 -9
- package/tableview/api/tableview/models/tableview-descriptor-helper.type.d.ts +0 -2
- package/tableview/api/tableview/models/tableview-input.model.d.ts +0 -8
- package/tableview/api/tableview/models/tableview-route.model.d.ts +0 -20
- package/tableview/editor/components/editor/auto-save-status/auto-save-status.component.d.ts +0 -10
- package/tableview/editor/components/editor/form-editor.component.d.ts +0 -117
- package/tableview/editor/components/formly/constants.d.ts +0 -1
- package/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.d.ts +0 -15
- package/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.d.ts +0 -11
- package/tableview/editor/components/formly/fields/formly-field-custom/formly-field-custom.component.d.ts +0 -10
- package/tableview/editor/components/formly/fields/formly-field-datepicker/formly-field-datepicker.component.d.ts +0 -24
- package/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.d.ts +0 -10
- package/tableview/editor/components/formly/fields/formly-field-fieldset/formly-field-fieldset.component.d.ts +0 -12
- package/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.d.ts +0 -33
- package/tableview/editor/components/formly/fields/formly-field-label/formly-field-label.component.d.ts +0 -10
- package/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +0 -36
- package/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +0 -22
- package/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +0 -37
- package/tableview/editor/components/formly/fields/formly-field-tabs/formly-field-tabs.component.d.ts +0 -10
- package/tableview/editor/components/formly/fields/formly-field-type.abstract.component.d.ts +0 -11
- package/tableview/editor/components/formly/fields/formly-group-type.abstract.component.d.ts +0 -7
- package/tableview/editor/components/formly/fields/formly-type.abstract.component.d.ts +0 -20
- package/tableview/editor/components/formly/pipes/formly-field-label.pipe.d.ts +0 -8
- package/tableview/editor/components/formly/wrappers/formly-field-no-label-wrapper/formly-field-no-label-wrapper.component.d.ts +0 -18
- package/tableview/editor/components/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.d.ts +0 -16
- package/tableview/editor/helpers/editor-autosave.d.ts +0 -17
- package/tableview/editor/helpers/editor-field.d.ts +0 -2
- package/tableview/editor/helpers/editor-formly.d.ts +0 -11
- package/tableview/editor/helpers/editor-validators.d.ts +0 -7
- package/tableview/editor/helpers/field-create.d.ts +0 -9
- package/tableview/editor/helpers/formly-config.d.ts +0 -18
- package/tableview/editor/helpers/notification.d.ts +0 -4
- package/tableview/editor/models/editor-auto-save-preview.model.d.ts +0 -10
- package/tableview/editor/models/formly-config.model.d.ts +0 -14
- package/tableview/editor/models/formly.model.d.ts +0 -23
- package/tableview/editor/services/form-editor.service.d.ts +0 -39
- package/tableview/editor/services/formly-config.provider.d.ts +0 -5
- package/tableview/provide.d.ts +0 -15
- package/tableview/tableview/components/route/tableview-route.component.d.ts +0 -7
- package/tableview/tableview/components/tableview/tableview.component.d.ts +0 -29
- package/tableview/tableview/router/tableview-route-builder.d.ts +0 -43
- package/tableview/tableview/services/tableview-feature-config.token.d.ts +0 -18
package/tableview/api/index.d.ts
CHANGED
|
@@ -1,63 +1,2542 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InputSignal, OutputEmitterRef, Type, InputSignalWithTransform, WritableSignal, Injector, InjectionToken } from '@angular/core';
|
|
3
|
+
import * as _mediusinc_mng_commons_core from '@mediusinc/mng-commons/core';
|
|
4
|
+
import { IdType, ActionData, ActionParameters, GetterFn, StyleLevelEnum, ServiceClassType, ILookupDataProvider, ILookupDescriptor, LookupDataProviderLookupFnType, EnumValue, EnumConstantType, ItemOrObservable, ArrayItemType, ITableviewDescriptor, ITableDescriptor, CommonPropsObjType3, IEditorDescriptor, IDataProvider, Nullable, IActionDescriptor, APermissions, ClassType, ServiceClassOptType, Undefined, DataProviderInst, StyleSizeEnum, DataListResult, CommonsErrorBaseOptions, ACommonsErrorBase, ICommonsActionError, ClassFunctionKeysWithParamAndReturnType, ClassFunctionKeyParam1ObjKeyExtendsOfTargetType, CommonsRouteData } from '@mediusinc/mng-commons/core';
|
|
5
|
+
import { IActionButtonDescriptor, InputTrimType, EmptyValueType } from '@mediusinc/mng-commons/form/api';
|
|
6
|
+
import { EnumDescriptor, TypeDescriptor, ModelDescriptor, ModelDescriptorCreateOpts } from '@mediusinc/mng-commons/model';
|
|
7
|
+
import { ToastMessageOptions, Confirmation } from 'primeng/api';
|
|
8
|
+
import * as rxjs from 'rxjs';
|
|
9
|
+
import { Observable, Subject } from 'rxjs';
|
|
10
|
+
import { DynamicDialogRef } from 'primeng/dynamicdialog';
|
|
11
|
+
import * as _mediusinc_mng_commons_table_api from '@mediusinc/mng-commons/table/api';
|
|
12
|
+
import { TableDescriptorInst, ITableDataProvider, TableDataProviderGetAllFnType, IColumnsManageInterface, ColumnDescriptor, TableDynamicDescriptorInst, TableReloadEvent, TableDataProviderInst, TableDataProviderGetAllEagerFnType } from '@mediusinc/mng-commons/table/api';
|
|
13
|
+
import { AbstractControl, FormGroup, FormControl, UntypedFormGroup } from '@angular/forms';
|
|
14
|
+
import * as _ngx_formly_core from '@ngx-formly/core';
|
|
15
|
+
import { FieldType, FormlyFieldConfig, FormlyFormOptions, FormlyFieldProps } from '@ngx-formly/core';
|
|
16
|
+
import * as _mediusinc_mng_commons_filter from '@mediusinc/mng-commons/filter';
|
|
17
|
+
import { FilterDescriptor, FilterDisplayTypeEnum } from '@mediusinc/mng-commons/filter';
|
|
18
|
+
import * as _mediusinc_mng_commons_tableview_api from '@mediusinc/mng-commons/tableview/api';
|
|
19
|
+
import { Params, QueryParamsHandling } from '@angular/router';
|
|
20
|
+
import { HttpErrorResponse } from '@angular/common/http';
|
|
21
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
22
|
+
|
|
23
|
+
interface IActionComponent<Item = any, Service = undefined> {
|
|
24
|
+
action: InputSignal<ActionDescriptorInst<Item, Service, any, any, any>>;
|
|
25
|
+
item: InputSignal<Item>;
|
|
26
|
+
itemId: InputSignal<IdType>;
|
|
27
|
+
actionData: InputSignal<ActionData>;
|
|
28
|
+
enabled: InputSignal<boolean>;
|
|
29
|
+
loading: InputSignal<boolean>;
|
|
30
|
+
trigger: OutputEmitterRef<ActionParameters<Item>>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface IActionEditorComponent {
|
|
34
|
+
closeWithUnsavedChangesConfirmation(callFromGuard: boolean): Observable<boolean>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface ActionExecutionError {
|
|
38
|
+
error: any;
|
|
39
|
+
dismissed: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* States of action. Enums ending with "*Final" are supposed to be final.
|
|
44
|
+
*/
|
|
45
|
+
declare enum ActionInstanceStateEnum {
|
|
46
|
+
TriggerStart = 0,// action was triggered (click or direct)
|
|
47
|
+
TriggerEnd = 1,
|
|
48
|
+
ActivationStart = 2,// action activation started (direct, event or editor)
|
|
49
|
+
ActivationEnd = 3,// action activation ended
|
|
50
|
+
FetchStart = 4,// fetch started
|
|
51
|
+
FetchEnd = 5,// fetch ended
|
|
52
|
+
FetchError = 6,// fetch error
|
|
53
|
+
RunConfirmationStart = 7,// confirmation for run is started
|
|
54
|
+
RunConfirmationEndAccept = 8,// confirmation accepted
|
|
55
|
+
RunConfirmationEndReject = 9,// confirmation rejected
|
|
56
|
+
RunStart = 10,// action was run by calling main function
|
|
57
|
+
RunEnd = 11,// action run function executed
|
|
58
|
+
RunError = 12,// action run function executed with error
|
|
59
|
+
NextActionStart = 13,// next action started
|
|
60
|
+
NextActionEnd = 14,// next action finished
|
|
61
|
+
ErrorActionStart = 15,// error action started
|
|
62
|
+
ErrorActionEnd = 16,// error action finished
|
|
63
|
+
FinishSuccessFinal = 17,// action executed successfully
|
|
64
|
+
FinishErrorFinal = 18,// action executed with error
|
|
65
|
+
FinishDismissedFinal = 19,// action was dismissed by user
|
|
66
|
+
FinishSuccessReactivateFinal = 20,// action executed successfully, another instance will directly start from previous
|
|
67
|
+
FinishComponentDestroyFinal = 21,// action was dismissed by destroying component that was executing it
|
|
68
|
+
FinishRouteUntriggerStart = 22,
|
|
69
|
+
FinishRouteUntriggerEndFinal = 23,
|
|
70
|
+
FinishRouteUntriggerTimeoutFinal = 24
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
interface IActionInstance<Item, Service> {
|
|
74
|
+
instanceId: string;
|
|
75
|
+
instanceLongName: string;
|
|
76
|
+
action: ActionDescriptorInst<Item, any, any, any, any>;
|
|
77
|
+
createdDate: Date;
|
|
78
|
+
triggerParameters?: ActionParameters<Item>;
|
|
79
|
+
activationParameters?: ActionParameters<Item>;
|
|
80
|
+
state: ActionInstanceStateEnum;
|
|
81
|
+
state$: Observable<ActionInstanceStateEnum>;
|
|
82
|
+
isRunLoading$: Observable<boolean>;
|
|
83
|
+
execution$: Observable<Item | null | undefined>;
|
|
84
|
+
executionIsRunning$: Observable<boolean>;
|
|
85
|
+
result?: Item | null;
|
|
86
|
+
result$: Observable<Item | null | undefined>;
|
|
87
|
+
error?: ActionExecutionError;
|
|
88
|
+
error$: Observable<ActionExecutionError>;
|
|
89
|
+
activationDialogRef?: DynamicDialogRef;
|
|
90
|
+
activationEditorComponentRef?: IActionEditorComponent;
|
|
91
|
+
reactivationPreviousInstance?: IActionInstance<Item, Service>;
|
|
92
|
+
previousInstance?: IActionInstance<any, any>;
|
|
93
|
+
nextActionInstance?: IActionInstance<any, any>;
|
|
94
|
+
errorActionInstance?: IActionInstance<Item, Service>;
|
|
95
|
+
reactivationInstance?: IActionInstance<Item, Service>;
|
|
96
|
+
reactivationInstance$: Observable<IActionInstance<Item, Service>>;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
type FieldValidationParamsType<Value, FormValue, ParentFormValue = undefined, Control extends AbstractControl = AbstractControl> = {
|
|
100
|
+
fieldFormControl: Value extends never ? undefined : Control;
|
|
101
|
+
form: FormGroup<{
|
|
102
|
+
[K in keyof FormValue]: AbstractControl<FormValue[K]>;
|
|
103
|
+
}>;
|
|
104
|
+
fieldComponent?: Value extends never ? undefined : FieldType<CommonsFormlyFieldConfig<Value, FormValue>>;
|
|
105
|
+
formComponent?: IFormEditorComponent<FormValue, ParentFormValue>;
|
|
106
|
+
fieldFormlyConfig: Value extends never ? undefined : CommonsFormlyFieldConfig<Value, FormValue, ParentFormValue>;
|
|
107
|
+
};
|
|
108
|
+
type FieldBaseValidator<Value, FormValue, ParentFormValue = undefined, Control extends AbstractControl = AbstractControl> = (params: FieldValidationParamsType<Value, FormValue, ParentFormValue, Control>) => boolean;
|
|
109
|
+
type FieldValidator<Value, FormValue, ParentFormValue = undefined, Control extends AbstractControl = FormControl<Value>> = FieldBaseValidator<Value, FormValue, ParentFormValue, Control>;
|
|
110
|
+
type FormValidator<Value, ParentValue = undefined, Control extends AbstractControl = FormGroup<{
|
|
111
|
+
[K in keyof Value]: AbstractControl<Value[K]>;
|
|
112
|
+
}>> = FieldBaseValidator<never, Value, ParentValue, Control>;
|
|
113
|
+
type FieldAsyncBaseValidator<Value, FormValue, ParentFormValue = undefined, Control extends AbstractControl = AbstractControl> = (params: FieldValidationParamsType<Value, FormValue, ParentFormValue, Control>) => Observable<boolean>;
|
|
114
|
+
type FieldAsyncValidator<Value, FormValue, ParentFormValue = undefined, Control extends AbstractControl = FormControl<Value>> = FieldAsyncBaseValidator<Value, FormValue, ParentFormValue, Control>;
|
|
115
|
+
type FormAsyncValidator<Value, ParentFormValue = undefined, Control extends AbstractControl = FormGroup<{
|
|
116
|
+
[K in keyof Value]: AbstractControl;
|
|
117
|
+
}>> = FieldAsyncBaseValidator<never, Value, ParentFormValue, Control>;
|
|
118
|
+
type FieldValidationMessage<Value, FormValue, ParentFormValue = undefined> = string | ((error: any, field: CommonsFormlyFieldConfig<Value, FormValue, ParentFormValue>) => string | Observable<string>);
|
|
119
|
+
type FormValidationMessage<Value, ParentFormValue = undefined> = FieldValidationMessage<Value, Value, ParentFormValue>;
|
|
120
|
+
|
|
121
|
+
declare enum FieldSizeEnum {
|
|
122
|
+
Small = 0,
|
|
123
|
+
Normal = 1,
|
|
124
|
+
Large = 2
|
|
125
|
+
}
|
|
126
|
+
declare enum FieldInputTypeEnum {
|
|
127
|
+
Hidden = 0,
|
|
128
|
+
Label = 1,
|
|
129
|
+
Text = 2,
|
|
130
|
+
Textarea = 3,
|
|
131
|
+
Number = 4,
|
|
132
|
+
Currency = 5,
|
|
133
|
+
Switch = 6,
|
|
134
|
+
Radio = 7,
|
|
135
|
+
Datepicker = 8,
|
|
136
|
+
Mask = 9,
|
|
137
|
+
File = 10,
|
|
138
|
+
ImageFile = 11,
|
|
139
|
+
ImageUrl = 12,
|
|
140
|
+
Custom = 13
|
|
141
|
+
}
|
|
142
|
+
declare enum FieldLookupTypeEnum {
|
|
143
|
+
Dropdown = 0,
|
|
144
|
+
Autocomplete = 1,
|
|
145
|
+
Dialog = 2,
|
|
146
|
+
Custom = 3
|
|
147
|
+
}
|
|
148
|
+
declare enum FieldManyToManyEditorTypeEnum {
|
|
149
|
+
DialogTableMultiselect = 0
|
|
150
|
+
}
|
|
151
|
+
declare enum FieldManyToManyEditorActionEnum {
|
|
152
|
+
Add = 0,
|
|
153
|
+
Delete = 1
|
|
154
|
+
}
|
|
155
|
+
declare enum FieldManyEditorTypeEnum {
|
|
156
|
+
DialogEditor = 0
|
|
157
|
+
}
|
|
158
|
+
declare enum FieldManyEditorActionEnum {
|
|
159
|
+
View = 0,
|
|
160
|
+
Add = 1,
|
|
161
|
+
Edit = 2,
|
|
162
|
+
Delete = 3
|
|
163
|
+
}
|
|
164
|
+
declare enum FieldGroupTypeEnum {
|
|
165
|
+
Tab = 0,
|
|
166
|
+
Fieldset = 1,
|
|
167
|
+
Logical = 2
|
|
168
|
+
}
|
|
169
|
+
type FieldConfig = object;
|
|
170
|
+
interface FieldLookupConfig extends FieldConfig {
|
|
171
|
+
table?: {
|
|
172
|
+
captionComponent?: Type<any>;
|
|
173
|
+
columnActionComponent?: Type<any>;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
type FieldValidationDescriptorOptsType<Property = string> = {
|
|
178
|
+
errorPath?: Property;
|
|
179
|
+
};
|
|
180
|
+
declare class FieldValidationDescriptor<FieldValue, EditorValue, ParentEditorModel = undefined> {
|
|
181
|
+
private readonly _name;
|
|
182
|
+
private readonly _validator?;
|
|
183
|
+
private readonly _message?;
|
|
184
|
+
private readonly _options?;
|
|
185
|
+
constructor(name: string, validator?: FieldBaseValidator<FieldValue, EditorValue, ParentEditorModel> | FieldAsyncBaseValidator<FieldValue, EditorValue, ParentEditorModel>, message?: FieldValidationMessage<FieldValue, EditorValue, ParentEditorModel>, options?: FieldValidationDescriptorOptsType);
|
|
186
|
+
get name(): string;
|
|
187
|
+
get validator(): FieldBaseValidator<FieldValue, EditorValue, ParentEditorModel> | FieldAsyncBaseValidator<FieldValue, EditorValue, ParentEditorModel> | undefined;
|
|
188
|
+
get message(): FieldValidationMessage<FieldValue, EditorValue, ParentEditorModel> | undefined;
|
|
189
|
+
get options(): FieldValidationDescriptorOptsType<string> | undefined;
|
|
190
|
+
copy(): FieldValidationDescriptor<FieldValue, EditorValue, ParentEditorModel>;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
declare const fieldDescriptorEmptyLabelType = "_emptyLabel";
|
|
194
|
+
declare abstract class AGenericFieldDescriptor {
|
|
195
|
+
protected _config: FieldConfig;
|
|
196
|
+
protected _formlyConfig: FormlyFieldConfig;
|
|
197
|
+
protected constructor();
|
|
198
|
+
get config(): object;
|
|
199
|
+
get formlyConfig(): FormlyFieldConfig<_ngx_formly_core.FormlyFieldProps & {
|
|
200
|
+
[additionalProperties: string]: any;
|
|
201
|
+
}>;
|
|
202
|
+
withConfig(config: FieldConfig): this;
|
|
203
|
+
withFormlyConfig(formlyConfig: FormlyFieldConfig): this;
|
|
204
|
+
/**
|
|
205
|
+
* Override toJSON implementation to prevent overflow with circular dependency.
|
|
206
|
+
* @ignore
|
|
207
|
+
*/
|
|
208
|
+
protected toJSON(): string;
|
|
209
|
+
}
|
|
210
|
+
type FieldValidationOptsType = {
|
|
211
|
+
forceShowMessage?: boolean;
|
|
212
|
+
};
|
|
213
|
+
type FieldClassNameType = {
|
|
214
|
+
field?: string;
|
|
215
|
+
grid?: string;
|
|
216
|
+
wrapper?: string;
|
|
217
|
+
label?: string;
|
|
218
|
+
control?: string;
|
|
219
|
+
input?: string;
|
|
220
|
+
};
|
|
221
|
+
declare abstract class AFieldDescriptor<FieldModel, EditorModel, FieldValue = FieldModel, ParentEditorModel = undefined> extends AGenericFieldDescriptor {
|
|
222
|
+
/** @ignore */ protected readonly _property: string;
|
|
223
|
+
/** @ignore */ protected _label?: string | null;
|
|
224
|
+
/** @ignore */ protected _labelUseModelBase?: boolean;
|
|
225
|
+
/** @ignore */ protected _labelInfoTooltip?: string;
|
|
226
|
+
/** @ignore */ protected _labelInfoTooltipIcon?: string;
|
|
227
|
+
/** @ignore */ protected _placeholder?: string;
|
|
228
|
+
/** @ignore */ protected _helpText?: string;
|
|
229
|
+
/** @ignore */ protected _required: boolean;
|
|
230
|
+
/** @ignore */ protected _requiredHideLabelMarker: boolean;
|
|
231
|
+
/** @ignore */ protected _disabled: boolean;
|
|
232
|
+
/** @ignore */ protected _defaultValue?: FieldValue;
|
|
233
|
+
/** @ignore */ protected _getter?: GetterFn<FieldValue, EditorModel>;
|
|
234
|
+
/** @ignore */ protected _setter?: (item: EditorModel, value: FieldValue) => void;
|
|
235
|
+
/** @ignore */ protected _validations: Array<FieldValidationDescriptor<any, any, any>>;
|
|
236
|
+
/** @ignore */ protected _asyncValidations: Array<FieldValidationDescriptor<any, any, any>>;
|
|
237
|
+
/** @ignore */ protected _validationOpts: FieldValidationOptsType;
|
|
238
|
+
/** @ignore */ protected _requiredExpression?: string | ((field?: FormlyFieldConfig) => boolean) | Observable<boolean>;
|
|
239
|
+
/** @ignore */ protected _disabledExpression?: string | ((field?: FormlyFieldConfig) => boolean) | Observable<boolean>;
|
|
240
|
+
/** @ignore */ protected _hiddenExpression?: string | ((field?: FormlyFieldConfig) => boolean) | Observable<boolean>;
|
|
241
|
+
/** @ignore */ protected _hiddenResetOnHide?: boolean;
|
|
242
|
+
/** @ignore */ protected _updateOn: 'change' | 'blur' | 'submit';
|
|
243
|
+
/** @ignore */ protected _onInit?: CommonsFormlyHookFn<FieldValue, EditorModel>;
|
|
244
|
+
/** @ignore */ protected _onChanges?: CommonsFormlyHookFn<FieldValue, EditorModel>;
|
|
245
|
+
/** @ignore */ protected _afterContentInit?: CommonsFormlyHookFn<FieldValue, EditorModel>;
|
|
246
|
+
/** @ignore */ protected _afterViewInit?: CommonsFormlyHookFn<FieldValue, EditorModel>;
|
|
247
|
+
/** @ignore */ protected _onDestroy?: CommonsFormlyHookFn<FieldValue, EditorModel>;
|
|
248
|
+
/** @ignore */ protected _onValueChange?: (field: CommonsFormlyFieldConfig<FieldValue, EditorModel>, value: any) => void;
|
|
249
|
+
/** @ignore */ protected _className?: FieldClassNameType;
|
|
250
|
+
/** @ignore */ protected _size: FieldSizeEnum;
|
|
251
|
+
/** @ignore */ protected _isLocalized: boolean;
|
|
252
|
+
/** @ignore */ protected readonly _eventsSubject: Subject<FormFieldEvent<FieldValue, EditorModel, ParentEditorModel>>;
|
|
253
|
+
protected constructor(property: string);
|
|
254
|
+
get property(): string;
|
|
255
|
+
get label(): string | null | undefined;
|
|
256
|
+
get labelUseModelBase(): boolean | undefined;
|
|
257
|
+
get placeholder(): string | undefined;
|
|
258
|
+
get helpText(): string | undefined;
|
|
259
|
+
get labelInfoTooltip(): string | undefined;
|
|
260
|
+
get labelInfoTooltipIcon(): string | undefined;
|
|
261
|
+
get required(): boolean;
|
|
262
|
+
get requiredHideLabelMarker(): boolean;
|
|
263
|
+
get disabled(): boolean;
|
|
264
|
+
get defaultValue(): FieldValue | undefined;
|
|
265
|
+
get getter(): GetterFn<FieldValue, EditorModel> | undefined;
|
|
266
|
+
get setter(): ((item: EditorModel, value: FieldValue) => void) | undefined;
|
|
267
|
+
get validations(): FieldValidationDescriptor<any, any, any>[];
|
|
268
|
+
get asyncValidations(): FieldValidationDescriptor<any, any, any>[];
|
|
269
|
+
get validationOpts(): FieldValidationOptsType;
|
|
270
|
+
get requiredExpression(): string | Observable<boolean> | ((field?: FormlyFieldConfig) => boolean) | undefined;
|
|
271
|
+
get disabledExpression(): string | Observable<boolean> | ((field?: FormlyFieldConfig) => boolean) | undefined;
|
|
272
|
+
get hiddenExpression(): string | Observable<boolean> | ((field?: FormlyFieldConfig) => boolean) | undefined;
|
|
273
|
+
get hiddenResetOnHide(): boolean | undefined;
|
|
274
|
+
get updateOn(): "change" | "blur" | "submit";
|
|
275
|
+
get onInit(): CommonsFormlyHookFn<FieldValue, EditorModel> | undefined;
|
|
276
|
+
get onChanges(): CommonsFormlyHookFn<FieldValue, EditorModel> | undefined;
|
|
277
|
+
get afterContentInit(): CommonsFormlyHookFn<FieldValue, EditorModel> | undefined;
|
|
278
|
+
get afterViewInit(): CommonsFormlyHookFn<FieldValue, EditorModel> | undefined;
|
|
279
|
+
get onDestroy(): CommonsFormlyHookFn<FieldValue, EditorModel> | undefined;
|
|
280
|
+
get onValueChange(): ((field: CommonsFormlyFieldConfig<FieldValue, EditorModel>, value: any) => void) | undefined;
|
|
281
|
+
get className(): FieldClassNameType | undefined;
|
|
282
|
+
get size(): FieldSizeEnum;
|
|
283
|
+
get isSizeSmall(): boolean;
|
|
284
|
+
get isSizeLarge(): boolean;
|
|
285
|
+
get isLocalized(): boolean;
|
|
286
|
+
abstract copy(): AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel>;
|
|
287
|
+
/**
|
|
288
|
+
* Set label for field.
|
|
289
|
+
* @param label Full label (i18n path or other string). If null, no label will be used.
|
|
290
|
+
* @param useModelBase If set to true, label will be appended to model's i18n base path.
|
|
291
|
+
*/
|
|
292
|
+
withLabel(label: string | null, useModelBase?: boolean): this;
|
|
293
|
+
withEmptyLabel(): this;
|
|
294
|
+
withPlaceholder(placeholder: string): this;
|
|
295
|
+
withHelpText(helpText: string): this;
|
|
296
|
+
/**
|
|
297
|
+
* Sets the label tooltip and optionally a custom icon for the field.
|
|
298
|
+
*
|
|
299
|
+
* @param {string} tooltip - The tooltip text to be displayed.
|
|
300
|
+
* @param {string} [customIcon] - An optional custom icon to be used for the tooltip. If not provided, the default icon is used.
|
|
301
|
+
*/
|
|
302
|
+
withLabelInfoTooltip(tooltip: string, customIcon?: string): this;
|
|
303
|
+
withRequired(required?: boolean, requiredExpression?: string | ((field?: FormlyFieldConfig) => boolean) | Observable<boolean>, hideLabelMarker?: boolean): this;
|
|
304
|
+
withDisabled(disabled?: boolean, disabledExpression?: string | ((field?: FormlyFieldConfig) => boolean) | Observable<boolean>): this;
|
|
305
|
+
withHidden(hiddenExpression: string | ((field?: FormlyFieldConfig) => boolean) | Observable<boolean>, resetOnHide?: boolean): this;
|
|
306
|
+
withUpdateOn(updateOn: 'change' | 'blur' | 'submit'): this;
|
|
307
|
+
withOnInit(onInit?: CommonsFormlyHookFn<FieldValue, EditorModel>): this;
|
|
308
|
+
withOnChanges(onChanges?: CommonsFormlyHookFn<FieldValue, EditorModel>): this;
|
|
309
|
+
withAfterContentInit(afterContentInit?: CommonsFormlyHookFn<FieldValue, EditorModel>): this;
|
|
310
|
+
withAfterViewInit(afterViewInit?: CommonsFormlyHookFn<FieldValue, EditorModel>): this;
|
|
311
|
+
withOnDestroy(onDestroy?: CommonsFormlyHookFn<FieldValue, EditorModel>): this;
|
|
312
|
+
withOnValueChange(onValueChange?: (field: CommonsFormlyFieldConfig<FieldValue, EditorModel>, value: FieldValue) => void): this;
|
|
313
|
+
withDefaultValue(defaultValue: FieldValue): this;
|
|
314
|
+
withGetter(fn?: GetterFn<FieldValue, EditorModel>): this;
|
|
315
|
+
withSetter(fn?: (item: EditorModel, value: FieldValue) => void): this;
|
|
316
|
+
withValidation<Value = FieldValue, EditorValue = EditorModel>(name: string, validator?: FieldValidator<Value, EditorValue, ParentEditorModel>, message?: FieldValidationMessage<Value, EditorValue, ParentEditorModel>): this;
|
|
317
|
+
removeValidation(name: string): this;
|
|
318
|
+
withAsyncValidation<Value = FieldValue, EditorValue = EditorModel>(name: string, asyncValidator?: FieldAsyncValidator<Value, EditorValue>, message?: FieldValidationMessage<Value, EditorValue>): this;
|
|
319
|
+
removeAsyncValidation(name: string): this;
|
|
320
|
+
withValidationOpts(validationOpts: FieldValidationOptsType): this;
|
|
321
|
+
withClassName(opts?: string | FieldClassNameType): this;
|
|
322
|
+
withSize(size?: FieldSizeEnum): this;
|
|
323
|
+
/**
|
|
324
|
+
* This function adds an icon with text Show all translations above the field and after clicking on it, it displays a new dialog with tableview.
|
|
325
|
+
* This new table view shows all available translations for specific property and allows editing it.
|
|
326
|
+
*/
|
|
327
|
+
localized(): this;
|
|
328
|
+
nextEvent(type: FormFieldEventTypeEnum, component: FieldType<CommonsFormlyFieldConfig<FieldValue, EditorModel, any>>, data?: FormFieldEventData<FieldValue, EditorModel>): void;
|
|
329
|
+
get events$(): Observable<FormFieldEvent<FieldValue, EditorModel, ParentEditorModel>>;
|
|
330
|
+
protected copyFieldsTo(obj: AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel>): void;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
declare abstract class AFieldGroupDescriptor<EditorModel, ParentEditorModel = undefined> extends AGenericFieldDescriptor {
|
|
334
|
+
protected readonly _name: string;
|
|
335
|
+
protected readonly _default: boolean;
|
|
336
|
+
protected _title?: string | null;
|
|
337
|
+
protected _fields: AGenericFieldDescriptor[];
|
|
338
|
+
protected _validations: Array<FieldValidationDescriptor<any, any, any>>;
|
|
339
|
+
protected _validationOpts: FieldValidationOptsType;
|
|
340
|
+
protected _hiddenExpression?: string | ((field?: CommonsFormlyFieldConfig<EditorModel, EditorModel>) => boolean) | Observable<boolean>;
|
|
341
|
+
protected constructor(name: string);
|
|
342
|
+
removeField(property: string, filterFunction: (fields: AGenericFieldDescriptor[]) => AGenericFieldDescriptor[]): AGenericFieldDescriptor[];
|
|
343
|
+
get title(): string | null | undefined;
|
|
344
|
+
abstract get type(): FieldGroupTypeEnum;
|
|
345
|
+
abstract get fields(): AGenericFieldDescriptor[];
|
|
346
|
+
get validations(): FieldValidationDescriptor<any, any, any>[];
|
|
347
|
+
get validationOpts(): FieldValidationOptsType;
|
|
348
|
+
get name(): string;
|
|
349
|
+
get default(): boolean;
|
|
350
|
+
get hiddenExpression(): string | Observable<boolean> | ((field?: CommonsFormlyFieldConfig<EditorModel, EditorModel>) => boolean) | undefined;
|
|
351
|
+
abstract addField(field: AGenericFieldDescriptor): this;
|
|
352
|
+
abstract copy(): AFieldGroupDescriptor<EditorModel, ParentEditorModel>;
|
|
353
|
+
withTitle(title?: string | null): this;
|
|
354
|
+
withValidation<Value = EditorModel, ParentValue = ParentEditorModel>(name: string, validator?: FormValidator<Value, ParentValue>, message?: FormValidationMessage<Value, ParentValue>, opts?: FieldValidationDescriptorOptsType): this;
|
|
355
|
+
withValidationOpts(validationOpts: FieldValidationOptsType): this;
|
|
356
|
+
withHidden(hiddenExpression: string | ((field?: CommonsFormlyFieldConfig<EditorModel, EditorModel>) => boolean) | Observable<boolean>): this;
|
|
357
|
+
}
|
|
358
|
+
declare class FieldTabGroupDescriptor<EditorModel> extends AFieldGroupDescriptor<EditorModel> {
|
|
359
|
+
protected _fields: FieldGroupDescriptor<EditorModel>[];
|
|
360
|
+
constructor(name: string);
|
|
361
|
+
get type(): FieldGroupTypeEnum;
|
|
362
|
+
get fields(): Array<FieldGroupDescriptor<EditorModel>>;
|
|
363
|
+
addField(field: FieldGroupDescriptor<EditorModel>): this;
|
|
364
|
+
copy(skipFields?: boolean): FieldTabGroupDescriptor<EditorModel>;
|
|
365
|
+
}
|
|
366
|
+
type FieldGroupClassNameType = {
|
|
367
|
+
grid?: string;
|
|
368
|
+
};
|
|
369
|
+
declare class FieldGroupDescriptor<EditorModel, ParentEditorModel = undefined> extends AFieldGroupDescriptor<EditorModel, ParentEditorModel> {
|
|
370
|
+
private _type;
|
|
371
|
+
protected _className?: FieldGroupClassNameType;
|
|
372
|
+
constructor(name: string);
|
|
373
|
+
get type(): FieldGroupTypeEnum;
|
|
374
|
+
get fields(): Array<AFieldDescriptor<any, EditorModel>>;
|
|
375
|
+
/**
|
|
376
|
+
* Styling class name configurations for group.
|
|
377
|
+
*/
|
|
378
|
+
get className(): FieldGroupClassNameType | undefined;
|
|
379
|
+
addField(field: AFieldDescriptor<any, EditorModel>): this;
|
|
380
|
+
asLogical(): this;
|
|
381
|
+
withClassName(opts?: string | FieldGroupClassNameType): this;
|
|
382
|
+
copy(skipFields?: boolean): FieldGroupDescriptor<EditorModel>;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
type CommonsFormlyFormOptions<Item> = FormlyFormOptions & {
|
|
386
|
+
formState?: CommonsFormlyFormState<Item>;
|
|
387
|
+
};
|
|
388
|
+
type CommonsFormlyFormState<Item> = {
|
|
389
|
+
descriptor?: EditorDescriptorInst<Item>;
|
|
390
|
+
add?: boolean;
|
|
391
|
+
edit?: boolean;
|
|
392
|
+
disabled?: boolean;
|
|
393
|
+
disabled$?: Observable<boolean>;
|
|
394
|
+
submittedOn?: number;
|
|
395
|
+
[key: string]: any;
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
type CommonsFormlyFieldProps<Value = any, FormValue = any, ParentFormValue = any> = FormlyFieldProps & CommonsFormlyFieldAdditionalProps<Value, FormValue, ParentFormValue>;
|
|
399
|
+
type CommonsFormlyValidation = FormlyFieldConfig['validators'];
|
|
400
|
+
interface CommonsFormlyFieldConfig<Value = any, FormValue = any, ParentFormValue = any, Props = CommonsFormlyFieldProps<Value, FormValue, ParentFormValue>> extends FormlyFieldConfig<Props> {
|
|
401
|
+
props: Props;
|
|
402
|
+
readonly model?: Value;
|
|
403
|
+
/**
|
|
404
|
+
* The form options.
|
|
405
|
+
*/
|
|
406
|
+
readonly options?: CommonsFormlyFormOptions<Value>;
|
|
407
|
+
/**
|
|
408
|
+
* The parent form.
|
|
409
|
+
*/
|
|
410
|
+
readonly form?: FormGroup<{
|
|
411
|
+
[K in keyof FormValue]: AbstractControl<FormValue[K]>;
|
|
412
|
+
}>;
|
|
413
|
+
/**
|
|
414
|
+
* This is the [FormControl](https://angular.io/api/forms/FormControl) for the field.
|
|
415
|
+
* It provides you more control like running validators, calculating status, and resetting state.
|
|
416
|
+
*/
|
|
417
|
+
readonly formControl?: FormControl<Value>;
|
|
418
|
+
}
|
|
419
|
+
type CommonsFormlyHookFn<T, ET> = (field: CommonsFormlyFieldConfig<T, ET>) => void;
|
|
420
|
+
interface CommonsFormlyFieldAdditionalProps<Value, FormValue, ParentFormValue = any> {
|
|
421
|
+
descriptor?: AFieldDescriptor<Value, FormValue> | AFieldGroupDescriptor<FormValue> | AGenericFieldDescriptor;
|
|
422
|
+
editorDescriptor?: EditorDescriptorInst<FormValue, ParentFormValue>;
|
|
423
|
+
formEditorComponent?: IFormEditorComponent<FormValue, ParentFormValue>;
|
|
424
|
+
fieldComponent?: FieldType<CommonsFormlyFieldConfig<Value, FormValue>>;
|
|
425
|
+
required?: boolean;
|
|
426
|
+
hide?: boolean;
|
|
427
|
+
disabled?: boolean;
|
|
428
|
+
minDate?: Date;
|
|
429
|
+
maxDate?: Date;
|
|
430
|
+
onValueChange?: (field: CommonsFormlyFieldConfig<Value, FormValue>, value: Value) => void;
|
|
431
|
+
[additionalProperties: string]: any;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
interface FieldActionContext<EditorModel, ParentEditorModel = undefined> {
|
|
435
|
+
descriptor: FieldActionDescriptor<EditorModel>;
|
|
436
|
+
formEditorComponent: IFormEditorComponent<EditorModel, ParentEditorModel>;
|
|
437
|
+
formly: {
|
|
438
|
+
model: EditorModel;
|
|
439
|
+
formControl: FormControl<void>;
|
|
440
|
+
form: FormGroup<{
|
|
441
|
+
[K in keyof EditorModel]: AbstractControl<EditorModel[K]>;
|
|
442
|
+
}>;
|
|
443
|
+
options: CommonsFormlyFormOptions<EditorModel>;
|
|
444
|
+
props: CommonsFormlyFieldProps<void, EditorModel, ParentEditorModel>;
|
|
445
|
+
formState: CommonsFormlyFormState<EditorModel>;
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
interface FieldActionResult {
|
|
449
|
+
message?: FieldActionResultMessage;
|
|
450
|
+
}
|
|
451
|
+
interface FieldActionResultMessage {
|
|
452
|
+
content: string;
|
|
453
|
+
severity?: 'success' | 'warn' | 'error' | 'info' | 'secondary' | 'contrast';
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
type FieldActionRunFnType<EditorModel, ParentEditorModel = undefined> = (ctx: FieldActionContext<EditorModel, ParentEditorModel>) => void | FieldActionResult | Observable<FieldActionResult>;
|
|
457
|
+
declare class FieldActionDescriptor<EditorModel, ParentEditorModel = undefined> extends AFieldDescriptor<void, EditorModel, void, ParentEditorModel> {
|
|
458
|
+
protected readonly _fieldActionName: string;
|
|
459
|
+
protected _button?: IActionButtonDescriptor;
|
|
460
|
+
protected _runFunction?: FieldActionRunFnType<EditorModel>;
|
|
461
|
+
private _wrappers;
|
|
462
|
+
constructor(property: string);
|
|
463
|
+
get button(): IActionButtonDescriptor | undefined;
|
|
464
|
+
get runFunction(): FieldActionRunFnType<EditorModel, undefined> | undefined;
|
|
465
|
+
get wrappers(): string[];
|
|
466
|
+
withButton(label?: string | null, icon?: string | null, level?: StyleLevelEnum): this;
|
|
467
|
+
withButtonOpts(button?: IActionButtonDescriptor): this;
|
|
468
|
+
withRunFunction(fn: FieldActionRunFnType<EditorModel>): this;
|
|
469
|
+
withWrappers(wrappers: string[]): this;
|
|
470
|
+
copy(): FieldActionDescriptor<EditorModel, ParentEditorModel>;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
type FieldLookupDescriptorConstructorOptsType<EditorModel, Service, Sorts, Filters extends keyof any> = FieldLookupDescriptorCreateOptsProviderType<EditorModel, Service, Sorts, Filters> & {
|
|
474
|
+
optionsValueProperty?: string;
|
|
475
|
+
};
|
|
476
|
+
type FieldLookupDescriptorCreateOptsProviderType<FieldModel, Service, Sorts = keyof FieldModel, Filters extends keyof any = keyof FieldModel> = {
|
|
477
|
+
serviceType?: ServiceClassType<Service>;
|
|
478
|
+
dataProvider?: ILookupDataProvider<FieldModel, Service, Sorts, Filters>;
|
|
479
|
+
};
|
|
480
|
+
type FieldLookupProviderType<FieldModel, Service> = ServiceClassType<Service> | ILookupDataProvider<FieldModel, Service, any, any>;
|
|
481
|
+
type FieldLookupAutocompleteOptsType = {
|
|
482
|
+
openOnFocus?: boolean;
|
|
483
|
+
inlineSearch?: boolean;
|
|
484
|
+
selectFirst?: boolean;
|
|
485
|
+
autoClear?: boolean;
|
|
486
|
+
};
|
|
487
|
+
declare const fieldLookupGetProviderCfgObj: <FieldModel, Service>(serviceOrDataProvider?: FieldLookupProviderType<FieldModel, Service>) => FieldLookupDescriptorCreateOptsProviderType<FieldModel, Service, keyof FieldModel, keyof FieldModel>;
|
|
488
|
+
declare class FieldLookupDescriptor<FieldModel, EditorModel, Service = any, FieldValue = FieldModel, ParentEditorModel = undefined, Sorts = keyof FieldModel, Filters extends keyof any = keyof FieldModel> extends AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel> implements ILookupDescriptor<FieldModel, Service, Sorts, Filters> {
|
|
489
|
+
protected readonly _dataProvider: ILookupDataProvider<FieldModel, Service, Sorts, Filters>;
|
|
490
|
+
protected readonly _optionsValueProperty?: string;
|
|
491
|
+
protected _lookupType: FieldLookupTypeEnum;
|
|
492
|
+
protected _optionsLabelProperty?: string;
|
|
493
|
+
protected _optionsLabelTranslate: boolean;
|
|
494
|
+
protected _optionsDisabledProperty?: string;
|
|
495
|
+
protected _optionsTrackProperty?: string;
|
|
496
|
+
protected _dropdownClassName: string;
|
|
497
|
+
protected _autocompleteOpenOnFocus?: boolean;
|
|
498
|
+
protected _autocompleteInlineSearch?: boolean;
|
|
499
|
+
protected _autocompleteAutoClear?: boolean;
|
|
500
|
+
protected _autocompleteSelectFirst?: boolean;
|
|
501
|
+
protected _autocompleteInputTrim?: InputTrimType;
|
|
502
|
+
protected _dialogTableDescriptor?: TableDescriptorInst<FieldModel, any, any>;
|
|
503
|
+
protected _dialogTableDataProvider?: ITableDataProvider<FieldModel, any, any, any>;
|
|
504
|
+
protected _customComponentName?: string;
|
|
505
|
+
constructor(property: string, cfg?: FieldLookupDescriptorConstructorOptsType<FieldModel, Service, Sorts, Filters>);
|
|
506
|
+
get lookupType(): FieldLookupTypeEnum;
|
|
507
|
+
get optionsLabelProperty(): string | undefined;
|
|
508
|
+
get optionsLabelTranslate(): boolean;
|
|
509
|
+
get optionsValueProperty(): string | undefined;
|
|
510
|
+
get optionsDisabledProperty(): string | undefined;
|
|
511
|
+
get optionsTrackProperty(): string | undefined;
|
|
512
|
+
get dataProvider(): ILookupDataProvider<FieldModel, Service, Sorts, Filters>;
|
|
513
|
+
get autocompleteOpenOnFocus(): boolean | undefined;
|
|
514
|
+
get autocompleteInlineSearch(): boolean | undefined;
|
|
515
|
+
get autocompleteAutoClear(): boolean | undefined;
|
|
516
|
+
get autocompleteSelectFirst(): boolean | undefined;
|
|
517
|
+
get dropdownClassName(): string;
|
|
518
|
+
get dialogTableDescriptor(): TableDescriptorInst<FieldModel, any, any> | undefined;
|
|
519
|
+
get dialogTableDataProvider(): ITableDataProvider<FieldModel, any, any, any> | undefined;
|
|
520
|
+
get customComponentName(): string | undefined;
|
|
521
|
+
get trimOption(): InputTrimType | undefined;
|
|
522
|
+
withOptionsLabelProperty(property: keyof FieldModel, translate?: boolean): this;
|
|
523
|
+
withOptionsLabelPropertyUnsafe(property: string, translate?: boolean): this;
|
|
524
|
+
withOptionsDisabledProperty(property: keyof FieldModel): this;
|
|
525
|
+
withOptionsDisabledPropertyUnsafe(property: string): this;
|
|
526
|
+
withOptionsTrackProperty(property: keyof FieldModel): this;
|
|
527
|
+
withOptionsTrackPropertyUnsafe(property: string): this;
|
|
528
|
+
withLookup(lookup?: LookupDataProviderLookupFnType<FieldModel, Service, Sorts, Filters>): this;
|
|
529
|
+
withInputTrim(trimOption?: InputTrimType): this;
|
|
530
|
+
withConfig(config: FieldLookupConfig): this;
|
|
531
|
+
asAutocomplete(opts?: FieldLookupAutocompleteOptsType): this;
|
|
532
|
+
asDialog<Sorts = keyof FieldModel, Filters extends keyof any = keyof FieldModel>(lookupTableDescriptor: TableDescriptorInst<FieldModel, Sorts, Filters>, tableDataProvider?: ITableDataProvider<FieldModel, any, Sorts, Filters>): this;
|
|
533
|
+
asCustomComponent(customComponentName: string): this;
|
|
534
|
+
copy(): FieldLookupDescriptor<FieldModel, EditorModel, Service, FieldValue, ParentEditorModel, Sorts, Filters>;
|
|
535
|
+
}
|
|
536
|
+
declare class FieldLookupEnumDescriptor<Enum, EditorModel, ParentEditorModel = undefined> extends FieldLookupDescriptor<EnumValue, EditorModel, undefined, EnumConstantType, ParentEditorModel, never, never> {
|
|
537
|
+
private readonly _enumModel;
|
|
538
|
+
private readonly _optionEnumValues;
|
|
539
|
+
private readonly _options;
|
|
540
|
+
constructor(property: string, enumModel: EnumDescriptor<Enum>, options?: Array<Enum>);
|
|
541
|
+
get enumModel(): EnumDescriptor<Enum>;
|
|
542
|
+
withDisabledOptions(...disabledOptions: Array<EnumConstantType>): this;
|
|
543
|
+
withDefaultValueEnum(defaultValue: EnumConstantType): this;
|
|
544
|
+
asAutocomplete(opts?: FieldLookupAutocompleteOptsType): this;
|
|
545
|
+
copy(): FieldLookupEnumDescriptor<Enum, EditorModel, ParentEditorModel>;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
type FieldManyToManyEditorDescriptorConstructorOptsType<FieldModel, Service> = FieldManyToManyEditorDescriptorCreateOptsProviderType<FieldModel, Service>;
|
|
549
|
+
type FieldManyToManyEditorDescriptorCreateOptsProviderType<FieldModel, Service> = {
|
|
550
|
+
lookupServiceType?: ServiceClassType<Service>;
|
|
551
|
+
lookupDataProvider?: ITableDataProvider<FieldModel, Service>;
|
|
552
|
+
};
|
|
553
|
+
type FieldManyToManyEditorProviderType<FieldModel, Service> = ServiceClassType<Service> | ITableDataProvider<FieldModel, Service>;
|
|
554
|
+
declare const fieldManyToManyGetProviderCfgObj: <FieldModel, Service>(serviceOrDataProvider?: FieldManyToManyEditorProviderType<FieldModel, Service>) => FieldManyToManyEditorDescriptorCreateOptsProviderType<FieldModel, Service>;
|
|
555
|
+
declare class FieldManyToManyEditorDescriptor<FieldModel, EditorModel, Service = any, FieldValue = FieldModel[], ParentEditorModel = undefined> extends AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel> {
|
|
556
|
+
private readonly _mainTableDescriptor;
|
|
557
|
+
private readonly _lookupTableDescriptor;
|
|
558
|
+
private readonly _lookupTableDataProvider;
|
|
559
|
+
private _fieldType;
|
|
560
|
+
private _actions;
|
|
561
|
+
private _hasLookupExcludeValues;
|
|
562
|
+
private _excludeFilterProperty;
|
|
563
|
+
private _excludeValueProperty;
|
|
564
|
+
constructor(property: string, mainTableDescriptor: TableDescriptorInst<FieldModel>, lookupTableDescriptor: TableDescriptorInst<FieldModel>, cfg?: FieldManyToManyEditorDescriptorConstructorOptsType<FieldModel, Service>);
|
|
565
|
+
get fieldType(): FieldManyToManyEditorTypeEnum;
|
|
566
|
+
get actions(): FieldManyToManyEditorActionEnum[];
|
|
567
|
+
get hasLookupExcludeValues(): boolean;
|
|
568
|
+
get excludeFilterProperty(): string;
|
|
569
|
+
get excludeValueProperty(): string;
|
|
570
|
+
get mainTableDescriptor(): TableDescriptorInst<FieldModel, keyof FieldModel, keyof FieldModel>;
|
|
571
|
+
get lookupTableDescriptor(): TableDescriptorInst<FieldModel, keyof FieldModel, keyof FieldModel>;
|
|
572
|
+
get lookupTableDataProvider(): ITableDataProvider<FieldModel, Service>;
|
|
573
|
+
withLookup(fn: TableDataProviderGetAllFnType<FieldModel, Service>): this;
|
|
574
|
+
withActions(actions?: Array<FieldManyToManyEditorActionEnum>): this;
|
|
575
|
+
withLookupExclude(filterProperty: keyof FieldModel, valueProperty: keyof FieldModel, hasLookupExclude?: boolean): this;
|
|
576
|
+
withLookupExcludeUnsafe(filterProperty: string, valueProperty: string, hasLookupExclude?: boolean): this;
|
|
577
|
+
copy(): FieldManyToManyEditorDescriptor<FieldModel, EditorModel, Service, FieldValue, ParentEditorModel>;
|
|
578
|
+
}
|
|
579
|
+
declare class FieldManyEditorDescriptor<FieldModel, EditorModel, FieldValue = FieldModel[], ParentEditorModel = undefined> extends AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel> {
|
|
580
|
+
private readonly _tableviewDescriptor;
|
|
581
|
+
private _fieldType;
|
|
582
|
+
private _fieldActions;
|
|
583
|
+
private _actions;
|
|
584
|
+
constructor(property: string, tableviewDescriptor: TableviewDescriptorInst<FieldModel, any, any, EditorModel, FieldModel, FieldModel, FieldModel, FieldModel>);
|
|
585
|
+
get fieldType(): FieldManyEditorTypeEnum;
|
|
586
|
+
get fieldActions(): FieldManyEditorActionEnum[];
|
|
587
|
+
get actions(): ActionDescriptorInst<any, any, any, any, any>[];
|
|
588
|
+
get tableviewDescriptor(): TableviewDescriptorInst<FieldModel, any, any, EditorModel, FieldModel, FieldModel, FieldModel, FieldModel>;
|
|
589
|
+
get tableDescriptor(): TableDescriptorInst<FieldModel, any, any>;
|
|
590
|
+
get editorForCreate(): _mediusinc_mng_commons_tableview_api.EditorDescriptorInst<FieldModel, EditorModel>;
|
|
591
|
+
get editorForRead(): _mediusinc_mng_commons_tableview_api.EditorDescriptorInst<FieldModel, EditorModel>;
|
|
592
|
+
get editorForUpdate(): _mediusinc_mng_commons_tableview_api.EditorDescriptorInst<FieldModel, EditorModel>;
|
|
593
|
+
withFieldAction(action: FieldManyEditorActionEnum): this;
|
|
594
|
+
withFieldActions(actions: FieldManyEditorActionEnum[]): this;
|
|
595
|
+
withAction(action: ActionDescriptorInst<any>): this;
|
|
596
|
+
copy(): FieldManyEditorDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel>;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
interface FieldImagePreviewComponent {
|
|
600
|
+
imageUrl: InputSignal<string>;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
declare abstract class AFormlyCustomFieldComponent<Value, FormValue, ParentFormValue = undefined> extends FieldType<CommonsFormlyFieldConfig<Value, FormValue, ParentFormValue>> {
|
|
604
|
+
field: CommonsFormlyFieldConfig<Value, FormValue, ParentFormValue>;
|
|
605
|
+
_model: Value;
|
|
606
|
+
_form: FormGroup<{
|
|
607
|
+
[K in keyof FormValue]: AbstractControl<FormValue[K]>;
|
|
608
|
+
}>;
|
|
609
|
+
_options: CommonsFormlyFormOptions<FormValue>;
|
|
610
|
+
_key: string | number | (string | number)[];
|
|
611
|
+
_formControl: FormControl<Value>;
|
|
612
|
+
_props: CommonsFormlyFieldProps<Value, FormValue, ParentFormValue>;
|
|
613
|
+
_showError: boolean;
|
|
614
|
+
_id: string;
|
|
615
|
+
_formState: CommonsFormlyFormState<FormValue>;
|
|
616
|
+
get model(): Value;
|
|
617
|
+
get form(): FormGroup<{ [K in keyof FormValue]: AbstractControl<FormValue[K], FormValue[K], any>; }>;
|
|
618
|
+
get options(): CommonsFormlyFormOptions<FormValue>;
|
|
619
|
+
get key(): string | number | (string | number)[];
|
|
620
|
+
get formControl(): FormControl<Value>;
|
|
621
|
+
get props(): CommonsFormlyFieldProps<Value, FormValue, ParentFormValue>;
|
|
622
|
+
get showError(): boolean;
|
|
623
|
+
get id(): string;
|
|
624
|
+
get formState(): CommonsFormlyFormState<FormValue>;
|
|
625
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AFormlyCustomFieldComponent<any, any, any>, never>;
|
|
626
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AFormlyCustomFieldComponent<any, any, any>, never, never, { "field": { "alias": "field"; "required": false; }; "_model": { "alias": "model"; "required": false; }; "_form": { "alias": "form"; "required": false; }; "_options": { "alias": "options"; "required": false; }; "_key": { "alias": "key"; "required": false; }; "_formControl": { "alias": "formControl"; "required": false; }; "_props": { "alias": "props"; "required": false; }; "_showError": { "alias": "showError"; "required": false; }; "_id": { "alias": "id"; "required": false; }; "_formState": { "alias": "formState"; "required": false; }; }, {}, never, never, true, never>;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
interface RadioValue<V = string | number | boolean> {
|
|
630
|
+
name?: string;
|
|
631
|
+
value: V;
|
|
632
|
+
title: string;
|
|
633
|
+
disabled?: boolean;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
type FieldInputDescriptorType = string | string[] | number | boolean | Date | File | File[];
|
|
637
|
+
type FieldInputOptsType = {
|
|
638
|
+
emptyValue?: EmptyValueType;
|
|
639
|
+
};
|
|
640
|
+
type FieldInpuTextBaseOptsType = {
|
|
641
|
+
trim?: InputTrimType;
|
|
642
|
+
};
|
|
643
|
+
type FieldInputTextOptsType = {
|
|
644
|
+
email?: boolean;
|
|
645
|
+
} & FieldInputTextValidationOptsType & FieldInpuTextBaseOptsType & FieldInputOptsType;
|
|
646
|
+
type FieldInputTextareaOptsType = {
|
|
647
|
+
rows?: number;
|
|
648
|
+
} & FieldInputTextValidationOptsType & FieldInpuTextBaseOptsType & FieldInputOptsType;
|
|
649
|
+
type FieldInputMaskOptsType = {
|
|
650
|
+
mask: string;
|
|
651
|
+
slotChar?: string;
|
|
652
|
+
} & FieldInputOptsType;
|
|
653
|
+
type FieldInputTextValidationOptsType = {
|
|
654
|
+
minLength?: number;
|
|
655
|
+
maxLength?: number;
|
|
656
|
+
pattern?: string | RegExp;
|
|
657
|
+
};
|
|
658
|
+
type FieldInputDatePickerDisplayOptsType = {
|
|
659
|
+
format?: string;
|
|
660
|
+
showTime?: boolean;
|
|
661
|
+
showSeconds?: boolean;
|
|
662
|
+
};
|
|
663
|
+
type FieldInputDateValidationOptsType<FieldValue, EditorModel, ParentEditorModel> = {
|
|
664
|
+
min?: Date | FieldInputDatePickerDynamicMinMaxFnType<FieldValue, EditorModel, ParentEditorModel>;
|
|
665
|
+
max?: Date | FieldInputDatePickerDynamicMinMaxFnType<FieldValue, EditorModel, ParentEditorModel>;
|
|
666
|
+
};
|
|
667
|
+
type FieldInputCurrencyOptsType<Property = string> = {
|
|
668
|
+
currencyProperty?: Property;
|
|
669
|
+
currency?: string;
|
|
670
|
+
currencyDisplay?: 'symbol' | 'code' | 'name';
|
|
671
|
+
} & FieldInputNumberGroupingOptsType & FieldInputNumberFractionOptsType & FieldInputNumberValidationOptsType & FieldInputLocaleOptsType & FieldInputOptsType;
|
|
672
|
+
type FieldInputNumberOptsType = FieldInputNumberGroupingOptsType & FieldInputNumberFractionOptsType & FieldInputNumberValidationOptsType & FieldInputLocaleOptsType & FieldInputNumberDisplayOptsType & FieldInputOptsType;
|
|
673
|
+
type FieldInputNumberGroupingOptsType = {
|
|
674
|
+
groupSeparator?: boolean;
|
|
675
|
+
};
|
|
676
|
+
type FieldInputNumberValidationOptsType = {
|
|
677
|
+
min?: number;
|
|
678
|
+
max?: number;
|
|
679
|
+
step?: number;
|
|
680
|
+
autoCorrect?: boolean;
|
|
681
|
+
};
|
|
682
|
+
type FieldInputNumberFractionOptsType = {
|
|
683
|
+
minFractionDigits?: number;
|
|
684
|
+
maxFractionDigits?: number;
|
|
685
|
+
};
|
|
686
|
+
type FieldInputLocaleOptsType = {
|
|
687
|
+
locale?: string;
|
|
688
|
+
};
|
|
689
|
+
type FieldInputNumberDisplayOptsType = {
|
|
690
|
+
prefix?: string;
|
|
691
|
+
suffix?: string;
|
|
692
|
+
};
|
|
693
|
+
type FieldInputDatePickerOptsType<FieldValue, EditorModel, ParentEditorModel> = FieldInputDatePickerDisplayOptsType & FieldInputDateValidationOptsType<FieldValue, EditorModel, ParentEditorModel> & FieldDateOptsType;
|
|
694
|
+
type FieldDateOptsType = {
|
|
695
|
+
asDateObj?: boolean;
|
|
696
|
+
utc?: boolean;
|
|
697
|
+
noTime?: boolean;
|
|
698
|
+
noTimeZone?: boolean;
|
|
699
|
+
};
|
|
700
|
+
type FieldInputFileOpts = {
|
|
701
|
+
multiple?: boolean;
|
|
702
|
+
maxFileSize?: number;
|
|
703
|
+
accept?: string;
|
|
704
|
+
onFileSelectHandlerFn?: FieldInputFileOnSelectHandlerFnType;
|
|
705
|
+
preview?: boolean;
|
|
706
|
+
previewAllowSvg?: boolean;
|
|
707
|
+
previewComponent?: Type<FieldImagePreviewComponent>;
|
|
708
|
+
};
|
|
709
|
+
type FieldInputImageUrlOpts = {
|
|
710
|
+
multiple?: boolean;
|
|
711
|
+
preview?: boolean;
|
|
712
|
+
inputVisibleOnDisabled?: boolean;
|
|
713
|
+
previewAllowSvg?: boolean;
|
|
714
|
+
previewComponent?: Type<FieldImagePreviewComponent>;
|
|
715
|
+
};
|
|
716
|
+
type FieldInputComponentOpts = {
|
|
717
|
+
fieldWrappers?: string[];
|
|
718
|
+
inputs?: Record<string, any>;
|
|
719
|
+
};
|
|
720
|
+
type FieldInputFileOnSelectHandlerFnType = (file: File[] | null, control: AbstractControl) => void;
|
|
721
|
+
type FieldInputDatePickerDynamicMinMaxFnType<Value, FormValue, ParentFormValue> = (control: AbstractControl<Value>, field: CommonsFormlyFieldConfig<Value, FormValue, ParentFormValue>) => ItemOrObservable<Date | undefined>;
|
|
722
|
+
declare class FieldInputDescriptor<EditorModel, FieldModel = FieldInputDescriptorType, FieldValue = FieldModel, ParentEditorModel = undefined> extends AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel> {
|
|
723
|
+
private _fieldType;
|
|
724
|
+
private _rows?;
|
|
725
|
+
private _numberMin?;
|
|
726
|
+
private _numberMax?;
|
|
727
|
+
private _numberStep?;
|
|
728
|
+
private _numberAutoCorrect?;
|
|
729
|
+
private _numberMinFractionDigits?;
|
|
730
|
+
private _numberMaxFractionDigits?;
|
|
731
|
+
private _numberUseGrouping;
|
|
732
|
+
private _locale?;
|
|
733
|
+
private _numberPrefix?;
|
|
734
|
+
private _numberSuffix?;
|
|
735
|
+
private _currency?;
|
|
736
|
+
private _currencyDisplay;
|
|
737
|
+
private _currencyFromProperty?;
|
|
738
|
+
private _radioOptions;
|
|
739
|
+
private _radioLabelClassName?;
|
|
740
|
+
private _datePickerFormat?;
|
|
741
|
+
private _datePickerMin?;
|
|
742
|
+
private _datePickerMax?;
|
|
743
|
+
private _datePickerShowTime?;
|
|
744
|
+
private _datePickerShowSeconds?;
|
|
745
|
+
private _datePickerValueUtc?;
|
|
746
|
+
private _datePickerValueNoTimezone?;
|
|
747
|
+
private _datePickerValueNoTime?;
|
|
748
|
+
private _datePickerValueAsDateObj?;
|
|
749
|
+
private _maxLength?;
|
|
750
|
+
private _minLength?;
|
|
751
|
+
private _pattern?;
|
|
752
|
+
private _validationEmail?;
|
|
753
|
+
private _textTrim?;
|
|
754
|
+
private _mask?;
|
|
755
|
+
private _slotChar?;
|
|
756
|
+
private _fileMultiple?;
|
|
757
|
+
private _fileMaxFileSize?;
|
|
758
|
+
private _fileAccept?;
|
|
759
|
+
private _fileOnSelectHandler?;
|
|
760
|
+
private _imagePreview?;
|
|
761
|
+
private _imageUrlInputHiddenOnDisabled?;
|
|
762
|
+
private _imagePreviewAllowSvg?;
|
|
763
|
+
private _imagePreviewComponent?;
|
|
764
|
+
private _customComponentType?;
|
|
765
|
+
private _customComponentInputs?;
|
|
766
|
+
private _customComponentWrappers?;
|
|
767
|
+
private _emptyValue?;
|
|
768
|
+
constructor(property: string);
|
|
769
|
+
/**
|
|
770
|
+
* converts field to given type with additional arguments
|
|
771
|
+
* @param fieldType field type enum
|
|
772
|
+
* @param args any additional arguments for field (optional)
|
|
773
|
+
*/
|
|
774
|
+
asType(fieldType: FieldInputTypeEnum, ...args: any[]): this;
|
|
775
|
+
get fieldType(): FieldInputTypeEnum;
|
|
776
|
+
get rows(): number | undefined;
|
|
777
|
+
get numberMin(): number | undefined;
|
|
778
|
+
get numberMax(): number | undefined;
|
|
779
|
+
get numberStep(): number | undefined;
|
|
780
|
+
get numberAutoCorrect(): boolean | undefined;
|
|
781
|
+
get numberMinFractionDigits(): number | undefined;
|
|
782
|
+
get numberMaxFractionDigits(): number | undefined;
|
|
783
|
+
get numberUseGrouping(): boolean;
|
|
784
|
+
get numberPrefix(): string | undefined;
|
|
785
|
+
get numberSuffix(): string | undefined;
|
|
786
|
+
get radioOptions(): RadioValue<string | number | boolean>[];
|
|
787
|
+
get radioLabelClassName(): string | undefined;
|
|
788
|
+
get datePickerFormat(): string | undefined;
|
|
789
|
+
get datePickerMin(): Date | FieldInputDatePickerDynamicMinMaxFnType<FieldValue, EditorModel, ParentEditorModel> | undefined;
|
|
790
|
+
get datePickerMax(): Date | FieldInputDatePickerDynamicMinMaxFnType<FieldValue, EditorModel, ParentEditorModel> | undefined;
|
|
791
|
+
get datePickerShowTime(): boolean | undefined;
|
|
792
|
+
get datePickerShowSeconds(): boolean | undefined;
|
|
793
|
+
get datePickerValueUtc(): boolean | undefined;
|
|
794
|
+
get datePickerValueNoTimezone(): boolean | undefined;
|
|
795
|
+
get datePickerValueNoTime(): boolean | undefined;
|
|
796
|
+
get datePickerValueAsDateObj(): boolean | undefined;
|
|
797
|
+
get maxLength(): number | undefined;
|
|
798
|
+
get minLength(): number | undefined;
|
|
799
|
+
get pattern(): string | RegExp | undefined;
|
|
800
|
+
get textTrim(): InputTrimType | undefined;
|
|
801
|
+
get emptyValue(): EmptyValueType | undefined;
|
|
802
|
+
get validationEmail(): boolean | undefined;
|
|
803
|
+
get mask(): string | undefined;
|
|
804
|
+
get slotChar(): string | undefined;
|
|
805
|
+
get fileMultiple(): boolean | undefined;
|
|
806
|
+
get fileMaxFileSize(): number | undefined;
|
|
807
|
+
get fileAccept(): string | undefined;
|
|
808
|
+
get fileOnSelectHandler(): FieldInputFileOnSelectHandlerFnType | undefined;
|
|
809
|
+
get imagePreview(): boolean | undefined;
|
|
810
|
+
get imageUrlInputVisibleOnDisabled(): boolean | undefined;
|
|
811
|
+
get imagePreviewAllowSvg(): boolean | undefined;
|
|
812
|
+
get imagePreviewComponent(): Type<FieldImagePreviewComponent> | undefined;
|
|
813
|
+
get customComponentType(): Type<AFormlyCustomFieldComponent<FieldValue, EditorModel, ParentEditorModel>> | undefined;
|
|
814
|
+
get customComponentInputs(): Record<string, any> | undefined;
|
|
815
|
+
get customComponentWrappers(): string[] | undefined;
|
|
816
|
+
get locale(): string | undefined;
|
|
817
|
+
get currency(): string | undefined;
|
|
818
|
+
get currencyFromProperty(): string | undefined;
|
|
819
|
+
get currencyDisplay(): "symbol" | "code" | "name";
|
|
820
|
+
asHidden(): this;
|
|
821
|
+
asLabel(): this;
|
|
822
|
+
asText(opts?: FieldInputTextOptsType): this;
|
|
823
|
+
asTextarea(opts?: FieldInputTextareaOptsType): this;
|
|
824
|
+
asNumber(opts?: FieldInputNumberOptsType): this;
|
|
825
|
+
asCurrency(opts?: FieldInputCurrencyOptsType<keyof EditorModel>): this;
|
|
826
|
+
asCurrencyUnsafe(opts?: FieldInputCurrencyOptsType): this;
|
|
827
|
+
asSwitch(): this;
|
|
828
|
+
asRadio(options: Array<string | number | boolean>, optionsTitlePath?: string): this;
|
|
829
|
+
asRadioFromEnum<Enum>(enumModel: EnumDescriptor<Enum>, values?: Array<Enum>): this;
|
|
830
|
+
asDatePicker(opts?: FieldInputDatePickerOptsType<FieldValue, EditorModel, ParentEditorModel>): this;
|
|
831
|
+
asMask(opts?: FieldInputMaskOptsType): this;
|
|
832
|
+
asFile(opts?: FieldInputFileOpts): this;
|
|
833
|
+
asImageFile(opts?: FieldInputFileOpts): this;
|
|
834
|
+
asImageUrl(opts?: FieldInputImageUrlOpts): this;
|
|
835
|
+
asCustomComponent(component: Type<AFormlyCustomFieldComponent<FieldValue, EditorModel, ParentEditorModel>>, opts?: FieldInputComponentOpts): this;
|
|
836
|
+
withNumberValidation(opts?: FieldInputNumberValidationOptsType): this;
|
|
837
|
+
withLocale(locale?: string): this;
|
|
838
|
+
withNumberFractions(opts?: FieldInputNumberFractionOptsType): this;
|
|
839
|
+
withNumberGrouping(useGrouping?: boolean): this;
|
|
840
|
+
withNumberDisplay(opts?: FieldInputNumberDisplayOptsType): this;
|
|
841
|
+
withTextareaRows(rows?: number): this;
|
|
842
|
+
withTextValidation(opts?: FieldInputTextValidationOptsType): this;
|
|
843
|
+
/**
|
|
844
|
+
* Common options for text input element (i.e. value value trimming).
|
|
845
|
+
* @param opts
|
|
846
|
+
*/
|
|
847
|
+
withTextCommonOpts(opts?: FieldInpuTextBaseOptsType): this;
|
|
848
|
+
/**
|
|
849
|
+
* Common options for input element (i.e. value on empty input).
|
|
850
|
+
* @param opts
|
|
851
|
+
*/
|
|
852
|
+
withInputCommonOpts(opts?: FieldInputOptsType): this;
|
|
853
|
+
withDatePickerDisplay(opts?: FieldInputDatePickerDisplayOptsType): this;
|
|
854
|
+
withDateValidation(opts?: FieldInputDateValidationOptsType<FieldValue, EditorModel, ParentEditorModel>): this;
|
|
855
|
+
withRadioOptions(opts: {
|
|
856
|
+
labelClassName?: string;
|
|
857
|
+
}): this;
|
|
858
|
+
withDateValue(opts?: FieldDateOptsType): this;
|
|
859
|
+
withTextValidationEmail(email?: boolean): this;
|
|
860
|
+
withFileOnSelectHandler(fn?: FieldInputFileOnSelectHandlerFnType): this;
|
|
861
|
+
copy(): FieldInputDescriptor<EditorModel, FieldModel, FieldValue, ParentEditorModel>;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
type FieldsManageAddFieldLookupOpts<FieldModel, Service> = {
|
|
865
|
+
type?: TypeDescriptor<FieldModel>;
|
|
866
|
+
serviceProvider?: FieldLookupProviderType<FieldModel, Service>;
|
|
867
|
+
};
|
|
868
|
+
interface IFieldsManageSafe<EditorModel, ParentEditorModel, GroupModel = EditorModel> {
|
|
869
|
+
removeField(property: keyof GroupModel): void;
|
|
870
|
+
addField<Property extends keyof GroupModel, FieldModel = NonNullable<GroupModel[Property]>, FieldValue = GroupModel[Property]>(property: Property): FieldInputDescriptor<EditorModel, FieldModel, FieldValue, ParentEditorModel>;
|
|
871
|
+
withFields(...properties: (keyof GroupModel)[]): this;
|
|
872
|
+
addFieldLookup<Property extends keyof GroupModel, Service = undefined, FieldModel extends NonNullable<GroupModel[Property]> = NonNullable<GroupModel[Property]>, FieldValue = GroupModel[Property]>(property: Property, opts?: FieldsManageAddFieldLookupOpts<FieldModel, Service>): FieldLookupDescriptor<FieldModel, EditorModel, Service, FieldValue, ParentEditorModel>;
|
|
873
|
+
addFieldLookupEnum<Property extends keyof GroupModel, Enum extends NonNullable<GroupModel[Property]>>(property: Property, enumModel: EnumDescriptor<Enum>, options?: Array<Enum>): FieldLookupEnumDescriptor<Enum, EditorModel, ParentEditorModel>;
|
|
874
|
+
addFieldManyEditor<Property extends keyof GroupModel, FieldModel = ArrayItemType<GroupModel[Property]>, FieldValue = GroupModel[Property]>(property: Property, tableviewDescriptor: ITableviewDescriptor<FieldModel, any, any, EditorModel, FieldModel, FieldModel, FieldModel>): FieldManyEditorDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel>;
|
|
875
|
+
addFieldManyToManyEditor<Property extends keyof GroupModel, Service, FieldModel = ArrayItemType<GroupModel[Property]>, FieldValue = GroupModel[Property]>(property: Property, mainTableDescriptor: ITableDescriptor<FieldModel, any, any>, lookupTableDescriptor: ITableDescriptor<FieldModel, any, any>, lookupDataProvider: ITableDataProvider<FieldModel, Service>): FieldManyToManyEditorDescriptor<FieldModel, EditorModel, Service, FieldValue, ParentEditorModel>;
|
|
876
|
+
addFieldDescriptor<FieldModel, FieldValue = FieldModel>(field: AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel>): this;
|
|
877
|
+
}
|
|
878
|
+
interface IFieldManageSafeWithGetField<EditorModel, ParentEditorModel, GroupModel = EditorModel> extends IFieldsManageSafe<EditorModel, ParentEditorModel, GroupModel> {
|
|
879
|
+
getField<Property extends keyof GroupModel, FieldModel = NonNullable<GroupModel[Property]>, FieldValue = GroupModel[Property]>(property: Property): AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel> | null;
|
|
880
|
+
}
|
|
881
|
+
interface IFieldsManage<EditorModel, ParentEditorModel> extends IFieldsManageSafe<EditorModel, ParentEditorModel> {
|
|
882
|
+
removeFieldUnsafe(property: string): void;
|
|
883
|
+
addFieldUnsafe<FieldModel = FieldInputDescriptorType, FieldValue = FieldModel>(property: string): FieldInputDescriptor<EditorModel, FieldModel, FieldValue, ParentEditorModel>;
|
|
884
|
+
addFieldAction(actionName: string): FieldActionDescriptor<EditorModel, ParentEditorModel>;
|
|
885
|
+
addFieldLookupUnsafe<FieldModel, Service = undefined, FieldValue = FieldModel>(property: string, opts?: FieldsManageAddFieldLookupOpts<FieldModel, Service>): FieldLookupDescriptor<FieldModel, EditorModel, Service, FieldValue, ParentEditorModel>;
|
|
886
|
+
addFieldLookupEnumUnsafe<Enum = EnumConstantType>(property: string, enumModel: EnumDescriptor<Enum>, options?: Array<Enum>): FieldLookupEnumDescriptor<Enum, EditorModel, ParentEditorModel>;
|
|
887
|
+
addFieldManyEditorUnsafe<FieldModel, FieldValue = FieldModel[]>(property: string, tableviewDescriptor: ITableviewDescriptor<FieldModel, any, any, EditorModel, FieldModel, FieldModel, FieldModel>): FieldManyEditorDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel>;
|
|
888
|
+
addFieldManyToManyEditorUnsafe<FieldModel, Service, FieldValue = FieldModel[]>(property: string, mainTableDescriptor: ITableDescriptor<FieldModel, any, any>, lookupTableDescriptor: ITableDescriptor<FieldModel, any, any>, lookupDataProvider: ITableDataProvider<FieldModel, Service>): FieldManyToManyEditorDescriptor<FieldModel, EditorModel, Service, FieldValue, ParentEditorModel>;
|
|
889
|
+
withValidation<Value = EditorModel>(name: string, validator?: FormValidator<Value, ParentEditorModel>, message?: FormValidationMessage<Value, ParentEditorModel>, opts?: FieldValidationDescriptorOptsType<keyof EditorModel>): this;
|
|
890
|
+
withValidationUnsafe<Value = EditorModel>(name: string, validator?: FormValidator<Value, ParentEditorModel>, message?: FormValidationMessage<Value, ParentEditorModel>, opts?: FieldValidationDescriptorOptsType): this;
|
|
891
|
+
}
|
|
892
|
+
interface IFieldsManageWithGetField<EditorModel, ParentEditorModel> extends IFieldsManage<EditorModel, ParentEditorModel> {
|
|
893
|
+
getField<Property extends keyof EditorModel, FieldModel = NonNullable<EditorModel[Property]>, FieldValue = EditorModel[Property]>(property: Property): AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel> | null;
|
|
894
|
+
getFieldUnsafe<FieldModel, FieldValue = FieldModel>(property: string): AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel> | null;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
declare enum TableviewEditorTypeEnum {
|
|
898
|
+
None = 0,
|
|
899
|
+
Details = 1,
|
|
900
|
+
Edit = 2,
|
|
901
|
+
Add = 3
|
|
902
|
+
}
|
|
903
|
+
declare const EDITOR_DEFAULT_GROUP_NAME = "_default";
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* Helper type for cases when you need to custom define FieldsManageModel on TableviewDescriptorInst from only one model (single model).
|
|
907
|
+
*/
|
|
908
|
+
type TableviewDescriptorFieldsManageSingleType<TableviewModel> = CommonPropsObjType3<TableviewModel, TableviewModel, TableviewModel>;
|
|
909
|
+
/**
|
|
910
|
+
* Helper type for cases when you need to custom define FieldsManageModel on TableviewDescriptorInst from only 3 models (multi model).
|
|
911
|
+
*/
|
|
912
|
+
type TableviewDescriptorFieldsManageMultiType<TableviewModel, AddModel, EditModel> = CommonPropsObjType3<TableviewModel, AddModel, EditModel>;
|
|
913
|
+
|
|
914
|
+
type TableviewDescriptorInstConstructorOpts<TableModel, AddModel, EditModel> = {
|
|
915
|
+
tableModel?: ModelDescriptor<TableModel>;
|
|
916
|
+
addModel?: ModelDescriptor<AddModel>;
|
|
917
|
+
editModel?: ModelDescriptor<EditModel>;
|
|
918
|
+
};
|
|
919
|
+
declare class TableviewDescriptorInst<TableviewModel, Sorts = keyof TableviewModel, Filters = keyof TableviewModel, ParentEditorModel = undefined, TableModel = TableviewModel, AddModel = TableviewModel, EditModel = TableviewModel, FieldsManageModel = TableviewDescriptorFieldsManageMultiType<TableviewModel, AddModel, EditModel>> implements ITableviewDescriptor<TableviewModel, Sorts, Filters, ParentEditorModel, TableModel, AddModel, EditModel>, IColumnsManageInterface<TableModel, Sorts, Filters>, IFieldsManage<FieldsManageModel, ParentEditorModel> {
|
|
920
|
+
private readonly _model;
|
|
921
|
+
protected _table: TableDescriptorInst<TableModel, Sorts, Filters>;
|
|
922
|
+
protected _detailsEditor: EditorDescriptorInst<TableviewModel, ParentEditorModel>;
|
|
923
|
+
protected _addEditor: EditorDescriptorInst<AddModel, ParentEditorModel>;
|
|
924
|
+
protected _editEditor: EditorDescriptorInst<EditModel, ParentEditorModel>;
|
|
925
|
+
protected _isLocalized: boolean;
|
|
926
|
+
constructor(model: ModelDescriptor<TableviewModel>, opts?: TableviewDescriptorInstConstructorOpts<TableModel, AddModel, EditModel>);
|
|
927
|
+
get table(): TableDescriptorInst<TableModel, Sorts, Filters>;
|
|
928
|
+
get detailsEditor(): EditorDescriptorInst<TableviewModel, ParentEditorModel>;
|
|
929
|
+
get addEditor(): EditorDescriptorInst<AddModel, ParentEditorModel>;
|
|
930
|
+
get editEditor(): EditorDescriptorInst<EditModel, ParentEditorModel>;
|
|
931
|
+
get model(): ModelDescriptor<TableviewModel>;
|
|
932
|
+
isLocalized(): boolean;
|
|
933
|
+
withTableDescriptor(descriptor: TableDescriptorInst<TableModel, Sorts, Filters>): this;
|
|
934
|
+
withEditorDescriptors(descriptor: EditorDescriptorInst<TableviewModel, ParentEditorModel>): this;
|
|
935
|
+
withDetailsDescriptor(descriptor: EditorDescriptorInst<TableviewModel, ParentEditorModel>): this;
|
|
936
|
+
withAddDescriptor(descriptor: EditorDescriptorInst<AddModel, ParentEditorModel>): this;
|
|
937
|
+
withEditDescriptor(descriptor: EditorDescriptorInst<EditModel, ParentEditorModel>): this;
|
|
938
|
+
/**
|
|
939
|
+
* creates new copy of editor descriptor and makes it disabled
|
|
940
|
+
* usable in combination with this::withEditorDescriptors, where detailsDescriptor is made non-disabled
|
|
941
|
+
* @param type which editor type to set to disabled
|
|
942
|
+
*/
|
|
943
|
+
withDisabledEditorDescriptor(type?: TableviewEditorTypeEnum): this;
|
|
944
|
+
withValidation<Value = TableviewModel>(name: string, expression: FormValidator<Value, ParentEditorModel>, message?: FormValidationMessage<Value, ParentEditorModel>, opts?: FieldValidationDescriptorOptsType<keyof FieldsManageModel>): this;
|
|
945
|
+
withValidationUnsafe<Value = TableviewModel>(name: string, expression: FormValidator<Value, ParentEditorModel>, message?: FormValidationMessage<Value, ParentEditorModel>, opts?: FieldValidationDescriptorOptsType): this;
|
|
946
|
+
getColumn<Property extends keyof TableModel, ColumnModel = NonNullable<TableModel[Property]>, ColumnValue = TableModel[Property]>(property: Property): ColumnDescriptor<ColumnModel, TableModel, ColumnValue> | null;
|
|
947
|
+
getColumnUnsafe<ColumnModel = any, ColumnValue = ColumnModel>(property: string): ColumnDescriptor<ColumnModel, TableModel, ColumnValue> | null;
|
|
948
|
+
removeColumn(property: keyof TableModel): void;
|
|
949
|
+
removeColumnUnsafe(property: string): void;
|
|
950
|
+
withColumn<ColumnModel, ColumnValue = ColumnModel>(column: ColumnDescriptor<ColumnModel, TableModel, ColumnValue>): this;
|
|
951
|
+
addColumn<Property extends keyof TableModel>(property: Property): ColumnDescriptor<NonNullable<TableModel[Property]>, TableModel, TableModel[Property]>;
|
|
952
|
+
addColumnEnum<PropertyKey extends keyof TableModel, Enum extends NonNullable<TableModel[PropertyKey]>>(property: PropertyKey, enumDesc: EnumDescriptor<Enum>): ColumnDescriptor<Enum, TableModel, TableModel[PropertyKey]>;
|
|
953
|
+
addColumnUnsafe<ColumnModel = any>(property: string): ColumnDescriptor<ColumnModel, TableModel>;
|
|
954
|
+
withColumns(...properties: (keyof TableModel)[]): this;
|
|
955
|
+
getSort(property: Sorts): _mediusinc_mng_commons_table_api.SortDescriptor<TableModel> | null;
|
|
956
|
+
getSortUnsafe(property: string): _mediusinc_mng_commons_table_api.SortDescriptor<TableModel> | null;
|
|
957
|
+
removeSort(property: Sorts): void;
|
|
958
|
+
removeSortUnsafe(property: string): void;
|
|
959
|
+
addSort(property: Sorts, isDefault?: boolean, ascending?: boolean): _mediusinc_mng_commons_table_api.SortDescriptor<TableModel>;
|
|
960
|
+
addSortUnsafe(property: string, isDefault?: boolean, ascending?: boolean): _mediusinc_mng_commons_table_api.SortDescriptor<TableModel>;
|
|
961
|
+
withSort(property: Sorts, isDefault?: boolean, ascending?: boolean): this;
|
|
962
|
+
withSortUnsafe(property: string, isDefault?: boolean, ascending?: boolean): this;
|
|
963
|
+
withDefaultSort(property: Sorts, ascending?: boolean, enabled?: boolean): this;
|
|
964
|
+
withDefaultSortUnsafe(property: string, ascending?: boolean, enabled?: boolean): this;
|
|
965
|
+
withSorts(...properties: Sorts[]): this;
|
|
966
|
+
withSortsUnsafe(...properties: string[]): this;
|
|
967
|
+
withDefaultSorts(...properties: Sorts[]): this;
|
|
968
|
+
withoutDefaultSorts(): this;
|
|
969
|
+
getFilter<FilterModel = Filters extends keyof TableModel ? NonNullable<TableModel[Filters]> : any>(property: Filters): FilterDescriptor<FilterModel, TableModel> | null;
|
|
970
|
+
getFilterUnsafe<FilterModel = any>(property: string): FilterDescriptor<FilterModel, TableModel> | null;
|
|
971
|
+
removeFilter(property: Filters): void;
|
|
972
|
+
removeFilterUnsafe(property: string): void;
|
|
973
|
+
addFilter<FilterModel = Filters extends keyof TableModel ? TableModel[Filters] : never>(property: Filters): FilterDescriptor<FilterModel, TableModel>;
|
|
974
|
+
addFilterUnsafe<FilterModel>(property: string): FilterDescriptor<FilterModel, TableModel>;
|
|
975
|
+
addFilterLookup<FilterModel = Filters extends keyof TableModel ? NonNullable<TableModel[Filters]> : never, Service = undefined>(property: Filters, provider?: ILookupDataProvider<FilterModel, Service, any, any>, optionsValueProperty?: keyof FilterModel): _mediusinc_mng_commons_filter.FilterLookupDescriptor<FilterModel, TableModel, Service, FilterModel, keyof FilterModel, keyof FilterModel>;
|
|
976
|
+
addFilterLookupUnsafe<FilterModel, Service = undefined>(property: string, provider?: ILookupDataProvider<FilterModel, Service, any, any>, optionsValueProperty?: string): _mediusinc_mng_commons_filter.FilterLookupDescriptor<FilterModel, TableModel, Service, FilterModel, keyof FilterModel, keyof FilterModel>;
|
|
977
|
+
addFilterLookupEnum<Enum>(property: Filters, enumDesc: EnumDescriptor<Enum>, options?: Array<Enum>): _mediusinc_mng_commons_filter.FilterLookupEnumDescriptor<Enum, unknown>;
|
|
978
|
+
addFilterLookupEnumUnsafe<Enum = EnumConstantType>(property: string, enumDesc: EnumDescriptor<Enum>, options?: Array<Enum>): _mediusinc_mng_commons_filter.FilterLookupEnumDescriptor<Enum, unknown>;
|
|
979
|
+
addFilterFromColumn<Property extends keyof TableModel, FilterModel = NonNullable<TableModel[Property]>>(property: Extract<Filters, Property>, displayType?: FilterDisplayTypeEnum, forceSimple?: boolean): FilterDescriptor<FilterModel, TableModel>;
|
|
980
|
+
withFiltersFromColumns(...properties: Extract<Filters, keyof TableModel>[]): this;
|
|
981
|
+
withFiltersFromColumnsUnsafe(...properties: string[]): this;
|
|
982
|
+
addFilterFromColumnUnsafe(property: string, displayType?: FilterDisplayTypeEnum, forceSimple?: boolean): FilterDescriptor<any, TableModel>;
|
|
983
|
+
withFilter<FilterModel>(property: Filters, filter: FilterDescriptor<FilterModel, TableModel>): this;
|
|
984
|
+
withFilterUnsafe<FilterModel>(filter: FilterDescriptor<FilterModel, TableModel>): this;
|
|
985
|
+
removeField(property: keyof FieldsManageModel): void;
|
|
986
|
+
removeFieldUnsafe(property: string): void;
|
|
987
|
+
addFieldDescriptor<FieldModel, FieldValue = FieldModel>(field: AFieldDescriptor<FieldModel, FieldsManageModel, FieldValue, ParentEditorModel>): this;
|
|
988
|
+
addField<Property extends keyof FieldsManageModel, FieldModel = NonNullable<FieldsManageModel[Property]>, FieldValue = FieldsManageModel[Property]>(property: Property): FieldInputDescriptor<FieldsManageModel, FieldModel, FieldValue, ParentEditorModel>;
|
|
989
|
+
addFieldUnsafe<FieldModel = FieldInputDescriptorType, FieldValue = FieldModel>(property: string): FieldInputDescriptor<FieldsManageModel, FieldModel, FieldValue, ParentEditorModel>;
|
|
990
|
+
withFields(...properties: (keyof FieldsManageModel)[]): this;
|
|
991
|
+
addFieldAction(actionName: string): FieldActionDescriptor<FieldsManageModel, ParentEditorModel>;
|
|
992
|
+
private addFieldToEditAndAdd;
|
|
993
|
+
/**
|
|
994
|
+
* Adds lookup field.
|
|
995
|
+
*
|
|
996
|
+
* @param {Property} property - The property key of the editor.
|
|
997
|
+
* @param {FieldsManageAddFieldLookupOpts<LookupModel, Service>} opts - Optional parameters configuring type and/or service provider.
|
|
998
|
+
* @typeparam Property - The property key of the EditorModel.
|
|
999
|
+
* @typeparam LookupModel - The field model type, defaults to the non-nullable type of the editor's property.
|
|
1000
|
+
* @typeparam Service - Service used for data provider.
|
|
1001
|
+
* @typeparam FieldValue - The value type of field on editor.
|
|
1002
|
+
*
|
|
1003
|
+
* @returns {FieldLookupDescriptor<LookupModel, FieldsManageModel, Service, FieldValue>} - The field lookup descriptor.
|
|
1004
|
+
*/
|
|
1005
|
+
addFieldLookup<Property extends keyof FieldsManageModel, Service = undefined, LookupModel extends NonNullable<FieldsManageModel[Property]> = NonNullable<FieldsManageModel[Property]>, FieldValue = FieldsManageModel[Property]>(property: Property, opts?: FieldsManageAddFieldLookupOpts<LookupModel, Service>): FieldLookupDescriptor<LookupModel, FieldsManageModel, Service, FieldValue, ParentEditorModel, keyof LookupModel, keyof LookupModel>;
|
|
1006
|
+
/**
|
|
1007
|
+
* [UNSAFE] Adds lookup field.
|
|
1008
|
+
* This function is UNSAFE because property is not type-checked.
|
|
1009
|
+
*
|
|
1010
|
+
* @param {string} property Model property name.
|
|
1011
|
+
* @param {FieldsManageAddFieldLookupOpts<LookupModel, Service>} opts - Optional parameters configuring type and/or service provider.
|
|
1012
|
+
* @typeparam LookupModel - The field model type, defaults to the non-nullable type of the editor's property.
|
|
1013
|
+
* @typeparam Service - Service used for data provider.
|
|
1014
|
+
* @typeparam FieldValue - The value type of field on editor.
|
|
1015
|
+
*
|
|
1016
|
+
* @returns {FieldLookupDescriptor<LookupModel, EditorModel, Service, FieldValue>} - The field lookup descriptor.
|
|
1017
|
+
*/
|
|
1018
|
+
addFieldLookupUnsafe<LookupModel, Service = undefined, FieldValue = LookupModel>(property: string, opts?: FieldsManageAddFieldLookupOpts<LookupModel, Service>): FieldLookupDescriptor<LookupModel, FieldsManageModel, Service, FieldValue, ParentEditorModel>;
|
|
1019
|
+
addFieldLookupEnum<Property extends keyof FieldsManageModel, Enum extends NonNullable<FieldsManageModel[Property]>>(property: Property, enumDesc: EnumDescriptor<Enum>, options?: Array<Enum>): FieldLookupEnumDescriptor<Enum, FieldsManageModel, ParentEditorModel>;
|
|
1020
|
+
addFieldLookupEnumUnsafe<Enum = EnumConstantType>(property: string, enumDesc: EnumDescriptor<Enum>, options?: Array<Enum>): FieldLookupEnumDescriptor<Enum, FieldsManageModel, ParentEditorModel>;
|
|
1021
|
+
addFieldManyEditor<Property extends keyof FieldsManageModel, FieldModel = ArrayItemType<FieldsManageModel[Property]>, FieldValue = FieldsManageModel[Property]>(property: Property, tableviewDescriptor: TableviewDescriptorInst<FieldModel, any, any, FieldsManageModel, FieldModel, FieldModel, FieldModel, FieldModel>): FieldManyEditorDescriptor<FieldModel, FieldsManageModel, FieldValue, ParentEditorModel>;
|
|
1022
|
+
addFieldManyEditorUnsafe<FieldModel, FieldValue = FieldModel[]>(property: string, tableviewDescriptor: TableviewDescriptorInst<FieldModel, any, any, FieldsManageModel, FieldModel, FieldModel, FieldModel, FieldModel>): FieldManyEditorDescriptor<FieldModel, FieldsManageModel, FieldValue, ParentEditorModel>;
|
|
1023
|
+
addFieldManyToManyEditor<Property extends keyof FieldsManageModel, Service, FieldModel = ArrayItemType<FieldsManageModel[Property]>, FieldValue = FieldsManageModel[Property]>(property: Property, mainTableDescriptor: TableDescriptorInst<FieldModel>, lookupTableDescriptor: TableDescriptorInst<FieldModel>, lookupDataProvider: ITableDataProvider<FieldModel, Service>): FieldManyToManyEditorDescriptor<FieldModel, FieldsManageModel, Service, FieldValue, ParentEditorModel>;
|
|
1024
|
+
addFieldManyToManyEditorUnsafe<FieldModel, Service, FieldValue = FieldModel[]>(property: string, mainTableDescriptor: TableDescriptorInst<FieldModel>, lookupTableDescriptor: TableDescriptorInst<FieldModel>, lookupDataProvider: ITableDataProvider<FieldModel, Service>): FieldManyToManyEditorDescriptor<FieldModel, FieldsManageModel, Service, FieldValue, ParentEditorModel>;
|
|
1025
|
+
withTabGroup(name: string, title?: string): this;
|
|
1026
|
+
withFieldGroup(name: string, title?: string): this;
|
|
1027
|
+
copy(): TableviewDescriptorInst<TableviewModel, Sorts, Filters, ParentEditorModel, TableModel, AddModel, EditModel, FieldsManageModel>;
|
|
1028
|
+
localized<Property extends keyof TableviewModel, LocalizationModel = ArrayItemType<TableviewModel[Property]>>(property: Property, model: ModelDescriptor<LocalizationModel>, localeProperty: keyof LocalizationModel): this;
|
|
1029
|
+
localizedUnsafe<LocalizationModel>(property: string, model: ModelDescriptor<LocalizationModel>, localeProperty: string): this;
|
|
1030
|
+
}
|
|
1031
|
+
declare class TableviewDynamicDescriptorInt extends TableviewDescriptorInst<any> {
|
|
1032
|
+
protected _table: TableDynamicDescriptorInst;
|
|
1033
|
+
constructor(model: ModelDescriptor<any>);
|
|
1034
|
+
get table(): TableDynamicDescriptorInst;
|
|
1035
|
+
/**
|
|
1036
|
+
* sets custom table descriptor
|
|
1037
|
+
* @param descriptor
|
|
1038
|
+
*/
|
|
1039
|
+
withTableDescriptor(descriptor: TableDynamicDescriptorInst): this;
|
|
1040
|
+
/**
|
|
1041
|
+
* sets visibility hidden state to column with given property
|
|
1042
|
+
* equals to be removing in auto and base tableview descriptor
|
|
1043
|
+
* * @param property column's property
|
|
1044
|
+
*/
|
|
1045
|
+
removeColumn(property: string): this;
|
|
1046
|
+
withEntityForTranslations(i18nBaseKey: string): this;
|
|
1047
|
+
/**
|
|
1048
|
+
* creates deep copy of tableview object and its children
|
|
1049
|
+
*/
|
|
1050
|
+
copy(): TableviewDynamicDescriptorInt;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* @experimental
|
|
1055
|
+
*/
|
|
1056
|
+
declare class EditorDescriptorNestedObjectWrapper<EditorModel, ParentEditorModel, PropertyObjectModel> implements IFieldManageSafeWithGetField<EditorModel, ParentEditorModel, PropertyObjectModel> {
|
|
1057
|
+
#private;
|
|
1058
|
+
constructor(editor: IFieldsManageWithGetField<EditorModel, ParentEditorModel>, basePath: string);
|
|
1059
|
+
nested<Property extends keyof PropertyObjectModel>(property: Property): EditorDescriptorNestedObjectWrapper<EditorModel, ParentEditorModel, NonNullable<PropertyObjectModel[Property]>>;
|
|
1060
|
+
getNestedPropertyPath(p: keyof PropertyObjectModel): string;
|
|
1061
|
+
getField<Property extends keyof PropertyObjectModel, FieldModel = NonNullable<PropertyObjectModel[Property]>, FieldValue = PropertyObjectModel[Property]>(property: Property): AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel> | null;
|
|
1062
|
+
removeField(property: keyof PropertyObjectModel): void;
|
|
1063
|
+
addField<PropertyField extends keyof PropertyObjectModel, FieldModel = NonNullable<PropertyObjectModel[PropertyField]>, FieldValue = PropertyObjectModel[PropertyField]>(property: PropertyField): _mediusinc_mng_commons_tableview_api.FieldInputDescriptor<EditorModel, FieldModel, FieldValue, ParentEditorModel>;
|
|
1064
|
+
withFields(...properties: (keyof PropertyObjectModel)[]): this;
|
|
1065
|
+
addFieldLookup<Property extends keyof PropertyObjectModel, Service = undefined, FieldModel extends NonNullable<PropertyObjectModel[Property]> = NonNullable<PropertyObjectModel[Property]>, FieldValue = PropertyObjectModel[Property]>(property: Property, opts?: FieldsManageAddFieldLookupOpts<FieldModel, Service>): _mediusinc_mng_commons_tableview_api.FieldLookupDescriptor<FieldModel, EditorModel, Service, FieldValue, ParentEditorModel, keyof FieldModel, keyof FieldModel>;
|
|
1066
|
+
addFieldLookupEnum<Property extends keyof PropertyObjectModel, Enum extends NonNullable<PropertyObjectModel[Property]>>(property: Property, enumModel: EnumDescriptor<Enum>, options?: Array<Enum>): FieldLookupEnumDescriptor<Enum, EditorModel, ParentEditorModel>;
|
|
1067
|
+
addFieldManyEditor<Property extends keyof PropertyObjectModel, FieldModel = ArrayItemType<PropertyObjectModel[Property]>, FieldValue = PropertyObjectModel[Property]>(property: Property, tableviewDescriptor: ITableviewDescriptor<FieldModel, any, any, EditorModel, FieldModel, FieldModel, FieldModel>): FieldManyEditorDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel>;
|
|
1068
|
+
addFieldManyToManyEditor<Property extends keyof PropertyObjectModel, Service, FieldModel = ArrayItemType<PropertyObjectModel[Property]>, FieldValue = PropertyObjectModel[Property]>(property: Property, mainTableDescriptor: ITableDescriptor<FieldModel, any, any>, lookupTableDescriptor: ITableDescriptor<FieldModel, any, any>, lookupDataProvider: ITableDataProvider<FieldModel, Service>): FieldManyToManyEditorDescriptor<FieldModel, EditorModel, Service, FieldValue, ParentEditorModel>;
|
|
1069
|
+
addFieldDescriptor<FieldModel, FieldValue = FieldModel>(field: AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel>): this;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
declare class EditorDescriptorInst<EditorModel, ParentEditorModel = undefined> implements IEditorDescriptor<EditorModel, ParentEditorModel>, IFieldsManageWithGetField<EditorModel, ParentEditorModel> {
|
|
1073
|
+
static readonly defaultGroupName = "_default";
|
|
1074
|
+
/** @ignore */ protected readonly _model: ModelDescriptor<EditorModel>;
|
|
1075
|
+
/** @ignore */ protected readonly _tableviewEditorType: TableviewEditorTypeEnum;
|
|
1076
|
+
/** @ignore */ protected readonly _tabs: Array<FieldTabGroupDescriptor<EditorModel>>;
|
|
1077
|
+
/** @ignore */ protected readonly _groups: Array<FieldGroupDescriptor<EditorModel, ParentEditorModel>>;
|
|
1078
|
+
/** @ignore */ protected _fields: Array<AFieldDescriptor<any, EditorModel>>;
|
|
1079
|
+
/** @ignore */ protected _currentTabGroup?: FieldTabGroupDescriptor<EditorModel>;
|
|
1080
|
+
/** @ignore */ protected _currentGroup?: FieldGroupDescriptor<EditorModel>;
|
|
1081
|
+
/** @ignore */ protected _autoSave?: boolean;
|
|
1082
|
+
/** @ignore */ protected _autoSaveIdentifier?: string;
|
|
1083
|
+
/** @ignore */ protected _autofocusOnField?: boolean;
|
|
1084
|
+
/** @ignore */ protected _disabled: boolean;
|
|
1085
|
+
/** @ignore */ protected _isLocalized: boolean;
|
|
1086
|
+
/** @ignore */ protected _localizationLocaleProperty?: string;
|
|
1087
|
+
/** @ignore */ protected _localizationModel?: ModelDescriptor<any>;
|
|
1088
|
+
/** @ignore */ protected _localizationLocalizationProperty?: string;
|
|
1089
|
+
/** @ignore */ protected readonly _eventsSubject: Subject<FormEvent<EditorModel, ParentEditorModel>>;
|
|
1090
|
+
/**
|
|
1091
|
+
* Creates new instance of editor descriptor.
|
|
1092
|
+
* @param model Model descriptor.
|
|
1093
|
+
* @param tableviewEditorType Type of editor in tableview (add, edit, view or none).
|
|
1094
|
+
*/
|
|
1095
|
+
constructor(model: ModelDescriptor<EditorModel>, tableviewEditorType?: TableviewEditorTypeEnum);
|
|
1096
|
+
/**
|
|
1097
|
+
* Model descriptor for editor.
|
|
1098
|
+
*/
|
|
1099
|
+
get model(): ModelDescriptor<EditorModel>;
|
|
1100
|
+
/**
|
|
1101
|
+
* Editor's tabs.
|
|
1102
|
+
*/
|
|
1103
|
+
get tabs(): FieldTabGroupDescriptor<EditorModel>[];
|
|
1104
|
+
/**
|
|
1105
|
+
* Editor's fields.
|
|
1106
|
+
*/
|
|
1107
|
+
get fields(): AFieldDescriptor<any, EditorModel, any, undefined>[];
|
|
1108
|
+
/**
|
|
1109
|
+
* Type of editor for tableview.
|
|
1110
|
+
*/
|
|
1111
|
+
get tableviewEditorType(): TableviewEditorTypeEnum;
|
|
1112
|
+
/**
|
|
1113
|
+
* If editor is disabled.
|
|
1114
|
+
*/
|
|
1115
|
+
get disabled(): boolean;
|
|
1116
|
+
get isLocalized(): boolean;
|
|
1117
|
+
get localizationLocaleProperty(): string | undefined;
|
|
1118
|
+
get localizationLocalizationProperty(): string | undefined;
|
|
1119
|
+
get localizationModel(): ModelDescriptor<any> | undefined;
|
|
1120
|
+
get autoSave(): boolean | undefined;
|
|
1121
|
+
get autoSaveIdentifier(): string | undefined;
|
|
1122
|
+
get autofocusOnField(): boolean | undefined;
|
|
1123
|
+
/**
|
|
1124
|
+
* Dives into nested object to add fields from the nested object on property.
|
|
1125
|
+
*
|
|
1126
|
+
* @experimental
|
|
1127
|
+
*
|
|
1128
|
+
* @param property Model property name.
|
|
1129
|
+
*/
|
|
1130
|
+
nested<Property extends keyof EditorModel>(property: Property): EditorDescriptorNestedObjectWrapper<EditorModel, ParentEditorModel, NonNullable<EditorModel[Property]>>;
|
|
1131
|
+
/**
|
|
1132
|
+
* Creates new tab group. Next added fields are added to newly created tab group.
|
|
1133
|
+
* @param name Name of the group.
|
|
1134
|
+
* @param title Title key for the tab.7@return Newly created group descriptor.
|
|
1135
|
+
* @return Newly created group descriptor.
|
|
1136
|
+
*/
|
|
1137
|
+
addTabGroup(name: string, title?: string): FieldTabGroupDescriptor<EditorModel>;
|
|
1138
|
+
/**
|
|
1139
|
+
* Creates new tab group. Next added fields are added to newly created tab group.
|
|
1140
|
+
* @param name Name of the group.
|
|
1141
|
+
* @param title Title key for the tab.7@return Newly created group descriptor.
|
|
1142
|
+
*/
|
|
1143
|
+
withTabGroup(name: string, title?: string): this;
|
|
1144
|
+
/**
|
|
1145
|
+
* Gets group by its name (key).
|
|
1146
|
+
* @param name Group's key.
|
|
1147
|
+
*/
|
|
1148
|
+
getGroup(name: string | number): FieldGroupDescriptor<EditorModel> | null;
|
|
1149
|
+
/**
|
|
1150
|
+
* Creates new field group. Next added fields are added to newly created field group.
|
|
1151
|
+
* @param name Name of the group.
|
|
1152
|
+
* @param title Title key for the group.
|
|
1153
|
+
* @return Newly created group descriptor.
|
|
1154
|
+
*/
|
|
1155
|
+
addFieldGroup(name: string, title?: string | null): FieldGroupDescriptor<EditorModel>;
|
|
1156
|
+
/**
|
|
1157
|
+
* Creates new field group. Next added fields are added to newly created field group.
|
|
1158
|
+
* @param name Name of the group.
|
|
1159
|
+
* @param title Title key for the group.
|
|
1160
|
+
*/
|
|
1161
|
+
withFieldGroup(name: string, title?: string): this;
|
|
1162
|
+
/**
|
|
1163
|
+
* Gets field by the model property name.
|
|
1164
|
+
* @param property Model property name.
|
|
1165
|
+
*/
|
|
1166
|
+
getField<Property extends keyof EditorModel, FieldModel = NonNullable<EditorModel[Property]>, FieldValue = EditorModel[Property]>(property: Property): AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel> | null;
|
|
1167
|
+
/**
|
|
1168
|
+
* Gets field by the model property name (UNSAFE).
|
|
1169
|
+
* @param property Model property name.
|
|
1170
|
+
*/
|
|
1171
|
+
getFieldUnsafe<FieldModel, FieldValue = FieldModel>(property: string): AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel> | null;
|
|
1172
|
+
/**
|
|
1173
|
+
* Removes field by the model property name.
|
|
1174
|
+
* @param property Model property name.
|
|
1175
|
+
*/
|
|
1176
|
+
removeField(property: keyof EditorModel): void;
|
|
1177
|
+
/**
|
|
1178
|
+
* Removes field by the model property name (UNSAFE).
|
|
1179
|
+
* @param property Model property name.
|
|
1180
|
+
*/
|
|
1181
|
+
removeFieldUnsafe(property: string): void;
|
|
1182
|
+
/**
|
|
1183
|
+
* Adds field by the descriptor.
|
|
1184
|
+
* @param field Field descriptor.
|
|
1185
|
+
*/
|
|
1186
|
+
addFieldDescriptor<FieldModel, FieldValue = FieldModel>(field: AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel>): this;
|
|
1187
|
+
/**
|
|
1188
|
+
* Adds field by the model property name.
|
|
1189
|
+
* @param property Model property name.
|
|
1190
|
+
*/
|
|
1191
|
+
addField<Property extends keyof EditorModel, FieldModel = NonNullable<EditorModel[Property]>, FieldValue = EditorModel[Property]>(property: Property): FieldInputDescriptor<EditorModel, FieldModel, FieldValue, ParentEditorModel>;
|
|
1192
|
+
/**
|
|
1193
|
+
* Adds field by the model property name (UNSAFE). Property is not checked on editor model.
|
|
1194
|
+
* Use {addField} for safe usage.
|
|
1195
|
+
* @param property Model property name.
|
|
1196
|
+
*/
|
|
1197
|
+
addFieldUnsafe<FieldModel = FieldInputDescriptorType, FieldValue = FieldModel>(property: string): FieldInputDescriptor<EditorModel, FieldModel, FieldValue, ParentEditorModel>;
|
|
1198
|
+
withFields(...properties: (keyof EditorModel)[]): this;
|
|
1199
|
+
addFieldAction(actionName: string): FieldActionDescriptor<EditorModel, ParentEditorModel>;
|
|
1200
|
+
/**
|
|
1201
|
+
* Adds lookup field.
|
|
1202
|
+
*
|
|
1203
|
+
* @param {Property} property - The property key of the editor.
|
|
1204
|
+
* @param {FieldsManageAddFieldLookupOpts<LookupModel, Service>} opts - Optional parameters configuring type and/or service provider.
|
|
1205
|
+
* @typeparam Property - The property key of the EditorModel.
|
|
1206
|
+
* @typeparam LookupModel - The field model type, defaults to the non-nullable type of the editor's property.
|
|
1207
|
+
* @typeparam Service - Service used for data provider.
|
|
1208
|
+
* @typeparam FieldValue - The value type of field on editor.
|
|
1209
|
+
*
|
|
1210
|
+
* @returns {FieldLookupDescriptor<LookupModel, EditorModel, Service, FieldValue>} - The field lookup descriptor.
|
|
1211
|
+
*/
|
|
1212
|
+
addFieldLookup<Property extends keyof EditorModel, Service = undefined, LookupModel extends NonNullable<EditorModel[Property]> = NonNullable<EditorModel[Property]>, FieldValue = EditorModel[Property]>(property: Property, opts?: FieldsManageAddFieldLookupOpts<LookupModel, Service>): FieldLookupDescriptor<LookupModel, EditorModel, Service, FieldValue, ParentEditorModel, keyof LookupModel, keyof LookupModel>;
|
|
1213
|
+
/**
|
|
1214
|
+
* [UNSAFE] Adds lookup field.
|
|
1215
|
+
* This function is UNSAFE because property is not type-checked.
|
|
1216
|
+
*
|
|
1217
|
+
* @param {string} property Model property name.
|
|
1218
|
+
* @param {FieldsManageAddFieldLookupOpts<LookupModel, Service>} opts - Optional parameters configuring type and/or service provider.
|
|
1219
|
+
* @typeparam LookupModel - The field model type, defaults to the non-nullable type of the editor's property.
|
|
1220
|
+
* @typeparam Service - Service used for data provider.
|
|
1221
|
+
* @typeparam FieldValue - The value type of field on editor.
|
|
1222
|
+
*
|
|
1223
|
+
* @returns {FieldLookupDescriptor<LookupModel, EditorModel, Service, FieldValue>} - The field lookup descriptor.
|
|
1224
|
+
*/
|
|
1225
|
+
addFieldLookupUnsafe<LookupModel, Service = undefined, FieldValue = LookupModel>(property: string, opts?: FieldsManageAddFieldLookupOpts<LookupModel, Service>): FieldLookupDescriptor<LookupModel, EditorModel, Service, FieldValue, ParentEditorModel, keyof LookupModel, keyof LookupModel>;
|
|
1226
|
+
addFieldLookupEnum<Property extends keyof EditorModel, Enum extends NonNullable<EditorModel[Property]>>(property: keyof EditorModel, enumDesc: EnumDescriptor<Enum>, options?: Array<Enum>): FieldLookupEnumDescriptor<Enum, EditorModel, ParentEditorModel>;
|
|
1227
|
+
/**
|
|
1228
|
+
* Adds enum lookup field.
|
|
1229
|
+
* @param property Model's property name.
|
|
1230
|
+
* @param enumDesc Type of enum or enum descriptor.
|
|
1231
|
+
* @param options Provides subset of enum's available constants.
|
|
1232
|
+
*/
|
|
1233
|
+
addFieldLookupEnumUnsafe<Enum = EnumConstantType>(property: string, enumDesc: EnumDescriptor<Enum>, options?: Array<Enum>): FieldLookupEnumDescriptor<Enum, EditorModel, ParentEditorModel>;
|
|
1234
|
+
/**
|
|
1235
|
+
* Adds table/details/add/edit field for one-to-many (1:n) relations.
|
|
1236
|
+
* @param property Model's property name.
|
|
1237
|
+
* @param tableviewDescriptor Tableview descriptor for related model.
|
|
1238
|
+
*/
|
|
1239
|
+
addFieldManyEditor<Property extends keyof EditorModel, FieldModel = ArrayItemType<EditorModel[Property]>, FieldValue = EditorModel[Property]>(property: Property, tableviewDescriptor: TableviewDescriptorInst<FieldModel, any, any, EditorModel, FieldModel, FieldModel, FieldModel, FieldModel>): FieldManyEditorDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel>;
|
|
1240
|
+
/**
|
|
1241
|
+
* Adds table/details/add/edit field for one-to-many (1:n) relations (UNSAFE).
|
|
1242
|
+
* @param property Model's property name.
|
|
1243
|
+
* @param tableviewDescriptor Tableview descriptor for related model.
|
|
1244
|
+
*/
|
|
1245
|
+
addFieldManyEditorUnsafe<FieldModel, FieldValue = FieldModel[]>(property: string, tableviewDescriptor: TableviewDescriptorInst<FieldModel, any, any, EditorModel, FieldModel, FieldModel, FieldModel, FieldModel>): FieldManyEditorDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel>;
|
|
1246
|
+
addFieldManyToManyEditor<Property extends keyof EditorModel, ServiceType, FieldModel = ArrayItemType<EditorModel[Property]>, FieldValue = EditorModel[Property]>(property: Property, mainTableDescriptor: TableDescriptorInst<FieldModel, any, any>, lookupTableDescriptor: TableDescriptorInst<FieldModel, any, any>, lookupDataProvider: ITableDataProvider<FieldModel, ServiceType, any, any>): FieldManyToManyEditorDescriptor<FieldModel, EditorModel, ServiceType, FieldValue, ParentEditorModel>;
|
|
1247
|
+
addFieldManyToManyEditorUnsafe<FieldModel, ServiceType, FieldValue = FieldModel[]>(property: string, mainTableDescriptor: TableDescriptorInst<FieldModel, any, any>, lookupTableDescriptor: TableDescriptorInst<FieldModel, any, any>, lookupDataProvider: ITableDataProvider<FieldModel, ServiceType, any, any>): FieldManyToManyEditorDescriptor<FieldModel, EditorModel, ServiceType, FieldValue, ParentEditorModel>;
|
|
1248
|
+
/**
|
|
1249
|
+
* Disables field on editor.
|
|
1250
|
+
* @param disabled
|
|
1251
|
+
*/
|
|
1252
|
+
withDisabled(disabled?: boolean): this;
|
|
1253
|
+
/**
|
|
1254
|
+
* Adds group validator to editor.
|
|
1255
|
+
* @param name Name of the validation.
|
|
1256
|
+
* @param validator Field validator function.
|
|
1257
|
+
* @param message Field validation message.
|
|
1258
|
+
* @param opts Additional configuration for validation.
|
|
1259
|
+
*/
|
|
1260
|
+
withValidation<Value = EditorModel>(name: string, validator?: FormValidator<Value, ParentEditorModel>, message?: FormValidationMessage<Value, ParentEditorModel>, opts?: FieldValidationDescriptorOptsType<keyof EditorModel>): this;
|
|
1261
|
+
/**
|
|
1262
|
+
* Adds group validator to editor.
|
|
1263
|
+
* @param name Name of the validation.
|
|
1264
|
+
* @param validator Field validator function.
|
|
1265
|
+
* @param message Field validation message.
|
|
1266
|
+
* @param opts Additional configuration for validation.
|
|
1267
|
+
*/
|
|
1268
|
+
withValidationUnsafe<Value = EditorModel>(name: string, validator?: FormValidator<Value, ParentEditorModel>, message?: FormValidationMessage<Value, ParentEditorModel>, opts?: FieldValidationDescriptorOptsType): this;
|
|
1269
|
+
withAutoSave(enabled?: boolean, autoSaveIdentifier?: string): this;
|
|
1270
|
+
withAutofocusOnField(enabled?: boolean): this;
|
|
1271
|
+
/**
|
|
1272
|
+
* Creates a copy of editor descriptor object.
|
|
1273
|
+
*/
|
|
1274
|
+
copy(): EditorDescriptorInst<EditorModel, ParentEditorModel>;
|
|
1275
|
+
/**
|
|
1276
|
+
* Created group from field group descriptor.
|
|
1277
|
+
* @param fieldGroup Field group descriptor.
|
|
1278
|
+
* @internal
|
|
1279
|
+
*/
|
|
1280
|
+
createFieldGroupDescriptor(fieldGroup: FieldGroupDescriptor<EditorModel, ParentEditorModel>): this;
|
|
1281
|
+
/**
|
|
1282
|
+
* Creates tab group from tab group descriptor.
|
|
1283
|
+
* @param tabGroup Tab group descriptor.
|
|
1284
|
+
* @internal
|
|
1285
|
+
*/
|
|
1286
|
+
protected createTabGroupDescriptor(tabGroup: FieldTabGroupDescriptor<EditorModel>): this;
|
|
1287
|
+
/**
|
|
1288
|
+
* Creates default field group.
|
|
1289
|
+
* @internal
|
|
1290
|
+
*/
|
|
1291
|
+
private createDefaultGroup;
|
|
1292
|
+
/**
|
|
1293
|
+
* Creates default tab group.
|
|
1294
|
+
* @internal
|
|
1295
|
+
*/
|
|
1296
|
+
private createDefaultTabGroup;
|
|
1297
|
+
/**
|
|
1298
|
+
* This function takes care of displaying correct/localized data in the editor
|
|
1299
|
+
* @param property property that tells us where on the model are localizations accessible
|
|
1300
|
+
* @param model Model for localizations
|
|
1301
|
+
* @param localeProperty property by which we find the locale
|
|
1302
|
+
*/
|
|
1303
|
+
localized<Property extends keyof EditorModel, LocalizationModel = ArrayItemType<EditorModel[Property]>>(property: Property, model: ModelDescriptor<LocalizationModel>, localeProperty: keyof LocalizationModel): this;
|
|
1304
|
+
localizedUnsafe<LocalizationType>(property: string, model: ModelDescriptor<LocalizationType>, localeProperty: string): this;
|
|
1305
|
+
nextEvent(type: FormEventTypeEnum, component: IFormEditorComponent<any, any>, data?: FormEventData<EditorModel>): void;
|
|
1306
|
+
get events$(): rxjs.Observable<FormEvent<EditorModel, ParentEditorModel>>;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
type FormEditorResetFormModelOpts = {
|
|
1310
|
+
markAsPristine?: boolean;
|
|
1311
|
+
onlySelf?: boolean;
|
|
1312
|
+
};
|
|
1313
|
+
type FormEditorSetFieldValueOpts = {
|
|
1314
|
+
onlySelf?: boolean;
|
|
1315
|
+
emitEvent?: boolean;
|
|
1316
|
+
emitModelToViewChange?: boolean;
|
|
1317
|
+
emitViewToModelChange?: boolean;
|
|
1318
|
+
};
|
|
1319
|
+
type FormEditorPatchFieldValueOpts = {
|
|
1320
|
+
onlySelf?: boolean;
|
|
1321
|
+
emitEvent?: boolean;
|
|
1322
|
+
emitModelToViewChange?: boolean;
|
|
1323
|
+
emitViewToModelChange?: boolean;
|
|
1324
|
+
};
|
|
1325
|
+
type FormEditorResetFieldValueOpts = {
|
|
1326
|
+
onlySelf?: boolean;
|
|
1327
|
+
emitEvent?: boolean;
|
|
1328
|
+
};
|
|
1329
|
+
type FormEditorGetFormValueOpts = {
|
|
1330
|
+
omitSetters?: boolean;
|
|
1331
|
+
};
|
|
1332
|
+
interface IFormEditorComponent<Item, ParentItem = any> {
|
|
1333
|
+
get form(): FormGroup<{
|
|
1334
|
+
[K in keyof Item]: AbstractControl<Item[K]>;
|
|
1335
|
+
}>;
|
|
1336
|
+
get formUnsafe(): UntypedFormGroup;
|
|
1337
|
+
get formlyInitialItem(): any;
|
|
1338
|
+
get formlyOptions(): FormlyFormOptions & CommonsFormlyFormOptions<Item>;
|
|
1339
|
+
get formlyFields(): FormlyFieldConfig[];
|
|
1340
|
+
get parent(): IFormEditorComponent<ParentItem> | undefined;
|
|
1341
|
+
descriptor: InputSignal<EditorDescriptorInst<Item>>;
|
|
1342
|
+
isFormDisabled: InputSignalWithTransform<boolean, unknown>;
|
|
1343
|
+
formMessages: WritableSignal<ToastMessageOptions[]>;
|
|
1344
|
+
submit(): void;
|
|
1345
|
+
getFormValue(opts?: FormEditorGetFormValueOpts): Item;
|
|
1346
|
+
resetFormModel(item?: Item, opts?: FormEditorResetFormModelOpts): void;
|
|
1347
|
+
getField(key: keyof Item): AbstractControl | null;
|
|
1348
|
+
getFieldUnsafe(key: string): AbstractControl | null;
|
|
1349
|
+
setFieldValue<Property extends keyof Item>(key: Property, value: Item[Property], opts?: FormEditorSetFieldValueOpts): boolean;
|
|
1350
|
+
setFieldValueUnsafe(key: string, value: any, opts?: FormEditorSetFieldValueOpts): boolean;
|
|
1351
|
+
patchFieldValue<Property extends keyof Item>(key: Property, value: Item[Property], opts?: FormEditorPatchFieldValueOpts): boolean;
|
|
1352
|
+
patchFieldValueUnsafe(key: string, value: any, opts?: FormEditorPatchFieldValueOpts): boolean;
|
|
1353
|
+
resetFieldValue<Property extends keyof Item>(key: Property, value?: Item[Property], opts?: FormEditorResetFieldValueOpts): boolean;
|
|
1354
|
+
resetFieldValueUnsafe(key: string, value?: any, opts?: FormEditorResetFieldValueOpts): boolean;
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
interface FormEditorSubmitEvent<Item> {
|
|
1358
|
+
formItem: Item;
|
|
1359
|
+
success: boolean;
|
|
1360
|
+
}
|
|
1361
|
+
declare enum FormFieldEventTypeEnum {
|
|
1362
|
+
ComponentLifecycle = "ComponentLifecycle",
|
|
1363
|
+
ValueChange = "ValueChange",
|
|
1364
|
+
DataProvider = "DataProvider",
|
|
1365
|
+
DialogLifecycle = "DialogLifecycle",
|
|
1366
|
+
RowReorder = "RowReorder",
|
|
1367
|
+
Other = "Other"
|
|
1368
|
+
}
|
|
1369
|
+
declare enum FormEventTypeEnum {
|
|
1370
|
+
ComponentLifecycle = "ComponentLifecycle",
|
|
1371
|
+
ValueChange = "ValueChange",
|
|
1372
|
+
Submit = "Submit",
|
|
1373
|
+
Other = "Other"
|
|
1374
|
+
}
|
|
1375
|
+
declare class FormFieldEventComponentSubtype {
|
|
1376
|
+
static readonly ON_INIT = "Component.OnInit";
|
|
1377
|
+
static readonly ON_VIEW_INIT = "Component.OnViewInit";
|
|
1378
|
+
static readonly ON_CONTENT_INIT = "Component.OnContentInit";
|
|
1379
|
+
static readonly ON_DESTROY = "Component.OnDestroy";
|
|
1380
|
+
}
|
|
1381
|
+
declare class FormFieldEventDialogSubtype {
|
|
1382
|
+
static readonly VISIBILITY = "Dialog.Visibility";
|
|
1383
|
+
static readonly TABLE_CAPTION_COMPONENT_INSTANCE = "Dialog.MngTable.CaptionComponentInstance";
|
|
1384
|
+
static readonly TABLE_COLUMN_ACTIONS_COMPONENT_INSTANCE = "Dialog.MngTable.ColumnActionsComponentInstance";
|
|
1385
|
+
}
|
|
1386
|
+
interface FormFieldEventData<FieldModel, EditorModel> {
|
|
1387
|
+
eventSubtype?: string;
|
|
1388
|
+
value?: FieldModel;
|
|
1389
|
+
formValue?: EditorModel;
|
|
1390
|
+
[key: string]: any;
|
|
1391
|
+
}
|
|
1392
|
+
interface FormEventData<EditorModel> {
|
|
1393
|
+
eventSubtype?: string;
|
|
1394
|
+
value?: EditorModel;
|
|
1395
|
+
submitValid?: boolean;
|
|
1396
|
+
submitValue?: EditorModel;
|
|
1397
|
+
[key: string]: any;
|
|
1398
|
+
}
|
|
1399
|
+
interface FormFieldEvent<FieldValue, FormValue, ParentFormValue = undefined> {
|
|
1400
|
+
type: FormFieldEventTypeEnum;
|
|
1401
|
+
fieldComponent?: FieldType<CommonsFormlyFieldConfig<FieldValue, FormValue, ParentFormValue>>;
|
|
1402
|
+
formComponent?: IFormEditorComponent<FormValue, ParentFormValue>;
|
|
1403
|
+
fieldFormControl: FormControl<FieldValue>;
|
|
1404
|
+
form: FormGroup<{
|
|
1405
|
+
[K in keyof FormValue]: AbstractControl<FormValue[K]>;
|
|
1406
|
+
}>;
|
|
1407
|
+
fieldFormlyConfig: CommonsFormlyFieldConfig<FieldValue, FormValue, ParentFormValue>;
|
|
1408
|
+
data?: FormFieldEventData<FieldValue, FormValue>;
|
|
1409
|
+
}
|
|
1410
|
+
interface FormEvent<FormValue, ParentFormValue = undefined> {
|
|
1411
|
+
type: FormEventTypeEnum;
|
|
1412
|
+
formComponent?: IFormEditorComponent<FormValue, ParentFormValue>;
|
|
1413
|
+
form: FormGroup<{
|
|
1414
|
+
[K in keyof FormValue]: AbstractControl<FormValue[K]>;
|
|
1415
|
+
}>;
|
|
1416
|
+
data?: FormEventData<FormValue>;
|
|
1417
|
+
}
|
|
1418
|
+
interface EditorResetEvent<Item> {
|
|
1419
|
+
emitEvent?: boolean;
|
|
1420
|
+
fetch?: boolean;
|
|
1421
|
+
item?: Item;
|
|
1422
|
+
fields?: Partial<Item>;
|
|
1423
|
+
data?: {
|
|
1424
|
+
[key: string]: any;
|
|
1425
|
+
};
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
interface IViewContainer<Item, Service, ActionInstance extends IActionInstance<Item, Service> = IActionInstance<Item, Service>> {
|
|
1429
|
+
dataProvider: WritableSignal<IDataProvider<Item, Service> | undefined>;
|
|
1430
|
+
routeTriggeredActionInstance: WritableSignal<ActionInstance | undefined>;
|
|
1431
|
+
actions: WritableSignal<Array<ActionDescriptorInst<any>>>;
|
|
1432
|
+
tableReload$: Observable<TableReloadEvent>;
|
|
1433
|
+
editorReset$: Observable<EditorResetEvent<Item>>;
|
|
1434
|
+
editorClose$: Observable<ViewContainerEditorCloseEvent<Item>>;
|
|
1435
|
+
reloadTable(event?: TableReloadEvent): void;
|
|
1436
|
+
resetEditor(event?: EditorResetEvent<Item> | undefined): void;
|
|
1437
|
+
closeEditor(event?: ViewContainerEditorCloseEvent<Item>): void;
|
|
1438
|
+
}
|
|
1439
|
+
interface ViewContainerEditorCloseEvent<T> {
|
|
1440
|
+
emitEvent?: boolean;
|
|
1441
|
+
item?: T;
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
/**
|
|
1445
|
+
* Class containing all main data for action to be executed in run/fetch/submit states.
|
|
1446
|
+
*/
|
|
1447
|
+
interface IActionContext<Item, ParametersItem, Service = undefined, Instance extends IActionInstance<Item, Service> = IActionInstance<Item, Service>, ViewContainer extends IViewContainer<Item, Service, Instance> = IViewContainer<Item, Service, Instance>> {
|
|
1448
|
+
contextLongName: string;
|
|
1449
|
+
instance: Instance;
|
|
1450
|
+
parameters: ActionParameters<ParametersItem, ParametersItem, ParametersItem, ParametersItem>;
|
|
1451
|
+
functionName: 'run' | 'fetch' | 'submit';
|
|
1452
|
+
serviceInstance: Service;
|
|
1453
|
+
dataProvider?: IDataProvider<Item, Service>;
|
|
1454
|
+
viewContainer?: ViewContainer;
|
|
1455
|
+
injector: Injector;
|
|
1456
|
+
previousActionInstance?: IActionInstance<any, any>;
|
|
1457
|
+
confirmation?: Confirmation;
|
|
1458
|
+
notification?: ToastMessageOptions;
|
|
1459
|
+
execution$: Observable<Item | null | undefined>;
|
|
1460
|
+
executionIsRunning$: Observable<boolean>;
|
|
1461
|
+
}
|
|
1462
|
+
type IActionEditorContext<Item, ParentItem, ParametersItem, Service = undefined, Instance extends IActionInstance<Item, Service> = IActionInstance<Item, Service>, ViewContainer extends IViewContainer<Item, Service, Instance> = IViewContainer<Item, Service, Instance>> = IActionContext<Item, ParametersItem, Service, Instance, ViewContainer>;
|
|
1463
|
+
|
|
1464
|
+
interface ActionConfirmation<Model, ParametersItem, Service> {
|
|
1465
|
+
icon?: string | null;
|
|
1466
|
+
title?: string | null;
|
|
1467
|
+
message?: string | null;
|
|
1468
|
+
acceptButton?: IActionButtonDescriptor;
|
|
1469
|
+
rejectButton?: IActionButtonDescriptor | false;
|
|
1470
|
+
closeOnEscape?: boolean;
|
|
1471
|
+
closable?: boolean;
|
|
1472
|
+
configMapFn?: ConfigurationConfigMapFn<ParametersItem>;
|
|
1473
|
+
shouldShowFn?: ConfigurationShouldShowFn<Model, ParametersItem, Service>;
|
|
1474
|
+
}
|
|
1475
|
+
type ConfigurationConfigMapFn<Item> = (ctx: IActionContext<any, Item, any, any, any>, confirmConfig: Confirmation) => Confirmation;
|
|
1476
|
+
type ConfigurationShouldShowFn<Item, ParametersItem, Service> = (ctx: IActionContext<Item, ParametersItem, Service, any, any>) => boolean;
|
|
1477
|
+
|
|
1478
|
+
/**
|
|
1479
|
+
* Class containing all main data for action validations (enabled/visible) to be executed in validation states.
|
|
1480
|
+
*/
|
|
1481
|
+
interface ActionContextValidation<Item, ParametersItem, Service = undefined> {
|
|
1482
|
+
descriptor: ActionDescriptorInst<Item, Service>;
|
|
1483
|
+
parameters: ActionParameters<ParametersItem>;
|
|
1484
|
+
serviceInstance: Service;
|
|
1485
|
+
dataProvider?: IDataProvider<Item, Service>;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
type ActionRunFnType<Item, Service = undefined, InputItem = Item, ReturnItem = Item, Return = ItemOrObservable<Nullable<ReturnItem>>> = (ctx: IActionContext<Item, InputItem, Service>) => Return;
|
|
1489
|
+
type ActionEditorRunFnType<Item, ParentItem, Service = undefined, InputItem = Item, ReturnItem = Item, Return = ItemOrObservable<Nullable<ReturnItem>>> = (ctx: IActionEditorContext<Item, ParentItem, InputItem, Service>) => Return;
|
|
1490
|
+
type ActionValidationFnType<Item, Service = undefined, InputItem = Item, Return = ItemOrObservable<boolean>> = (ctx: ActionContextValidation<Item, InputItem, Service>) => Return;
|
|
1491
|
+
type ActionNotificationType = {
|
|
1492
|
+
title?: string;
|
|
1493
|
+
message?: string;
|
|
1494
|
+
};
|
|
1495
|
+
|
|
1496
|
+
declare enum ActionPositionEnum {
|
|
1497
|
+
ToolbarLeft = 0,
|
|
1498
|
+
ToolbarRight = 1,
|
|
1499
|
+
TableHeader = 2,
|
|
1500
|
+
RowInline = 3,
|
|
1501
|
+
RowClick = 4,
|
|
1502
|
+
FooterLeft = 5,
|
|
1503
|
+
FooterRight = 6
|
|
1504
|
+
}
|
|
1505
|
+
declare enum ActionActivationTriggerEnum {
|
|
1506
|
+
OnClick = 0,// action is triggered for activation on click
|
|
1507
|
+
OnRoute = 1
|
|
1508
|
+
}
|
|
1509
|
+
declare enum ActionTypeEnum {
|
|
1510
|
+
Direct = 0,// action is directly activated and executed
|
|
1511
|
+
Editor = 1
|
|
1512
|
+
}
|
|
1513
|
+
declare enum ActionEditorSubmitTypeEnum {
|
|
1514
|
+
Submit = 0,
|
|
1515
|
+
Cancel = 1
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
type ActionDescriptorCreateOptsProviderType<Item, Service> = {
|
|
1519
|
+
serviceType?: ServiceClassType<Service>;
|
|
1520
|
+
dataProvider?: IDataProvider<Item, Service>;
|
|
1521
|
+
};
|
|
1522
|
+
type ActionDescriptorCreateOptsParentType = {
|
|
1523
|
+
parentModel?: ModelDescriptor<any>;
|
|
1524
|
+
parentProperty?: string;
|
|
1525
|
+
};
|
|
1526
|
+
type ActionDescriptorConstructorOptsType<Item, Service> = ActionDescriptorCreateOptsParentType & ActionDescriptorCreateOptsProviderType<Item, Service> & {
|
|
1527
|
+
model?: ModelDescriptor<Item>;
|
|
1528
|
+
};
|
|
1529
|
+
type AfterRunActionType<RunReturnItem> = ActionDescriptorInst<any, any, RunReturnItem, any, undefined>;
|
|
1530
|
+
type OnErrorActionType<RunInputItem> = ActionDescriptorInst<any, any, RunInputItem, any, undefined>;
|
|
1531
|
+
declare class ActionDescriptorInst<Item, Service = any, RunInputItem = Item, RunReturnItem = Item, ValidationInputItem = RunInputItem> implements IActionDescriptor<Item, Service> {
|
|
1532
|
+
protected readonly _model?: ModelDescriptor<Item>;
|
|
1533
|
+
protected readonly _actionName: string;
|
|
1534
|
+
protected readonly _actionNameLong: string;
|
|
1535
|
+
protected readonly _parentModel?: ModelDescriptor<any>;
|
|
1536
|
+
protected readonly _parentProperty?: string;
|
|
1537
|
+
protected readonly _dataProvider?: IDataProvider<Item, Service>;
|
|
1538
|
+
protected _i18nModelActionBaseKey?: string;
|
|
1539
|
+
protected _type: ActionTypeEnum;
|
|
1540
|
+
protected _activationTrigger: ActionActivationTriggerEnum;
|
|
1541
|
+
protected _position: ActionPositionEnum;
|
|
1542
|
+
protected _level: StyleLevelEnum;
|
|
1543
|
+
private _positionTableviewCategories?;
|
|
1544
|
+
protected _tableviewCategory?: string;
|
|
1545
|
+
protected _routeUrl: string | null;
|
|
1546
|
+
protected _runFunction?: ActionRunFnType<Item, Service, RunInputItem, RunReturnItem>;
|
|
1547
|
+
protected _isVisibleFunction?: ActionValidationFnType<ValidationInputItem, Service>;
|
|
1548
|
+
protected _isEnabledFunction?: ActionValidationFnType<ValidationInputItem, Service>;
|
|
1549
|
+
protected _runConfirmation?: ActionConfirmation<Item, RunInputItem, Service>;
|
|
1550
|
+
protected _runNotificationOnSuccess?: ActionNotificationType | boolean;
|
|
1551
|
+
protected _runNotificationOnError?: ActionNotificationType | boolean;
|
|
1552
|
+
protected _afterRunAction?: AfterRunActionType<RunReturnItem> | ((ctx: IActionContext<Item, RunInputItem, any, any>) => AfterRunActionType<RunReturnItem>);
|
|
1553
|
+
protected _onRunErrorAction?: OnErrorActionType<RunInputItem> | ((ctx: IActionContext<Item, RunInputItem, any, any>) => OnErrorActionType<RunInputItem>);
|
|
1554
|
+
protected _permissions?: APermissions;
|
|
1555
|
+
protected _button?: IActionButtonDescriptor;
|
|
1556
|
+
protected _hasItemsSelection: boolean;
|
|
1557
|
+
protected _component?: Type<IActionComponent<Item>>;
|
|
1558
|
+
protected _componentFromDi?: InjectionToken<Type<any>>;
|
|
1559
|
+
protected _subactionsAsMenu: boolean;
|
|
1560
|
+
protected _subactions: Array<ActionDescriptorInst<Item, any, RunInputItem, any>>;
|
|
1561
|
+
constructor(actionName: string, cfg?: ActionDescriptorConstructorOptsType<Item, Service>);
|
|
1562
|
+
get model(): ModelDescriptor<Item> | undefined;
|
|
1563
|
+
get parentModel(): ModelDescriptor<any> | undefined;
|
|
1564
|
+
get parentProperty(): string | undefined;
|
|
1565
|
+
get i18nModelActionBaseKey(): string | undefined;
|
|
1566
|
+
get type(): ActionTypeEnum;
|
|
1567
|
+
get activationTrigger(): ActionActivationTriggerEnum;
|
|
1568
|
+
get position(): ActionPositionEnum;
|
|
1569
|
+
get routeUrl(): string | null;
|
|
1570
|
+
get dataProvider(): IDataProvider<Item, Service> | undefined;
|
|
1571
|
+
get hasRunFunction(): boolean;
|
|
1572
|
+
get runFunction(): ActionRunFnType<Item, Service, RunInputItem, RunReturnItem>;
|
|
1573
|
+
get isVisibleFunction(): ActionValidationFnType<ValidationInputItem, Service> | undefined;
|
|
1574
|
+
get isEnabledFunction(): ActionValidationFnType<ValidationInputItem, Service> | undefined;
|
|
1575
|
+
get actionName(): string;
|
|
1576
|
+
get actionNameLong(): string;
|
|
1577
|
+
get runConfirmation(): ActionConfirmation<Item, RunInputItem, Service> | undefined;
|
|
1578
|
+
get runNotificationOnSuccess(): boolean | ActionNotificationType | undefined;
|
|
1579
|
+
get runNotificationOnError(): boolean | ActionNotificationType | undefined;
|
|
1580
|
+
get afterRunAction(): AfterRunActionType<RunReturnItem> | ((ctx: IActionContext<Item, RunInputItem, any, any>) => AfterRunActionType<RunReturnItem>) | undefined;
|
|
1581
|
+
get onRunErrorAction(): OnErrorActionType<RunInputItem> | ((ctx: IActionContext<Item, RunInputItem, any, any>) => OnErrorActionType<RunInputItem>) | undefined;
|
|
1582
|
+
get permissions(): APermissions | undefined;
|
|
1583
|
+
get tableviewCategory(): string | undefined;
|
|
1584
|
+
get hasItemsSelection(): boolean;
|
|
1585
|
+
get button(): IActionButtonDescriptor | undefined;
|
|
1586
|
+
get component(): Type<IActionComponent<Item, undefined>> | undefined;
|
|
1587
|
+
get componentFromDi(): InjectionToken<Type<any>> | undefined;
|
|
1588
|
+
get positionTableviewCategories(): string[] | undefined;
|
|
1589
|
+
get subactionsAsMenu(): boolean;
|
|
1590
|
+
get subactions(): ActionDescriptorInst<Item, any, RunInputItem, any, RunInputItem>[];
|
|
1591
|
+
protected setI18nModelActionBaseKey(base?: string): void;
|
|
1592
|
+
withRunFunction(fn: ActionRunFnType<Item, Service, RunInputItem, RunReturnItem>): this;
|
|
1593
|
+
withIsVisibleFunction(fn?: ActionValidationFnType<ValidationInputItem, Service>): this;
|
|
1594
|
+
withIsEnabledFunction(fn?: ActionValidationFnType<ValidationInputItem, Service>): this;
|
|
1595
|
+
withRouteTrigger(routeUrl: string): this;
|
|
1596
|
+
withPosition(position: ActionPositionEnum): this;
|
|
1597
|
+
/**
|
|
1598
|
+
* Creates confirmation action with default style based on action descriptor
|
|
1599
|
+
*/
|
|
1600
|
+
withRunConfirmation(opts?: boolean | ActionConfirmation<Item, RunInputItem, Service>): this;
|
|
1601
|
+
/**
|
|
1602
|
+
* Override default notifications setup. Notifications can either be overridden with custom text or turned on/off.
|
|
1603
|
+
*
|
|
1604
|
+
* @param opts Provide config for texts or on/off flag for run success/error notifications.
|
|
1605
|
+
*/
|
|
1606
|
+
withNotifications(opts?: {
|
|
1607
|
+
runOnSuccess?: ActionNotificationType | boolean;
|
|
1608
|
+
runOnError?: ActionNotificationType | boolean;
|
|
1609
|
+
} | boolean): this;
|
|
1610
|
+
withAfterRunAction(action?: AfterRunActionType<RunReturnItem> | ((ctx: IActionContext<Item, RunInputItem, any, any>) => AfterRunActionType<RunReturnItem>)): this;
|
|
1611
|
+
withOnRunErrorAction(action?: OnErrorActionType<RunInputItem> | ((ctx: IActionContext<Item, RunInputItem, any, any>) => OnErrorActionType<RunInputItem>)): this;
|
|
1612
|
+
withPermissions(permissions: APermissions): this;
|
|
1613
|
+
withTableviewCategory(category: string): this;
|
|
1614
|
+
withButtonOpts(button?: IActionButtonDescriptor): this;
|
|
1615
|
+
withButton(label?: string | null, icon?: string | null, level?: StyleLevelEnum): this;
|
|
1616
|
+
withItemsSelection(hasSelection?: boolean): this;
|
|
1617
|
+
withComponent(component: Type<IActionComponent<Item>>): this;
|
|
1618
|
+
withComponentFromDi(injectionToken: InjectionToken<Type<any>>): this;
|
|
1619
|
+
withPositionTableviewCategories(positionTableviewCategories: string[]): this;
|
|
1620
|
+
withI18nBase(base: ClassType<unknown> | string): this;
|
|
1621
|
+
withSubactionsAsMenu(subactionsAsMenu?: boolean): this;
|
|
1622
|
+
withSubactions(...subactions: Array<ActionDescriptorInst<Item, any, RunInputItem, any>>): this;
|
|
1623
|
+
copyFieldsTo(descriptor: ActionDescriptorInst<Item, Service, RunInputItem, RunReturnItem, ValidationInputItem>): ActionDescriptorInst<Item, Service, RunInputItem, RunReturnItem, ValidationInputItem>;
|
|
1624
|
+
copy(): ActionDescriptorInst<Item, Service, RunInputItem, RunReturnItem, ValidationInputItem>;
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
type ActionDescriptorCreateFromModelOptsType<RunInputType, RunReturnType, ValidationInput> = ActionDescriptorCreateOptsParentType & {
|
|
1628
|
+
runInputType?: TypeDescriptor<RunInputType>;
|
|
1629
|
+
runReturnType?: TypeDescriptor<RunReturnType>;
|
|
1630
|
+
validationType?: TypeDescriptor<ValidationInput>;
|
|
1631
|
+
};
|
|
1632
|
+
type ActionDescriptorCreateOptsType<Model, Service, RunInputType, RunReturnType, ValidationInput> = ActionDescriptorCreateOptsParentType & {
|
|
1633
|
+
model?: ModelDescriptor<Model>;
|
|
1634
|
+
serviceProvider?: ActionProviderType<Model, Service>;
|
|
1635
|
+
runInputType?: TypeDescriptor<RunInputType>;
|
|
1636
|
+
runReturnType?: TypeDescriptor<RunReturnType>;
|
|
1637
|
+
validationType?: TypeDescriptor<ValidationInput>;
|
|
1638
|
+
};
|
|
1639
|
+
type ActionProviderType<Model, Service> = ServiceClassType<Service> | IDataProvider<Model, Service>;
|
|
1640
|
+
declare const actionGetProviderCfgObj: <Model, Service>(serviceOrDataProvider?: ActionProviderType<Model, Service>) => ActionDescriptorCreateOptsProviderType<Model, Service>;
|
|
1641
|
+
/**
|
|
1642
|
+
* Creates and returns an instance of ActionDescriptorInst, allowing customization of the action's behavior through configuration options.
|
|
1643
|
+
*
|
|
1644
|
+
* @param {string} actionName - The unique name of the action.
|
|
1645
|
+
* @param {ActionDescriptorCreateFromModelOptsType<Model, Service, RunInput, RunResult, ValidationInput>} [opts] - Optional configuration object to define the action's behavior, including model, service provider and other.
|
|
1646
|
+
* @return {ActionDescriptorInst<Model, Service, RunInput, RunResult, ValidationInput>} An instance of ActionDescriptorInst configured with the provided parameters.
|
|
1647
|
+
*/
|
|
1648
|
+
declare function action<Model, Service = undefined, RunInput = Model, RunResult = Model, ValidationInput = Model>(actionName: string, opts?: ActionDescriptorCreateOptsType<Model, Service, RunInput, RunResult, ValidationInput>): ActionDescriptorInst<Model, Service, RunInput, RunResult, ValidationInput>;
|
|
1649
|
+
|
|
1650
|
+
type EditorDataProviderFetchFnType<Model = any, Service = undefined, Id = IdType, Return = ItemOrObservable<Model>> = (id: Id, service: Service, locale: string | undefined) => Return;
|
|
1651
|
+
type EditorDataProviderCreateFnType<CreateModel = any, Model = any, Service = undefined, Item = Undefined<CreateModel>, Return = ItemOrObservable<Undefined<Model>>> = (item: Item, service: Service) => Return;
|
|
1652
|
+
type EditorDataProviderUpdateFnType<UpdateModel = any, Model = any, Service = undefined, Id = IdType, Item = Undefined<UpdateModel>, Return = ItemOrObservable<Undefined<Model>>> = (id: Id, item: Item, service: Service) => Return;
|
|
1653
|
+
type EditorDataProviderDeleteFnType<Model = any, Service = undefined, Item = undefined, Id = IdType, Return = ItemOrObservable<Undefined<Model>>> = (id: Id, service: Service, item: Item) => Return;
|
|
1654
|
+
type EditorDataProviderFetchMapToFnType<FromModel, ToModel> = (item: FromModel) => ToModel;
|
|
1655
|
+
interface IEditorDataProviderFetch<Model, Service> {
|
|
1656
|
+
fetch?: EditorDataProviderFetchFnType<Model, Service>;
|
|
1657
|
+
withFetch(fn: EditorDataProviderFetchFnType<Model, Service>): this;
|
|
1658
|
+
}
|
|
1659
|
+
interface IEditorDataProviderCreate<CreateModel, Model, Service> {
|
|
1660
|
+
create?: EditorDataProviderCreateFnType<CreateModel, Model, Service>;
|
|
1661
|
+
withCreate(fn?: EditorDataProviderCreateFnType<CreateModel, Model, Service>): this;
|
|
1662
|
+
}
|
|
1663
|
+
interface IEditorDataProviderUpdate<UpdateModel, Model, Service> {
|
|
1664
|
+
update?: EditorDataProviderUpdateFnType<UpdateModel, Model, Service>;
|
|
1665
|
+
withUpdate(fn?: EditorDataProviderUpdateFnType<UpdateModel, Model, Service>): this;
|
|
1666
|
+
}
|
|
1667
|
+
interface IEditorDataProviderDelete<Model, Service> {
|
|
1668
|
+
delete?: EditorDataProviderDeleteFnType<Model, Service, any>;
|
|
1669
|
+
withDelete<Item = undefined>(fn?: EditorDataProviderDeleteFnType<Model, Service, Item>): this;
|
|
1670
|
+
}
|
|
1671
|
+
interface IEditorDataProviderFetchMapToCreate<Model, CreateModel> {
|
|
1672
|
+
mapFetchItemToCreateItem?: EditorDataProviderFetchMapToFnType<Model, CreateModel>;
|
|
1673
|
+
withMapFetchItemToCreateItem(fn?: EditorDataProviderFetchMapToFnType<Model, CreateModel>): this;
|
|
1674
|
+
}
|
|
1675
|
+
interface IEditorDataProviderFetchMapToUpdate<Model, UpdateModel> {
|
|
1676
|
+
mapFetchItemToUpdateItem?: EditorDataProviderFetchMapToFnType<Model, UpdateModel>;
|
|
1677
|
+
withMapFetchItemToUpdateItem(fn?: EditorDataProviderFetchMapToFnType<Model, UpdateModel>): this;
|
|
1678
|
+
}
|
|
1679
|
+
type IEditorDataProviderFnsType<Model, Service, CreateModel = Model, UpdateModel = Model, DeleteModel = Model> = IEditorDataProviderFetch<Model, Service> & IEditorDataProviderCreate<CreateModel, Model, Service> & IEditorDataProviderUpdate<UpdateModel, Model, Service> & IEditorDataProviderDelete<DeleteModel, Service> & IEditorDataProviderFetchMapToCreate<Model, CreateModel> & IEditorDataProviderFetchMapToUpdate<Model, UpdateModel>;
|
|
1680
|
+
interface IEditorDataProviderSupport<Model> {
|
|
1681
|
+
get editorReset$(): Observable<EditorResetEvent<Model>>;
|
|
1682
|
+
resetEditor(event?: EditorResetEvent<Model>): void;
|
|
1683
|
+
}
|
|
1684
|
+
type IEditorDataProvider<Model = any, Service = any, ServiceClass = ServiceClassOptType<Service>, CreateModel = Model, UpdateModel = Model> = IDataProvider<Model, Service, ServiceClass> & IEditorDataProviderFnsType<Model, Service, CreateModel, UpdateModel> & IEditorDataProviderSupport<Model>;
|
|
1685
|
+
declare class EditorDataProviderInst<Model, Service = any, ServiceClass = ServiceClassOptType<Service>, CreateModel = Model, UpdateModel = Model> extends DataProviderInst<Model, Service, ServiceClass> implements IEditorDataProvider<Model, Service, ServiceClass, CreateModel, UpdateModel> {
|
|
1686
|
+
protected readonly _editorResetSubject: Subject<EditorResetEvent<Model>>;
|
|
1687
|
+
protected _fetch?: EditorDataProviderFetchFnType<Model, Service>;
|
|
1688
|
+
protected _create?: EditorDataProviderCreateFnType<CreateModel, Model, Service>;
|
|
1689
|
+
protected _update?: EditorDataProviderUpdateFnType<UpdateModel, Model, Service>;
|
|
1690
|
+
protected _delete?: EditorDataProviderDeleteFnType<Model, Service, any>;
|
|
1691
|
+
protected _mapFetchItemToCreateItem?: EditorDataProviderFetchMapToFnType<Model, CreateModel>;
|
|
1692
|
+
protected _mapFetchItemToUpdateItem?: EditorDataProviderFetchMapToFnType<Model, UpdateModel>;
|
|
1693
|
+
constructor(serviceType: ServiceClass);
|
|
1694
|
+
get fetch(): EditorDataProviderFetchFnType<Model, Service, IdType, ItemOrObservable<Model>> | undefined;
|
|
1695
|
+
get create(): EditorDataProviderCreateFnType<CreateModel, Model, Service, Undefined<CreateModel>, ItemOrObservable<Undefined<Model>>> | undefined;
|
|
1696
|
+
get update(): EditorDataProviderUpdateFnType<UpdateModel, Model, Service, IdType, Undefined<UpdateModel>, ItemOrObservable<Undefined<Model>>> | undefined;
|
|
1697
|
+
get delete(): EditorDataProviderDeleteFnType<Model, Service, any, IdType, ItemOrObservable<Undefined<Model>>> | undefined;
|
|
1698
|
+
get mapFetchItemToCreateItem(): EditorDataProviderFetchMapToFnType<Model, CreateModel> | undefined;
|
|
1699
|
+
get mapFetchItemToUpdateItem(): EditorDataProviderFetchMapToFnType<Model, UpdateModel> | undefined;
|
|
1700
|
+
get editorReset$(): Observable<EditorResetEvent<Model>>;
|
|
1701
|
+
/**
|
|
1702
|
+
* Sets the fetch function for the EditorDataProvider instance.
|
|
1703
|
+
*
|
|
1704
|
+
* @param {EditorDataProviderFetchFnType<Model, Service>} fn - The fetch function to be set.
|
|
1705
|
+
* @returns {this} - The instance of the EditorDataProvider with the fetch function set.
|
|
1706
|
+
*
|
|
1707
|
+
* @typeparam Model The type of data this DataProvider will handle.
|
|
1708
|
+
* @typeparam Service The type of service used by this DataProvider.
|
|
1709
|
+
*/
|
|
1710
|
+
withFetch(fn: EditorDataProviderFetchFnType<Model, Service>): this;
|
|
1711
|
+
/**
|
|
1712
|
+
* Sets the create function for the EditorDataProvider.
|
|
1713
|
+
*
|
|
1714
|
+
* @param {EditorDataProviderCreateFnType<CreateModel, Model, Service>} fn - The function used for creating new items.
|
|
1715
|
+
* @returns {this} - Returns the instance of the class.
|
|
1716
|
+
*
|
|
1717
|
+
* @typeparam Model The type of data this DataProvider will handle.
|
|
1718
|
+
* @typeparam Service The type of service used by this DataProvider.
|
|
1719
|
+
*/
|
|
1720
|
+
withCreate(fn?: EditorDataProviderCreateFnType<CreateModel, Model, Service>): this;
|
|
1721
|
+
/**
|
|
1722
|
+
* Sets the update function for the EditorDataProvider.
|
|
1723
|
+
*
|
|
1724
|
+
* @param {EditorDataProviderUpdateFnType<Model, Service>} fn - The update function to be set.
|
|
1725
|
+
* @returns {this} - Returns the instance of the object calling this method.
|
|
1726
|
+
*
|
|
1727
|
+
* @typeparam Model The type of data this DataProvider will handle.
|
|
1728
|
+
* @typeparam Service The type of service used by this DataProvider.
|
|
1729
|
+
*/
|
|
1730
|
+
withUpdate(fn?: EditorDataProviderUpdateFnType<UpdateModel, Model, Service>): this;
|
|
1731
|
+
/**
|
|
1732
|
+
* Sets the delete function for the editor data provider.
|
|
1733
|
+
*
|
|
1734
|
+
* @param {EditorDataProviderDeleteFnType<Model, Service>} fn - The delete function to be set.
|
|
1735
|
+
*
|
|
1736
|
+
* @returns {this} - Returns the instance of the current class.
|
|
1737
|
+
*
|
|
1738
|
+
* @typeparam Model The type of data this DataProvider will handle.
|
|
1739
|
+
* @typeparam Service The type of service used by this DataProvider.
|
|
1740
|
+
*/
|
|
1741
|
+
withDelete<Item = undefined>(fn?: EditorDataProviderDeleteFnType<Model, Service, Item>): this;
|
|
1742
|
+
/**
|
|
1743
|
+
* Sets the function to map data from fetch function to create model.
|
|
1744
|
+
*
|
|
1745
|
+
* @param {EditorDataProviderFetchMapToFnType<Model, CreateModel>} fn - The map function to be set.
|
|
1746
|
+
*
|
|
1747
|
+
* @returns {this} - Returns the instance of the current class.
|
|
1748
|
+
*
|
|
1749
|
+
* @typeparam Model The type of data from fetch function to map from.
|
|
1750
|
+
* @typeparam CreateModel The type of data to map to.
|
|
1751
|
+
*/
|
|
1752
|
+
withMapFetchItemToCreateItem(fn?: EditorDataProviderFetchMapToFnType<Model, CreateModel>): this;
|
|
1753
|
+
/**
|
|
1754
|
+
* Sets the function to map data from fetch function to update model.
|
|
1755
|
+
*
|
|
1756
|
+
* @param {EditorDataProviderFetchMapToFnType<Model, UpdateModel>} fn - The map function to be set.
|
|
1757
|
+
*
|
|
1758
|
+
* @returns {this} - Returns the instance of the current class.
|
|
1759
|
+
*
|
|
1760
|
+
* @typeparam Model The type of data from fetch function to map from.
|
|
1761
|
+
* @typeparam UpdateModel The type of data to map to.
|
|
1762
|
+
*/
|
|
1763
|
+
withMapFetchItemToUpdateItem(fn?: EditorDataProviderFetchMapToFnType<Model, UpdateModel>): this;
|
|
1764
|
+
resetEditor(event?: EditorResetEvent<Model>): void;
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
type ActionEditorDescriptorConstructorOptsType<Model, Service> = ActionDescriptorCreateOptsParentType & ActionEditorDescriptorCreateOptsProviderType<Model, Service> & {
|
|
1768
|
+
model?: ModelDescriptor<Model>;
|
|
1769
|
+
isTableviewMainEditor?: boolean;
|
|
1770
|
+
};
|
|
1771
|
+
type ActionEditorDescriptorCreateOptsProviderType<Model, Service> = {
|
|
1772
|
+
serviceType?: ServiceClassType<Service>;
|
|
1773
|
+
dataProvider?: IEditorDataProvider<Model, Service>;
|
|
1774
|
+
};
|
|
1775
|
+
declare class ActionEditorDescriptorInst<Item, Service = any, EditorItem = Item, FetchInputItem = Item, SubmitReturnItem = Item, ValidationInputItem = Item, ParentEditorItem = undefined> extends ActionDescriptorInst<Item, Service, EditorItem, SubmitReturnItem, ValidationInputItem> {
|
|
1776
|
+
private readonly _editorDescriptor;
|
|
1777
|
+
protected readonly _dataProvider?: IEditorDataProvider<Item, any>;
|
|
1778
|
+
protected _editorActions: ActionDescriptorInst<any, any, EditorItem, any, EditorItem>[];
|
|
1779
|
+
protected _editorTitle?: string | null;
|
|
1780
|
+
protected _editorTitleParams?: any;
|
|
1781
|
+
protected _fetchNotificationOnSuccess?: ActionNotificationType | boolean;
|
|
1782
|
+
protected _fetchNotificationOnError?: ActionNotificationType | boolean;
|
|
1783
|
+
protected _dialogSize: StyleSizeEnum;
|
|
1784
|
+
protected _dialogClassName?: string;
|
|
1785
|
+
protected _fetchFunction?: ActionEditorRunFnType<Item, ParentEditorItem, Service, FetchInputItem, EditorItem>;
|
|
1786
|
+
protected _submitFunction?: ActionEditorRunFnType<Item, ParentEditorItem, Service, EditorItem, SubmitReturnItem>;
|
|
1787
|
+
protected _editorComponent?: Type<any>;
|
|
1788
|
+
protected _resubmitEnabled?: boolean;
|
|
1789
|
+
protected _resubmitRefetch: boolean;
|
|
1790
|
+
protected _unsavedChangesConfirmation: boolean;
|
|
1791
|
+
constructor(editorDescriptor: EditorDescriptorInst<EditorItem, any>, actionName: string, cfg?: ActionEditorDescriptorConstructorOptsType<Item, Service>);
|
|
1792
|
+
get editorTitle(): string | null | undefined;
|
|
1793
|
+
get editorTitleParams(): any;
|
|
1794
|
+
get editorDescriptor(): EditorDescriptorInst<EditorItem, ParentEditorItem>;
|
|
1795
|
+
get dialogSize(): StyleSizeEnum;
|
|
1796
|
+
get dialogClassName(): string | undefined;
|
|
1797
|
+
get fetchNotificationOnSuccess(): boolean | ActionNotificationType | undefined;
|
|
1798
|
+
get fetchNotificationOnError(): boolean | ActionNotificationType | undefined;
|
|
1799
|
+
get dataProvider(): IEditorDataProvider<Item, any> | undefined;
|
|
1800
|
+
get hasRunFunction(): boolean;
|
|
1801
|
+
get runFunction(): ActionRunFnType<Item, Service, EditorItem, SubmitReturnItem>;
|
|
1802
|
+
get hasFetchFunction(): boolean;
|
|
1803
|
+
get fetchFunction(): ActionEditorRunFnType<Item, ParentEditorItem, Service, FetchInputItem, EditorItem> | undefined;
|
|
1804
|
+
get hasSubmitFunction(): boolean;
|
|
1805
|
+
get submitFunction(): ActionEditorRunFnType<Item, ParentEditorItem, Service, EditorItem, SubmitReturnItem> | undefined;
|
|
1806
|
+
get editorActions(): ActionDescriptorInst<any, any, EditorItem, any, EditorItem>[];
|
|
1807
|
+
get editorComponent(): Type<any> | undefined;
|
|
1808
|
+
get resubmitEnabled(): boolean | undefined;
|
|
1809
|
+
get resubmitRefetch(): boolean;
|
|
1810
|
+
get unsavedChangesConfirmation(): boolean;
|
|
1811
|
+
withEditorTitle(title: string | null, params?: any): this;
|
|
1812
|
+
withDialogSize(size?: StyleSizeEnum): this;
|
|
1813
|
+
withDialogClassName(className: string): this;
|
|
1814
|
+
withRunFunction(fn: ActionEditorRunFnType<Item, ParentEditorItem, Service, EditorItem, SubmitReturnItem>): this;
|
|
1815
|
+
withFetchFunction(fn: ActionEditorRunFnType<Item, ParentEditorItem, Service, FetchInputItem, EditorItem>): this;
|
|
1816
|
+
withSubmitFunction(fn: ActionEditorRunFnType<Item, ParentEditorItem, Service, EditorItem, SubmitReturnItem>): this;
|
|
1817
|
+
/**
|
|
1818
|
+
* Override default notifications setup. Notifications can either be overridden with custom text or turned on/off.
|
|
1819
|
+
*
|
|
1820
|
+
* @param opts Provide config for texts or on/off flag for submit (is same as run) or fetch success/error notifications.
|
|
1821
|
+
*/
|
|
1822
|
+
withNotifications(opts?: {
|
|
1823
|
+
submitOnSuccess?: ActionNotificationType | boolean;
|
|
1824
|
+
submitOnError?: ActionNotificationType | boolean;
|
|
1825
|
+
runOnSuccess?: ActionNotificationType | boolean;
|
|
1826
|
+
runOnError?: ActionNotificationType | boolean;
|
|
1827
|
+
fetchOnSuccess?: ActionNotificationType | boolean;
|
|
1828
|
+
fetchOnError?: ActionNotificationType | boolean;
|
|
1829
|
+
} | boolean): this;
|
|
1830
|
+
withEditorAction(action: ActionDescriptorInst<any, any, EditorItem, any, EditorItem>): this;
|
|
1831
|
+
withEditorActions(actions: ActionDescriptorInst<any, any, EditorItem, any, EditorItem>[]): this;
|
|
1832
|
+
withEditorComponent(editorComponent: Type<any>): this;
|
|
1833
|
+
/**
|
|
1834
|
+
* Enables or disables resubmit resubmit - this means the form will not exit after successful submission, but will instead remain open.
|
|
1835
|
+
*
|
|
1836
|
+
* @param {boolean} [enabled=true] - Specifies whether resubmit is enabled or disabled. Defaults to true if not provided.
|
|
1837
|
+
* @param {boolean} [refetch=true] - Specifies whether the data should be refetched after resubmit. If not, the data in the form stays as is. Defaults to true if not provided.
|
|
1838
|
+
*
|
|
1839
|
+
* @returns {this} - Returns the current instance with the resubmit configuration updated.
|
|
1840
|
+
*/
|
|
1841
|
+
withResubmit(enabled?: boolean, refetch?: boolean): this;
|
|
1842
|
+
withUnsavedChangesConfirmation(unsavedChangesConfirmation?: boolean): this;
|
|
1843
|
+
copyFieldsTo(descriptor: ActionEditorDescriptorInst<Item, Service, EditorItem, FetchInputItem, SubmitReturnItem, ValidationInputItem, ParentEditorItem>): ActionEditorDescriptorInst<Item, Service, EditorItem, FetchInputItem, SubmitReturnItem, ValidationInputItem, ParentEditorItem>;
|
|
1844
|
+
copy(): ActionEditorDescriptorInst<Item, Service, EditorItem, FetchInputItem, SubmitReturnItem, ValidationInputItem, ParentEditorItem>;
|
|
1845
|
+
}
|
|
1846
|
+
declare class ActionEditorSubmitDescriptorInst<Model, EditorModel> extends ActionDescriptorInst<Model, undefined, EditorModel, EditorModel, EditorModel> {
|
|
1847
|
+
private readonly _submitType;
|
|
1848
|
+
constructor(editorActionName: string, editorActionModel: ModelDescriptor<Model> | undefined, submitType?: ActionEditorSubmitTypeEnum);
|
|
1849
|
+
get submitType(): ActionEditorSubmitTypeEnum;
|
|
1850
|
+
copy(): ActionEditorSubmitDescriptorInst<Model, EditorModel>;
|
|
1851
|
+
}
|
|
1852
|
+
/**
|
|
1853
|
+
* creates primary action with primary button style
|
|
1854
|
+
* @param editorAction
|
|
1855
|
+
* @param submitType
|
|
1856
|
+
*/
|
|
1857
|
+
declare function actionEditorSubmit<Model, EditorModel>(editorAction: ActionEditorDescriptorInst<Model, any, EditorModel, any, any, any, any>, submitType?: ActionEditorSubmitTypeEnum): ActionEditorSubmitDescriptorInst<Model, EditorModel>;
|
|
1858
|
+
/**
|
|
1859
|
+
* creates secondary button with text button style
|
|
1860
|
+
* @param editorAction
|
|
1861
|
+
* @param submitType
|
|
1862
|
+
*/
|
|
1863
|
+
declare function actionEditorCancel<Model, EditorModel>(editorAction: ActionEditorDescriptorInst<Model, any, EditorModel, any, any, any, any>, submitType?: ActionEditorSubmitTypeEnum): ActionEditorSubmitDescriptorInst<Model, EditorModel>;
|
|
1864
|
+
|
|
1865
|
+
type ActionEditorProviderType<Model, Service> = ServiceClassType<Service> | IEditorDataProvider<Model, Service>;
|
|
1866
|
+
type ActionEditorDescriptorOptsType<Model, Service, FetchInput, SubmitReturn, ValidationInput> = ActionDescriptorCreateOptsParentType & {
|
|
1867
|
+
model?: ModelDescriptor<Model>;
|
|
1868
|
+
serviceProvider?: ActionEditorProviderType<Model, Service>;
|
|
1869
|
+
fetchInputType?: TypeDescriptor<FetchInput>;
|
|
1870
|
+
submitReturnType?: TypeDescriptor<SubmitReturn>;
|
|
1871
|
+
validationType?: TypeDescriptor<ValidationInput>;
|
|
1872
|
+
};
|
|
1873
|
+
declare const actionEditorGetProviderCfgObj: <Model, Service>(serviceOrDataProvider?: ActionEditorProviderType<Model, Service>) => ActionEditorDescriptorCreateOptsProviderType<Model, Service>;
|
|
1874
|
+
/**
|
|
1875
|
+
* Creates an ActionEditorDescriptorInst instance with the provided editor descriptor and options.
|
|
1876
|
+
*
|
|
1877
|
+
* @param {string} actionName - The name of the action to associate with the editor.
|
|
1878
|
+
* @param {EditorDescriptorInst<EditorModel, any>} editor - The editor descriptor instance to be used.
|
|
1879
|
+
* @param {ActionEditorDescriptorOptsType<Model, Service, FetchInput, SubmitReturn, ValidationInput>} [opts] - Optional configuration options for the ActionEditor.
|
|
1880
|
+
* @return {ActionEditorDescriptorInst<Model, Service, EditorModel, FetchInput, SubmitReturn, ValidationInput>} An instance of ActionEditorDescriptor with the configured parameters.
|
|
1881
|
+
*/
|
|
1882
|
+
declare function actionEditor<EditorModel, Model = EditorModel, Service = undefined, FetchInput = Model, SubmitReturn = Model, ValidationInput = Model, ParentEditorItem = undefined>(actionName: string, editor: EditorDescriptorInst<EditorModel, ParentEditorItem>, opts?: ActionEditorDescriptorOptsType<Model, Service, FetchInput, SubmitReturn, ValidationInput>): ActionEditorDescriptorInst<Model, Service, EditorModel, FetchInput, SubmitReturn, ValidationInput, ParentEditorItem>;
|
|
1883
|
+
|
|
1884
|
+
type ActionLinkDescriptorConstructorOpts<Model> = Omit<ActionDescriptorConstructorOptsType<Model, undefined>, 'serviceType' | 'dataProvider'>;
|
|
1885
|
+
declare class ActionLinkDescriptorInst<Item, ValidationInputItem = Item> extends ActionDescriptorInst<Item, undefined, undefined, undefined, ValidationInputItem> {
|
|
1886
|
+
private _url;
|
|
1887
|
+
private _pathSegments;
|
|
1888
|
+
private _queryParams?;
|
|
1889
|
+
private _queryParamsHandling?;
|
|
1890
|
+
private _replaceUrl;
|
|
1891
|
+
private _target;
|
|
1892
|
+
private _isStyleLink;
|
|
1893
|
+
constructor(actionName?: string, cfg?: ActionLinkDescriptorConstructorOpts<Item>);
|
|
1894
|
+
get url(): string;
|
|
1895
|
+
get pathSegments(): string[];
|
|
1896
|
+
get queryParams(): Params | undefined;
|
|
1897
|
+
get queryParamsHandling(): QueryParamsHandling | undefined;
|
|
1898
|
+
get replaceUrl(): boolean;
|
|
1899
|
+
get target(): string;
|
|
1900
|
+
get isStyleLink(): boolean;
|
|
1901
|
+
withHref(url: string): this;
|
|
1902
|
+
withRouterLink(...pathSegments: string[]): this;
|
|
1903
|
+
withQueryParams(queryParams: Params, queryParamsHandling?: QueryParamsHandling): this;
|
|
1904
|
+
withReplaceUrl(replaceUrl?: boolean): this;
|
|
1905
|
+
withTarget(target?: '_self' | '_blank'): this;
|
|
1906
|
+
withStyleLink(isStyleLink: boolean): this;
|
|
1907
|
+
copy(): ActionLinkDescriptorInst<Item, ValidationInputItem>;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
type ActionLinkCreateOptsType<Model, ValidationInput> = ActionDescriptorCreateOptsParentType & {
|
|
1911
|
+
model?: ModelDescriptor<Model>;
|
|
1912
|
+
validationType?: TypeDescriptor<ValidationInput>;
|
|
1913
|
+
};
|
|
1914
|
+
/**
|
|
1915
|
+
* Creates an instance of ActionLinkDescriptorInst with the provided action name and options.
|
|
1916
|
+
*
|
|
1917
|
+
* @param {string} actionName - The unique name of the action.
|
|
1918
|
+
* @param {ActionLinkCreateOptsType<Model, ValidationInput>} [opts] - Optional parameters for configuring the action link, including the model and validation type.
|
|
1919
|
+
* @return {ActionLinkDescriptorInst<Model, ValidationInput>} An instance of ActionLinkDescriptorInst initialized with the action name and options.
|
|
1920
|
+
*/
|
|
1921
|
+
declare function actionLink<Model = any, ValidationInput = Model>(actionName: string, opts?: ActionLinkCreateOptsType<Model, ValidationInput>): ActionLinkDescriptorInst<Model, ValidationInput>;
|
|
1922
|
+
/**
|
|
1923
|
+
* Generates an ActionLinkDescriptorInst from the provided ActionDescriptorInst.
|
|
1924
|
+
*
|
|
1925
|
+
* @param {ActionDescriptorInst<Model, any, any, any, ValidationInput>} action - The action descriptor instance that serves as the basis for the action link.
|
|
1926
|
+
* @return {ActionLinkDescriptorInst<Model, ValidationInput>} A newly created ActionLinkDescriptorInst configured with the provided action parameters.
|
|
1927
|
+
*/
|
|
1928
|
+
declare function actionLinkFromAction<Model, ValidationInput = Model>(action: ActionDescriptorInst<Model, any, any, any, ValidationInput>): ActionLinkDescriptorInst<Model, ValidationInput>;
|
|
1929
|
+
|
|
1930
|
+
/**
|
|
1931
|
+
* Defines an action to be positioned on a specified editor with editor-specific execution context.
|
|
1932
|
+
*
|
|
1933
|
+
* @param {string} actionName - The name identifying the action to be performed.
|
|
1934
|
+
* @param {EditorDescriptorInst<EditorModel>} editor - The descriptor of the editor on which the action will be placed and executed.
|
|
1935
|
+
* @param {Object} [opts] - Options for configuring the action behavior.
|
|
1936
|
+
* @param {ModelDescriptor<Model>} [opts.model] - The model descriptor associated with the action.
|
|
1937
|
+
* @param {ActionProviderType<Model, Service>} [opts.serviceProvider] - The service provider type for execution context.
|
|
1938
|
+
* @param {ActionPositionEnum.FooterLeft | ActionPositionEnum.FooterRight | ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight} [opts.position] - The position of action on editor.
|
|
1939
|
+
* @return {ActionDescriptorInst<Model, Service, EditorModel, Model, EditorModel>} - An instance representing the configured action descriptor for the specified editor and model.
|
|
1940
|
+
*/
|
|
1941
|
+
declare function actionOnEditor<Model, EditorModel, Service = undefined>(actionName: string, editor: EditorDescriptorInst<EditorModel, any>, opts?: {
|
|
1942
|
+
model?: ModelDescriptor<Model>;
|
|
1943
|
+
serviceProvider?: ActionProviderType<Model, Service>;
|
|
1944
|
+
position?: ActionPositionEnum.FooterLeft | ActionPositionEnum.FooterRight | ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight;
|
|
1945
|
+
}): ActionDescriptorInst<Model, Service, EditorModel, Model, EditorModel>;
|
|
1946
|
+
|
|
1947
|
+
/**
|
|
1948
|
+
* Creates and returns an instance of `ActionEditorDescriptorInst` when positioned on another (parent) editor.
|
|
1949
|
+
*
|
|
1950
|
+
* @param {string} actionName - The name of the action associated with the editor.
|
|
1951
|
+
* @param {EditorDescriptorInst<EditorModel, ParentEditor>} editor - The editor descriptor defining editor on action.
|
|
1952
|
+
* @param {Object} [opts] - Optional parameters for configuring the action editor.
|
|
1953
|
+
* @param {ModelDescriptor<Model>} [opts.model] - The descriptor for the model associated with the action.
|
|
1954
|
+
* @param {ActionEditorProviderType<Model, Service>} [opts.serviceProvider] - The service provider type for the action editor.
|
|
1955
|
+
* @param {ActionPositionEnum.FooterLeft | ActionPositionEnum.FooterRight | ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight} [opts.position] - The desired position of action on the editor.
|
|
1956
|
+
* @return {ActionEditorDescriptorInst<Model, Service, EditorModel, ParentEditor, EditorModel, ParentEditor>} A configured instance of `ActionEditorDescriptorInst` representing the action editor.
|
|
1957
|
+
*/
|
|
1958
|
+
declare function actionEditorOnEditor<EditorModel, ParentEditor, Model = EditorModel, Service = undefined>(actionName: string, editor: EditorDescriptorInst<EditorModel, ParentEditor>, opts?: {
|
|
1959
|
+
model?: ModelDescriptor<Model>;
|
|
1960
|
+
serviceProvider?: ActionEditorProviderType<Model, Service>;
|
|
1961
|
+
position?: ActionPositionEnum.FooterLeft | ActionPositionEnum.FooterRight | ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight;
|
|
1962
|
+
}): ActionEditorDescriptorInst<Model, Service, EditorModel, ParentEditor, EditorModel, ParentEditor, ParentEditor>;
|
|
1963
|
+
|
|
1964
|
+
/**
|
|
1965
|
+
* Defines an action to be positioned on a specified table with table row execution context.
|
|
1966
|
+
*
|
|
1967
|
+
* @param {string} actionName - The name identifying the action to be performed.
|
|
1968
|
+
* @param {TableDescriptorInst<TableModel, any, any>} table - The descriptor of the table on which the action will be placed and executed.
|
|
1969
|
+
* @param {Object} [opts] - Options for configuring the action behavior.
|
|
1970
|
+
* @param {ModelDescriptor<Model>} [opts.model] - The model descriptor associated with the action.
|
|
1971
|
+
* @param {ActionProviderType<Model, Service>} [opts.serviceProvider] - The service provider type for execution context.
|
|
1972
|
+
* @param {ActionPositionEnum.RowInline | ActionPositionEnum.RowClick} [opts.position] - The position of action on table.
|
|
1973
|
+
* @return {ActionDescriptorInst<Model, Service, TableModel, Model, TableModel>} - An instance representing the configured action descriptor for the specified table row and model.
|
|
1974
|
+
*/
|
|
1975
|
+
declare function actionOnTableRow<Model, TableModel, Service = undefined>(actionName: string, table: TableDescriptorInst<TableModel, any, any>, opts?: {
|
|
1976
|
+
model?: ModelDescriptor<Model>;
|
|
1977
|
+
serviceProvider?: ActionProviderType<Model, Service>;
|
|
1978
|
+
position?: ActionPositionEnum.RowInline | ActionPositionEnum.RowClick;
|
|
1979
|
+
}): ActionDescriptorInst<Model, Service, TableModel, Model, TableModel>;
|
|
1980
|
+
/**
|
|
1981
|
+
* Defines an action to be positioned on a specified table with table header or footer execution context.
|
|
1982
|
+
*
|
|
1983
|
+
* @param {string} actionName - The name identifying the action to be performed.
|
|
1984
|
+
* @param {Object} [opts] - Options for configuring the action behavior.
|
|
1985
|
+
* @param {ModelDescriptor<Model>} [opts.model] - The model descriptor associated with the action.
|
|
1986
|
+
* @param {ActionProviderType<Model, Service>} [opts.serviceProvider] - The service provider type for execution context.
|
|
1987
|
+
* @param {ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight | ActionPositionEnum.TableHeader} [opts.position] - The position of action on table.
|
|
1988
|
+
* @return {ActionDescriptorInst<Model, Service, TableModel, Model, TableModel>} - An instance representing the configured action descriptor for the specified table top and model.
|
|
1989
|
+
*/
|
|
1990
|
+
declare function actionOnTableTop<Model, Service = undefined>(actionName: string, opts?: {
|
|
1991
|
+
model?: ModelDescriptor<Model>;
|
|
1992
|
+
serviceProvider?: ActionProviderType<Model, Service>;
|
|
1993
|
+
position?: ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight | ActionPositionEnum.TableHeader;
|
|
1994
|
+
}): ActionDescriptorInst<Model, Service, undefined, Model, undefined>;
|
|
1995
|
+
|
|
1996
|
+
/**
|
|
1997
|
+
* Creates and returns an ActionEditorDescriptorInst for displaying editor action on table row.
|
|
1998
|
+
*
|
|
1999
|
+
* @param {string} actionName - The name of the action.
|
|
2000
|
+
* @param {EditorDescriptorInst<EditorModel, any>} editor - The editor descriptor instance responsible for configuring the editor behavior.
|
|
2001
|
+
* @param {TableDescriptorInst<TableModel, any, any>} table - The table descriptor instance representing the table on which the action is positioned.
|
|
2002
|
+
* @param {Object} [opts] - Optional configurations for the action editor.
|
|
2003
|
+
* @param {ModelDescriptor<Model>} [opts.model] - The model descriptor associated with the action editor.
|
|
2004
|
+
* @param {ActionEditorProviderType<Model, Service>} [opts.serviceProvider] - The service provider for additional configurations or services for the action editor.
|
|
2005
|
+
* @param {ActionPositionEnum.RowInline | ActionPositionEnum.RowClick} [opts.position] - The position where the action should be displayed on the table row.
|
|
2006
|
+
* @return {ActionEditorDescriptorInst<Model, Service, EditorModel, TableModel, EditorModel, TableModel>} The configured action editor descriptor instance.
|
|
2007
|
+
*/
|
|
2008
|
+
declare function actionEditorOnTableRow<EditorModel, ParentEditorItem, TableModel, Model = EditorModel, Service = undefined>(actionName: string, editor: EditorDescriptorInst<EditorModel, ParentEditorItem>, table: TableDescriptorInst<TableModel, any, any>, opts?: {
|
|
2009
|
+
model?: ModelDescriptor<Model>;
|
|
2010
|
+
serviceProvider?: ActionEditorProviderType<Model, Service>;
|
|
2011
|
+
position?: ActionPositionEnum.RowInline | ActionPositionEnum.RowClick;
|
|
2012
|
+
}): ActionEditorDescriptorInst<Model, Service, EditorModel, TableModel, EditorModel, TableModel, ParentEditorItem>;
|
|
2013
|
+
/**
|
|
2014
|
+
* Creates and returns an action editor descriptor configured with the given parameters.
|
|
2015
|
+
* This is used to define an action editor positioned relative to a table.
|
|
2016
|
+
*
|
|
2017
|
+
* @param {string} actionName - The name of the action.
|
|
2018
|
+
* @param {EditorDescriptorInst<EditorModel, any>} editor - The editor descriptor instance responsible for configuring the editor behavior.
|
|
2019
|
+
* @param {Object} [opts] - Optional configurations for the action editor.
|
|
2020
|
+
* @param {ModelDescriptor<Model>} [opts.model] - The model descriptor associated with the action editor.
|
|
2021
|
+
* @param {ActionEditorProviderType<Model, Service>} [opts.serviceProvider] - The service provider for additional configurations or services for the action editor.
|
|
2022
|
+
* @param {ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight | ActionPositionEnum.TableHeader} [opts.position] - The position of the action on the table.
|
|
2023
|
+
* @return {ActionEditorDescriptorInst<Model, Service, EditorModel, undefined, EditorModel, undefined>} The configured action editor descriptor instance.
|
|
2024
|
+
*/
|
|
2025
|
+
declare function actionEditorOnTableTop<EditorModel, ParentEditorItem, Model = EditorModel, Service = undefined>(actionName: string, editor: EditorDescriptorInst<EditorModel, ParentEditorItem>, opts?: {
|
|
2026
|
+
model?: ModelDescriptor<Model>;
|
|
2027
|
+
serviceProvider?: ActionEditorProviderType<Model, Service>;
|
|
2028
|
+
position?: ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight | ActionPositionEnum.TableHeader;
|
|
2029
|
+
}): ActionEditorDescriptorInst<Model, Service, EditorModel, undefined, EditorModel, undefined, ParentEditorItem>;
|
|
2030
|
+
|
|
2031
|
+
declare function runFnFromDataProviderOrFallback<Item, ParameterItem, Service, Return, FallbackReturn = Return>(ctx: IActionContext<Item, ParameterItem, Service>, fn: (ctx: IActionContext<Item, ParameterItem, Service>) => Observable<Return> | null, fallback: Observable<FallbackReturn>): Observable<Return | FallbackReturn>;
|
|
2032
|
+
declare function runFnFromDataProviderOrFail<Item, ParameterItem, Service, Return>(ctx: IActionContext<Item, ParameterItem, Service>, fn: (ctx: IActionContext<Item, ParameterItem, Service>) => Observable<Return> | null): Observable<Return>;
|
|
2033
|
+
declare function runGetAllFromDataProvider<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>): Observable<DataListResult<Item>> | null;
|
|
2034
|
+
type RunFetchFromDataProviderOptsType = {
|
|
2035
|
+
strict?: boolean;
|
|
2036
|
+
reason?: RunFetchFromDataProviderReasonType;
|
|
2037
|
+
};
|
|
2038
|
+
type RunFetchFromDataProviderReasonType = 'create' | 'update' | 'fetch';
|
|
2039
|
+
declare function runFetchFromDataProvider<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, opts?: RunFetchFromDataProviderOptsType): Observable<Item> | null;
|
|
2040
|
+
declare function runCreateFromDataProvider<Item, ParameterItem, Service>(ctx: IActionContext<Item, ParameterItem, Service>): Observable<Nullable<Item>> | null;
|
|
2041
|
+
declare function runUpdateFromDataProvider<Item, ParameterItem, service>(ctx: IActionContext<Item, ParameterItem, service>): Observable<Nullable<Item>> | null;
|
|
2042
|
+
declare function runDeleteFromDataProvider<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>): Observable<Nullable<Item>> | null;
|
|
2043
|
+
/**
|
|
2044
|
+
* Gets service instance of data provider.
|
|
2045
|
+
*
|
|
2046
|
+
* @param injector Injector instance
|
|
2047
|
+
* @param dataProvider Data provider instance.
|
|
2048
|
+
*/
|
|
2049
|
+
declare function getDataProviderService<Item, Service>(injector: Injector, dataProvider?: IDataProvider<Item, Service>): Service | null;
|
|
2050
|
+
|
|
2051
|
+
interface CommonsActionErrorOptions extends CommonsErrorBaseOptions {
|
|
2052
|
+
actionContext?: IActionContext<any, any, any>;
|
|
2053
|
+
httpError?: HttpErrorResponse;
|
|
2054
|
+
}
|
|
2055
|
+
declare class CommonsActionError extends ACommonsErrorBase implements ICommonsActionError {
|
|
2056
|
+
readonly type = "CommonsActionError";
|
|
2057
|
+
readonly actionId: string;
|
|
2058
|
+
readonly actionContext?: IActionContext<any, any>;
|
|
2059
|
+
readonly httpError?: HttpErrorResponse;
|
|
2060
|
+
constructor(message: string, actionName: string, options?: CommonsActionErrorOptions);
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
/**
|
|
2064
|
+
* Default categories for tableview actions
|
|
2065
|
+
*/
|
|
2066
|
+
declare class TableviewActionDefaultCategories {
|
|
2067
|
+
static readonly READ = "_defaultTwRead";
|
|
2068
|
+
static readonly ADD = "_defaultTwAdd";
|
|
2069
|
+
static readonly EDIT = "_defaultTwEdit";
|
|
2070
|
+
static readonly DELETE = "_defaultTwDelete";
|
|
2071
|
+
static readonly DETAILS = "_defaultTwDetails";
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
declare const DATA_LANGUAGE_DROPDOWN_COMPONENT_IT: InjectionToken<Type<any>>;
|
|
2075
|
+
|
|
2076
|
+
declare abstract class DataProviderExecutor {
|
|
2077
|
+
runGetAllOrFail<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>): Observable<DataListResult<Item>>;
|
|
2078
|
+
abstract runGetAll<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>): Observable<DataListResult<Item>> | null;
|
|
2079
|
+
abstract runGetAll<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, fallback: Observable<DataListResult<Item>>): Observable<DataListResult<Item>>;
|
|
2080
|
+
abstract runGetAll<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, fallback: undefined): Observable<DataListResult<Item>> | null;
|
|
2081
|
+
abstract runGetAll<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, fallback?: Observable<DataListResult<Item>>): Observable<DataListResult<Item>> | null;
|
|
2082
|
+
runFetchOrFail<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, fetchReason?: RunFetchFromDataProviderReasonType): Observable<Item>;
|
|
2083
|
+
abstract runFetch<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, fetchReason?: RunFetchFromDataProviderReasonType): Observable<Item> | null;
|
|
2084
|
+
abstract runFetch<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, fetchReason: RunFetchFromDataProviderReasonType | undefined, fallback: Observable<Nullable<Item>>): Observable<Nullable<Item>>;
|
|
2085
|
+
abstract runFetch<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, fetchReason: RunFetchFromDataProviderReasonType | undefined, fallback: undefined): Observable<Nullable<Item>> | null;
|
|
2086
|
+
abstract runFetch<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, fetchReason: RunFetchFromDataProviderReasonType | undefined, fallback?: Observable<Nullable<Item>>): Observable<Nullable<Item>> | null;
|
|
2087
|
+
runCreateOrFail<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>): Observable<Item>;
|
|
2088
|
+
abstract runCreate<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>): Observable<Item> | null;
|
|
2089
|
+
abstract runCreate<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, fallback: Observable<Nullable<Item>>): Observable<Nullable<Item>>;
|
|
2090
|
+
abstract runCreate<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, fallback: undefined): Observable<Nullable<Item>> | null;
|
|
2091
|
+
abstract runCreate<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, fallback?: Observable<Nullable<Item>>): Observable<Nullable<Item>> | null;
|
|
2092
|
+
runUpdateOrFail<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>): Observable<Item>;
|
|
2093
|
+
abstract runUpdate<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>): Observable<Item> | null;
|
|
2094
|
+
abstract runUpdate<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, fallback: Observable<Nullable<Item>>): Observable<Nullable<Item>>;
|
|
2095
|
+
abstract runUpdate<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, fallback: undefined): Observable<Nullable<Item>> | null;
|
|
2096
|
+
abstract runUpdate<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, fallback?: Observable<Nullable<Item>>): Observable<Nullable<Item>> | null;
|
|
2097
|
+
runDeleteOrFail<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>): Observable<Item | null>;
|
|
2098
|
+
abstract runDelete<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>): Observable<Nullable<Item>> | null;
|
|
2099
|
+
abstract runDelete<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, fallback: Observable<Nullable<Item>>): Observable<Nullable<Item>>;
|
|
2100
|
+
abstract runDelete<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, fallback: undefined): Observable<Nullable<Item>> | null;
|
|
2101
|
+
abstract runDelete<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, fallback?: Observable<Nullable<Item>>): Observable<Nullable<Item>> | null;
|
|
2102
|
+
/**
|
|
2103
|
+
* Gets service instance of data provider.
|
|
2104
|
+
*
|
|
2105
|
+
* @param injector Injector instance
|
|
2106
|
+
* @param dataProvider Data provider instance.
|
|
2107
|
+
*/
|
|
2108
|
+
getDataProviderService<Item, Service>(injector: Injector, dataProvider?: IDataProvider<Item, Service>): Service | null;
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
/**
|
|
2112
|
+
* Creates and returns an instance of `EditorDataProviderInst` with the specified options for managing editor data.
|
|
2113
|
+
*
|
|
2114
|
+
* @param {Object} [opts] - The options object to configure the data provider.
|
|
2115
|
+
* @param {TypeDescriptor<Model> | ModelDescriptor<Model>} [opts.type] - The descriptor defining the type of model.
|
|
2116
|
+
* @param {ServiceClassType<Service>} [opts.service] - The service class type associated with the data provider.
|
|
2117
|
+
* @param {TypeDescriptor<CreateModel> | ModelDescriptor<CreateModel>} [opts.createType] - The descriptor defining the create type.
|
|
2118
|
+
* @param {TypeDescriptor<UpdateModel> | ModelDescriptor<UpdateModel>} [opts.updateType] - The descriptor defining the update type.
|
|
2119
|
+
* @return {EditorDataProviderInst<Model, Service, ServiceClass, CreateModel, UpdateModel>} An instance of `EditorDataProviderInst` configured according to the provided options.
|
|
2120
|
+
*/
|
|
2121
|
+
declare function editorDataProvider<Model, Service = undefined, CreateModel = Model, UpdateModel = Model, ServiceClass = Service extends undefined ? undefined : ServiceClassType<Service>>(opts?: {
|
|
2122
|
+
type?: TypeDescriptor<Model> | ModelDescriptor<Model>;
|
|
2123
|
+
service?: ServiceClassType<Service>;
|
|
2124
|
+
createType?: TypeDescriptor<CreateModel> | ModelDescriptor<Model>;
|
|
2125
|
+
updateType?: TypeDescriptor<UpdateModel> | ModelDescriptor<Model>;
|
|
2126
|
+
}): EditorDataProviderInst<Model, Service, ServiceClass, CreateModel, UpdateModel>;
|
|
2127
|
+
|
|
2128
|
+
type EditorDescriptorCreateBaseOptsType<ParentEditorModel> = {
|
|
2129
|
+
tableviewEditorType?: TableviewEditorTypeEnum;
|
|
2130
|
+
parentEditorType?: TypeDescriptor<ParentEditorModel> | ModelDescriptor<ParentEditorModel> | EditorDescriptorInst<ParentEditorModel, any>;
|
|
2131
|
+
};
|
|
2132
|
+
type EditorDescriptorCreateOptsType<EditorModel, ParentEditorModel> = ModelDescriptorCreateOpts<EditorModel> & EditorDescriptorCreateBaseOptsType<ParentEditorModel>;
|
|
2133
|
+
declare function editorDescriptor<EditorModel, ParentEditorModel = undefined>(): EditorDescriptorInst<EditorModel, ParentEditorModel>;
|
|
2134
|
+
declare function editorDescriptor<EditorModel, ParentEditorModel = undefined>(opts: EditorDescriptorCreateOptsType<EditorModel, ParentEditorModel>): EditorDescriptorInst<EditorModel, ParentEditorModel>;
|
|
2135
|
+
declare function editorDescriptor<EditorModel, ParentEditorModel = undefined>(model: ModelDescriptor<EditorModel>, opts?: EditorDescriptorCreateBaseOptsType<ParentEditorModel>): EditorDescriptorInst<EditorModel, ParentEditorModel>;
|
|
2136
|
+
|
|
2137
|
+
type ITableviewDataProvider<Model = any, Service = any, Sorts = keyof Model, Filters extends keyof any = keyof Model, ServiceClass = ServiceClassOptType<Service>, TableModel = Model, CreateModel = Model, UpdateModel = Model> = IEditorDataProvider<Model, Service, ServiceClass, CreateModel, UpdateModel> & ITableDataProvider<TableModel, Service, Sorts, Filters, ServiceClass>;
|
|
2138
|
+
declare class TableviewDataProviderInst<Model, Service = any, Sorts = keyof Model, Filters extends keyof any = keyof Model, ServiceClass = ServiceClassOptType<Service>, TableModel = Model, CreateModel = Model, UpdateModel = Model> extends DataProviderInst<Model, Service, ServiceClass> implements ITableviewDataProvider<Model, Service, Sorts, Filters, ServiceClass, TableModel, CreateModel, UpdateModel>, IEditorDataProvider<Model, Service, ServiceClass, CreateModel, UpdateModel> {
|
|
2139
|
+
protected readonly editorDataProvider: EditorDataProviderInst<Model, Service, ServiceClass, CreateModel, UpdateModel>;
|
|
2140
|
+
protected readonly tableDataProvider: TableDataProviderInst<TableModel, Service, Sorts, Filters, ServiceClass>;
|
|
2141
|
+
constructor(serviceType: ServiceClass);
|
|
2142
|
+
get isLazy(): boolean;
|
|
2143
|
+
get tableReload$(): rxjs.Observable<TableReloadEvent<Sorts, Filters>>;
|
|
2144
|
+
get editorReset$(): rxjs.Observable<EditorResetEvent<Model>>;
|
|
2145
|
+
get getAll(): TableDataProviderGetAllFnType<TableModel, Service, Sorts, Filters, _mediusinc_mng_commons_core.ItemOrObservable<_mediusinc_mng_commons_core.DataListResult<TableModel>>>;
|
|
2146
|
+
get fetch(): EditorDataProviderFetchFnType<Model, Service, _mediusinc_mng_commons_core.IdType, _mediusinc_mng_commons_core.ItemOrObservable<Model>> | undefined;
|
|
2147
|
+
get create(): EditorDataProviderCreateFnType<CreateModel, Model, Service, _mediusinc_mng_commons_core.Undefined<CreateModel>, _mediusinc_mng_commons_core.ItemOrObservable<_mediusinc_mng_commons_core.Undefined<Model>>> | undefined;
|
|
2148
|
+
get update(): EditorDataProviderUpdateFnType<UpdateModel, Model, Service, _mediusinc_mng_commons_core.IdType, _mediusinc_mng_commons_core.Undefined<UpdateModel>, _mediusinc_mng_commons_core.ItemOrObservable<_mediusinc_mng_commons_core.Undefined<Model>>> | undefined;
|
|
2149
|
+
get delete(): EditorDataProviderDeleteFnType<Model, Service, any, _mediusinc_mng_commons_core.IdType, _mediusinc_mng_commons_core.ItemOrObservable<_mediusinc_mng_commons_core.Undefined<Model>>> | undefined;
|
|
2150
|
+
get mapFetchItemToCreateItem(): EditorDataProviderFetchMapToFnType<Model, CreateModel> | undefined;
|
|
2151
|
+
get mapFetchItemToUpdateItem(): EditorDataProviderFetchMapToFnType<Model, UpdateModel> | undefined;
|
|
2152
|
+
withGetAll(fn: TableDataProviderGetAllFnType<TableModel, Service, Sorts, Filters>): this;
|
|
2153
|
+
withGetAllEagerly(fn: TableDataProviderGetAllEagerFnType<TableModel, Service>): this;
|
|
2154
|
+
withFetch(fn: EditorDataProviderFetchFnType<Model, Service>): this;
|
|
2155
|
+
withCreate(fn?: EditorDataProviderCreateFnType<CreateModel, Model, Service>): this;
|
|
2156
|
+
withUpdate(fn?: EditorDataProviderUpdateFnType<UpdateModel, Model, Service>): this;
|
|
2157
|
+
withDelete<Item = undefined>(fn?: EditorDataProviderDeleteFnType<Model, Service, Item>): this;
|
|
2158
|
+
withMapFetchItemToCreateItem(fn?: EditorDataProviderFetchMapToFnType<Model, CreateModel>): this;
|
|
2159
|
+
withMapFetchItemToUpdateItem(fn?: EditorDataProviderFetchMapToFnType<Model, UpdateModel>): this;
|
|
2160
|
+
reloadTable(event?: TableReloadEvent<Sorts, Filters>): void;
|
|
2161
|
+
resetEditor(event?: EditorResetEvent<Model>): void;
|
|
2162
|
+
}
|
|
2163
|
+
declare class DynamicTableviewDataProviderInst<Service = any, ServiceClass = ServiceClassOptType<Service>> extends TableviewDataProviderInst<any, Service, any, any, ServiceClass> {
|
|
2164
|
+
constructor(serviceType: ServiceClass);
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
/**
|
|
2168
|
+
* Creates and returns an instance of `TableviewDataProviderInst` with the specified options for managing tableview data.
|
|
2169
|
+
*
|
|
2170
|
+
* @param {Object} [opts] - The options object to configure the data provider.
|
|
2171
|
+
* @param {TypeDescriptor<Model> | ModelDescriptor<Model>} [opts.type] - The descriptor defining the type of model.
|
|
2172
|
+
* @param {ServiceClassType<Service>} [opts.service] - The service class type associated with the data provider.
|
|
2173
|
+
* @param {TypeDescriptor<CreateModel> | ModelDescriptor<CreateModel>} [opts.filtersType] - The descriptor defining the filters type.
|
|
2174
|
+
* @param {TypeDescriptor<UpdateModel> | ModelDescriptor<UpdateModel>} [opts.sortsType] - The descriptor defining the sorts type.
|
|
2175
|
+
* @return {TableviewDataProviderInst<Model, Service, Sorts, Filters, ServiceClass, TableModel, CreateModel, UpdateModel>} An instance of `TableviewDataProviderInst` configured according to the provided options.
|
|
2176
|
+
*/
|
|
2177
|
+
declare function tableviewDataProvider<Model, Service = undefined, Sorts = keyof Model, Filters extends keyof any = keyof Model, TableModel = Model, CreateModel = Model, UpdateModel = Model, ServiceClass = Service extends undefined ? undefined : ServiceClassType<Service>>(opts?: {
|
|
2178
|
+
type?: TypeDescriptor<Model> | ModelDescriptor<Model>;
|
|
2179
|
+
service?: ServiceClassType<Service>;
|
|
2180
|
+
tableType?: TypeDescriptor<TableModel> | ModelDescriptor<TableModel>;
|
|
2181
|
+
createType?: TypeDescriptor<CreateModel> | ModelDescriptor<Model>;
|
|
2182
|
+
updateType?: TypeDescriptor<UpdateModel> | ModelDescriptor<Model>;
|
|
2183
|
+
filtersType?: TypeDescriptor<Filters> | ModelDescriptor<Filters>;
|
|
2184
|
+
sortsType?: TypeDescriptor<Sorts> | ModelDescriptor<Sorts>;
|
|
2185
|
+
}): TableviewDataProviderInst<Model, Service, Sorts, Filters, ServiceClass, TableModel, CreateModel, UpdateModel>;
|
|
2186
|
+
declare function tableviewDynamicDataProvider(): DynamicTableviewDataProviderInst<undefined, undefined>;
|
|
2187
|
+
declare function tableviewDynamicDataProvider<Service>(serviceType: ServiceClassType<Service>): DynamicTableviewDataProviderInst<Service, ServiceClassType<Service>>;
|
|
2188
|
+
|
|
2189
|
+
type TableviewDescriptorCreateSortsFiltersParentOptsType<Model, Sorts = keyof Model, Filters = keyof Model, ParentEditorModel = undefined> = {
|
|
2190
|
+
filtersType?: TypeDescriptor<Filters> | ModelDescriptor<Filters>;
|
|
2191
|
+
sortsType?: TypeDescriptor<Sorts> | ModelDescriptor<Filters>;
|
|
2192
|
+
parentEditorType?: TypeDescriptor<ParentEditorModel> | ModelDescriptor<ParentEditorModel> | EditorDescriptorInst<ParentEditorModel, any> | TableviewDescriptorInst<ParentEditorModel, any, any, any, any, ParentEditorModel, ParentEditorModel, ParentEditorModel>;
|
|
2193
|
+
};
|
|
2194
|
+
type TableviewDescriptorCreateOptsType<Model, Sorts = keyof Model, Filters = keyof Model, ParentEditorModel = undefined> = TableviewDescriptorCreateSortsFiltersParentOptsType<Model, Sorts, Filters, ParentEditorModel>;
|
|
2195
|
+
type TableviewDescriptorCreateWithModelDescriptorOptsType<Model, Sorts = keyof Model, Filters = keyof Model, ParentEditorModel = undefined> = TableviewDescriptorCreateOptsType<Model, Sorts, Filters, ParentEditorModel> & ModelDescriptorCreateOpts<Model>;
|
|
2196
|
+
declare function tableviewDescriptor<Model, Sorts = keyof Model, Filters = keyof Model, ParentEditorModel = undefined, TableModel = Model>(): TableviewDescriptorInst<Model, Sorts, Filters, ParentEditorModel, TableModel, Model, Model, Model>;
|
|
2197
|
+
declare function tableviewDescriptor<Model, Sorts = keyof Model, Filters = keyof Model, ParentEditorModel = undefined, TableModel = Model>(opts: TableviewDescriptorCreateWithModelDescriptorOptsType<Model, Sorts, Filters, ParentEditorModel>): TableviewDescriptorInst<Model, Sorts, Filters, ParentEditorModel, TableModel, Model, Model, Model>;
|
|
2198
|
+
declare function tableviewDescriptor<Model, Sorts = keyof Model, Filters = keyof Model, ParentEditorModel = undefined, TableModel = Model>(opts: TableviewDescriptorCreateWithModelDescriptorOptsType<Model, Sorts, Filters, ParentEditorModel>): TableviewDescriptorInst<Model, Sorts, Filters, ParentEditorModel, TableModel, Model, Model, Model>;
|
|
2199
|
+
declare function tableviewDescriptor<Model, Sorts = keyof Model, Filters = keyof Model, ParentEditorModel = undefined, TableModel = Model>(model: ModelDescriptor<Model>, opts?: TableviewDescriptorCreateOptsType<Model, Sorts, Filters, ParentEditorModel>): TableviewDescriptorInst<Model, Sorts, Filters, ParentEditorModel, TableModel, Model, Model, Model>;
|
|
2200
|
+
type TableviewDescriptorMultiModelCreateOptsType<Model, Sorts = keyof Model, Filters = keyof Model, ParentEditorModel = undefined, TableModel = Model, AddModel = Model, EditModel = Model> = TableviewDescriptorCreateSortsFiltersParentOptsType<Model, Sorts, Filters, ParentEditorModel> & TableviewDescriptorInstConstructorOpts<TableModel, AddModel, EditModel>;
|
|
2201
|
+
type TableviewDescriptorCreateMultiModelWithModelDescriptorOptsType<Model, Sorts = keyof Model, Filters = keyof Model, ParentEditorModel = undefined, TableModel = Model, AddModel = Model, EditModel = Model> = TableviewDescriptorMultiModelCreateOptsType<Model, Sorts, Filters, ParentEditorModel, TableModel, AddModel, EditModel> & ModelDescriptorCreateOpts<Model>;
|
|
2202
|
+
declare function tableviewDescriptorMultiModel<Model, Sorts = keyof Model, Filters = keyof Model, ParentEditorModel = undefined, TableModel = Model, AddModel = Model, EditModel = Model>(): TableviewDescriptorInst<Model, Sorts, Filters, ParentEditorModel, TableModel, AddModel, EditModel, TableviewDescriptorFieldsManageMultiType<Model, AddModel, EditModel>>;
|
|
2203
|
+
declare function tableviewDescriptorMultiModel<Model, Sorts = keyof Model, Filters = keyof Model, ParentEditorModel = undefined, TableModel = Model, AddModel = Model, EditModel = Model>(opts: TableviewDescriptorCreateMultiModelWithModelDescriptorOptsType<Model, Sorts, Filters, ParentEditorModel, TableModel, AddModel, EditModel>): TableviewDescriptorInst<Model, Sorts, Filters, ParentEditorModel, TableModel, AddModel, EditModel>;
|
|
2204
|
+
declare function tableviewDescriptorMultiModel<Model, Sorts = keyof Model, Filters = keyof Model, ParentEditorModel = undefined, TableModel = Model, AddModel = Model, EditModel = Model>(opts: TableviewDescriptorCreateMultiModelWithModelDescriptorOptsType<Model, Sorts, Filters, ParentEditorModel, TableModel, AddModel, EditModel>): TableviewDescriptorInst<Model, Sorts, Filters, ParentEditorModel, TableModel, AddModel, EditModel>;
|
|
2205
|
+
declare function tableviewDescriptorMultiModel<Model, Sorts = keyof Model, Filters = keyof Model, ParentEditorModel = undefined, TableModel = Model, AddModel = Model, EditModel = Model>(model: ModelDescriptor<Model>, opts?: TableviewDescriptorMultiModelCreateOptsType<Model, Sorts, Filters, ParentEditorModel, TableModel, AddModel, EditModel>): TableviewDescriptorInst<Model, Sorts, Filters, ParentEditorModel, TableModel, AddModel, EditModel>;
|
|
2206
|
+
declare function tableviewDynamicDescriptor(modelOrOpts?: ModelDescriptor<any> | TableviewDescriptorCreateMultiModelWithModelDescriptorOptsType<any>): TableviewDynamicDescriptorInt;
|
|
2207
|
+
|
|
2208
|
+
declare function convertDataToStringWithDelimiter(data: any[], delimiter: string, descriptor: TableviewDescriptorInst<any, any, any>, translate: TranslateService): string;
|
|
2209
|
+
declare function saveFileAs(blob: Blob, filename: string): void;
|
|
2210
|
+
|
|
2211
|
+
interface TableviewInput<Model, Service, Sorts = keyof Model, Filters extends keyof any = keyof Model, TableModel = Model, AddModel = Model, EditModel = Model, Descriptor = TableviewDescriptorInst<Model, Sorts, Filters, undefined, TableModel, AddModel, EditModel>, DataProvider = ITableviewDataProvider<Model, Service, Sorts, Filters, any, TableModel, AddModel, EditModel>> {
|
|
2212
|
+
descriptor: Descriptor;
|
|
2213
|
+
dataProvider: DataProvider;
|
|
2214
|
+
actions: ActionDescriptorInst<Model>[];
|
|
2215
|
+
}
|
|
2216
|
+
|
|
2217
|
+
declare enum TableviewDefaultActionsEnum {
|
|
2218
|
+
Details = 0,
|
|
2219
|
+
Add = 1,
|
|
2220
|
+
Edit = 2,
|
|
2221
|
+
EditOnDetails = 3,
|
|
2222
|
+
Delete = 4,
|
|
2223
|
+
DeleteOnDetails = 5,
|
|
2224
|
+
Refresh = 6,
|
|
2225
|
+
Export = 7,
|
|
2226
|
+
ExportJson = 8,
|
|
2227
|
+
ExportCsv = 9,
|
|
2228
|
+
LocalizationLanguageSelect = 10
|
|
2229
|
+
}
|
|
2230
|
+
declare function tableviewGetDefaultActions(): TableviewDefaultActionsEnum[];
|
|
2231
|
+
declare function tableviewCreateDefaultActions(tableview: TableviewDescriptorInst<any, any, any>, defaultActions?: TableviewDefaultActionsEnum[], defaultActionsOverrides?: Record<number, ActionDescriptorInst<any>>, injector?: Injector | null): Array<ActionDescriptorInst<any>>;
|
|
2232
|
+
declare function tableviewCreateDefaultAction(type: TableviewDefaultActionsEnum, tableview: TableviewDescriptorInst<any, any, any>, defaultActions?: TableviewDefaultActionsEnum[], defaultActionsOverrides?: Record<number, ActionDescriptorInst<any>>, injector?: Injector | null): ActionDescriptorInst<any> | null;
|
|
2233
|
+
declare const tableviewActionEditorDetailsActionName = "details";
|
|
2234
|
+
declare const tableviewActionEditorDetailsRoute = ":itemId";
|
|
2235
|
+
type TableviewActionDetailsOnTableOptsType<Model, TableModel, Service> = {
|
|
2236
|
+
table?: TableDescriptorInst<TableModel>;
|
|
2237
|
+
serviceProvider?: ActionEditorProviderType<Model, Service>;
|
|
2238
|
+
injector?: Injector | null;
|
|
2239
|
+
position?: ActionPositionEnum.RowInline | ActionPositionEnum.RowClick;
|
|
2240
|
+
};
|
|
2241
|
+
declare function tableviewActionDetailsOnTable<Model, TableModel, Service = undefined>(model: ModelDescriptor<Model>, descriptor: EditorDescriptorInst<Model>, opts?: TableviewActionDetailsOnTableOptsType<Model, TableModel, Service>): ActionEditorDescriptorInst<Model, Service, Model, TableModel, undefined, TableModel> | null;
|
|
2242
|
+
declare const tableviewActionEditorAddActionName = "add";
|
|
2243
|
+
declare const tableviewActionEditorAddRoute = "add";
|
|
2244
|
+
type ActionEditorProviderAddType<Model, AddModel, Service> = ServiceClassType<Service> | IEditorDataProvider<Model, Service, any, AddModel, any>;
|
|
2245
|
+
type TableviewActionAddOnTableOptsType<Model, AddModel, Service> = {
|
|
2246
|
+
serviceProvider?: ActionEditorProviderAddType<Model, AddModel, Service>;
|
|
2247
|
+
injector?: Injector | null;
|
|
2248
|
+
position?: ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight;
|
|
2249
|
+
};
|
|
2250
|
+
declare function tableviewActionAddOnTable<Model, AddModel, Service = undefined>(model: ModelDescriptor<Model>, descriptor: EditorDescriptorInst<AddModel>, opts?: TableviewActionAddOnTableOptsType<Model, AddModel, Service>): ActionEditorDescriptorInst<Model, Service, AddModel, undefined, Model, undefined> | null;
|
|
2251
|
+
declare const tableviewActionEditorEditActionName = "edit";
|
|
2252
|
+
declare const tableviewActionEditorEditRoute = ":itemId/edit";
|
|
2253
|
+
type ActionEditorProviderEditType<Model, EditModel, Service> = ServiceClassType<Service> | IEditorDataProvider<Model, Service, any, any, EditModel>;
|
|
2254
|
+
type TableviewActionEditOnTableOptsType<Model, EditModel, TableModel, Service> = {
|
|
2255
|
+
table?: TableDescriptorInst<TableModel, any, any>;
|
|
2256
|
+
serviceProvider?: ActionEditorProviderEditType<Model, EditModel, Service>;
|
|
2257
|
+
injector?: Injector | null;
|
|
2258
|
+
position?: ActionPositionEnum.RowClick | ActionPositionEnum.RowInline;
|
|
2259
|
+
};
|
|
2260
|
+
declare function tableviewActionEditOnTable<Model, EditModel, TableModel, Service = undefined>(model: ModelDescriptor<Model>, descriptor: EditorDescriptorInst<EditModel>, opts?: TableviewActionEditOnTableOptsType<Model, EditModel, TableModel, Service>): ActionEditorDescriptorInst<Model, Service, EditModel, TableModel, Model, TableModel> | null;
|
|
2261
|
+
type TableviewActionEditOnDetailsOptsType = {
|
|
2262
|
+
injector?: Injector | null;
|
|
2263
|
+
position?: ActionPositionEnum.FooterLeft | ActionPositionEnum.FooterRight;
|
|
2264
|
+
};
|
|
2265
|
+
declare function tableviewActionEditOnDetails<Model>(model: ModelDescriptor<Model>, opts?: TableviewActionEditOnDetailsOptsType): ActionLinkDescriptorInst<Model> | null;
|
|
2266
|
+
declare const tableviewActionDeleteActionName = "delete";
|
|
2267
|
+
type TableviewActionDeleteOnTableOptsType<Model, TableModel, Service> = {
|
|
2268
|
+
injector?: Injector | null;
|
|
2269
|
+
table?: TableDescriptorInst<TableModel, any, any>;
|
|
2270
|
+
serviceProvider?: ActionProviderType<Model, Service>;
|
|
2271
|
+
position?: ActionPositionEnum.RowInline | ActionPositionEnum.RowClick;
|
|
2272
|
+
};
|
|
2273
|
+
declare function tableviewActionDeleteOnTable<Model, TableModel, Service = undefined>(model: ModelDescriptor<Model>, opts?: TableviewActionDeleteOnTableOptsType<Model, TableModel, Service>): ActionDescriptorInst<Model, Service, TableModel, Model, TableModel> | null;
|
|
2274
|
+
type TableviewActionDeleteOnDetailsOptsType<Model, Service> = {
|
|
2275
|
+
injector?: Injector | null;
|
|
2276
|
+
serviceProvider?: ActionProviderType<Model, Service>;
|
|
2277
|
+
position?: ActionPositionEnum.RowInline | ActionPositionEnum.RowClick;
|
|
2278
|
+
};
|
|
2279
|
+
declare function tableviewActionDeleteOnDetails<Model, Service = undefined>(model: ModelDescriptor<Model>, opts?: TableviewActionDeleteOnDetailsOptsType<Model, Service>): ActionDescriptorInst<Model, Service, Model, Model, Model> | null;
|
|
2280
|
+
type TableviewActionExportOnTableOptsType = {
|
|
2281
|
+
injector?: Injector | null;
|
|
2282
|
+
defaultActions?: TableviewDefaultActionsEnum[];
|
|
2283
|
+
position?: ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight;
|
|
2284
|
+
};
|
|
2285
|
+
declare function tableviewActionExportOnTable<Model>(descriptor: TableviewDescriptorInst<Model>, opts?: TableviewActionExportOnTableOptsType): ActionDescriptorInst<Model, undefined, undefined, undefined> | null;
|
|
2286
|
+
declare function tableviewActionExportJsonOnTable<Model>(descriptor: TableviewDescriptorInst<Model>, opts?: Omit<TableviewActionExportOnTableOptsType, 'defaultActions'>): ActionDescriptorInst<Model, undefined, undefined, undefined>;
|
|
2287
|
+
declare function tableviewActionExportCsvOnTable<Model>(descriptor: TableviewDescriptorInst<Model>, opts?: Omit<TableviewActionExportOnTableOptsType, 'defaultActions'>): ActionDescriptorInst<Model, undefined, undefined, undefined>;
|
|
2288
|
+
type TableviewActionRefreshOnTableOptsType = {
|
|
2289
|
+
position?: ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight;
|
|
2290
|
+
};
|
|
2291
|
+
declare function tableviewActionRefreshOnTable<Model>(descriptor: ModelDescriptor<Model>, opts?: TableviewActionRefreshOnTableOptsType): ActionDescriptorInst<Model, undefined, undefined, undefined, undefined> | null;
|
|
2292
|
+
type TableviewLocalizationLangSelectOnTableActionOptsType = {
|
|
2293
|
+
position?: ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight;
|
|
2294
|
+
};
|
|
2295
|
+
declare function tableviewActionLocalizationLangSelectOnTable<Model>(descriptor: TableviewDescriptorInst<Model>, opts?: TableviewLocalizationLangSelectOnTableActionOptsType): ActionDescriptorInst<Model, undefined, undefined, undefined, undefined> | null;
|
|
2296
|
+
|
|
2297
|
+
type TvBuilderSetterParamsType<Descriptor, DataProvider> = {
|
|
2298
|
+
descriptor: Descriptor;
|
|
2299
|
+
dataProvider: DataProvider;
|
|
2300
|
+
injector: Injector;
|
|
2301
|
+
};
|
|
2302
|
+
type TvBuilderActionSetterFnType<ActionModel, ActionService, ActionInput, ActionResult, ValidationInput, Descriptor, DataProvider> = (params: TvBuilderSetterParamsType<Descriptor, DataProvider>) => Nullable<ActionDescriptorInst<ActionModel, ActionService, ActionInput, ActionResult, ValidationInput> | ActionEditorDescriptorInst<ActionModel, ActionService, any, ActionInput, ActionResult, ValidationInput>>;
|
|
2303
|
+
type TvBuilderDescriptorSetterFnType<Descriptor, DataProvider> = (params: TvBuilderSetterParamsType<Descriptor, DataProvider>) => Descriptor;
|
|
2304
|
+
type TvBuilderDataProviderSetterFnType<Descriptor, DataProvider> = (params: TvBuilderSetterParamsType<Descriptor, DataProvider>) => DataProvider;
|
|
2305
|
+
/**
|
|
2306
|
+
* The `TableviewBuilder` class is used to build a tableview configuration.
|
|
2307
|
+
* It allows you to set various options such as the descriptor, data provider,
|
|
2308
|
+
* default actions, and custom actions for the tableview.
|
|
2309
|
+
*
|
|
2310
|
+
* @typeparam Model - The main model type.
|
|
2311
|
+
* @typeparam Service - The API service type.
|
|
2312
|
+
* @typeparam Descriptor - The descriptor type.
|
|
2313
|
+
* @typeparam DataProvider - The data provider type.
|
|
2314
|
+
* @typeparam Sorts - The sort type representing available sort keys.
|
|
2315
|
+
* @typeparam Filters - The filter type representing available filter keys.
|
|
2316
|
+
*/
|
|
2317
|
+
declare class TableviewInputBuilder<Model, Service, Descriptor extends TableviewDescriptorInst<Model, Sorts, Filters, undefined, TableModel, AddModel, EditModel, FieldsModel>, DataProvider extends IDataProvider<Model, Service>, Sorts = keyof Model, Filters extends keyof any = keyof Model, TableModel = Model, AddModel = Model, EditModel = Model, FieldsModel = Model> {
|
|
2318
|
+
private _descriptor;
|
|
2319
|
+
private _dataProvider;
|
|
2320
|
+
private readonly injector;
|
|
2321
|
+
private defaultActions;
|
|
2322
|
+
private readonly _customActions;
|
|
2323
|
+
constructor(_descriptor: Descriptor, _dataProvider: DataProvider, injector: Injector);
|
|
2324
|
+
private prepareSetterParams;
|
|
2325
|
+
/**
|
|
2326
|
+
* Sets a descriptor instead of the default one.
|
|
2327
|
+
*
|
|
2328
|
+
* @param {TvBuilderDescriptorSetterFnType<Descriptor, DataProvider>} fn - The function that returns the new descriptor. It should accept a single parameter of type `TvBuilderSetterParamsType<Descriptor, DataProvider>`.
|
|
2329
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
2330
|
+
*/
|
|
2331
|
+
withDescriptor(fn: TvBuilderDescriptorSetterFnType<Descriptor, DataProvider>): this;
|
|
2332
|
+
/**
|
|
2333
|
+
* Adjusts the descriptor using the provided adjust function.
|
|
2334
|
+
*
|
|
2335
|
+
* @param {(descriptor: Descriptor) => void} adjustFn - The function used to adjust the descriptor. It accepts a single parameter of type `Descriptor`.
|
|
2336
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
2337
|
+
*/
|
|
2338
|
+
withAdjustDescriptor(adjustFn: (descriptor: Descriptor) => void): this;
|
|
2339
|
+
/**
|
|
2340
|
+
* Sets the data provider for the TvBuilder instance
|
|
2341
|
+
*
|
|
2342
|
+
* @param {TvBuilderDataProviderSetterFnType<Descriptor, DataProvider>} fn - The function that returns the new data provider. It accepts a single parameter of type `TvBuilderSetterParamsType<Descriptor, DataProvider>`.
|
|
2343
|
+
* * @returns {this} - Returns the current instance of the builder.
|
|
2344
|
+
*/
|
|
2345
|
+
withDataProvider(fn: TvBuilderDataProviderSetterFnType<Descriptor, DataProvider>): this;
|
|
2346
|
+
/**
|
|
2347
|
+
* Adjusts the data provider using the provided adjust function.
|
|
2348
|
+
*
|
|
2349
|
+
* @param {(dataProvider: DataProvider) => void} adjustFn - The function used to adjust the data provider. It accepts a single parameter of type `DataProvider`.
|
|
2350
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
2351
|
+
*/
|
|
2352
|
+
withAdjustDataProvider(adjustFn: (dataProvider: DataProvider) => void): this;
|
|
2353
|
+
/**
|
|
2354
|
+
* Adjusts the data provider and/or descriptor using the provided adjust function.
|
|
2355
|
+
*
|
|
2356
|
+
* @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>`.
|
|
2357
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
2358
|
+
*/
|
|
2359
|
+
withAdjust(adjustFn: (params: TvBuilderSetterParamsType<Descriptor, DataProvider>) => void): this;
|
|
2360
|
+
/**
|
|
2361
|
+
* Associates a fetch function for a data provider API service with the specified parameters.
|
|
2362
|
+
*
|
|
2363
|
+
* @param {ServiceFn} serviceFn The function from the service class that performs the fetch API call.
|
|
2364
|
+
* Must be a key of the service with a parameter and return an Observable.
|
|
2365
|
+
* @param {ClassFunctionKeyParam1ObjKeyExtendsOfTargetType<Service, ServiceFn, IdType>} fnItemIdParamName The parameter name for itemId used as the key within the request object of fetch function on API service.
|
|
2366
|
+
*/
|
|
2367
|
+
withDataServiceFetchFn<ServiceFn extends ClassFunctionKeysWithParamAndReturnType<Service, any, Observable<Model>>>(serviceFn: ServiceFn, itemIdParamName: ClassFunctionKeyParam1ObjKeyExtendsOfTargetType<Service, ServiceFn, IdType>): this;
|
|
2368
|
+
/**
|
|
2369
|
+
* Associates a create function for a data provider API service with the specified parameters.
|
|
2370
|
+
*
|
|
2371
|
+
* @param {ServiceFn} serviceFn The function from the service class that performs the create API call.
|
|
2372
|
+
* Must be a key of the service with a parameter and return an Observable.
|
|
2373
|
+
* @param {ClassFunctionKeyParam1ObjKeyExtendsOfTargetType<Service, ServiceFn, Undefined<EditModel>>} serviceFnItemParamName The parameter name for item used as the key within the request object of create function on API service.
|
|
2374
|
+
* @param {EditorDataProviderFetchMapToFnType<Model, AddModel>} [mapFetchItem] Map function to transform model from fetch to form's add model.
|
|
2375
|
+
*/
|
|
2376
|
+
withDataServiceCreateFn<ServiceFn extends ClassFunctionKeysWithParamAndReturnType<Service, any, Observable<any>>>(serviceFn: ServiceFn, serviceFnItemParamName: ClassFunctionKeyParam1ObjKeyExtendsOfTargetType<Service, ServiceFn, AddModel>, mapFetchItem?: EditorDataProviderFetchMapToFnType<Model, AddModel>): this;
|
|
2377
|
+
/**
|
|
2378
|
+
* Associates an update function for a data provider API service with the specified parameters.
|
|
2379
|
+
*
|
|
2380
|
+
* @param {ServiceFn} serviceFn The function from the service class that performs the update API call.
|
|
2381
|
+
* Must be a key of the service with a parameter and return an Observable.
|
|
2382
|
+
* @param {ClassFunctionKeyParam1ObjKeyExtendsOfTargetType<Service, ServiceFn, Undefined<EditModel>>} fnItemParamName The parameter name for item used as the key within the request object of update function on API service.
|
|
2383
|
+
* @param {ClassFunctionKeyParam1ObjKeyExtendsOfTargetType<Service, ServiceFn, IdType>} [fnItemIdParamName] The parameter name for itemId used as the key within the request object of update function on API service.
|
|
2384
|
+
* @param {EditorDataProviderFetchMapToFnType<Model, EditModel>} [mapFetchItem] Map function to transform model from fetch to form' edit model.
|
|
2385
|
+
*/
|
|
2386
|
+
withDataServiceUpdateFn<ServiceFn extends ClassFunctionKeysWithParamAndReturnType<Service, any, Observable<any>>>(serviceFn: ServiceFn, fnItemParamName: ClassFunctionKeyParam1ObjKeyExtendsOfTargetType<Service, ServiceFn, EditModel>, fnItemIdParamName?: ClassFunctionKeyParam1ObjKeyExtendsOfTargetType<Service, ServiceFn, IdType>, mapFetchItem?: EditorDataProviderFetchMapToFnType<Model, EditModel>): this;
|
|
2387
|
+
/**
|
|
2388
|
+
* Associates a delete function for a data provider API service with the specified parameters.
|
|
2389
|
+
*
|
|
2390
|
+
* @param {ServiceFn} serviceFn The function from the service class that performs the delete API call.
|
|
2391
|
+
* Must be a key of the service with a parameter and return an Observable.
|
|
2392
|
+
* @param {ClassFunctionKeyParam1ObjKeyExtendsOfTargetType<Service, ServiceFn, IdType>} fnItemIdParamName The parameter name for itemId used as the key within the request object of delete function on API service.
|
|
2393
|
+
*/
|
|
2394
|
+
withDataServiceDeleteFn<ServiceFn extends ClassFunctionKeysWithParamAndReturnType<Service, any, Observable<any>>>(serviceFn: ServiceFn, fnItemIdParamName: ClassFunctionKeyParam1ObjKeyExtendsOfTargetType<Service, ServiceFn, IdType>): this;
|
|
2395
|
+
/**
|
|
2396
|
+
* Removes all the default tableview actions.
|
|
2397
|
+
*
|
|
2398
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
2399
|
+
*/
|
|
2400
|
+
withNoDefaultActions(): this;
|
|
2401
|
+
/**
|
|
2402
|
+
* Adds the default actions specified in parameters.
|
|
2403
|
+
*
|
|
2404
|
+
* @param {TableviewDefaultActionsEnum[]} types - The default actions to add.
|
|
2405
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
2406
|
+
*/
|
|
2407
|
+
withDefaultActions(...types: TableviewDefaultActionsEnum[]): this;
|
|
2408
|
+
/**
|
|
2409
|
+
* Removes the default actions specified in parameters.
|
|
2410
|
+
*
|
|
2411
|
+
* @param {TableviewDefaultActionsEnum[]} types - The default actions to remove.
|
|
2412
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
2413
|
+
*/
|
|
2414
|
+
withoutDefaultActions(...types: TableviewDefaultActionsEnum[]): this;
|
|
2415
|
+
/**
|
|
2416
|
+
* Overrides the default action.
|
|
2417
|
+
*
|
|
2418
|
+
* @param {TableviewDefaultActionsEnum} type - The default actions to override.
|
|
2419
|
+
* @param {TvBuilderActionSetterFnType<Model, ActionService , ActionRunInput, ActionRunResult, Descriptor, DataProvider>} fn - The function that returns the new action descriptor. It accepts a single parameter of type `TvBuilderSetterParamsType<Descriptor, DataProvider>`.
|
|
2420
|
+
* @typeParam ActionService - The service type (same as build `Service` by default).
|
|
2421
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
2422
|
+
*/
|
|
2423
|
+
withDefaultActionOverride<ActionService = Service, ActionRunInput = Model, ActionRunResult = Model, ValidationInput = Model>(type: TableviewDefaultActionsEnum, fn: TvBuilderActionSetterFnType<Model, ActionService, ActionRunInput, ActionRunResult, ValidationInput, Descriptor, DataProvider>): this;
|
|
2424
|
+
/**
|
|
2425
|
+
* Adds a custom action.
|
|
2426
|
+
*
|
|
2427
|
+
* @deprecated Use on of {withActionOnTable}, {withActionOnDetailsEditor}, {withActionOnEditEditor} or {withActionOnAddEditor} instead.
|
|
2428
|
+
*
|
|
2429
|
+
* @param {TvBuilderActionSetterFnType<Model, ActionService, ActionRunInput, ActionRunResult, Descriptor, DataProvider>} fn - The function that returns the new action descriptor. It accepts a single parameter of type `TvBuilderSetterParamsType<Descriptor, DataProvider>`.
|
|
2430
|
+
* @typeParam ActionService - The service type (same as build `Service` by default).
|
|
2431
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
2432
|
+
*/
|
|
2433
|
+
withAction<ActionModel = Model, ActionService = Service, ActionRunInput = Model, ActionRunResult = Model, ValidationInput = Model>(fn: TvBuilderActionSetterFnType<ActionModel, ActionService, ActionRunInput, ActionRunResult, ValidationInput, Descriptor, DataProvider>): this;
|
|
2434
|
+
/**
|
|
2435
|
+
* Adds a custom action on table row or top (header or toolbar).
|
|
2436
|
+
*
|
|
2437
|
+
* @param {TvBuilderActionSetterFnType<Model, ActionService, ActionRunResult, Descriptor, DataProvider>} fn - The function that returns the new action descriptor. It accepts a single parameter of type `TvBuilderSetterParamsType<Descriptor, DataProvider>`.
|
|
2438
|
+
* @param {ActionPositionEnum} fn - The function that returns the new action descriptor. It accepts a single parameter of type `TvBuilderSetterParamsType<Descriptor, DataProvider>`.
|
|
2439
|
+
* @typeParam ActionService - The service type (same as build `Service` by default).
|
|
2440
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
2441
|
+
*/
|
|
2442
|
+
withActionOnTable<ActionModel = Model, ActionService = Service, ActionInput extends TableModel | undefined = TableModel, ActionRunResult = Model>(fn: TvBuilderActionSetterFnType<ActionModel, ActionService, ActionInput, ActionRunResult, ActionInput, Descriptor, DataProvider>): this;
|
|
2443
|
+
/**
|
|
2444
|
+
* Adds a custom action on details editor.
|
|
2445
|
+
*
|
|
2446
|
+
* @param {TvBuilderActionSetterFnType<Model, ActionService, ActionRunResult, Descriptor, DataProvider>} fn - The function that returns the new action descriptor. It accepts a single parameter of type `TvBuilderSetterParamsType<Descriptor, DataProvider>`.
|
|
2447
|
+
* @param {ActionPositionEnum} fn - The function that returns the new action descriptor. It accepts a single parameter of type `TvBuilderSetterParamsType<Descriptor, DataProvider>`.
|
|
2448
|
+
* @typeParam ActionService - The service type (same as build `Service` by default).
|
|
2449
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
2450
|
+
*/
|
|
2451
|
+
withActionOnDetailsEditor<ActionModel = Model, ActionService = Service, ActionInput extends Model = Model, ActionResult = Model>(fn: TvBuilderActionSetterFnType<ActionModel, ActionService, ActionInput, ActionResult, ActionInput, Descriptor, DataProvider>): this;
|
|
2452
|
+
/**
|
|
2453
|
+
* Adds a custom action on edit editor.
|
|
2454
|
+
*
|
|
2455
|
+
* @param {TvBuilderActionSetterFnType<Model, ActionService, ActionRunResult, Descriptor, DataProvider>} fn - The function that returns the new action descriptor. It accepts a single parameter of type `TvBuilderSetterParamsType<Descriptor, DataProvider>`.
|
|
2456
|
+
* @param {ActionPositionEnum} fn - The function that returns the new action descriptor. It accepts a single parameter of type `TvBuilderSetterParamsType<Descriptor, DataProvider>`.
|
|
2457
|
+
* @typeParam ActionService - The service type (same as build `Service` by default).
|
|
2458
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
2459
|
+
*/
|
|
2460
|
+
withActionOnEditEditor<ActionModel = Model, ActionService = Service, ActionInput extends EditModel = EditModel, ActionResult = Model>(fn: TvBuilderActionSetterFnType<ActionModel, ActionService, ActionInput, ActionResult, ActionInput, Descriptor, DataProvider>): this;
|
|
2461
|
+
/**
|
|
2462
|
+
* Adds a custom action on add editor.
|
|
2463
|
+
*
|
|
2464
|
+
* @param {TvBuilderActionSetterFnType<Model, ActionService, ActionRunResult, Descriptor, DataProvider>} fn - The function that returns the new action descriptor. It accepts a single parameter of type `TvBuilderSetterParamsType<Descriptor, DataProvider>`.
|
|
2465
|
+
* @param {ActionPositionEnum} fn - The function that returns the new action descriptor. It accepts a single parameter of type `TvBuilderSetterParamsType<Descriptor, DataProvider>`.
|
|
2466
|
+
* @typeParam ActionService - The service type (same as build `Service` by default).
|
|
2467
|
+
* @returns {this} - Returns the current instance of the builder.
|
|
2468
|
+
*/
|
|
2469
|
+
withActionOnAddEditor<ActionModel = Model, ActionService = Service, ActionInput extends AddModel = AddModel, ActionResult = Model>(fn: TvBuilderActionSetterFnType<ActionModel, ActionService, ActionInput, ActionResult, ActionInput, Descriptor, DataProvider>): this;
|
|
2470
|
+
/**
|
|
2471
|
+
* @internal
|
|
2472
|
+
*
|
|
2473
|
+
* Builds and returns an instance of ITableview.
|
|
2474
|
+
* DO NOT CALL this within tableview create callback function!
|
|
2475
|
+
*
|
|
2476
|
+
* @return {TableviewInput<Model, Service, Sorts, Filters, TableModel, AddModel, EditModel, Descriptor, DataProvider>} - The built ITableview instance.
|
|
2477
|
+
*/
|
|
2478
|
+
build(): TableviewInput<Model, Service, Sorts, Filters, TableModel, AddModel, EditModel, Descriptor, DataProvider>;
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
/**
|
|
2482
|
+
* Creates a tableview with the given model, service.
|
|
2483
|
+
*
|
|
2484
|
+
* @param {ModelDescriptor<Model>} model - The model descriptor.
|
|
2485
|
+
* @param {ServiceClassType<Service>} [opts.service] - The class type of the service.
|
|
2486
|
+
* @param {TypeDescriptor<Sorts> | ModelDescriptor<Sorts>} [opts.sortsType] - Type of sorts
|
|
2487
|
+
* @param {TypeDescriptor<Filters> | ModelDescriptor<Filters>} [opts.filtersType] - Type of filters.
|
|
2488
|
+
* @param {(builder: TableviewBuilder) => void} [buildFn] - The optional callback function to customize the tableview using the prepared builder.
|
|
2489
|
+
*
|
|
2490
|
+
* @returns A tableview instance with descriptor, data provider and actions.
|
|
2491
|
+
*/
|
|
2492
|
+
declare function tableview<Model, Service = undefined, Sorts = keyof Model, Filters extends keyof any = keyof Model>(model: ModelDescriptor<Model>, opts?: {
|
|
2493
|
+
service?: ServiceClassType<Service>;
|
|
2494
|
+
sortsType?: TypeDescriptor<Sorts> | ModelDescriptor<Sorts>;
|
|
2495
|
+
filtersType?: TypeDescriptor<Filters> | ModelDescriptor<Filters>;
|
|
2496
|
+
}, buildFn?: (builder: TableviewInputBuilder<Model, Service, TableviewDescriptorInst<Model, Sorts, Filters>, TableviewDataProviderInst<Model, Service, Sorts, Filters>, Sorts, Filters>) => void): _mediusinc_mng_commons_tableview_api.TableviewInput<Model, Service, Sorts, Filters, Model, Model, Model, TableviewDescriptorInst<Model, Sorts, Filters, undefined, Model, Model, Model, TableviewDescriptorFieldsManageMultiType<Model, Model, Model>>, TableviewDataProviderInst<Model, Service, Sorts, Filters, ServiceClassOptType<Service>, Model, Model, Model>>;
|
|
2497
|
+
type TableviewMultiModelOpts<Service, Sorts, Filters, TableModel, AddModel, EditModel> = {
|
|
2498
|
+
service?: ServiceClassType<Service>;
|
|
2499
|
+
sortsType?: TypeDescriptor<Sorts> | ModelDescriptor<Sorts>;
|
|
2500
|
+
filtersType?: TypeDescriptor<Filters> | ModelDescriptor<Filters>;
|
|
2501
|
+
} & TableviewDescriptorInstConstructorOpts<TableModel, AddModel, EditModel>;
|
|
2502
|
+
declare function tableviewMultiModel<Model, Service = undefined, Sorts = keyof Model, Filters extends keyof any = keyof Model, TableModel = Model, AddModel = Model, EditModel = Model, FieldsModel = TableviewDescriptorFieldsManageMultiType<Model, AddModel, EditModel>>(model: ModelDescriptor<Model>, opts?: TableviewMultiModelOpts<Service, Sorts, Filters, TableModel, AddModel, EditModel>, buildFn?: (builder: TableviewInputBuilder<Model, Service, TableviewDescriptorInst<Model, Sorts, Filters, undefined, TableModel, AddModel, EditModel, FieldsModel>, TableviewDataProviderInst<Model, Service, Sorts, Filters, ServiceClassOptType<Service>, TableModel, AddModel, EditModel>, Sorts, Filters, TableModel, AddModel, EditModel, FieldsModel>) => void): _mediusinc_mng_commons_tableview_api.TableviewInput<Model, Service, Sorts, Filters, TableModel, AddModel, EditModel, TableviewDescriptorInst<Model, Sorts, Filters, undefined, TableModel, AddModel, EditModel, FieldsModel>, TableviewDataProviderInst<Model, Service, Sorts, Filters, ServiceClassOptType<Service>, TableModel, AddModel, EditModel>>;
|
|
2503
|
+
|
|
2504
|
+
/**
|
|
2505
|
+
* Creates a data provider for from descriptor. DO NOT use if the model is class, because the type (from model descriptor) will not be set in data provider.
|
|
2506
|
+
*
|
|
2507
|
+
* @param {TableviewDescriptorInst<Model, Sorts, Filters>} descriptor - The table descriptor.
|
|
2508
|
+
*
|
|
2509
|
+
* @return {TableviewDataProviderInst<Model, undefined, Sorts, Filters, undefined, undefined>} - The data provider for the table component.
|
|
2510
|
+
*/
|
|
2511
|
+
declare function tableviewDataProviderFromDescriptor<Model, Sorts = keyof Model, Filters extends keyof any = keyof Model, TableModel = Model, CreateModel = Model, UpdateModel = Model>(descriptor: TableviewDescriptorInst<Model, Sorts, Filters, any, TableModel, CreateModel, UpdateModel, any>): TableviewDataProviderInst<Model, undefined, Sorts, Filters, undefined, TableModel, CreateModel, UpdateModel>;
|
|
2512
|
+
/**
|
|
2513
|
+
* Creates a data provider for from descriptor. DO NOT use if the model is class, because the type (from model descriptor) will not be set in data provider.
|
|
2514
|
+
*
|
|
2515
|
+
* @param {TableviewDescriptorInst<Model, Sorts, Filters>} descriptor - The table descriptor.
|
|
2516
|
+
* @param {ServiceClassType<Service>} serviceClass - The service class type.
|
|
2517
|
+
*
|
|
2518
|
+
* @return {TableviewDataProviderInst<Model, Service, Sorts, Filters, undefined, ServiceClassType<Service>>} - The data provider for the table component.
|
|
2519
|
+
*/
|
|
2520
|
+
declare function tableviewDataProviderFromDescriptor<Model, Service = any, Sorts = keyof Model, Filters extends keyof any = keyof Model, TableModel = Model, CreateModel = Model, UpdateModel = Model>(descriptor: TableviewDescriptorInst<Model, Sorts, Filters, any, TableModel, CreateModel, UpdateModel, any>, serviceClass: ServiceClassType<Service>): TableviewDataProviderInst<Model, Service, Sorts, Filters, ServiceClassType<Service>, TableModel, CreateModel, UpdateModel>;
|
|
2521
|
+
|
|
2522
|
+
type TableviewDescriptorType<TableviewModel, Sorts = keyof TableviewModel, Filters = keyof TableviewModel, ParentEditorModel = undefined> = TableviewDescriptorInst<TableviewModel, Sorts, Filters, ParentEditorModel, TableviewModel, TableviewModel, TableviewModel, TableviewModel>;
|
|
2523
|
+
|
|
2524
|
+
interface TableviewRouteData extends CommonsRouteData {
|
|
2525
|
+
tableview?: {
|
|
2526
|
+
descriptor: TableviewDescriptorInst<any, any, any, any>;
|
|
2527
|
+
dataProvider: ITableviewDataProvider;
|
|
2528
|
+
actions?: Array<ActionDescriptorInst<any>>;
|
|
2529
|
+
};
|
|
2530
|
+
tableviewPermissions?: {
|
|
2531
|
+
[key: string]: APermissions;
|
|
2532
|
+
};
|
|
2533
|
+
tableviewActions?: {
|
|
2534
|
+
hasAdd?: boolean;
|
|
2535
|
+
hasEdit?: boolean;
|
|
2536
|
+
hasDetails?: boolean;
|
|
2537
|
+
hasDelete?: boolean;
|
|
2538
|
+
};
|
|
2539
|
+
}
|
|
2540
|
+
|
|
2541
|
+
export { AFieldDescriptor, AFieldGroupDescriptor, AFormlyCustomFieldComponent, AGenericFieldDescriptor, ActionActivationTriggerEnum, ActionDescriptorInst, ActionEditorDescriptorInst, ActionEditorSubmitDescriptorInst, ActionEditorSubmitTypeEnum, ActionInstanceStateEnum, ActionLinkDescriptorInst, ActionPositionEnum, ActionTypeEnum, CommonsActionError, DATA_LANGUAGE_DROPDOWN_COMPONENT_IT, DataProviderExecutor, DynamicTableviewDataProviderInst, EDITOR_DEFAULT_GROUP_NAME, EditorDataProviderInst, EditorDescriptorInst, EditorDescriptorNestedObjectWrapper, FieldActionDescriptor, FieldGroupDescriptor, FieldGroupTypeEnum, FieldInputDescriptor, FieldInputTypeEnum, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldLookupTypeEnum, FieldManyEditorActionEnum, FieldManyEditorDescriptor, FieldManyEditorTypeEnum, FieldManyToManyEditorActionEnum, FieldManyToManyEditorDescriptor, FieldManyToManyEditorTypeEnum, FieldSizeEnum, FieldTabGroupDescriptor, FieldValidationDescriptor, FormEventTypeEnum, FormFieldEventComponentSubtype, FormFieldEventDialogSubtype, FormFieldEventTypeEnum, TableviewActionDefaultCategories, TableviewDataProviderInst, TableviewDefaultActionsEnum, TableviewDescriptorInst, TableviewDynamicDescriptorInt, TableviewEditorTypeEnum, TableviewInputBuilder, action, actionEditor, actionEditorCancel, actionEditorGetProviderCfgObj, actionEditorOnEditor, actionEditorOnTableRow, actionEditorOnTableTop, actionEditorSubmit, actionGetProviderCfgObj, actionLink, actionLinkFromAction, actionOnEditor, actionOnTableRow, actionOnTableTop, convertDataToStringWithDelimiter, editorDataProvider, editorDescriptor, fieldDescriptorEmptyLabelType, fieldLookupGetProviderCfgObj, fieldManyToManyGetProviderCfgObj, getDataProviderService, runCreateFromDataProvider, runDeleteFromDataProvider, runFetchFromDataProvider, runFnFromDataProviderOrFail, runFnFromDataProviderOrFallback, runGetAllFromDataProvider, runUpdateFromDataProvider, saveFileAs, tableview, tableviewActionAddOnTable, tableviewActionDeleteActionName, tableviewActionDeleteOnDetails, tableviewActionDeleteOnTable, tableviewActionDetailsOnTable, tableviewActionEditOnDetails, tableviewActionEditOnTable, tableviewActionEditorAddActionName, tableviewActionEditorAddRoute, tableviewActionEditorDetailsActionName, tableviewActionEditorDetailsRoute, tableviewActionEditorEditActionName, tableviewActionEditorEditRoute, tableviewActionExportCsvOnTable, tableviewActionExportJsonOnTable, tableviewActionExportOnTable, tableviewActionLocalizationLangSelectOnTable, tableviewActionRefreshOnTable, tableviewCreateDefaultAction, tableviewCreateDefaultActions, tableviewDataProvider, tableviewDataProviderFromDescriptor, tableviewDescriptor, tableviewDescriptorMultiModel, tableviewDynamicDataProvider, tableviewDynamicDescriptor, tableviewGetDefaultActions, tableviewMultiModel };
|
|
2542
|
+
export type { ActionConfirmation, ActionContextValidation, ActionDescriptorConstructorOptsType, ActionDescriptorCreateFromModelOptsType, ActionDescriptorCreateOptsParentType, ActionDescriptorCreateOptsProviderType, ActionDescriptorCreateOptsType, ActionEditorDescriptorConstructorOptsType, ActionEditorDescriptorCreateOptsProviderType, ActionEditorDescriptorOptsType, ActionEditorProviderAddType, ActionEditorProviderEditType, ActionEditorProviderType, ActionEditorRunFnType, ActionExecutionError, ActionLinkDescriptorConstructorOpts, ActionNotificationType, ActionProviderType, ActionRunFnType, ActionValidationFnType, CommonsActionErrorOptions, CommonsFormlyFieldAdditionalProps, CommonsFormlyFieldConfig, CommonsFormlyFieldProps, CommonsFormlyFormOptions, CommonsFormlyFormState, CommonsFormlyHookFn, CommonsFormlyValidation, ConfigurationConfigMapFn, ConfigurationShouldShowFn, EditorDataProviderCreateFnType, EditorDataProviderDeleteFnType, EditorDataProviderFetchFnType, EditorDataProviderFetchMapToFnType, EditorDataProviderUpdateFnType, EditorDescriptorCreateBaseOptsType, EditorDescriptorCreateOptsType, EditorResetEvent, FieldActionContext, FieldActionResult, FieldActionResultMessage, FieldActionRunFnType, FieldAsyncBaseValidator, FieldAsyncValidator, FieldBaseValidator, FieldClassNameType, FieldConfig, FieldDateOptsType, FieldImagePreviewComponent, FieldInputComponentOpts, FieldInputCurrencyOptsType, FieldInputDatePickerDisplayOptsType, FieldInputDatePickerDynamicMinMaxFnType, FieldInputDatePickerOptsType, FieldInputDateValidationOptsType, FieldInputDescriptorType, FieldInputFileOnSelectHandlerFnType, FieldInputFileOpts, FieldInputImageUrlOpts, FieldInputLocaleOptsType, FieldInputMaskOptsType, FieldInputNumberDisplayOptsType, FieldInputNumberFractionOptsType, FieldInputNumberGroupingOptsType, FieldInputNumberOptsType, FieldInputNumberValidationOptsType, FieldInputTextOptsType, FieldInputTextValidationOptsType, FieldInputTextareaOptsType, FieldLookupAutocompleteOptsType, FieldLookupConfig, FieldLookupDescriptorConstructorOptsType, FieldLookupDescriptorCreateOptsProviderType, FieldLookupProviderType, FieldManyToManyEditorDescriptorConstructorOptsType, FieldManyToManyEditorDescriptorCreateOptsProviderType, FieldManyToManyEditorProviderType, FieldValidationDescriptorOptsType, FieldValidationMessage, FieldValidationOptsType, FieldValidationParamsType, FieldValidator, FieldsManageAddFieldLookupOpts, FormAsyncValidator, FormEditorGetFormValueOpts, FormEditorPatchFieldValueOpts, FormEditorResetFieldValueOpts, FormEditorResetFormModelOpts, FormEditorSetFieldValueOpts, FormEditorSubmitEvent, FormEvent, FormEventData, FormFieldEvent, FormFieldEventData, FormValidationMessage, FormValidator, IActionComponent, IActionContext, IActionEditorComponent, IActionEditorContext, IActionInstance, IEditorDataProvider, IEditorDataProviderCreate, IEditorDataProviderDelete, IEditorDataProviderFetch, IEditorDataProviderFetchMapToCreate, IEditorDataProviderFetchMapToUpdate, IEditorDataProviderFnsType, IEditorDataProviderSupport, IEditorDataProviderUpdate, IFieldManageSafeWithGetField, IFieldsManage, IFieldsManageSafe, IFieldsManageWithGetField, IFormEditorComponent, ITableviewDataProvider, IViewContainer, RadioValue, RunFetchFromDataProviderOptsType, RunFetchFromDataProviderReasonType, TableviewDescriptorCreateMultiModelWithModelDescriptorOptsType, TableviewDescriptorCreateOptsType, TableviewDescriptorCreateWithModelDescriptorOptsType, TableviewDescriptorFieldsManageMultiType, TableviewDescriptorFieldsManageSingleType, TableviewDescriptorInstConstructorOpts, TableviewDescriptorMultiModelCreateOptsType, TableviewDescriptorType, TableviewInput, TableviewRouteData, TvBuilderActionSetterFnType, TvBuilderDataProviderSetterFnType, TvBuilderDescriptorSetterFnType, TvBuilderSetterParamsType, ViewContainerEditorCloseEvent };
|