@nocobase/client 2.0.0-beta.17 → 2.0.0-beta.19

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.
@@ -30,62 +30,7 @@ export declare class CollectionBlockModel<T = DefaultStructure> extends DataBloc
30
30
  /**
31
31
  * 定义子菜单选项
32
32
  */
33
- static defineChildren(ctx: FlowModelContext): Promise<{
34
- key: string;
35
- label: any;
36
- searchable: boolean;
37
- searchPlaceholder: string;
38
- children: (ctx: any) => {
39
- key: string;
40
- label: any;
41
- useModel: string;
42
- createModelOptions: any;
43
- }[];
44
- }[] | {
45
- key: string;
46
- label: any;
47
- useModel: string;
48
- createModelOptions: any;
49
- }[] | ({
50
- key: string;
51
- label: string;
52
- useModel: string;
53
- createModelOptions: any;
54
- children?: undefined;
55
- } | {
56
- key: string;
57
- label: string;
58
- children: () => {
59
- key: string;
60
- label: string;
61
- useModel: string;
62
- createModelOptions: any;
63
- }[];
64
- useModel?: undefined;
65
- createModelOptions?: undefined;
66
- } | {
67
- key: string;
68
- label: string;
69
- children: {
70
- key: string;
71
- label: any;
72
- searchable: boolean;
73
- searchPlaceholder: string;
74
- children: (ctx: any) => {
75
- key: string;
76
- label: any;
77
- useModel: string;
78
- createModelOptions: any;
79
- }[];
80
- }[] | {
81
- key: string;
82
- label: any;
83
- useModel: string;
84
- createModelOptions: any;
85
- }[];
86
- useModel?: undefined;
87
- createModelOptions?: undefined;
88
- })[]>;
33
+ static defineChildren(ctx: FlowModelContext): Promise<any[]>;
89
34
  get dataSource(): DataSource;
90
35
  get collection(): Collection;
91
36
  get resource(): BaseRecordResource;
@@ -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
- submit(params?: any): Promise<void>;
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
- submit(params?: any): Promise<void>;
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
  }
@@ -22,6 +22,7 @@ type DefaultCollectionBlockModelStructure = {
22
22
  };
23
23
  type CustomFormBlockModelClassesEnum = {};
24
24
  export declare class FormBlockModel<T extends DefaultCollectionBlockModelStructure = DefaultCollectionBlockModelStructure> extends CollectionBlockModel<T> {
25
+ private userModifiedTopLevelFields;
25
26
  get form(): FormInstance<any>;
26
27
  _defaultCustomModelClasses: {
27
28
  FormActionGroupModel: string;
@@ -31,7 +32,22 @@ export declare class FormBlockModel<T extends DefaultCollectionBlockModelStructu
31
32
  customModelClasses: CustomFormBlockModelClassesEnum;
32
33
  renderConfigureActions(): React.JSX.Element;
33
34
  setFieldsValue(values: any): void;
34
- setFieldValue(fieldName: string, value: any): void;
35
+ setFieldValue(fieldName: any, value: any): void;
36
+ /**
37
+ * @internal
38
+ *
39
+ * 仅用于编辑表单刷新保护:只记录「用户交互」触发的改动(来自 antd Form.onValuesChange)。
40
+ * 程序化 setFieldValue/setFieldsValue 不会触发 onValuesChange(见 linkageRules 的手动 emit),因此不会污染该集合。
41
+ */
42
+ markUserModifiedFields(changedValues: any): void;
43
+ /**
44
+ * @internal
45
+ */
46
+ getUserModifiedFields(): Set<string>;
47
+ /**
48
+ * @internal
49
+ */
50
+ resetUserModifiedFields(): void;
35
51
  onDispatchEventStart(eventName: string, options?: any, inputArgs?: Record<string, any>): Promise<void>;
36
52
  getStepParams(flowKey: string, stepKey: string): any | undefined;
37
53
  getStepParams(flowKey: string): Record<string, any> | undefined;
@@ -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>;