@nocobase/client 0.9.2-alpha.4 → 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 (211) hide show
  1. package/es/block-provider/DetailsBlockProvider.js +13 -1
  2. package/es/block-provider/FormBlockProvider.js +30 -13
  3. package/es/block-provider/hooks/index.d.ts +10 -0
  4. package/es/block-provider/hooks/index.js +498 -281
  5. package/es/collection-manager/Configuration/CollectionFields.js +1 -2
  6. package/es/collection-manager/Configuration/EditFieldAction.js +0 -1
  7. package/es/collection-manager/Configuration/OverridingCollectionField.js +0 -1
  8. package/es/collection-manager/action-hooks.d.ts +1 -1
  9. package/es/collection-manager/action-hooks.js +18 -7
  10. package/es/collection-manager/interfaces/createdBy.js +1 -1
  11. package/es/collection-manager/interfaces/linkTo.js +3 -39
  12. package/es/collection-manager/interfaces/m2m.js +4 -38
  13. package/es/collection-manager/interfaces/m2o.js +4 -38
  14. package/es/collection-manager/interfaces/o2m.js +4 -68
  15. package/es/collection-manager/interfaces/o2o.js +25 -119
  16. package/es/collection-manager/interfaces/updatedBy.js +1 -1
  17. package/es/collection-manager/templates/tree.js +2 -2
  18. package/es/filter-provider/FilterProvider.js +3 -1
  19. package/es/locale/en_US.d.ts +3 -0
  20. package/es/locale/en_US.js +5 -2
  21. package/es/locale/ja_JP.d.ts +3 -0
  22. package/es/locale/ja_JP.js +3 -0
  23. package/es/locale/zh_CN.d.ts +4 -0
  24. package/es/locale/zh_CN.js +4 -0
  25. package/es/schema-component/antd/action/Action.Designer.js +4 -5
  26. package/es/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -0
  27. package/es/schema-component/antd/association-field/AssociationFieldProvider.js +19 -0
  28. package/es/schema-component/antd/association-field/AssociationSelect.d.ts +14 -0
  29. package/es/schema-component/antd/association-field/AssociationSelect.js +118 -0
  30. package/es/schema-component/antd/association-field/Editable.d.ts +2 -0
  31. package/es/schema-component/antd/association-field/Editable.js +88 -0
  32. package/es/schema-component/antd/association-field/FileManager.d.ts +4 -0
  33. package/es/schema-component/antd/association-field/FileManager.js +243 -0
  34. package/es/schema-component/antd/association-field/InternalNester.d.ts +1 -0
  35. package/es/schema-component/antd/association-field/InternalNester.js +28 -0
  36. package/es/schema-component/antd/association-field/InternalPicker.d.ts +2 -0
  37. package/es/schema-component/antd/association-field/InternalPicker.js +267 -0
  38. package/es/schema-component/antd/association-field/InternalSubTable.d.ts +1 -0
  39. package/es/schema-component/antd/association-field/InternalSubTable.js +28 -0
  40. package/es/schema-component/antd/association-field/InternalViewer.d.ts +2 -0
  41. package/es/schema-component/antd/association-field/InternalViewer.js +115 -0
  42. package/es/schema-component/antd/association-field/Nester.d.ts +1 -0
  43. package/es/schema-component/antd/association-field/Nester.js +80 -0
  44. package/es/schema-component/antd/association-field/ReadPretty.d.ts +2 -0
  45. package/es/schema-component/antd/association-field/ReadPretty.js +38 -0
  46. package/es/schema-component/antd/association-field/SubTable.d.ts +1 -0
  47. package/es/schema-component/antd/association-field/SubTable.js +25 -0
  48. package/es/schema-component/antd/association-field/context.d.ts +7 -0
  49. package/es/schema-component/antd/association-field/context.js +2 -0
  50. package/es/schema-component/antd/association-field/hooks.d.ts +8 -0
  51. package/es/schema-component/antd/association-field/hooks.js +96 -0
  52. package/es/schema-component/antd/association-field/index.d.ts +1 -0
  53. package/es/schema-component/antd/association-field/index.js +14 -0
  54. package/es/schema-component/antd/association-field/schema.d.ts +142 -0
  55. package/es/schema-component/antd/association-field/schema.js +141 -0
  56. package/es/schema-component/antd/association-field/util.d.ts +8 -0
  57. package/es/schema-component/antd/association-field/util.js +84 -0
  58. package/es/schema-component/antd/expand-action/Expand.Action.Design.d.ts +1 -0
  59. package/es/schema-component/antd/expand-action/Expand.Action.Design.js +112 -0
  60. package/es/schema-component/antd/expand-action/Expand.Action.d.ts +1 -0
  61. package/es/schema-component/antd/expand-action/Expand.Action.js +40 -0
  62. package/es/schema-component/antd/expand-action/index.d.ts +1 -0
  63. package/es/schema-component/antd/expand-action/index.js +5 -0
  64. package/es/schema-component/antd/filter/Filter.Action.Designer.js +10 -12
  65. package/es/schema-component/antd/filter/FilterItem.js +1 -1
  66. package/es/schema-component/antd/filter/useOperators.d.ts +1 -1
  67. package/es/schema-component/antd/form-item/FormItem.d.ts +2 -1
  68. package/es/schema-component/antd/form-item/FormItem.js +183 -52
  69. package/es/schema-component/antd/form-item/SchemaSettingOptions.js +36 -58
  70. package/es/schema-component/antd/form-v2/utils.js +3 -1
  71. package/es/schema-component/antd/gantt/components/other/tooltip.js +1 -1
  72. package/es/schema-component/antd/index.d.ts +3 -1
  73. package/es/schema-component/antd/index.js +3 -1
  74. package/es/schema-component/antd/menu/Menu.js +6 -3
  75. package/es/schema-component/antd/record-picker/InputRecordPicker.d.ts +1 -0
  76. package/es/schema-component/antd/record-picker/InputRecordPicker.js +32 -12
  77. package/es/schema-component/antd/remote-select/RemoteSelect.js +16 -18
  78. package/es/schema-component/antd/table-v2/Table.Column.Designer.js +18 -9
  79. package/es/schema-component/antd/table-v2/Table.Index.d.ts +1 -0
  80. package/es/schema-component/antd/table-v2/Table.Index.js +6 -0
  81. package/es/schema-component/antd/table-v2/Table.js +9 -5
  82. package/es/schema-component/antd/table-v2/index.js +3 -1
  83. package/es/schema-component/antd/table-v2/utils.js +1 -1
  84. package/es/schema-component/antd/variable/Input.js +5 -5
  85. package/es/schema-component/antd/variable/TextArea.js +2 -5
  86. package/es/schema-component/common/dnd-context/index.js +3 -2
  87. package/es/schema-component/common/sortable-item/SortableItem.js +4 -1
  88. package/es/schema-component/common/utils/uitls.js +1 -1
  89. package/es/schema-component/hooks/index.d.ts +1 -0
  90. package/es/schema-component/hooks/index.js +2 -1
  91. package/es/schema-component/hooks/useFieldModeOptions.d.ts +4 -0
  92. package/es/schema-component/hooks/useFieldModeOptions.js +105 -0
  93. package/es/schema-initializer/components/CreateRecordAction.d.ts +1 -1
  94. package/es/schema-initializer/components/CreateRecordAction.js +4 -3
  95. package/es/schema-initializer/items/ExpandActionInitializer.d.ts +0 -1
  96. package/es/schema-initializer/items/ExpandActionInitializer.js +9 -34
  97. package/es/schema-initializer/items/SelectActionInitializer.d.ts +1 -0
  98. package/es/schema-initializer/items/SelectActionInitializer.js +65 -0
  99. package/es/schema-initializer/items/index.d.ts +1 -0
  100. package/es/schema-initializer/items/index.js +2 -1
  101. package/es/schema-initializer/utils.js +20 -8
  102. package/es/schema-settings/LinkageRules/FilterDynamicComponent.js +1 -1
  103. package/es/schema-settings/LinkageRules/Variables.d.ts +1 -1
  104. package/es/schema-settings/LinkageRules/Variables.js +7 -4
  105. package/es/schema-settings/SchemaSettings.js +2 -2
  106. package/lib/block-provider/DetailsBlockProvider.js +13 -1
  107. package/lib/block-provider/FormBlockProvider.js +31 -15
  108. package/lib/block-provider/hooks/index.d.ts +10 -0
  109. package/lib/block-provider/hooks/index.js +509 -289
  110. package/lib/collection-manager/Configuration/CollectionFields.js +1 -2
  111. package/lib/collection-manager/Configuration/EditFieldAction.js +0 -1
  112. package/lib/collection-manager/Configuration/OverridingCollectionField.js +0 -1
  113. package/lib/collection-manager/action-hooks.d.ts +1 -1
  114. package/lib/collection-manager/action-hooks.js +18 -7
  115. package/lib/collection-manager/interfaces/createdBy.js +1 -1
  116. package/lib/collection-manager/interfaces/linkTo.js +2 -38
  117. package/lib/collection-manager/interfaces/m2m.js +3 -37
  118. package/lib/collection-manager/interfaces/m2o.js +3 -37
  119. package/lib/collection-manager/interfaces/o2m.js +6 -70
  120. package/lib/collection-manager/interfaces/o2o.js +30 -124
  121. package/lib/collection-manager/interfaces/updatedBy.js +1 -1
  122. package/lib/collection-manager/templates/tree.js +2 -2
  123. package/lib/filter-provider/FilterProvider.js +3 -1
  124. package/lib/locale/en_US.d.ts +3 -0
  125. package/lib/locale/en_US.js +5 -2
  126. package/lib/locale/ja_JP.d.ts +3 -0
  127. package/lib/locale/ja_JP.js +3 -0
  128. package/lib/locale/zh_CN.d.ts +4 -0
  129. package/lib/locale/zh_CN.js +4 -0
  130. package/lib/schema-component/antd/action/Action.Designer.js +4 -5
  131. package/lib/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -0
  132. package/lib/schema-component/antd/association-field/AssociationFieldProvider.js +28 -0
  133. package/lib/schema-component/antd/association-field/AssociationSelect.d.ts +14 -0
  134. package/lib/schema-component/antd/association-field/AssociationSelect.js +129 -0
  135. package/lib/schema-component/antd/association-field/Editable.d.ts +2 -0
  136. package/lib/schema-component/antd/association-field/Editable.js +97 -0
  137. package/lib/schema-component/antd/association-field/FileManager.d.ts +4 -0
  138. package/lib/schema-component/antd/association-field/FileManager.js +253 -0
  139. package/lib/schema-component/antd/association-field/InternalNester.d.ts +1 -0
  140. package/lib/schema-component/antd/association-field/InternalNester.js +39 -0
  141. package/lib/schema-component/antd/association-field/InternalPicker.d.ts +2 -0
  142. package/lib/schema-component/antd/association-field/InternalPicker.js +277 -0
  143. package/lib/schema-component/antd/association-field/InternalSubTable.d.ts +1 -0
  144. package/lib/schema-component/antd/association-field/InternalSubTable.js +39 -0
  145. package/lib/schema-component/antd/association-field/InternalViewer.d.ts +2 -0
  146. package/lib/schema-component/antd/association-field/InternalViewer.js +126 -0
  147. package/lib/schema-component/antd/association-field/Nester.d.ts +1 -0
  148. package/lib/schema-component/antd/association-field/Nester.js +89 -0
  149. package/lib/schema-component/antd/association-field/ReadPretty.d.ts +2 -0
  150. package/lib/schema-component/antd/association-field/ReadPretty.js +47 -0
  151. package/lib/schema-component/antd/association-field/SubTable.d.ts +1 -0
  152. package/lib/schema-component/antd/association-field/SubTable.js +33 -0
  153. package/lib/schema-component/antd/association-field/context.d.ts +7 -0
  154. package/lib/schema-component/antd/association-field/context.js +9 -0
  155. package/lib/schema-component/antd/association-field/hooks.d.ts +8 -0
  156. package/lib/schema-component/antd/association-field/hooks.js +107 -0
  157. package/lib/schema-component/antd/association-field/index.d.ts +1 -0
  158. package/lib/schema-component/antd/association-field/index.js +21 -0
  159. package/lib/schema-component/antd/association-field/schema.d.ts +142 -0
  160. package/lib/schema-component/antd/association-field/schema.js +148 -0
  161. package/lib/schema-component/antd/association-field/util.d.ts +8 -0
  162. package/lib/schema-component/antd/association-field/util.js +98 -0
  163. package/lib/schema-component/antd/expand-action/Expand.Action.Design.d.ts +1 -0
  164. package/lib/schema-component/antd/expand-action/Expand.Action.Design.js +120 -0
  165. package/lib/schema-component/antd/expand-action/Expand.Action.d.ts +1 -0
  166. package/lib/schema-component/antd/expand-action/Expand.Action.js +48 -0
  167. package/lib/schema-component/antd/expand-action/index.d.ts +1 -0
  168. package/lib/schema-component/antd/expand-action/index.js +12 -0
  169. package/lib/schema-component/antd/filter/Filter.Action.Designer.js +10 -12
  170. package/lib/schema-component/antd/filter/FilterItem.js +1 -1
  171. package/lib/schema-component/antd/filter/useOperators.d.ts +1 -1
  172. package/lib/schema-component/antd/form-item/FormItem.d.ts +2 -1
  173. package/lib/schema-component/antd/form-item/FormItem.js +180 -48
  174. package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +34 -56
  175. package/lib/schema-component/antd/form-v2/utils.js +3 -1
  176. package/lib/schema-component/antd/gantt/components/other/tooltip.js +1 -1
  177. package/lib/schema-component/antd/index.d.ts +3 -1
  178. package/lib/schema-component/antd/index.js +33 -11
  179. package/lib/schema-component/antd/menu/Menu.js +6 -3
  180. package/lib/schema-component/antd/record-picker/InputRecordPicker.d.ts +1 -0
  181. package/lib/schema-component/antd/record-picker/InputRecordPicker.js +34 -13
  182. package/lib/schema-component/antd/remote-select/RemoteSelect.js +15 -17
  183. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +18 -9
  184. package/lib/schema-component/antd/table-v2/Table.Index.d.ts +1 -0
  185. package/lib/schema-component/antd/table-v2/Table.Index.js +14 -0
  186. package/lib/schema-component/antd/table-v2/Table.js +9 -5
  187. package/lib/schema-component/antd/table-v2/index.js +3 -1
  188. package/lib/schema-component/antd/table-v2/utils.js +1 -1
  189. package/lib/schema-component/antd/variable/Input.js +5 -5
  190. package/lib/schema-component/antd/variable/TextArea.js +2 -5
  191. package/lib/schema-component/common/dnd-context/index.js +3 -2
  192. package/lib/schema-component/common/sortable-item/SortableItem.js +4 -1
  193. package/lib/schema-component/common/utils/uitls.js +1 -1
  194. package/lib/schema-component/hooks/index.d.ts +1 -0
  195. package/lib/schema-component/hooks/index.js +11 -0
  196. package/lib/schema-component/hooks/useFieldModeOptions.d.ts +4 -0
  197. package/lib/schema-component/hooks/useFieldModeOptions.js +112 -0
  198. package/lib/schema-initializer/components/CreateRecordAction.d.ts +1 -1
  199. package/lib/schema-initializer/components/CreateRecordAction.js +4 -3
  200. package/lib/schema-initializer/items/ExpandActionInitializer.d.ts +0 -1
  201. package/lib/schema-initializer/items/ExpandActionInitializer.js +11 -37
  202. package/lib/schema-initializer/items/SelectActionInitializer.d.ts +1 -0
  203. package/lib/schema-initializer/items/SelectActionInitializer.js +73 -0
  204. package/lib/schema-initializer/items/index.d.ts +1 -0
  205. package/lib/schema-initializer/items/index.js +11 -0
  206. package/lib/schema-initializer/utils.js +20 -8
  207. package/lib/schema-settings/LinkageRules/FilterDynamicComponent.js +1 -1
  208. package/lib/schema-settings/LinkageRules/Variables.d.ts +1 -1
  209. package/lib/schema-settings/LinkageRules/Variables.js +7 -4
  210. package/lib/schema-settings/SchemaSettings.js +3 -3
  211. package/package.json +5 -6
@@ -10,7 +10,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
10
10
  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); }
11
11
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
12
12
  import { css } from '@emotion/css';
13
- import { ArrayCollapse, FormLayout, FormItem as Item } from '@formily/antd';
13
+ import { ArrayCollapse, FormLayout, FormItem as Item, ArrayItems } from '@formily/antd';
14
14
  import { observer, useField, useFieldSchema } from '@formily/react';
15
15
  import { uid } from '@formily/shared';
16
16
  import _ from 'lodash';
@@ -19,13 +19,15 @@ import React, { useContext, useEffect } from 'react';
19
19
  import { useTranslation } from 'react-i18next';
20
20
  import { ACLCollectionFieldProvider } from '../../../acl/ACLProvider';
21
21
  import { BlockRequestContext, useFilterByTk, useFormBlockContext } from '../../../block-provider';
22
- import { useCollection, useCollectionManager } from '../../../collection-manager';
22
+ import { useCollection, useCollectionManager, useSortFields, useCollectionFilterOptions } from '../../../collection-manager';
23
23
  import { isTitleField } from '../../../collection-manager/Configuration/CollectionFields';
24
24
  import { GeneralSchemaDesigner, SchemaSettings, isPatternDisabled, isShowDefaultValue } from '../../../schema-settings';
25
25
  import { VariableInput } from '../../../schema-settings/VariableInput/VariableInput';
26
+ import { FilterDynamicComponent } from '../table-v2/FilterDynamicComponent';
26
27
  import { isVariable, parseVariables, useVariablesCtx } from '../../common/utils/uitls';
27
28
  import { SchemaComponent } from '../../core';
28
- import { useCompile, useDesignable, useFieldComponentOptions } from '../../hooks';
29
+ import { removeNullCondition } from '../filter';
30
+ import { useCompile, useDesignable, useFieldModeOptions } from '../../hooks';
29
31
  import { BlockItem } from '../block-item';
30
32
  import { HTMLEncode } from '../input/shared';
31
33
  import { isInvariable } from '../variable';
@@ -73,7 +75,7 @@ export var FormItem = observer(function (props) {
73
75
  }))));
74
76
  });
75
77
  FormItem.Designer = function Designer() {
76
- var _interfaceConfig$vali, _collectionField$uiSc, _getCollectionFields, _collectionField$uiSc2, _fieldSchema$xDecora, _fieldSchema$xCompon, _fieldSchema$xCompon2, _fieldSchema$xCompon3, _fieldSchema$xCompon4, _fieldSchema$xCompon5, _field$componentProps, _field$componentProps2;
78
+ var _interfaceConfig$vali, _collectionField$uiSc, _getCollectionFields, _field$componentProps, _field$componentProps2, _field$componentProps3, _field$componentProps4, _field$componentProps5, _field$componentProps6, _field$componentProps7, _collectionField$uiSc2, _fieldSchema$xDecora, _fieldSchema$xCompon, _fieldSchema$xCompon2, _fieldSchema$xCompon3, _fieldSchema$xCompon4, _field$componentProps8, _field$componentProps9;
77
79
  var _useCollectionManager = useCollectionManager(),
78
80
  getCollectionFields = _useCollectionManager.getCollectionFields,
79
81
  getInterface = _useCollectionManager.getInterface,
@@ -100,8 +102,10 @@ FormItem.Designer = function Designer() {
100
102
  var validateSchema = interfaceConfig === null || interfaceConfig === void 0 ? void 0 : (_interfaceConfig$vali = interfaceConfig['validateSchema']) === null || _interfaceConfig$vali === void 0 ? void 0 : _interfaceConfig$vali.call(interfaceConfig, fieldSchema);
101
103
  var originalTitle = collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc = collectionField.uiSchema) === null || _collectionField$uiSc === void 0 ? void 0 : _collectionField$uiSc.title;
102
104
  var targetFields = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) ? getCollectionFields(collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) : (_getCollectionFields = getCollectionFields(collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetCollection)) !== null && _getCollectionFields !== void 0 ? _getCollectionFields : [];
103
- var fieldComponentOptions = useFieldComponentOptions();
104
- var isSubFormAssociationField = field.address.segments.includes('__form_grid');
105
+ var fieldModeOptions = useFieldModeOptions();
106
+ var isAssociationField = ['belongsTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(collectionField === null || collectionField === void 0 ? void 0 : collectionField.type);
107
+ var isTableField = fieldSchema['x-component'] === 'TableField';
108
+ var isFileField = isFileCollection(targetCollection);
105
109
  var initialValue = {
106
110
  title: field.title === originalTitle ? undefined : field.title
107
111
  };
@@ -124,6 +128,21 @@ FormItem.Designer = function Designer() {
124
128
  if (fieldSchema['x-read-pretty'] === true) {
125
129
  readOnlyMode = 'read-pretty';
126
130
  }
131
+ var dataSource = useCollectionFilterOptions(collectionField === null || collectionField === void 0 ? void 0 : collectionField.target);
132
+ var defaultFilter = ((_field$componentProps = field.componentProps) === null || _field$componentProps === void 0 ? void 0 : (_field$componentProps2 = _field$componentProps.service) === null || _field$componentProps2 === void 0 ? void 0 : (_field$componentProps3 = _field$componentProps2.params) === null || _field$componentProps3 === void 0 ? void 0 : _field$componentProps3.filter) || {};
133
+ var sortFields = useSortFields(collectionField === null || collectionField === void 0 ? void 0 : collectionField.target);
134
+ var defaultSort = ((_field$componentProps4 = field.componentProps) === null || _field$componentProps4 === void 0 ? void 0 : (_field$componentProps5 = _field$componentProps4.service) === null || _field$componentProps5 === void 0 ? void 0 : (_field$componentProps6 = _field$componentProps5.params) === null || _field$componentProps6 === void 0 ? void 0 : _field$componentProps6.sort) || [];
135
+ var fieldMode = (field === null || field === void 0 ? void 0 : (_field$componentProps7 = field.componentProps) === null || _field$componentProps7 === void 0 ? void 0 : _field$componentProps7['mode']) || (isFileField ? 'FileManager' : 'Select');
136
+ var isSelectFieldMode = fieldMode === 'Select';
137
+ var sort = defaultSort === null || defaultSort === void 0 ? void 0 : defaultSort.map(function (item) {
138
+ return item.startsWith('-') ? {
139
+ field: item.substring(1),
140
+ direction: 'desc'
141
+ } : {
142
+ field: item,
143
+ direction: 'asc'
144
+ };
145
+ });
127
146
  return /*#__PURE__*/React.createElement(GeneralSchemaDesigner, null, collectionField && /*#__PURE__*/React.createElement(SchemaSettings.ModalItem, {
128
147
  key: "edit-field-title",
129
148
  title: t('Edit field title'),
@@ -225,10 +244,10 @@ FormItem.Designer = function Designer() {
225
244
  });
226
245
  refresh();
227
246
  }
228
- }), !(form === null || form === void 0 ? void 0 : form.readPretty) && isFileCollection(targetCollection) ? /*#__PURE__*/React.createElement(SchemaSettings.SwitchItem, {
247
+ }), !(form === null || form === void 0 ? void 0 : form.readPretty) && isFileField ? /*#__PURE__*/React.createElement(SchemaSettings.SwitchItem, {
229
248
  key: "quick-upload",
230
249
  title: t('Quick upload'),
231
- checked: (_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon.quickUpload,
250
+ checked: ((_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon.quickUpload) !== false,
232
251
  onChange: function onChange(value) {
233
252
  var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
234
253
  field.componentProps.quickUpload = value;
@@ -240,10 +259,10 @@ FormItem.Designer = function Designer() {
240
259
  });
241
260
  refresh();
242
261
  }
243
- }) : null, !(form === null || form === void 0 ? void 0 : form.readPretty) && isFileCollection(targetCollection) ? /*#__PURE__*/React.createElement(SchemaSettings.SwitchItem, {
262
+ }) : null, !(form === null || form === void 0 ? void 0 : form.readPretty) && isFileField ? /*#__PURE__*/React.createElement(SchemaSettings.SwitchItem, {
244
263
  key: "select-file",
245
264
  title: t('Select file'),
246
- checked: (_fieldSchema$xCompon2 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon2 === void 0 ? void 0 : _fieldSchema$xCompon2.selectFile,
265
+ checked: ((_fieldSchema$xCompon2 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon2 === void 0 ? void 0 : _fieldSchema$xCompon2.selectFile) !== false,
247
266
  onChange: function onChange(value) {
248
267
  var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
249
268
  field.componentProps.selectFile = value;
@@ -464,44 +483,154 @@ FormItem.Designer = function Designer() {
464
483
  });
465
484
  refresh();
466
485
  }
467
- }), form && !isSubFormAssociationField && fieldComponentOptions && /*#__PURE__*/React.createElement(SchemaSettings.SelectItem, {
468
- title: t('Field component'),
469
- options: fieldComponentOptions,
470
- value: fieldSchema['x-component'],
471
- onChange: function onChange(type) {
472
- var _collectionField$uiSc4, _interfaceConfig$sche;
473
- var schema = {
474
- name: collectionField === null || collectionField === void 0 ? void 0 : collectionField.name,
475
- type: 'void',
476
- required: fieldSchema['required'],
477
- description: fieldSchema['description'],
478
- default: fieldSchema['default'],
479
- 'x-decorator': 'FormItem',
480
- 'x-designer': 'FormItem.Designer',
481
- 'x-component': type,
482
- 'x-validator': fieldSchema['x-validator'],
483
- 'x-collection-field': fieldSchema['x-collection-field'],
484
- 'x-decorator-props': fieldSchema['x-decorator-props'],
485
- 'x-component-props': _objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc4 = collectionField.uiSchema) === null || _collectionField$uiSc4 === void 0 ? void 0 : _collectionField$uiSc4['x-component-props']), fieldSchema['x-component-props'])
486
- };
487
- interfaceConfig === null || interfaceConfig === void 0 ? void 0 : (_interfaceConfig$sche = interfaceConfig.schemaInitialize) === null || _interfaceConfig$sche === void 0 ? void 0 : _interfaceConfig$sche.call(interfaceConfig, schema, {
488
- field: collectionField,
489
- block: 'Form',
490
- readPretty: field.readPretty,
491
- action: tk ? 'get' : null,
492
- targetCollection: targetCollection
486
+ }), isSelectFieldMode && !field.readPretty && /*#__PURE__*/React.createElement(SchemaSettings.ModalItem, {
487
+ title: t('Set the data scope'),
488
+ schema: {
489
+ type: 'object',
490
+ title: t('Set the data scope'),
491
+ properties: {
492
+ filter: {
493
+ default: defaultFilter,
494
+ // title: '数据范围',
495
+ enum: dataSource,
496
+ 'x-component': 'Filter',
497
+ 'x-component-props': {
498
+ dynamicComponent: function dynamicComponent(props) {
499
+ return FilterDynamicComponent(_objectSpread({}, props));
500
+ }
501
+ }
502
+ }
503
+ }
504
+ },
505
+ onSubmit: function onSubmit(_ref4) {
506
+ var _schema6;
507
+ var filter = _ref4.filter;
508
+ filter = removeNullCondition(filter);
509
+ _.set(field.componentProps, 'service.params.filter', filter);
510
+ fieldSchema['x-component-props'] = field.componentProps;
511
+ field.componentProps = field.componentProps;
512
+ dn.emit('patch', {
513
+ schema: (_schema6 = {}, _defineProperty(_schema6, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema6, 'x-component-props', field.componentProps), _schema6)
493
514
  });
494
- insertAdjacent('beforeBegin', divWrap(schema), {
495
- onSuccess: function onSuccess() {
496
- dn.remove(null, {
497
- removeParentsIfNoChildren: true,
498
- breakRemoveOn: {
499
- 'x-component': 'Grid'
515
+ }
516
+ }), isSelectFieldMode && !field.readPretty && /*#__PURE__*/React.createElement(SchemaSettings.ModalItem, {
517
+ title: t('Set default sorting rules'),
518
+ components: {
519
+ ArrayItems: ArrayItems
520
+ },
521
+ schema: {
522
+ type: 'object',
523
+ title: t('Set default sorting rules'),
524
+ properties: {
525
+ sort: {
526
+ type: 'array',
527
+ default: sort,
528
+ 'x-component': 'ArrayItems',
529
+ 'x-decorator': 'FormItem',
530
+ items: {
531
+ type: 'object',
532
+ properties: {
533
+ space: {
534
+ type: 'void',
535
+ 'x-component': 'Space',
536
+ properties: {
537
+ sort: {
538
+ type: 'void',
539
+ 'x-decorator': 'FormItem',
540
+ 'x-component': 'ArrayItems.SortHandle'
541
+ },
542
+ field: {
543
+ type: 'string',
544
+ enum: sortFields,
545
+ 'x-decorator': 'FormItem',
546
+ 'x-component': 'Select',
547
+ 'x-component-props': {
548
+ style: {
549
+ width: 260
550
+ }
551
+ }
552
+ },
553
+ direction: {
554
+ type: 'string',
555
+ 'x-decorator': 'FormItem',
556
+ 'x-component': 'Radio.Group',
557
+ 'x-component-props': {
558
+ optionType: 'button'
559
+ },
560
+ enum: [{
561
+ label: t('ASC'),
562
+ value: 'asc'
563
+ }, {
564
+ label: t('DESC'),
565
+ value: 'desc'
566
+ }]
567
+ },
568
+ remove: {
569
+ type: 'void',
570
+ 'x-decorator': 'FormItem',
571
+ 'x-component': 'ArrayItems.Remove'
572
+ }
573
+ }
574
+ }
500
575
  }
501
- });
576
+ },
577
+ properties: {
578
+ add: {
579
+ type: 'void',
580
+ title: t('Add sort field'),
581
+ 'x-component': 'ArrayItems.Addition'
582
+ }
583
+ }
502
584
  }
585
+ }
586
+ },
587
+ onSubmit: function onSubmit(_ref5) {
588
+ var _schema7;
589
+ var sort = _ref5.sort;
590
+ var sortArr = sort.map(function (item) {
591
+ return item.direction === 'desc' ? "-".concat(item.field) : item.field;
592
+ });
593
+ _.set(field.componentProps, 'service.params.sort', sortArr);
594
+ fieldSchema['x-component-props'] = field.componentProps;
595
+ dn.emit('patch', {
596
+ schema: (_schema7 = {}, _defineProperty(_schema7, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema7, 'x-component-props', field.componentProps), _schema7)
503
597
  });
504
598
  }
599
+ }), isAssociationField && fieldModeOptions && !isTableField && /*#__PURE__*/React.createElement(SchemaSettings.SelectItem, {
600
+ key: "field-mode",
601
+ title: t('Field mode'),
602
+ options: fieldModeOptions,
603
+ value: fieldMode,
604
+ onChange: function onChange(mode) {
605
+ var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
606
+ fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
607
+ fieldSchema['x-component-props']['mode'] = mode;
608
+ schema['x-component-props'] = fieldSchema['x-component-props'];
609
+ field.componentProps = field.componentProps || {};
610
+ field.componentProps.mode = mode;
611
+ if (mode === 'Nester') {
612
+ var initValue = ['o2m', 'm2m'].includes(collectionField.interface) ? [] : {};
613
+ field.value = field.value || initValue;
614
+ }
615
+ dn.emit('patch', {
616
+ schema: schema
617
+ });
618
+ dn.refresh();
619
+ }
620
+ }), !field.readPretty && isAssociationField && ['Select', 'Picker'].includes(fieldMode) && /*#__PURE__*/React.createElement(SchemaSettings.SwitchItem, {
621
+ key: "allowAddNew",
622
+ title: t('Allow add new data'),
623
+ checked: fieldSchema['x-add-new'],
624
+ onChange: function onChange(allowAddNew) {
625
+ var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
626
+ field['x-add-new'] = allowAddNew;
627
+ fieldSchema['x-add-new'] = allowAddNew;
628
+ schema['x-add-new'] = allowAddNew;
629
+ dn.emit('patch', {
630
+ schema: schema
631
+ });
632
+ refresh();
633
+ }
505
634
  }), form && !(form === null || form === void 0 ? void 0 : form.readPretty) && ['o2m', 'm2m'].includes(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface) && fieldSchema['x-component'] !== 'TableField' && /*#__PURE__*/React.createElement(SchemaSettings.SwitchItem, {
506
635
  key: "multiple",
507
636
  title: t('Multiple'),
@@ -518,13 +647,14 @@ FormItem.Designer = function Designer() {
518
647
  });
519
648
  refresh();
520
649
  }
521
- }), field.readPretty && options.length > 0 && fieldSchema['x-component'] === 'CollectionField' && /*#__PURE__*/React.createElement(SchemaSettings.SwitchItem, {
650
+ }), field.readPretty && options.length > 0 && fieldSchema['x-component'] === 'CollectionField' && !isFileField && /*#__PURE__*/React.createElement(SchemaSettings.SwitchItem, {
522
651
  title: t('Enable link'),
523
- checked: ((_fieldSchema$xCompon4 = (_fieldSchema$xCompon5 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon5 === void 0 ? void 0 : _fieldSchema$xCompon5.mode) !== null && _fieldSchema$xCompon4 !== void 0 ? _fieldSchema$xCompon4 : 'links') === 'links',
652
+ checked: ((_fieldSchema$xCompon4 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon4 === void 0 ? void 0 : _fieldSchema$xCompon4.enableLink) !== false,
524
653
  onChange: function onChange(flag) {
525
654
  fieldSchema['x-component-props'] = _objectSpread(_objectSpread({}, fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-component-props']), {}, {
526
- mode: flag ? 'links' : 'tags'
655
+ enableLink: flag
527
656
  });
657
+ field.componentProps['enableLink'] = flag;
528
658
  dn.emit('patch', {
529
659
  schema: {
530
660
  'x-uid': fieldSchema['x-uid'],
@@ -589,16 +719,17 @@ FormItem.Designer = function Designer() {
589
719
  key: "title-field",
590
720
  title: t('Title field'),
591
721
  options: options,
592
- value: field === null || field === void 0 ? void 0 : (_field$componentProps = field.componentProps) === null || _field$componentProps === void 0 ? void 0 : (_field$componentProps2 = _field$componentProps.fieldNames) === null || _field$componentProps2 === void 0 ? void 0 : _field$componentProps2.label,
722
+ value: field === null || field === void 0 ? void 0 : (_field$componentProps8 = field.componentProps) === null || _field$componentProps8 === void 0 ? void 0 : (_field$componentProps9 = _field$componentProps8.fieldNames) === null || _field$componentProps9 === void 0 ? void 0 : _field$componentProps9.label,
593
723
  onChange: function onChange(label) {
594
- var _collectionField$uiSc5, _collectionField$uiSc6;
724
+ var _collectionField$uiSc4, _collectionField$uiSc5;
595
725
  var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
596
- var fieldNames = _objectSpread(_objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc5 = collectionField.uiSchema) === null || _collectionField$uiSc5 === void 0 ? void 0 : (_collectionField$uiSc6 = _collectionField$uiSc5['x-component-props']) === null || _collectionField$uiSc6 === void 0 ? void 0 : _collectionField$uiSc6['fieldNames']), field.componentProps.fieldNames), {}, {
726
+ var fieldNames = _objectSpread(_objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc4 = collectionField.uiSchema) === null || _collectionField$uiSc4 === void 0 ? void 0 : (_collectionField$uiSc5 = _collectionField$uiSc4['x-component-props']) === null || _collectionField$uiSc5 === void 0 ? void 0 : _collectionField$uiSc5['fieldNames']), field.componentProps.fieldNames), {}, {
597
727
  label: label
598
728
  });
599
729
  fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
600
730
  fieldSchema['x-component-props']['fieldNames'] = fieldNames;
601
731
  schema['x-component-props'] = fieldSchema['x-component-props'];
732
+ field.componentProps.fieldNames = fieldSchema['x-component-props'].fieldNames;
602
733
  dn.emit('patch', {
603
734
  schema: schema
604
735
  });
@@ -615,14 +746,14 @@ FormItem.Designer = function Designer() {
615
746
  }
616
747
  }));
617
748
  };
618
- function isFileCollection(collection) {
749
+ export function isFileCollection(collection) {
619
750
  return (collection === null || collection === void 0 ? void 0 : collection.template) === 'file';
620
751
  }
621
752
  FormItem.FilterFormDesigner = FilterFormDesigner;
622
753
  export function getFieldDefaultValue(fieldSchema, collectionField) {
623
- var _collectionField$uiSc7;
754
+ var _collectionField$uiSc6;
624
755
  var result = (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.default) || (collectionField === null || collectionField === void 0 ? void 0 : collectionField.defaultValue);
625
- if ((collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc7 = collectionField.uiSchema) === null || _collectionField$uiSc7 === void 0 ? void 0 : _collectionField$uiSc7['x-component']) === 'DatePicker' && result) {
756
+ if ((collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc6 = collectionField.uiSchema) === null || _collectionField$uiSc6 === void 0 ? void 0 : _collectionField$uiSc6['x-component']) === 'DatePicker' && result) {
626
757
  return moment(result);
627
758
  }
628
759
  return result;
@@ -13,11 +13,12 @@ import { uid } from '@formily/shared';
13
13
  import _ from 'lodash';
14
14
  import React from 'react';
15
15
  import { useTranslation } from 'react-i18next';
16
- import { useFilterByTk, useFormBlockContext } from '../../../block-provider';
16
+ import { useFormBlockContext } from '../../../block-provider';
17
17
  import { useCollection, useCollectionManager } from '../../../collection-manager';
18
18
  import { SchemaSettings, isPatternDisabled } from '../../../schema-settings';
19
- import { useCompile, useDesignable, useFieldComponentOptions } from '../../hooks';
19
+ import { useCompile, useDesignable, useFieldModeOptions } from '../../hooks';
20
20
  import { useOperatorList } from '../filter/useOperators';
21
+ import { isFileCollection } from './FormItem';
21
22
  export var findFilterOperators = function findFilterOperators(schema) {
22
23
  while (schema) {
23
24
  if (schema['x-filter-operators']) {
@@ -387,64 +388,39 @@ export var EditDefaultValue = function EditDefaultValue() {
387
388
  }) : null;
388
389
  };
389
390
  export var EditComponent = function EditComponent() {
391
+ var _field$componentProps;
390
392
  var _useCollectionManager4 = useCollectionManager(),
391
- getInterface = _useCollectionManager4.getInterface,
392
393
  getCollectionJoinField = _useCollectionManager4.getCollectionJoinField,
393
394
  getCollection = _useCollectionManager4.getCollection;
394
395
  var _useCollection4 = useCollection(),
395
- getField = _useCollection4.getField,
396
- template = _useCollection4.template;
397
- var tk = useFilterByTk();
398
- var _useFormBlockContext3 = useFormBlockContext(),
399
- form = _useFormBlockContext3.form;
396
+ getField = _useCollection4.getField;
400
397
  var field = useField();
401
398
  var fieldSchema = useFieldSchema();
402
399
  var _useTranslation7 = useTranslation(),
403
400
  t = _useTranslation7.t;
404
401
  var _useDesignable7 = useDesignable(),
405
- dn = _useDesignable7.dn,
406
- insertAdjacent = _useDesignable7.insertAdjacent;
402
+ dn = _useDesignable7.dn;
407
403
  var collectionField = getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']);
408
- var interfaceConfig = getInterface(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface);
409
- var fieldComponentOptions = useFieldComponentOptions();
410
- var isSubFormAssociationField = field.address.segments.includes('__form_grid');
411
- return form && !isSubFormAssociationField && fieldComponentOptions ? /*#__PURE__*/React.createElement(SchemaSettings.SelectItem, {
412
- title: t('Field component'),
413
- options: fieldComponentOptions,
414
- value: fieldSchema['x-component'],
415
- onChange: function onChange(type) {
416
- var _collectionField$uiSc4, _interfaceConfig$sche;
417
- var schema = {
418
- name: collectionField.name,
419
- type: 'void',
420
- required: fieldSchema['required'],
421
- description: fieldSchema['description'],
422
- default: fieldSchema['default'],
423
- 'x-decorator': 'FormItem',
424
- 'x-designer': 'FormItem.Designer',
425
- 'x-component': type,
426
- 'x-validator': fieldSchema['x-validator'],
427
- 'x-collection-field': fieldSchema['x-collection-field'],
428
- 'x-decorator-props': fieldSchema['x-decorator-props'],
429
- 'x-component-props': _objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc4 = collectionField.uiSchema) === null || _collectionField$uiSc4 === void 0 ? void 0 : _collectionField$uiSc4['x-component-props']), fieldSchema['x-component-props'])
430
- };
431
- interfaceConfig === null || interfaceConfig === void 0 ? void 0 : (_interfaceConfig$sche = interfaceConfig.schemaInitialize) === null || _interfaceConfig$sche === void 0 ? void 0 : _interfaceConfig$sche.call(interfaceConfig, schema, {
432
- field: collectionField,
433
- block: 'Form',
434
- readPretty: field.readPretty,
435
- action: tk ? 'get' : null,
436
- targetCollection: getCollection(collectionField.target)
437
- });
438
- insertAdjacent('beforeBegin', divWrap(schema), {
439
- onSuccess: function onSuccess() {
440
- dn.remove(null, {
441
- removeParentsIfNoChildren: true,
442
- breakRemoveOn: {
443
- 'x-component': 'Grid'
444
- }
445
- });
446
- }
404
+ var fieldModeOptions = useFieldModeOptions();
405
+ var isAssociationField = ['belongsTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(collectionField === null || collectionField === void 0 ? void 0 : collectionField.type);
406
+ var targetCollection = getCollection(collectionField === null || collectionField === void 0 ? void 0 : collectionField.target);
407
+ var isFileField = isFileCollection(targetCollection);
408
+ return isAssociationField && fieldModeOptions ? /*#__PURE__*/React.createElement(SchemaSettings.SelectItem, {
409
+ key: "field-mode",
410
+ title: t('Field mode'),
411
+ options: fieldModeOptions,
412
+ value: (field === null || field === void 0 ? void 0 : (_field$componentProps = field.componentProps) === null || _field$componentProps === void 0 ? void 0 : _field$componentProps['mode']) || (isFileField ? 'FileManager' : 'Select'),
413
+ onChange: function onChange(mode) {
414
+ var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
415
+ fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
416
+ fieldSchema['x-component-props']['mode'] = mode;
417
+ schema['x-component-props'] = fieldSchema['x-component-props'];
418
+ field.componentProps = field.componentProps || {};
419
+ field.componentProps.mode = mode;
420
+ dn.emit('patch', {
421
+ schema: schema
447
422
  });
423
+ dn.refresh();
448
424
  }
449
425
  }) : null;
450
426
  };
@@ -453,8 +429,8 @@ export var EditPattern = function EditPattern() {
453
429
  getCollectionJoinField = _useCollectionManager5.getCollectionJoinField;
454
430
  var _useCollection5 = useCollection(),
455
431
  getField = _useCollection5.getField;
456
- var _useFormBlockContext4 = useFormBlockContext(),
457
- form = _useFormBlockContext4.form;
432
+ var _useFormBlockContext3 = useFormBlockContext(),
433
+ form = _useFormBlockContext3.form;
458
434
  var field = useField();
459
435
  var fieldSchema = useFieldSchema();
460
436
  var _useTranslation8 = useTranslation(),
@@ -545,7 +521,8 @@ export var EditOperator = function EditOperator() {
545
521
  dn = _useDesignable9.dn;
546
522
  var operatorList = useOperatorList();
547
523
  var _findFilterOperators2 = findFilterOperators(fieldSchema),
548
- storedOperators = _findFilterOperators2.operators,
524
+ _findFilterOperators3 = _findFilterOperators2.operators,
525
+ storedOperators = _findFilterOperators3 === void 0 ? {} : _findFilterOperators3,
549
526
  uid = _findFilterOperators2.uid;
550
527
  if (operatorList.length && !storedOperators[fieldSchema.name]) {
551
528
  storedOperators[fieldSchema.name] = operatorList[0].value;
@@ -556,9 +533,9 @@ export var EditOperator = function EditOperator() {
556
533
  value: storedOperators[fieldSchema.name],
557
534
  options: compile(operatorList),
558
535
  onChange: function onChange(v) {
559
- var _schema5;
536
+ var _schema6;
560
537
  storedOperators[fieldSchema.name] = v;
561
- var schema = (_schema5 = {}, _defineProperty(_schema5, 'x-uid', uid), _defineProperty(_schema5, 'x-filter-operators', storedOperators), _schema5);
538
+ var schema = (_schema6 = {}, _defineProperty(_schema6, 'x-uid', uid), _defineProperty(_schema6, 'x-filter-operators', storedOperators), _schema6);
562
539
  dn.emit('patch', {
563
540
  schema: schema
564
541
  });
@@ -567,7 +544,7 @@ export var EditOperator = function EditOperator() {
567
544
  }) : null;
568
545
  };
569
546
  export var EditTitleField = function EditTitleField() {
570
- var _getCollectionFields, _field$componentProps, _field$componentProps2;
547
+ var _getCollectionFields, _field$componentProps2, _field$componentProps3;
571
548
  var _useCollectionManager6 = useCollectionManager(),
572
549
  getCollectionFields = _useCollectionManager6.getCollectionFields,
573
550
  getCollectionJoinField = _useCollectionManager6.getCollectionJoinField;
@@ -595,16 +572,17 @@ export var EditTitleField = function EditTitleField() {
595
572
  key: "title-field",
596
573
  title: t('Title field'),
597
574
  options: options,
598
- value: field === null || field === void 0 ? void 0 : (_field$componentProps = field.componentProps) === null || _field$componentProps === void 0 ? void 0 : (_field$componentProps2 = _field$componentProps.fieldNames) === null || _field$componentProps2 === void 0 ? void 0 : _field$componentProps2.label,
575
+ value: field === null || field === void 0 ? void 0 : (_field$componentProps2 = field.componentProps) === null || _field$componentProps2 === void 0 ? void 0 : (_field$componentProps3 = _field$componentProps2.fieldNames) === null || _field$componentProps3 === void 0 ? void 0 : _field$componentProps3.label,
599
576
  onChange: function onChange(label) {
600
- var _collectionField$uiSc5, _collectionField$uiSc6;
577
+ var _collectionField$uiSc4, _collectionField$uiSc5;
601
578
  var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
602
- var fieldNames = _objectSpread(_objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc5 = collectionField.uiSchema) === null || _collectionField$uiSc5 === void 0 ? void 0 : (_collectionField$uiSc6 = _collectionField$uiSc5['x-component-props']) === null || _collectionField$uiSc6 === void 0 ? void 0 : _collectionField$uiSc6['fieldNames']), field.componentProps.fieldNames), {}, {
579
+ var fieldNames = _objectSpread(_objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc4 = collectionField.uiSchema) === null || _collectionField$uiSc4 === void 0 ? void 0 : (_collectionField$uiSc5 = _collectionField$uiSc4['x-component-props']) === null || _collectionField$uiSc5 === void 0 ? void 0 : _collectionField$uiSc5['fieldNames']), field.componentProps.fieldNames), {}, {
603
580
  label: label
604
581
  });
605
582
  fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
606
583
  fieldSchema['x-component-props']['fieldNames'] = fieldNames;
607
584
  schema['x-component-props'] = fieldSchema['x-component-props'];
585
+ field.componentProps.fieldNames = fieldSchema['x-component-props'].fieldNames;
608
586
  dn.emit('patch', {
609
587
  schema: schema
610
588
  });
@@ -70,7 +70,9 @@ export var linkageMergeAction = function linkageMergeAction(_ref, field, conditi
70
70
  }
71
71
  }));
72
72
  valueResult.push(result);
73
- } catch (error) {}
73
+ } catch (error) {
74
+ console.log(error);
75
+ }
74
76
  } else if ((value === null || value === void 0 ? void 0 : value.mode) === 'constant') {
75
77
  valueResult.push((value === null || value === void 0 ? void 0 : value.value) || value);
76
78
  } else {
@@ -97,7 +97,7 @@ export var StandardTooltipContent = function StandardTooltipContent(_ref2) {
97
97
  }
98
98
  }, task.name, ": ", getYmd(task.start), " ~ ", getYmd(task.end)), task.end.getTime() - task.start.getTime() !== 0 && /*#__PURE__*/React.createElement("p", {
99
99
  className: cx(tooltipDefaultContainerParagraph)
100
- }, "Duration: ".concat(~~((task.end.getTime() - task.start.getTime()) / (1000 * 60 * 60 * 24)), " day(s)")), /*#__PURE__*/React.createElement("p", {
100
+ }, "Duration: ".concat(Math.round((task.end.getTime() - task.start.getTime()) / (1000 * 60 * 60 * 24) * 10) / 10, " day(s)")), /*#__PURE__*/React.createElement("p", {
101
101
  className: cx(tooltipDefaultContainerParagraph)
102
102
  }, !!task.progress && "Progress: ".concat(task.progress, "%")));
103
103
  };
@@ -1,4 +1,5 @@
1
1
  export * from './action';
2
+ export * from './association-field';
2
3
  export * from './association-select';
3
4
  export * from './block-item';
4
5
  export * from './calendar';
@@ -10,11 +11,13 @@ export * from './color-select';
10
11
  export * from './cron';
11
12
  export * from './date-picker';
12
13
  export * from './details';
14
+ export * from './expand-action';
13
15
  export * from './filter';
14
16
  export * from './form';
15
17
  export * from './form-item';
16
18
  export * from './form-v2';
17
19
  export * from './g2plot';
20
+ export * from './gantt';
18
21
  export * from './grid';
19
22
  export * from './icon-picker';
20
23
  export * from './input';
@@ -40,5 +43,4 @@ export * from './time-picker';
40
43
  export * from './tree-select';
41
44
  export * from './upload';
42
45
  export * from './variable';
43
- export * from './gantt';
44
46
  import './index.less';
@@ -1,4 +1,5 @@
1
1
  export * from './action';
2
+ export * from './association-field';
2
3
  export * from './association-select';
3
4
  export * from './block-item';
4
5
  export * from './calendar';
@@ -10,11 +11,13 @@ export * from './color-select';
10
11
  export * from './cron';
11
12
  export * from './date-picker';
12
13
  export * from './details';
14
+ export * from './expand-action';
13
15
  export * from './filter';
14
16
  export * from './form';
15
17
  export * from './form-item';
16
18
  export * from './form-v2';
17
19
  export * from './g2plot';
20
+ export * from './gantt';
18
21
  export * from './grid';
19
22
  export * from './icon-picker';
20
23
  export * from './input';
@@ -40,5 +43,4 @@ export * from './time-picker';
40
43
  export * from './tree-select';
41
44
  export * from './upload';
42
45
  export * from './variable';
43
- export * from './gantt';
44
46
  import './index.less';
@@ -232,7 +232,8 @@ Menu.Item = observer(function (props) {
232
232
  eventKey: schema.name,
233
233
  schema: schema
234
234
  }), /*#__PURE__*/React.createElement(SortableItem, {
235
- className: designerCss
235
+ className: designerCss,
236
+ removeParentsIfNoChildren: false
236
237
  }, /*#__PURE__*/React.createElement(Icon, {
237
238
  type: icon
238
239
  }), /*#__PURE__*/React.createElement("span", {
@@ -254,7 +255,8 @@ Menu.URL = observer(function (props) {
254
255
  window.open(props.href, '_blank');
255
256
  }
256
257
  }), /*#__PURE__*/React.createElement(SortableItem, {
257
- className: designerCss
258
+ className: designerCss,
259
+ removeParentsIfNoChildren: false
258
260
  }, /*#__PURE__*/React.createElement(Icon, {
259
261
  type: icon
260
262
  }), /*#__PURE__*/React.createElement("span", {
@@ -276,7 +278,8 @@ Menu.SubMenu = observer(function (props) {
276
278
  key: schema.name,
277
279
  eventKey: schema.name,
278
280
  title: /*#__PURE__*/React.createElement(SortableItem, {
279
- className: subMenuDesignerCss
281
+ className: subMenuDesignerCss,
282
+ removeParentsIfNoChildren: false
280
283
  }, /*#__PURE__*/React.createElement(Icon, {
281
284
  type: icon
282
285
  }), field.title, /*#__PURE__*/React.createElement(Designer, null))
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  export declare const RecordPickerContext: React.Context<any>;
3
3
  export declare const InputRecordPicker: React.FC<any>;
4
+ export declare const RecordPickerProvider: (props: any) => JSX.Element;
4
5
  export declare function isShowFilePicker(labelUiSchema: any): boolean;