amis-core 3.5.3 → 3.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/esm/Root.js +1 -1
  2. package/esm/RootRenderer.d.ts +1 -1
  3. package/esm/RootRenderer.js +1 -1
  4. package/esm/SchemaRenderer.js +1 -1
  5. package/esm/Scoped.d.ts +2 -0
  6. package/esm/Scoped.js +48 -6
  7. package/esm/StatusScoped.js +1 -1
  8. package/esm/WithRootStore.js +1 -1
  9. package/esm/WithStore.js +27 -12
  10. package/esm/actions/Action.js +30 -22
  11. package/esm/actions/AjaxAction.js +2 -2
  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 +3 -3
  17. package/esm/actions/CustomAction.js +1 -1
  18. package/esm/actions/DialogAction.js +1 -1
  19. package/esm/actions/DrawerAction.js +1 -1
  20. package/esm/actions/EmailAction.js +1 -1
  21. package/esm/actions/LinkAction.js +5 -5
  22. package/esm/actions/LoopAction.js +1 -1
  23. package/esm/actions/PageAction.js +1 -1
  24. package/esm/actions/ParallelAction.js +1 -1
  25. package/esm/actions/StatusAction.js +1 -1
  26. package/esm/actions/SwitchAction.js +1 -1
  27. package/esm/actions/ToastAction.js +3 -3
  28. package/esm/components/CustomStyle.js +1 -1
  29. package/esm/components/ErrorBoundary.d.ts +20 -0
  30. package/esm/components/ErrorBoundary.js +41 -0
  31. package/esm/components/LazyComponent.js +1 -1
  32. package/esm/components/Overlay.js +1 -1
  33. package/esm/components/PopOver.d.ts +4 -0
  34. package/esm/components/PopOver.js +66 -3
  35. package/esm/env.js +1 -1
  36. package/esm/envOverwrite.js +1 -1
  37. package/esm/factory.js +1 -1
  38. package/esm/index.d.ts +2 -1
  39. package/esm/index.js +4 -3
  40. package/esm/locale.js +1 -1
  41. package/esm/polyfills.js +1 -1
  42. package/esm/renderers/Form.d.ts +1 -1
  43. package/esm/renderers/Form.js +16 -8
  44. package/esm/renderers/Item.d.ts +54 -0
  45. package/esm/renderers/Item.js +1 -1
  46. package/esm/renderers/Options.d.ts +4 -0
  47. package/esm/renderers/Options.js +5 -4
  48. package/esm/renderers/Placeholder.js +1 -1
  49. package/esm/renderers/builtin.js +1 -1
  50. package/esm/renderers/register.js +1 -1
  51. package/esm/renderers/wrapControl.js +4 -6
  52. package/esm/store/app.js +1 -1
  53. package/esm/store/combo.d.ts +24 -24
  54. package/esm/store/combo.js +1 -1
  55. package/esm/store/crud.d.ts +9 -1
  56. package/esm/store/crud.js +29 -13
  57. package/esm/store/form.d.ts +10 -10
  58. package/esm/store/form.js +1 -1
  59. package/esm/store/formItem.js +16 -7
  60. package/esm/store/iRenderer.js +1 -1
  61. package/esm/store/index.js +1 -1
  62. package/esm/store/list.js +1 -1
  63. package/esm/store/manager.js +1 -1
  64. package/esm/store/modal.js +1 -1
  65. package/esm/store/node.js +1 -1
  66. package/esm/store/pagination.js +1 -1
  67. package/esm/store/root.js +1 -1
  68. package/esm/store/service.js +1 -1
  69. package/esm/store/status.js +1 -1
  70. package/esm/store/table.d.ts +21 -20
  71. package/esm/store/table.js +8 -12
  72. package/esm/store/table2.js +1 -1
  73. package/esm/theme.js +1 -1
  74. package/esm/utils/Animation.js +1 -1
  75. package/esm/utils/ColorScale.js +1 -1
  76. package/esm/utils/DataSchema.js +1 -1
  77. package/esm/utils/DataScope.js +1 -1
  78. package/esm/utils/RootClose.js +1 -1
  79. package/esm/utils/SimpleMap.js +1 -1
  80. package/esm/utils/api.js +1 -1
  81. package/esm/utils/arraySlice.js +1 -1
  82. package/esm/utils/attachmentAdpator.js +3 -1
  83. package/esm/utils/autobind.js +1 -1
  84. package/esm/utils/columnsSplit.js +1 -1
  85. package/esm/utils/dataMapping.js +1 -1
  86. package/esm/utils/date.js +1 -1
  87. package/esm/utils/debug.js +1 -1
  88. package/esm/utils/decodeEntity.js +1 -1
  89. package/esm/utils/dom.js +1 -1
  90. package/esm/utils/errors.js +1 -1
  91. package/esm/utils/escapeHtml.js +1 -1
  92. package/esm/utils/filter-schema.d.ts +2 -1
  93. package/esm/utils/filter-schema.js +14 -5
  94. package/esm/utils/filter.js +1 -1
  95. package/esm/utils/formatDuration.js +1 -1
  96. package/esm/utils/formula.js +1 -1
  97. package/esm/utils/getVariable.js +1 -1
  98. package/esm/utils/grammar.js +1 -1
  99. package/esm/utils/handleAction.js +1 -1
  100. package/esm/utils/helper.js +1 -1
  101. package/esm/utils/highlight.js +1 -1
  102. package/esm/utils/icon.js +1 -1
  103. package/esm/utils/image.js +1 -1
  104. package/esm/utils/isPureVariable.js +1 -1
  105. package/esm/utils/json-schema-2-amis-schema.js +1 -1
  106. package/esm/utils/keyToPath.js +1 -1
  107. package/esm/utils/makeSorter.js +1 -1
  108. package/esm/utils/math.js +1 -1
  109. package/esm/utils/memoryParse.js +1 -1
  110. package/esm/utils/normalizeLink.js +1 -1
  111. package/esm/utils/normalizeOptions.js +1 -1
  112. package/esm/utils/object.js +1 -1
  113. package/esm/utils/offset.js +1 -1
  114. package/esm/utils/offsetParent.js +1 -1
  115. package/esm/utils/optionValueCompare.js +1 -1
  116. package/esm/utils/position.js +1 -1
  117. package/esm/utils/prettyBytes.js +1 -1
  118. package/esm/utils/renderer-event.js +1 -1
  119. package/esm/utils/replaceText.js +1 -1
  120. package/esm/utils/resize-sensor.js +1 -1
  121. package/esm/utils/resolveCondition.js +1 -1
  122. package/esm/utils/resolveVariable.js +1 -1
  123. package/esm/utils/resolveVariableAndFilter.js +1 -1
  124. package/esm/utils/resolveVariableAndFilterForAsync.js +1 -1
  125. package/esm/utils/scrollPosition.js +1 -1
  126. package/esm/utils/string2regExp.js +1 -1
  127. package/esm/utils/stripNumber.js +1 -1
  128. package/esm/utils/style-helper.js +5 -3
  129. package/esm/utils/style.js +1 -1
  130. package/esm/utils/toNumber.js +1 -1
  131. package/esm/utils/tokenize.js +1 -1
  132. package/esm/utils/tpl-builtin.js +1 -1
  133. package/esm/utils/tpl-lodash.js +1 -1
  134. package/esm/utils/tpl.js +1 -1
  135. package/esm/utils/uncontrollable.js +1 -1
  136. package/esm/utils/validations.js +1 -1
  137. package/lib/Root.js +1 -1
  138. package/lib/RootRenderer.js +1 -1
  139. package/lib/SchemaRenderer.js +1 -1
  140. package/lib/Scoped.d.ts +2 -0
  141. package/lib/Scoped.js +47 -5
  142. package/lib/StatusScoped.js +1 -1
  143. package/lib/WithRootStore.js +1 -1
  144. package/lib/WithStore.js +26 -11
  145. package/lib/actions/Action.js +29 -21
  146. package/lib/actions/AjaxAction.js +2 -2
  147. package/lib/actions/BreakAction.js +1 -1
  148. package/lib/actions/BroadcastAction.js +1 -1
  149. package/lib/actions/CmptAction.js +3 -3
  150. package/lib/actions/ContinueAction.js +1 -1
  151. package/lib/actions/CopyAction.js +3 -3
  152. package/lib/actions/CustomAction.js +1 -1
  153. package/lib/actions/DialogAction.js +1 -1
  154. package/lib/actions/DrawerAction.js +1 -1
  155. package/lib/actions/EmailAction.js +1 -1
  156. package/lib/actions/LinkAction.js +5 -5
  157. package/lib/actions/LoopAction.js +1 -1
  158. package/lib/actions/PageAction.js +1 -1
  159. package/lib/actions/ParallelAction.js +1 -1
  160. package/lib/actions/StatusAction.js +1 -1
  161. package/lib/actions/SwitchAction.js +1 -1
  162. package/lib/actions/ToastAction.js +3 -3
  163. package/lib/components/CustomStyle.js +1 -1
  164. package/lib/components/ErrorBoundary.d.ts +20 -0
  165. package/lib/components/ErrorBoundary.js +52 -0
  166. package/lib/components/LazyComponent.js +1 -1
  167. package/lib/components/Overlay.js +1 -1
  168. package/lib/components/PopOver.d.ts +4 -0
  169. package/lib/components/PopOver.js +64 -1
  170. package/lib/env.js +1 -1
  171. package/lib/envOverwrite.js +1 -1
  172. package/lib/factory.js +1 -1
  173. package/lib/index.d.ts +2 -1
  174. package/lib/index.js +5 -2
  175. package/lib/locale.js +1 -1
  176. package/lib/polyfills.js +1 -1
  177. package/lib/renderers/Form.d.ts +1 -1
  178. package/lib/renderers/Form.js +16 -8
  179. package/lib/renderers/Item.d.ts +55 -1
  180. package/lib/renderers/Item.js +1 -1
  181. package/lib/renderers/Options.d.ts +4 -0
  182. package/lib/renderers/Options.js +5 -4
  183. package/lib/renderers/Placeholder.js +1 -1
  184. package/lib/renderers/builtin.js +1 -1
  185. package/lib/renderers/register.js +1 -1
  186. package/lib/renderers/wrapControl.js +4 -6
  187. package/lib/store/app.js +1 -1
  188. package/lib/store/combo.d.ts +25 -24
  189. package/lib/store/combo.js +1 -1
  190. package/lib/store/crud.d.ts +9 -1
  191. package/lib/store/crud.js +29 -13
  192. package/lib/store/form.d.ts +11 -10
  193. package/lib/store/form.js +1 -1
  194. package/lib/store/formItem.js +16 -7
  195. package/lib/store/iRenderer.js +1 -1
  196. package/lib/store/index.js +1 -1
  197. package/lib/store/list.js +1 -1
  198. package/lib/store/manager.js +1 -1
  199. package/lib/store/modal.js +1 -1
  200. package/lib/store/node.js +1 -1
  201. package/lib/store/pagination.js +1 -1
  202. package/lib/store/root.js +1 -1
  203. package/lib/store/service.js +1 -1
  204. package/lib/store/status.js +1 -1
  205. package/lib/store/table.d.ts +22 -20
  206. package/lib/store/table.js +8 -12
  207. package/lib/store/table2.js +1 -1
  208. package/lib/theme.js +1 -1
  209. package/lib/utils/Animation.js +1 -1
  210. package/lib/utils/ColorScale.js +1 -1
  211. package/lib/utils/DataSchema.js +1 -1
  212. package/lib/utils/DataScope.js +1 -1
  213. package/lib/utils/RootClose.js +1 -1
  214. package/lib/utils/SimpleMap.js +1 -1
  215. package/lib/utils/api.js +1 -1
  216. package/lib/utils/arraySlice.js +1 -1
  217. package/lib/utils/attachmentAdpator.js +3 -1
  218. package/lib/utils/autobind.js +1 -1
  219. package/lib/utils/columnsSplit.js +1 -1
  220. package/lib/utils/dataMapping.js +1 -1
  221. package/lib/utils/date.js +1 -1
  222. package/lib/utils/debug.js +1 -1
  223. package/lib/utils/decodeEntity.js +1 -1
  224. package/lib/utils/dom.js +1 -1
  225. package/lib/utils/errors.js +1 -1
  226. package/lib/utils/escapeHtml.js +1 -1
  227. package/lib/utils/filter-schema.d.ts +2 -1
  228. package/lib/utils/filter-schema.js +14 -4
  229. package/lib/utils/filter.js +1 -1
  230. package/lib/utils/formatDuration.js +1 -1
  231. package/lib/utils/formula.js +1 -1
  232. package/lib/utils/getVariable.js +1 -1
  233. package/lib/utils/grammar.js +1 -1
  234. package/lib/utils/handleAction.js +1 -1
  235. package/lib/utils/helper.js +1 -1
  236. package/lib/utils/highlight.js +1 -1
  237. package/lib/utils/icon.js +1 -1
  238. package/lib/utils/image.js +1 -1
  239. package/lib/utils/isPureVariable.js +1 -1
  240. package/lib/utils/json-schema-2-amis-schema.js +1 -1
  241. package/lib/utils/keyToPath.js +1 -1
  242. package/lib/utils/makeSorter.js +1 -1
  243. package/lib/utils/math.js +1 -1
  244. package/lib/utils/memoryParse.js +1 -1
  245. package/lib/utils/normalizeLink.js +1 -1
  246. package/lib/utils/normalizeOptions.js +1 -1
  247. package/lib/utils/object.js +1 -1
  248. package/lib/utils/offset.js +1 -1
  249. package/lib/utils/offsetParent.js +1 -1
  250. package/lib/utils/optionValueCompare.js +1 -1
  251. package/lib/utils/position.js +1 -1
  252. package/lib/utils/prettyBytes.js +1 -1
  253. package/lib/utils/renderer-event.js +1 -1
  254. package/lib/utils/replaceText.js +1 -1
  255. package/lib/utils/resize-sensor.js +1 -1
  256. package/lib/utils/resolveCondition.js +1 -1
  257. package/lib/utils/resolveVariable.js +1 -1
  258. package/lib/utils/resolveVariableAndFilter.js +1 -1
  259. package/lib/utils/resolveVariableAndFilterForAsync.js +1 -1
  260. package/lib/utils/scrollPosition.js +1 -1
  261. package/lib/utils/string2regExp.js +1 -1
  262. package/lib/utils/stripNumber.js +1 -1
  263. package/lib/utils/style-helper.js +5 -3
  264. package/lib/utils/style.js +1 -1
  265. package/lib/utils/toNumber.js +1 -1
  266. package/lib/utils/tokenize.js +1 -1
  267. package/lib/utils/tpl-builtin.js +1 -1
  268. package/lib/utils/tpl-lodash.js +1 -1
  269. package/lib/utils/tpl.js +1 -1
  270. package/lib/utils/uncontrollable.js +1 -1
  271. package/lib/utils/validations.js +1 -1
  272. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -163,14 +163,16 @@ function formatStyle(themeCss, classNames, id, defaultData) {
163
163
  style_1['top-left-border-radius'] || 0,
164
164
  style_1['top-right-border-radius'] || 0,
165
165
  style_1['bottom-right-border-radius'] || 0,
166
- style_1['bottom-left-border-radius'] || 0
166
+ style_1['bottom-left-border-radius'] || 0,
167
+ (weights === null || weights === void 0 ? void 0 : weights.important) ? ' !important' : ''
167
168
  ].join(' '));
168
169
  }
169
170
  else {
170
171
  Object.keys(style_1).forEach(function (k) {
171
172
  if (k !== '$$id') {
172
173
  var value = style_1[k];
173
- value && fn(k, value);
174
+ value &&
175
+ fn(k, value + ((weights === null || weights === void 0 ? void 0 : weights.important) ? ' !important' : ''));
174
176
  }
175
177
  });
176
178
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
package/esm/utils/tpl.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
package/lib/Root.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
package/lib/Scoped.d.ts CHANGED
@@ -5,6 +5,7 @@
5
5
  import React from 'react';
6
6
  import { RendererEnv, RendererProps } from './factory';
7
7
  import { RendererData, ActionObject } from './types';
8
+ import { ListenerAction } from './actions';
8
9
  /**
9
10
  * target 里面可能包含 ?xxx=xxx,这种情况下,需要把 ?xxx=xxx 保留下来,然后对前面的部分进行 filter
10
11
  * 因为后面会对 query 部分做不一样的处理。会保留原始的值。而不是会转成字符串。
@@ -36,6 +37,7 @@ export interface IScopedContext {
36
37
  close: (target: string) => void;
37
38
  closeById: (target: string) => void;
38
39
  getComponentsByRefPath: (session: string, path: string) => ScopedComponentType[];
40
+ doAction: (actions: ListenerAction | ListenerAction[], ctx: any) => void;
39
41
  }
40
42
  type AliasIScopedContext = IScopedContext;
41
43
  export declare const ScopedContext: React.Context<IScopedContext>;
package/lib/Scoped.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -14,9 +14,9 @@ var values = require('lodash/values');
14
14
  var hoistNonReactStatic = require('hoist-non-react-statics');
15
15
  var amisFormula = require('amis-formula');
16
16
  require('moment');
17
- require('lodash/isPlainObject');
18
- var getVariable = require('./utils/getVariable.js');
17
+ var object = require('./utils/object.js');
19
18
  var isPureVariable = require('./utils/isPureVariable.js');
19
+ var getVariable = require('./utils/getVariable.js');
20
20
  var dataMapping = require('./utils/dataMapping.js');
21
21
  require('./utils/filter.js');
22
22
  var helper = require('./utils/helper.js');
@@ -29,6 +29,7 @@ require('./utils/debug.js');
29
29
  require('./utils/dom.js');
30
30
  require('./utils/errors.js');
31
31
  var tpl = require('./utils/tpl.js');
32
+ require('lodash/isPlainObject');
32
33
  require('lodash/isObject');
33
34
  require('lodash/isString');
34
35
  require('lodash/isBoolean');
@@ -36,8 +37,7 @@ require('./utils/highlight.js');
36
37
  require('./utils/icon.js');
37
38
  require('./utils/image.js');
38
39
  require('lodash/isEqual');
39
- require('./actions/Action.js');
40
- require('lodash/debounce');
40
+ var rendererEvent = require('./utils/renderer-event.js');
41
41
  require('lodash/cloneDeep');
42
42
  require('./utils/resize-sensor.js');
43
43
  require('react-overlays/useRootClose');
@@ -53,6 +53,24 @@ require('./utils/validations.js');
53
53
  require('./utils/resolveCondition.js');
54
54
  require('mobx');
55
55
  require('./utils/Animation.js');
56
+ require('./actions/LoopAction.js');
57
+ require('./actions/BreakAction.js');
58
+ require('./actions/ContinueAction.js');
59
+ require('./actions/SwitchAction.js');
60
+ require('./actions/ParallelAction.js');
61
+ require('./actions/CustomAction.js');
62
+ require('./actions/BroadcastAction.js');
63
+ require('./actions/CmptAction.js');
64
+ require('./actions/StatusAction.js');
65
+ require('./actions/AjaxAction.js');
66
+ require('./actions/CopyAction.js');
67
+ require('./actions/DialogAction.js');
68
+ require('./actions/DrawerAction.js');
69
+ require('./actions/EmailAction.js');
70
+ require('./actions/LinkAction.js');
71
+ require('./actions/ToastAction.js');
72
+ require('./actions/PageAction.js');
73
+ var Action = require('./actions/Action.js');
56
74
 
57
75
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
58
76
 
@@ -311,6 +329,30 @@ function createScopedTools(path, parent, env, rendererType) {
311
329
  if (component && component.props.show) {
312
330
  closeDialog(component);
313
331
  }
332
+ },
333
+ doAction: function (actions, ctx) {
334
+ return tslib.__awaiter(this, void 0, void 0, function () {
335
+ var renderer, rendererEvent$1;
336
+ return tslib.__generator(this, function (_a) {
337
+ switch (_a.label) {
338
+ case 0:
339
+ renderer = this.getComponents()[0];
340
+ rendererEvent$1 = rendererEvent.createRendererEvent('embed', {
341
+ env: env,
342
+ nativeEvent: undefined,
343
+ data: object.createObject(renderer.props.data, ctx),
344
+ scoped: this
345
+ });
346
+ return [4 /*yield*/, Action.runActions(actions, renderer, rendererEvent$1)];
347
+ case 1:
348
+ _a.sent();
349
+ if (rendererEvent$1.prevented) {
350
+ return [2 /*return*/];
351
+ }
352
+ return [2 /*return*/];
353
+ }
354
+ });
355
+ });
314
356
  }
315
357
  };
316
358
  amisFormula.registerFunction('GETRENDERERDATA', function (componentId, path, scoped) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
package/lib/WithStore.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -72,12 +72,10 @@ function HocStoreFactory(renderer) {
72
72
  var detectField = props.detectField, rest = tslib.__rest(props, ["detectField"]);
73
73
  var exprProps = {};
74
74
  if (!detectField || detectField === 'data') {
75
- exprProps = filterSchema.getExprProperties(rest, store.data, undefined, rest);
75
+ exprProps = filterSchema.getExprProperties(rest, store.data);
76
76
  _this.state = tslib.__assign({}, exprProps);
77
- _this.unReaction = mobx.reaction(function () {
78
- return JSON.stringify(filterSchema.getExprProperties(_this.props, store.data, undefined, _this.props));
79
- }, function () {
80
- return _this.setState(tslib.__assign({}, filterSchema.getExprProperties(_this.props, store.data, undefined, _this.props)));
77
+ _this.unReaction = mobx.reaction(function () { return JSON.stringify(filterSchema.getExprProperties(_this.props, store.data)); }, function () {
78
+ return _this.setState(tslib.__assign({}, filterSchema.getExprProperties(_this.props, store.data)));
81
79
  });
82
80
  }
83
81
  return _this;
@@ -97,10 +95,24 @@ function HocStoreFactory(renderer) {
97
95
  return data;
98
96
  };
99
97
  StoreFactory.prototype.componentDidUpdate = function (prevProps) {
100
- var _a, _b, _c;
98
+ var _this = this;
99
+ var _a, _b, _c, _d;
101
100
  var props = this.props;
102
101
  var store = this.store;
103
- var shouldSync = (_a = renderer.shouldSyncSuperStore) === null || _a === void 0 ? void 0 : _a.call(renderer, store, props, prevProps);
102
+ // dialog 场景下 schema 是显示的时候更新的,
103
+ // 所以 schema 里面有表达式属性其实是监听不到变化的
104
+ // 所以这里需要根据新属性重新 reaction 一下
105
+ if ((!props.detectField || props.detectField === 'data') &&
106
+ filterSchema.hasExprPropertiesChanged(this.props, prevProps)) {
107
+ var state = filterSchema.getExprProperties(this.props, store.data);
108
+ helper.isObjectShallowModified(state, this.state) && this.setState(state);
109
+ // 需要重新监听
110
+ (_a = this.unReaction) === null || _a === void 0 ? void 0 : _a.call(this);
111
+ this.unReaction = mobx.reaction(function () { return JSON.stringify(filterSchema.getExprProperties(props, store.data)); }, function () {
112
+ return _this.setState(tslib.__assign({}, filterSchema.getExprProperties(_this.props, store.data)));
113
+ });
114
+ }
115
+ var shouldSync = (_b = renderer.shouldSyncSuperStore) === null || _b === void 0 ? void 0 : _b.call(renderer, store, props, prevProps);
104
116
  if (shouldSync === false) {
105
117
  return;
106
118
  }
@@ -135,10 +147,13 @@ function HocStoreFactory(renderer) {
135
147
  ? tslib.__assign({}, store.data) : helper.syncDataFromSuper(store.data, props.store.data, prevProps.scope, store, props.syncSuperStore === true)), props.updatePristineAfterStoreDataReInit === false);
136
148
  }
137
149
  else if (props.data && props.data.__super) {
138
- store.initData(object.extendObject(props.data, store.hasRemoteData || store.path === 'page'
150
+ store.initData(object.extendObject(props.data,
151
+ // 有远程数据
152
+ // 或者顶级 store
153
+ store.hasRemoteData || !store.path.includes('/')
139
154
  ? tslib.__assign(tslib.__assign({}, store.data), props.data) : // combo 不需要同步,如果要同步,在 Combo.tsx 里面已经实现了相关逻辑
140
155
  // 目前主要的问题是,如果 combo 中表单项名字和 combo 本身的名字一样,会导致里面的值会被覆盖成数组
141
- ((_b = props.store) === null || _b === void 0 ? void 0 : _b.storeType) === 'ComboStore'
156
+ ((_c = props.store) === null || _c === void 0 ? void 0 : _c.storeType) === 'ComboStore'
142
157
  ? undefined
143
158
  : helper.syncDataFromSuper(props.data, props.data.__super, prevProps.data.__super, store, false)), props.updatePristineAfterStoreDataReInit === false);
144
159
  }
@@ -155,7 +170,7 @@ function HocStoreFactory(renderer) {
155
170
  helper.isObjectShallowModified(props.data.__super, prevProps.data.__super, false)) {
156
171
  store.initData(object.createObject(props.data.__super, tslib.__assign(tslib.__assign({}, props.data), store.data)), props.updatePristineAfterStoreDataReInit === false ||
157
172
  (store.storeType === 'FormStore' &&
158
- ((_c = prevProps.store) === null || _c === void 0 ? void 0 : _c.storeType) === 'CRUDStore'));
173
+ ((_d = prevProps.store) === null || _d === void 0 ? void 0 : _d.storeType) === 'CRUDStore'));
159
174
  }
160
175
  // nextProps.data.__super !== props.data.__super) &&
161
176
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -189,10 +189,10 @@ var runActions = function (actions, renderer, event) { return tslib.__awaiter(vo
189
189
  }); };
190
190
  // 执行动作,与原有动作处理打通
191
191
  var runAction = function (actionInstrance, actionConfig, renderer, event) { return tslib.__awaiter(void 0, void 0, void 0, function () {
192
- var additional, action, mergeData, expression, isStop, preventDefault, key, api, args, afterMappingData, actionData, data, stopped, actionResult, stopPropagation;
193
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
194
- return tslib.__generator(this, function (_u) {
195
- switch (_u.label) {
192
+ var additional, action, mergeData, expression, isStop, preventDefault, key, api, cmptFlag, targetComponent, args, afterMappingData, actionData, data, stopped, actionResult, stopPropagation;
193
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
194
+ return tslib.__generator(this, function (_v) {
195
+ switch (_v.label) {
196
196
  case 0:
197
197
  additional = {
198
198
  event: event
@@ -214,8 +214,8 @@ var runAction = function (actionInstrance, actionConfig, renderer, event) { retu
214
214
  if (!expression) return [3 /*break*/, 2];
215
215
  return [4 /*yield*/, tpl.evalExpressionWithConditionBuilder(expression, mergeData, true)];
216
216
  case 1:
217
- isStop = !(_u.sent());
218
- _u.label = 2;
217
+ isStop = !(_v.sent());
218
+ _v.label = 2;
219
219
  case 2:
220
220
  if (isStop) {
221
221
  return [2 /*return*/];
@@ -224,8 +224,8 @@ var runAction = function (actionInstrance, actionConfig, renderer, event) { retu
224
224
  if (!action.preventDefault) return [3 /*break*/, 4];
225
225
  return [4 /*yield*/, tpl.evalExpressionWithConditionBuilder(action.preventDefault, mergeData, false)];
226
226
  case 3:
227
- preventDefault = _u.sent();
228
- _u.label = 4;
227
+ preventDefault = _v.sent();
228
+ _v.label = 4;
229
229
  case 4:
230
230
  key = {
231
231
  componentId: dataMapping.dataMapping(action.componentId, mergeData),
@@ -249,14 +249,22 @@ var runAction = function (actionInstrance, actionConfig, renderer, event) { retu
249
249
  (_q = action.args) === null || _q === void 0 ? true : delete _q.options;
250
250
  (_r = action.args) === null || _r === void 0 ? true : delete _r.messages;
251
251
  }
252
+ cmptFlag = key.componentId || key.componentName;
253
+ targetComponent = cmptFlag
254
+ ? (_s = event.context.scoped) === null || _s === void 0 ? void 0 : _s[action.componentId ? 'getComponentById' : 'getComponentByName'](cmptFlag)
255
+ : renderer;
252
256
  args = dataMapping.dataMapping(action.args, mergeData, function (key) {
253
- return [
254
- 'adaptor',
255
- 'responseAdaptor',
256
- 'requestAdaptor',
257
- 'responseData',
258
- 'condition'
259
- ].includes(key);
257
+ var _a;
258
+ var actionIgnoreKey = {
259
+ ajax: ['adaptor', 'responseAdaptor', 'requestAdaptor', 'responseData']
260
+ };
261
+ var cmptIgnoreMap = {
262
+ 'input-table': ['condition']
263
+ };
264
+ var curCmptType = (_a = targetComponent === null || targetComponent === void 0 ? void 0 : targetComponent.props) === null || _a === void 0 ? void 0 : _a.type;
265
+ var curActionType = action.actionType;
266
+ var ignoreKey = tslib.__spreadArray(tslib.__spreadArray([], tslib.__read((actionIgnoreKey[curActionType] || [])), false), tslib.__read((cmptIgnoreMap[curCmptType] || [])), false);
267
+ return ignoreKey.includes(key);
260
268
  });
261
269
  afterMappingData = dataMapping.dataMapping(action.data, mergeData);
262
270
  actionData = args && Object.keys(args).length
@@ -266,12 +274,12 @@ var runAction = function (actionInstrance, actionConfig, renderer, event) { retu
266
274
  !['ajax', 'download', 'dialog', 'drawer'].includes(action.actionType) // 避免非法配置影响对actionData的判断,导致动作配置中的数据映射失败
267
275
  ? actionData
268
276
  : mergeData;
269
- (_s = console.group) === null || _s === void 0 ? void 0 : _s.call(console, "run action ".concat(action.actionType));
277
+ (_t = console.group) === null || _t === void 0 ? void 0 : _t.call(console, "run action ".concat(action.actionType));
270
278
  console.debug("[".concat(action.actionType, "] action args, data"), args, data);
271
279
  stopped = false;
272
280
  return [4 /*yield*/, actionInstrance.run(tslib.__assign(tslib.__assign(tslib.__assign({}, action), { args: args, data: action.actionType === 'reload' ? actionData : data }), key), renderer, event, mergeData)];
273
281
  case 5:
274
- actionResult = _u.sent();
282
+ actionResult = _v.sent();
275
283
  // 二次确认弹窗如果取消,则终止后续动作
276
284
  if ((action === null || action === void 0 ? void 0 : action.actionType) === 'confirmDialog' && !actionResult) {
277
285
  stopped = true;
@@ -281,11 +289,11 @@ var runAction = function (actionInstrance, actionConfig, renderer, event) { retu
281
289
  if (!action.stopPropagation) return [3 /*break*/, 7];
282
290
  return [4 /*yield*/, tpl.evalExpressionWithConditionBuilder(action.stopPropagation, mergeData, false)];
283
291
  case 6:
284
- stopPropagation = _u.sent();
285
- _u.label = 7;
292
+ stopPropagation = _v.sent();
293
+ _v.label = 7;
286
294
  case 7:
287
295
  console.debug("[".concat(action.actionType, "] action end event"), event);
288
- (_t = console.groupEnd) === null || _t === void 0 ? void 0 : _t.call(console);
296
+ (_u = console.groupEnd) === null || _u === void 0 ? void 0 : _u.call(console);
289
297
  // 阻止原有动作执行
290
298
  preventDefault && event.preventDefault();
291
299
  // 阻止后续动作执行
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -34,7 +34,7 @@ var AjaxAction = /** @class */ (function () {
34
34
  return tslib.__generator(this, function (_p) {
35
35
  switch (_p.label) {
36
36
  case 0:
37
- if (!((_a = renderer.props.env) === null || _a === void 0 ? void 0 : _a.fetcher)) {
37
+ if (!((_a = event.context.env) === null || _a === void 0 ? void 0 : _a.fetcher)) {
38
38
  throw new Error('env.fetcher is required!');
39
39
  }
40
40
  if (!action.api) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -34,7 +34,7 @@ var CmptAction = /** @class */ (function () {
34
34
  dataMergeMode = action.dataMergeMode || 'merge';
35
35
  path = (_a = action.args) === null || _a === void 0 ? void 0 : _a.path;
36
36
  if (!(action.actionType === 'setValue' && path && typeof path === 'string')) return [3 /*break*/, 2];
37
- beforeSetData = (_c = (_b = renderer === null || renderer === void 0 ? void 0 : renderer.props) === null || _b === void 0 ? void 0 : _b.env) === null || _c === void 0 ? void 0 : _c.beforeSetData;
37
+ beforeSetData = (_c = (_b = event === null || event === void 0 ? void 0 : event.context) === null || _b === void 0 ? void 0 : _b.env) === null || _c === void 0 ? void 0 : _c.beforeSetData;
38
38
  if (!(beforeSetData && typeof beforeSetData === 'function')) return [3 /*break*/, 2];
39
39
  return [4 /*yield*/, beforeSetData(renderer, action, event)];
40
40
  case 1:
@@ -47,7 +47,7 @@ var CmptAction = /** @class */ (function () {
47
47
  component = key
48
48
  ? (_d = event.context.scoped) === null || _d === void 0 ? void 0 : _d[action.componentId ? 'getComponentById' : 'getComponentByName'](key)
49
49
  : renderer;
50
- // 如果key指定来,但是没找到组件,则报错
50
+ // 如果key指定了,但是没找到组件,则报错
51
51
  if (key && !component) {
52
52
  msg = '尝试执行一个不存在的目标组件动作,请检查目标组件非隐藏状态,且正确指定了componentId或componentName';
53
53
  if (action.ignoreError === false) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -24,11 +24,11 @@ var CopyAction = /** @class */ (function () {
24
24
  var _a, _b, _c, _d, _e, _f;
25
25
  return tslib.__awaiter(this, void 0, void 0, function () {
26
26
  return tslib.__generator(this, function (_g) {
27
- if (!((_a = renderer.props.env) === null || _a === void 0 ? void 0 : _a.copy)) {
27
+ if (!((_a = event.context.env) === null || _a === void 0 ? void 0 : _a.copy)) {
28
28
  throw new Error('env.copy is required!');
29
29
  }
30
30
  if ((_b = action.args) === null || _b === void 0 ? void 0 : _b.content) {
31
- (_d = (_c = renderer.props.env).copy) === null || _d === void 0 ? void 0 : _d.call(_c, action.args.content, {
31
+ (_d = (_c = event.context.env) === null || _c === void 0 ? void 0 : _c.copy) === null || _d === void 0 ? void 0 : _d.call(_c, action.args.content, {
32
32
  format: (_f = (_e = action.args) === null || _e === void 0 ? void 0 : _e.copyFormat) !== null && _f !== void 0 ? _f : 'text/html'
33
33
  });
34
34
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.5.3
2
+ * amis-core v3.6.1
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5