@nocobase/client 2.1.0-alpha.1 → 2.1.0-alpha.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/.dumirc.ts +8 -0
- package/es/ai/ai-manager.d.ts +15 -0
- package/es/ai/index.d.ts +11 -0
- package/es/ai/tools-manager/hooks/context.d.ts +17 -0
- package/es/ai/tools-manager/hooks/index.d.ts +11 -0
- package/es/ai/tools-manager/hooks/provider.d.ts +16 -0
- package/es/ai/tools-manager/index.d.ts +21 -0
- package/es/ai/tools-manager/types.d.ts +80 -0
- package/es/ai/utils.d.ts +10 -0
- package/es/api-client/APIClient.d.ts +1 -0
- package/es/application/Application.d.ts +2 -0
- package/es/application/Plugin.d.ts +1 -0
- package/es/application/RouteRepository.d.ts +23 -0
- package/es/application/globalOperators.d.ts +11 -0
- package/es/block-provider/TableUidContext.d.ts +10 -0
- package/es/data-source/collection/utils.d.ts +2 -4
- package/es/flow/actions/aclCheckRefresh.d.ts +9 -0
- package/es/flow/actions/blockHeight.d.ts +9 -0
- package/es/flow/actions/filterFormDefaultValues.d.ts +9 -0
- package/es/flow/actions/formAssignRules.d.ts +9 -0
- package/es/flow/actions/index.d.ts +6 -0
- package/es/flow/actions/linkageRulesRefresh.d.ts +9 -0
- package/es/flow/actions/numberFormat.d.ts +9 -0
- package/es/flow/components/BlockItemCard.d.ts +1 -0
- package/es/flow/components/ConditionBuilder.d.ts +2 -0
- package/es/flow/components/DefaultValue.d.ts +1 -0
- package/es/flow/components/FieldAssignEditor.d.ts +32 -0
- package/es/flow/components/FieldAssignExactDatePicker.d.ts +23 -0
- package/es/flow/components/FieldAssignRulesEditor.d.ts +70 -0
- package/es/flow/components/FieldAssignValueInput.d.ts +42 -1
- package/es/flow/components/RunJSValueEditor.d.ts +19 -0
- package/es/flow/components/TextAreaWithContextSelector.d.ts +1 -0
- package/es/flow/components/code-editor/core/EditorCore.d.ts +3 -1
- package/es/flow/components/code-editor/formatDocInfo.d.ts +17 -0
- package/es/flow/components/code-editor/hooks/useCodeRunner.d.ts +3 -1
- package/es/flow/components/code-editor/index.d.ts +1 -0
- package/es/flow/components/code-editor/linter.d.ts +10 -2
- package/es/flow/components/code-editor/runjsCompletionSource.d.ts +20 -0
- package/es/flow/components/code-editor/runjsDiagnostics.d.ts +43 -0
- package/es/flow/components/fieldAssignOptions.d.ts +23 -0
- package/es/flow/components/filter/LinkageFilterItem.d.ts +4 -1
- package/es/flow/components/useAssociationTitleFieldSync.d.ts +13 -0
- package/es/flow/index.d.ts +2 -0
- package/es/flow/internal/utils/modelUtils.d.ts +23 -0
- package/es/flow/internal/utils/saveStepParamsWithSubModels.d.ts +11 -0
- package/es/flow/internal/utils/titleFieldQuickSync.d.ts +35 -0
- package/es/flow/models/base/AssociationFieldGroupModel.d.ts +1 -1
- package/es/flow/models/base/BlockModel.d.ts +3 -1
- package/es/flow/models/base/CollectionBlockModel.d.ts +29 -56
- package/es/flow/models/base/GridModel.d.ts +6 -0
- package/es/flow/models/base/PageModel/PageModel.d.ts +16 -0
- package/es/flow/models/blocks/details/DetailsGridModel.d.ts +1 -0
- package/es/flow/models/blocks/details/utils.d.ts +16 -0
- package/es/flow/models/blocks/filter-form/FieldOperatorSelect.d.ts +10 -0
- package/es/flow/models/blocks/filter-form/FilterFormBlockModel.d.ts +6 -0
- package/es/flow/models/blocks/filter-form/FilterFormItemModel.d.ts +5 -37
- package/es/flow/models/blocks/filter-form/customFieldOperators.d.ts +34 -0
- package/es/flow/models/blocks/filter-form/fields/FilterFormCustomFieldModel.d.ts +16 -0
- package/es/flow/models/blocks/filter-form/fields/FilterFormCustomRecordSelectFieldModel.d.ts +20 -0
- package/es/flow/models/blocks/filter-form/fields/FilterFormRecordSelectFieldModel.d.ts +12 -0
- package/es/flow/models/blocks/filter-form/fields/index.d.ts +2 -0
- package/es/flow/models/blocks/filter-form/index.d.ts +4 -0
- package/es/flow/models/blocks/filter-form/legacyDefaultValueMigration.d.ts +13 -0
- package/es/flow/models/blocks/filter-form/valueNormalization.d.ts +17 -0
- package/es/flow/models/blocks/filter-manager/flow-actions/defaultOperator.d.ts +1 -3
- package/es/flow/models/blocks/form/CreateFormModel.d.ts +2 -1
- package/es/flow/models/blocks/form/EditFormModel.d.ts +2 -1
- package/es/flow/models/blocks/form/FormAssociationFieldGroupModel.d.ts +12 -0
- package/es/flow/models/blocks/form/FormAssociationItemModel.d.ts +39 -0
- package/es/flow/models/blocks/form/FormBlockModel.d.ts +34 -2
- package/es/flow/models/blocks/form/FormGridModel.d.ts +1 -0
- package/es/flow/models/blocks/form/QuickEditFormModel.d.ts +4 -1
- package/es/flow/models/blocks/form/assignRulesUpdateAssociationValues.d.ts +18 -0
- package/es/flow/models/blocks/form/dynamicNamePath.d.ts +19 -0
- package/es/flow/models/blocks/form/index.d.ts +2 -0
- package/es/flow/models/blocks/form/legacyDefaultValueMigration.d.ts +13 -0
- package/es/flow/models/blocks/form/submitHandler.d.ts +1 -1
- package/es/flow/models/blocks/form/submitValues.d.ts +19 -0
- package/es/flow/models/blocks/form/value-runtime/conditions.d.ts +9 -0
- package/es/flow/models/blocks/form/value-runtime/deps.d.ts +23 -0
- package/es/flow/models/blocks/form/value-runtime/form-patch.d.ts +19 -0
- package/es/flow/models/blocks/form/value-runtime/index.d.ts +11 -0
- package/es/flow/models/blocks/form/value-runtime/path.d.ts +25 -0
- package/es/flow/models/blocks/form/value-runtime/rules.d.ts +129 -0
- package/es/flow/models/blocks/form/value-runtime/runtime.d.ts +75 -0
- package/es/flow/models/blocks/form/value-runtime/types.d.ts +62 -0
- package/es/flow/models/blocks/form/value-runtime/utils.d.ts +12 -0
- package/es/flow/models/blocks/shared/legacyDefaultValueMigrationBase.d.ts +20 -0
- package/es/flow/models/blocks/table/TableSelectModel.d.ts +0 -1
- package/es/flow/models/blocks/table/dragSort/dragSortComponents.d.ts +14 -0
- package/es/flow/models/blocks/table/dragSort/dragSortHooks.d.ts +13 -0
- package/es/flow/models/blocks/table/dragSort/dragSortSettings.d.ts +39 -0
- package/es/flow/models/blocks/table/dragSort/dragSortUtils.d.ts +37 -0
- package/es/flow/models/blocks/table/dragSort/index.d.ts +12 -0
- package/es/flow/models/blocks/table/utils.d.ts +8 -8
- package/es/flow/models/fields/AssociationFieldModel/CascadeSelectFieldModel.d.ts +16 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableActionGroupModel.d.ts +11 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableActionsColumnModel.d.ts +19 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableFieldModel.d.ts +30 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableEditActionModel.d.ts +28 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableFormSubmitActionModel.d.ts +16 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableRemoveActionModel.d.ts +14 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/blocks/PopupSubTableFormModel.d.ts +36 -0
- package/es/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/index.d.ts +17 -0
- package/es/flow/models/fields/AssociationFieldModel/RecordPickerFieldModel.d.ts +8 -1
- package/es/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.d.ts +15 -0
- package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.d.ts +4 -1
- package/es/flow/models/fields/AssociationFieldModel/index.d.ts +1 -0
- package/es/flow/models/fields/AssociationFieldModel/itemChain.d.ts +94 -0
- package/es/flow/models/fields/AssociationFieldModel/recordSelectShared.d.ts +15 -5
- package/es/flow/models/fields/RichTextFieldModel/registerFontSize.d.ts +9 -0
- package/es/flow/models/fields/RichTextFieldModel/registerImageResize.d.ts +9 -0
- package/es/flow/models/fields/RichTextFieldModel/registerSmartBreak.d.ts +12 -0
- package/es/flow/models/fields/index.d.ts +0 -1
- package/es/flow/utils/dispatchEventDeep.d.ts +20 -0
- package/es/flow/utils/index.d.ts +1 -0
- package/es/flow/utils/useJsonTemplateResolver.d.ts +9 -0
- package/es/index.d.ts +1 -0
- package/es/index.mjs +36092 -24112
- package/es/route-switch/antd/admin-layout/index.d.ts +1 -1
- package/es/schema-component/antd/form-item/hooks/useLazyLoadDisplayAssociationFieldsOfForm.d.ts +26 -0
- package/es/user/CurrentUserProvider.d.ts +1 -1
- package/es/variables/index.d.ts +1 -1
- package/lib/index.js +449 -290
- package/lib/locale/de-DE.json +2 -0
- package/lib/locale/en-US.json +51 -0
- package/lib/locale/es-ES.json +2 -0
- package/lib/locale/fr-FR.json +2 -0
- package/lib/locale/hu-HU.json +2 -0
- package/lib/locale/id-ID.json +2 -0
- package/lib/locale/it-IT.json +2 -0
- package/lib/locale/ja-JP.json +2 -0
- package/lib/locale/ko-KR.json +2 -0
- package/lib/locale/nl-NL.json +2 -0
- package/lib/locale/pt-BR.json +2 -0
- package/lib/locale/ru-RU.json +2 -0
- package/lib/locale/tr-TR.json +2 -0
- package/lib/locale/uk-UA.json +2 -0
- package/lib/locale/vi-VN.json +2 -0
- package/lib/locale/zh-CN.json +78 -7
- package/lib/locale/zh-TW.json +12 -0
- package/package.json +8 -7
- package/es/flow/models/fields/UploadFieldModel.d.ts +0 -22
- package/es/index-C3fHjsMw.mjs +0 -279
- package/lib/index-C3fHjsMw-CDWZlvuM.js +0 -2237
- package/lib/style.css +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { RecordSelectFieldModel } from '../../../fields/AssociationFieldModel/RecordSelectFieldModel';
|
|
11
|
+
export declare class FilterFormCustomRecordSelectFieldModel extends RecordSelectFieldModel {
|
|
12
|
+
private valueOptionsSyncKey;
|
|
13
|
+
private valueOptionsSyncedKey;
|
|
14
|
+
private valueOptionsSyncTask;
|
|
15
|
+
private buildValueOptionsSyncKey;
|
|
16
|
+
private ensureValueOptionsSynced;
|
|
17
|
+
onDispatchEventStart(eventName: string): Promise<void>;
|
|
18
|
+
getFilterValue(): any;
|
|
19
|
+
render(): React.JSX.Element;
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { RecordSelectFieldModel } from '../../../fields/AssociationFieldModel';
|
|
10
|
+
export declare class FilterFormRecordSelectFieldModel extends RecordSelectFieldModel {
|
|
11
|
+
onInit(options: any): void;
|
|
12
|
+
}
|
|
@@ -7,5 +7,7 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
export * from './FilterFormFieldModel';
|
|
10
|
+
export * from './FilterFormRecordSelectFieldModel';
|
|
10
11
|
export * from './date-time';
|
|
11
12
|
export * from './FilterFormCustomFieldModel';
|
|
13
|
+
export * from './FilterFormCustomRecordSelectFieldModel';
|
|
@@ -14,6 +14,10 @@ export * from './FilterFormCollapseActionModel';
|
|
|
14
14
|
export * from './FilterFormGridModel';
|
|
15
15
|
export * from './FilterFormItemModel';
|
|
16
16
|
export * from './FilterFormCustomItemModel';
|
|
17
|
+
export * from './FieldModelSelect';
|
|
18
|
+
export * from './FieldOperatorSelect';
|
|
19
|
+
export * from './SourceCascader';
|
|
20
|
+
export * from './customFieldOperators';
|
|
17
21
|
export * from './FilterFormJSActionModel';
|
|
18
22
|
export * from './FilterFormResetActionModel';
|
|
19
23
|
export * from './FilterFormSubmitActionModel';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { mergeAssignRulesWithLegacyDefaults } from '../shared/legacyDefaultValueMigrationBase';
|
|
10
|
+
import type { FieldAssignRuleItem } from '../../../components/FieldAssignRulesEditor';
|
|
11
|
+
export declare function collectLegacyDefaultValueRulesFromFilterFormModel(filterFormModel: any): FieldAssignRuleItem[];
|
|
12
|
+
export declare function clearLegacyDefaultValuesFromFilterFormModel(filterFormModel: any): any[];
|
|
13
|
+
export { mergeAssignRulesWithLegacyDefaults };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Normalize filter value based on operator expected shape.
|
|
11
|
+
*
|
|
12
|
+
* - Multi-value operators: normalize scalar -> [value]
|
|
13
|
+
* - $dateBetween: normalize scalar date -> [date, date]
|
|
14
|
+
*
|
|
15
|
+
* Note: For date variables (object with `type`), keep as-is because operators can resolve it to ranges.
|
|
16
|
+
*/
|
|
17
|
+
export declare function normalizeFilterValueByOperator(operator: string | undefined, rawValue: any): any;
|
|
@@ -6,6 +6,4 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
import { FilterFormFieldModel } from '../../filter-form/fields';
|
|
11
|
-
export declare const defaultOperator: import("@nocobase/flow-engine").ActionDefinition<FilterFormFieldModel, FlowContext>;
|
|
9
|
+
export declare const defaultOperator: any;
|
|
@@ -15,6 +15,7 @@ export declare class CreateFormModel extends FormBlockModel {
|
|
|
15
15
|
private actionExtraToolbarItems;
|
|
16
16
|
createResource(ctx: any, params: any): SingleRecordResource<unknown>;
|
|
17
17
|
getAclActionName(): string;
|
|
18
|
-
|
|
18
|
+
submitHandler(ctx: any, params: any, cb?: (values?: any, filterByTk?: any) => void): Promise<void>;
|
|
19
|
+
submit(params?: any, cb?: (values?: any, filterByTk?: any) => void): Promise<void>;
|
|
19
20
|
renderComponent(): React.JSX.Element;
|
|
20
21
|
}
|
|
@@ -18,6 +18,7 @@ export declare class EditFormModel extends FormBlockModel {
|
|
|
18
18
|
getCurrentRecord(): any;
|
|
19
19
|
getAclActionName(): string;
|
|
20
20
|
handlePageChange: (page: number) => Promise<void>;
|
|
21
|
-
|
|
21
|
+
submitHandler(ctx: any, params: any, cb?: (values?: any, filterByTk?: any) => void): Promise<void>;
|
|
22
|
+
submit(params?: any, cb?: (values?: any, filterByTk?: any) => void): Promise<void>;
|
|
22
23
|
renderComponent(): React.JSX.Element;
|
|
23
24
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { AssociationFieldGroupModel } from '../../base';
|
|
10
|
+
export declare class FormAssociationFieldGroupModel extends AssociationFieldGroupModel {
|
|
11
|
+
static itemModelName: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { DisplayItemModel, FlowModelContext } from '@nocobase/flow-engine';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
export declare class FormAssociationItemModel extends DisplayItemModel {
|
|
12
|
+
static defineChildren(ctx: FlowModelContext): {
|
|
13
|
+
key: any;
|
|
14
|
+
label: string;
|
|
15
|
+
refreshTargets: string[];
|
|
16
|
+
toggleable: (subModel: any) => boolean;
|
|
17
|
+
useModel: string;
|
|
18
|
+
createModelOptions: () => {
|
|
19
|
+
use: string;
|
|
20
|
+
stepParams: {
|
|
21
|
+
fieldSettings: {
|
|
22
|
+
init: {
|
|
23
|
+
dataSourceKey: any;
|
|
24
|
+
collectionName: any;
|
|
25
|
+
fieldPath: any;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
subModels: {
|
|
30
|
+
field: {
|
|
31
|
+
use: string;
|
|
32
|
+
props: any;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}[];
|
|
37
|
+
onInit(options: any): void;
|
|
38
|
+
renderItem(): React.JSX.Element;
|
|
39
|
+
}
|
|
@@ -13,6 +13,7 @@ import { BlockGridModel } from '../../base/BlockGridModel';
|
|
|
13
13
|
import { CollectionBlockModel } from '../../base/CollectionBlockModel';
|
|
14
14
|
import { FormActionModel } from './FormActionModel';
|
|
15
15
|
import { FormGridModel } from './FormGridModel';
|
|
16
|
+
import { FormValueRuntime } from './value-runtime';
|
|
16
17
|
type DefaultCollectionBlockModelStructure = {
|
|
17
18
|
parent?: BlockGridModel;
|
|
18
19
|
subModels?: {
|
|
@@ -22,16 +23,33 @@ type DefaultCollectionBlockModelStructure = {
|
|
|
22
23
|
};
|
|
23
24
|
type CustomFormBlockModelClassesEnum = {};
|
|
24
25
|
export declare class FormBlockModel<T extends DefaultCollectionBlockModelStructure = DefaultCollectionBlockModelStructure> extends CollectionBlockModel<T> {
|
|
26
|
+
formValueRuntime?: FormValueRuntime;
|
|
27
|
+
private userModifiedTopLevelFields;
|
|
25
28
|
get form(): FormInstance<any>;
|
|
26
29
|
_defaultCustomModelClasses: {
|
|
27
30
|
FormActionGroupModel: string;
|
|
28
31
|
FormItemModel: string;
|
|
29
|
-
|
|
32
|
+
FormAssociationFieldGroupModel: string;
|
|
30
33
|
};
|
|
31
34
|
customModelClasses: CustomFormBlockModelClassesEnum;
|
|
32
35
|
renderConfigureActions(): React.JSX.Element;
|
|
33
36
|
setFieldsValue(values: any): void;
|
|
34
|
-
setFieldValue(fieldName:
|
|
37
|
+
setFieldValue(fieldName: any, value: any): void;
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
*
|
|
41
|
+
* 仅用于编辑表单刷新保护:只记录「用户交互」触发的改动(来自 antd Form.onValuesChange)。
|
|
42
|
+
* 程序化 setFieldValue/setFieldsValue 不会触发 onValuesChange(见 linkageRules 的手动 emit),因此不会污染该集合。
|
|
43
|
+
*/
|
|
44
|
+
markUserModifiedFields(changedValues: any): void;
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
getUserModifiedFields(): Set<string>;
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
resetUserModifiedFields(): void;
|
|
35
53
|
onDispatchEventStart(eventName: string, options?: any, inputArgs?: Record<string, any>): Promise<void>;
|
|
36
54
|
getStepParams(flowKey: string, stepKey: string): any | undefined;
|
|
37
55
|
getStepParams(flowKey: string): Record<string, any> | undefined;
|
|
@@ -44,6 +62,7 @@ export declare class FormBlockModel<T extends DefaultCollectionBlockModelStructu
|
|
|
44
62
|
useHooksBeforeRender(): void;
|
|
45
63
|
onInit(options: any): void;
|
|
46
64
|
protected onMount(): void;
|
|
65
|
+
onUnmount(): void;
|
|
47
66
|
getCurrentRecord(): {};
|
|
48
67
|
renderComponent(): void;
|
|
49
68
|
}
|
|
@@ -53,7 +72,20 @@ export declare function FormComponent({ model, children, layoutProps, initialVal
|
|
|
53
72
|
layoutProps?: any;
|
|
54
73
|
initialValues?: any;
|
|
55
74
|
onFinish?: (values: any) => void;
|
|
75
|
+
[key: string]: any;
|
|
56
76
|
}): React.JSX.Element;
|
|
77
|
+
type FormBlockContentProps = {
|
|
78
|
+
model: FormBlockModel;
|
|
79
|
+
gridModel: FormGridModel;
|
|
80
|
+
layoutProps?: any;
|
|
81
|
+
onFinish?: (values: any) => void;
|
|
82
|
+
grid: React.ReactNode;
|
|
83
|
+
actions?: React.ReactNode;
|
|
84
|
+
footer?: React.ReactNode;
|
|
85
|
+
heightMode?: string;
|
|
86
|
+
height?: number;
|
|
87
|
+
};
|
|
88
|
+
export declare const FormBlockContent: ({ model, gridModel, layoutProps, onFinish, grid, actions, footer, heightMode, height, }: FormBlockContentProps) => React.JSX.Element;
|
|
57
89
|
/**
|
|
58
90
|
* 兼容旧版本
|
|
59
91
|
* @deprecated use FormBlockModel instead
|
|
@@ -16,6 +16,7 @@ export declare class QuickEditFormModel extends FlowModel {
|
|
|
16
16
|
viewContainer: any;
|
|
17
17
|
__onSubmitSuccess: any;
|
|
18
18
|
_fieldProps: any;
|
|
19
|
+
_onOk: any;
|
|
19
20
|
get form(): any;
|
|
20
21
|
useHooksBeforeRender(): void;
|
|
21
22
|
static open(options: {
|
|
@@ -24,10 +25,12 @@ export declare class QuickEditFormModel extends FlowModel {
|
|
|
24
25
|
dataSourceKey: string;
|
|
25
26
|
collectionName: string;
|
|
26
27
|
fieldPath: string;
|
|
27
|
-
filterByTk: string;
|
|
28
28
|
record: any;
|
|
29
|
+
filterByTk?: string;
|
|
29
30
|
onSuccess?: (values: any) => void;
|
|
30
31
|
fieldProps?: any;
|
|
32
|
+
sourceFieldModelUid?: string;
|
|
33
|
+
onOk?: (values: any) => void;
|
|
31
34
|
}): Promise<void>;
|
|
32
35
|
onInit(options: any): void;
|
|
33
36
|
addAppends(fieldPath: string, refresh?: boolean): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* 从 assignRules 的 targetPath 推导需要注入到请求中的 updateAssociationValues。
|
|
11
|
+
*
|
|
12
|
+
* 规则:仅当 targetPath 穿过至少一段关联字段(association)时返回该关联路径:
|
|
13
|
+
* - user.name -> user
|
|
14
|
+
* - user.profile.name -> user.profile
|
|
15
|
+
*/
|
|
16
|
+
export declare function collectUpdateAssociationValuesFromAssignRules(items: Array<{
|
|
17
|
+
targetPath?: string;
|
|
18
|
+
} | any>, rootCollection: any): string[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export type DynamicNamePart = string | number;
|
|
10
|
+
/**
|
|
11
|
+
* Build a dynamic NamePath based on current subform list row index.
|
|
12
|
+
*
|
|
13
|
+
* fieldIndex is an array like: ["products:0", "products:2"] (nested lists allowed, including same-name lists).
|
|
14
|
+
*
|
|
15
|
+
* For example:
|
|
16
|
+
* - nameParts: ["products", "products"] + fieldIndex: ["products:0"] => [0, "products"]
|
|
17
|
+
* - nameParts: ["products", "products", "id"] + fieldIndex: ["products:1", "products:0"] => [0, "id"]
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildDynamicNamePath(nameParts: DynamicNamePart[], fieldIndex?: string[]): DynamicNamePart[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { mergeAssignRulesWithLegacyDefaults } from '../shared/legacyDefaultValueMigrationBase';
|
|
10
|
+
import type { FieldAssignRuleItem } from '../../../components/FieldAssignRulesEditor';
|
|
11
|
+
export declare function collectLegacyDefaultValueRulesFromFormModel(formModel: any): FieldAssignRuleItem[];
|
|
12
|
+
export declare function clearLegacyDefaultValuesFromFormModel(formModel: any): any[];
|
|
13
|
+
export { mergeAssignRulesWithLegacyDefaults };
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
export declare function submitHandler(ctx: any, params: any): Promise<void>;
|
|
9
|
+
export declare function submitHandler(ctx: any, params: any, cb?: (values?: any, filterByTk?: any) => void): Promise<void>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { FormBlockModel } from './FormBlockModel';
|
|
10
|
+
/**
|
|
11
|
+
* 提交前过滤:移除当前表单 block 中被「联动规则隐藏」的字段值(`model.hidden === true`)。
|
|
12
|
+
*
|
|
13
|
+
* 说明:
|
|
14
|
+
* - 仅对 “隐藏 / Hidden” 生效(对应 `model.hidden=true`)。
|
|
15
|
+
* - “隐藏并保留值 / Hidden (reserved value)” 在实现上是 `props.hidden=true` 但 `model.hidden=false`,
|
|
16
|
+
* 因此仍会提交(保持现有语义)。
|
|
17
|
+
* - 不会清空 antd Form 的内部 store,只影响本次提交 payload。
|
|
18
|
+
*/
|
|
19
|
+
export declare function omitHiddenModelValuesFromSubmit<T = any>(values: T, blockModel: FormBlockModel): T;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export declare function evaluateCondition(ctx: any, condition: any): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { NamePath } from './types';
|
|
10
|
+
export type DepCollector = {
|
|
11
|
+
deps: Set<string>;
|
|
12
|
+
wildcard: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare function recordDep(namePath: NamePath, collector: DepCollector | undefined): void;
|
|
15
|
+
export declare function createFormValuesProxy(options: {
|
|
16
|
+
valuesMirror: any;
|
|
17
|
+
basePath: NamePath;
|
|
18
|
+
collector?: DepCollector;
|
|
19
|
+
getFormValuesSnapshot: () => any;
|
|
20
|
+
getFormValueAtPath: (namePath: NamePath) => any;
|
|
21
|
+
}): any;
|
|
22
|
+
export declare function collectStaticDepsFromTemplateValue(value: any, collector: DepCollector): void;
|
|
23
|
+
export declare function collectStaticDepsFromRunJSValue(value: any, collector: DepCollector): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { FormInstance } from 'antd';
|
|
10
|
+
import type { Patch, SetOptions } from './types';
|
|
11
|
+
export type FormPatcher = {
|
|
12
|
+
patch: (form: FormInstance) => void;
|
|
13
|
+
restore: () => void;
|
|
14
|
+
};
|
|
15
|
+
export declare function createFormPatcher(options: {
|
|
16
|
+
isSuppressed: () => boolean;
|
|
17
|
+
getCallerContext: () => any;
|
|
18
|
+
setFormValues: (callerCtx: any, patch: Patch, options?: SetOptions) => Promise<void>;
|
|
19
|
+
}): FormPatcher;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export * from './types';
|
|
10
|
+
export { FormValueRuntime } from './runtime';
|
|
11
|
+
export { isEmptyValue } from './utils';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { NamePath } from './types';
|
|
10
|
+
export type PathSegment = string | number | {
|
|
11
|
+
placeholder: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function parsePathString(path: string): PathSegment[];
|
|
14
|
+
/**
|
|
15
|
+
* Resolve a dynamic NamePath using the current row index context (`fieldIndex`).
|
|
16
|
+
*
|
|
17
|
+
* - Supports placeholders: `users[placeholder].name`
|
|
18
|
+
* - Auto-fills to-many index when omitted: `users.name` -> `users[ctxIndex].name`
|
|
19
|
+
*
|
|
20
|
+
* Returns `null` when a placeholder can't be resolved in current context.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveDynamicNamePath(path: string | NamePath, fieldIndex?: unknown): NamePath | null;
|
|
23
|
+
export declare function namePathToPathKey(namePath: Array<string | number>): string;
|
|
24
|
+
export declare function pathKeyToNamePath(pathKey: string): NamePath;
|
|
25
|
+
export declare function buildAncestorKeys(namePath: NamePath): string[];
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { FlowModel } from '@nocobase/flow-engine';
|
|
10
|
+
import { DepCollector } from './deps';
|
|
11
|
+
import type { FormAssignRuleItem, FormValueWriteMeta, NamePath, Patch, SetOptions, ValueSource } from './types';
|
|
12
|
+
type ObservableBinding = {
|
|
13
|
+
source: ValueSource;
|
|
14
|
+
dispose: () => void;
|
|
15
|
+
};
|
|
16
|
+
export type RuleEngineOptions = {
|
|
17
|
+
getBlockModelUid: () => string;
|
|
18
|
+
getActionName: () => string | undefined;
|
|
19
|
+
getBlockContext: () => any;
|
|
20
|
+
getEngine: () => any;
|
|
21
|
+
getEngineModel: (uid: string) => FlowModel | null;
|
|
22
|
+
isDisposed: () => boolean;
|
|
23
|
+
valuesMirror: any;
|
|
24
|
+
changeTick: {
|
|
25
|
+
value: number;
|
|
26
|
+
};
|
|
27
|
+
getWriteSeq: () => number;
|
|
28
|
+
txWriteCounts: Map<string, Map<string, number>>;
|
|
29
|
+
createTrackingFormValues: (collector: DepCollector) => any;
|
|
30
|
+
tryResolveNamePath: (callerCtx: any, path: string | NamePath) => NamePath | null;
|
|
31
|
+
getFormValueAtPath: (namePath: NamePath) => any;
|
|
32
|
+
setFormValues: (callerCtx: any, patch: Patch, options?: SetOptions) => Promise<void>;
|
|
33
|
+
findExplicitHit: (pathKey: string) => string | null;
|
|
34
|
+
lastDefaultValueByPathKey: Map<string, any>;
|
|
35
|
+
lastWriteMetaByPathKey: Map<string, FormValueWriteMeta>;
|
|
36
|
+
observableBindings: Map<string, ObservableBinding>;
|
|
37
|
+
};
|
|
38
|
+
export declare class RuleEngine {
|
|
39
|
+
private readonly options;
|
|
40
|
+
private readonly rules;
|
|
41
|
+
private readonly lastRuleWriteByTargetKey;
|
|
42
|
+
private readonly assignTemplatesByTargetPath;
|
|
43
|
+
/** 当前表单中“已配置到 UI 的字段(FormItemModel)”的 targetPath 集合,用于避免对 row grid 重复注册规则 */
|
|
44
|
+
private readonly formItemTargetPaths;
|
|
45
|
+
/** targetPath -> updateAssociation(SubForm/SubTable 等) */
|
|
46
|
+
private readonly updateAssociationByTargetPath;
|
|
47
|
+
private readonly pendingRuleIds;
|
|
48
|
+
private readonly ruleDebounceUntilById;
|
|
49
|
+
private readonly ruleDebounceTimersById;
|
|
50
|
+
private readonly defaultRuleIdsByMasterUid;
|
|
51
|
+
private readonly defaultRuleMasterDisposers;
|
|
52
|
+
private runningRules;
|
|
53
|
+
private rulesEnabled;
|
|
54
|
+
private currentRuleTxId;
|
|
55
|
+
constructor(options: RuleEngineOptions);
|
|
56
|
+
private getAssignRuleBlockId;
|
|
57
|
+
private removeAssignRuleBlockInstance;
|
|
58
|
+
private removeRowGridAssignRuleInstances;
|
|
59
|
+
private hasAnyNonBlockAssignRuleInstance;
|
|
60
|
+
private ensureBlockAssignRuleInstancesForTargetPath;
|
|
61
|
+
private getCollectionFromContext;
|
|
62
|
+
private getRootCollection;
|
|
63
|
+
private shouldCreateBlockLevelAssignRule;
|
|
64
|
+
/**
|
|
65
|
+
* 对关联字段嵌套属性(如 user.name / user.profile.name):
|
|
66
|
+
* - 依赖应包含关联对象本身(user / user.profile),否则当关联对象从 null -> {id} 时,user.name 仍为 undefined,无法触发 rule re-run。
|
|
67
|
+
* - 写入前需校验关联对象已存在,避免隐式创建关联对象。
|
|
68
|
+
*/
|
|
69
|
+
private collectAssociationPrefixPaths;
|
|
70
|
+
private shouldSkipToManyAssociationWriteWithoutIndex;
|
|
71
|
+
private shouldSkipAssociationNestedWrite;
|
|
72
|
+
private getAssociationTargetKeyFields;
|
|
73
|
+
private resolveAssociationFieldByPrefixPath;
|
|
74
|
+
private isAssociationTargetKeyWrite;
|
|
75
|
+
private collectUpdateAssociationInitPatches;
|
|
76
|
+
dispose(): void;
|
|
77
|
+
enable(): void;
|
|
78
|
+
syncAssignRules(items: FormAssignRuleItem[]): void;
|
|
79
|
+
onModelMounted(model: FlowModel): void;
|
|
80
|
+
onModelUnmounted(model: FlowModel): void;
|
|
81
|
+
private isModelInThisForm;
|
|
82
|
+
private cacheUpdateAssociationForModel;
|
|
83
|
+
private getUpdateAssociationForTargetPath;
|
|
84
|
+
private getDefaultRuleId;
|
|
85
|
+
private getModelTargetNamePath;
|
|
86
|
+
private tryRegisterDefaultRuleInstance;
|
|
87
|
+
private getModelTargetPath;
|
|
88
|
+
private getAssignRuleInstanceId;
|
|
89
|
+
private getDeepestFieldIndexKey;
|
|
90
|
+
private getDeepestToManyAssociationKey;
|
|
91
|
+
private isRowGridModel;
|
|
92
|
+
private tryRegisterAssignRuleInstancesForModel;
|
|
93
|
+
private tryUnregisterAssignRuleInstancesForModel;
|
|
94
|
+
private tryUnregisterDefaultRuleInstance;
|
|
95
|
+
private bindMasterInitialValue;
|
|
96
|
+
private removeRule;
|
|
97
|
+
private scheduleRule;
|
|
98
|
+
private flushRules;
|
|
99
|
+
private runRule;
|
|
100
|
+
private isTzAwareTargetInterface;
|
|
101
|
+
private normalizeDateOnlyToStartOfDayIso;
|
|
102
|
+
private normalizeResolvedValueForTarget;
|
|
103
|
+
private isPrimitiveAssociationTargetValue;
|
|
104
|
+
private extractAssociationIdentity;
|
|
105
|
+
private isAssociationTargetSemanticallyEqual;
|
|
106
|
+
private resolveCollectionFieldByNamePath;
|
|
107
|
+
private normalizeResolvedValueForAssociationTarget;
|
|
108
|
+
private prepareRuleContext;
|
|
109
|
+
private shouldApplyDefaultRuleInCurrentState;
|
|
110
|
+
private shouldRunRule;
|
|
111
|
+
private createRuleCollectorAndContext;
|
|
112
|
+
private evaluateRuleCondition;
|
|
113
|
+
private resolveRuleValue;
|
|
114
|
+
private resolveRunJSValue;
|
|
115
|
+
private resolveTemplateValue;
|
|
116
|
+
private commitRuleDeps;
|
|
117
|
+
/**
|
|
118
|
+
* Check if default rule value can be applied.
|
|
119
|
+
* Default value can overwrite when:
|
|
120
|
+
* 1. Current value is empty
|
|
121
|
+
* 2. Current value equals the last default value (user hasn't modified it)
|
|
122
|
+
*/
|
|
123
|
+
private checkDefaultRuleCanApply;
|
|
124
|
+
private createRuleEvaluationContext;
|
|
125
|
+
private buildItemChainValue;
|
|
126
|
+
private getFieldIndexSignature;
|
|
127
|
+
private updateRuleDeps;
|
|
128
|
+
}
|
|
129
|
+
export {};
|