@nocobase/client 0.9.2-alpha.3 → 0.9.3-alpha.1

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 (237) hide show
  1. package/es/acl/Configuration/schemas/useRoleResourceValues.d.ts +1 -14
  2. package/es/api-client/hooks/useRequest.d.ts +1 -14
  3. package/es/api-client/hooks/useRequest.js +48 -53
  4. package/es/block-provider/DetailsBlockProvider.js +13 -1
  5. package/es/block-provider/FormBlockProvider.js +30 -13
  6. package/es/block-provider/hooks/index.d.ts +11 -1
  7. package/es/block-provider/hooks/index.js +527 -301
  8. package/es/collection-manager/Configuration/CollectionFields.js +1 -2
  9. package/es/collection-manager/Configuration/EditCollectionAction.d.ts +1 -14
  10. package/es/collection-manager/action-hooks.d.ts +4 -43
  11. package/es/collection-manager/action-hooks.js +18 -7
  12. package/es/collection-manager/interfaces/createdBy.js +1 -1
  13. package/es/collection-manager/interfaces/linkTo.js +5 -40
  14. package/es/collection-manager/interfaces/m2m.js +6 -39
  15. package/es/collection-manager/interfaces/m2o.js +6 -39
  16. package/es/collection-manager/interfaces/o2m.js +6 -69
  17. package/es/collection-manager/interfaces/o2o.js +31 -122
  18. package/es/collection-manager/interfaces/types.d.ts +2 -0
  19. package/es/collection-manager/interfaces/updatedBy.js +1 -1
  20. package/es/collection-manager/sub-table.d.ts +1 -14
  21. package/es/collection-manager/templates/tree.js +2 -2
  22. package/es/filter-provider/FilterProvider.js +3 -1
  23. package/es/locale/en_US.d.ts +4 -1
  24. package/es/locale/en_US.js +6 -3
  25. package/es/locale/ja_JP.d.ts +4 -1
  26. package/es/locale/ja_JP.js +4 -1
  27. package/es/locale/pt_BR.d.ts +1 -1
  28. package/es/locale/pt_BR.js +1 -1
  29. package/es/locale/zh_CN.d.ts +5 -1
  30. package/es/locale/zh_CN.js +5 -1
  31. package/es/schema-component/antd/action/Action.Designer.js +4 -5
  32. package/es/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -0
  33. package/es/schema-component/antd/association-field/AssociationFieldProvider.js +19 -0
  34. package/es/schema-component/antd/association-field/AssociationSelect.d.ts +14 -0
  35. package/es/schema-component/antd/association-field/AssociationSelect.js +118 -0
  36. package/es/schema-component/antd/association-field/Editable.d.ts +2 -0
  37. package/es/schema-component/antd/association-field/Editable.js +88 -0
  38. package/es/schema-component/antd/association-field/FileManager.d.ts +4 -0
  39. package/es/schema-component/antd/association-field/FileManager.js +243 -0
  40. package/es/schema-component/antd/association-field/InternalNester.d.ts +1 -0
  41. package/es/schema-component/antd/association-field/InternalNester.js +28 -0
  42. package/es/schema-component/antd/association-field/InternalPicker.d.ts +2 -0
  43. package/es/schema-component/antd/association-field/InternalPicker.js +267 -0
  44. package/es/schema-component/antd/association-field/InternalSubTable.d.ts +1 -0
  45. package/es/schema-component/antd/association-field/InternalSubTable.js +28 -0
  46. package/es/schema-component/antd/association-field/InternalViewer.d.ts +2 -0
  47. package/es/schema-component/antd/association-field/InternalViewer.js +115 -0
  48. package/es/schema-component/antd/association-field/Nester.d.ts +1 -0
  49. package/es/schema-component/antd/association-field/Nester.js +80 -0
  50. package/es/schema-component/antd/association-field/ReadPretty.d.ts +2 -0
  51. package/es/schema-component/antd/association-field/ReadPretty.js +38 -0
  52. package/es/schema-component/antd/association-field/SubTable.d.ts +1 -0
  53. package/es/schema-component/antd/association-field/SubTable.js +25 -0
  54. package/es/schema-component/antd/association-field/context.d.ts +7 -0
  55. package/es/schema-component/antd/association-field/context.js +2 -0
  56. package/es/schema-component/antd/association-field/hooks.d.ts +8 -0
  57. package/es/schema-component/antd/association-field/hooks.js +96 -0
  58. package/es/schema-component/antd/association-field/index.d.ts +1 -0
  59. package/es/schema-component/antd/association-field/index.js +14 -0
  60. package/es/schema-component/antd/association-field/schema.d.ts +142 -0
  61. package/es/schema-component/antd/association-field/schema.js +141 -0
  62. package/es/schema-component/antd/association-field/util.d.ts +8 -0
  63. package/es/schema-component/antd/association-field/util.js +84 -0
  64. package/es/schema-component/antd/association-filter/AssociationFilter.FilterBlockInitializer.js +2 -2
  65. package/es/schema-component/antd/association-select/AssociationSelect.js +11 -2
  66. package/es/schema-component/antd/expand-action/Expand.Action.Design.d.ts +1 -0
  67. package/es/schema-component/antd/expand-action/Expand.Action.Design.js +112 -0
  68. package/es/schema-component/antd/expand-action/Expand.Action.d.ts +1 -0
  69. package/es/schema-component/antd/expand-action/Expand.Action.js +40 -0
  70. package/es/schema-component/antd/expand-action/index.d.ts +1 -0
  71. package/es/schema-component/antd/expand-action/index.js +5 -0
  72. package/es/schema-component/antd/filter/Filter.Action.Designer.js +10 -12
  73. package/es/schema-component/antd/filter/FilterItem.js +1 -1
  74. package/es/schema-component/antd/filter/useOperators.d.ts +1 -1
  75. package/es/schema-component/antd/form-item/FormItem.d.ts +2 -1
  76. package/es/schema-component/antd/form-item/FormItem.js +206 -58
  77. package/es/schema-component/antd/form-item/SchemaSettingOptions.js +36 -58
  78. package/es/schema-component/antd/form-v2/utils.js +6 -4
  79. package/es/schema-component/antd/gantt/components/gantt/gantt.js +3 -3
  80. package/es/schema-component/antd/gantt/components/other/tooltip.js +1 -1
  81. package/es/schema-component/antd/index.d.ts +3 -1
  82. package/es/schema-component/antd/index.js +3 -1
  83. package/es/schema-component/antd/menu/Menu.js +6 -3
  84. package/es/schema-component/antd/record-picker/InputRecordPicker.d.ts +1 -0
  85. package/es/schema-component/antd/record-picker/InputRecordPicker.js +40 -17
  86. package/es/schema-component/antd/remote-select/RemoteSelect.js +16 -18
  87. package/es/schema-component/antd/table-v2/Table.Column.Designer.js +18 -9
  88. package/es/schema-component/antd/table-v2/Table.Index.d.ts +1 -0
  89. package/es/schema-component/antd/table-v2/Table.Index.js +6 -0
  90. package/es/schema-component/antd/table-v2/Table.js +9 -5
  91. package/es/schema-component/antd/table-v2/index.js +3 -1
  92. package/es/schema-component/antd/table-v2/utils.js +1 -1
  93. package/es/schema-component/antd/variable/Input.js +15 -16
  94. package/es/schema-component/antd/variable/TextArea.js +2 -5
  95. package/es/schema-component/antd/variable/Variable.d.ts +2 -0
  96. package/es/schema-component/antd/variable/Variable.js +5 -2
  97. package/es/schema-component/common/dnd-context/index.js +3 -2
  98. package/es/schema-component/common/sortable-item/SortableItem.js +4 -1
  99. package/es/schema-component/common/utils/uitls.js +1 -1
  100. package/es/schema-component/hooks/index.d.ts +1 -0
  101. package/es/schema-component/hooks/index.js +2 -1
  102. package/es/schema-component/hooks/useFieldModeOptions.d.ts +4 -0
  103. package/es/schema-component/hooks/useFieldModeOptions.js +105 -0
  104. package/es/schema-initializer/components/CreateRecordAction.d.ts +1 -1
  105. package/es/schema-initializer/components/CreateRecordAction.js +4 -3
  106. package/es/schema-initializer/items/ExpandActionInitializer.d.ts +0 -1
  107. package/es/schema-initializer/items/ExpandActionInitializer.js +9 -34
  108. package/es/schema-initializer/items/SelectActionInitializer.d.ts +1 -0
  109. package/es/schema-initializer/items/SelectActionInitializer.js +65 -0
  110. package/es/schema-initializer/items/index.d.ts +1 -0
  111. package/es/schema-initializer/items/index.js +2 -1
  112. package/es/schema-initializer/utils.js +57 -43
  113. package/es/schema-settings/LinkageRules/FilterDynamicComponent.js +1 -1
  114. package/es/schema-settings/LinkageRules/Variables.d.ts +1 -1
  115. package/es/schema-settings/LinkageRules/Variables.js +7 -4
  116. package/es/schema-settings/SchemaSettings.js +3 -3
  117. package/es/schema-settings/VariableInput/VariableInput.d.ts +3 -2
  118. package/es/schema-settings/VariableInput/VariableInput.js +3 -1
  119. package/lib/acl/Configuration/schemas/useRoleResourceValues.d.ts +1 -14
  120. package/lib/api-client/hooks/useRequest.d.ts +1 -14
  121. package/lib/api-client/hooks/useRequest.js +48 -53
  122. package/lib/block-provider/DetailsBlockProvider.js +13 -1
  123. package/lib/block-provider/FormBlockProvider.js +31 -15
  124. package/lib/block-provider/hooks/index.d.ts +11 -1
  125. package/lib/block-provider/hooks/index.js +537 -308
  126. package/lib/collection-manager/Configuration/CollectionFields.js +1 -2
  127. package/lib/collection-manager/Configuration/EditCollectionAction.d.ts +1 -14
  128. package/lib/collection-manager/action-hooks.d.ts +4 -43
  129. package/lib/collection-manager/action-hooks.js +18 -7
  130. package/lib/collection-manager/interfaces/createdBy.js +1 -1
  131. package/lib/collection-manager/interfaces/linkTo.js +4 -39
  132. package/lib/collection-manager/interfaces/m2m.js +5 -38
  133. package/lib/collection-manager/interfaces/m2o.js +5 -38
  134. package/lib/collection-manager/interfaces/o2m.js +8 -71
  135. package/lib/collection-manager/interfaces/o2o.js +36 -127
  136. package/lib/collection-manager/interfaces/types.d.ts +2 -0
  137. package/lib/collection-manager/interfaces/updatedBy.js +1 -1
  138. package/lib/collection-manager/sub-table.d.ts +1 -14
  139. package/lib/collection-manager/templates/tree.js +2 -2
  140. package/lib/filter-provider/FilterProvider.js +3 -1
  141. package/lib/locale/en_US.d.ts +4 -1
  142. package/lib/locale/en_US.js +6 -3
  143. package/lib/locale/ja_JP.d.ts +4 -1
  144. package/lib/locale/ja_JP.js +4 -1
  145. package/lib/locale/pt_BR.d.ts +1 -1
  146. package/lib/locale/pt_BR.js +1 -1
  147. package/lib/locale/zh_CN.d.ts +5 -1
  148. package/lib/locale/zh_CN.js +5 -1
  149. package/lib/schema-component/antd/action/Action.Designer.js +4 -5
  150. package/lib/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -0
  151. package/lib/schema-component/antd/association-field/AssociationFieldProvider.js +28 -0
  152. package/lib/schema-component/antd/association-field/AssociationSelect.d.ts +14 -0
  153. package/lib/schema-component/antd/association-field/AssociationSelect.js +129 -0
  154. package/lib/schema-component/antd/association-field/Editable.d.ts +2 -0
  155. package/lib/schema-component/antd/association-field/Editable.js +97 -0
  156. package/lib/schema-component/antd/association-field/FileManager.d.ts +4 -0
  157. package/lib/schema-component/antd/association-field/FileManager.js +253 -0
  158. package/lib/schema-component/antd/association-field/InternalNester.d.ts +1 -0
  159. package/lib/schema-component/antd/association-field/InternalNester.js +39 -0
  160. package/lib/schema-component/antd/association-field/InternalPicker.d.ts +2 -0
  161. package/lib/schema-component/antd/association-field/InternalPicker.js +277 -0
  162. package/lib/schema-component/antd/association-field/InternalSubTable.d.ts +1 -0
  163. package/lib/schema-component/antd/association-field/InternalSubTable.js +39 -0
  164. package/lib/schema-component/antd/association-field/InternalViewer.d.ts +2 -0
  165. package/lib/schema-component/antd/association-field/InternalViewer.js +126 -0
  166. package/lib/schema-component/antd/association-field/Nester.d.ts +1 -0
  167. package/lib/schema-component/antd/association-field/Nester.js +89 -0
  168. package/lib/schema-component/antd/association-field/ReadPretty.d.ts +2 -0
  169. package/lib/schema-component/antd/association-field/ReadPretty.js +47 -0
  170. package/lib/schema-component/antd/association-field/SubTable.d.ts +1 -0
  171. package/lib/schema-component/antd/association-field/SubTable.js +33 -0
  172. package/lib/schema-component/antd/association-field/context.d.ts +7 -0
  173. package/lib/schema-component/antd/association-field/context.js +9 -0
  174. package/lib/schema-component/antd/association-field/hooks.d.ts +8 -0
  175. package/lib/schema-component/antd/association-field/hooks.js +107 -0
  176. package/lib/schema-component/antd/association-field/index.d.ts +1 -0
  177. package/lib/schema-component/antd/association-field/index.js +21 -0
  178. package/lib/schema-component/antd/association-field/schema.d.ts +142 -0
  179. package/lib/schema-component/antd/association-field/schema.js +148 -0
  180. package/lib/schema-component/antd/association-field/util.d.ts +8 -0
  181. package/lib/schema-component/antd/association-field/util.js +98 -0
  182. package/lib/schema-component/antd/association-filter/AssociationFilter.FilterBlockInitializer.js +2 -2
  183. package/lib/schema-component/antd/association-select/AssociationSelect.js +10 -1
  184. package/lib/schema-component/antd/expand-action/Expand.Action.Design.d.ts +1 -0
  185. package/lib/schema-component/antd/expand-action/Expand.Action.Design.js +120 -0
  186. package/lib/schema-component/antd/expand-action/Expand.Action.d.ts +1 -0
  187. package/lib/schema-component/antd/expand-action/Expand.Action.js +48 -0
  188. package/lib/schema-component/antd/expand-action/index.d.ts +1 -0
  189. package/lib/schema-component/antd/expand-action/index.js +12 -0
  190. package/lib/schema-component/antd/filter/Filter.Action.Designer.js +10 -12
  191. package/lib/schema-component/antd/filter/FilterItem.js +1 -1
  192. package/lib/schema-component/antd/filter/useOperators.d.ts +1 -1
  193. package/lib/schema-component/antd/form-item/FormItem.d.ts +2 -1
  194. package/lib/schema-component/antd/form-item/FormItem.js +204 -55
  195. package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +34 -56
  196. package/lib/schema-component/antd/form-v2/utils.js +6 -5
  197. package/lib/schema-component/antd/gantt/components/gantt/gantt.js +3 -3
  198. package/lib/schema-component/antd/gantt/components/other/tooltip.js +1 -1
  199. package/lib/schema-component/antd/index.d.ts +3 -1
  200. package/lib/schema-component/antd/index.js +33 -11
  201. package/lib/schema-component/antd/menu/Menu.js +6 -3
  202. package/lib/schema-component/antd/record-picker/InputRecordPicker.d.ts +1 -0
  203. package/lib/schema-component/antd/record-picker/InputRecordPicker.js +42 -18
  204. package/lib/schema-component/antd/remote-select/RemoteSelect.js +15 -17
  205. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +18 -9
  206. package/lib/schema-component/antd/table-v2/Table.Index.d.ts +1 -0
  207. package/lib/schema-component/antd/table-v2/Table.Index.js +14 -0
  208. package/lib/schema-component/antd/table-v2/Table.js +9 -5
  209. package/lib/schema-component/antd/table-v2/index.js +3 -1
  210. package/lib/schema-component/antd/table-v2/utils.js +1 -1
  211. package/lib/schema-component/antd/variable/Input.js +15 -16
  212. package/lib/schema-component/antd/variable/TextArea.js +2 -5
  213. package/lib/schema-component/antd/variable/Variable.d.ts +2 -0
  214. package/lib/schema-component/antd/variable/Variable.js +6 -2
  215. package/lib/schema-component/common/dnd-context/index.js +3 -2
  216. package/lib/schema-component/common/sortable-item/SortableItem.js +4 -1
  217. package/lib/schema-component/common/utils/uitls.js +1 -1
  218. package/lib/schema-component/hooks/index.d.ts +1 -0
  219. package/lib/schema-component/hooks/index.js +11 -0
  220. package/lib/schema-component/hooks/useFieldModeOptions.d.ts +4 -0
  221. package/lib/schema-component/hooks/useFieldModeOptions.js +112 -0
  222. package/lib/schema-initializer/components/CreateRecordAction.d.ts +1 -1
  223. package/lib/schema-initializer/components/CreateRecordAction.js +4 -3
  224. package/lib/schema-initializer/items/ExpandActionInitializer.d.ts +0 -1
  225. package/lib/schema-initializer/items/ExpandActionInitializer.js +11 -37
  226. package/lib/schema-initializer/items/SelectActionInitializer.d.ts +1 -0
  227. package/lib/schema-initializer/items/SelectActionInitializer.js +73 -0
  228. package/lib/schema-initializer/items/index.d.ts +1 -0
  229. package/lib/schema-initializer/items/index.js +11 -0
  230. package/lib/schema-initializer/utils.js +56 -42
  231. package/lib/schema-settings/LinkageRules/FilterDynamicComponent.js +1 -1
  232. package/lib/schema-settings/LinkageRules/Variables.d.ts +1 -1
  233. package/lib/schema-settings/LinkageRules/Variables.js +7 -4
  234. package/lib/schema-settings/SchemaSettings.js +4 -4
  235. package/lib/schema-settings/VariableInput/VariableInput.d.ts +3 -2
  236. package/lib/schema-settings/VariableInput/VariableInput.js +3 -1
  237. package/package.json +5 -6
@@ -4,75 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- import { cloneDeep } from 'lodash';
8
- import { constraintsProps, recordPickerSelector, recordPickerViewer, relationshipType, reverseFieldProperties } from './properties';
9
- var internalSchameInitialize = function internalSchameInitialize(schema, _ref) {
10
- var field = _ref.field,
11
- block = _ref.block,
12
- readPretty = _ref.readPretty,
13
- action = _ref.action;
14
- if (block === 'Form') {
15
- if (schema['x-component'] === 'FormField') {
16
- var association = "".concat(field.collectionName, ".").concat(field.name);
17
- schema.type = 'void';
18
- schema.properties = {
19
- block: {
20
- type: 'void',
21
- 'x-decorator': 'FormFieldProvider',
22
- 'x-decorator-props': {
23
- collection: field.target,
24
- association: association,
25
- resource: association,
26
- action: action,
27
- fieldName: field.name,
28
- readPretty: readPretty
29
- },
30
- 'x-component': 'CardItem',
31
- 'x-component-props': {
32
- bordered: true
33
- },
34
- properties: _defineProperty({}, field.name, {
35
- type: 'object',
36
- 'x-component': 'FormV2',
37
- 'x-component-props': {
38
- useProps: '{{ useFormFieldProps }}'
39
- },
40
- properties: {
41
- __form_grid: {
42
- type: 'void',
43
- 'x-component': 'Grid',
44
- 'x-initializer': 'FormItemInitializers',
45
- properties: {}
46
- }
47
- }
48
- })
49
- }
50
- };
51
- } else if (schema['x-component'] === 'AssociationSelect') {
52
- Object.assign(schema, {
53
- type: 'string',
54
- 'x-designer': 'AssociationSelect.Designer'
55
- });
56
- } else {
57
- schema.type = 'string';
58
- schema['properties'] = {
59
- viewer: cloneDeep(recordPickerViewer),
60
- selector: cloneDeep(recordPickerSelector)
61
- };
62
- }
63
- return schema;
64
- }
65
- schema.type = 'string';
66
- if (readPretty) {
67
- schema['properties'] = {
68
- viewer: cloneDeep(recordPickerViewer)
69
- };
70
- } else {
71
- schema['properties'] = {
72
- selector: cloneDeep(recordPickerSelector)
73
- };
74
- }
75
- };
7
+ import { constraintsProps, relationshipType, reverseFieldProperties } from './properties';
76
8
  export var o2o = {
77
9
  name: 'o2o',
78
10
  type: 'object',
@@ -86,7 +18,7 @@ export var o2o = {
86
18
  // name,
87
19
  uiSchema: {
88
20
  // title,
89
- 'x-component': 'RecordPicker',
21
+ 'x-component': 'AssociationField',
90
22
  'x-component-props': {
91
23
  // mode: 'tags',
92
24
  multiple: false,
@@ -103,7 +35,7 @@ export var o2o = {
103
35
  // name,
104
36
  uiSchema: {
105
37
  // title,
106
- 'x-component': 'RecordPicker',
38
+ 'x-component': 'AssociationField',
107
39
  'x-component-props': {
108
40
  // mode: 'tags',
109
41
  multiple: false,
@@ -116,17 +48,11 @@ export var o2o = {
116
48
  }
117
49
  },
118
50
  availableTypes: ['hasOne'],
119
- schemaInitialize: function schemaInitialize(schema, _ref2) {
120
- var field = _ref2.field,
121
- block = _ref2.block,
122
- readPretty = _ref2.readPretty,
123
- action = _ref2.action;
124
- internalSchameInitialize(schema, {
125
- field: field,
126
- block: block,
127
- readPretty: readPretty,
128
- action: action
129
- });
51
+ schemaInitialize: function schemaInitialize(schema, _ref) {
52
+ var field = _ref.field,
53
+ block = _ref.block,
54
+ readPretty = _ref.readPretty,
55
+ action = _ref.action;
130
56
  if (['Table', 'Kanban'].includes(block)) {
131
57
  schema['x-component-props'] = schema['x-component-props'] || {};
132
58
  schema['x-component-props']['ellipsis'] = true;
@@ -254,7 +180,8 @@ export var o2o = {
254
180
  // },
255
181
  // },
256
182
  ]
257
- }
183
+ },
184
+ invariable: true
258
185
  };
259
186
  export var oho = {
260
187
  name: 'oho',
@@ -269,7 +196,7 @@ export var oho = {
269
196
  // name,
270
197
  uiSchema: {
271
198
  // title,
272
- 'x-component': 'RecordPicker',
199
+ 'x-component': 'AssociationField',
273
200
  'x-component-props': {
274
201
  // mode: 'tags',
275
202
  multiple: false,
@@ -286,7 +213,7 @@ export var oho = {
286
213
  // name,
287
214
  uiSchema: {
288
215
  // title,
289
- 'x-component': 'RecordPicker',
216
+ 'x-component': 'AssociationField',
290
217
  'x-component-props': {
291
218
  // mode: 'tags',
292
219
  multiple: false,
@@ -298,17 +225,12 @@ export var oho = {
298
225
  }
299
226
  }
300
227
  },
301
- schemaInitialize: function schemaInitialize(schema, _ref3) {
302
- var field = _ref3.field,
303
- block = _ref3.block,
304
- readPretty = _ref3.readPretty,
305
- action = _ref3.action;
306
- internalSchameInitialize(schema, {
307
- field: field,
308
- block: block,
309
- readPretty: readPretty,
310
- action: action
311
- });
228
+ schemaInitialize: function schemaInitialize(schema, _ref2) {
229
+ var field = _ref2.field,
230
+ block = _ref2.block,
231
+ readPretty = _ref2.readPretty,
232
+ action = _ref2.action;
233
+ schema['type'] = 'object';
312
234
  if (['Table', 'Kanban'].includes(block)) {
313
235
  schema['x-component-props'] = schema['x-component-props'] || {};
314
236
  schema['x-component-props']['ellipsis'] = true;
@@ -427,7 +349,8 @@ export var oho = {
427
349
  // },
428
350
  // },
429
351
  ]
430
- }
352
+ },
353
+ invariable: true
431
354
  };
432
355
  export var obo = {
433
356
  name: 'obo',
@@ -442,7 +365,7 @@ export var obo = {
442
365
  // name,
443
366
  uiSchema: {
444
367
  // title,
445
- 'x-component': 'RecordPicker',
368
+ 'x-component': 'AssociationField',
446
369
  'x-component-props': {
447
370
  // mode: 'tags',
448
371
  multiple: false,
@@ -458,7 +381,7 @@ export var obo = {
458
381
  // name,
459
382
  uiSchema: {
460
383
  // title,
461
- 'x-component': 'RecordPicker',
384
+ 'x-component': 'AssociationField',
462
385
  'x-component-props': {
463
386
  // mode: 'tags',
464
387
  multiple: false,
@@ -470,18 +393,13 @@ export var obo = {
470
393
  }
471
394
  }
472
395
  },
473
- schemaInitialize: function schemaInitialize(schema, _ref4) {
474
- var field = _ref4.field,
475
- block = _ref4.block,
476
- readPretty = _ref4.readPretty,
477
- action = _ref4.action,
478
- targetCollection = _ref4.targetCollection;
479
- internalSchameInitialize(schema, {
480
- field: field,
481
- block: block,
482
- readPretty: readPretty,
483
- action: action
484
- });
396
+ schemaInitialize: function schemaInitialize(schema, _ref3) {
397
+ var field = _ref3.field,
398
+ block = _ref3.block,
399
+ readPretty = _ref3.readPretty,
400
+ action = _ref3.action,
401
+ targetCollection = _ref3.targetCollection;
402
+ schema['type'] = 'object';
485
403
  if (['Table', 'Kanban'].includes(block)) {
486
404
  schema['x-component-props'] = schema['x-component-props'] || {};
487
405
  schema['x-component-props']['ellipsis'] = true;
@@ -494,16 +412,6 @@ export var obo = {
494
412
  };
495
413
  schema['x-component-props'].fieldNames.label = targetCollection.titleField;
496
414
  }
497
- if ((targetCollection === null || targetCollection === void 0 ? void 0 : targetCollection.template) === 'file') {
498
- var fieldNames = schema['x-component-props']['fieldNames'] || {
499
- label: 'preview',
500
- value: 'id'
501
- };
502
- fieldNames.label = 'preview';
503
- schema['x-component-props']['fieldNames'] = fieldNames;
504
- schema['x-component-props'].quickUpload = true;
505
- schema['x-component-props'].selectFile = true;
506
- }
507
415
  },
508
416
  properties: _objectSpread(_objectSpread({
509
417
  'uiSchema.title': {
@@ -617,5 +525,6 @@ export var obo = {
617
525
  // },
618
526
  // },
619
527
  ]
620
- }
528
+ },
529
+ invariable: true
621
530
  };
@@ -8,6 +8,8 @@ export interface IField extends ISchema {
8
8
  default?: IDefault;
9
9
  operators?: any[];
10
10
  filterable?: any;
11
+ /** 不支持使用变量的值进行设置 */
12
+ invariable?: boolean;
11
13
  [key: string]: any;
12
14
  }
13
15
  export {};
@@ -20,7 +20,7 @@ export var updatedBy = {
20
20
  uiSchema: {
21
21
  type: 'object',
22
22
  title: '{{t("Last updated by")}}',
23
- 'x-component': 'RecordPicker',
23
+ 'x-component': 'AssociationField',
24
24
  'x-component-props': {
25
25
  fieldNames: {
26
26
  value: 'id',
@@ -2,20 +2,7 @@ import React from 'react';
2
2
  export declare const DataSourceContext: React.Context<any>;
3
3
  export declare const ds: {
4
4
  useSelectedRowKeys: () => any[];
5
- useDataSource: (options: any) => {
6
- state: {};
7
- setState: import("ahooks/lib/useSetState").SetState<{}>;
8
- loading: boolean;
9
- data?: any;
10
- error?: Error;
11
- params: any;
12
- cancel: () => void;
13
- refresh: () => void;
14
- refreshAsync: () => Promise<any>;
15
- run: (...params: any) => void;
16
- runAsync: (...params: any) => Promise<any>;
17
- mutate: (data?: any) => void;
18
- };
5
+ useDataSource: (options: any) => any;
19
6
  useCreateAction: () => {
20
7
  run(): Promise<void>;
21
8
  };
@@ -26,7 +26,7 @@ export var tree = {
26
26
  onDelete: 'CASCADE',
27
27
  uiSchema: {
28
28
  title: '{{t("Parent")}}',
29
- 'x-component': 'RecordPicker',
29
+ 'x-component': 'AssociationField',
30
30
  'x-component-props': {
31
31
  // mode: 'tags',
32
32
  multiple: false,
@@ -45,7 +45,7 @@ export var tree = {
45
45
  onDelete: 'CASCADE',
46
46
  uiSchema: {
47
47
  title: '{{t("Children")}}',
48
- 'x-component': 'RecordPicker',
48
+ 'x-component': 'AssociationField',
49
49
  'x-component-props': {
50
50
  // mode: 'tags',
51
51
  multiple: true,
@@ -21,6 +21,7 @@ import { mergeFilter } from '../block-provider/SharedFilterProvider';
21
21
  import { useCollection } from '../collection-manager';
22
22
  import { removeNullCondition } from '../schema-component';
23
23
  import { useAssociatedFields } from './utils';
24
+ import { uniqBy } from 'lodash';
24
25
  var FilterContext = /*#__PURE__*/createContext(null);
25
26
  /**
26
27
  * 主要用于记录当前页面中的数据区块的信息,用于在过滤区块中使用
@@ -121,8 +122,9 @@ export var useFilterBlock = function useFilterBlock() {
121
122
  existingBlock.defaultFilter = block.defaultFilter;
122
123
  return;
123
124
  }
125
+ // 由于 setDataBlocks 是异步操作,所以上面的 existingBlock 在判断时有可能用的是旧的 dataBlocks,所以下面还需要根据 uid 进行去重操作
124
126
  setDataBlocks(function (prev) {
125
- return [].concat(_toConsumableArray(prev), [block]);
127
+ return uniqBy([].concat(_toConsumableArray(prev), [block]), 'uid');
126
128
  });
127
129
  };
128
130
  var getDataBlocks = function getDataBlocks() {
@@ -210,7 +210,7 @@ declare const _default: {
210
210
  "Association fields filter": string;
211
211
  "PK & FK fields": string;
212
212
  "Association fields": string;
213
- "Optional fields": string;
213
+ "Choices fields": string;
214
214
  "System fields": string;
215
215
  "General fields": string;
216
216
  "Inherited fields": string;
@@ -241,6 +241,7 @@ declare const _default: {
241
241
  "Link to": string;
242
242
  "Link to description": string;
243
243
  "Sub-table": string;
244
+ "Sub-details": string;
244
245
  "System info": string;
245
246
  "Created at": string;
246
247
  "Last updated at": string;
@@ -282,6 +283,8 @@ declare const _default: {
282
283
  "Field component": string;
283
284
  Subtable: string;
284
285
  Subform: string;
286
+ "Field mode": string;
287
+ "Allow add new data": string;
285
288
  "Record picker": string;
286
289
  "Toggles the subfield mode": string;
287
290
  "Selector mode": string;
@@ -210,7 +210,7 @@ export default {
210
210
  "Association fields filter": "Association fields filter",
211
211
  "PK & FK fields": "PK & FK fields",
212
212
  "Association fields": "Association fields",
213
- "Optional fields": "Optional fields",
213
+ "Choices fields": "Choices fields",
214
214
  "System fields": "System fields",
215
215
  "General fields": "General fields",
216
216
  "Inherited fields": "Inherited fields",
@@ -241,6 +241,7 @@ export default {
241
241
  "Link to": "Link to",
242
242
  "Link to description": "Used to create collection relationships quickly and compatible with most common scenarios. Suitable for non-developer use. When present as a field, it is a drop-down selection used to select records from the target collection. Once created, it will simultaneously generate the associated fields of the current collection in the target collection.",
243
243
  "Sub-table": "Sub-table",
244
+ "Sub-details": "Sub-details",
244
245
  "System info": "System info",
245
246
  "Created at": "Created at",
246
247
  "Last updated at": "Last updated at",
@@ -281,12 +282,14 @@ export default {
281
282
  "Display field title": "Display field title",
282
283
  "Field component": "Field component",
283
284
  "Subtable": "Subtable",
284
- "Subform": "Subform",
285
+ "Subform": "Sub-form",
286
+ "Field mode": "Field mode",
287
+ "Allow add new data": "Allow add new data",
285
288
  "Record picker": "Record picker",
286
289
  "Toggles the subfield mode": "Toggles the subfield mode",
287
290
  "Selector mode": "Selector mode",
288
291
  "Subtable mode": "Subtable mode",
289
- "Subform mode": "Subform mode",
292
+ "Subform mode": "Sub-form mode",
290
293
  "Edit block title": "Edit block title",
291
294
  "Block title": "Block title",
292
295
  "Pattern": "Pattern",
@@ -556,6 +556,9 @@ declare const _default: {
556
556
  "Field component": string;
557
557
  Subtable: string;
558
558
  Subform: string;
559
+ "Sub-details": string;
560
+ "Field mode": string;
561
+ "Allow add new data": string;
559
562
  "Regular expression": string;
560
563
  "Enabled languages": string;
561
564
  "View all plugins": string;
@@ -576,7 +579,7 @@ declare const _default: {
576
579
  "Enable SMS authentication": string;
577
580
  "Display association fields": string;
578
581
  "Set default value": string;
579
- "Optional fields": string;
582
+ "Choices fields": string;
580
583
  Editable: string;
581
584
  Readonly: string;
582
585
  "Easy-reading": string;
@@ -556,6 +556,9 @@ export default {
556
556
  "Field component": "フィールドコンポーネント",
557
557
  "Subtable": "サブテーブル",
558
558
  "Subform": "サブフォーム",
559
+ "Sub-details": "サブリスト",
560
+ "Field mode": "フィールドコンポーネント",
561
+ "Allow add new data": "データの追加を許可",
559
562
  "Regular expression": "正規表現",
560
563
  "Enabled languages": "利用可能な言語",
561
564
  "View all plugins": "すべてのプラグラインを見る",
@@ -577,7 +580,7 @@ export default {
577
580
  "Enable SMS authentication": "SMS認証を有効にする",
578
581
  "Display association fields": "関連付けられたコレクションのフィールドを表示",
579
582
  "Set default value": "デフォルト値を設定",
580
- "Optional fields": "オプションフィールド",
583
+ "Choices fields": "チョイスフィールド",
581
584
  "Editable": "編集可能",
582
585
  "Readonly": "読み取り専用(編集不可)",
583
586
  "Easy-reading": "読取り専用(読取りモード)",
@@ -170,7 +170,7 @@ declare const _default: {
170
170
  "Association fields filter": string;
171
171
  "PK & FK fields": string;
172
172
  "Association fields": string;
173
- "Optional fields": string;
173
+ "Choices fields": string;
174
174
  "System fields": string;
175
175
  "General fields": string;
176
176
  "Inherited fields": string;
@@ -170,7 +170,7 @@ export default {
170
170
  "Association fields filter": "Filtro de campos de associação",
171
171
  "PK & FK fields": "Campos PK & FK",
172
172
  "Association fields": "Campos de associação",
173
- "Optional fields": "Campos opcionais",
173
+ "Choices fields": "Campos de opções",
174
174
  "System fields": "Campos do sistema",
175
175
  "General fields": "Campos gerais",
176
176
  "Inherited fields": "Campos herdados",
@@ -214,6 +214,7 @@ declare const _default: {
214
214
  "Edit collection": string;
215
215
  "Configure fields": string;
216
216
  "Configure columns": string;
217
+ "Please select the records you want to delete": string;
217
218
  "Edit field": string;
218
219
  Override: string;
219
220
  "Override field": string;
@@ -221,7 +222,7 @@ declare const _default: {
221
222
  "Association fields filter": string;
222
223
  "PK & FK fields": string;
223
224
  "Association fields": string;
224
- "Optional fields": string;
225
+ "Choices fields": string;
225
226
  "System fields": string;
226
227
  "General fields": string;
227
228
  "Inherited fields": string;
@@ -300,11 +301,14 @@ declare const _default: {
300
301
  "Field component": string;
301
302
  Subtable: string;
302
303
  Subform: string;
304
+ "Sub-details": string;
303
305
  "Record picker": string;
304
306
  "Toggles the subfield mode": string;
305
307
  "Selector mode": string;
306
308
  "Subtable mode": string;
307
309
  "Subform mode": string;
310
+ "Field mode": string;
311
+ "Allow add new data": string;
308
312
  "Edit block title": string;
309
313
  "Block title": string;
310
314
  Pattern: string;
@@ -214,6 +214,7 @@ export default {
214
214
  "Edit collection": "编辑数据表",
215
215
  "Configure fields": "配置字段",
216
216
  "Configure columns": "配置字段",
217
+ "Please select the records you want to delete": "请选择要删除的记录",
217
218
  "Edit field": "编辑字段",
218
219
  "Override": "重写",
219
220
  "Override field": "重写字段",
@@ -221,7 +222,7 @@ export default {
221
222
  "Association fields filter": "关系筛选",
222
223
  "PK & FK fields": "主外键字段",
223
224
  "Association fields": "关系字段",
224
- "Optional fields": "可选字段",
225
+ "Choices fields": "选项字段",
225
226
  "System fields": "系统字段",
226
227
  "General fields": "普通字段",
227
228
  "Inherited fields": "继承字段",
@@ -300,11 +301,14 @@ export default {
300
301
  "Field component": "字段组件",
301
302
  "Subtable": "子表格",
302
303
  "Subform": "子表单",
304
+ "Sub-details": "子详情",
303
305
  "Record picker": "数据选择器",
304
306
  "Toggles the subfield mode": "切换子字段模式",
305
307
  "Selector mode": "选择器模式",
306
308
  "Subtable mode": "子表格模式",
307
309
  "Subform mode": "子表单模式",
310
+ "Field mode": "字段组件",
311
+ "Allow add new data": "允许添加数据",
308
312
  "Edit block title": "编辑区块标题",
309
313
  "Block title": "区块标题",
310
314
  "Pattern": "模式",
@@ -58,6 +58,7 @@ export var ActionDesigner = function ActionDesigner(props) {
58
58
  dn = _useDesignable.dn;
59
59
  var _useTranslation2 = useTranslation(),
60
60
  t = _useTranslation2.t;
61
+ var isAction = useLinkageAction();
61
62
  var isPopupAction = ['create', 'update', 'view', 'customize:popup'].includes(fieldSchema['x-action'] || '');
62
63
  var isUpdateModePopupAction = ['customize:bulkUpdate', 'customize:bulkEdit'].includes(fieldSchema['x-action']);
63
64
  var _useState = useState(),
@@ -65,9 +66,8 @@ export var ActionDesigner = function ActionDesigner(props) {
65
66
  initialSchema = _useState2[0],
66
67
  setInitialSchema = _useState2[1];
67
68
  var actionType = (_fieldSchema$xAction = fieldSchema['x-action']) !== null && _fieldSchema$xAction !== void 0 ? _fieldSchema$xAction : '';
68
- var isLinkageAction = linkageAction || useLinkageAction();
69
+ var isLinkageAction = linkageAction || isAction;
69
70
  var isChildCollectionAction = getChildrenCollections(name).length > 0 && fieldSchema['x-action'] === 'create';
70
- var isSupportEditButton = fieldSchema['x-action'] !== 'expandAll';
71
71
  var isLink = fieldSchema['x-component'] === 'Action.Link';
72
72
  useEffect(function () {
73
73
  var schemaUid = uid();
@@ -96,8 +96,7 @@ export var ActionDesigner = function ActionDesigner(props) {
96
96
  'x-component': 'Input',
97
97
  title: t('Button title'),
98
98
  default: fieldSchema.title,
99
- 'x-component-props': {},
100
- 'x-visible': isSupportEditButton
99
+ 'x-component-props': {}
101
100
  // description: `原字段标题:${collectionField?.uiSchema?.title}`,
102
101
  },
103
102
 
@@ -107,7 +106,7 @@ export var ActionDesigner = function ActionDesigner(props) {
107
106
  title: t('Button icon'),
108
107
  default: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon.icon,
109
108
  'x-component-props': {},
110
- 'x-visible': isSupportEditButton && !isLink
109
+ 'x-visible': !isLink
111
110
  // description: `原字段标题:${collectionField?.uiSchema?.title}`,
112
111
  },
113
112
 
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function AssociationFieldProvider(props: any): JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { useField, useFieldSchema } from '@formily/react';
2
+ import React, { useMemo } from 'react';
3
+ import { useCollectionManager } from '../../../collection-manager';
4
+ import { AssociationFieldContext } from './context';
5
+ export function AssociationFieldProvider(props) {
6
+ var field = useField();
7
+ var _useCollectionManager = useCollectionManager(),
8
+ getCollectionField = _useCollectionManager.getCollectionField;
9
+ var fieldSchema = useFieldSchema();
10
+ var collectionField = useMemo(function () {
11
+ return getCollectionField(fieldSchema['x-collection-field']);
12
+ }, [fieldSchema['x-collection-field']]);
13
+ return /*#__PURE__*/React.createElement(AssociationFieldContext.Provider, {
14
+ value: {
15
+ options: collectionField,
16
+ field: field
17
+ }
18
+ }, props.children);
19
+ }
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { RemoteSelectProps } from '../remote-select';
3
+ export declare type AssociationSelectProps<P = any> = RemoteSelectProps<P> & {
4
+ action?: string;
5
+ multiple?: boolean;
6
+ };
7
+ interface AssociationSelectInterface {
8
+ (props: any): React.ReactElement;
9
+ Designer: React.FC;
10
+ FilterDesigner: React.FC;
11
+ }
12
+ export declare const AssociationSelect: AssociationSelectInterface;
13
+ export declare const AssociationSelectReadPretty: React.ForwardRefExoticComponent<Pick<Partial<any>, string | number | symbol> & React.RefAttributes<unknown>>;
14
+ export {};