@nocobase/client-v2 2.1.0-beta.38 → 2.1.0-beta.40

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.
Files changed (137) hide show
  1. package/es/Application.d.ts +6 -0
  2. package/es/collection-field-interface/CollectionFieldInterface.d.ts +51 -15
  3. package/es/collection-field-interface/CollectionFieldInterfaceManager.d.ts +82 -3
  4. package/es/collection-manager/field-configure.d.ts +80 -0
  5. package/es/collection-manager/field-validation.d.ts +43 -0
  6. package/es/collection-manager/filter-operators/index.d.ts +46 -0
  7. package/es/collection-manager/filter-operators/operators.d.ts +30 -0
  8. package/es/collection-manager/interfaces/checkbox.d.ts +1 -41
  9. package/es/collection-manager/interfaces/checkboxGroup.d.ts +12 -44
  10. package/es/collection-manager/interfaces/collection.d.ts +12 -51
  11. package/es/collection-manager/interfaces/color.d.ts +1 -16
  12. package/es/collection-manager/interfaces/createdAt.d.ts +1 -44
  13. package/es/collection-manager/interfaces/createdBy.d.ts +0 -4
  14. package/es/collection-manager/interfaces/dateOnly.d.ts +7 -44
  15. package/es/collection-manager/interfaces/datetime.d.ts +1 -44
  16. package/es/collection-manager/interfaces/datetimeNoTz.d.ts +1 -44
  17. package/es/collection-manager/interfaces/email.d.ts +1 -29
  18. package/es/collection-manager/interfaces/id.d.ts +1 -16
  19. package/es/collection-manager/interfaces/index.d.ts +2 -3
  20. package/es/collection-manager/interfaces/input.d.ts +1 -102
  21. package/es/collection-manager/interfaces/integer.d.ts +1 -95
  22. package/es/collection-manager/interfaces/json.d.ts +16 -7
  23. package/es/collection-manager/interfaces/m2m.d.ts +11 -19
  24. package/es/collection-manager/interfaces/m2o.d.ts +11 -19
  25. package/es/collection-manager/interfaces/markdown.d.ts +1 -63
  26. package/es/collection-manager/interfaces/multipleSelect.d.ts +12 -44
  27. package/es/collection-manager/interfaces/nanoid.d.ts +1 -34
  28. package/es/collection-manager/interfaces/number.d.ts +1 -87
  29. package/es/collection-manager/interfaces/o2m.d.ts +12 -24
  30. package/es/collection-manager/interfaces/obo.d.ts +207 -0
  31. package/es/collection-manager/interfaces/oho.d.ts +207 -0
  32. package/es/collection-manager/interfaces/password.d.ts +1 -56
  33. package/es/collection-manager/interfaces/percent.d.ts +1 -84
  34. package/es/collection-manager/interfaces/phone.d.ts +1 -25
  35. package/es/collection-manager/interfaces/properties/index.d.ts +0 -28
  36. package/es/collection-manager/interfaces/radioGroup.d.ts +1 -29
  37. package/es/collection-manager/interfaces/richText.d.ts +1 -63
  38. package/es/collection-manager/interfaces/select.d.ts +12 -44
  39. package/es/collection-manager/interfaces/snowflake-id.d.ts +1 -34
  40. package/es/collection-manager/interfaces/tableoid.d.ts +1 -10
  41. package/es/collection-manager/interfaces/textarea.d.ts +1 -51
  42. package/es/collection-manager/interfaces/time.d.ts +1 -16
  43. package/es/collection-manager/interfaces/types.d.ts +3 -12
  44. package/es/collection-manager/interfaces/unixTimestamp.d.ts +1 -44
  45. package/es/collection-manager/interfaces/updatedAt.d.ts +1 -44
  46. package/es/collection-manager/interfaces/updatedBy.d.ts +0 -4
  47. package/es/collection-manager/interfaces/url.d.ts +1 -20
  48. package/es/collection-manager/interfaces/uuid.d.ts +1 -34
  49. package/es/collection-manager/template-fields.d.ts +53 -0
  50. package/es/components/form/VariableInput.d.ts +53 -2
  51. package/es/components/form/filter/CollectionFilter.d.ts +9 -1
  52. package/es/components/form/filter/CollectionFilterItem.d.ts +10 -2
  53. package/es/flow/components/filter/useFilterOptions.d.ts +13 -1
  54. package/es/flow/models/blocks/assign-form/assignFieldValuesFlow.d.ts +84 -0
  55. package/es/flow/models/blocks/assign-form/index.d.ts +1 -0
  56. package/es/flow/models/blocks/form/FormActionModel.d.ts +9 -2
  57. package/es/index.d.ts +4 -0
  58. package/es/index.mjs +105 -142
  59. package/lib/index.js +106 -143
  60. package/package.json +7 -7
  61. package/src/Application.tsx +24 -0
  62. package/src/collection-field-interface/CollectionFieldInterface.ts +71 -77
  63. package/src/collection-field-interface/CollectionFieldInterfaceManager.ts +201 -4
  64. package/src/collection-manager/field-configure.ts +548 -0
  65. package/src/collection-manager/field-validation.ts +195 -0
  66. package/src/collection-manager/filter-operators/index.ts +176 -0
  67. package/src/collection-manager/{interfaces/properties → filter-operators}/operators.ts +24 -13
  68. package/src/collection-manager/interfaces/checkbox.ts +2 -9
  69. package/src/collection-manager/interfaces/checkboxGroup.ts +2 -10
  70. package/src/collection-manager/interfaces/collection.ts +2 -15
  71. package/src/collection-manager/interfaces/color.ts +2 -2
  72. package/src/collection-manager/interfaces/createdAt.ts +2 -2
  73. package/src/collection-manager/interfaces/createdBy.ts +1 -12
  74. package/src/collection-manager/interfaces/dateOnly.ts +8 -2
  75. package/src/collection-manager/interfaces/datetime.ts +2 -2
  76. package/src/collection-manager/interfaces/datetimeNoTz.ts +2 -2
  77. package/src/collection-manager/interfaces/email.ts +2 -9
  78. package/src/collection-manager/interfaces/id.ts +1 -2
  79. package/src/collection-manager/interfaces/index.ts +2 -3
  80. package/src/collection-manager/interfaces/input.ts +2 -133
  81. package/src/collection-manager/interfaces/integer.ts +2 -71
  82. package/src/collection-manager/interfaces/json.tsx +17 -11
  83. package/src/collection-manager/interfaces/m2m.tsx +0 -21
  84. package/src/collection-manager/interfaces/m2o.tsx +0 -22
  85. package/src/collection-manager/interfaces/markdown.ts +2 -51
  86. package/src/collection-manager/interfaces/multipleSelect.ts +2 -14
  87. package/src/collection-manager/interfaces/nanoid.ts +2 -2
  88. package/src/collection-manager/interfaces/number.ts +2 -85
  89. package/src/collection-manager/interfaces/o2m.tsx +1 -22
  90. package/src/collection-manager/interfaces/obo.tsx +145 -0
  91. package/src/collection-manager/interfaces/oho.tsx +145 -0
  92. package/src/collection-manager/interfaces/password.ts +2 -44
  93. package/src/collection-manager/interfaces/percent.ts +2 -74
  94. package/src/collection-manager/interfaces/phone.ts +2 -2
  95. package/src/collection-manager/interfaces/properties/index.ts +0 -133
  96. package/src/collection-manager/interfaces/radioGroup.ts +2 -2
  97. package/src/collection-manager/interfaces/richText.ts +2 -51
  98. package/src/collection-manager/interfaces/select.ts +2 -14
  99. package/src/collection-manager/interfaces/snowflake-id.ts +2 -2
  100. package/src/collection-manager/interfaces/tableoid.ts +1 -2
  101. package/src/collection-manager/interfaces/textarea.ts +2 -51
  102. package/src/collection-manager/interfaces/time.ts +2 -2
  103. package/src/collection-manager/interfaces/types.ts +4 -12
  104. package/src/collection-manager/interfaces/unixTimestamp.tsx +2 -2
  105. package/src/collection-manager/interfaces/updatedAt.ts +2 -2
  106. package/src/collection-manager/interfaces/updatedBy.ts +1 -12
  107. package/src/collection-manager/interfaces/url.ts +2 -4
  108. package/src/collection-manager/interfaces/uuid.ts +2 -2
  109. package/src/collection-manager/template-fields.ts +109 -0
  110. package/src/components/README.md +1 -0
  111. package/src/components/README.zh-CN.md +1 -0
  112. package/src/components/form/VariableInput.tsx +101 -28
  113. package/src/components/form/__tests__/VariableInput.test.ts +85 -0
  114. package/src/components/form/filter/CollectionFilter.tsx +11 -1
  115. package/src/components/form/filter/CollectionFilterItem.tsx +12 -4
  116. package/src/components/form/filter/__tests__/CollectionFilterItem.test.tsx +42 -0
  117. package/src/components/form/filter/useFilterActionProps.ts +7 -4
  118. package/src/flow/components/filter/useFilterOptions.ts +27 -5
  119. package/src/flow/models/actions/UpdateRecordActionModel.tsx +14 -95
  120. package/src/flow/models/actions/UpdateRecordActionUtils.ts +4 -7
  121. package/src/flow/models/actions/__tests__/AssignFormRefill.test.ts +26 -1
  122. package/src/flow/models/blocks/assign-form/AssignFormItemModel.tsx +63 -2
  123. package/src/flow/models/blocks/assign-form/assignFieldValuesFlow.tsx +206 -0
  124. package/src/flow/models/blocks/assign-form/index.ts +1 -0
  125. package/src/flow/models/blocks/form/FormActionModel.tsx +30 -3
  126. package/src/flow/models/blocks/form/__tests__/submitHandler.test.ts +71 -0
  127. package/src/flow/models/blocks/form/submitHandler.ts +8 -1
  128. package/src/flow/models/fields/CollectionSelectorFieldModel.tsx +8 -2
  129. package/src/flow/models/fields/DisplayEnumFieldModel.tsx +8 -2
  130. package/src/index.ts +4 -0
  131. package/es/collection-manager/interfaces/linkTo.d.ts +0 -90
  132. package/es/collection-manager/interfaces/o2o.d.ts +0 -621
  133. package/es/collection-manager/interfaces/properties/operators.d.ts +0 -294
  134. package/es/collection-manager/interfaces/subTable.d.ts +0 -172
  135. package/src/collection-manager/interfaces/linkTo.ts +0 -120
  136. package/src/collection-manager/interfaces/o2o.tsx +0 -561
  137. package/src/collection-manager/interfaces/subTable.ts +0 -218
@@ -69,15 +69,6 @@ export declare class UUIDFieldInterface extends CollectionFieldInterface {
69
69
  'x-decorator': string;
70
70
  'x-component': string;
71
71
  'x-disabled': string;
72
- 'x-reactions': {
73
- dependencies: string[];
74
- when: string;
75
- fulfill: {
76
- state: {
77
- value: boolean;
78
- };
79
- };
80
- }[];
81
72
  };
82
73
  unique: {
83
74
  type: string;
@@ -85,36 +76,12 @@ export declare class UUIDFieldInterface extends CollectionFieldInterface {
85
76
  'x-decorator': string;
86
77
  'x-component': string;
87
78
  'x-disabled': string;
88
- 'x-reactions': {
89
- dependencies: string[];
90
- when: string;
91
- fulfill: {
92
- state: {
93
- value: boolean;
94
- };
95
- };
96
- }[];
97
79
  };
98
80
  };
99
81
  };
100
82
  };
101
83
  filterable: {
102
- operators: ({
103
- label: string;
104
- value: string;
105
- selected: boolean;
106
- noValue?: undefined;
107
- } | {
108
- label: string;
109
- value: string;
110
- selected?: undefined;
111
- noValue?: undefined;
112
- } | {
113
- label: string;
114
- value: string;
115
- noValue: boolean;
116
- selected?: undefined;
117
- })[];
84
+ operators: string;
118
85
  };
119
86
  titleUsable: boolean;
120
87
  }
@@ -0,0 +1,53 @@
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 { ReactNode } from 'react';
10
+ export interface CollectionTemplateFieldOption {
11
+ label: ReactNode;
12
+ value: string | number | boolean;
13
+ [key: string]: unknown;
14
+ }
15
+ export interface CollectionTemplateField {
16
+ name: string;
17
+ interface?: string;
18
+ type?: string;
19
+ title?: ReactNode;
20
+ options?: CollectionTemplateFieldOption[];
21
+ component?: string;
22
+ componentProps?: Record<string, unknown>;
23
+ uiSchema?: Record<string, unknown>;
24
+ [key: string]: unknown;
25
+ }
26
+ interface FieldInterfaceConfigureLike {
27
+ default?: {
28
+ uiSchema?: Record<string, unknown>;
29
+ [key: string]: unknown;
30
+ };
31
+ }
32
+ interface FieldInterfaceLike {
33
+ default?: {
34
+ uiSchema?: Record<string, unknown>;
35
+ [key: string]: unknown;
36
+ };
37
+ }
38
+ export interface CollectionTemplateFieldNormalizeManager {
39
+ getFieldInterfaceConfigure?: (name: string, collectionInfo?: Record<string, unknown>) => FieldInterfaceConfigureLike | undefined;
40
+ getFieldInterface?: (name: string) => FieldInterfaceLike | undefined;
41
+ }
42
+ export interface NormalizeCollectionTemplateFieldOptions {
43
+ collectionInfo?: Record<string, unknown>;
44
+ }
45
+ export declare function normalizeCollectionTemplateField(field: CollectionTemplateField, manager?: CollectionTemplateFieldNormalizeManager, options?: NormalizeCollectionTemplateFieldOptions): {
46
+ [key: string]: unknown;
47
+ uiSchema?: Record<string, unknown>;
48
+ } & CollectionTemplateField;
49
+ export declare function normalizeCollectionTemplateFields(fields?: CollectionTemplateField[], manager?: CollectionTemplateFieldNormalizeManager, options?: NormalizeCollectionTemplateFieldOptions): ({
50
+ [key: string]: unknown;
51
+ uiSchema?: Record<string, unknown>;
52
+ } & CollectionTemplateField)[];
53
+ export {};
@@ -8,8 +8,45 @@
8
8
  */
9
9
  import { type MetaTreeNode, type VariableHybridInputConverters } from '@nocobase/flow-engine';
10
10
  import React from 'react';
11
- export declare function parseVariablePath(value?: string): string[] | undefined;
12
- export declare function formatVariablePath(meta?: MetaTreeNode): string | undefined;
11
+ /**
12
+ * The flow-engine defaults emit `{{ ctx.$X.Y }}` and only parse the same
13
+ * shape back into a path — but NocoBase server templates (and v1 stored
14
+ * values) use the bare `{{$X.Y}}` form without the `ctx.` prefix. These
15
+ * converters keep the picker's output stable against v1 and let already-
16
+ * stored values round-trip to a labelled pill instead of falling back to a
17
+ * raw `{{…}}` literal.
18
+ */
19
+ /**
20
+ * Variable delimiters: opening + closing tokens. Default `['{{', '}}']`
21
+ * matches NocoBase server template convention (Handlebars HTML-escaped
22
+ * output). Pass `['{{{', '}}}']` to switch to Handlebars' raw/unescaped
23
+ * form — required for fields whose content is rendered as HTML (e.g.
24
+ * in-app message body) so the variable expansion bypasses HTML escaping.
25
+ *
26
+ * Restrict to literal-token pairs, since the regex builder escapes them
27
+ * verbatim.
28
+ */
29
+ export type VariableDelimiters = readonly [string, string];
30
+ /**
31
+ * Factory: returns a `parseValueToPath` bound to the given delimiters.
32
+ * Anchored (`^…$`) — only treats the whole input as a single variable
33
+ * reference, matching the v1 single-line picker behaviour.
34
+ */
35
+ export declare function makeParseVariablePath(delimiters?: VariableDelimiters): (value?: string) => string[] | undefined;
36
+ /**
37
+ * Factory: returns a `formatPathToValue` bound to the given delimiters.
38
+ * No inner spaces — matches the v1 storage shape exactly so round-trips
39
+ * through the API stay byte-stable.
40
+ */
41
+ export declare function makeFormatVariablePath(delimiters?: VariableDelimiters): (meta?: MetaTreeNode) => string | undefined;
42
+ /**
43
+ * Factory: returns a global regex matching every occurrence of the
44
+ * variable token within a longer string. Used by `VariableHybridInput`
45
+ * to render embedded variables as pills.
46
+ */
47
+ export declare function makeVariableRegExp(delimiters?: VariableDelimiters): RegExp;
48
+ export declare const parseVariablePath: (value?: string) => string[] | undefined;
49
+ export declare const formatVariablePath: (meta?: MetaTreeNode) => string | undefined;
13
50
  /**
14
51
  * Resolve the meta tree the variable picker should expose. Filters the global
15
52
  * meta tree by `namespaces` (top-level property names like `'$env'`,
@@ -48,8 +85,22 @@ export interface VariableInputProps {
48
85
  * Override the converters used by the underlying `VariableHybridInput`.
49
86
  * Mostly useful when the caller wants to constrain `formatPathToValue` to a
50
87
  * specific namespace (see `EnvVariableInput` for that pattern).
88
+ *
89
+ * Takes precedence over `delimiters` when both are set on the same field
90
+ * (an explicit converter wins over the delimiter-derived one).
51
91
  */
52
92
  converters?: VariableHybridInputConverters;
93
+ /**
94
+ * Token pair wrapping variable references in the stored string. Defaults
95
+ * to `['{{', '}}']` — the standard NocoBase server-template form,
96
+ * HTML-escaped by Handlebars. Pass `['{{{', '}}}']` for fields rendered
97
+ * as HTML where escaping would corrupt the variable value (e.g. the
98
+ * in-app message body).
99
+ *
100
+ * Ignored when `converters` is also supplied — caller-provided converters
101
+ * win.
102
+ */
103
+ delimiters?: VariableDelimiters;
53
104
  className?: string;
54
105
  style?: React.CSSProperties;
55
106
  }
@@ -19,7 +19,15 @@ export interface CollectionFilterProps {
19
19
  t?: (key: string, options?: Record<string, any>) => string;
20
20
  /** Whitelist of root-level field names to expose. */
21
21
  filterableFieldNames?: string[];
22
- /** Bypass the `filterableFieldNames` whitelist. */
22
+ /**
23
+ * Blacklist of root-level field names to drop. Mirrors v1's `nonfilterable: [...]` on `Filter.Action`. When both `filterableFieldNames` and this prop are supplied, both apply (final = whitelist ∩ ¬blacklist).
24
+ */
25
+ nonfilterableFieldNames?: string[];
26
+ /**
27
+ * Bypass the `filterableFieldNames` whitelist.
28
+ *
29
+ * Legacy escape hatch — prefer adjusting `filterableFieldNames` / `nonfilterableFieldNames` instead.
30
+ */
23
31
  noIgnore?: boolean;
24
32
  /** Override the trigger button's label. Defaults to `t('Filter')`, or the v1-style `t('{{count}} filter items', { count })` when conditions are present. */
25
33
  buttonText?: React.ReactNode;
@@ -21,7 +21,15 @@ export interface CollectionFilterItemProps {
21
21
  collection: Collection;
22
22
  /** Whitelist of field names to expose; empty/undefined means all filterable fields. */
23
23
  filterableFieldNames?: string[];
24
- /** Bypass the `filterableFieldNames` whitelist (matches the legacy FilterItem `noIgnore`). */
24
+ /**
25
+ * Blacklist of field names to drop. Mirrors v1's `nonfilterable: [...]` on `Filter.Action`. When both whitelist and blacklist are supplied, both apply (final = whitelist ∩ ¬blacklist).
26
+ */
27
+ nonfilterableFieldNames?: string[];
28
+ /**
29
+ * Bypass the `filterableFieldNames` whitelist (matches the legacy FilterItem `noIgnore`).
30
+ *
31
+ * Legacy escape hatch — prefer adjusting `filterableFieldNames` / `nonfilterableFieldNames` instead.
32
+ */
25
33
  noIgnore?: boolean;
26
34
  /** Translator; defaults to identity so callers can omit it. */
27
35
  t?: (key: string) => string;
@@ -35,7 +43,7 @@ export declare const CollectionFilterItem: FC<CollectionFilterItemProps>;
35
43
  /**
36
44
  * Convenience factory returning a `FilterContainer`-compatible `FilterItem` component bound to a specific collection. Avoids creating an inline closure on every parent render, which would otherwise reset any focused inner antd control.
37
45
  */
38
- export declare function createCollectionFilterItem(collection: Collection, bound?: Pick<CollectionFilterItemProps, 'filterableFieldNames' | 'noIgnore' | 't'>): React.FC<{
46
+ export declare function createCollectionFilterItem(collection: Collection, bound?: Pick<CollectionFilterItemProps, 'filterableFieldNames' | 'nonfilterableFieldNames' | 'noIgnore' | 't'>): React.FC<{
39
47
  value: CollectionFilterItemValue;
40
48
  }>;
41
49
  export default CollectionFilterItem;
@@ -36,10 +36,22 @@ export type FilterOption = {
36
36
  };
37
37
  export interface UseFilterOptionsArgs {
38
38
  /**
39
+ * **Preferred way to restrict fields**, alongside `nonfilterableFieldNames`.
40
+ *
39
41
  * Whitelist of root-level field names to expose. Empty/undefined means "all filterable fields". The whitelist applies only at depth 1 — nested fields under an allowed association field are always included, matching the legacy v1 `Filter.Action` behaviour.
40
42
  */
41
43
  filterableFieldNames?: string[];
42
- /** Bypass the `filterableFieldNames` whitelist (mirrors v1 `noIgnore`). */
44
+ /**
45
+ * **Preferred way to restrict fields**, alongside `filterableFieldNames`.
46
+ *
47
+ * Blacklist of root-level field names to drop. Mirrors v1's `nonfilterable: [...]` schema prop on `Filter.Action`. Applies at depth 1 only, same as the whitelist. When both `filterableFieldNames` and `nonfilterableFieldNames` are provided, both apply: the final field set is `(whitelist or all) minus blacklist`.
48
+ */
49
+ nonfilterableFieldNames?: string[];
50
+ /**
51
+ * Bypass the `filterableFieldNames` whitelist (mirrors v1 `noIgnore`).
52
+ *
53
+ * Legacy escape hatch from v1 schemas — prefer adjusting `filterableFieldNames` / `nonfilterableFieldNames` instead. Kept only for parity with existing v1 schemas that already set `noIgnore`.
54
+ */
43
55
  noIgnore?: boolean;
44
56
  /** Translator used for field/operator labels. Defaults to identity. */
45
57
  t?: (key: string) => string;
@@ -0,0 +1,84 @@
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 FlowModelContext } from '@nocobase/flow-engine';
10
+ import React from 'react';
11
+ import { AssignFormModel } from './AssignFormModel';
12
+ export declare const ASSIGN_FIELD_VALUES_STEP_KEY = "assignFieldValues";
13
+ type AssignedValues = Record<string, unknown>;
14
+ type AssignFieldValuesCollection = {
15
+ dataSourceKey?: string;
16
+ name?: string;
17
+ };
18
+ type AssignFieldValuesContext = FlowModelContext & {
19
+ collection?: AssignFieldValuesCollection;
20
+ flowSettingsEnabled?: boolean;
21
+ };
22
+ type AssignFieldValuesModel = {
23
+ uid: string;
24
+ assignFormUid?: string;
25
+ context?: AssignFieldValuesContext;
26
+ getStepParams?: (flowKey: string, stepKey: string) => {
27
+ assignedValues?: AssignedValues;
28
+ } | undefined;
29
+ setStepParams?: (flowKey: string, stepKey: string, params: {
30
+ assignedValues: AssignedValues;
31
+ }) => void;
32
+ };
33
+ type AssignFieldValuesStepOptions = {
34
+ settingsFlowKey: string;
35
+ title?: string;
36
+ tipComponent?: React.ComponentType;
37
+ validateBeforeSave?: boolean;
38
+ clearRecordContext?: boolean;
39
+ };
40
+ export declare function createAssignFormSubModelOptions(ctx: AssignFieldValuesContext): {
41
+ async: boolean;
42
+ use: string;
43
+ stepParams: {
44
+ resourceSettings: {
45
+ init: {
46
+ dataSourceKey: string;
47
+ collectionName: string;
48
+ };
49
+ };
50
+ };
51
+ };
52
+ export declare function getAssignFieldValuesDefaultParams(ctx: {
53
+ model: Pick<AssignFieldValuesModel, 'getStepParams'>;
54
+ }, settingsFlowKey: string): {
55
+ assignedValues: AssignedValues;
56
+ };
57
+ export declare function resolveAssignFieldValues(ctx: {
58
+ message?: {
59
+ error?: (message: string) => void;
60
+ };
61
+ t?: (message: string) => string;
62
+ }, rawAssignedValues: unknown, logName?: string): Promise<AssignedValues | null>;
63
+ export declare function mergeAssignFieldValues<T extends Record<string, unknown>>(values: T, assignedValues?: AssignedValues | null): T;
64
+ export declare function createAssignFieldValuesStep(options: AssignFieldValuesStepOptions): {
65
+ title: string;
66
+ uiSchema(): {
67
+ tip: {
68
+ 'x-decorator': string;
69
+ 'x-component': React.ComponentType<{}>;
70
+ };
71
+ editor: {
72
+ 'x-decorator': string;
73
+ 'x-component': () => React.JSX.Element;
74
+ };
75
+ };
76
+ beforeParamsSave(ctx: {
77
+ model: AssignFieldValuesModel;
78
+ engine: {
79
+ getModel?: (uid: string, fromRoot?: boolean) => AssignFormModel | undefined;
80
+ };
81
+ }): Promise<void>;
82
+ handler(): void;
83
+ };
84
+ export {};
@@ -9,3 +9,4 @@
9
9
  export * from './AssignFormModel';
10
10
  export * from './AssignFormGridModel';
11
11
  export * from './AssignFormItemModel';
12
+ export * from './assignFieldValuesFlow';
@@ -6,12 +6,19 @@
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
+ import { DefaultStructure } from '@nocobase/flow-engine';
9
10
  import { ButtonProps } from 'antd';
10
11
  import { AxiosRequestConfig } from 'axios';
11
12
  import { ActionModel } from '../../base/ActionModelCore';
12
- export declare class FormActionModel extends ActionModel {
13
+ import { AssignFormModel } from '../assign-form/AssignFormModel';
14
+ export declare class FormActionModel<T extends DefaultStructure = DefaultStructure> extends ActionModel<T> {
13
15
  }
14
- export declare class FormSubmitActionModel extends FormActionModel {
16
+ export declare class FormSubmitActionModel extends FormActionModel<{
17
+ subModels: {
18
+ assignForm: AssignFormModel;
19
+ };
20
+ }> {
21
+ assignFormUid?: string;
15
22
  defaultProps: ButtonProps;
16
23
  /**
17
24
  * 简化设置保存请求配置的方式
package/es/index.d.ts CHANGED
@@ -30,7 +30,11 @@ export { default as languageCodes } from './locale/languageCodes';
30
30
  export * from './nocobase-buildin-plugin';
31
31
  export * from './collection-field-interface/CollectionFieldInterface';
32
32
  export * from './collection-field-interface/CollectionFieldInterfaceManager';
33
+ export * from './collection-manager/field-configure';
34
+ export * from './collection-manager/field-validation';
35
+ export * from './collection-manager/filter-operators';
33
36
  export * from './collection-manager/interfaces';
37
+ export * from './collection-manager/template-fields';
34
38
  export * from './data-source';
35
39
  export * from './flow';
36
40
  export { DEFAULT_DATA_SOURCE_KEY, isTitleField, isTitleFieldInterface } from './flow-compat';