amis-core 6.2.2 → 6.4.0

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 (329) hide show
  1. package/esm/Root.js +1 -1
  2. package/esm/RootRenderer.d.ts +1 -1
  3. package/esm/RootRenderer.js +28 -10
  4. package/esm/SchemaRenderer.js +17 -7
  5. package/esm/Scoped.d.ts +2 -1
  6. package/esm/Scoped.js +30 -14
  7. package/esm/StatusScoped.js +4 -2
  8. package/esm/WithRootStore.js +1 -1
  9. package/esm/WithStore.js +28 -17
  10. package/esm/actions/Action.js +5 -3
  11. package/esm/actions/AjaxAction.js +29 -19
  12. package/esm/actions/BreakAction.js +1 -1
  13. package/esm/actions/BroadcastAction.js +1 -1
  14. package/esm/actions/CmptAction.js +3 -3
  15. package/esm/actions/ContinueAction.js +1 -1
  16. package/esm/actions/CopyAction.js +1 -1
  17. package/esm/actions/CustomAction.js +2 -2
  18. package/esm/actions/DialogAction.d.ts +8 -0
  19. package/esm/actions/DialogAction.js +116 -40
  20. package/esm/actions/DrawerAction.d.ts +5 -0
  21. package/esm/actions/DrawerAction.js +74 -11
  22. package/esm/actions/EmailAction.js +1 -1
  23. package/esm/actions/EventAction.d.ts +20 -0
  24. package/esm/actions/EventAction.js +102 -0
  25. package/esm/actions/LinkAction.js +1 -1
  26. package/esm/actions/LoopAction.js +1 -1
  27. package/esm/actions/PageAction.js +1 -1
  28. package/esm/actions/ParallelAction.js +1 -1
  29. package/esm/actions/PrintAction.d.ts +2 -2
  30. package/esm/actions/PrintAction.js +6 -6
  31. package/esm/actions/StatusAction.js +1 -1
  32. package/esm/actions/SwitchAction.js +1 -1
  33. package/esm/actions/ToastAction.js +1 -1
  34. package/esm/actions/WaitAction.d.ts +18 -0
  35. package/esm/actions/WaitAction.js +41 -0
  36. package/esm/actions/index.d.ts +2 -0
  37. package/esm/components/CustomStyle.js +1 -4
  38. package/esm/components/ErrorBoundary.js +1 -1
  39. package/esm/components/LazyComponent.js +1 -1
  40. package/esm/components/Overlay.d.ts +3 -0
  41. package/esm/components/Overlay.js +7 -4
  42. package/esm/components/PopOver.js +2 -2
  43. package/esm/env.js +1 -1
  44. package/esm/envOverwrite.js +1 -1
  45. package/esm/factory.d.ts +3 -0
  46. package/esm/factory.js +1 -1
  47. package/esm/index.js +6 -4
  48. package/esm/locale.js +4 -2
  49. package/esm/polyfills.js +1 -1
  50. package/esm/renderers/Form.d.ts +6 -4
  51. package/esm/renderers/Form.js +134 -66
  52. package/esm/renderers/Item.d.ts +123 -79
  53. package/esm/renderers/Item.js +159 -60
  54. package/esm/renderers/Options.d.ts +0 -11
  55. package/esm/renderers/Options.js +20 -84
  56. package/esm/renderers/Placeholder.js +1 -1
  57. package/esm/renderers/builtin.js +1 -1
  58. package/esm/renderers/register.js +1 -1
  59. package/esm/renderers/wrapControl.d.ts +2 -1
  60. package/esm/renderers/wrapControl.js +34 -28
  61. package/esm/store/app.d.ts +5 -5
  62. package/esm/store/app.js +1 -1
  63. package/esm/store/combo.d.ts +255 -63
  64. package/esm/store/combo.js +1 -1
  65. package/esm/store/crud.d.ts +5 -5
  66. package/esm/store/crud.js +12 -6
  67. package/esm/store/form.d.ts +105 -25
  68. package/esm/store/form.js +33 -15
  69. package/esm/store/formItem.d.ts +6 -2
  70. package/esm/store/formItem.js +68 -5
  71. package/esm/store/iRenderer.d.ts +5 -5
  72. package/esm/store/iRenderer.js +28 -12
  73. package/esm/store/index.js +1 -1
  74. package/esm/store/list.d.ts +18 -5
  75. package/esm/store/list.js +14 -1
  76. package/esm/store/manager.js +1 -1
  77. package/esm/store/modal.d.ts +5 -5
  78. package/esm/store/modal.js +1 -1
  79. package/esm/store/node.js +1 -1
  80. package/esm/store/pagination.d.ts +5 -5
  81. package/esm/store/pagination.js +1 -1
  82. package/esm/store/root.d.ts +5 -5
  83. package/esm/store/root.js +1 -1
  84. package/esm/store/service.d.ts +5 -5
  85. package/esm/store/service.js +2 -2
  86. package/esm/store/status.js +1 -1
  87. package/esm/store/table.d.ts +244 -55
  88. package/esm/store/table.js +27 -9
  89. package/esm/store/table2.d.ts +5 -5
  90. package/esm/store/table2.js +1 -1
  91. package/esm/theme.js +4 -2
  92. package/esm/types.d.ts +7 -1
  93. package/esm/utils/Animation.js +1 -1
  94. package/esm/utils/ColorScale.js +1 -1
  95. package/esm/utils/DataSchema.js +1 -1
  96. package/esm/utils/DataScope.js +1 -1
  97. package/esm/utils/RootClose.js +1 -1
  98. package/esm/utils/SimpleMap.js +1 -1
  99. package/esm/utils/api.js +1 -1
  100. package/esm/utils/arraySlice.js +1 -1
  101. package/esm/utils/attachmentAdpator.js +1 -1
  102. package/esm/utils/autobind.js +1 -1
  103. package/esm/utils/browser.js +1 -1
  104. package/esm/utils/columnsSplit.js +1 -1
  105. package/esm/utils/concatData.js +1 -1
  106. package/esm/utils/dataMapping.js +1 -1
  107. package/esm/utils/date.js +1 -1
  108. package/esm/utils/debug.js +1 -1
  109. package/esm/utils/decodeEntity.js +1 -1
  110. package/esm/utils/dom.d.ts +2 -2
  111. package/esm/utils/dom.js +72 -13
  112. package/esm/utils/errors.js +1 -1
  113. package/esm/utils/escapeHtml.js +1 -1
  114. package/esm/utils/filter-schema.js +1 -1
  115. package/esm/utils/filter.js +1 -1
  116. package/esm/utils/formatDuration.js +1 -1
  117. package/esm/utils/formula.js +2 -2
  118. package/esm/utils/getVariable.js +1 -1
  119. package/esm/utils/grammar.js +1 -1
  120. package/esm/utils/handleAction.js +1 -1
  121. package/esm/utils/helper.d.ts +12 -6
  122. package/esm/utils/helper.js +41 -18
  123. package/esm/utils/highlight.js +1 -1
  124. package/esm/utils/icon.js +1 -1
  125. package/esm/utils/image.js +1 -1
  126. package/esm/utils/isPureVariable.js +1 -1
  127. package/esm/utils/json-schema-2-amis-schema.js +1 -1
  128. package/esm/utils/keyToPath.js +1 -1
  129. package/esm/utils/labelToString.js +1 -1
  130. package/esm/utils/makeSorter.js +1 -1
  131. package/esm/utils/math.js +1 -1
  132. package/esm/utils/memoryParse.js +1 -1
  133. package/esm/utils/normalizeLink.js +1 -1
  134. package/esm/utils/normalizeOptions.js +1 -1
  135. package/esm/utils/object.js +1 -1
  136. package/esm/utils/offset.js +1 -1
  137. package/esm/utils/offsetParent.js +1 -1
  138. package/esm/utils/optionValueCompare.js +1 -1
  139. package/esm/utils/position.js +1 -1
  140. package/esm/utils/prettyBytes.js +1 -1
  141. package/esm/utils/printElement.js +1 -1
  142. package/esm/utils/renderer-event.d.ts +13 -0
  143. package/esm/utils/renderer-event.js +111 -2
  144. package/esm/utils/replaceText.js +1 -1
  145. package/esm/utils/resize-sensor.js +1 -1
  146. package/esm/utils/resolveCondition.js +1 -1
  147. package/esm/utils/resolveVariable.js +1 -1
  148. package/esm/utils/resolveVariableAndFilter.js +1 -1
  149. package/esm/utils/resolveVariableAndFilterForAsync.js +1 -1
  150. package/esm/utils/scrollPosition.js +1 -1
  151. package/esm/utils/string2regExp.js +1 -1
  152. package/esm/utils/stripNumber.d.ts +1 -1
  153. package/esm/utils/stripNumber.js +4 -3
  154. package/esm/utils/style-helper.d.ts +21 -2
  155. package/esm/utils/style-helper.js +55 -10
  156. package/esm/utils/style.js +1 -1
  157. package/esm/utils/toNumber.js +1 -1
  158. package/esm/utils/tokenize.js +1 -1
  159. package/esm/utils/tpl-builtin.js +1 -1
  160. package/esm/utils/tpl-lodash.js +1 -1
  161. package/esm/utils/tpl.js +4 -4
  162. package/esm/utils/uncontrollable.js +1 -1
  163. package/esm/utils/validateId.js +5 -2
  164. package/esm/utils/validations.js +1 -1
  165. package/lib/Root.js +1 -1
  166. package/lib/RootRenderer.d.ts +2 -2
  167. package/lib/RootRenderer.js +28 -10
  168. package/lib/SchemaRenderer.js +16 -6
  169. package/lib/Scoped.d.ts +2 -1
  170. package/lib/Scoped.js +30 -14
  171. package/lib/StatusScoped.js +4 -2
  172. package/lib/WithRootStore.js +1 -1
  173. package/lib/WithStore.js +28 -17
  174. package/lib/actions/Action.js +5 -3
  175. package/lib/actions/AjaxAction.js +29 -19
  176. package/lib/actions/BreakAction.js +1 -1
  177. package/lib/actions/BroadcastAction.js +1 -1
  178. package/lib/actions/CmptAction.js +3 -3
  179. package/lib/actions/ContinueAction.js +1 -1
  180. package/lib/actions/CopyAction.js +1 -1
  181. package/lib/actions/CustomAction.js +1 -1
  182. package/lib/actions/DialogAction.d.ts +8 -0
  183. package/lib/actions/DialogAction.js +119 -40
  184. package/lib/actions/DrawerAction.d.ts +5 -0
  185. package/lib/actions/DrawerAction.js +77 -11
  186. package/lib/actions/EmailAction.js +1 -1
  187. package/lib/actions/EventAction.d.ts +20 -0
  188. package/lib/actions/EventAction.js +109 -0
  189. package/lib/actions/LinkAction.js +1 -1
  190. package/lib/actions/LoopAction.js +1 -1
  191. package/lib/actions/PageAction.js +1 -1
  192. package/lib/actions/ParallelAction.js +1 -1
  193. package/lib/actions/PrintAction.d.ts +2 -2
  194. package/lib/actions/PrintAction.js +6 -6
  195. package/lib/actions/StatusAction.js +1 -1
  196. package/lib/actions/SwitchAction.js +1 -1
  197. package/lib/actions/ToastAction.js +1 -1
  198. package/lib/actions/WaitAction.d.ts +18 -0
  199. package/lib/actions/WaitAction.js +45 -0
  200. package/lib/actions/index.d.ts +2 -0
  201. package/lib/components/CustomStyle.js +1 -4
  202. package/lib/components/ErrorBoundary.js +1 -1
  203. package/lib/components/LazyComponent.js +1 -1
  204. package/lib/components/Overlay.d.ts +3 -0
  205. package/lib/components/Overlay.js +7 -4
  206. package/lib/components/PopOver.js +1 -1
  207. package/lib/env.js +1 -1
  208. package/lib/envOverwrite.js +1 -1
  209. package/lib/factory.d.ts +3 -0
  210. package/lib/factory.js +1 -1
  211. package/lib/index.js +6 -4
  212. package/lib/locale.js +4 -2
  213. package/lib/polyfills.js +1 -1
  214. package/lib/renderers/Form.d.ts +6 -4
  215. package/lib/renderers/Form.js +135 -65
  216. package/lib/renderers/Item.d.ts +123 -79
  217. package/lib/renderers/Item.js +158 -58
  218. package/lib/renderers/Options.d.ts +0 -11
  219. package/lib/renderers/Options.js +19 -84
  220. package/lib/renderers/Placeholder.js +1 -1
  221. package/lib/renderers/builtin.js +1 -1
  222. package/lib/renderers/register.js +1 -1
  223. package/lib/renderers/wrapControl.d.ts +2 -1
  224. package/lib/renderers/wrapControl.js +34 -28
  225. package/lib/store/app.d.ts +5 -5
  226. package/lib/store/app.js +1 -1
  227. package/lib/store/combo.d.ts +279 -88
  228. package/lib/store/combo.js +1 -1
  229. package/lib/store/crud.d.ts +5 -5
  230. package/lib/store/crud.js +12 -6
  231. package/lib/store/form.d.ts +115 -36
  232. package/lib/store/form.js +33 -15
  233. package/lib/store/formItem.d.ts +6 -2
  234. package/lib/store/formItem.js +67 -4
  235. package/lib/store/iRenderer.d.ts +5 -5
  236. package/lib/store/iRenderer.js +27 -11
  237. package/lib/store/index.js +1 -1
  238. package/lib/store/list.d.ts +18 -5
  239. package/lib/store/list.js +14 -1
  240. package/lib/store/manager.js +1 -1
  241. package/lib/store/modal.d.ts +5 -5
  242. package/lib/store/modal.js +1 -1
  243. package/lib/store/node.js +1 -1
  244. package/lib/store/pagination.d.ts +5 -5
  245. package/lib/store/pagination.js +1 -1
  246. package/lib/store/root.d.ts +5 -5
  247. package/lib/store/root.js +1 -1
  248. package/lib/store/service.d.ts +5 -5
  249. package/lib/store/service.js +2 -2
  250. package/lib/store/status.js +1 -1
  251. package/lib/store/table.d.ts +264 -76
  252. package/lib/store/table.js +27 -9
  253. package/lib/store/table2.d.ts +5 -5
  254. package/lib/store/table2.js +1 -1
  255. package/lib/theme.js +4 -2
  256. package/lib/types.d.ts +7 -1
  257. package/lib/utils/Animation.js +1 -1
  258. package/lib/utils/ColorScale.js +1 -1
  259. package/lib/utils/DataSchema.js +1 -1
  260. package/lib/utils/DataScope.js +1 -1
  261. package/lib/utils/RootClose.js +1 -1
  262. package/lib/utils/SimpleMap.js +1 -1
  263. package/lib/utils/api.js +1 -1
  264. package/lib/utils/arraySlice.js +1 -1
  265. package/lib/utils/attachmentAdpator.js +1 -1
  266. package/lib/utils/autobind.js +1 -1
  267. package/lib/utils/browser.js +1 -1
  268. package/lib/utils/columnsSplit.js +1 -1
  269. package/lib/utils/concatData.js +1 -1
  270. package/lib/utils/dataMapping.js +1 -1
  271. package/lib/utils/date.js +1 -1
  272. package/lib/utils/debug.js +1 -1
  273. package/lib/utils/decodeEntity.js +1 -1
  274. package/lib/utils/dom.d.ts +2 -2
  275. package/lib/utils/dom.js +72 -13
  276. package/lib/utils/errors.js +1 -1
  277. package/lib/utils/escapeHtml.js +1 -1
  278. package/lib/utils/filter-schema.js +1 -1
  279. package/lib/utils/filter.js +1 -1
  280. package/lib/utils/formatDuration.js +1 -1
  281. package/lib/utils/formula.js +2 -2
  282. package/lib/utils/getVariable.js +1 -1
  283. package/lib/utils/grammar.js +1 -1
  284. package/lib/utils/handleAction.js +1 -1
  285. package/lib/utils/helper.d.ts +12 -6
  286. package/lib/utils/helper.js +41 -20
  287. package/lib/utils/highlight.js +1 -1
  288. package/lib/utils/icon.js +1 -1
  289. package/lib/utils/image.js +1 -1
  290. package/lib/utils/isPureVariable.js +1 -1
  291. package/lib/utils/json-schema-2-amis-schema.js +1 -1
  292. package/lib/utils/keyToPath.js +1 -1
  293. package/lib/utils/labelToString.js +1 -1
  294. package/lib/utils/makeSorter.js +1 -1
  295. package/lib/utils/math.js +1 -1
  296. package/lib/utils/memoryParse.js +1 -1
  297. package/lib/utils/normalizeLink.js +1 -1
  298. package/lib/utils/normalizeOptions.js +1 -1
  299. package/lib/utils/object.js +1 -1
  300. package/lib/utils/offset.js +1 -1
  301. package/lib/utils/offsetParent.js +1 -1
  302. package/lib/utils/optionValueCompare.js +1 -1
  303. package/lib/utils/position.js +1 -1
  304. package/lib/utils/prettyBytes.js +1 -1
  305. package/lib/utils/printElement.js +1 -1
  306. package/lib/utils/renderer-event.d.ts +13 -0
  307. package/lib/utils/renderer-event.js +111 -1
  308. package/lib/utils/replaceText.js +1 -1
  309. package/lib/utils/resize-sensor.js +1 -1
  310. package/lib/utils/resolveCondition.js +1 -1
  311. package/lib/utils/resolveVariable.js +1 -1
  312. package/lib/utils/resolveVariableAndFilter.js +1 -1
  313. package/lib/utils/resolveVariableAndFilterForAsync.js +1 -1
  314. package/lib/utils/scrollPosition.js +1 -1
  315. package/lib/utils/string2regExp.js +1 -1
  316. package/lib/utils/stripNumber.d.ts +1 -1
  317. package/lib/utils/stripNumber.js +4 -3
  318. package/lib/utils/style-helper.d.ts +21 -2
  319. package/lib/utils/style-helper.js +55 -10
  320. package/lib/utils/style.js +1 -1
  321. package/lib/utils/toNumber.js +1 -1
  322. package/lib/utils/tokenize.js +1 -1
  323. package/lib/utils/tpl-builtin.js +1 -1
  324. package/lib/utils/tpl-lodash.js +1 -1
  325. package/lib/utils/tpl.js +4 -4
  326. package/lib/utils/uncontrollable.js +1 -1
  327. package/lib/utils/validateId.js +9 -2
  328. package/lib/utils/validations.js +1 -1
  329. package/package.json +5 -3
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v6.2.2
2
+ * amis-core v6.4.0
3
3
  * Copyright 2018-2024 fex
4
4
  */
5
5
 
@@ -7,8 +7,9 @@ import { __extends, __awaiter, __generator, __assign, __read, __rest, __decorate
7
7
  import React from 'react';
8
8
  import hoistNonReactStatic from 'hoist-non-react-statics';
9
9
  import { reaction } from 'mobx';
10
+ import { isAlive } from 'mobx-state-tree';
10
11
  import { registerRenderer, renderersMap } from '../factory.js';
11
- import { ucFirst, getWidthRate, autobind, anyChanged } from '../utils/helper.js';
12
+ import { isEmpty, getTreeAncestors, ucFirst, getWidthRate, autobind, anyChanged } from '../utils/helper.js';
12
13
  import { observer } from 'mobx-react';
13
14
  import { HocStoreFactory } from '../WithStore.js';
14
15
  import { wrapControl } from './wrapControl.js';
@@ -19,7 +20,7 @@ import '../utils/browser.js';
19
20
  import '../utils/ColorScale.js';
20
21
  import 'lodash/chunk';
21
22
  import { getVariable } from '../utils/getVariable.js';
22
- import { createObject } from '../utils/object.js';
23
+ import { setVariable, createObject } from '../utils/object.js';
23
24
  import { dataMapping } from '../utils/dataMapping.js';
24
25
  import '../utils/DataSchema.js';
25
26
  import '../utils/DataScope.js';
@@ -28,12 +29,13 @@ import 'amis-formula';
28
29
  import '../utils/debug.js';
29
30
  import '../utils/errors.js';
30
31
  import '../utils/tpl.js';
31
- import 'lodash/isPlainObject';
32
+ import isPlainObject from 'lodash/isPlainObject';
32
33
  import '../utils/filter.js';
33
34
  import 'lodash/isObject';
34
35
  import 'lodash/isString';
35
36
  import 'lodash/isBoolean';
36
37
  import '../utils/image.js';
38
+ import { keyToPath } from '../utils/keyToPath.js';
37
39
  import 'lodash/isEqual';
38
40
  import '../actions/Action.js';
39
41
  import '../utils/resize-sensor.js';
@@ -67,46 +69,72 @@ var FormItemWrap = /** @class */ (function (_super) {
67
69
  __extends(FormItemWrap, _super);
68
70
  function FormItemWrap(props) {
69
71
  var _this = _super.call(this, props) || this;
70
- _this.reaction = [];
71
- _this.syncAutoFill = debounce(function (term, reload) {
72
- (function (term, reload) { return __awaiter(_this, void 0, void 0, function () {
73
- var _a, autoFill, onBulkChange, formItem, data, itemName, ctx, result;
72
+ _this.mounted = false;
73
+ _this.initedOptionFilled = false;
74
+ _this.initedApiFilled = false;
75
+ _this.toDispose = [];
76
+ _this.syncApiAutoFill = debounce(function (term, forceLoad, skipIfExits) {
77
+ if (skipIfExits === void 0) { skipIfExits = false; }
78
+ return __awaiter(_this, void 0, void 0, function () {
79
+ var _a, autoFill, onBulkChange, formItem, data_1, itemName, ctx, result, e_1;
74
80
  var _b;
75
81
  var _c, _d;
76
82
  return __generator(this, function (_e) {
77
83
  switch (_e.label) {
78
84
  case 0:
79
- _a = this.props, autoFill = _a.autoFill, onBulkChange = _a.onBulkChange, formItem = _a.formItem, data = _a.data;
85
+ _e.trys.push([0, 4, , 5]);
86
+ _a = this.props, autoFill = _a.autoFill, onBulkChange = _a.onBulkChange, formItem = _a.formItem, data_1 = _a.data;
80
87
  // 参照录入
81
- if (!autoFill || (autoFill && !(autoFill === null || autoFill === void 0 ? void 0 : autoFill.hasOwnProperty('api')))) {
88
+ if (!onBulkChange ||
89
+ !formItem ||
90
+ !autoFill ||
91
+ (autoFill && !(autoFill === null || autoFill === void 0 ? void 0 : autoFill.hasOwnProperty('api')))) {
92
+ return [2 /*return*/];
93
+ }
94
+ else if (skipIfExits &&
95
+ (!autoFill.fillMapping ||
96
+ Object.keys(autoFill.fillMapping).some(function (key) { return typeof getVariable(data_1, key) !== 'undefined'; }))) {
97
+ // 只要目标填充值有一个有值,就初始不自动填充
82
98
  return [2 /*return*/];
83
99
  }
84
100
  if (!(autoFill === null || autoFill === void 0 ? void 0 : autoFill.showSuggestion)) return [3 /*break*/, 1];
85
101
  this.handleAutoFill('change');
86
102
  return [3 /*break*/, 3];
87
103
  case 1:
88
- itemName = formItem === null || formItem === void 0 ? void 0 : formItem.name;
89
- ctx = createObject(data, (_b = {},
104
+ itemName = formItem.name;
105
+ ctx = createObject(data_1, (_b = {},
90
106
  _b[itemName || ''] = term,
107
+ _b.__term = term,
91
108
  _b));
92
- if (!((onBulkChange &&
93
- isEffectiveApi(autoFill.api, ctx) &&
94
- this.lastSearchTerm !== term) ||
95
- reload)) return [3 /*break*/, 3];
96
- return [4 /*yield*/, (formItem === null || formItem === void 0 ? void 0 : formItem.loadAutoUpdateData(autoFill.api, ctx, !!((_c = autoFill.api) === null || _c === void 0 ? void 0 : _c.silent)))];
109
+ if (!(forceLoad ||
110
+ (isEffectiveApi(autoFill.api, ctx) && this.lastSearchTerm !== term))) return [3 /*break*/, 3];
111
+ return [4 /*yield*/, formItem.loadAutoUpdateData(autoFill.api, ctx, !!((_c = autoFill.api) === null || _c === void 0 ? void 0 : _c.silent))];
97
112
  case 2:
98
113
  result = _e.sent();
99
114
  this.lastSearchTerm =
100
115
  (_d = (result && getVariable(result, itemName))) !== null && _d !== void 0 ? _d : term;
116
+ // 如果没有返回不应该处理
117
+ if (!result) {
118
+ return [2 /*return*/];
119
+ }
101
120
  if (autoFill === null || autoFill === void 0 ? void 0 : autoFill.fillMapping) {
102
121
  result = dataMapping(autoFill.fillMapping, result);
103
122
  }
104
- result && (onBulkChange === null || onBulkChange === void 0 ? void 0 : onBulkChange(result));
123
+ if (result) {
124
+ // 不能把自己给清了吧
125
+ setVariable(result, itemName, getVariable(result, itemName) || formItem.tmpValue);
126
+ onBulkChange === null || onBulkChange === void 0 ? void 0 : onBulkChange(result);
127
+ }
105
128
  _e.label = 3;
106
- case 3: return [2 /*return*/];
129
+ case 3: return [3 /*break*/, 5];
130
+ case 4:
131
+ e_1 = _e.sent();
132
+ console.error(e_1);
133
+ return [3 /*break*/, 5];
134
+ case 5: return [2 /*return*/];
107
135
  }
108
136
  });
109
- }); })(term, reload).catch(function (e) { return console.error(e); });
137
+ });
110
138
  }, 250, {
111
139
  trailing: true,
112
140
  leading: false
@@ -114,30 +142,57 @@ var FormItemWrap = /** @class */ (function (_super) {
114
142
  _this.state = {
115
143
  isOpened: false
116
144
  };
117
- var model = props.formItem;
118
- if (model) {
119
- _this.reaction.push(reaction(function () { return "".concat(model.errors.join('')).concat(model.isFocused).concat(model.dialogOpen); }, function () { return _this.forceUpdate(); }));
120
- _this.reaction.push(reaction(function () { return model === null || model === void 0 ? void 0 : model.filteredOptions; }, function () { return _this.forceUpdate(); }));
121
- _this.reaction.push(reaction(function () { return JSON.stringify(model.tmpValue); }, function () { return _this.syncAutoFill(model.tmpValue); }));
145
+ var model = props.formItem, formInited = props.formInited, addHook = props.addHook, initAutoFill = props.initAutoFill;
146
+ if (!model) {
147
+ return _this;
122
148
  }
149
+ _this.toDispose.push(reaction(function () {
150
+ return "".concat(model.errors.join('')).concat(model.isFocused).concat(model.dialogOpen).concat(JSON.stringify(model.filteredOptions));
151
+ }, function () { return _this.forceUpdate(); }));
152
+ var onInit = function () {
153
+ var _a;
154
+ _this.initedOptionFilled = true;
155
+ initAutoFill !== false &&
156
+ isAlive(model) &&
157
+ _this.syncOptionAutoFill(model.getSelectedOptions(model.tmpValue), initAutoFill === 'fillIfNotSet');
158
+ _this.initedApiFilled = true;
159
+ initAutoFill !== false &&
160
+ isAlive(model) &&
161
+ _this.syncApiAutoFill((_a = model.tmpValue) !== null && _a !== void 0 ? _a : '', false, initAutoFill === 'fillIfNotSet');
162
+ _this.toDispose.push(reaction(function () { return JSON.stringify(model.tmpValue); }, function () {
163
+ return _this.mounted &&
164
+ _this.initedApiFilled &&
165
+ _this.syncApiAutoFill(model.tmpValue);
166
+ }));
167
+ _this.toDispose.push(reaction(function () { return JSON.stringify(model.getSelectedOptions(model.tmpValue)); }, function () {
168
+ return _this.mounted &&
169
+ _this.initedOptionFilled &&
170
+ _this.syncOptionAutoFill(model.getSelectedOptions(model.tmpValue));
171
+ }));
172
+ };
173
+ _this.toDispose.push(formInited || !addHook
174
+ ? model.addInitHook(onInit, 999)
175
+ : addHook(onInit, 'init', 'post'));
123
176
  return _this;
124
177
  }
178
+ FormItemWrap.prototype.componentDidMount = function () {
179
+ this.mounted = true;
180
+ this.target = findDOMNode(this);
181
+ };
125
182
  FormItemWrap.prototype.componentDidUpdate = function (prevProps) {
126
183
  var _a, _b, _c;
127
184
  var props = this.props;
128
185
  var model = props.formItem;
129
186
  if (isEffectiveApi((_a = props.autoFill) === null || _a === void 0 ? void 0 : _a.api, props.data) &&
130
187
  isApiOutdated((_b = prevProps.autoFill) === null || _b === void 0 ? void 0 : _b.api, (_c = props.autoFill) === null || _c === void 0 ? void 0 : _c.api, prevProps.data, props.data)) {
131
- this.syncAutoFill(model === null || model === void 0 ? void 0 : model.tmpValue, true);
188
+ this.syncApiAutoFill(model === null || model === void 0 ? void 0 : model.tmpValue, true);
132
189
  }
133
190
  };
134
- FormItemWrap.prototype.componentDidMount = function () {
135
- this.target = findDOMNode(this);
136
- };
137
191
  FormItemWrap.prototype.componentWillUnmount = function () {
138
- this.reaction.forEach(function (fn) { return fn(); });
139
- this.reaction = [];
140
- this.syncAutoFill.cancel();
192
+ this.syncApiAutoFill.cancel();
193
+ this.mounted = false;
194
+ this.toDispose.forEach(function (fn) { return fn(); });
195
+ this.toDispose = [];
141
196
  };
142
197
  FormItemWrap.prototype.handleFocus = function (e) {
143
198
  var _a = this.props, model = _a.formItem, autoFill = _a.autoFill;
@@ -168,7 +223,7 @@ var FormItemWrap = /** @class */ (function (_super) {
168
223
  // 参照录入 dialog | drawer
169
224
  trigger === type &&
170
225
  (mode === 'dialog' || mode === 'drawer')) {
171
- formItem === null || formItem === void 0 ? void 0 : formItem.openDialog(this.buildSchema(), data, function (result) {
226
+ formItem === null || formItem === void 0 ? void 0 : formItem.openDialog(this.buildAutoFillSchema(), data, function (confirmed, result) {
172
227
  if (!(result === null || result === void 0 ? void 0 : result.selectedItems)) {
173
228
  return;
174
229
  }
@@ -189,7 +244,50 @@ var FormItemWrap = /** @class */ (function (_super) {
189
244
  }
190
245
  onBulkChange === null || onBulkChange === void 0 ? void 0 : onBulkChange(responseData);
191
246
  };
192
- FormItemWrap.prototype.buildSchema = function () {
247
+ FormItemWrap.prototype.syncOptionAutoFill = function (selectedOptions, skipIfExits) {
248
+ if (skipIfExits === void 0) { skipIfExits = false; }
249
+ var _a = this.props, autoFill = _a.autoFill, multiple = _a.multiple, onBulkChange = _a.onBulkChange, data = _a.data;
250
+ var formItem = this.props.formItem;
251
+ // 参照录入|自动填充
252
+ if (autoFill === null || autoFill === void 0 ? void 0 : autoFill.hasOwnProperty('api')) {
253
+ return;
254
+ }
255
+ if (onBulkChange &&
256
+ autoFill &&
257
+ !isEmpty(autoFill) &&
258
+ formItem.filteredOptions.length) {
259
+ var toSync_1 = dataMapping(autoFill, multiple
260
+ ? {
261
+ items: selectedOptions.map(function (item) {
262
+ return createObject(__assign(__assign({}, data), { ancestors: getTreeAncestors(formItem.filteredOptions, item, true) }), item);
263
+ })
264
+ }
265
+ : createObject(__assign(__assign({}, data), { ancestors: getTreeAncestors(formItem.filteredOptions, selectedOptions[0], true) }), selectedOptions[0]));
266
+ var tmpData_1 = __assign({}, data);
267
+ var result_1 = __assign({}, toSync_1);
268
+ Object.keys(autoFill).forEach(function (key) {
269
+ var keys = keyToPath(key);
270
+ var value = getVariable(toSync_1, key);
271
+ if (skipIfExits) {
272
+ var originValue = getVariable(data, key);
273
+ if (typeof originValue !== 'undefined') {
274
+ value = originValue;
275
+ }
276
+ }
277
+ setVariable(result_1, key, value);
278
+ // 如果左边的 key 是一个路径
279
+ // 这里不希望直接把原始对象都给覆盖没了
280
+ // 而是保留原始的对象,只修改指定的属性
281
+ if (keys.length > 1 && isPlainObject(tmpData_1[keys[0]])) {
282
+ // 存在情况:依次更新同一子路径的多个key,eg: a.b.c1 和 a.b.c2,所以需要同步更新data
283
+ setVariable(tmpData_1, key, value);
284
+ result_1[keys[0]] = tmpData_1[keys[0]];
285
+ }
286
+ });
287
+ onBulkChange(result_1);
288
+ }
289
+ };
290
+ FormItemWrap.prototype.buildAutoFillSchema = function () {
193
291
  var _this = this;
194
292
  var _a = this.props, render = _a.render, autoFill = _a.autoFill, ns = _a.classPrefix, cx = _a.classnames, __ = _a.translate;
195
293
  if (!autoFill || (autoFill && !(autoFill === null || autoFill === void 0 ? void 0 : autoFill.hasOwnProperty('api')))) {
@@ -249,29 +347,9 @@ var FormItemWrap = /** @class */ (function (_super) {
249
347
  }
250
348
  ]
251
349
  };
252
- var schema = {
253
- type: mode,
254
- className: 'auto-fill-dialog',
255
- title: __('FormItem.autoFillSuggest'),
256
- size: size,
257
- body: form,
258
- actions: [
259
- {
260
- type: 'button',
261
- actionType: 'cancel',
262
- label: __('cancel')
263
- },
264
- {
265
- type: 'submit',
266
- actionType: 'submit',
267
- level: 'primary',
268
- label: __('confirm')
269
- }
270
- ]
271
- };
272
350
  if (mode === 'popOver') {
273
351
  return (React.createElement(Overlay, { container: popOverContainer || this.target, target: function () { return _this.target; }, placement: position || 'left-bottom-left-top', show: true },
274
- React.createElement(PopOver, { classPrefix: ns, className: cx("".concat(ns, "auto-fill-popOver"), popOverClassName), style: {
352
+ React.createElement(PopOver, { classPrefix: ns, className: cx("".concat(ns, "Autofill-popOver"), popOverClassName), style: {
275
353
  minWidth: this.target ? this.target.offsetWidth : undefined
276
354
  }, offset: offset, onHide: this.handleClose, overlay: true }, render('popOver-auto-fill-form', form, {
277
355
  onAction: this.handleAction,
@@ -279,7 +357,26 @@ var FormItemWrap = /** @class */ (function (_super) {
279
357
  }))));
280
358
  }
281
359
  else {
282
- return schema;
360
+ return {
361
+ type: mode,
362
+ className: 'auto-fill-dialog',
363
+ title: __('FormItem.autoFillSuggest'),
364
+ size: size,
365
+ body: __assign(__assign({}, form), { wrapWithPanel: false }),
366
+ actions: [
367
+ {
368
+ type: 'button',
369
+ actionType: 'cancel',
370
+ label: __('cancel')
371
+ },
372
+ {
373
+ type: 'submit',
374
+ actionType: 'submit',
375
+ level: 'primary',
376
+ label: __('confirm')
377
+ }
378
+ ]
379
+ };
283
380
  }
284
381
  };
285
382
  // 参照录入popOver提交
@@ -310,7 +407,9 @@ var FormItemWrap = /** @class */ (function (_super) {
310
407
  return [2 /*return*/];
311
408
  }
312
409
  return [2 /*return*/, new Promise(function (resolve) {
313
- return model.openDialog(schema, data, function (result) { return resolve(result); });
410
+ return model.openDialog(schema, data, function (confirmed, value) {
411
+ return resolve(confirmed ? value : false);
412
+ });
314
413
  })];
315
414
  });
316
415
  });
@@ -321,7 +420,7 @@ var FormItemWrap = /** @class */ (function (_super) {
321
420
  if (!model) {
322
421
  return;
323
422
  }
324
- model.closeDialog(values);
423
+ model.closeDialog(true, values);
325
424
  };
326
425
  FormItemWrap.prototype.handleDialogClose = function (confirmed) {
327
426
  if (confirmed === void 0) { confirmed = false; }
@@ -858,11 +957,11 @@ function asFormItem(config) {
858
957
  !!controlSize &&
859
958
  controlSize !== 'full',
860
959
  _a), model === null || model === void 0 ? void 0 : model.errClassNames, getItemInputClassName(this.props)) })),
861
- isOpened ? this.buildSchema() : null));
960
+ isOpened ? this.buildAutoFillSchema() : null));
862
961
  };
863
962
  return class_1;
864
963
  }(FormItemWrap)),
865
- _a.defaultProps = __assign({ className: '', renderLabel: config.renderLabel, renderDescription: config.renderDescription, sizeMutable: config.sizeMutable, wrap: config.wrap, showErrorMsg: config.showErrorMsg }, Control.defaultProps),
964
+ _a.defaultProps = __assign({ initAutoFill: 'fillIfNotSet', className: '', renderLabel: config.renderLabel, renderDescription: config.renderDescription, sizeMutable: config.sizeMutable, wrap: config.wrap, showErrorMsg: config.showErrorMsg }, Control.defaultProps),
866
965
  _a.propsList = __spreadArray([
867
966
  'value',
868
967
  'defaultValue',
@@ -120,17 +120,6 @@ export interface FormOptionsControl extends FormBaseControl {
120
120
  * 选项删除提示文字。
121
121
  */
122
122
  deleteConfirmText?: string;
123
- /**
124
- * 自动填充,当选项被选择的时候,将选项中的其他值同步设置到表单内。
125
- */
126
- autoFill?: {
127
- [propName: string]: string;
128
- };
129
- /**
130
- * @default fillIfNotSet
131
- * 初始化时是否把其他字段同步到表单内部。
132
- */
133
- initAutoFill?: boolean | 'fillIfNotSet';
134
123
  }
135
124
  export interface OptionsBasicConfig extends FormItemBasicConfig {
136
125
  autoLoadOptionsFromSource?: boolean;
@@ -1,12 +1,12 @@
1
1
  /**
2
- * amis-core v6.2.2
2
+ * amis-core v6.4.0
3
3
  * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  import { __extends, __awaiter, __generator, __assign, __spreadArray, __read, __decorate, __metadata } from 'tslib';
7
7
  import { isEffectiveApi, isApiOutdated } from '../utils/api.js';
8
8
  import { isAlive } from 'mobx-state-tree';
9
- import { anyChanged, isEmpty, getTreeAncestors, getTreeDepth, flattenTree, spliceTree, getTree, findTreeIndex, normalizeNodePath, autobind } from '../utils/helper.js';
9
+ import { anyChanged, getTreeDepth, flattenTree, spliceTree, getTree, findTreeIndex, normalizeNodePath, autobind } from '../utils/helper.js';
10
10
  import { reaction } from 'mobx';
11
11
  import { registerFormItem, detectProps as detectProps$1 } from './Item.js';
12
12
  import React from 'react';
@@ -14,13 +14,11 @@ import 'amis-formula';
14
14
  import 'moment';
15
15
  import { createObject, setVariable } from '../utils/object.js';
16
16
  import { isPureVariable } from '../utils/isPureVariable.js';
17
- import { getVariable } from '../utils/getVariable.js';
18
17
  import { resolveVariableAndFilter } from '../utils/resolveVariableAndFilter.js';
19
- import { dataMapping } from '../utils/dataMapping.js';
18
+ import 'lodash/isPlainObject';
20
19
  import '../utils/filter.js';
21
20
  import { filter } from '../utils/tpl.js';
22
21
  import findIndex from 'lodash/findIndex';
23
- import isPlainObject from 'lodash/isPlainObject';
24
22
  import { normalizeOptions } from '../utils/normalizeOptions.js';
25
23
  import { optionValueCompare } from '../utils/optionValueCompare.js';
26
24
  import '../utils/browser.js';
@@ -35,7 +33,6 @@ import 'lodash/isObject';
35
33
  import 'lodash/isString';
36
34
  import 'lodash/isBoolean';
37
35
  import '../utils/image.js';
38
- import { keyToPath } from '../utils/keyToPath.js';
39
36
  import { resolveEventData } from '../utils/renderer-event.js';
40
37
  import '../utils/resize-sensor.js';
41
38
  import 'react-overlays/useRootClose';
@@ -80,40 +77,21 @@ function registerOptionsControl(config) {
80
77
  _this = _super.call(this, props) || this;
81
78
  _this.toDispose = [];
82
79
  _this.mounted = false;
83
- _this.initedFilled = false;
84
80
  var initFetch = props.initFetch, formItem = props.formItem, source = props.source, data = props.data, setPrinstineValue = props.setPrinstineValue, defaultValue = props.defaultValue, multiple = props.multiple, joinValues = props.joinValues, extractValue = props.extractValue, addHook = props.addHook, formInited = props.formInited, valueField = props.valueField, options = props.options, value = props.value, defaultCheckAll = props.defaultCheckAll;
85
- if (formItem) {
86
- formItem.setOptions(normalizeOptions(options, undefined, valueField), _this.changeOptionValue, data);
87
- _this.toDispose.push(reaction(function () { return JSON.stringify([formItem.loading, formItem.filteredOptions]); }, function () { return _this.mounted && _this.forceUpdate(); }));
88
- _this.toDispose.push(reaction(function () {
89
- return JSON.stringify(formItem.getSelectedOptions(formItem.tmpValue));
90
- }, function () {
91
- return _this.mounted &&
92
- _this.initedFilled &&
93
- _this.syncAutoFill(formItem.getSelectedOptions(formItem.tmpValue));
94
- }));
95
- if (formInited || !addHook) {
96
- _this.initedFilled = true;
97
- _this.props.initAutoFill !== false &&
98
- _this.syncAutoFill(formItem.getSelectedOptions(formItem.tmpValue), _this.props.initAutoFill === 'fillIfNotSet');
99
- }
100
- else if (addHook) {
101
- addHook(function () {
102
- _this.initedFilled = true;
103
- _this.props.initAutoFill !== false &&
104
- _this.syncAutoFill(formItem.getSelectedOptions(formItem.tmpValue), _this.props.initAutoFill === 'fillIfNotSet');
105
- }, 'init');
106
- }
107
- // 默认全选。这里会和默认值\回填值逻辑冲突,所以如果有配置source则不执行默认全选
108
- if (multiple &&
109
- defaultCheckAll &&
110
- ((_a = formItem.filteredOptions) === null || _a === void 0 ? void 0 : _a.length) &&
111
- !source) {
112
- _this.defaultCheckAll();
113
- }
81
+ if (!formItem) {
82
+ return _this;
83
+ }
84
+ formItem.setOptions(normalizeOptions(options, undefined, valueField), _this.changeOptionValue, data);
85
+ _this.toDispose.push(reaction(function () { return JSON.stringify([formItem.loading, formItem.filteredOptions]); }, function () { return _this.mounted && _this.forceUpdate(); }));
86
+ // 默认全选。这里会和默认值\回填值逻辑冲突,所以如果有配置source则不执行默认全选
87
+ if (multiple &&
88
+ defaultCheckAll &&
89
+ ((_a = formItem.filteredOptions) === null || _a === void 0 ? void 0 : _a.length) &&
90
+ !source) {
91
+ _this.defaultCheckAll();
114
92
  }
115
93
  var loadOptions = initFetch !== false;
116
- if (formItem && joinValues === false && defaultValue) {
94
+ if (joinValues === false && defaultValue) {
117
95
  var selectedOptions = extractValue
118
96
  ? formItem
119
97
  .getSelectedOptions(value)
@@ -125,9 +103,9 @@ function registerOptionsControl(config) {
125
103
  }
126
104
  loadOptions &&
127
105
  config.autoLoadOptionsFromSource !== false &&
128
- (formInited || !addHook
129
- ? _this.reload()
130
- : addHook && addHook(_this.initOptions, 'init'));
106
+ _this.toDispose.push(formInited || !addHook
107
+ ? formItem.addInitHook(_this.reload)
108
+ : addHook(_this.initOptions, 'init'));
131
109
  return _this;
132
110
  }
133
111
  FormOptionsItem.prototype.componentDidMount = function () {
@@ -185,6 +163,7 @@ function registerOptionsControl(config) {
185
163
  FormOptionsItem.prototype.componentWillUnmount = function () {
186
164
  var _a, _b;
187
165
  (_b = (_a = this.props).removeHook) === null || _b === void 0 ? void 0 : _b.call(_a, this.reload, 'init');
166
+ this.mounted = false;
188
167
  this.toDispose.forEach(function (fn) { return fn(); });
189
168
  this.toDispose = [];
190
169
  };
@@ -234,49 +213,6 @@ function registerOptionsControl(config) {
234
213
  onChange === null || onChange === void 0 ? void 0 : onChange(resetValue !== null && resetValue !== void 0 ? resetValue : '');
235
214
  }
236
215
  };
237
- FormOptionsItem.prototype.syncAutoFill = function (selectedOptions, skipIfExits) {
238
- if (skipIfExits === void 0) { skipIfExits = false; }
239
- var _a = this.props, autoFill = _a.autoFill, multiple = _a.multiple, onBulkChange = _a.onBulkChange, data = _a.data;
240
- var formItem = this.props.formItem;
241
- // 参照录入|自动填充
242
- if (autoFill === null || autoFill === void 0 ? void 0 : autoFill.hasOwnProperty('api')) {
243
- return;
244
- }
245
- if (onBulkChange &&
246
- autoFill &&
247
- !isEmpty(autoFill) &&
248
- formItem.filteredOptions.length) {
249
- var toSync_1 = dataMapping(autoFill, multiple
250
- ? {
251
- items: selectedOptions.map(function (item) {
252
- return createObject(__assign(__assign({}, data), { ancestors: getTreeAncestors(formItem.filteredOptions, item, true) }), item);
253
- })
254
- }
255
- : createObject(__assign(__assign({}, data), { ancestors: getTreeAncestors(formItem.filteredOptions, selectedOptions[0], true) }), selectedOptions[0]));
256
- var tmpData_1 = __assign({}, data);
257
- var result_1 = __assign({}, toSync_1);
258
- Object.keys(autoFill).forEach(function (key) {
259
- var keys = keyToPath(key);
260
- var value = getVariable(toSync_1, key);
261
- if (skipIfExits) {
262
- var originValue = getVariable(data, key);
263
- if (typeof originValue !== 'undefined') {
264
- value = originValue;
265
- }
266
- }
267
- setVariable(result_1, key, value);
268
- // 如果左边的 key 是一个路径
269
- // 这里不希望直接把原始对象都给覆盖没了
270
- // 而是保留原始的对象,只修改指定的属性
271
- if (keys.length > 1 && isPlainObject(tmpData_1[keys[0]])) {
272
- // 存在情况:依次更新同一子路径的多个key,eg: a.b.c1 和 a.b.c2,所以需要同步更新data
273
- setVariable(tmpData_1, key, value);
274
- result_1[keys[0]] = tmpData_1[keys[0]];
275
- }
276
- });
277
- onBulkChange(result_1);
278
- }
279
- };
280
216
  // 当前值,跟设置预期的值格式不一致时自动转换。
281
217
  FormOptionsItem.prototype.normalizeValue = function () {
282
218
  var _a = this.props, joinValues = _a.joinValues, extractValue = _a.extractValue, value = _a.value, multiple = _a.multiple, formItem = _a.formItem, valueField = _a.valueField; _a.enableNodePath; _a.pathSeparator; var onChange = _a.onChange;
@@ -936,7 +872,7 @@ function registerOptionsControl(config) {
936
872
  : [], nodePath: nodePathArray, loading: formItem ? formItem.loading : false, setLoading: this.setLoading, setOptions: this.setOptions, syncOptions: this.syncOptions, reloadOptions: this.reload, deferLoad: this.deferLoad, leftDeferLoad: this.leftDeferLoad, expandTreeOptions: this.expandTreeOptions, creatable: creatable !== false && isEffectiveApi(addApi) ? true : creatable, editable: editable || (editable !== false && isEffectiveApi(editApi)), removable: removable || (removable !== false && isEffectiveApi(deleteApi)), onAdd: this.handleOptionAdd, onEdit: this.handleOptionEdit, onDelete: this.handleOptionDelete })));
937
873
  };
938
874
  FormOptionsItem.displayName = "OptionsControl(".concat(config.type, ")");
939
- FormOptionsItem.defaultProps = __assign({ delimiter: ',', labelField: 'label', valueField: 'value', joinValues: true, extractValue: false, multiple: false, placeholder: 'Select.placeholder', resetValue: '', deleteConfirmText: 'deleteConfirm', initAutoFill: 'fillIfNotSet' }, Control.defaultProps);
875
+ FormOptionsItem.defaultProps = __assign({ delimiter: ',', labelField: 'label', valueField: 'value', joinValues: true, extractValue: false, multiple: false, placeholder: 'Select.placeholder', resetValue: '', deleteConfirmText: 'deleteConfirm' }, Control.defaultProps);
940
876
  FormOptionsItem.propsList = Control.propsList
941
877
  ? __spreadArray([], __read(Control.propsList), false) : [];
942
878
  FormOptionsItem.ComposedComponent = Control;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v6.2.2
2
+ * amis-core v6.4.0
3
3
  * Copyright 2018-2024 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v6.2.2
2
+ * amis-core v6.4.0
3
3
  * Copyright 2018-2024 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v6.2.2
2
+ * amis-core v6.4.0
3
3
  * Copyright 2018-2024 fex
4
4
  */
5
5
 
@@ -32,7 +32,7 @@ export interface ControlOutterProps extends RendererProps {
32
32
  submitOnChange?: boolean;
33
33
  validate?: (value: any, values: any, name: string) => any;
34
34
  formItem?: IFormItemStore;
35
- addHook?: (fn: () => any, type?: 'validate' | 'init' | 'flush') => void;
35
+ addHook?: (fn: () => any, type?: 'validate' | 'init' | 'flush') => () => void;
36
36
  removeHook?: (fn: () => any, type?: 'validate' | 'init' | 'flush') => void;
37
37
  $schema: {
38
38
  pipeIn?: (value: any, data: any) => any;
@@ -42,6 +42,7 @@ export interface ControlOutterProps extends RendererProps {
42
42
  store?: IIRendererStore;
43
43
  onChange?: (value: any, name: string, submit?: boolean, changePristine?: boolean) => void;
44
44
  formItemDispatchEvent: (type: string, data: any) => void;
45
+ formItemRef?: (control: any) => void;
45
46
  }
46
47
  export interface ControlProps {
47
48
  onBulkChange?: (values: Object) => void;