@mediusinc/mng-commons 5.5.0-rc.4 → 6.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/action/action-parameters.model.d.ts +4 -4
- package/core/data-providers/base.data-provider.d.ts +4 -7
- package/core/data-providers/lookup.data-provider.d.ts +2 -2
- package/core/descriptors/model.descriptor.d.ts +1 -7
- package/core/descriptors/tableview.descriptor.d.ts +5 -5
- package/core/helpers/route.d.ts +0 -1
- package/core/helpers/type-helpers.d.ts +8 -0
- package/core/index.d.ts +0 -3
- package/core/models/menu.model.d.ts +0 -4
- package/core/services/commons.service.d.ts +0 -32
- package/core/services/tokens/module-config.token.d.ts +0 -28
- package/esm2022/core/action/action-parameters.model.mjs +1 -1
- package/esm2022/core/data-providers/base.data-provider.mjs +2 -4
- package/esm2022/core/data-providers/lookup.data-provider.mjs +1 -1
- package/esm2022/core/descriptors/model.descriptor.mjs +1 -1
- package/esm2022/core/descriptors/tableview.descriptor.mjs +1 -1
- package/esm2022/core/helpers/type-helpers.mjs +1 -1
- package/esm2022/core/index.mjs +1 -4
- package/esm2022/core/models/menu.model.mjs +1 -1
- package/esm2022/core/services/commons.service.mjs +1 -34
- package/esm2022/core/services/tokens/module-config.token.mjs +1 -1
- package/esm2022/filter/descriptors/filter-lookup.descriptor.mjs +5 -86
- package/esm2022/filter/descriptors/filter.descriptor.mjs +7 -29
- package/esm2022/form/api/data-providers/lookup-data-provider.factory.mjs +14 -41
- package/esm2022/form/api/data-providers/lookup.data-provider.mjs +3 -3
- package/esm2022/model/class/data-providers/base-from-class-data-provider.factory.mjs +5 -0
- package/esm2022/model/class/descriptors/model-class.descriptor.mjs +28 -0
- package/esm2022/model/class/descriptors/type-class.descriptor.mjs +6 -0
- package/esm2022/model/class/helpers/model.mjs +53 -0
- package/esm2022/model/class/index.mjs +8 -0
- package/esm2022/model/class/mediusinc-mng-commons-model-class.mjs +5 -0
- package/esm2022/model/data-providers/base-from-type-data-provider.factory.mjs +11 -6
- package/esm2022/model/descriptors/model.descriptor.mjs +11 -54
- package/esm2022/model/descriptors/type.descriptor.mjs +2 -10
- package/esm2022/model/index.mjs +1 -2
- package/esm2022/table/api/class/class-table-attribute-converter.mjs +80 -0
- package/esm2022/table/api/class/class-table-attribute.model.mjs +2 -0
- package/esm2022/table/api/class/class-table-data-provider.factory.mjs +5 -0
- package/esm2022/table/api/class/class-table-descriptor-helpers.mjs +99 -0
- package/esm2022/table/api/class/class-table-descriptor.factory.mjs +21 -0
- package/esm2022/table/api/class/index.mjs +6 -0
- package/esm2022/table/api/class/mediusinc-mng-commons-table-api-class.mjs +5 -0
- package/esm2022/table/api/data-providers/table-data-provider.factory.mjs +14 -41
- package/esm2022/table/api/data-providers/table.data-provider.mjs +3 -9
- package/esm2022/table/api/descriptors/column.descriptor.mjs +8 -3
- package/esm2022/table/api/descriptors/table-descriptor.factory.mjs +10 -77
- package/esm2022/table/api/descriptors/table.descriptor.mjs +3 -3
- package/esm2022/table/api/helpers/column-converter.mjs +25 -0
- package/esm2022/table/api/helpers/table-data-provider-descriptor-convert.mjs +4 -4
- package/esm2022/table/api/index.mjs +2 -4
- package/esm2022/table/api/models/table-columns.model.mjs +1 -1
- package/esm2022/table/components/column-value/column-value.component.mjs +4 -3
- package/esm2022/table/components/filter/filter-active-tag/filter-active-tag.component.mjs +3 -3
- package/esm2022/table/components/filter/filter-form/filter-form.component.mjs +5 -5
- package/esm2022/table/components/table/table.component.mjs +6 -8
- package/esm2022/tableview/action/components/action/action.component.mjs +1 -1
- package/esm2022/tableview/action/components/editor/injector-context/action-editor-injector-context.component.mjs +10 -6
- package/esm2022/tableview/action/helpers/action-execution.mjs +1 -1
- package/esm2022/tableview/action/models/execution/action-context.model.mjs +1 -1
- package/esm2022/tableview/action/models/execution/action-instance.model.mjs +1 -1
- package/esm2022/tableview/action/services/action-executor.service.mjs +11 -11
- package/esm2022/tableview/action/services/data-provider-executor.service.mjs +18 -3
- package/esm2022/tableview/api/action/descriptors/action-confirmation.descriptor.mjs +1 -1
- package/esm2022/tableview/api/action/descriptors/action-descriptor.factory.mjs +13 -104
- package/esm2022/tableview/api/action/descriptors/action-editor-descriptor.factory.mjs +15 -62
- package/esm2022/tableview/api/action/descriptors/action-editor.descriptor.mjs +3 -63
- package/esm2022/tableview/api/action/descriptors/action-link-descriptor.factory.mjs +17 -30
- package/esm2022/tableview/api/action/descriptors/action-link.descriptor.mjs +1 -1
- package/esm2022/tableview/api/action/descriptors/action.descriptor.mjs +6 -29
- package/esm2022/tableview/api/action/descriptors/editor-action-descriptor.factory.mjs +21 -0
- package/esm2022/tableview/api/action/descriptors/editor-action-editor-descriptor.factory.mjs +21 -0
- package/esm2022/tableview/api/action/descriptors/table-action-descriptor.factory.mjs +37 -0
- package/esm2022/tableview/api/action/descriptors/table-action-editor-descriptor.factory.mjs +40 -0
- package/esm2022/tableview/api/action/helpers/data-provider-executors.mjs +25 -5
- package/esm2022/tableview/api/action/models/action-descriptor.types.mjs +1 -1
- package/esm2022/tableview/api/action/models/action-error.model.mjs +1 -1
- package/esm2022/tableview/api/action/models/execution/action-context-validation.model.mjs +1 -1
- package/esm2022/tableview/api/action/models/execution/action-context.model.mjs +1 -1
- package/esm2022/tableview/api/action/models/execution/action-instance.model.mjs +1 -1
- package/esm2022/tableview/api/action/models/tableview-action-default-categories.model.mjs +6 -6
- package/esm2022/tableview/api/action/services/data-provider-executor.service.mjs +3 -3
- package/esm2022/tableview/api/class/editor/class-editor-attribute-converter.mjs +85 -0
- package/esm2022/tableview/api/class/editor/class-editor-attribute.model.mjs +2 -0
- package/esm2022/tableview/api/class/editor/class-editor-data-provider.factory.mjs +5 -0
- package/esm2022/tableview/api/class/editor/class-editor-descriptor-helpers.mjs +95 -0
- package/esm2022/tableview/api/class/editor/class-editor-descriptor.factory.mjs +21 -0
- package/esm2022/tableview/api/class/index.mjs +13 -0
- package/esm2022/tableview/api/class/mediusinc-mng-commons-tableview-api-class.mjs +5 -0
- package/esm2022/tableview/api/class/tableview/class-tableview-attribute-converter.mjs +35 -0
- package/esm2022/tableview/api/class/tableview/class-tableview-attribute.model.mjs +2 -0
- package/esm2022/tableview/api/class/tableview/class-tableview-data-provider.factory.mjs +5 -0
- package/esm2022/tableview/api/class/tableview/class-tableview-descriptor-helpers.mjs +111 -0
- package/esm2022/tableview/api/class/tableview/class-tableview-descriptor.factory.mjs +26 -0
- package/esm2022/tableview/api/editor/data-providers/editor-data-provider.factory.mjs +14 -32
- package/esm2022/tableview/api/editor/data-providers/editor.data-provider.mjs +40 -7
- package/esm2022/tableview/api/editor/descriptors/editor-descriptor.factory.mjs +7 -73
- package/esm2022/tableview/api/editor/descriptors/editor.descriptor.mjs +49 -134
- package/esm2022/tableview/api/editor/descriptors/field-base.descriptor.mjs +11 -2
- package/esm2022/tableview/api/editor/descriptors/field-lookup.descriptor.mjs +3 -5
- package/esm2022/tableview/api/editor/descriptors/field-many.descriptor.mjs +2 -18
- package/esm2022/tableview/api/editor/descriptors/wrappers/editor-descriptor-nested-object-wrapper.mjs +51 -0
- package/esm2022/tableview/api/editor/models/editor-fields.model.mjs +1 -1
- package/esm2022/tableview/api/editor/models/form-editor.event.mjs +1 -1
- package/esm2022/tableview/api/index.mjs +8 -8
- package/esm2022/tableview/api/tableview/data-providers/tableview-data-provider.factory.mjs +13 -51
- package/esm2022/tableview/api/tableview/data-providers/tableview.data-provider.mjs +19 -11
- package/esm2022/tableview/api/tableview/descriptors/tableview-descriptor.factory.mjs +19 -96
- package/esm2022/tableview/api/tableview/descriptors/tableview.descriptor.mjs +29 -182
- package/esm2022/tableview/api/tableview/helpers/tableview-create.mjs +8 -6
- package/esm2022/tableview/api/tableview/helpers/tableview-data-provider-descriptor-convert.mjs +4 -4
- package/esm2022/tableview/api/tableview/helpers/tableview-default-actions.mjs +117 -99
- package/esm2022/tableview/api/tableview/helpers/tableview-input-builder.mjs +164 -7
- package/esm2022/tableview/api/tableview/models/tableview-descriptor-fields-manage-helper.type.mjs +2 -0
- package/esm2022/tableview/api/tableview/models/tableview-descriptor-helper.type.mjs +2 -0
- package/esm2022/tableview/api/tableview/models/tableview-input.model.mjs +1 -1
- package/esm2022/tableview/api/tableview/models/tableview-route.model.mjs +1 -1
- package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +6 -6
- package/esm2022/tableview/editor/helpers/editor-field.mjs +3 -3
- package/esm2022/tableview/editor/helpers/editor-formly.mjs +4 -4
- package/esm2022/tableview/editor/helpers/field-create.mjs +21 -0
- package/esm2022/tableview/index.mjs +3 -2
- package/esm2022/tableview/tableview/components/route/tableview-route.component.mjs +1 -1
- package/esm2022/tableview/tableview/components/tableview/tableview.component.mjs +3 -1
- package/fesm2022/mediusinc-mng-commons-core.mjs +687 -781
- package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-filter.mjs +10 -113
- package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form-api.mjs +15 -42
- package/fesm2022/mediusinc-mng-commons-form-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-model-class.mjs +97 -0
- package/fesm2022/mediusinc-mng-commons-model-class.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons-model.mjs +23 -137
- package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table-api-class.mjs +204 -0
- package/fesm2022/mediusinc-mng-commons-table-api-class.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons-table-api.mjs +55 -319
- package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table.mjs +14 -15
- package/fesm2022/mediusinc-mng-commons-table.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api-class.mjs +367 -0
- package/fesm2022/mediusinc-mng-commons-tableview-api-class.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +715 -1298
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview.mjs +67 -27
- package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
- package/filter/descriptors/filter-lookup.descriptor.d.ts +1 -26
- package/filter/descriptors/filter.descriptor.d.ts +5 -12
- package/form/api/data-providers/lookup-data-provider.factory.d.ts +17 -20
- package/form/api/data-providers/lookup.data-provider.d.ts +3 -3
- package/model/class/README.md +8 -0
- package/model/class/data-providers/base-from-class-data-provider.factory.d.ts +3 -0
- package/model/class/descriptors/model-class.descriptor.d.ts +12 -0
- package/model/class/descriptors/type-class.descriptor.d.ts +3 -0
- package/model/{helpers → class/helpers}/model.d.ts +1 -2
- package/model/class/index.d.ts +4 -0
- package/model/data-providers/base-from-type-data-provider.factory.d.ts +13 -6
- package/model/descriptors/model.descriptor.d.ts +12 -27
- package/model/descriptors/type.descriptor.d.ts +0 -5
- package/model/index.d.ts +0 -1
- package/package.json +25 -7
- package/table/api/class/README.md +10 -0
- package/table/api/{helpers/class-attribute-converter.d.ts → class/class-table-attribute-converter.d.ts} +2 -9
- package/table/api/{models → class}/class-table-attribute.model.d.ts +1 -1
- package/table/api/class/class-table-data-provider.factory.d.ts +4 -0
- package/table/api/{helpers/table-descriptor-helpers.d.ts → class/class-table-descriptor-helpers.d.ts} +2 -4
- package/table/api/class/class-table-descriptor.factory.d.ts +11 -0
- package/table/api/class/index.d.ts +5 -0
- package/table/api/data-providers/table-data-provider.factory.d.ts +17 -20
- package/table/api/data-providers/table.data-provider.d.ts +4 -12
- package/table/api/descriptors/column.descriptor.d.ts +5 -2
- package/table/api/descriptors/table-descriptor.factory.d.ts +3 -39
- package/table/api/descriptors/table.descriptor.d.ts +3 -3
- package/table/api/helpers/column-converter.d.ts +7 -0
- package/table/api/helpers/table-data-provider-descriptor-convert.d.ts +3 -3
- package/table/api/index.d.ts +1 -3
- package/table/api/models/table-columns.model.d.ts +2 -2
- package/table/components/column-value/column-value.component.d.ts +1 -0
- package/table/components/filter/filter-active-tag/filter-active-tag.component.d.ts +1 -1
- package/table/components/filter/filter-form/filter-form.component.d.ts +1 -1
- package/table/components/filter/filter-overlay-with-tag/filter-overlay-with-tag.component.d.ts +1 -1
- package/table/components/table/table.component.d.ts +0 -9
- package/tableview/action/components/action/action.component.d.ts +2 -2
- package/tableview/action/components/editor/action-editor.component.d.ts +1 -1
- package/tableview/action/components/editor/injector-context/action-editor-injector-context.component.d.ts +6 -5
- package/tableview/action/components/localization/data-language-dropdown.component.d.ts +3 -3
- package/tableview/action/components/table/action-table.component.d.ts +3 -3
- package/tableview/action/helpers/action-execution.d.ts +1 -1
- package/tableview/action/models/execution/action-context.model.d.ts +3 -3
- package/tableview/action/models/execution/action-instance.model.d.ts +5 -5
- package/tableview/action/services/action-executor.service.d.ts +7 -7
- package/tableview/action/services/data-provider-executor.service.d.ts +16 -16
- package/tableview/action/services/view-container.service.d.ts +1 -1
- package/tableview/api/action/descriptors/action-confirmation.descriptor.d.ts +1 -1
- package/tableview/api/action/descriptors/action-descriptor.factory.d.ts +20 -31
- package/tableview/api/action/descriptors/action-editor-descriptor.factory.d.ts +18 -25
- package/tableview/api/action/descriptors/action-editor.descriptor.d.ts +22 -40
- package/tableview/api/action/descriptors/action-link-descriptor.factory.d.ts +21 -13
- package/tableview/api/action/descriptors/action-link.descriptor.d.ts +3 -3
- package/tableview/api/action/descriptors/action.descriptor.d.ts +31 -33
- package/tableview/api/action/descriptors/editor-action-descriptor.factory.d.ts +21 -0
- package/tableview/api/action/descriptors/editor-action-editor-descriptor.factory.d.ts +21 -0
- package/tableview/api/action/descriptors/table-action-descriptor.factory.d.ts +36 -0
- package/tableview/api/action/descriptors/table-action-editor-descriptor.factory.d.ts +40 -0
- package/tableview/api/action/helpers/data-provider-executors.d.ts +13 -8
- package/tableview/api/action/models/action-descriptor.types.d.ts +2 -2
- package/tableview/api/action/models/action-error.model.d.ts +1 -1
- package/tableview/api/action/models/execution/action-context-validation.model.d.ts +2 -2
- package/tableview/api/action/models/execution/action-context.model.d.ts +2 -2
- package/tableview/api/action/models/execution/action-instance.model.d.ts +1 -1
- package/tableview/api/action/models/tableview-action-default-categories.model.d.ts +5 -5
- package/tableview/api/action/services/data-provider-executor.service.d.ts +26 -25
- package/tableview/api/class/README.md +13 -0
- package/tableview/api/{editor/helpers/class-attribute-converter.d.ts → class/editor/class-editor-attribute-converter.d.ts} +2 -2
- package/tableview/api/{editor/models/class-tableview-attribute.model.d.ts → class/editor/class-editor-attribute.model.d.ts} +1 -1
- package/tableview/api/class/editor/class-editor-data-provider.factory.d.ts +4 -0
- package/tableview/api/{editor/helpers/editor-descriptor-helpers.d.ts → class/editor/class-editor-descriptor-helpers.d.ts} +2 -5
- package/tableview/api/class/editor/class-editor-descriptor.factory.d.ts +11 -0
- package/tableview/api/class/index.d.ts +10 -0
- package/tableview/api/{tableview/helpers/class-attribute-converter.d.ts → class/tableview/class-tableview-attribute-converter.d.ts} +1 -1
- package/tableview/api/{tableview/models → class/tableview}/class-tableview-attribute.model.d.ts +2 -2
- package/tableview/api/class/tableview/class-tableview-data-provider.factory.d.ts +4 -0
- package/tableview/api/{tableview/helpers/tableview-descriptor-helpers.d.ts → class/tableview/class-tableview-descriptor-helpers.d.ts} +1 -2
- package/tableview/api/class/tableview/class-tableview-descriptor.factory.d.ts +12 -0
- package/tableview/api/editor/data-providers/editor-data-provider.factory.d.ts +17 -16
- package/tableview/api/editor/data-providers/editor.data-provider.d.ts +64 -29
- package/tableview/api/editor/descriptors/editor-descriptor.factory.d.ts +5 -38
- package/tableview/api/editor/descriptors/editor.descriptor.d.ts +48 -112
- package/tableview/api/editor/descriptors/field-base.descriptor.d.ts +8 -1
- package/tableview/api/editor/descriptors/field-lookup.descriptor.d.ts +2 -3
- package/tableview/api/editor/descriptors/field-many.descriptor.d.ts +3 -11
- package/tableview/api/editor/descriptors/wrappers/editor-descriptor-nested-object-wrapper.d.ts +25 -0
- package/tableview/api/editor/models/editor-fields.model.d.ts +25 -21
- package/tableview/api/editor/models/form-editor.event.d.ts +0 -4
- package/tableview/api/index.d.ts +7 -6
- package/tableview/api/tableview/data-providers/tableview-data-provider.factory.d.ts +20 -25
- package/tableview/api/tableview/data-providers/tableview.data-provider.d.ts +22 -22
- package/tableview/api/tableview/descriptors/tableview-descriptor.factory.d.ts +20 -50
- package/tableview/api/tableview/descriptors/tableview.descriptor.d.ts +69 -163
- package/tableview/api/tableview/helpers/tableview-create.d.ts +18 -5
- package/tableview/api/tableview/helpers/tableview-data-provider-descriptor-convert.d.ts +2 -2
- package/tableview/api/tableview/helpers/tableview-default-actions.d.ts +73 -20
- package/tableview/api/tableview/helpers/tableview-input-builder.d.ts +87 -9
- package/tableview/api/tableview/models/tableview-descriptor-fields-manage-helper.type.d.ts +9 -0
- package/tableview/api/tableview/models/tableview-descriptor-helper.type.d.ts +2 -0
- package/tableview/api/tableview/models/tableview-input.model.d.ts +1 -1
- package/tableview/api/tableview/models/tableview-route.model.d.ts +1 -1
- package/tableview/editor/helpers/field-create.d.ts +9 -0
- package/tableview/index.d.ts +2 -1
- package/tableview/tableview/components/route/tableview-route.component.d.ts +1 -1
- package/tableview/tableview/components/tableview/tableview.component.d.ts +6 -6
- package/version-info.json +5 -5
- package/core/components/pages/error/error.page.component.d.ts +0 -11
- package/core/components/pages/not-found/not-found.page.component.d.ts +0 -11
- package/core/data-providers/base-data-provider.factory.d.ts +0 -13
- package/esm2022/core/components/pages/error/error.page.component.mjs +0 -24
- package/esm2022/core/components/pages/not-found/not-found.page.component.mjs +0 -24
- package/esm2022/core/data-providers/base-data-provider.factory.mjs +0 -28
- package/esm2022/model/helpers/model.mjs +0 -71
- package/esm2022/table/api/helpers/class-attribute-converter.mjs +0 -104
- package/esm2022/table/api/helpers/table-descriptor-helpers.mjs +0 -98
- package/esm2022/table/api/models/class-table-attribute.model.mjs +0 -2
- package/esm2022/tableview/api/editor/helpers/class-attribute-converter.mjs +0 -85
- package/esm2022/tableview/api/editor/helpers/editor-descriptor-helpers.mjs +0 -95
- package/esm2022/tableview/api/editor/models/class-tableview-attribute.model.mjs +0 -2
- package/esm2022/tableview/api/tableview/helpers/class-attribute-converter.mjs +0 -34
- package/esm2022/tableview/api/tableview/helpers/tableview-descriptor-helpers.mjs +0 -110
- package/esm2022/tableview/api/tableview/models/class-tableview-attribute.model.mjs +0 -2
|
@@ -1,31 +1,24 @@
|
|
|
1
1
|
import { ServiceClassType } from '@mediusinc/mng-commons/core';
|
|
2
|
+
import { ModelDescriptor, TypeDescriptor } from '@mediusinc/mng-commons/model';
|
|
2
3
|
import { IEditorDataProvider } from '../../editor/data-providers/editor.data-provider';
|
|
3
4
|
import { EditorDescriptorInst } from '../../editor/descriptors/editor.descriptor';
|
|
4
|
-
import {
|
|
5
|
+
import { ActionEditorDescriptorCreateOptsProviderType, ActionEditorDescriptorInst } from './action-editor.descriptor';
|
|
5
6
|
import { ActionDescriptorCreateOptsParentType } from './action.descriptor';
|
|
6
7
|
export type ActionEditorProviderType<Model, Service> = ServiceClassType<Service> | IEditorDataProvider<Model, Service>;
|
|
8
|
+
export type ActionEditorDescriptorOptsType<Model, Service, FetchInput, SubmitReturn, ValidationInput> = ActionDescriptorCreateOptsParentType & {
|
|
9
|
+
model?: ModelDescriptor<Model>;
|
|
10
|
+
serviceProvider?: ActionEditorProviderType<Model, Service>;
|
|
11
|
+
fetchInputType?: TypeDescriptor<FetchInput>;
|
|
12
|
+
submitReturnType?: TypeDescriptor<SubmitReturn>;
|
|
13
|
+
validationType?: TypeDescriptor<ValidationInput>;
|
|
14
|
+
};
|
|
7
15
|
export declare const actionEditorGetProviderCfgObj: <Model, Service>(serviceOrDataProvider?: ActionEditorProviderType<Model, Service>) => ActionEditorDescriptorCreateOptsProviderType<Model, Service>;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
export declare function actionEditorDetails<Model>(editor: EditorDescriptorInst<Model, any>): ActionEditorDetailsDescriptorInst<Model, undefined>;
|
|
19
|
-
export declare function actionEditorDetails<Model, Service>(editor: EditorDescriptorInst<Model, any>, serviceProvider: ActionEditorProviderType<Model, Service>): ActionEditorDetailsDescriptorInst<Model, Service>;
|
|
20
|
-
export declare class ActionEditorAddDescriptor {
|
|
21
|
-
static create<Model>(editor: EditorDescriptorInst<Model, any>): ActionEditorAddDescriptorInst<Model, undefined>;
|
|
22
|
-
static createWithProvider<Model, Service>(editor: EditorDescriptorInst<Model, any>, serviceProvider: ActionEditorProviderType<Model, Service>): ActionEditorAddDescriptorInst<Model, Service>;
|
|
23
|
-
}
|
|
24
|
-
export declare function actionEditorAdd<Model>(editor: EditorDescriptorInst<Model, any>): ActionEditorDetailsDescriptorInst<Model, undefined>;
|
|
25
|
-
export declare function actionEditorAdd<Model, Service>(editor: EditorDescriptorInst<Model, any>, serviceProvider: ActionEditorProviderType<Model, Service>): ActionEditorAddDescriptorInst<Model, Service>;
|
|
26
|
-
export declare class ActionEditorEditDescriptor {
|
|
27
|
-
static create<Model>(editor: EditorDescriptorInst<Model, any>): ActionEditorEditDescriptorInst<Model, undefined>;
|
|
28
|
-
static createWithProvider<Model, Service>(editor: EditorDescriptorInst<Model, any>, serviceProvider: ActionEditorProviderType<Model, Service>): ActionEditorEditDescriptorInst<Model, Service>;
|
|
29
|
-
}
|
|
30
|
-
export declare function actionEditorEdit<Model>(editor: EditorDescriptorInst<Model, any>): ActionEditorDetailsDescriptorInst<Model, undefined>;
|
|
31
|
-
export declare function actionEditorEdit<Model, Service>(editor: EditorDescriptorInst<Model, any>, serviceProvider: ActionEditorProviderType<Model, Service>): ActionEditorEditDescriptorInst<Model, Service>;
|
|
16
|
+
/**
|
|
17
|
+
* Creates an ActionEditorDescriptorInst instance with the provided editor descriptor and options.
|
|
18
|
+
*
|
|
19
|
+
* @param {string} actionName - The name of the action to associate with the editor.
|
|
20
|
+
* @param {EditorDescriptorInst<EditorModel, any>} editor - The editor descriptor instance to be used.
|
|
21
|
+
* @param {ActionEditorDescriptorOptsType<Model, Service, FetchInput, SubmitReturn, ValidationInput>} [opts] - Optional configuration options for the ActionEditor.
|
|
22
|
+
* @return {ActionEditorDescriptorInst<Model, Service, EditorModel, FetchInput, SubmitReturn, ValidationInput>} An instance of ActionEditorDescriptor with the configured parameters.
|
|
23
|
+
*/
|
|
24
|
+
export declare function actionEditor<EditorModel, Model = EditorModel, Service = undefined, FetchInput = Model, SubmitReturn = Model, ValidationInput = Model>(actionName: string, editor: EditorDescriptorInst<EditorModel, any>, opts?: ActionEditorDescriptorOptsType<Model, Service, FetchInput, SubmitReturn, ValidationInput>): ActionEditorDescriptorInst<Model, Service, EditorModel, FetchInput, SubmitReturn, ValidationInput>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Type } from '@angular/core';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
2
|
import { ServiceClassType, StyleSizeEnum } from '@mediusinc/mng-commons/core';
|
|
4
3
|
import { ModelDescriptor } from '@mediusinc/mng-commons/model';
|
|
5
4
|
import { IEditorDataProvider } from '../../editor/data-providers/editor.data-provider';
|
|
6
5
|
import { EditorDescriptorInst } from '../../editor/descriptors/editor.descriptor';
|
|
6
|
+
import { ActionRunFnType } from '../models/action-descriptor.types';
|
|
7
7
|
import { ActionEditorSubmitTypeEnum } from '../models/action.type';
|
|
8
|
-
import { IActionContext } from '../models/execution/action-context.model';
|
|
9
8
|
import { ActionDescriptorCreateOptsParentType, ActionDescriptorInst } from './action.descriptor';
|
|
10
9
|
export type ActionEditorDescriptorConstructorOptsType<Model, Service> = ActionDescriptorCreateOptsParentType & ActionEditorDescriptorCreateOptsProviderType<Model, Service> & {
|
|
11
10
|
model?: ModelDescriptor<Model>;
|
|
@@ -15,11 +14,10 @@ export type ActionEditorDescriptorCreateOptsProviderType<Model, Service> = {
|
|
|
15
14
|
serviceType?: ServiceClassType<Service>;
|
|
16
15
|
dataProvider?: IEditorDataProvider<Model, Service>;
|
|
17
16
|
};
|
|
18
|
-
export declare class ActionEditorDescriptorInst<Item, Service = any, FetchInputItem = Item, SubmitReturnItem = Item> extends ActionDescriptorInst<Item, Service> {
|
|
17
|
+
export declare class ActionEditorDescriptorInst<Item, Service = any, EditorItem = Item, FetchInputItem = Item, SubmitReturnItem = Item, ValidationInputItem = Item> extends ActionDescriptorInst<Item, Service, EditorItem, SubmitReturnItem, ValidationInputItem> {
|
|
19
18
|
private readonly _editorDescriptor;
|
|
20
19
|
protected readonly _dataProvider?: IEditorDataProvider<Item, any>;
|
|
21
|
-
protected
|
|
22
|
-
protected _editorActions: ActionDescriptorInst<Item>[];
|
|
20
|
+
protected _editorActions: ActionDescriptorInst<any, any, EditorItem, any, EditorItem>[];
|
|
23
21
|
protected _editorTitle?: string | null;
|
|
24
22
|
protected _editorTitleParams?: any;
|
|
25
23
|
protected _hasFetchNotificationSuccess: boolean;
|
|
@@ -27,17 +25,16 @@ export declare class ActionEditorDescriptorInst<Item, Service = any, FetchInputI
|
|
|
27
25
|
protected _fetchNotificationSuccessMessage?: string;
|
|
28
26
|
protected _dialogSize: StyleSizeEnum;
|
|
29
27
|
protected _dialogClassName?: string;
|
|
30
|
-
protected _fetchFunction?:
|
|
31
|
-
protected _submitFunction?:
|
|
28
|
+
protected _fetchFunction?: ActionRunFnType<Item, Service, FetchInputItem, EditorItem>;
|
|
29
|
+
protected _submitFunction?: ActionRunFnType<Item, Service, EditorItem, SubmitReturnItem>;
|
|
32
30
|
protected _editorComponent?: Type<any>;
|
|
33
31
|
protected _resubmitEnabled?: boolean;
|
|
34
32
|
protected _resubmitRefetch: boolean;
|
|
35
33
|
protected _unsavedChangesConfirmation: boolean;
|
|
36
|
-
constructor(editorDescriptor: EditorDescriptorInst<
|
|
37
|
-
get isTableviewMainEditor(): boolean;
|
|
34
|
+
constructor(editorDescriptor: EditorDescriptorInst<EditorItem, any>, actionName: string, cfg?: ActionEditorDescriptorConstructorOptsType<Item, Service>);
|
|
38
35
|
get editorTitle(): string | null | undefined;
|
|
39
36
|
get editorTitleParams(): any;
|
|
40
|
-
get editorDescriptor(): EditorDescriptorInst<
|
|
37
|
+
get editorDescriptor(): EditorDescriptorInst<EditorItem, any>;
|
|
41
38
|
get dialogSize(): StyleSizeEnum;
|
|
42
39
|
get dialogClassName(): string | undefined;
|
|
43
40
|
get hasFetchNotificationSuccess(): boolean;
|
|
@@ -45,12 +42,12 @@ export declare class ActionEditorDescriptorInst<Item, Service = any, FetchInputI
|
|
|
45
42
|
get fetchNotificationSuccessMessage(): string | undefined;
|
|
46
43
|
get dataProvider(): IEditorDataProvider<Item, any> | undefined;
|
|
47
44
|
get hasRunFunction(): boolean;
|
|
48
|
-
get runFunction():
|
|
45
|
+
get runFunction(): ActionRunFnType<Item, Service, EditorItem, SubmitReturnItem>;
|
|
49
46
|
get hasFetchFunction(): boolean;
|
|
50
|
-
get fetchFunction():
|
|
47
|
+
get fetchFunction(): ActionRunFnType<Item, Service, FetchInputItem, EditorItem> | undefined;
|
|
51
48
|
get hasSubmitFunction(): boolean;
|
|
52
|
-
get submitFunction():
|
|
53
|
-
get editorActions(): ActionDescriptorInst<
|
|
49
|
+
get submitFunction(): ActionRunFnType<Item, Service, EditorItem, SubmitReturnItem> | undefined;
|
|
50
|
+
get editorActions(): ActionDescriptorInst<any, any, EditorItem, any, EditorItem>[];
|
|
54
51
|
get editorComponent(): Type<any> | undefined;
|
|
55
52
|
get resubmitEnabled(): boolean | undefined;
|
|
56
53
|
get resubmitRefetch(): boolean;
|
|
@@ -58,12 +55,12 @@ export declare class ActionEditorDescriptorInst<Item, Service = any, FetchInputI
|
|
|
58
55
|
withEditorTitle(title: string | null, params?: any): this;
|
|
59
56
|
withDialogSize(size?: StyleSizeEnum): this;
|
|
60
57
|
withDialogClassName(className: string): this;
|
|
61
|
-
withRunFunction(fn:
|
|
62
|
-
withFetchFunction(fn:
|
|
63
|
-
withSubmitFunction(fn:
|
|
58
|
+
withRunFunction(fn: ActionRunFnType<Item, Service, EditorItem, SubmitReturnItem>): this;
|
|
59
|
+
withFetchFunction(fn: ActionRunFnType<Item, Service, FetchInputItem, EditorItem>): this;
|
|
60
|
+
withSubmitFunction(fn: ActionRunFnType<Item, Service, EditorItem, SubmitReturnItem>): this;
|
|
64
61
|
withFetchNotificationError(title?: string, message?: string, hasNotification?: boolean): this;
|
|
65
|
-
withEditorAction(action: ActionDescriptorInst<
|
|
66
|
-
withEditorActions(actions: ActionDescriptorInst<
|
|
62
|
+
withEditorAction(action: ActionDescriptorInst<any, any, EditorItem, any, EditorItem>): this;
|
|
63
|
+
withEditorActions(actions: ActionDescriptorInst<any, any, EditorItem, any, EditorItem>[]): this;
|
|
67
64
|
withEditorComponent(editorComponent: Type<any>): this;
|
|
68
65
|
/**
|
|
69
66
|
* Enables or disables resubmit resubmit - this means the form will not exit after successful submission, but will instead remain open.
|
|
@@ -75,39 +72,24 @@ export declare class ActionEditorDescriptorInst<Item, Service = any, FetchInputI
|
|
|
75
72
|
*/
|
|
76
73
|
withResubmit(enabled?: boolean, refetch?: boolean): this;
|
|
77
74
|
withUnsavedChangesConfirmation(unsavedChangesConfirmation?: boolean): this;
|
|
78
|
-
copyFieldsTo(descriptor: ActionEditorDescriptorInst<Item, Service, FetchInputItem, SubmitReturnItem>): ActionEditorDescriptorInst<Item, Service, FetchInputItem, SubmitReturnItem>;
|
|
79
|
-
copy(): ActionEditorDescriptorInst<Item, Service, FetchInputItem, SubmitReturnItem>;
|
|
75
|
+
copyFieldsTo(descriptor: ActionEditorDescriptorInst<Item, Service, EditorItem, FetchInputItem, SubmitReturnItem, ValidationInputItem>): ActionEditorDescriptorInst<Item, Service, EditorItem, FetchInputItem, SubmitReturnItem, ValidationInputItem>;
|
|
76
|
+
copy(): ActionEditorDescriptorInst<Item, Service, EditorItem, FetchInputItem, SubmitReturnItem, ValidationInputItem>;
|
|
80
77
|
}
|
|
81
|
-
export declare class ActionEditorSubmitDescriptorInst<Model> extends ActionDescriptorInst<Model> {
|
|
78
|
+
export declare class ActionEditorSubmitDescriptorInst<Model, EditorModel> extends ActionDescriptorInst<Model, undefined, EditorModel, EditorModel, EditorModel> {
|
|
82
79
|
private readonly _submitType;
|
|
83
80
|
constructor(editorActionName: string, editorActionModel: ModelDescriptor<Model> | undefined, submitType?: ActionEditorSubmitTypeEnum);
|
|
84
81
|
get submitType(): ActionEditorSubmitTypeEnum;
|
|
85
|
-
copy(): ActionEditorSubmitDescriptorInst<Model>;
|
|
82
|
+
copy(): ActionEditorSubmitDescriptorInst<Model, EditorModel>;
|
|
86
83
|
}
|
|
87
84
|
/**
|
|
88
85
|
* creates primary action with primary button style
|
|
89
86
|
* @param editorAction
|
|
90
87
|
* @param submitType
|
|
91
88
|
*/
|
|
92
|
-
export declare function actionEditorSubmit<Model>(editorAction: ActionEditorDescriptorInst<Model>, submitType?: ActionEditorSubmitTypeEnum): ActionEditorSubmitDescriptorInst<Model>;
|
|
89
|
+
export declare function actionEditorSubmit<Model, EditorModel>(editorAction: ActionEditorDescriptorInst<Model, any, EditorModel, any, any, any>, submitType?: ActionEditorSubmitTypeEnum): ActionEditorSubmitDescriptorInst<Model, EditorModel>;
|
|
93
90
|
/**
|
|
94
91
|
* creates secondary button with text button style
|
|
95
92
|
* @param editorAction
|
|
96
93
|
* @param submitType
|
|
97
94
|
*/
|
|
98
|
-
export declare function actionEditorCancel<Model>(editorAction: ActionEditorDescriptorInst<Model>, submitType?: ActionEditorSubmitTypeEnum): ActionEditorSubmitDescriptorInst<Model>;
|
|
99
|
-
export declare class ActionEditorDetailsDescriptorInst<Model, Service = any> extends ActionEditorDescriptorInst<Model, Service> {
|
|
100
|
-
static readonly ACTION_NAME = "details";
|
|
101
|
-
constructor(editorDescriptor: EditorDescriptorInst<Model, any>, cfg?: ActionEditorDescriptorCreateOptsProviderType<Model, Service>);
|
|
102
|
-
copy(): ActionEditorDetailsDescriptorInst<Model, Service>;
|
|
103
|
-
}
|
|
104
|
-
export declare class ActionEditorAddDescriptorInst<Model, Service = any> extends ActionEditorDescriptorInst<Model, Service> {
|
|
105
|
-
static readonly ACTION_NAME = "add";
|
|
106
|
-
constructor(editorDescriptor: EditorDescriptorInst<Model, any>, cfg?: ActionEditorDescriptorCreateOptsProviderType<Model, Service>);
|
|
107
|
-
copy(): ActionEditorAddDescriptorInst<Model, Service>;
|
|
108
|
-
}
|
|
109
|
-
export declare class ActionEditorEditDescriptorInst<Model, Service = any> extends ActionEditorDescriptorInst<Model, Service> {
|
|
110
|
-
static readonly ACTION_NAME = "edit";
|
|
111
|
-
constructor(editorDescriptor: EditorDescriptorInst<Model, any>, cfg?: ActionEditorDescriptorCreateOptsProviderType<Model, Service>);
|
|
112
|
-
copy(): ActionEditorEditDescriptorInst<Model, Service>;
|
|
113
|
-
}
|
|
95
|
+
export declare function actionEditorCancel<Model, EditorModel>(editorAction: ActionEditorDescriptorInst<Model, any, EditorModel, any, any, any>, submitType?: ActionEditorSubmitTypeEnum): ActionEditorSubmitDescriptorInst<Model, EditorModel>;
|
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ModelDescriptor } from '@mediusinc/mng-commons/model';
|
|
3
|
-
import { ActionDescriptorCreateFromClassOpts } from './action-descriptor.factory';
|
|
1
|
+
import { ModelDescriptor, TypeDescriptor } from '@mediusinc/mng-commons/model';
|
|
4
2
|
import { ActionLinkDescriptorInst } from './action-link.descriptor';
|
|
5
3
|
import { ActionDescriptorCreateOptsParentType, ActionDescriptorInst } from './action.descriptor';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
type ActionLinkCreateOptsType<Model, ValidationInput> = ActionDescriptorCreateOptsParentType & {
|
|
5
|
+
model?: ModelDescriptor<Model>;
|
|
6
|
+
validationType?: TypeDescriptor<ValidationInput>;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Creates an instance of ActionLinkDescriptorInst with the provided action name and options.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} actionName - The unique name of the action.
|
|
12
|
+
* @param {ActionLinkCreateOptsType<Model, ValidationInput>} [opts] - Optional parameters for configuring the action link, including the model and validation type.
|
|
13
|
+
* @return {ActionLinkDescriptorInst<Model, ValidationInput>} An instance of ActionLinkDescriptorInst initialized with the action name and options.
|
|
14
|
+
*/
|
|
15
|
+
export declare function actionLink<Model = any, ValidationInput = Model>(actionName: string, opts?: ActionLinkCreateOptsType<Model, ValidationInput>): ActionLinkDescriptorInst<Model, ValidationInput>;
|
|
16
|
+
/**
|
|
17
|
+
* Generates an ActionLinkDescriptorInst from the provided ActionDescriptorInst.
|
|
18
|
+
*
|
|
19
|
+
* @param {ActionDescriptorInst<Model, any, any, any, ValidationInput>} action - The action descriptor instance that serves as the basis for the action link.
|
|
20
|
+
* @return {ActionLinkDescriptorInst<Model, ValidationInput>} A newly created ActionLinkDescriptorInst configured with the provided action parameters.
|
|
21
|
+
*/
|
|
22
|
+
export declare function actionLinkFromAction<Model, ValidationInput = Model>(action: ActionDescriptorInst<Model, any, any, any, ValidationInput>): ActionLinkDescriptorInst<Model, ValidationInput>;
|
|
23
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Params, QueryParamsHandling } from '@angular/router';
|
|
2
2
|
import { ActionDescriptorConstructorOptsType, ActionDescriptorInst } from './action.descriptor';
|
|
3
3
|
export type ActionLinkDescriptorConstructorOpts<Model> = Omit<ActionDescriptorConstructorOptsType<Model, undefined>, 'serviceType' | 'dataProvider'>;
|
|
4
|
-
export declare class ActionLinkDescriptorInst<
|
|
4
|
+
export declare class ActionLinkDescriptorInst<Item, ValidationInputItem = Item> extends ActionDescriptorInst<Item, undefined, undefined, undefined, ValidationInputItem> {
|
|
5
5
|
private _url;
|
|
6
6
|
private _pathSegments;
|
|
7
7
|
private _queryParams?;
|
|
@@ -9,7 +9,7 @@ export declare class ActionLinkDescriptorInst<Model> extends ActionDescriptorIns
|
|
|
9
9
|
private _replaceUrl;
|
|
10
10
|
private _target;
|
|
11
11
|
private _isStyleLink;
|
|
12
|
-
constructor(actionName?: string, cfg?: ActionLinkDescriptorConstructorOpts<
|
|
12
|
+
constructor(actionName?: string, cfg?: ActionLinkDescriptorConstructorOpts<Item>);
|
|
13
13
|
get url(): string;
|
|
14
14
|
get pathSegments(): string[];
|
|
15
15
|
get queryParams(): Params | undefined;
|
|
@@ -23,5 +23,5 @@ export declare class ActionLinkDescriptorInst<Model> extends ActionDescriptorIns
|
|
|
23
23
|
withReplaceUrl(replaceUrl?: boolean): this;
|
|
24
24
|
withTarget(target?: '_self' | '_blank'): this;
|
|
25
25
|
withStyleLink(isStyleLink: boolean): this;
|
|
26
|
-
copy(): ActionLinkDescriptorInst<
|
|
26
|
+
copy(): ActionLinkDescriptorInst<Item, ValidationInputItem>;
|
|
27
27
|
}
|
|
@@ -18,7 +18,9 @@ export type ActionDescriptorCreateOptsParentType = {
|
|
|
18
18
|
export type ActionDescriptorConstructorOptsType<Item, Service> = ActionDescriptorCreateOptsParentType & ActionDescriptorCreateOptsProviderType<Item, Service> & {
|
|
19
19
|
model?: ModelDescriptor<Item>;
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
type AfterRunActionType<RunReturnItem> = ActionDescriptorInst<any, any, RunReturnItem, any, undefined>;
|
|
22
|
+
type OnErrorActionType<RunInputItem> = ActionDescriptorInst<any, any, RunInputItem, any, undefined>;
|
|
23
|
+
export declare class ActionDescriptorInst<Item, Service = any, RunInputItem = Item, RunReturnItem = Item, ValidationInputItem = RunInputItem> implements IActionDescriptor<Item, Service> {
|
|
22
24
|
protected readonly _model?: ModelDescriptor<Item>;
|
|
23
25
|
protected readonly _actionName: string;
|
|
24
26
|
protected readonly _actionNameLong: string;
|
|
@@ -33,28 +35,28 @@ export declare class ActionDescriptorInst<Item, Service = any, ReturnItem = Item
|
|
|
33
35
|
private _positionTableviewCategories?;
|
|
34
36
|
protected _tableviewCategory?: string;
|
|
35
37
|
protected _routeUrl: string | null;
|
|
36
|
-
protected _runFunction?: ActionRunFnType<Item, Service,
|
|
37
|
-
protected _isVisibleFunction?: ActionValidationFnType<
|
|
38
|
-
protected _isEnabledFunction?: ActionValidationFnType<
|
|
39
|
-
protected _runConfirmationDialogDescriptor?: ActionConfirmationDescriptor<
|
|
38
|
+
protected _runFunction?: ActionRunFnType<Item, Service, RunInputItem, RunReturnItem>;
|
|
39
|
+
protected _isVisibleFunction?: ActionValidationFnType<ValidationInputItem, Service>;
|
|
40
|
+
protected _isEnabledFunction?: ActionValidationFnType<ValidationInputItem, Service>;
|
|
41
|
+
protected _runConfirmationDialogDescriptor?: ActionConfirmationDescriptor<RunInputItem>;
|
|
40
42
|
protected _hasRunNotificationSuccess: boolean;
|
|
41
43
|
protected _runNotificationSuccessTitle?: string;
|
|
42
44
|
protected _runNotificationSuccessMessage?: string;
|
|
43
45
|
protected _hasRunNotificationError: boolean;
|
|
44
46
|
protected _runNotificationErrorTitle?: string;
|
|
45
47
|
protected _runNotificationErrorMessage?: string;
|
|
46
|
-
protected _afterRunAction?:
|
|
47
|
-
protected _onRunErrorAction?:
|
|
48
|
+
protected _afterRunAction?: AfterRunActionType<RunReturnItem> | ((ctx: IActionContext<Item, RunInputItem, any>) => AfterRunActionType<RunReturnItem>);
|
|
49
|
+
protected _onRunErrorAction?: OnErrorActionType<RunInputItem> | ((ctx: IActionContext<Item, RunInputItem, any>) => OnErrorActionType<RunInputItem>);
|
|
48
50
|
protected _permissions?: APermissions;
|
|
49
51
|
protected _button: ActionButtonDescriptor;
|
|
50
52
|
protected _hasItemsSelection: boolean;
|
|
51
53
|
protected _component?: Type<IActionComponent<Item>>;
|
|
52
54
|
protected _componentFromDi?: InjectionToken<Type<any>>;
|
|
53
55
|
protected _subactionsAsMenu: boolean;
|
|
54
|
-
protected _subactions: Array<ActionDescriptorInst<Item>>;
|
|
56
|
+
protected _subactions: Array<ActionDescriptorInst<Item, any, RunInputItem, any>>;
|
|
55
57
|
constructor(actionName: string, cfg?: ActionDescriptorConstructorOptsType<Item, Service>);
|
|
56
|
-
get model(): ModelDescriptor<Item
|
|
57
|
-
get parentModel(): ModelDescriptor<any
|
|
58
|
+
get model(): ModelDescriptor<Item> | undefined;
|
|
59
|
+
get parentModel(): ModelDescriptor<any> | undefined;
|
|
58
60
|
get parentProperty(): string | undefined;
|
|
59
61
|
get i18nModelActionBaseKey(): string | undefined;
|
|
60
62
|
get type(): ActionTypeEnum;
|
|
@@ -64,13 +66,13 @@ export declare class ActionDescriptorInst<Item, Service = any, ReturnItem = Item
|
|
|
64
66
|
get routeUrl(): string | null;
|
|
65
67
|
get dataProvider(): IDataProvider<Item, Service> | undefined;
|
|
66
68
|
get hasRunFunction(): boolean;
|
|
67
|
-
get runFunction(): ActionRunFnType<Item, Service,
|
|
68
|
-
get isVisibleFunction(): ActionValidationFnType<
|
|
69
|
-
get isEnabledFunction(): ActionValidationFnType<
|
|
69
|
+
get runFunction(): ActionRunFnType<Item, Service, RunInputItem, RunReturnItem>;
|
|
70
|
+
get isVisibleFunction(): ActionValidationFnType<ValidationInputItem, Service> | undefined;
|
|
71
|
+
get isEnabledFunction(): ActionValidationFnType<ValidationInputItem, Service> | undefined;
|
|
70
72
|
get actionName(): string;
|
|
71
73
|
get actionNameLong(): string;
|
|
72
74
|
get className(): string | undefined;
|
|
73
|
-
get runConfirmationDialogDescriptor(): ActionConfirmationDescriptor<
|
|
75
|
+
get runConfirmationDialogDescriptor(): ActionConfirmationDescriptor<RunInputItem> | undefined;
|
|
74
76
|
get hasRunConfirmation(): boolean;
|
|
75
77
|
get hasRunNotificationSuccess(): boolean;
|
|
76
78
|
get runNotificationSuccessTitle(): string | undefined;
|
|
@@ -78,8 +80,8 @@ export declare class ActionDescriptorInst<Item, Service = any, ReturnItem = Item
|
|
|
78
80
|
get hasRunNotificationError(): boolean;
|
|
79
81
|
get runNotificationErrorTitle(): string | undefined;
|
|
80
82
|
get runNotificationErrorMessage(): string | undefined;
|
|
81
|
-
get afterRunAction():
|
|
82
|
-
get onRunErrorAction():
|
|
83
|
+
get afterRunAction(): AfterRunActionType<RunReturnItem> | ((ctx: IActionContext<Item, RunInputItem, any>) => AfterRunActionType<RunReturnItem>) | undefined;
|
|
84
|
+
get onRunErrorAction(): OnErrorActionType<RunInputItem> | ((ctx: IActionContext<Item, RunInputItem, any>) => OnErrorActionType<RunInputItem>) | undefined;
|
|
83
85
|
get permissions(): APermissions | undefined;
|
|
84
86
|
get tableviewCategory(): string | undefined;
|
|
85
87
|
get hasItemsSelection(): boolean;
|
|
@@ -88,28 +90,28 @@ export declare class ActionDescriptorInst<Item, Service = any, ReturnItem = Item
|
|
|
88
90
|
get componentFromDi(): InjectionToken<Type<any>> | undefined;
|
|
89
91
|
get positionTableviewCategories(): string[] | undefined;
|
|
90
92
|
get subactionsAsMenu(): boolean;
|
|
91
|
-
get subactions(): ActionDescriptorInst<Item, any,
|
|
93
|
+
get subactions(): ActionDescriptorInst<Item, any, RunInputItem, any, RunInputItem>[];
|
|
92
94
|
protected setI18nModelActionBaseKey(base?: string): void;
|
|
93
|
-
withRunFunction(fn: ActionRunFnType<Item, Service,
|
|
94
|
-
withIsVisibleFunction(fn?: ActionValidationFnType<
|
|
95
|
-
withIsEnabledFunction(fn?: ActionValidationFnType<
|
|
95
|
+
withRunFunction(fn: ActionRunFnType<Item, Service, RunInputItem, RunReturnItem>): this;
|
|
96
|
+
withIsVisibleFunction(fn?: ActionValidationFnType<ValidationInputItem, Service>): this;
|
|
97
|
+
withIsEnabledFunction(fn?: ActionValidationFnType<ValidationInputItem, Service>): this;
|
|
96
98
|
withRouteTrigger(routeUrl: string): this;
|
|
97
99
|
withPosition(position: ActionPositionEnum): this;
|
|
98
100
|
/**
|
|
99
101
|
* creates confirmation action with default style based on action descriptor
|
|
100
102
|
*/
|
|
101
|
-
withRunConfirmation(): ActionConfirmationDescriptor<
|
|
103
|
+
withRunConfirmation(): ActionConfirmationDescriptor<RunInputItem>;
|
|
102
104
|
/**
|
|
103
105
|
* Add a configuration dialogue to action using ActionConfigurationDescriptor
|
|
104
106
|
* @param runConfirmationDialogDescriptor descriptor with customizable information for dialog
|
|
105
107
|
*/
|
|
106
|
-
withRunConfirmationDescriptor(runConfirmationDialogDescriptor?: ActionConfirmationDescriptor<
|
|
108
|
+
withRunConfirmationDescriptor(runConfirmationDialogDescriptor?: ActionConfirmationDescriptor<RunInputItem>): this;
|
|
107
109
|
withRunNotificationSuccess(title?: string, message?: string, hasNotification?: boolean): this;
|
|
108
110
|
withRunNotificationError(title?: string, message?: string, hasNotification?: boolean): this;
|
|
109
|
-
withAfterRunAction
|
|
110
|
-
withOnRunErrorAction
|
|
111
|
+
withAfterRunAction(action?: AfterRunActionType<RunReturnItem> | ((ctx: IActionContext<Item, RunInputItem, any>) => AfterRunActionType<RunReturnItem>)): this;
|
|
112
|
+
withOnRunErrorAction(action?: OnErrorActionType<RunInputItem> | ((ctx: IActionContext<Item, RunInputItem, any>) => OnErrorActionType<RunInputItem>)): this;
|
|
111
113
|
withPermissions(permissions: APermissions): this;
|
|
112
|
-
withTableviewCategory(
|
|
114
|
+
withTableviewCategory(category: string): this;
|
|
113
115
|
withButtonDescriptor(button: ActionButtonDescriptor): this;
|
|
114
116
|
withButton(label?: string | null, icon?: string | null, styleLevel?: StyleLevelEnum, styleText?: boolean): this;
|
|
115
117
|
withItemsSelection(hasSelection?: boolean): this;
|
|
@@ -118,12 +120,8 @@ export declare class ActionDescriptorInst<Item, Service = any, ReturnItem = Item
|
|
|
118
120
|
withPositionTableviewCategories(positionTableviewCategories: string[]): this;
|
|
119
121
|
withI18nBase(base: ClassType<unknown> | string): this;
|
|
120
122
|
withSubactionsAsMenu(subactionsAsMenu?: boolean): this;
|
|
121
|
-
withSubactions(...subactions: Array<ActionDescriptorInst<Item>>): this;
|
|
122
|
-
copyFieldsTo(descriptor: ActionDescriptorInst<Item, Service,
|
|
123
|
-
copy(): ActionDescriptorInst<Item, Service,
|
|
124
|
-
}
|
|
125
|
-
export declare class ActionDeleteDescriptorInst<Item, Service = any> extends ActionDescriptorInst<Item, Service> {
|
|
126
|
-
static readonly ACTION_NAME = "delete";
|
|
127
|
-
constructor(model: ModelDescriptor<Item>, cfg?: ActionDescriptorCreateOptsProviderType<Item, Service>);
|
|
128
|
-
copy(): ActionDeleteDescriptorInst<Item, Service>;
|
|
123
|
+
withSubactions(...subactions: Array<ActionDescriptorInst<Item, any, RunInputItem, any>>): this;
|
|
124
|
+
copyFieldsTo(descriptor: ActionDescriptorInst<Item, Service, RunInputItem, RunReturnItem, ValidationInputItem>): ActionDescriptorInst<Item, Service, RunInputItem, RunReturnItem, ValidationInputItem>;
|
|
125
|
+
copy(): ActionDescriptorInst<Item, Service, RunInputItem, RunReturnItem, ValidationInputItem>;
|
|
129
126
|
}
|
|
127
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ModelDescriptor } from '@mediusinc/mng-commons/model';
|
|
2
|
+
import { EditorDescriptorInst } from '../../editor/descriptors/editor.descriptor';
|
|
3
|
+
import { ActionPositionEnum } from '../models/action.type';
|
|
4
|
+
import { ActionProviderType } from './action-descriptor.factory';
|
|
5
|
+
import { ActionDescriptorInst } from './action.descriptor';
|
|
6
|
+
/**
|
|
7
|
+
* Defines an action to be positioned on a specified editor with editor-specific execution context.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} actionName - The name identifying the action to be performed.
|
|
10
|
+
* @param {EditorDescriptorInst<EditorModel>} editor - The descriptor of the editor on which the action will be placed and executed.
|
|
11
|
+
* @param {Object} [opts] - Options for configuring the action behavior.
|
|
12
|
+
* @param {ModelDescriptor<Model>} [opts.model] - The model descriptor associated with the action.
|
|
13
|
+
* @param {ActionProviderType<Model, Service>} [opts.serviceProvider] - The service provider type for execution context.
|
|
14
|
+
* @param {ActionPositionEnum.FooterLeft | ActionPositionEnum.FooterRight | ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight} [opts.position] - The position of action on editor.
|
|
15
|
+
* @return {ActionDescriptorInst<Model, Service, EditorModel, Model, EditorModel>} - An instance representing the configured action descriptor for the specified editor and model.
|
|
16
|
+
*/
|
|
17
|
+
export declare function actionOnEditor<Model, EditorModel, Service = undefined>(actionName: string, editor: EditorDescriptorInst<EditorModel>, opts?: {
|
|
18
|
+
model?: ModelDescriptor<Model>;
|
|
19
|
+
serviceProvider?: ActionProviderType<Model, Service>;
|
|
20
|
+
position?: ActionPositionEnum.FooterLeft | ActionPositionEnum.FooterRight | ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight;
|
|
21
|
+
}): ActionDescriptorInst<Model, Service, EditorModel, Model, EditorModel>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ModelDescriptor } from '@mediusinc/mng-commons/model';
|
|
2
|
+
import { EditorDescriptorInst } from '../../editor/descriptors/editor.descriptor';
|
|
3
|
+
import { ActionPositionEnum } from '../models/action.type';
|
|
4
|
+
import { ActionEditorProviderType } from './action-editor-descriptor.factory';
|
|
5
|
+
import { ActionEditorDescriptorInst } from './action-editor.descriptor';
|
|
6
|
+
/**
|
|
7
|
+
* Creates and returns an instance of `ActionEditorDescriptorInst` when positioned on another (parent) editor.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} actionName - The name of the action associated with the editor.
|
|
10
|
+
* @param {EditorDescriptorInst<EditorModel, ParentEditor>} editor - The editor descriptor defining editor on action.
|
|
11
|
+
* @param {Object} [opts] - Optional parameters for configuring the action editor.
|
|
12
|
+
* @param {ModelDescriptor<Model>} [opts.model] - The descriptor for the model associated with the action.
|
|
13
|
+
* @param {ActionEditorProviderType<Model, Service>} [opts.serviceProvider] - The service provider type for the action editor.
|
|
14
|
+
* @param {ActionPositionEnum.FooterLeft | ActionPositionEnum.FooterRight | ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight} [opts.position] - The desired position of action on the editor.
|
|
15
|
+
* @return {ActionEditorDescriptorInst<Model, Service, EditorModel, ParentEditor, EditorModel, ParentEditor>} A configured instance of `ActionEditorDescriptorInst` representing the action editor.
|
|
16
|
+
*/
|
|
17
|
+
export declare function actionEditorOnEditor<EditorModel, ParentEditor, Model = EditorModel, Service = undefined>(actionName: string, editor: EditorDescriptorInst<EditorModel, ParentEditor>, opts?: {
|
|
18
|
+
model?: ModelDescriptor<Model>;
|
|
19
|
+
serviceProvider?: ActionEditorProviderType<Model, Service>;
|
|
20
|
+
position?: ActionPositionEnum.FooterLeft | ActionPositionEnum.FooterRight | ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight;
|
|
21
|
+
}): ActionEditorDescriptorInst<Model, Service, EditorModel, ParentEditor, EditorModel, ParentEditor>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ModelDescriptor } from '@mediusinc/mng-commons/model';
|
|
2
|
+
import { TableDescriptorInst } from '@mediusinc/mng-commons/table/api';
|
|
3
|
+
import { ActionPositionEnum } from '../models/action.type';
|
|
4
|
+
import { ActionProviderType } from './action-descriptor.factory';
|
|
5
|
+
import { ActionDescriptorInst } from './action.descriptor';
|
|
6
|
+
/**
|
|
7
|
+
* Defines an action to be positioned on a specified table with table row execution context.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} actionName - The name identifying the action to be performed.
|
|
10
|
+
* @param {TableDescriptorInst<TableModel, any, any>} table - The descriptor of the table on which the action will be placed and executed.
|
|
11
|
+
* @param {Object} [opts] - Options for configuring the action behavior.
|
|
12
|
+
* @param {ModelDescriptor<Model>} [opts.model] - The model descriptor associated with the action.
|
|
13
|
+
* @param {ActionProviderType<Model, Service>} [opts.serviceProvider] - The service provider type for execution context.
|
|
14
|
+
* @param {ActionPositionEnum.RowInline | ActionPositionEnum.RowClick} [opts.position] - The position of action on table.
|
|
15
|
+
* @return {ActionDescriptorInst<Model, Service, TableModel, Model, TableModel>} - An instance representing the configured action descriptor for the specified table row and model.
|
|
16
|
+
*/
|
|
17
|
+
export declare function actionOnTableRow<Model, TableModel, Service = undefined>(actionName: string, table: TableDescriptorInst<TableModel, any, any>, opts?: {
|
|
18
|
+
model?: ModelDescriptor<Model>;
|
|
19
|
+
serviceProvider?: ActionProviderType<Model, Service>;
|
|
20
|
+
position?: ActionPositionEnum.RowInline | ActionPositionEnum.RowClick;
|
|
21
|
+
}): ActionDescriptorInst<Model, Service, TableModel, Model, TableModel>;
|
|
22
|
+
/**
|
|
23
|
+
* Defines an action to be positioned on a specified table with table header or footer execution context.
|
|
24
|
+
*
|
|
25
|
+
* @param {string} actionName - The name identifying the action to be performed.
|
|
26
|
+
* @param {Object} [opts] - Options for configuring the action behavior.
|
|
27
|
+
* @param {ModelDescriptor<Model>} [opts.model] - The model descriptor associated with the action.
|
|
28
|
+
* @param {ActionProviderType<Model, Service>} [opts.serviceProvider] - The service provider type for execution context.
|
|
29
|
+
* @param {ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight | ActionPositionEnum.TableHeader} [opts.position] - The position of action on table.
|
|
30
|
+
* @return {ActionDescriptorInst<Model, Service, TableModel, Model, TableModel>} - An instance representing the configured action descriptor for the specified table top and model.
|
|
31
|
+
*/
|
|
32
|
+
export declare function actionOnTableTop<Model, Service = undefined>(actionName: string, opts?: {
|
|
33
|
+
model?: ModelDescriptor<Model>;
|
|
34
|
+
serviceProvider?: ActionProviderType<Model, Service>;
|
|
35
|
+
position?: ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight | ActionPositionEnum.TableHeader;
|
|
36
|
+
}): ActionDescriptorInst<Model, Service, undefined, Model, undefined>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ModelDescriptor } from '@mediusinc/mng-commons/model';
|
|
2
|
+
import { TableDescriptorInst } from '@mediusinc/mng-commons/table/api';
|
|
3
|
+
import { EditorDescriptorInst } from '../../editor/descriptors/editor.descriptor';
|
|
4
|
+
import { ActionPositionEnum } from '../models/action.type';
|
|
5
|
+
import { ActionEditorProviderType } from './action-editor-descriptor.factory';
|
|
6
|
+
import { ActionEditorDescriptorInst } from './action-editor.descriptor';
|
|
7
|
+
/**
|
|
8
|
+
* Creates and returns an ActionEditorDescriptorInst for displaying editor action on table row.
|
|
9
|
+
*
|
|
10
|
+
* @param {string} actionName - The name of the action.
|
|
11
|
+
* @param {EditorDescriptorInst<EditorModel, any>} editor - The editor descriptor instance responsible for configuring the editor behavior.
|
|
12
|
+
* @param {TableDescriptorInst<TableModel, any, any>} table - The table descriptor instance representing the table on which the action is positioned.
|
|
13
|
+
* @param {Object} [opts] - Optional configurations for the action editor.
|
|
14
|
+
* @param {ModelDescriptor<Model>} [opts.model] - The model descriptor associated with the action editor.
|
|
15
|
+
* @param {ActionEditorProviderType<Model, Service>} [opts.serviceProvider] - The service provider for additional configurations or services for the action editor.
|
|
16
|
+
* @param {ActionPositionEnum.RowInline | ActionPositionEnum.RowClick} [opts.position] - The position where the action should be displayed on the table row.
|
|
17
|
+
* @return {ActionEditorDescriptorInst<Model, Service, EditorModel, TableModel, EditorModel, TableModel>} The configured action editor descriptor instance.
|
|
18
|
+
*/
|
|
19
|
+
export declare function actionEditorOnTableRow<EditorModel, TableModel, Model = EditorModel, Service = undefined>(actionName: string, editor: EditorDescriptorInst<EditorModel, any>, table: TableDescriptorInst<TableModel, any, any>, opts?: {
|
|
20
|
+
model?: ModelDescriptor<Model>;
|
|
21
|
+
serviceProvider?: ActionEditorProviderType<Model, Service>;
|
|
22
|
+
position?: ActionPositionEnum.RowInline | ActionPositionEnum.RowClick;
|
|
23
|
+
}): ActionEditorDescriptorInst<Model, Service, EditorModel, TableModel, EditorModel, TableModel>;
|
|
24
|
+
/**
|
|
25
|
+
* Creates and returns an action editor descriptor configured with the given parameters.
|
|
26
|
+
* This is used to define an action editor positioned relative to a table.
|
|
27
|
+
*
|
|
28
|
+
* @param {string} actionName - The name of the action.
|
|
29
|
+
* @param {EditorDescriptorInst<EditorModel, any>} editor - The editor descriptor instance responsible for configuring the editor behavior.
|
|
30
|
+
* @param {Object} [opts] - Optional configurations for the action editor.
|
|
31
|
+
* @param {ModelDescriptor<Model>} [opts.model] - The model descriptor associated with the action editor.
|
|
32
|
+
* @param {ActionEditorProviderType<Model, Service>} [opts.serviceProvider] - The service provider for additional configurations or services for the action editor.
|
|
33
|
+
* @param {ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight | ActionPositionEnum.TableHeader} [opts.position] - The position of the action on the table.
|
|
34
|
+
* @return {ActionEditorDescriptorInst<Model, Service, EditorModel, undefined, EditorModel, undefined>} The configured action editor descriptor instance.
|
|
35
|
+
*/
|
|
36
|
+
export declare function actionEditorOnTableTop<EditorModel, Model = EditorModel, Service = undefined>(actionName: string, editor: EditorDescriptorInst<EditorModel, any>, opts?: {
|
|
37
|
+
model?: ModelDescriptor<Model>;
|
|
38
|
+
serviceProvider?: ActionEditorProviderType<Model, Service>;
|
|
39
|
+
position?: ActionPositionEnum.ToolbarLeft | ActionPositionEnum.ToolbarRight | ActionPositionEnum.TableHeader;
|
|
40
|
+
}): ActionEditorDescriptorInst<Model, Service, EditorModel, undefined, EditorModel, undefined>;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { Injector } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { DataListResult, IDataProvider } from '@mediusinc/mng-commons/core';
|
|
3
|
+
import { DataListResult, IDataProvider, Nullable } from '@mediusinc/mng-commons/core';
|
|
4
4
|
import { IActionContext } from '../models/execution/action-context.model';
|
|
5
|
-
export declare function runFnFromDataProviderOrFallback<Item, Service, Return, FallbackReturn = Return>(ctx: IActionContext<Item, Service>, fn: (ctx: IActionContext<Item, Service>) => Observable<Return> | null, fallback: Observable<FallbackReturn>): Observable<Return | FallbackReturn>;
|
|
6
|
-
export declare function runFnFromDataProviderOrFail<Item, Service, Return>(ctx: IActionContext<Item, Service>, fn: (ctx: IActionContext<Item, Service>) => Observable<Return> | null): Observable<Return>;
|
|
7
|
-
export declare function runGetAllFromDataProvider<Item, Service>(ctx: IActionContext<Item, Service>): Observable<DataListResult<Item>> | null;
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
export 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>;
|
|
6
|
+
export declare function runFnFromDataProviderOrFail<Item, ParameterItem, Service, Return>(ctx: IActionContext<Item, ParameterItem, Service>, fn: (ctx: IActionContext<Item, ParameterItem, Service>) => Observable<Return> | null): Observable<Return>;
|
|
7
|
+
export declare function runGetAllFromDataProvider<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>): Observable<DataListResult<Item>> | null;
|
|
8
|
+
export type RunFetchFromDataProviderOptsType = {
|
|
9
|
+
strict?: boolean;
|
|
10
|
+
reason?: RunFetchFromDataProviderReasonType;
|
|
11
|
+
};
|
|
12
|
+
export type RunFetchFromDataProviderReasonType = 'create' | 'update' | 'fetch';
|
|
13
|
+
export declare function runFetchFromDataProvider<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>, opts?: RunFetchFromDataProviderOptsType): Observable<Item> | null;
|
|
14
|
+
export declare function runCreateFromDataProvider<Item, ParameterItem, Service>(ctx: IActionContext<Item, ParameterItem, Service>): Observable<Nullable<Item>> | null;
|
|
15
|
+
export declare function runUpdateFromDataProvider<Item, ParameterItem, service>(ctx: IActionContext<Item, ParameterItem, service>): Observable<Nullable<Item>> | null;
|
|
16
|
+
export declare function runDeleteFromDataProvider<Item, ParametersItem, Service>(ctx: IActionContext<Item, ParametersItem, Service>): Observable<Nullable<Item>> | null;
|
|
12
17
|
/**
|
|
13
18
|
* Gets service instance of data provider.
|
|
14
19
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ItemOrObservable, Nullable } from '@mediusinc/mng-commons/core';
|
|
2
2
|
import { ActionContextValidation } from './execution/action-context-validation.model';
|
|
3
3
|
import { IActionContext } from './execution/action-context.model';
|
|
4
|
-
export type ActionRunFnType<Item, Service = undefined, ReturnItem = Item, Return = ItemOrObservable<Nullable<ReturnItem>>> = (ctx: IActionContext<Item, Service>) => Return;
|
|
5
|
-
export type ActionValidationFnType<Item, Service = undefined, Return = ItemOrObservable<boolean>> = (ctx: ActionContextValidation<Item, Service>) => Return;
|
|
4
|
+
export type ActionRunFnType<Item, Service = undefined, InputItem = Item, ReturnItem = Item, Return = ItemOrObservable<Nullable<ReturnItem>>> = (ctx: IActionContext<Item, InputItem, Service>) => Return;
|
|
5
|
+
export type ActionValidationFnType<Item, Service = undefined, InputItem = Item, Return = ItemOrObservable<boolean>> = (ctx: ActionContextValidation<Item, InputItem, Service>) => Return;
|
|
@@ -2,7 +2,7 @@ import { HttpErrorResponse } from '@angular/common/http';
|
|
|
2
2
|
import { ACommonsErrorBase, CommonsErrorBaseOptions, ICommonsActionError } from '@mediusinc/mng-commons/core';
|
|
3
3
|
import { IActionContext } from './execution/action-context.model';
|
|
4
4
|
export interface CommonsActionErrorOptions extends CommonsErrorBaseOptions {
|
|
5
|
-
actionContext?: IActionContext<any, any>;
|
|
5
|
+
actionContext?: IActionContext<any, any, any>;
|
|
6
6
|
httpError?: HttpErrorResponse;
|
|
7
7
|
}
|
|
8
8
|
export declare class CommonsActionError extends ACommonsErrorBase implements ICommonsActionError {
|
|
@@ -3,9 +3,9 @@ import { ActionDescriptorInst } from '../../descriptors/action.descriptor';
|
|
|
3
3
|
/**
|
|
4
4
|
* Class containing all main data for action validations (enabled/visible) to be executed in validation states.
|
|
5
5
|
*/
|
|
6
|
-
export interface ActionContextValidation<Item, Service = undefined> {
|
|
6
|
+
export interface ActionContextValidation<Item, ParametersItem, Service = undefined> {
|
|
7
7
|
descriptor: ActionDescriptorInst<Item, Service>;
|
|
8
|
-
parameters: ActionParameters<
|
|
8
|
+
parameters: ActionParameters<ParametersItem>;
|
|
9
9
|
serviceInstance: Service;
|
|
10
10
|
dataProvider?: IDataProvider<Item, Service>;
|
|
11
11
|
}
|
|
@@ -7,10 +7,10 @@ import { IViewContainer } from './view-container.model';
|
|
|
7
7
|
/**
|
|
8
8
|
* Class containing all main data for action to be executed in run/fetch/submit states.
|
|
9
9
|
*/
|
|
10
|
-
export interface IActionContext<Item, Service = undefined, Instance extends IActionInstance<Item, Service> = IActionInstance<Item, Service>, ViewContainer extends IViewContainer<Item, Service, Instance> = IViewContainer<Item, Service, Instance>> {
|
|
10
|
+
export interface IActionContext<Item, ParametersItem, Service = undefined, Instance extends IActionInstance<Item, Service> = IActionInstance<Item, Service>, ViewContainer extends IViewContainer<Item, Service, Instance> = IViewContainer<Item, Service, Instance>> {
|
|
11
11
|
contextLongName: string;
|
|
12
12
|
instance: Instance;
|
|
13
|
-
parameters: ActionParameters<
|
|
13
|
+
parameters: ActionParameters<ParametersItem>;
|
|
14
14
|
functionName: 'run' | 'fetch' | 'submit';
|
|
15
15
|
serviceInstance: Service;
|
|
16
16
|
dataProvider?: IDataProvider<Item, Service>;
|
|
@@ -8,7 +8,7 @@ import { ActionInstanceStateEnum } from './action-instance-state.model';
|
|
|
8
8
|
export interface IActionInstance<Item, Service> {
|
|
9
9
|
instanceId: string;
|
|
10
10
|
instanceLongName: string;
|
|
11
|
-
action: ActionDescriptorInst<Item>;
|
|
11
|
+
action: ActionDescriptorInst<Item, any, any, any, any>;
|
|
12
12
|
createdDate: Date;
|
|
13
13
|
triggerParameters?: ActionParameters<Item>;
|
|
14
14
|
activationParameters?: ActionParameters<Item>;
|