amis-core 2.7.2 → 2.8.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 (233) hide show
  1. package/esm/Root.js +1 -1
  2. package/esm/RootRenderer.js +4 -4
  3. package/esm/SchemaRenderer.js +23 -12
  4. package/esm/Scoped.js +49 -30
  5. package/esm/WithRootStore.js +1 -1
  6. package/esm/WithStore.js +1 -1
  7. package/esm/actions/Action.js +32 -17
  8. package/esm/actions/AjaxAction.js +1 -1
  9. package/esm/actions/BreakAction.js +1 -1
  10. package/esm/actions/BroadcastAction.js +1 -1
  11. package/esm/actions/CmptAction.js +1 -1
  12. package/esm/actions/ContinueAction.js +1 -1
  13. package/esm/actions/CopyAction.js +1 -1
  14. package/esm/actions/CustomAction.js +1 -1
  15. package/esm/actions/DialogAction.js +1 -1
  16. package/esm/actions/DrawerAction.js +1 -1
  17. package/esm/actions/EmailAction.js +1 -1
  18. package/esm/actions/LinkAction.js +1 -1
  19. package/esm/actions/LoopAction.js +63 -34
  20. package/esm/actions/PageAction.js +1 -1
  21. package/esm/actions/ParallelAction.js +1 -1
  22. package/esm/actions/SwitchAction.js +25 -12
  23. package/esm/actions/ToastAction.js +1 -1
  24. package/esm/components/LazyComponent.js +1 -1
  25. package/esm/components/Overlay.js +1 -1
  26. package/esm/components/PopOver.js +1 -1
  27. package/esm/env.js +1 -1
  28. package/esm/envOverwrite.js +29 -9
  29. package/esm/factory.js +1 -1
  30. package/esm/index.js +2 -2
  31. package/esm/locale.js +3 -3
  32. package/esm/renderers/Form.js +5 -36
  33. package/esm/renderers/Item.js +4 -4
  34. package/esm/renderers/Options.js +4 -4
  35. package/esm/renderers/Placeholder.js +1 -1
  36. package/esm/renderers/builtin.js +1 -1
  37. package/esm/renderers/register.js +3 -6
  38. package/esm/renderers/wrapControl.js +8 -4
  39. package/esm/store/app.js +1 -1
  40. package/esm/store/combo.d.ts +2335 -239
  41. package/esm/store/combo.js +1 -1
  42. package/esm/store/crud.js +54 -35
  43. package/esm/store/form.d.ts +1033 -16
  44. package/esm/store/form.js +27 -7
  45. package/esm/store/formItem.d.ts +9 -1
  46. package/esm/store/formItem.js +83 -45
  47. package/esm/store/iRenderer.js +1 -1
  48. package/esm/store/index.js +1 -1
  49. package/esm/store/list.js +1 -1
  50. package/esm/store/manager.js +1 -1
  51. package/esm/store/modal.js +1 -1
  52. package/esm/store/node.js +1 -1
  53. package/esm/store/pagination.js +1 -1
  54. package/esm/store/root.js +1 -1
  55. package/esm/store/service.js +1 -1
  56. package/esm/store/table.d.ts +2180 -148
  57. package/esm/store/table.js +27 -17
  58. package/esm/store/table2.js +1 -1
  59. package/esm/theme.js +3 -3
  60. package/esm/utils/Animation.js +1 -1
  61. package/esm/utils/ColorScale.js +4 -3
  62. package/esm/utils/DataSchema.js +4 -3
  63. package/esm/utils/DataScope.js +36 -16
  64. package/esm/utils/RootClose.js +3 -3
  65. package/esm/utils/SimpleMap.js +1 -1
  66. package/esm/utils/api.js +4 -4
  67. package/esm/utils/attachmentAdpator.js +1 -1
  68. package/esm/utils/autobind.js +1 -1
  69. package/esm/utils/columnsSplit.js +3 -5
  70. package/esm/utils/dataMapping.js +16 -6
  71. package/esm/utils/date.js +1 -1
  72. package/esm/utils/debug.js +28 -18
  73. package/esm/utils/decodeEntity.js +1 -1
  74. package/esm/utils/dom.js +4 -3
  75. package/esm/utils/errors.js +1 -1
  76. package/esm/utils/escapeHtml.js +1 -1
  77. package/esm/utils/filter-schema.js +1 -1
  78. package/esm/utils/filter.js +5 -7
  79. package/esm/utils/formatDuration.js +1 -1
  80. package/esm/utils/formula.js +1 -1
  81. package/esm/utils/getVariable.js +1 -1
  82. package/esm/utils/grammar.js +1 -1
  83. package/esm/utils/handleAction.js +1 -1
  84. package/esm/utils/helper.js +7 -7
  85. package/esm/utils/highlight.js +1 -1
  86. package/esm/utils/icon.js +1 -1
  87. package/esm/utils/image.js +1 -1
  88. package/esm/utils/isPureVariable.js +1 -1
  89. package/esm/utils/json-schema-2-amis-schema.js +1 -1
  90. package/esm/utils/keyToPath.js +1 -1
  91. package/esm/utils/makeSorter.js +1 -1
  92. package/esm/utils/normalizeLink.js +1 -1
  93. package/esm/utils/normalizeOptions.js +1 -1
  94. package/esm/utils/object.js +1 -1
  95. package/esm/utils/offset.js +1 -1
  96. package/esm/utils/offsetParent.js +1 -1
  97. package/esm/utils/optionValueCompare.js +1 -1
  98. package/esm/utils/position.js +1 -1
  99. package/esm/utils/prettyBytes.js +8 -1
  100. package/esm/utils/renderer-event.js +54 -29
  101. package/esm/utils/replaceText.js +16 -8
  102. package/esm/utils/resize-sensor.js +4 -2
  103. package/esm/utils/resolveVariable.js +1 -1
  104. package/esm/utils/resolveVariableAndFilter.js +1 -1
  105. package/esm/utils/scrollPosition.js +1 -1
  106. package/esm/utils/string2regExp.js +1 -1
  107. package/esm/utils/stripNumber.js +1 -1
  108. package/esm/utils/style-helper.js +96 -75
  109. package/esm/utils/style.js +1 -1
  110. package/esm/utils/toNumber.js +1 -1
  111. package/esm/utils/tokenize.js +1 -1
  112. package/esm/utils/tpl-builtin.js +1 -1
  113. package/esm/utils/tpl-lodash.js +1 -1
  114. package/esm/utils/tpl.js +3 -3
  115. package/esm/utils/uncontrollable.js +1 -1
  116. package/esm/utils/validations.js +4 -4
  117. package/lib/Root.js +1 -1
  118. package/lib/RootRenderer.js +3 -3
  119. package/lib/SchemaRenderer.js +22 -11
  120. package/lib/Scoped.js +48 -29
  121. package/lib/WithRootStore.js +1 -1
  122. package/lib/WithStore.js +1 -1
  123. package/lib/actions/Action.js +31 -16
  124. package/lib/actions/AjaxAction.js +1 -1
  125. package/lib/actions/BreakAction.js +1 -1
  126. package/lib/actions/BroadcastAction.js +1 -1
  127. package/lib/actions/CmptAction.js +1 -1
  128. package/lib/actions/ContinueAction.js +1 -1
  129. package/lib/actions/CopyAction.js +1 -1
  130. package/lib/actions/CustomAction.js +1 -1
  131. package/lib/actions/DialogAction.js +1 -1
  132. package/lib/actions/DrawerAction.js +1 -1
  133. package/lib/actions/EmailAction.js +1 -1
  134. package/lib/actions/LinkAction.js +1 -1
  135. package/lib/actions/LoopAction.js +62 -33
  136. package/lib/actions/PageAction.js +1 -1
  137. package/lib/actions/ParallelAction.js +1 -1
  138. package/lib/actions/SwitchAction.js +24 -11
  139. package/lib/actions/ToastAction.js +1 -1
  140. package/lib/components/LazyComponent.js +1 -1
  141. package/lib/components/Overlay.js +1 -1
  142. package/lib/components/PopOver.js +1 -1
  143. package/lib/env.js +1 -1
  144. package/lib/envOverwrite.js +29 -9
  145. package/lib/factory.js +1 -1
  146. package/lib/index.js +2 -2
  147. package/lib/locale.js +2 -2
  148. package/lib/renderers/Form.js +5 -36
  149. package/lib/renderers/Item.js +3 -3
  150. package/lib/renderers/Options.js +3 -3
  151. package/lib/renderers/Placeholder.js +1 -1
  152. package/lib/renderers/builtin.js +1 -1
  153. package/lib/renderers/register.js +3 -6
  154. package/lib/renderers/wrapControl.js +8 -4
  155. package/lib/store/app.js +1 -1
  156. package/lib/store/combo.d.ts +2335 -239
  157. package/lib/store/combo.js +1 -1
  158. package/lib/store/crud.js +53 -34
  159. package/lib/store/form.d.ts +1033 -16
  160. package/lib/store/form.js +26 -6
  161. package/lib/store/formItem.d.ts +9 -1
  162. package/lib/store/formItem.js +81 -43
  163. package/lib/store/iRenderer.js +1 -1
  164. package/lib/store/index.js +1 -1
  165. package/lib/store/list.js +1 -1
  166. package/lib/store/manager.js +1 -1
  167. package/lib/store/modal.js +1 -1
  168. package/lib/store/node.js +1 -1
  169. package/lib/store/pagination.js +1 -1
  170. package/lib/store/root.js +1 -1
  171. package/lib/store/service.js +1 -1
  172. package/lib/store/table.d.ts +2180 -148
  173. package/lib/store/table.js +26 -16
  174. package/lib/store/table2.js +1 -1
  175. package/lib/theme.js +2 -2
  176. package/lib/utils/Animation.js +1 -1
  177. package/lib/utils/ColorScale.js +4 -3
  178. package/lib/utils/DataSchema.js +4 -3
  179. package/lib/utils/DataScope.js +35 -15
  180. package/lib/utils/RootClose.js +2 -2
  181. package/lib/utils/SimpleMap.js +1 -1
  182. package/lib/utils/api.js +3 -3
  183. package/lib/utils/attachmentAdpator.js +1 -1
  184. package/lib/utils/autobind.js +1 -1
  185. package/lib/utils/columnsSplit.js +3 -5
  186. package/lib/utils/dataMapping.js +15 -5
  187. package/lib/utils/date.js +1 -1
  188. package/lib/utils/debug.js +27 -17
  189. package/lib/utils/decodeEntity.js +1 -1
  190. package/lib/utils/dom.js +4 -3
  191. package/lib/utils/errors.js +1 -1
  192. package/lib/utils/escapeHtml.js +1 -1
  193. package/lib/utils/filter-schema.js +1 -1
  194. package/lib/utils/filter.js +4 -6
  195. package/lib/utils/formatDuration.js +1 -1
  196. package/lib/utils/formula.js +1 -1
  197. package/lib/utils/getVariable.js +1 -1
  198. package/lib/utils/grammar.js +1 -1
  199. package/lib/utils/handleAction.js +1 -1
  200. package/lib/utils/helper.js +6 -6
  201. package/lib/utils/highlight.js +1 -1
  202. package/lib/utils/icon.js +1 -1
  203. package/lib/utils/image.js +1 -1
  204. package/lib/utils/isPureVariable.js +1 -1
  205. package/lib/utils/json-schema-2-amis-schema.js +1 -1
  206. package/lib/utils/keyToPath.js +1 -1
  207. package/lib/utils/makeSorter.js +1 -1
  208. package/lib/utils/normalizeLink.js +1 -1
  209. package/lib/utils/normalizeOptions.js +1 -1
  210. package/lib/utils/object.js +1 -1
  211. package/lib/utils/offset.js +1 -1
  212. package/lib/utils/offsetParent.js +1 -1
  213. package/lib/utils/optionValueCompare.js +1 -1
  214. package/lib/utils/position.js +1 -1
  215. package/lib/utils/prettyBytes.js +8 -1
  216. package/lib/utils/renderer-event.js +53 -28
  217. package/lib/utils/replaceText.js +16 -8
  218. package/lib/utils/resize-sensor.js +4 -2
  219. package/lib/utils/resolveVariable.js +1 -1
  220. package/lib/utils/resolveVariableAndFilter.js +1 -1
  221. package/lib/utils/scrollPosition.js +1 -1
  222. package/lib/utils/string2regExp.js +1 -1
  223. package/lib/utils/stripNumber.js +1 -1
  224. package/lib/utils/style-helper.js +96 -75
  225. package/lib/utils/style.js +1 -1
  226. package/lib/utils/toNumber.js +1 -1
  227. package/lib/utils/tokenize.js +1 -1
  228. package/lib/utils/tpl-builtin.js +1 -1
  229. package/lib/utils/tpl-lodash.js +1 -1
  230. package/lib/utils/tpl.js +2 -2
  231. package/lib/utils/uncontrollable.js +1 -1
  232. package/lib/utils/validations.js +3 -3
  233. package/package.json +3 -3
package/esm/Root.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,9 +1,9 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
6
- import { __extends, __assign, __awaiter, __generator, __spreadArray, __rest, __decorate, __metadata } from 'tslib';
6
+ import { __extends, __assign, __awaiter, __generator, __spreadArray, __read, __rest, __decorate, __metadata } from 'tslib';
7
7
  import { observer } from 'mobx-react';
8
8
  import React from 'react';
9
9
  import { ScopedContext } from './Scoped.js';
@@ -192,7 +192,7 @@ var RootRenderer = /** @class */ (function (_super) {
192
192
  var dialog = store.action.dialog;
193
193
  if (dialog &&
194
194
  dialog.onConfirm &&
195
- dialog.onConfirm.apply(dialog, __spreadArray([values, action], args, false)) === false) {
195
+ dialog.onConfirm.apply(dialog, __spreadArray([values, action], __read(args), false)) === false) {
196
196
  return;
197
197
  }
198
198
  store.closeDialog(true);
@@ -214,7 +214,7 @@ var RootRenderer = /** @class */ (function (_super) {
214
214
  var drawer = store.action.drawer;
215
215
  if (drawer &&
216
216
  drawer.onConfirm &&
217
- drawer.onConfirm.apply(drawer, __spreadArray([values, action], args, false)) === false) {
217
+ drawer.onConfirm.apply(drawer, __spreadArray([values, action], __read(args), false)) === false) {
218
218
  return;
219
219
  }
220
220
  store.closeDrawer();
@@ -1,9 +1,9 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
6
- import { __extends, __assign, __awaiter, __generator, __rest, __decorate, __metadata } from 'tslib';
6
+ import { __extends, __assign, __awaiter, __generator, __rest, __values, __decorate, __metadata } from 'tslib';
7
7
  import difference from 'lodash/difference';
8
8
  import omit from 'lodash/omit';
9
9
  import React from 'react';
@@ -181,13 +181,14 @@ var SchemaRenderer = /** @class */ (function (_super) {
181
181
  this.forceUpdate();
182
182
  };
183
183
  SchemaRenderer.prototype.render = function () {
184
+ var e_1, _a;
184
185
  var _this = this;
185
- var _a, _b, _c;
186
- var _d = this.props; _d.$path; var __ = _d.schema, rootStore = _d.rootStore, topStore = _d.topStore, render = _d.render, rest = __rest(_d, ["$path", "schema", "rootStore", "topStore", "render"]);
186
+ var _b, _c, _d;
187
+ var _e = this.props; _e.$path; var __ = _e.schema, rootStore = _e.rootStore, topStore = _e.topStore, render = _e.render, rest = __rest(_e, ["$path", "schema", "rootStore", "topStore", "render"]);
187
188
  if (__ == null) {
188
189
  return null;
189
190
  }
190
- var _e = this.resolveRenderer(this.props), $path = _e.path, schema = _e.schema;
191
+ var _f = this.resolveRenderer(this.props), $path = _f.path, schema = _f.schema;
191
192
  var theme = this.props.env.theme;
192
193
  if (Array.isArray(schema)) {
193
194
  return render($path, schema, rest);
@@ -280,13 +281,14 @@ var SchemaRenderer = /** @class */ (function (_super) {
280
281
  }
281
282
  // style 支持公式
282
283
  if (schema.style) {
283
- schema.style = buildStyle(schema.style, detectData);
284
+ // schema.style是readonly属性
285
+ schema = __assign(__assign({}, schema), { style: buildStyle(schema.style, detectData) });
284
286
  }
285
- var isClassComponent = (_a = Component.prototype) === null || _a === void 0 ? void 0 : _a.isReactComponent;
287
+ var isClassComponent = (_b = Component.prototype) === null || _b === void 0 ? void 0 : _b.isReactComponent;
286
288
  var $schema = __assign(__assign({}, schema), exprProps);
287
289
  var props = __assign(__assign(__assign(__assign(__assign({}, theme.getRendererConfig(renderer.name)), restSchema), chainEvents(rest, restSchema)), exprProps), {
288
290
  // value: defaultValue, // 备注: 此处并没有将value传递给渲染器
289
- defaultData: (_b = restSchema.defaultData) !== null && _b !== void 0 ? _b : defaultData, defaultValue: (_c = restSchema.defaultValue) !== null && _c !== void 0 ? _c : defaultValue, defaultActiveKey: defaultActiveKey, propKey: propKey, $path: $path, $schema: $schema, ref: this.refFn, render: this.renderChild, rootStore: rootStore, topStore: topStore, dispatchEvent: this.dispatchEvent });
291
+ defaultData: (_c = restSchema.defaultData) !== null && _c !== void 0 ? _c : defaultData, defaultValue: (_d = restSchema.defaultValue) !== null && _d !== void 0 ? _d : defaultValue, defaultActiveKey: defaultActiveKey, propKey: propKey, $path: $path, $schema: $schema, ref: this.refFn, render: this.renderChild, rootStore: rootStore, topStore: topStore, dispatchEvent: this.dispatchEvent });
290
292
  if (disable !== undefined) {
291
293
  props.disabled = disable;
292
294
  }
@@ -295,12 +297,21 @@ var SchemaRenderer = /** @class */ (function (_super) {
295
297
  }
296
298
  // 自动解析变量模式,主要是方便直接引入第三方组件库,无需为了支持变量封装一层
297
299
  if (renderer.autoVar) {
298
- for (var _i = 0, _f = Object.keys($schema); _i < _f.length; _i++) {
299
- var key = _f[_i];
300
- if (typeof props[key] === 'string') {
301
- props[key] = resolveVariableAndFilter(props[key], props.data, '| raw');
300
+ try {
301
+ for (var _g = __values(Object.keys($schema)), _h = _g.next(); !_h.done; _h = _g.next()) {
302
+ var key = _h.value;
303
+ if (typeof props[key] === 'string') {
304
+ props[key] = resolveVariableAndFilter(props[key], props.data, '| raw');
305
+ }
302
306
  }
303
307
  }
308
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
309
+ finally {
310
+ try {
311
+ if (_h && !_h.done && (_a = _g.return)) _a.call(_g);
312
+ }
313
+ finally { if (e_1) throw e_1.error; }
314
+ }
304
315
  }
305
316
  var component = isClassComponent ? (React.createElement(Component, __assign({}, props, { ref: this.childRef }))) : (React.createElement(Component, __assign({}, props)));
306
317
  return this.props.env.enableAMISDebug ? (React.createElement(DebugWrapper, { renderer: renderer }, component)) : (component);
package/esm/Scoped.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
6
- import { __assign, __extends, __rest, __decorate, __metadata } from 'tslib';
6
+ import { __values, __assign, __extends, __rest, __decorate, __metadata } from 'tslib';
7
7
  import React from 'react';
8
8
  import find from 'lodash/find';
9
9
  import values from 'lodash/values';
@@ -98,39 +98,58 @@ function createScopedTools(path, parent, env) {
98
98
  root = root.parent;
99
99
  }
100
100
  eachTree([root], function (item) {
101
- var _a, _b, _c, _d, _e, _f;
101
+ var e_1, _a, e_2, _b;
102
+ var _c, _d, _e, _f, _g, _h;
102
103
  var scopedCmptList = item.getComponents() || [];
103
104
  if (Array.isArray(scopedCmptList)) {
104
- for (var _i = 0, scopedCmptList_1 = scopedCmptList; _i < scopedCmptList_1.length; _i++) {
105
- var cmpt = scopedCmptList_1[_i];
106
- var pathKey = (_b = (_a = cmpt === null || cmpt === void 0 ? void 0 : cmpt.props) === null || _a === void 0 ? void 0 : _a.$path) !== null && _b !== void 0 ? _b : 'unknown';
107
- var schema = (_d = (_c = cmpt === null || cmpt === void 0 ? void 0 : cmpt.props) === null || _c === void 0 ? void 0 : _c.$schema) !== null && _d !== void 0 ? _d : {};
108
- var cmptSession = (_f = (_e = cmpt === null || cmpt === void 0 ? void 0 : cmpt.props.env) === null || _e === void 0 ? void 0 : _e.session) !== null && _f !== void 0 ? _f : 'global';
109
- /** 仅查找当前session的组件 */
110
- if (cmptMaps[pathKey] || session !== cmptSession) {
111
- continue;
112
- }
113
- /** 非Scoped组件, 查找其所属的父容器 */
114
- if ((cmpt === null || cmpt === void 0 ? void 0 : cmpt.setData) && typeof cmpt.setData === 'function') {
115
- cmptMaps[pathKey] = cmpt;
116
- continue;
117
- }
118
- /** 查找Scoped组件中的引用 */
119
- for (var _g = 0, _h = Object.keys(schema); _g < _h.length; _g++) {
120
- var key = _h[_g];
121
- var expression = schema[key];
122
- if (typeof expression === 'string' &&
123
- isPureVariable(expression)) {
124
- /** 考虑到数据映射函数的情况,将宿主变量提取出来 */
125
- var host = expression
126
- .substring(2, expression.length - 1)
127
- .split('|')[0];
128
- if (host && host === path) {
129
- cmptMaps[pathKey] = cmpt;
130
- break;
105
+ try {
106
+ for (var scopedCmptList_1 = __values(scopedCmptList), scopedCmptList_1_1 = scopedCmptList_1.next(); !scopedCmptList_1_1.done; scopedCmptList_1_1 = scopedCmptList_1.next()) {
107
+ var cmpt = scopedCmptList_1_1.value;
108
+ var pathKey = (_d = (_c = cmpt === null || cmpt === void 0 ? void 0 : cmpt.props) === null || _c === void 0 ? void 0 : _c.$path) !== null && _d !== void 0 ? _d : 'unknown';
109
+ var schema = (_f = (_e = cmpt === null || cmpt === void 0 ? void 0 : cmpt.props) === null || _e === void 0 ? void 0 : _e.$schema) !== null && _f !== void 0 ? _f : {};
110
+ var cmptSession = (_h = (_g = cmpt === null || cmpt === void 0 ? void 0 : cmpt.props.env) === null || _g === void 0 ? void 0 : _g.session) !== null && _h !== void 0 ? _h : 'global';
111
+ /** 仅查找当前session的组件 */
112
+ if (cmptMaps[pathKey] || session !== cmptSession) {
113
+ continue;
114
+ }
115
+ /** 非Scoped组件, 查找其所属的父容器 */
116
+ if ((cmpt === null || cmpt === void 0 ? void 0 : cmpt.setData) && typeof cmpt.setData === 'function') {
117
+ cmptMaps[pathKey] = cmpt;
118
+ continue;
119
+ }
120
+ try {
121
+ /** 查找Scoped组件中的引用 */
122
+ for (var _j = (e_2 = void 0, __values(Object.keys(schema))), _k = _j.next(); !_k.done; _k = _j.next()) {
123
+ var key = _k.value;
124
+ var expression = schema[key];
125
+ if (typeof expression === 'string' &&
126
+ isPureVariable(expression)) {
127
+ /** 考虑到数据映射函数的情况,将宿主变量提取出来 */
128
+ var host = expression
129
+ .substring(2, expression.length - 1)
130
+ .split('|')[0];
131
+ if (host && host === path) {
132
+ cmptMaps[pathKey] = cmpt;
133
+ break;
134
+ }
135
+ }
131
136
  }
132
137
  }
138
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
139
+ finally {
140
+ try {
141
+ if (_k && !_k.done && (_b = _j.return)) _b.call(_j);
142
+ }
143
+ finally { if (e_2) throw e_2.error; }
144
+ }
145
+ }
146
+ }
147
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
148
+ finally {
149
+ try {
150
+ if (scopedCmptList_1_1 && !scopedCmptList_1_1.done && (_a = scopedCmptList_1.return)) _a.call(scopedCmptList_1);
133
151
  }
152
+ finally { if (e_1) throw e_1.error; }
134
153
  }
135
154
  }
136
155
  });
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
package/esm/WithStore.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,9 +1,9 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
6
- import { __awaiter, __generator, __assign } from 'tslib';
6
+ import { __awaiter, __generator, __values, __assign } from 'tslib';
7
7
  import omit from 'lodash/omit';
8
8
  import '../utils/helper.js';
9
9
  import { evalExpression } from '../utils/tpl.js';
@@ -94,18 +94,22 @@ var getOmitActionProp = function (type) {
94
94
  return omitList;
95
95
  };
96
96
  var runActions = function (actions, renderer, event) { return __awaiter(void 0, void 0, void 0, function () {
97
- var _i, actions_1, actionConfig, actionInstrance;
98
- return __generator(this, function (_a) {
99
- switch (_a.label) {
97
+ var actions_1, actions_1_1, actionConfig, actionInstrance, e_1_1;
98
+ var e_1, _a;
99
+ return __generator(this, function (_b) {
100
+ switch (_b.label) {
100
101
  case 0:
101
102
  if (!Array.isArray(actions)) {
102
103
  actions = [actions];
103
104
  }
104
- _i = 0, actions_1 = actions;
105
- _a.label = 1;
105
+ _b.label = 1;
106
106
  case 1:
107
- if (!(_i < actions_1.length)) return [3 /*break*/, 4];
108
- actionConfig = actions_1[_i];
107
+ _b.trys.push([1, 6, 7, 8]);
108
+ actions_1 = __values(actions), actions_1_1 = actions_1.next();
109
+ _b.label = 2;
110
+ case 2:
111
+ if (!!actions_1_1.done) return [3 /*break*/, 5];
112
+ actionConfig = actions_1_1.value;
109
113
  actionInstrance = getActionByType(actionConfig.actionType);
110
114
  // 如果存在指定组件ID,说明是组件专有动作
111
115
  if (!actionInstrance && actionConfig.componentId) {
@@ -123,17 +127,28 @@ var runActions = function (actions, renderer, event) { return __awaiter(void 0,
123
127
  }
124
128
  // 这些节点的子节点运行逻辑由节点内部实现
125
129
  return [4 /*yield*/, runAction(actionInstrance, actionConfig, renderer, event)];
126
- case 2:
130
+ case 3:
127
131
  // 这些节点的子节点运行逻辑由节点内部实现
128
- _a.sent();
132
+ _b.sent();
129
133
  if (event.stoped) {
130
- return [3 /*break*/, 4];
134
+ return [3 /*break*/, 5];
131
135
  }
132
- _a.label = 3;
133
- case 3:
134
- _i++;
135
- return [3 /*break*/, 1];
136
- case 4: return [2 /*return*/];
136
+ _b.label = 4;
137
+ case 4:
138
+ actions_1_1 = actions_1.next();
139
+ return [3 /*break*/, 2];
140
+ case 5: return [3 /*break*/, 8];
141
+ case 6:
142
+ e_1_1 = _b.sent();
143
+ e_1 = { error: e_1_1 };
144
+ return [3 /*break*/, 8];
145
+ case 7:
146
+ try {
147
+ if (actions_1_1 && !actions_1_1.done && (_a = actions_1.return)) _a.call(actions_1);
148
+ }
149
+ finally { if (e_1) throw e_1.error; }
150
+ return [7 /*endfinally*/];
151
+ case 8: return [2 /*return*/];
137
152
  }
138
153
  });
139
154
  }); };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,9 +1,9 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
6
- import { __awaiter, __generator } from 'tslib';
6
+ import { __awaiter, __generator, __values } from 'tslib';
7
7
  import '../utils/helper.js';
8
8
  import { registerAction, LoopStatus, runActions } from './Action.js';
9
9
  import 'amis-formula';
@@ -26,9 +26,10 @@ var LoopAction = /** @class */ (function () {
26
26
  LoopAction.prototype.run = function (action, renderer, event, mergeData) {
27
27
  var _a, _b;
28
28
  return __awaiter(this, void 0, void 0, function () {
29
- var loopName, loopData, protoData, _i, loopData_1, data, _c, _d, subAction;
30
- return __generator(this, function (_e) {
31
- switch (_e.label) {
29
+ var loopName, loopData, protoData, loopData_1, loopData_1_1, data, _c, _d, subAction, e_1_1, e_2_1;
30
+ var e_2, _e, e_1, _f;
31
+ return __generator(this, function (_g) {
32
+ switch (_g.label) {
32
33
  case 0:
33
34
  loopName = (_a = action.args) === null || _a === void 0 ? void 0 : _a.loopName;
34
35
  if (typeof loopName !== 'string') {
@@ -38,60 +39,88 @@ var LoopAction = /** @class */ (function () {
38
39
  loopData = resolveVariable(loopName, mergeData) || [];
39
40
  if (!!loopData) return [3 /*break*/, 1];
40
41
  console.error("\u6CA1\u6709\u627E\u5230\u6570\u636E ".concat(loopName));
41
- return [3 /*break*/, 10];
42
+ return [3 /*break*/, 18];
42
43
  case 1:
43
44
  if (!!Array.isArray(loopData)) return [3 /*break*/, 2];
44
45
  console.error("".concat(loopName, " \u6570\u636E\u4E0D\u662F\u6570\u7EC4"));
45
- return [3 /*break*/, 10];
46
+ return [3 /*break*/, 18];
46
47
  case 2:
47
- if (!((_b = action.children) === null || _b === void 0 ? void 0 : _b.length)) return [3 /*break*/, 10];
48
+ if (!((_b = action.children) === null || _b === void 0 ? void 0 : _b.length)) return [3 /*break*/, 18];
48
49
  protoData = event.data;
49
- _i = 0, loopData_1 = loopData;
50
- _e.label = 3;
50
+ _g.label = 3;
51
51
  case 3:
52
- if (!(_i < loopData_1.length)) return [3 /*break*/, 9];
53
- data = loopData_1[_i];
52
+ _g.trys.push([3, 15, 16, 17]);
53
+ loopData_1 = __values(loopData), loopData_1_1 = loopData_1.next();
54
+ _g.label = 4;
55
+ case 4:
56
+ if (!!loopData_1_1.done) return [3 /*break*/, 14];
57
+ data = loopData_1_1.value;
54
58
  renderer.loopStatus = LoopStatus.NORMAL;
55
59
  // 追加逻辑处理中的数据,事件数据优先,用完还要还原
56
60
  event.setData(createObject(event.data, data));
57
- _c = 0, _d = action.children;
58
- _e.label = 4;
59
- case 4:
60
- if (!(_c < _d.length)) return [3 /*break*/, 7];
61
- subAction = _d[_c];
61
+ _g.label = 5;
62
+ case 5:
63
+ _g.trys.push([5, 10, 11, 12]);
64
+ _c = (e_1 = void 0, __values(action.children)), _d = _c.next();
65
+ _g.label = 6;
66
+ case 6:
67
+ if (!!_d.done) return [3 /*break*/, 9];
68
+ subAction = _d.value;
62
69
  // @ts-ignore
63
70
  if (renderer.loopStatus === LoopStatus.CONTINUE) {
64
- return [3 /*break*/, 6];
71
+ return [3 /*break*/, 8];
65
72
  }
66
73
  return [4 /*yield*/, runActions(subAction, renderer, event)];
67
- case 5:
68
- _e.sent();
74
+ case 7:
75
+ _g.sent();
69
76
  // @ts-ignore
70
77
  if (renderer.loopStatus === LoopStatus.BREAK || event.stoped) {
71
78
  // 还原事件数据
72
79
  event.setData(protoData);
73
80
  event.stopPropagation();
74
- return [3 /*break*/, 7];
81
+ return [3 /*break*/, 9];
75
82
  }
76
- _e.label = 6;
77
- case 6:
78
- _c++;
79
- return [3 /*break*/, 4];
80
- case 7:
83
+ _g.label = 8;
84
+ case 8:
85
+ _d = _c.next();
86
+ return [3 /*break*/, 6];
87
+ case 9: return [3 /*break*/, 12];
88
+ case 10:
89
+ e_1_1 = _g.sent();
90
+ e_1 = { error: e_1_1 };
91
+ return [3 /*break*/, 12];
92
+ case 11:
93
+ try {
94
+ if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
95
+ }
96
+ finally { if (e_1) throw e_1.error; }
97
+ return [7 /*endfinally*/];
98
+ case 12:
81
99
  if (event.stoped) {
82
100
  // 还原事件数据
83
101
  event.setData(protoData);
84
- return [3 /*break*/, 9];
102
+ return [3 /*break*/, 14];
85
103
  }
86
- _e.label = 8;
87
- case 8:
88
- _i++;
89
- return [3 /*break*/, 3];
90
- case 9:
104
+ _g.label = 13;
105
+ case 13:
106
+ loopData_1_1 = loopData_1.next();
107
+ return [3 /*break*/, 4];
108
+ case 14: return [3 /*break*/, 17];
109
+ case 15:
110
+ e_2_1 = _g.sent();
111
+ e_2 = { error: e_2_1 };
112
+ return [3 /*break*/, 17];
113
+ case 16:
114
+ try {
115
+ if (loopData_1_1 && !loopData_1_1.done && (_e = loopData_1.return)) _e.call(loopData_1);
116
+ }
117
+ finally { if (e_2) throw e_2.error; }
118
+ return [7 /*endfinally*/];
119
+ case 17:
91
120
  renderer.loopStatus = LoopStatus.NORMAL;
92
121
  event.setData(protoData);
93
- _e.label = 10;
94
- case 10: return [2 /*return*/];
122
+ _g.label = 18;
123
+ case 18: return [2 /*return*/];
95
124
  }
96
125
  });
97
126
  });
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,9 +1,9 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
6
- import { __awaiter, __generator } from 'tslib';
6
+ import { __awaiter, __generator, __values } from 'tslib';
7
7
  import { evalExpression } from '../utils/tpl.js';
8
8
  import { registerAction, runActions } from './Action.js';
9
9
 
@@ -15,28 +15,41 @@ var SwitchAction = /** @class */ (function () {
15
15
  }
16
16
  SwitchAction.prototype.run = function (action, renderer, event, mergeData) {
17
17
  return __awaiter(this, void 0, void 0, function () {
18
- var _i, _a, branch;
19
- return __generator(this, function (_b) {
20
- switch (_b.label) {
18
+ var _a, _b, branch, e_1_1;
19
+ var e_1, _c;
20
+ return __generator(this, function (_d) {
21
+ switch (_d.label) {
21
22
  case 0:
22
- _i = 0, _a = action.children || [];
23
- _b.label = 1;
23
+ _d.trys.push([0, 5, 6, 7]);
24
+ _a = __values(action.children || []), _b = _a.next();
25
+ _d.label = 1;
24
26
  case 1:
25
- if (!(_i < _a.length)) return [3 /*break*/, 4];
26
- branch = _a[_i];
27
+ if (!!_b.done) return [3 /*break*/, 4];
28
+ branch = _b.value;
27
29
  if (!branch.expression) {
28
30
  return [3 /*break*/, 3];
29
31
  }
30
32
  if (!evalExpression(branch.expression, mergeData)) return [3 /*break*/, 3];
31
33
  return [4 /*yield*/, runActions(branch, renderer, event)];
32
34
  case 2:
33
- _b.sent();
35
+ _d.sent();
34
36
  // 去掉runAllMatch,这里只做排他,多个可以直接通过expression
35
37
  return [3 /*break*/, 4];
36
38
  case 3:
37
- _i++;
39
+ _b = _a.next();
38
40
  return [3 /*break*/, 1];
39
- case 4: return [2 /*return*/];
41
+ case 4: return [3 /*break*/, 7];
42
+ case 5:
43
+ e_1_1 = _d.sent();
44
+ e_1 = { error: e_1_1 };
45
+ return [3 /*break*/, 7];
46
+ case 6:
47
+ try {
48
+ if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
49
+ }
50
+ finally { if (e_1) throw e_1.error; }
51
+ return [7 /*endfinally*/];
52
+ case 7: return [2 /*return*/];
40
53
  }
41
54
  });
42
55
  });
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.7.2
2
+ * amis-core v2.8.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5