amis-core 3.1.1 → 3.3.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 (313) hide show
  1. package/esm/Root.js +1 -1
  2. package/esm/RootRenderer.d.ts +1 -1
  3. package/esm/RootRenderer.js +3 -3
  4. package/esm/SchemaRenderer.js +6 -2
  5. package/esm/Scoped.d.ts +4 -1
  6. package/esm/Scoped.js +9 -5
  7. package/esm/StatusScoped.js +1 -1
  8. package/esm/WithRootStore.d.ts +4 -24
  9. package/esm/WithRootStore.js +12 -4
  10. package/esm/WithStore.js +23 -16
  11. package/esm/actions/Action.d.ts +1 -0
  12. package/esm/actions/Action.js +70 -45
  13. package/esm/actions/AjaxAction.d.ts +6 -8
  14. package/esm/actions/AjaxAction.js +20 -18
  15. package/esm/actions/BreakAction.js +1 -1
  16. package/esm/actions/BroadcastAction.js +1 -1
  17. package/esm/actions/CmptAction.d.ts +1 -2
  18. package/esm/actions/CmptAction.js +47 -32
  19. package/esm/actions/ContinueAction.js +1 -1
  20. package/esm/actions/CopyAction.js +1 -1
  21. package/esm/actions/CustomAction.js +3 -2
  22. package/esm/actions/DialogAction.d.ts +2 -0
  23. package/esm/actions/DialogAction.js +39 -23
  24. package/esm/actions/DrawerAction.js +4 -4
  25. package/esm/actions/EmailAction.js +1 -1
  26. package/esm/actions/LinkAction.js +1 -1
  27. package/esm/actions/LoopAction.js +1 -1
  28. package/esm/actions/PageAction.js +1 -1
  29. package/esm/actions/ParallelAction.js +1 -1
  30. package/esm/actions/StatusAction.d.ts +15 -0
  31. package/esm/actions/StatusAction.js +49 -0
  32. package/esm/actions/SwitchAction.js +1 -1
  33. package/esm/actions/ToastAction.js +1 -1
  34. package/esm/actions/index.d.ts +1 -0
  35. package/esm/components/CustomStyle.js +1 -1
  36. package/esm/components/LazyComponent.js +1 -1
  37. package/esm/components/Overlay.js +3 -2
  38. package/esm/components/PopOver.js +3 -2
  39. package/esm/env.js +1 -1
  40. package/esm/envOverwrite.js +1 -1
  41. package/esm/factory.js +2 -2
  42. package/esm/index.d.ts +3 -1
  43. package/esm/index.js +16 -14
  44. package/esm/locale.js +1 -1
  45. package/esm/polyfills.d.ts +3 -0
  46. package/esm/polyfills.js +18 -0
  47. package/esm/renderers/Form.d.ts +7 -7
  48. package/esm/renderers/Form.js +182 -128
  49. package/esm/renderers/Item.d.ts +82 -77
  50. package/esm/renderers/Item.js +90 -74
  51. package/esm/renderers/Options.js +1 -2
  52. package/esm/renderers/Placeholder.js +1 -1
  53. package/esm/renderers/builtin.js +1 -1
  54. package/esm/renderers/register.js +1 -1
  55. package/esm/renderers/wrapControl.d.ts +4 -24
  56. package/esm/renderers/wrapControl.js +140 -88
  57. package/esm/store/app.js +42 -4
  58. package/esm/store/combo.d.ts +564 -1892
  59. package/esm/store/combo.js +9 -2
  60. package/esm/store/crud.d.ts +4 -2
  61. package/esm/store/crud.js +17 -4
  62. package/esm/store/form.d.ts +182 -882
  63. package/esm/store/form.js +83 -81
  64. package/esm/store/formItem.d.ts +6 -2
  65. package/esm/store/formItem.js +19 -3
  66. package/esm/store/iRenderer.js +3 -2
  67. package/esm/store/index.js +1 -1
  68. package/esm/store/list.d.ts +1 -0
  69. package/esm/store/list.js +8 -2
  70. package/esm/store/manager.js +1 -1
  71. package/esm/store/modal.js +1 -1
  72. package/esm/store/node.js +1 -1
  73. package/esm/store/pagination.js +1 -1
  74. package/esm/store/root.js +3 -2
  75. package/esm/store/service.js +17 -12
  76. package/esm/store/status.js +1 -1
  77. package/esm/store/table.d.ts +604 -2020
  78. package/esm/store/table.js +86 -56
  79. package/esm/store/table2.d.ts +49 -0
  80. package/esm/store/table2.js +37 -4
  81. package/esm/theme.js +1 -1
  82. package/esm/types.d.ts +22 -5
  83. package/esm/utils/Animation.js +1 -1
  84. package/esm/utils/ColorScale.js +1 -1
  85. package/esm/utils/DataSchema.d.ts +3 -2
  86. package/esm/utils/DataSchema.js +27 -7
  87. package/esm/utils/DataScope.d.ts +10 -3
  88. package/esm/utils/DataScope.js +50 -12
  89. package/esm/utils/RootClose.js +1 -1
  90. package/esm/utils/SimpleMap.js +1 -1
  91. package/esm/utils/api.d.ts +2 -2
  92. package/esm/utils/api.js +152 -112
  93. package/esm/utils/arraySlice.d.ts +1 -0
  94. package/esm/utils/arraySlice.js +76 -0
  95. package/esm/utils/attachmentAdpator.js +1 -1
  96. package/esm/utils/autobind.js +1 -1
  97. package/esm/utils/columnsSplit.js +1 -1
  98. package/esm/utils/dataMapping.js +29 -19
  99. package/esm/utils/date.js +1 -1
  100. package/esm/utils/debug.d.ts +2 -0
  101. package/esm/utils/debug.js +34 -7
  102. package/esm/utils/decodeEntity.js +1 -1
  103. package/esm/utils/dom.js +4 -1
  104. package/esm/utils/errors.js +1 -1
  105. package/esm/utils/escapeHtml.js +1 -1
  106. package/esm/utils/filter-schema.js +1 -1
  107. package/esm/utils/filter.js +1 -1
  108. package/esm/utils/formatDuration.js +1 -1
  109. package/esm/utils/formula.d.ts +0 -1
  110. package/esm/utils/formula.js +6 -9
  111. package/esm/utils/getVariable.js +1 -1
  112. package/esm/utils/grammar.js +1 -1
  113. package/esm/utils/handleAction.js +1 -1
  114. package/esm/utils/helper.d.ts +19 -2
  115. package/esm/utils/helper.js +69 -10
  116. package/esm/utils/highlight.js +1 -1
  117. package/esm/utils/icon.d.ts +4 -2
  118. package/esm/utils/icon.js +3 -2
  119. package/esm/utils/image.js +1 -1
  120. package/esm/utils/index.d.ts +2 -0
  121. package/esm/utils/isPureVariable.js +1 -1
  122. package/esm/utils/json-schema-2-amis-schema.js +1 -1
  123. package/esm/utils/keyToPath.js +1 -1
  124. package/esm/utils/makeSorter.js +1 -1
  125. package/esm/utils/math.d.ts +3 -0
  126. package/esm/utils/math.js +52 -0
  127. package/esm/utils/memoryParse.js +1 -1
  128. package/esm/utils/normalizeLink.js +18 -9
  129. package/esm/utils/normalizeOptions.js +1 -1
  130. package/esm/utils/object.d.ts +7 -0
  131. package/esm/utils/object.js +13 -2
  132. package/esm/utils/offset.js +1 -1
  133. package/esm/utils/offsetParent.js +1 -1
  134. package/esm/utils/optionValueCompare.js +2 -2
  135. package/esm/utils/position.js +1 -1
  136. package/esm/utils/prettyBytes.js +1 -1
  137. package/esm/utils/renderer-event.d.ts +1 -1
  138. package/esm/utils/renderer-event.js +14 -6
  139. package/esm/utils/replaceText.js +1 -1
  140. package/esm/utils/resize-sensor.js +1 -1
  141. package/esm/utils/resolveCondition.js +1 -1
  142. package/esm/utils/resolveVariable.js +1 -1
  143. package/esm/utils/resolveVariableAndFilter.js +1 -1
  144. package/esm/utils/resolveVariableAndFilterForAsync.js +1 -1
  145. package/esm/utils/scrollPosition.js +1 -1
  146. package/esm/utils/string2regExp.js +1 -1
  147. package/esm/utils/stripNumber.js +1 -1
  148. package/esm/utils/style-helper.js +1 -1
  149. package/esm/utils/style.js +1 -1
  150. package/esm/utils/toNumber.js +1 -1
  151. package/esm/utils/tokenize.js +1 -1
  152. package/esm/utils/tpl-builtin.js +1 -1
  153. package/esm/utils/tpl-lodash.js +1 -1
  154. package/esm/utils/tpl.js +1 -1
  155. package/esm/utils/uncontrollable.js +1 -1
  156. package/esm/utils/validations.js +1 -1
  157. package/lib/Root.js +10 -7
  158. package/lib/RootRenderer.d.ts +1 -1
  159. package/lib/RootRenderer.js +11 -8
  160. package/lib/SchemaRenderer.js +13 -6
  161. package/lib/Scoped.d.ts +4 -1
  162. package/lib/Scoped.js +19 -13
  163. package/lib/StatusScoped.js +5 -2
  164. package/lib/WithRootStore.d.ts +4 -24
  165. package/lib/WithRootStore.js +15 -4
  166. package/lib/WithStore.js +27 -17
  167. package/lib/actions/Action.d.ts +1 -0
  168. package/lib/actions/Action.js +70 -45
  169. package/lib/actions/AjaxAction.d.ts +6 -8
  170. package/lib/actions/AjaxAction.js +20 -18
  171. package/lib/actions/BreakAction.js +1 -1
  172. package/lib/actions/BroadcastAction.js +1 -1
  173. package/lib/actions/CmptAction.d.ts +1 -2
  174. package/lib/actions/CmptAction.js +47 -32
  175. package/lib/actions/ContinueAction.js +1 -1
  176. package/lib/actions/CopyAction.js +1 -1
  177. package/lib/actions/CustomAction.js +9 -5
  178. package/lib/actions/DialogAction.d.ts +2 -0
  179. package/lib/actions/DialogAction.js +39 -23
  180. package/lib/actions/DrawerAction.js +4 -4
  181. package/lib/actions/EmailAction.js +1 -1
  182. package/lib/actions/LinkAction.js +1 -1
  183. package/lib/actions/LoopAction.js +1 -1
  184. package/lib/actions/PageAction.js +1 -1
  185. package/lib/actions/ParallelAction.js +1 -1
  186. package/lib/actions/StatusAction.d.ts +15 -0
  187. package/lib/actions/StatusAction.js +53 -0
  188. package/lib/actions/SwitchAction.js +1 -1
  189. package/lib/actions/ToastAction.js +1 -1
  190. package/lib/actions/index.d.ts +1 -0
  191. package/lib/components/CustomStyle.js +1 -1
  192. package/lib/components/LazyComponent.js +12 -14
  193. package/lib/components/Overlay.js +15 -14
  194. package/lib/components/PopOver.js +12 -10
  195. package/lib/env.js +4 -1
  196. package/lib/envOverwrite.js +1 -1
  197. package/lib/factory.js +11 -9
  198. package/lib/index.d.ts +3 -1
  199. package/lib/index.js +26 -19
  200. package/lib/locale.js +6 -3
  201. package/lib/polyfills.d.ts +3 -0
  202. package/lib/polyfills.js +20 -0
  203. package/lib/renderers/Form.d.ts +7 -7
  204. package/lib/renderers/Form.js +194 -135
  205. package/lib/renderers/Item.d.ts +82 -77
  206. package/lib/renderers/Item.js +126 -104
  207. package/lib/renderers/Options.js +10 -5
  208. package/lib/renderers/Placeholder.js +1 -1
  209. package/lib/renderers/builtin.js +1 -1
  210. package/lib/renderers/register.js +1 -1
  211. package/lib/renderers/wrapControl.d.ts +4 -24
  212. package/lib/renderers/wrapControl.js +143 -88
  213. package/lib/store/app.js +44 -3
  214. package/lib/store/combo.d.ts +564 -1892
  215. package/lib/store/combo.js +9 -2
  216. package/lib/store/crud.d.ts +4 -2
  217. package/lib/store/crud.js +17 -4
  218. package/lib/store/form.d.ts +182 -882
  219. package/lib/store/form.js +81 -79
  220. package/lib/store/formItem.d.ts +6 -2
  221. package/lib/store/formItem.js +19 -3
  222. package/lib/store/iRenderer.js +9 -5
  223. package/lib/store/index.js +1 -1
  224. package/lib/store/list.d.ts +1 -0
  225. package/lib/store/list.js +8 -2
  226. package/lib/store/manager.js +1 -1
  227. package/lib/store/modal.js +1 -1
  228. package/lib/store/node.js +1 -1
  229. package/lib/store/pagination.js +1 -1
  230. package/lib/store/root.js +9 -5
  231. package/lib/store/service.js +17 -12
  232. package/lib/store/status.js +1 -1
  233. package/lib/store/table.d.ts +604 -2020
  234. package/lib/store/table.js +85 -55
  235. package/lib/store/table2.d.ts +49 -0
  236. package/lib/store/table2.js +36 -3
  237. package/lib/theme.js +6 -3
  238. package/lib/types.d.ts +22 -5
  239. package/lib/utils/Animation.js +1 -1
  240. package/lib/utils/ColorScale.js +1 -1
  241. package/lib/utils/DataSchema.d.ts +3 -2
  242. package/lib/utils/DataSchema.js +27 -7
  243. package/lib/utils/DataScope.d.ts +10 -3
  244. package/lib/utils/DataScope.js +50 -11
  245. package/lib/utils/RootClose.js +1 -1
  246. package/lib/utils/SimpleMap.js +1 -1
  247. package/lib/utils/api.d.ts +2 -2
  248. package/lib/utils/api.js +151 -111
  249. package/lib/utils/arraySlice.d.ts +1 -0
  250. package/lib/utils/arraySlice.js +80 -0
  251. package/lib/utils/attachmentAdpator.js +1 -1
  252. package/lib/utils/autobind.js +1 -1
  253. package/lib/utils/columnsSplit.js +8 -6
  254. package/lib/utils/dataMapping.js +29 -19
  255. package/lib/utils/date.js +1 -1
  256. package/lib/utils/debug.d.ts +2 -0
  257. package/lib/utils/debug.js +61 -33
  258. package/lib/utils/decodeEntity.js +1 -1
  259. package/lib/utils/dom.js +10 -5
  260. package/lib/utils/errors.js +1 -1
  261. package/lib/utils/escapeHtml.js +1 -1
  262. package/lib/utils/filter-schema.js +1 -1
  263. package/lib/utils/filter.js +1 -1
  264. package/lib/utils/formatDuration.js +1 -1
  265. package/lib/utils/formula.d.ts +0 -1
  266. package/lib/utils/formula.js +6 -10
  267. package/lib/utils/getVariable.js +1 -1
  268. package/lib/utils/grammar.js +1 -1
  269. package/lib/utils/handleAction.js +1 -1
  270. package/lib/utils/helper.d.ts +19 -2
  271. package/lib/utils/helper.js +70 -9
  272. package/lib/utils/highlight.js +8 -9
  273. package/lib/utils/icon.d.ts +4 -2
  274. package/lib/utils/icon.js +12 -10
  275. package/lib/utils/image.js +1 -1
  276. package/lib/utils/index.d.ts +2 -0
  277. package/lib/utils/isPureVariable.js +1 -1
  278. package/lib/utils/json-schema-2-amis-schema.js +1 -1
  279. package/lib/utils/keyToPath.js +1 -1
  280. package/lib/utils/makeSorter.js +1 -1
  281. package/lib/utils/math.d.ts +3 -0
  282. package/lib/utils/math.js +58 -0
  283. package/lib/utils/memoryParse.js +1 -1
  284. package/lib/utils/normalizeLink.js +18 -9
  285. package/lib/utils/normalizeOptions.js +1 -1
  286. package/lib/utils/object.d.ts +7 -0
  287. package/lib/utils/object.js +13 -1
  288. package/lib/utils/offset.js +1 -1
  289. package/lib/utils/offsetParent.js +1 -1
  290. package/lib/utils/optionValueCompare.js +7 -3
  291. package/lib/utils/position.js +1 -1
  292. package/lib/utils/prettyBytes.js +1 -1
  293. package/lib/utils/renderer-event.d.ts +1 -1
  294. package/lib/utils/renderer-event.js +13 -5
  295. package/lib/utils/replaceText.js +1 -1
  296. package/lib/utils/resize-sensor.js +1 -1
  297. package/lib/utils/resolveCondition.js +1 -1
  298. package/lib/utils/resolveVariable.js +1 -1
  299. package/lib/utils/resolveVariableAndFilter.js +1 -1
  300. package/lib/utils/resolveVariableAndFilterForAsync.js +1 -1
  301. package/lib/utils/scrollPosition.js +1 -1
  302. package/lib/utils/string2regExp.js +1 -1
  303. package/lib/utils/stripNumber.js +1 -1
  304. package/lib/utils/style-helper.js +1 -1
  305. package/lib/utils/style.js +1 -1
  306. package/lib/utils/toNumber.js +1 -1
  307. package/lib/utils/tokenize.js +1 -1
  308. package/lib/utils/tpl-builtin.js +1 -1
  309. package/lib/utils/tpl-lodash.js +1 -1
  310. package/lib/utils/tpl.js +1 -1
  311. package/lib/utils/uncontrollable.js +1 -1
  312. package/lib/utils/validations.js +1 -1
  313. package/package.json +9 -4
package/lib/Scoped.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.1.1
2
+ * amis-core v3.3.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -22,30 +22,34 @@ require('./utils/filter.js');
22
22
  var helper = require('./utils/helper.js');
23
23
  require('./utils/api.js');
24
24
  require('./utils/ColorScale.js');
25
- require('lodash/chunk');
25
+ require('./utils/columnsSplit.js');
26
26
  require('./utils/DataSchema.js');
27
27
  require('./utils/DataScope.js');
28
28
  require('./utils/debug.js');
29
- require('react-dom');
29
+ require('./utils/dom.js');
30
30
  require('./utils/errors.js');
31
31
  var tpl = require('./utils/tpl.js');
32
32
  require('classnames');
33
33
  require('lodash/isObject');
34
34
  require('lodash/isString');
35
35
  require('lodash/isBoolean');
36
- require('lodash');
36
+ require('./utils/highlight.js');
37
+ require('./utils/icon.js');
37
38
  require('./utils/image.js');
39
+ require('lodash/isEqual');
38
40
  require('./actions/Action.js');
39
41
  require('lodash/debounce');
40
42
  require('lodash/cloneDeep');
41
43
  require('./utils/resize-sensor.js');
42
44
  require('react-overlays/useRootClose');
45
+ require('react-dom');
43
46
  require('./utils/SimpleMap.js');
44
47
  require('lodash/mapValues');
45
48
  require('lodash/camelCase');
46
49
  require('uncontrollable');
47
50
  require('./utils/validations.js');
48
51
  require('./utils/resolveCondition.js');
52
+ require('mobx');
49
53
  require('./utils/Animation.js');
50
54
 
51
55
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -55,10 +59,9 @@ var find__default = /*#__PURE__*/_interopDefaultLegacy(find);
55
59
  var values__default = /*#__PURE__*/_interopDefaultLegacy(values);
56
60
  var hoistNonReactStatic__default = /*#__PURE__*/_interopDefaultLegacy(hoistNonReactStatic);
57
61
 
58
- /**
59
- * @file 用来创建一个域,在这个域里面会把里面的运行时实例注册进来,方便组件之间的通信。
60
- * @author fex
61
- */
62
+ var __react_jsx__ = require('react');
63
+ var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
64
+ (__react_jsx__["default"] || __react_jsx__).Fragment;
62
65
  /**
63
66
  * target 里面可能包含 ?xxx=xxx,这种情况下,需要把 ?xxx=xxx 保留下来,然后对前面的部分进行 filter
64
67
  * 因为后面会对 query 部分做不一样的处理。会保留原始的值。而不是会转成字符串。
@@ -75,13 +78,16 @@ function filterTarget(target, data) {
75
78
  }
76
79
  var rootScopedContext = createScopedTools('');
77
80
  var ScopedContext = React__default["default"].createContext(rootScopedContext);
78
- function createScopedTools(path, parent, env) {
81
+ function createScopedTools(path, parent, env, rendererType) {
79
82
  var components = [];
80
83
  var self = {
84
+ rendererType: rendererType,
85
+ component: undefined,
81
86
  parent: parent,
82
87
  registerComponent: function (component) {
83
88
  // 不要把自己注册在自己的 Scoped 上,自己的 Scoped 是给子节点们注册的。
84
89
  if (component.props.$path === path && parent) {
90
+ self.component = component;
85
91
  return parent.registerComponent(component);
86
92
  }
87
93
  if (!~components.indexOf(component)) {
@@ -345,12 +351,12 @@ function closeDialog(component) {
345
351
  .forEach(closeDialog);
346
352
  component.props.onClose && component.props.onClose();
347
353
  }
348
- function HocScoped(ComposedComponent) {
354
+ function HocScoped(ComposedComponent, rendererType) {
349
355
  var ScopedComponent = /** @class */ (function (_super) {
350
356
  tslib.__extends(ScopedComponent, _super);
351
357
  function ScopedComponent(props, context) {
352
358
  var _this = _super.call(this, props) || this;
353
- _this.scoped = createScopedTools(_this.props.$path, context, _this.props.env);
359
+ _this.scoped = createScopedTools(_this.props.$path, context, _this.props.env, rendererType);
354
360
  var scopeRef = props.scopeRef;
355
361
  scopeRef && scopeRef(_this.scoped);
356
362
  return _this;
@@ -371,8 +377,8 @@ function HocScoped(ComposedComponent) {
371
377
  };
372
378
  ScopedComponent.prototype.render = function () {
373
379
  var _a = this.props; _a.scopeRef; var rest = tslib.__rest(_a, ["scopeRef"]);
374
- return (React__default["default"].createElement(ScopedContext.Provider, { value: this.scoped },
375
- React__default["default"].createElement(ComposedComponent, tslib.__assign({}, rest /* todo */, { ref: this.childRef }))));
380
+ return (_J$X_(ScopedContext.Provider, { value: this.scoped },
381
+ _J$X_(ComposedComponent, tslib.__assign({}, rest /* todo */, { ref: this.childRef }))));
376
382
  };
377
383
  ScopedComponent.displayName = "Scoped(".concat(ComposedComponent.displayName || ComposedComponent.name, ")");
378
384
  ScopedComponent.contextType = ScopedContext;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.1.1
2
+ * amis-core v3.3.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -18,6 +18,9 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
18
18
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
19
19
  var hoistNonReactStatic__default = /*#__PURE__*/_interopDefaultLegacy(hoistNonReactStatic);
20
20
 
21
+ var __react_jsx__ = require('react');
22
+ var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
23
+ (__react_jsx__["default"] || __react_jsx__).Fragment;
21
24
  function StatusScoped(ComposedComponent) {
22
25
  var _a;
23
26
  var result = hoistNonReactStatic__default["default"]((_a = /** @class */ (function (_super) {
@@ -50,7 +53,7 @@ function StatusScoped(ComposedComponent) {
50
53
  var refConfig = ((_a = ComposedComponent.prototype) === null || _a === void 0 ? void 0 : _a.isReactComponent)
51
54
  ? { ref: this.childRef }
52
55
  : { forwardedRef: this.childRef };
53
- return (React__default["default"].createElement(ComposedComponent, tslib.__assign({}, this.props, injectedProps, refConfig)));
56
+ return (_J$X_(ComposedComponent, tslib.__assign({}, this.props, injectedProps, refConfig)));
54
57
  };
55
58
  return class_1;
56
59
  }(React__default["default"].Component)),
@@ -333,30 +333,10 @@ export declare const RootStoreContext: React.Context<{
333
333
  export declare function withRootStore<T extends React.ComponentType<React.ComponentProps<T> & {
334
334
  rootStore: IRendererStore;
335
335
  }>>(ComposedComponent: T): {
336
- new (props: JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, "rootStore">> | Readonly<JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, "rootStore">>>): {
337
- render(): React.JSX.Element;
338
- context: unknown;
339
- setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, "rootStore">>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
340
- forceUpdate(callback?: (() => void) | undefined): void;
341
- readonly props: Readonly<JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, "rootStore">>>;
342
- state: Readonly<{}>;
343
- refs: {
344
- [key: string]: React.ReactInstance;
345
- };
346
- componentDidMount?(): void;
347
- shouldComponentUpdate?(nextProps: Readonly<JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, "rootStore">>>, nextState: Readonly<{}>, nextContext: any): boolean;
348
- componentWillUnmount?(): void;
349
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
350
- getSnapshotBeforeUpdate?(prevProps: Readonly<JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, "rootStore">>>, prevState: Readonly<{}>): any;
351
- componentDidUpdate?(prevProps: Readonly<JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, "rootStore">>>, prevState: Readonly<{}>, snapshot?: any): void;
352
- componentWillMount?(): void;
353
- UNSAFE_componentWillMount?(): void;
354
- componentWillReceiveProps?(nextProps: Readonly<JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, "rootStore">>>, nextContext: any): void;
355
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, "rootStore">>>, nextContext: any): void;
356
- componentWillUpdate?(nextProps: Readonly<JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, "rootStore">>>, nextState: Readonly<{}>, nextContext: any): void;
357
- UNSAFE_componentWillUpdate?(nextProps: Readonly<JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, "rootStore">>>, nextState: Readonly<{}>, nextContext: any): void;
358
- };
359
- new (props: JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, "rootStore">>, context: any): {
336
+ new (props: JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, "rootStore">>): {
337
+ ref: any;
338
+ getWrappedInstance(): any;
339
+ refFn(ref: any): void;
360
340
  render(): React.JSX.Element;
361
341
  context: unknown;
362
342
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, "rootStore">>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.1.1
2
+ * amis-core v3.3.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -16,20 +16,31 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
16
16
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
17
17
  var hoistNonReactStatic__default = /*#__PURE__*/_interopDefaultLegacy(hoistNonReactStatic);
18
18
 
19
+ var __react_jsx__ = require('react');
20
+ var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
21
+ (__react_jsx__["default"] || __react_jsx__).Fragment;
19
22
  var RootStoreContext = React__default["default"].createContext(undefined);
20
23
  function withRootStore(ComposedComponent) {
21
24
  var _a;
22
25
  var result = hoistNonReactStatic__default["default"]((_a = /** @class */ (function (_super) {
23
26
  tslib.__extends(class_1, _super);
24
- function class_1() {
25
- return _super !== null && _super.apply(this, arguments) || this;
27
+ function class_1(props) {
28
+ var _this = _super.call(this, props) || this;
29
+ _this.refFn = _this.refFn.bind(_this);
30
+ return _this;
26
31
  }
32
+ class_1.prototype.getWrappedInstance = function () {
33
+ return this.ref.control;
34
+ };
35
+ class_1.prototype.refFn = function (ref) {
36
+ this.ref = ref;
37
+ };
27
38
  class_1.prototype.render = function () {
28
39
  var rootStore = this.context;
29
40
  var injectedProps = {
30
41
  rootStore: rootStore
31
42
  };
32
- return (React__default["default"].createElement(ComposedComponent, tslib.__assign({}, this.props, injectedProps)));
43
+ return (_J$X_(ComposedComponent, tslib.__assign({}, this.props, injectedProps, { ref: this.refFn })));
33
44
  };
34
45
  return class_1;
35
46
  }(React__default["default"].Component)),
package/lib/WithStore.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.1.1
2
+ * amis-core v3.3.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -18,6 +18,7 @@ var helper = require('./utils/helper.js');
18
18
  require('amis-formula');
19
19
  require('moment');
20
20
  var object = require('./utils/object.js');
21
+ var tokenize = require('./utils/tokenize.js');
21
22
  var dataMapping = require('./utils/dataMapping.js');
22
23
  require('./utils/filter.js');
23
24
  var WithRootStore = require('./WithRootStore.js');
@@ -27,6 +28,9 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
27
28
  var hoistNonReactStatic__default = /*#__PURE__*/_interopDefaultLegacy(hoistNonReactStatic);
28
29
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
29
30
 
31
+ var __react_jsx__ = require('react');
32
+ var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
33
+ (__react_jsx__["default"] || __react_jsx__).Fragment;
30
34
  function HocStoreFactory(renderer) {
31
35
  return function (Component) {
32
36
  var StoreFactory = /** @class */ (function (_super) {
@@ -106,20 +110,26 @@ function HocStoreFactory(renderer) {
106
110
  if (extendsData === false) {
107
111
  if (shouldSync === true ||
108
112
  prevProps.defaultData !== props.defaultData ||
109
- helper.isObjectShallowModified(prevProps.data, props.data) ||
110
- //
111
- // 特殊处理 CRUD。
112
- // CRUD 中 toolbar 里面的 data 是空对象,但是 __super 会不一样
113
- (props.data &&
114
- prevProps.data &&
115
- props.data.__super !== prevProps.data.__super)) {
113
+ (props.trackExpression
114
+ ? tokenize.tokenize(props.trackExpression, props.data) !==
115
+ tokenize.tokenize(props.trackExpression, prevProps.data)
116
+ : helper.isObjectShallowModified(prevProps.data, props.data) ||
117
+ //
118
+ // 特殊处理 CRUD。
119
+ // CRUD 中 toolbar 里面的 data 是空对象,但是 __super 会不一样
120
+ (props.data &&
121
+ prevProps.data &&
122
+ props.data.__super !== prevProps.data.__super))) {
116
123
  store.initData(object.extendObject(props.data, tslib.__assign(tslib.__assign(tslib.__assign({}, (store.hasRemoteData ? store.data : null)), this.formatData(props.defaultData)), this.formatData(props.data))));
117
124
  }
118
125
  }
119
126
  else if (shouldSync === true ||
120
- helper.isObjectShallowModified(prevProps.data, props.data) ||
121
- (props.syncSuperStore !== false &&
122
- helper.isSuperDataModified(props.data, prevProps.data, store))) {
127
+ (props.trackExpression
128
+ ? tokenize.tokenize(props.trackExpression, props.data) !==
129
+ tokenize.tokenize(props.trackExpression, prevProps.data)
130
+ : helper.isObjectShallowModified(prevProps.data, props.data) ||
131
+ (props.syncSuperStore !== false &&
132
+ helper.isSuperDataModified(props.data, prevProps.data, store)))) {
123
133
  if (props.store && props.store.data === props.data) {
124
134
  store.initData(object.createObject(props.store.data, props.syncSuperStore === false
125
135
  ? tslib.__assign({}, store.data) : helper.syncDataFromSuper(store.data, props.store.data, prevProps.scope, store, props.syncSuperStore === true)));
@@ -132,9 +142,8 @@ function HocStoreFactory(renderer) {
132
142
  store.initData(object.createObject(props.scope, props.data));
133
143
  }
134
144
  }
135
- else if ((shouldSync === true ||
136
- !props.store ||
137
- props.data !== props.store.data) &&
145
+ else if (!props.trackExpression &&
146
+ (!props.store || props.data !== props.store.data) &&
138
147
  props.data &&
139
148
  props.data.__super) {
140
149
  // 这个用法很少,当 data.__super 值发生变化时,更新 store.data
@@ -145,9 +154,10 @@ function HocStoreFactory(renderer) {
145
154
  }
146
155
  // nextProps.data.__super !== props.data.__super) &&
147
156
  }
148
- else if (props.scope &&
157
+ else if (!props.trackExpression &&
158
+ props.scope &&
149
159
  props.data === props.store.data &&
150
- (shouldSync === true || prevProps.data !== props.data)) {
160
+ prevProps.data !== props.data) {
151
161
  // 只有父级数据变动的时候才应该进来,
152
162
  // 目前看来这个 case 很少有情况下能进来
153
163
  store.initData(object.createObject(props.scope, tslib.__assign({}, store.data)));
@@ -175,7 +185,7 @@ function HocStoreFactory(renderer) {
175
185
  if (this.state.hidden || this.state.visible === false) {
176
186
  return null;
177
187
  }
178
- return (React__default["default"].createElement(Component, tslib.__assign({}, rest /* todo */, this.state, { ref: this.refFn, data: this.store.data, dataUpdatedAt: this.store.updatedAt, store: this.store, scope: this.store.data, render: this.renderChild })));
188
+ return (_J$X_(Component, tslib.__assign({}, rest /* todo */, this.state, { ref: this.refFn, data: this.store.data, dataUpdatedAt: this.store.updatedAt, store: this.store, scope: this.store.data, render: this.renderChild })));
179
189
  };
180
190
  StoreFactory.displayName = "WithStore(".concat(Component.displayName || Component.name, ")");
181
191
  StoreFactory.ComposedComponent = Component;
@@ -25,6 +25,7 @@ export interface ListenerAction {
25
25
  stopPropagation?: boolean;
26
26
  expression?: string | ConditionGroupValue;
27
27
  execOn?: string;
28
+ [propName: string]: any;
28
29
  }
29
30
  export interface ILogicAction extends ListenerAction {
30
31
  children?: ListenerAction[];
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.1.1
2
+ * amis-core v3.3.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -96,7 +96,7 @@ var getOmitActionProp = function (type) {
96
96
  omitList = ['drawer'];
97
97
  break;
98
98
  case 'confirmDialog':
99
- omitList = ['confirmDialog'];
99
+ omitList = ['dialog'];
100
100
  break;
101
101
  case 'reload':
102
102
  omitList = ['resetPage'];
@@ -125,11 +125,20 @@ var runActions = function (actions, renderer, event) { return tslib.__awaiter(vo
125
125
  // 如果存在指定组件ID,说明是组件专有动作
126
126
  if (!actionInstrance &&
127
127
  (actionConfig.componentId || actionConfig.componentName)) {
128
- actionInstrance = getActionByType('component');
128
+ actionInstrance = [
129
+ 'static',
130
+ 'nonstatic',
131
+ 'show',
132
+ 'visibility',
133
+ 'hidden',
134
+ 'enabled',
135
+ 'disabled',
136
+ 'usability'
137
+ ].includes(actionConfig.actionType)
138
+ ? getActionByType('status')
139
+ : getActionByType('component');
129
140
  }
130
- else if (actionConfig.actionType === 'url' ||
131
- actionConfig.actionType === 'link' ||
132
- actionConfig.actionType === 'jump') {
141
+ else if (['url', 'link', 'jump'].includes(actionConfig.actionType)) {
133
142
  // 打开页面动作
134
143
  actionInstrance = getActionByType('openlink');
135
144
  }
@@ -166,14 +175,16 @@ var runActions = function (actions, renderer, event) { return tslib.__awaiter(vo
166
175
  }); };
167
176
  // 执行动作,与原有动作处理打通
168
177
  var runAction = function (actionInstrance, actionConfig, renderer, event) { return tslib.__awaiter(void 0, void 0, void 0, function () {
169
- var additional, mergeData, expression, isStop, preventDefault, stopPropagation, key, args, afterMappingData, actionData, data, stoped, actionResult;
170
- var _a, _b, _c;
171
- return tslib.__generator(this, function (_d) {
172
- switch (_d.label) {
178
+ var additional, action, mergeData, expression, isStop, preventDefault, key, api, args, afterMappingData, actionData, data, stopped, actionResult, stopPropagation;
179
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
180
+ return tslib.__generator(this, function (_u) {
181
+ switch (_u.label) {
173
182
  case 0:
174
183
  additional = {
175
184
  event: event
176
185
  };
186
+ action = tslib.__assign({}, actionConfig);
187
+ action.args = tslib.__assign({}, actionConfig.args);
177
188
  // __rendererData默认为renderer.props.data,兼容表单项值变化时的data读取
178
189
  if (!event.data.__rendererData) {
179
190
  additional = {
@@ -184,36 +195,47 @@ var runAction = function (actionInstrance, actionConfig, renderer, event) { retu
184
195
  mergeData = object.createObject(object.createObject(renderer.props.data.__super
185
196
  ? object.createObject(renderer.props.data.__super, additional)
186
197
  : additional, renderer.props.data), event.data);
187
- expression = (_a = actionConfig.expression) !== null && _a !== void 0 ? _a : actionConfig.execOn;
198
+ expression = (_a = action.expression) !== null && _a !== void 0 ? _a : action.execOn;
188
199
  isStop = false;
189
200
  if (!expression) return [3 /*break*/, 2];
190
201
  return [4 /*yield*/, tpl.evalExpressionWithConditionBuilder(expression, mergeData, true)];
191
202
  case 1:
192
- isStop = !(_d.sent());
193
- _d.label = 2;
203
+ isStop = !(_u.sent());
204
+ _u.label = 2;
194
205
  case 2:
195
206
  if (isStop) {
196
207
  return [2 /*return*/];
197
208
  }
198
209
  preventDefault = false;
199
- if (!actionConfig.preventDefault) return [3 /*break*/, 4];
200
- return [4 /*yield*/, tpl.evalExpressionWithConditionBuilder(actionConfig.preventDefault, mergeData, false)];
210
+ if (!action.preventDefault) return [3 /*break*/, 4];
211
+ return [4 /*yield*/, tpl.evalExpressionWithConditionBuilder(action.preventDefault, mergeData, false)];
201
212
  case 3:
202
- preventDefault = _d.sent();
203
- _d.label = 4;
213
+ preventDefault = _u.sent();
214
+ _u.label = 4;
204
215
  case 4:
205
- stopPropagation = false;
206
- if (!actionConfig.stopPropagation) return [3 /*break*/, 6];
207
- return [4 /*yield*/, tpl.evalExpressionWithConditionBuilder(actionConfig.stopPropagation, mergeData, false)];
208
- case 5:
209
- stopPropagation = _d.sent();
210
- _d.label = 6;
211
- case 6:
212
216
  key = {
213
- componentId: dataMapping.dataMapping(actionConfig.componentId, mergeData),
214
- componentName: dataMapping.dataMapping(actionConfig.componentName, mergeData)
217
+ componentId: dataMapping.dataMapping(action.componentId, mergeData),
218
+ componentName: dataMapping.dataMapping(action.componentName, mergeData)
215
219
  };
216
- args = dataMapping.dataMapping(actionConfig.args, mergeData, function (key) {
220
+ // 兼容args包裹的用法
221
+ if (action.actionType === 'dialog') {
222
+ action.dialog = tslib.__assign({}, ((_b = action.dialog) !== null && _b !== void 0 ? _b : (_c = action.args) === null || _c === void 0 ? void 0 : _c.dialog));
223
+ (_d = action.args) === null || _d === void 0 ? true : delete _d.dialog;
224
+ }
225
+ else if (action.actionType === 'drawer') {
226
+ action.drawer = tslib.__assign({}, ((_e = action.drawer) !== null && _e !== void 0 ? _e : (_f = action.args) === null || _f === void 0 ? void 0 : _f.drawer));
227
+ (_g = action.args) === null || _g === void 0 ? true : delete _g.drawer;
228
+ }
229
+ else if (action.actionType === 'ajax') {
230
+ api = (_h = action.api) !== null && _h !== void 0 ? _h : (_j = action.args) === null || _j === void 0 ? void 0 : _j.api;
231
+ action.api = typeof api === 'string' ? api : tslib.__assign({}, api);
232
+ action.options = tslib.__assign({}, ((_k = action.options) !== null && _k !== void 0 ? _k : (_l = action.args) === null || _l === void 0 ? void 0 : _l.options));
233
+ action.messages = tslib.__assign({}, ((_m = action.messages) !== null && _m !== void 0 ? _m : (_o = action.args) === null || _o === void 0 ? void 0 : _o.messages));
234
+ (_p = action.args) === null || _p === void 0 ? true : delete _p.api;
235
+ (_q = action.args) === null || _q === void 0 ? true : delete _q.options;
236
+ (_r = action.args) === null || _r === void 0 ? true : delete _r.messages;
237
+ }
238
+ args = dataMapping.dataMapping(action.args, mergeData, function (key) {
217
239
  return [
218
240
  'adaptor',
219
241
  'responseAdaptor',
@@ -222,31 +244,34 @@ var runAction = function (actionInstrance, actionConfig, renderer, event) { retu
222
244
  'condition'
223
245
  ].includes(key);
224
246
  });
225
- afterMappingData = dataMapping.dataMapping(actionConfig.data, mergeData);
247
+ afterMappingData = dataMapping.dataMapping(action.data, mergeData);
226
248
  actionData = args && Object.keys(args).length
227
- ? omit__default["default"](tslib.__assign(tslib.__assign({}, args), (afterMappingData !== null && afterMappingData !== void 0 ? afterMappingData : {})), getOmitActionProp(actionConfig.actionType))
249
+ ? omit__default["default"](tslib.__assign(tslib.__assign({}, args), (afterMappingData !== null && afterMappingData !== void 0 ? afterMappingData : {})), getOmitActionProp(action.actionType))
228
250
  : afterMappingData;
229
- data = args && !Object.keys(args).length && actionConfig.data === undefined // 兼容历史
230
- ? {}
231
- : actionData !== undefined
232
- ? actionData
233
- : event.data;
234
- (_b = console.group) === null || _b === void 0 ? void 0 : _b.call(console, "run action ".concat(actionConfig.actionType));
235
- console.debug("[".concat(actionConfig.actionType, "] action args, data"), args, data);
236
- stoped = false;
237
- return [4 /*yield*/, actionInstrance.run(tslib.__assign(tslib.__assign(tslib.__assign({}, actionConfig), { args: args, data: data }), key), renderer, event, mergeData)];
238
- case 7:
239
- actionResult = _d.sent();
251
+ data = actionData !== undefined ? actionData : mergeData;
252
+ (_s = console.group) === null || _s === void 0 ? void 0 : _s.call(console, "run action ".concat(action.actionType));
253
+ console.debug("[".concat(action.actionType, "] action args, data"), args, data);
254
+ stopped = false;
255
+ return [4 /*yield*/, actionInstrance.run(tslib.__assign(tslib.__assign(tslib.__assign({}, action), { args: args, data: action.actionType === 'reload' ? actionData : data }), key), renderer, event, mergeData)];
256
+ case 5:
257
+ actionResult = _u.sent();
240
258
  // 二次确认弹窗如果取消,则终止后续动作
241
- if ((actionConfig === null || actionConfig === void 0 ? void 0 : actionConfig.actionType) === 'confirmDialog' && !actionResult) {
242
- stoped = true;
259
+ if ((action === null || action === void 0 ? void 0 : action.actionType) === 'confirmDialog' && !actionResult) {
260
+ stopped = true;
243
261
  }
244
- console.debug("[".concat(actionConfig.actionType, "] action end event"), event);
245
- (_c = console.groupEnd) === null || _c === void 0 ? void 0 : _c.call(console);
262
+ stopPropagation = false;
263
+ if (!action.stopPropagation) return [3 /*break*/, 7];
264
+ return [4 /*yield*/, tpl.evalExpressionWithConditionBuilder(action.stopPropagation, mergeData, false)];
265
+ case 6:
266
+ stopPropagation = _u.sent();
267
+ _u.label = 7;
268
+ case 7:
269
+ console.debug("[".concat(action.actionType, "] action end event"), event);
270
+ (_t = console.groupEnd) === null || _t === void 0 ? void 0 : _t.call(console);
246
271
  // 阻止原有动作执行
247
272
  preventDefault && event.preventDefault();
248
273
  // 阻止后续动作执行
249
- (stopPropagation || stoped) && event.stopPropagation();
274
+ (stopPropagation || stopped) && event.stopPropagation();
250
275
  return [2 /*return*/];
251
276
  }
252
277
  });
@@ -3,15 +3,13 @@ import { RendererEvent } from '../utils/renderer-event';
3
3
  import { RendererAction, ListenerAction, ListenerContext } from './Action';
4
4
  export interface IAjaxAction extends ListenerAction {
5
5
  action: 'ajax';
6
- args: {
7
- api: Api;
8
- messages?: {
9
- success: string;
10
- failed: string;
11
- };
12
- options?: Record<string, any>;
13
- [propName: string]: any;
6
+ api: Api;
7
+ messages?: {
8
+ success: string;
9
+ failed: string;
14
10
  };
11
+ options?: Record<string, any>;
12
+ [propName: string]: any;
15
13
  }
16
14
  /**
17
15
  * 发送请求动作
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.1.1
2
+ * amis-core v3.3.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -27,39 +27,41 @@ var AjaxAction = /** @class */ (function () {
27
27
  this.fetcherType = fetcherType;
28
28
  }
29
29
  AjaxAction.prototype.run = function (action, renderer, event) {
30
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
30
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
31
31
  return tslib.__awaiter(this, void 0, void 0, function () {
32
- var env, result, responseData, msg, e_1, result;
33
- var _1;
34
- return tslib.__generator(this, function (_2) {
35
- switch (_2.label) {
32
+ var env, silent, messages, result, responseData, msg, e_1, result;
33
+ var _o;
34
+ return tslib.__generator(this, function (_p) {
35
+ switch (_p.label) {
36
36
  case 0:
37
37
  if (!((_a = renderer.props.env) === null || _a === void 0 ? void 0 : _a.fetcher)) {
38
38
  throw new Error('env.fetcher is required!');
39
39
  }
40
40
  if (this.fetcherType === 'download' && action.actionType === 'download') {
41
- if ((_b = action.args) === null || _b === void 0 ? void 0 : _b.api) {
42
- action.args.api.responseType = 'blob';
41
+ if (action.api) {
42
+ action.api.responseType = 'blob';
43
43
  }
44
44
  }
45
45
  env = event.context.env;
46
- _2.label = 1;
46
+ silent = (_b = action === null || action === void 0 ? void 0 : action.options) === null || _b === void 0 ? void 0 : _b.silent;
47
+ messages = (_c = action === null || action === void 0 ? void 0 : action.api) === null || _c === void 0 ? void 0 : _c.messages;
48
+ _p.label = 1;
47
49
  case 1:
48
- _2.trys.push([1, 3, , 4]);
49
- return [4 /*yield*/, env.fetcher((_c = action.args) === null || _c === void 0 ? void 0 : _c.api, (_d = action.data) !== null && _d !== void 0 ? _d : {}, (_f = (_e = action.args) === null || _e === void 0 ? void 0 : _e.options) !== null && _f !== void 0 ? _f : {})];
50
+ _p.trys.push([1, 3, , 4]);
51
+ return [4 /*yield*/, env.fetcher(action === null || action === void 0 ? void 0 : action.api, (_d = action.data) !== null && _d !== void 0 ? _d : {}, (_e = action === null || action === void 0 ? void 0 : action.options) !== null && _e !== void 0 ? _e : {})];
50
52
  case 2:
51
- result = _2.sent();
53
+ result = _p.sent();
52
54
  responseData = !helper.isEmpty(result.data) || result.ok
53
55
  ? api.normalizeApiResponseData(result.data)
54
56
  : null;
55
57
  // 记录请求返回的数据
56
- event.setData(object.createObject(event.data, tslib.__assign(tslib.__assign({}, responseData), (_1 = { responseData: responseData }, _1[action.outputVar || 'responseResult'] = tslib.__assign(tslib.__assign({}, responseData), { responseData: responseData, responseStatus: result.status, responseMsg: result.msg }), _1))));
57
- if (!((_h = (_g = action.args) === null || _g === void 0 ? void 0 : _g.options) === null || _h === void 0 ? void 0 : _h.silent)) {
58
+ event.setData(object.createObject(event.data, tslib.__assign(tslib.__assign({}, responseData), (_o = { responseData: responseData }, _o[action.outputVar || 'responseResult'] = tslib.__assign(tslib.__assign({}, responseData), { responseData: responseData, responseStatus: result.status, responseMsg: result.msg }), _o))));
59
+ if (!silent) {
58
60
  if (!result.ok) {
59
- throw new errors.ServerError((_q = (_m = (_l = (_k = (_j = action.args) === null || _j === void 0 ? void 0 : _j.api) === null || _k === void 0 ? void 0 : _k.messages) === null || _l === void 0 ? void 0 : _l.failed) !== null && _m !== void 0 ? _m : (_p = (_o = action.args) === null || _o === void 0 ? void 0 : _o.messages) === null || _p === void 0 ? void 0 : _p.failed) !== null && _q !== void 0 ? _q : result.msg, result);
61
+ throw new errors.ServerError((_h = (_f = messages === null || messages === void 0 ? void 0 : messages.failed) !== null && _f !== void 0 ? _f : (_g = action.messages) === null || _g === void 0 ? void 0 : _g.failed) !== null && _h !== void 0 ? _h : result.msg, result);
60
62
  }
61
63
  else {
62
- msg = (_y = (_x = (_u = (_t = (_s = (_r = action.args) === null || _r === void 0 ? void 0 : _r.api) === null || _s === void 0 ? void 0 : _s.messages) === null || _t === void 0 ? void 0 : _t.success) !== null && _u !== void 0 ? _u : (_w = (_v = action.args) === null || _v === void 0 ? void 0 : _v.messages) === null || _w === void 0 ? void 0 : _w.success) !== null && _x !== void 0 ? _x : result.msg) !== null && _y !== void 0 ? _y : result.defaultMsg;
64
+ msg = (_m = (_l = (_j = messages === null || messages === void 0 ? void 0 : messages.success) !== null && _j !== void 0 ? _j : (_k = action.messages) === null || _k === void 0 ? void 0 : _k.success) !== null && _l !== void 0 ? _l : result.msg) !== null && _m !== void 0 ? _m : result.defaultMsg;
63
65
  msg &&
64
66
  env.notify('success', msg, result.msgTimeout !== undefined
65
67
  ? {
@@ -71,8 +73,8 @@ var AjaxAction = /** @class */ (function () {
71
73
  }
72
74
  return [2 /*return*/, result.data];
73
75
  case 3:
74
- e_1 = _2.sent();
75
- if (!((_0 = (_z = action.args) === null || _z === void 0 ? void 0 : _z.options) === null || _0 === void 0 ? void 0 : _0.silent)) {
76
+ e_1 = _p.sent();
77
+ if (!silent) {
76
78
  if (e_1.type === 'ServerError') {
77
79
  result = e_1.response;
78
80
  env.notify('error', e_1.message, result.msgTimeout !== undefined
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.1.1
2
+ * amis-core v3.3.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.1.1
2
+ * amis-core v3.3.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,9 +1,8 @@
1
1
  import { RendererEvent } from '../utils/renderer-event';
2
2
  import { RendererAction, ListenerAction, ListenerContext } from './Action';
3
3
  export interface ICmptAction extends ListenerAction {
4
- actionType: 'setValue' | 'static' | 'nonstatic' | 'show' | 'visibility' | 'hidden' | 'enabled' | 'disabled' | 'usability' | 'reload';
4
+ actionType: string;
5
5
  args: {
6
- /** actionType为setValue时,目标变量的path */
7
6
  path?: string;
8
7
  value?: string | {
9
8
  [key: string]: string;