@nocobase/client 0.7.6-alpha.2 → 0.8.0-alpha.4

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 (235) hide show
  1. package/es/acl/ACLShortcut.d.ts +2 -0
  2. package/es/acl/ACLShortcut.js +31 -2
  3. package/es/api-client/APIClient.d.ts +1 -0
  4. package/es/api-client/APIClient.js +6 -1
  5. package/es/application/Application.d.ts +3 -1
  6. package/es/application/Application.js +131 -39
  7. package/es/block-provider/BlockProvider.js +12 -1
  8. package/es/block-provider/CalendarBlockProvider.d.ts +1 -0
  9. package/es/block-provider/CalendarBlockProvider.js +6 -3
  10. package/es/block-provider/TableSelectorProvider.js +21 -6
  11. package/es/block-provider/hooks/index.d.ts +6 -0
  12. package/es/block-provider/hooks/index.js +485 -115
  13. package/es/collection-manager/CollectionManagerProvider.js +26 -45
  14. package/es/collection-manager/CollectionManagerShortcut.d.ts +2 -0
  15. package/es/collection-manager/CollectionManagerShortcut.js +38 -3
  16. package/es/collection-manager/Configuration/AddFieldAction.d.ts +5 -1
  17. package/es/collection-manager/Configuration/AddFieldAction.js +44 -13
  18. package/es/collection-manager/Configuration/EditFieldAction.d.ts +1 -0
  19. package/es/collection-manager/Configuration/EditFieldAction.js +24 -11
  20. package/es/collection-manager/Configuration/index.d.ts +2 -0
  21. package/es/collection-manager/Configuration/index.js +2 -0
  22. package/es/collection-manager/Configuration/schemas/collectionFields.js +2 -2
  23. package/es/collection-manager/index.d.ts +1 -0
  24. package/es/collection-manager/index.js +2 -1
  25. package/es/collection-manager/interfaces/index.d.ts +1 -0
  26. package/es/collection-manager/interfaces/index.js +1 -0
  27. package/es/collection-manager/interfaces/json.d.ts +2 -0
  28. package/es/collection-manager/interfaces/json.js +48 -0
  29. package/es/collection-manager/interfaces/m2o.js +3 -3
  30. package/es/collection-manager/interfaces/o2m.js +5 -6
  31. package/es/collection-manager/interfaces/o2o.js +5 -5
  32. package/es/collection-manager/interfaces/properties/index.d.ts +14 -0
  33. package/es/collection-manager/interfaces/properties/index.js +23 -0
  34. package/es/collection-manager/interfaces/sequence.js +13 -9
  35. package/es/index.d.ts +1 -0
  36. package/es/index.js +1 -0
  37. package/es/locale/en_US.d.ts +14 -1
  38. package/es/locale/en_US.js +15 -2
  39. package/es/locale/ja_JP.d.ts +2 -1
  40. package/es/locale/ja_JP.js +2 -1
  41. package/es/locale/ru_RU.d.ts +2 -1
  42. package/es/locale/ru_RU.js +2 -1
  43. package/es/locale/tr_TR.d.ts +1 -1
  44. package/es/locale/tr_TR.js +1 -1
  45. package/es/locale/zh_CN.d.ts +40 -1
  46. package/es/locale/zh_CN.js +41 -2
  47. package/es/plugin-manager/PluginManager.js +35 -23
  48. package/es/pm/PluginManagerLink.d.ts +2 -0
  49. package/es/pm/PluginManagerLink.js +111 -0
  50. package/es/pm/index.d.ts +4 -0
  51. package/es/pm/index.js +422 -0
  52. package/es/route-switch/antd/admin-layout/index.js +1 -1
  53. package/es/schema-component/antd/action/Action.Designer.js +35 -12
  54. package/es/schema-component/antd/action/Action.Modal.js +4 -2
  55. package/es/schema-component/antd/action/Action.js +3 -3
  56. package/es/schema-component/antd/action/context.d.ts +2 -0
  57. package/es/schema-component/antd/action/hooks.d.ts +1 -0
  58. package/es/schema-component/antd/calendar/Calendar.Designer.js +19 -6
  59. package/es/schema-component/antd/calendar/Calendar.js +23 -2
  60. package/es/schema-component/antd/calendar/Title.js +18 -3
  61. package/es/schema-component/antd/calendar/components/Header.d.ts +10 -0
  62. package/es/schema-component/antd/calendar/components/Header.js +43 -0
  63. package/es/schema-component/antd/calendar/style.less +53 -9
  64. package/es/schema-component/antd/calendar/types.d.ts +6 -0
  65. package/es/schema-component/antd/calendar/utils.d.ts +2 -0
  66. package/es/schema-component/antd/calendar/utils.js +7 -0
  67. package/es/schema-component/antd/checkbox/Checkbox.js +13 -4
  68. package/es/schema-component/antd/formula-input/FormulaInput.js +28 -37
  69. package/es/schema-component/antd/input/Input.d.ts +1 -0
  70. package/es/schema-component/antd/input/Input.js +2 -0
  71. package/es/schema-component/antd/input/Json.d.ts +6 -0
  72. package/es/schema-component/antd/input/Json.js +41 -0
  73. package/es/schema-component/antd/input/ReadPretty.d.ts +3 -0
  74. package/es/schema-component/antd/input/ReadPretty.js +15 -0
  75. package/es/schema-component/antd/input/index.d.ts +1 -0
  76. package/es/schema-component/antd/input/index.js +2 -1
  77. package/es/schema-component/antd/markdown/Markdown.Void.js +5 -2
  78. package/es/schema-component/antd/radio/Radio.js +2 -1
  79. package/es/schema-component/antd/select/ReadPretty.js +2 -1
  80. package/es/schema-component/antd/table-v2/TableSelectorDesigner.js +16 -2
  81. package/es/schema-component/antd/upload/Upload.js +2 -1
  82. package/es/schema-component/antd/upload/shared.js +5 -6
  83. package/es/schema-component/antd/upload/type.d.ts +2 -0
  84. package/es/schema-initializer/buttons/BulkEditFormItemInitializers.d.ts +1 -0
  85. package/es/schema-initializer/buttons/BulkEditFormItemInitializers.js +50 -0
  86. package/es/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.d.ts +1 -0
  87. package/es/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.js +35 -0
  88. package/es/schema-initializer/buttons/FormActionInitializers.d.ts +132 -0
  89. package/es/schema-initializer/buttons/FormActionInitializers.js +118 -0
  90. package/es/schema-initializer/buttons/TabPaneInitializers.d.ts +1 -0
  91. package/es/schema-initializer/buttons/TabPaneInitializers.js +13 -0
  92. package/es/schema-initializer/buttons/TableActionInitializers.d.ts +56 -2
  93. package/es/schema-initializer/buttons/TableActionInitializers.js +45 -0
  94. package/es/schema-initializer/buttons/index.d.ts +2 -0
  95. package/es/schema-initializer/buttons/index.js +2 -0
  96. package/es/schema-initializer/components/BulkEditField.d.ts +7 -0
  97. package/es/schema-initializer/components/BulkEditField.js +187 -0
  98. package/es/schema-initializer/components/index.d.ts +1 -0
  99. package/es/schema-initializer/components/index.js +2 -1
  100. package/es/schema-initializer/items/BlockInitializer.js +8 -8
  101. package/es/schema-initializer/items/BulkEditSubmitActionInitializer.d.ts +1 -0
  102. package/es/schema-initializer/items/BulkEditSubmitActionInitializer.js +24 -0
  103. package/es/schema-initializer/items/CreateFormBulkEditBlockInitializer.d.ts +1 -0
  104. package/es/schema-initializer/items/CreateFormBulkEditBlockInitializer.js +103 -0
  105. package/es/schema-initializer/items/CustomizeBulkEditActionInitializer.d.ts +1 -0
  106. package/es/schema-initializer/items/CustomizeBulkEditActionInitializer.js +61 -0
  107. package/es/schema-initializer/items/index.d.ts +3 -0
  108. package/es/schema-initializer/items/index.js +3 -0
  109. package/es/schema-initializer/utils.d.ts +1 -0
  110. package/es/schema-initializer/utils.js +67 -12
  111. package/es/schema-settings/SchemaSettings.d.ts +6 -0
  112. package/es/schema-settings/SchemaSettings.js +4 -1
  113. package/es/schema-templates/BlockTemplatePage.d.ts +1 -0
  114. package/es/schema-templates/BlockTemplatePage.js +7 -0
  115. package/es/schema-templates/SchemaTemplateShortcut.js +1 -1
  116. package/es/system-settings/SystemSettingsShortcut.d.ts +2 -0
  117. package/es/system-settings/SystemSettingsShortcut.js +134 -5
  118. package/lib/acl/ACLShortcut.d.ts +2 -0
  119. package/lib/acl/ACLShortcut.js +41 -4
  120. package/lib/api-client/APIClient.d.ts +1 -0
  121. package/lib/api-client/APIClient.js +6 -1
  122. package/lib/application/Application.d.ts +3 -1
  123. package/lib/application/Application.js +139 -39
  124. package/lib/block-provider/BlockProvider.js +11 -0
  125. package/lib/block-provider/CalendarBlockProvider.d.ts +1 -0
  126. package/lib/block-provider/CalendarBlockProvider.js +6 -3
  127. package/lib/block-provider/TableSelectorProvider.js +21 -6
  128. package/lib/block-provider/hooks/index.d.ts +6 -0
  129. package/lib/block-provider/hooks/index.js +496 -115
  130. package/lib/collection-manager/CollectionManagerProvider.js +28 -47
  131. package/lib/collection-manager/CollectionManagerShortcut.d.ts +2 -0
  132. package/lib/collection-manager/CollectionManagerShortcut.js +47 -4
  133. package/lib/collection-manager/Configuration/AddFieldAction.d.ts +5 -1
  134. package/lib/collection-manager/Configuration/AddFieldAction.js +48 -12
  135. package/lib/collection-manager/Configuration/EditFieldAction.d.ts +1 -0
  136. package/lib/collection-manager/Configuration/EditFieldAction.js +26 -10
  137. package/lib/collection-manager/Configuration/index.d.ts +2 -0
  138. package/lib/collection-manager/Configuration/index.js +26 -0
  139. package/lib/collection-manager/Configuration/schemas/collectionFields.js +2 -2
  140. package/lib/collection-manager/index.d.ts +1 -0
  141. package/lib/collection-manager/index.js +14 -0
  142. package/lib/collection-manager/interfaces/index.d.ts +1 -0
  143. package/lib/collection-manager/interfaces/index.js +13 -0
  144. package/lib/collection-manager/interfaces/json.d.ts +2 -0
  145. package/lib/collection-manager/interfaces/json.js +58 -0
  146. package/lib/collection-manager/interfaces/m2o.js +2 -2
  147. package/lib/collection-manager/interfaces/o2m.js +4 -5
  148. package/lib/collection-manager/interfaces/o2o.js +4 -4
  149. package/lib/collection-manager/interfaces/properties/index.d.ts +14 -0
  150. package/lib/collection-manager/interfaces/properties/index.js +25 -1
  151. package/lib/collection-manager/interfaces/sequence.js +13 -9
  152. package/lib/index.d.ts +1 -0
  153. package/lib/index.js +13 -0
  154. package/lib/locale/en_US.d.ts +14 -1
  155. package/lib/locale/en_US.js +15 -2
  156. package/lib/locale/ja_JP.d.ts +2 -1
  157. package/lib/locale/ja_JP.js +2 -1
  158. package/lib/locale/ru_RU.d.ts +2 -1
  159. package/lib/locale/ru_RU.js +2 -1
  160. package/lib/locale/tr_TR.d.ts +1 -1
  161. package/lib/locale/tr_TR.js +1 -1
  162. package/lib/locale/zh_CN.d.ts +40 -1
  163. package/lib/locale/zh_CN.js +41 -2
  164. package/lib/plugin-manager/PluginManager.js +33 -21
  165. package/lib/pm/PluginManagerLink.d.ts +2 -0
  166. package/lib/pm/PluginManagerLink.js +138 -0
  167. package/lib/pm/index.d.ts +4 -0
  168. package/lib/pm/index.js +474 -0
  169. package/lib/route-switch/antd/admin-layout/index.js +1 -1
  170. package/lib/schema-component/antd/action/Action.Designer.js +35 -12
  171. package/lib/schema-component/antd/action/Action.Modal.js +4 -2
  172. package/lib/schema-component/antd/action/Action.js +3 -3
  173. package/lib/schema-component/antd/action/context.d.ts +2 -0
  174. package/lib/schema-component/antd/action/hooks.d.ts +1 -0
  175. package/lib/schema-component/antd/calendar/Calendar.Designer.js +19 -6
  176. package/lib/schema-component/antd/calendar/Calendar.js +24 -2
  177. package/lib/schema-component/antd/calendar/Title.js +18 -2
  178. package/lib/schema-component/antd/calendar/components/Header.d.ts +10 -0
  179. package/lib/schema-component/antd/calendar/components/Header.js +57 -0
  180. package/lib/schema-component/antd/calendar/style.less +53 -9
  181. package/lib/schema-component/antd/calendar/types.d.ts +6 -0
  182. package/lib/schema-component/antd/calendar/utils.d.ts +2 -0
  183. package/lib/schema-component/antd/calendar/utils.js +18 -2
  184. package/lib/schema-component/antd/checkbox/Checkbox.js +13 -4
  185. package/lib/schema-component/antd/formula-input/FormulaInput.js +28 -37
  186. package/lib/schema-component/antd/input/Input.d.ts +1 -0
  187. package/lib/schema-component/antd/input/Input.js +3 -0
  188. package/lib/schema-component/antd/input/Json.d.ts +6 -0
  189. package/lib/schema-component/antd/input/Json.js +53 -0
  190. package/lib/schema-component/antd/input/ReadPretty.d.ts +3 -0
  191. package/lib/schema-component/antd/input/ReadPretty.js +16 -0
  192. package/lib/schema-component/antd/input/index.d.ts +1 -0
  193. package/lib/schema-component/antd/input/index.js +13 -0
  194. package/lib/schema-component/antd/markdown/Markdown.Void.js +8 -2
  195. package/lib/schema-component/antd/radio/Radio.js +2 -1
  196. package/lib/schema-component/antd/select/ReadPretty.js +2 -1
  197. package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +17 -2
  198. package/lib/schema-component/antd/upload/Upload.js +2 -1
  199. package/lib/schema-component/antd/upload/shared.js +4 -5
  200. package/lib/schema-component/antd/upload/type.d.ts +2 -0
  201. package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.d.ts +1 -0
  202. package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.js +66 -0
  203. package/lib/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.d.ts +1 -0
  204. package/lib/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.js +50 -0
  205. package/lib/schema-initializer/buttons/FormActionInitializers.d.ts +132 -0
  206. package/lib/schema-initializer/buttons/FormActionInitializers.js +121 -2
  207. package/lib/schema-initializer/buttons/TabPaneInitializers.d.ts +1 -0
  208. package/lib/schema-initializer/buttons/TabPaneInitializers.js +18 -2
  209. package/lib/schema-initializer/buttons/TableActionInitializers.d.ts +56 -2
  210. package/lib/schema-initializer/buttons/TableActionInitializers.js +45 -0
  211. package/lib/schema-initializer/buttons/index.d.ts +2 -0
  212. package/lib/schema-initializer/buttons/index.js +26 -0
  213. package/lib/schema-initializer/components/BulkEditField.d.ts +7 -0
  214. package/lib/schema-initializer/components/BulkEditField.js +210 -0
  215. package/lib/schema-initializer/components/index.d.ts +1 -0
  216. package/lib/schema-initializer/components/index.js +13 -0
  217. package/lib/schema-initializer/items/BlockInitializer.js +8 -7
  218. package/lib/schema-initializer/items/BulkEditSubmitActionInitializer.d.ts +1 -0
  219. package/lib/schema-initializer/items/BulkEditSubmitActionInitializer.js +37 -0
  220. package/lib/schema-initializer/items/CreateFormBulkEditBlockInitializer.d.ts +1 -0
  221. package/lib/schema-initializer/items/CreateFormBulkEditBlockInitializer.js +121 -0
  222. package/lib/schema-initializer/items/CustomizeBulkEditActionInitializer.d.ts +1 -0
  223. package/lib/schema-initializer/items/CustomizeBulkEditActionInitializer.js +74 -0
  224. package/lib/schema-initializer/items/index.d.ts +3 -0
  225. package/lib/schema-initializer/items/index.js +39 -0
  226. package/lib/schema-initializer/utils.d.ts +1 -0
  227. package/lib/schema-initializer/utils.js +71 -13
  228. package/lib/schema-settings/SchemaSettings.d.ts +6 -0
  229. package/lib/schema-settings/SchemaSettings.js +3 -0
  230. package/lib/schema-templates/BlockTemplatePage.d.ts +1 -0
  231. package/lib/schema-templates/BlockTemplatePage.js +12 -2
  232. package/lib/schema-templates/SchemaTemplateShortcut.js +1 -1
  233. package/lib/system-settings/SystemSettingsShortcut.d.ts +2 -0
  234. package/lib/system-settings/SystemSettingsShortcut.js +145 -7
  235. package/package.json +5 -4
@@ -1,9 +1,14 @@
1
+ var _templateObject;
2
+
3
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
4
+
1
5
  import { usePrefixCls } from '@formily/antd/lib/__builtins__';
2
6
  import cls from 'classnames';
3
7
  import React from 'react';
4
8
  import { useCompile } from '../..';
5
9
  import { EllipsisWithTooltip } from './EllipsisWithTooltip';
6
10
  import { HTMLEncode } from './shared';
11
+ import { cx, css } from '@emotion/css';
7
12
  export var ReadPretty = function ReadPretty() {
8
13
  return null;
9
14
  };
@@ -90,4 +95,14 @@ ReadPretty.URL = function (props) {
90
95
  className: cls(prefixCls, props.className),
91
96
  style: props.style
92
97
  }, props.addonBefore, props.prefix, content, props.suffix, props.addonAfter);
98
+ };
99
+
100
+ ReadPretty.JSON = function (props) {
101
+ var _props$space;
102
+
103
+ var prefixCls = usePrefixCls('json', props);
104
+ return /*#__PURE__*/React.createElement("pre", {
105
+ className: cx(prefixCls, props.className, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-bottom: 0;\n "])))),
106
+ style: props.style
107
+ }, props.value != null ? JSON.stringify(props.value, null, (_props$space = props.space) !== null && _props$space !== void 0 ? _props$space : 2) : '');
93
108
  };
@@ -1,2 +1,3 @@
1
1
  export * from './Input';
2
2
  export * from './ReadPretty';
3
+ export * from './Json';
@@ -1,2 +1,3 @@
1
1
  export * from './Input';
2
- export * from './ReadPretty';
2
+ export * from './ReadPretty';
3
+ export * from './Json';
@@ -22,6 +22,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
22
 
23
23
  import { observer, useField, useFieldSchema } from '@formily/react';
24
24
  import { Button, Input as AntdInput, Space } from 'antd';
25
+ import cls from 'classnames';
25
26
  import React, { useState } from 'react';
26
27
  import { useTranslation } from 'react-i18next';
27
28
  import { useDesignable } from '../../hooks/useDesignable';
@@ -74,7 +75,8 @@ var MarkdownEditor = function MarkdownEditor(props) {
74
75
  };
75
76
 
76
77
  export var MarkdownVoid = observer(function (props) {
77
- var content = props.content;
78
+ var content = props.content,
79
+ className = props.className;
78
80
  var field = useField();
79
81
  var schema = useFieldSchema();
80
82
 
@@ -84,6 +86,7 @@ export var MarkdownVoid = observer(function (props) {
84
86
  var onSave = props.onSave,
85
87
  _onCancel = props.onCancel;
86
88
  return (field === null || field === void 0 ? void 0 : field.editable) ? /*#__PURE__*/React.createElement(MarkdownEditor, _objectSpread(_objectSpread({}, props), {}, {
89
+ className: true,
87
90
  defaultValue: content,
88
91
  onCancel: function onCancel() {
89
92
  field.editable = false;
@@ -126,7 +129,7 @@ export var MarkdownVoid = observer(function (props) {
126
129
  return onSubmit;
127
130
  }()
128
131
  })) : /*#__PURE__*/React.createElement("div", {
129
- className: 'nb-markdown',
132
+ className: cls(['nb-markdown', className]),
130
133
  dangerouslySetInnerHTML: {
131
134
  __html: markdown(content)
132
135
  }
@@ -24,7 +24,8 @@ Radio.Group = connect(AntdRadio.Group, mapProps({
24
24
  }).map(function (option, key) {
25
25
  return /*#__PURE__*/React.createElement(Tag, {
26
26
  key: key,
27
- color: option.color
27
+ color: option.color,
28
+ icon: option.icon
28
29
  }, option.label);
29
30
  }));
30
31
  }));
@@ -30,7 +30,8 @@ export var ReadPretty = observer(function (props) {
30
30
  return /*#__PURE__*/React.createElement("div", null, options.map(function (option, key) {
31
31
  return /*#__PURE__*/React.createElement(Tag, {
32
32
  key: key,
33
- color: option[fieldNames.color]
33
+ color: option[fieldNames.color],
34
+ icon: option.icon
34
35
  }, option[fieldNames.label]);
35
36
  }));
36
37
  });
@@ -14,6 +14,7 @@ import { useCollectionFilterOptions, useSortFields } from '../../../collection-m
14
14
  import { GeneralSchemaDesigner, SchemaSettings } from '../../../schema-settings';
15
15
  import { useSchemaTemplate } from '../../../schema-templates';
16
16
  import { useDesignable } from '../../hooks';
17
+ import { cloneDeep } from 'lodash';
17
18
  export var TableSelectorDesigner = function TableSelectorDesigner() {
18
19
  var _fieldSchema$xDecora, _fieldSchema$xDecora$, _fieldSchema$xDecora2, _fieldSchema$xDecora3, _field$decoratorProps, _field$decoratorProps2;
19
20
 
@@ -27,7 +28,8 @@ export var TableSelectorDesigner = function TableSelectorDesigner() {
27
28
  var sortFields = useSortFields(name);
28
29
 
29
30
  var _useTableSelectorCont = useTableSelectorContext(),
30
- service = _useTableSelectorCont.service;
31
+ service = _useTableSelectorCont.service,
32
+ extraFilter = _useTableSelectorCont.extraFilter;
31
33
 
32
34
  var _useTranslation = useTranslation(),
33
35
  t = _useTranslation.t;
@@ -75,8 +77,20 @@ export var TableSelectorDesigner = function TableSelectorDesigner() {
75
77
  params.filter = filter;
76
78
  field.decoratorProps.params = params;
77
79
  fieldSchema['x-decorator-props']['params'] = params;
80
+ var serviceFilter = cloneDeep(filter);
81
+
82
+ if (extraFilter) {
83
+ if (serviceFilter) {
84
+ serviceFilter = {
85
+ $and: [extraFilter, serviceFilter]
86
+ };
87
+ } else {
88
+ serviceFilter = extraFilter;
89
+ }
90
+ }
91
+
78
92
  service.run(_objectSpread(_objectSpread({}, (_service$params = service.params) === null || _service$params === void 0 ? void 0 : _service$params[0]), {}, {
79
- filter: filter,
93
+ filter: serviceFilter,
80
94
  page: 1
81
95
  }));
82
96
  dn.emit('patch', {
@@ -232,9 +232,10 @@ Upload.Attachment = connect(function (props) {
232
232
  }));
233
233
  }, mapReadPretty(ReadPretty.Attachment));
234
234
  Upload.Dragger = connect(function (props) {
235
+ var tipContent = props.tipContent;
235
236
  return /*#__PURE__*/React.createElement("div", {
236
237
  className: usePrefixCls('upload-dragger')
237
- }, /*#__PURE__*/React.createElement(AntdUpload.Dragger, _objectSpread({}, useUploadProps(props))));
238
+ }, /*#__PURE__*/React.createElement(AntdUpload.Dragger, _objectSpread({}, useUploadProps(props)), tipContent, props.children));
238
239
  }, mapProps({
239
240
  value: 'fileList'
240
241
  }));
@@ -24,7 +24,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
24
24
 
25
25
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
26
26
 
27
- import { useField, useForm } from '@formily/react';
27
+ import { useField } from '@formily/react';
28
28
  import { reaction } from '@formily/reactive';
29
29
  import { isArr, isValid, toArr as toArray } from '@formily/shared';
30
30
  import { useEffect } from 'react';
@@ -197,9 +197,11 @@ export function useUploadProps(_ref) {
197
197
  (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, normalizeFileList(_toConsumableArray(param.fileList)));
198
198
  };
199
199
 
200
- var form = useForm();
201
200
  var api = useAPIClient();
202
201
  return _objectSpread(_objectSpread({}, props), {}, {
202
+ // in customRequest method can't modify form's status(e.g: form.disabled=true )
203
+ // that will be trigger Upload component(actual Underlying is AjaxUploader component )'s componentWillUnmount method
204
+ // which will cause multiple files upload fail
203
205
  customRequest: function customRequest(_ref2) {
204
206
  var action = _ref2.action,
205
207
  data = _ref2.data,
@@ -219,7 +221,6 @@ export function useUploadProps(_ref) {
219
221
  }
220
222
 
221
223
  formData.append(filename, file);
222
- form.disabled = true;
223
224
  api.axios.post(action, formData, {
224
225
  withCredentials: withCredentials,
225
226
  headers: headers,
@@ -233,9 +234,7 @@ export function useUploadProps(_ref) {
233
234
  }).then(function (_ref4) {
234
235
  var data = _ref4.data;
235
236
  onSuccess(data, file);
236
- }).catch(onError).finally(function () {
237
- form.disabled = false;
238
- });
237
+ }).catch(onError).finally(function () {});
239
238
  return {
240
239
  abort: function abort() {
241
240
  console.log('upload progress is aborted.');
@@ -12,6 +12,8 @@ export type UploadProps = Omit<AntdUploadProps, 'onChange'> & {
12
12
  export type DraggerProps = Omit<AntdDraggerProps, 'onChange'> & {
13
13
  onChange?: (fileList: UploadFile[]) => void;
14
14
  serviceErrorMessage?: string;
15
+ tipContent?: string | React.ReactNode;
16
+ children?: React.ReactNode;
15
17
  };
16
18
 
17
19
  export type ComposedUpload = React.FC<UploadProps> & {
@@ -0,0 +1 @@
1
+ export declare const BulkEditFormItemInitializers: (props: any) => JSX.Element;
@@ -0,0 +1,50 @@
1
+ import { union } from 'lodash';
2
+ import React from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import { SchemaInitializer } from '../SchemaInitializer';
5
+ import { gridRowColWrap, useAssociatedFormItemInitializerFields, useCustomBulkEditFormItemInitializerFields } from '../utils';
6
+ export var BulkEditFormItemInitializers = function BulkEditFormItemInitializers(props) {
7
+ var _useTranslation = useTranslation(),
8
+ t = _useTranslation.t;
9
+
10
+ var insertPosition = props.insertPosition,
11
+ component = props.component;
12
+ var associationFields = useAssociatedFormItemInitializerFields({
13
+ readPretty: true,
14
+ block: 'Form'
15
+ });
16
+ return /*#__PURE__*/React.createElement(SchemaInitializer.Button, {
17
+ wrap: gridRowColWrap,
18
+ icon: 'SettingOutlined',
19
+ items: union([{
20
+ type: 'itemGroup',
21
+ title: t('Display fields'),
22
+ children: useCustomBulkEditFormItemInitializerFields()
23
+ }], associationFields.length > 0 ? [{
24
+ type: 'divider'
25
+ }, {
26
+ type: 'itemGroup',
27
+ title: t('Display association fields'),
28
+ children: associationFields
29
+ }] : [], [{
30
+ type: 'divider'
31
+ }, {
32
+ type: 'item',
33
+ title: t('Add text'),
34
+ component: 'BlockInitializer',
35
+ schema: {
36
+ type: 'void',
37
+ 'x-editable': false,
38
+ 'x-decorator': 'FormItem',
39
+ 'x-designer': 'Markdown.Void.Designer',
40
+ 'x-component': 'Markdown.Void',
41
+ 'x-component-props': {
42
+ content: t('This is a demo text, **supports Markdown syntax**.')
43
+ }
44
+ }
45
+ }]),
46
+ insertPosition: insertPosition,
47
+ component: component,
48
+ title: component ? null : t('Configure fields')
49
+ });
50
+ };
@@ -0,0 +1 @@
1
+ export declare const CreateFormBulkEditBlockInitializers: (props: any) => JSX.Element;
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { SchemaInitializer } from '../..';
4
+ import { gridRowColWrap } from '../utils';
5
+ export var CreateFormBulkEditBlockInitializers = function CreateFormBulkEditBlockInitializers(props) {
6
+ var _useTranslation = useTranslation(),
7
+ t = _useTranslation.t;
8
+
9
+ var insertPosition = props.insertPosition,
10
+ component = props.component;
11
+ return /*#__PURE__*/React.createElement(SchemaInitializer.Button, {
12
+ wrap: gridRowColWrap,
13
+ title: component ? null : t('Add block'),
14
+ icon: 'PlusOutlined',
15
+ insertPosition: insertPosition,
16
+ component: component,
17
+ items: [{
18
+ type: 'itemGroup',
19
+ title: '{{t("Data blocks")}}',
20
+ children: [{
21
+ type: 'item',
22
+ title: '{{t("Form")}}',
23
+ component: 'CreateFormBulkEditBlockInitializer'
24
+ }]
25
+ }, {
26
+ type: 'itemGroup',
27
+ title: '{{t("Other blocks")}}',
28
+ children: [{
29
+ type: 'item',
30
+ title: '{{t("Markdown")}}',
31
+ component: 'MarkdownBlockInitializer'
32
+ }]
33
+ }]
34
+ });
35
+ };
@@ -394,3 +394,135 @@ export declare const UpdateFormActionInitializers: {
394
394
  })[];
395
395
  })[];
396
396
  };
397
+ export declare const BulkEditFormActionInitializers: {
398
+ title: string;
399
+ icon: string;
400
+ items: ({
401
+ type: string;
402
+ title: string;
403
+ children: {
404
+ type: string;
405
+ title: string;
406
+ component: string;
407
+ schema: {
408
+ 'x-action-settings': {};
409
+ };
410
+ }[];
411
+ } | {
412
+ type: string;
413
+ title?: undefined;
414
+ children?: undefined;
415
+ } | {
416
+ type: string;
417
+ title: string;
418
+ children: ({
419
+ type: string;
420
+ title: string;
421
+ component: string;
422
+ schema: {
423
+ type: string;
424
+ title: string;
425
+ 'x-action': string;
426
+ 'x-designer': string;
427
+ 'x-component': string;
428
+ 'x-component-props': {
429
+ openMode: string;
430
+ useProps?: undefined;
431
+ };
432
+ properties: {
433
+ drawer: {
434
+ type: string;
435
+ title: string;
436
+ 'x-component': string;
437
+ 'x-component-props': {
438
+ className: string;
439
+ };
440
+ properties: {
441
+ tabs: {
442
+ type: string;
443
+ 'x-component': string;
444
+ 'x-component-props': {};
445
+ 'x-initializer': string;
446
+ properties: {
447
+ tab1: {
448
+ type: string;
449
+ title: string;
450
+ 'x-component': string;
451
+ 'x-designer': string;
452
+ 'x-component-props': {};
453
+ properties: {
454
+ grid: {
455
+ type: string;
456
+ 'x-component': string;
457
+ 'x-initializer': string;
458
+ properties: {};
459
+ };
460
+ };
461
+ };
462
+ };
463
+ };
464
+ };
465
+ };
466
+ };
467
+ 'x-designer-props'?: undefined;
468
+ 'x-action-settings'?: undefined;
469
+ };
470
+ } | {
471
+ type: string;
472
+ title: string;
473
+ component: string;
474
+ schema: {
475
+ title: string;
476
+ 'x-component': string;
477
+ 'x-action': string;
478
+ 'x-designer': string;
479
+ 'x-designer-props': {
480
+ modalTip: string;
481
+ };
482
+ 'x-action-settings': {
483
+ assignedValues: {};
484
+ skipValidator: boolean;
485
+ onSuccess: {
486
+ manualClose: boolean;
487
+ redirecting: boolean;
488
+ successMessage: string;
489
+ };
490
+ requestSettings?: undefined;
491
+ };
492
+ 'x-component-props': {
493
+ useProps: string;
494
+ openMode?: undefined;
495
+ };
496
+ type?: undefined;
497
+ properties?: undefined;
498
+ };
499
+ } | {
500
+ type: string;
501
+ title: string;
502
+ component: string;
503
+ schema: {
504
+ title: string;
505
+ 'x-component': string;
506
+ 'x-action': string;
507
+ 'x-designer': string;
508
+ 'x-action-settings': {
509
+ requestSettings: {};
510
+ skipValidator: boolean;
511
+ onSuccess: {
512
+ manualClose: boolean;
513
+ redirecting: boolean;
514
+ successMessage: string;
515
+ };
516
+ assignedValues?: undefined;
517
+ };
518
+ 'x-component-props': {
519
+ useProps: string;
520
+ openMode?: undefined;
521
+ };
522
+ type?: undefined;
523
+ properties?: undefined;
524
+ 'x-designer-props'?: undefined;
525
+ };
526
+ })[];
527
+ })[];
528
+ };
@@ -352,4 +352,122 @@ export var UpdateFormActionInitializers = {
352
352
  }
353
353
  }]
354
354
  }]
355
+ };
356
+ export var BulkEditFormActionInitializers = {
357
+ title: '{{t("Configure actions")}}',
358
+ icon: 'SettingOutlined',
359
+ items: [{
360
+ type: 'itemGroup',
361
+ title: '{{t("Enable actions")}}',
362
+ children: [{
363
+ type: 'item',
364
+ title: '{{t("Submit")}}',
365
+ component: 'BulkEditSubmitActionInitializer',
366
+ schema: {
367
+ 'x-action-settings': {}
368
+ }
369
+ }]
370
+ }, {
371
+ type: 'divider'
372
+ }, {
373
+ type: 'subMenu',
374
+ title: '{{t("Customize")}}',
375
+ children: [{
376
+ type: 'item',
377
+ title: '{{t("Popup")}}',
378
+ component: 'CustomizeActionInitializer',
379
+ schema: {
380
+ type: 'void',
381
+ title: '{{ t("Popup") }}',
382
+ 'x-action': 'customize:popup',
383
+ 'x-designer': 'Action.Designer',
384
+ 'x-component': 'Action',
385
+ 'x-component-props': {
386
+ openMode: 'drawer'
387
+ },
388
+ properties: {
389
+ drawer: {
390
+ type: 'void',
391
+ title: '{{ t("Popup") }}',
392
+ 'x-component': 'Action.Container',
393
+ 'x-component-props': {
394
+ className: 'nb-action-popup'
395
+ },
396
+ properties: {
397
+ tabs: {
398
+ type: 'void',
399
+ 'x-component': 'Tabs',
400
+ 'x-component-props': {},
401
+ 'x-initializer': 'TabPaneInitializers',
402
+ properties: {
403
+ tab1: {
404
+ type: 'void',
405
+ title: '{{t("Details")}}',
406
+ 'x-component': 'Tabs.TabPane',
407
+ 'x-designer': 'Tabs.Designer',
408
+ 'x-component-props': {},
409
+ properties: {
410
+ grid: {
411
+ type: 'void',
412
+ 'x-component': 'Grid',
413
+ 'x-initializer': 'RecordBlockInitializers',
414
+ properties: {}
415
+ }
416
+ }
417
+ }
418
+ }
419
+ }
420
+ }
421
+ }
422
+ }
423
+ }
424
+ }, {
425
+ type: 'item',
426
+ title: '{{t("Save record")}}',
427
+ component: 'CustomizeActionInitializer',
428
+ schema: {
429
+ title: '{{ t("Save") }}',
430
+ 'x-component': 'Action',
431
+ 'x-action': 'customize:save',
432
+ 'x-designer': 'Action.Designer',
433
+ 'x-designer-props': {
434
+ modalTip: '{{ t("When the button is clicked, the following fields will be assigned and saved together with the fields in the form. If there are overlapping fields, the value here will overwrite the value in the form.") }}'
435
+ },
436
+ 'x-action-settings': {
437
+ assignedValues: {},
438
+ skipValidator: false,
439
+ onSuccess: {
440
+ manualClose: true,
441
+ redirecting: false,
442
+ successMessage: '{{t("Saved successfully")}}'
443
+ }
444
+ },
445
+ 'x-component-props': {
446
+ useProps: '{{ useUpdateActionProps }}'
447
+ }
448
+ }
449
+ }, {
450
+ type: 'item',
451
+ title: '{{t("Custom request")}}',
452
+ component: 'CustomizeActionInitializer',
453
+ schema: {
454
+ title: '{{ t("Custom request") }}',
455
+ 'x-component': 'Action',
456
+ 'x-action': 'customize:form:request',
457
+ 'x-designer': 'Action.Designer',
458
+ 'x-action-settings': {
459
+ requestSettings: {},
460
+ skipValidator: false,
461
+ onSuccess: {
462
+ manualClose: false,
463
+ redirecting: false,
464
+ successMessage: '{{t("Request success")}}'
465
+ }
466
+ },
467
+ 'x-component-props': {
468
+ useProps: '{{ useCustomizeRequestActionProps }}'
469
+ }
470
+ }
471
+ }]
472
+ }]
355
473
  };
@@ -1,2 +1,3 @@
1
1
  export declare const TabPaneInitializers: (props?: any) => JSX.Element;
2
2
  export declare const TabPaneInitializersForCreateFormBlock: () => JSX.Element;
3
+ export declare const TabPaneInitializersForBulkEditFormBlock: () => JSX.Element;
@@ -18,6 +18,14 @@ export var TabPaneInitializers = function TabPaneInitializers(props) {
18
18
  var form = useForm();
19
19
  var ctx = useActionContext();
20
20
  var index = useRecordIndex();
21
+ var initializer = 'RecordBlockInitializers';
22
+
23
+ if (props.isCreate || index === null) {
24
+ initializer = 'CreateFormBlockInitializers';
25
+ } else if (props.isBulkEdit) {
26
+ initializer = 'CreateFormBulkEditBlockInitializers';
27
+ }
28
+
21
29
  return {
22
30
  run: function run() {
23
31
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
@@ -156,4 +164,9 @@ export var TabPaneInitializersForCreateFormBlock = function TabPaneInitializersF
156
164
  return /*#__PURE__*/React.createElement(TabPaneInitializers, {
157
165
  isCreate: true
158
166
  });
167
+ };
168
+ export var TabPaneInitializersForBulkEditFormBlock = function TabPaneInitializersForBulkEditFormBlock() {
169
+ return /*#__PURE__*/React.createElement(TabPaneInitializers, {
170
+ isBulkEdit: true
171
+ });
159
172
  };
@@ -4,7 +4,7 @@ export declare const TableActionInitializers: {
4
4
  style: {
5
5
  marginLeft: number;
6
6
  };
7
- items: {
7
+ items: ({
8
8
  type: string;
9
9
  title: string;
10
10
  children: ({
@@ -28,5 +28,59 @@ export declare const TableActionInitializers: {
28
28
  };
29
29
  };
30
30
  })[];
31
- }[];
31
+ } | {
32
+ type: string;
33
+ title?: undefined;
34
+ children?: undefined;
35
+ } | {
36
+ type: string;
37
+ title: string;
38
+ children: ({
39
+ type: string;
40
+ title: string;
41
+ component: string;
42
+ schema: {
43
+ type: string;
44
+ title: string;
45
+ 'x-component': string;
46
+ 'x-align': string;
47
+ 'x-decorator': string;
48
+ 'x-acl-action-props': {
49
+ skipScopeCheck: boolean;
50
+ };
51
+ 'x-action': string;
52
+ 'x-designer': string;
53
+ 'x-action-settings': {
54
+ assignedValues: {};
55
+ updateMode: string;
56
+ onSuccess: {
57
+ manualClose: boolean;
58
+ redirecting: boolean;
59
+ successMessage: string;
60
+ };
61
+ };
62
+ 'x-component-props': {
63
+ useProps: string;
64
+ };
65
+ };
66
+ } | {
67
+ type: string;
68
+ title: string;
69
+ component: string;
70
+ schema: {
71
+ 'x-align': string;
72
+ 'x-decorator': string;
73
+ 'x-acl-action-props': {
74
+ skipScopeCheck: boolean;
75
+ };
76
+ type?: undefined;
77
+ title?: undefined;
78
+ 'x-component'?: undefined;
79
+ 'x-action'?: undefined;
80
+ 'x-designer'?: undefined;
81
+ 'x-action-settings'?: undefined;
82
+ 'x-component-props'?: undefined;
83
+ };
84
+ })[];
85
+ })[];
32
86
  };