amis-core 6.13.0-beta.2 → 6.13.0-beta.21

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 (326) hide show
  1. package/esm/Root.js +1 -1
  2. package/esm/RootRenderer.js +15 -7
  3. package/esm/SchemaRenderer.js +11 -6
  4. package/esm/Scoped.js +1 -1
  5. package/esm/StatusScoped.js +1 -1
  6. package/esm/StyleManager.js +1 -1
  7. package/esm/WithRootStore.js +1 -1
  8. package/esm/WithStore.js +1 -1
  9. package/esm/actions/Action.js +60 -15
  10. package/esm/actions/AjaxAction.js +2 -2
  11. package/esm/actions/BreakAction.js +1 -1
  12. package/esm/actions/BroadcastAction.js +1 -1
  13. package/esm/actions/CmptAction.js +48 -43
  14. package/esm/actions/ContinueAction.js +1 -1
  15. package/esm/actions/CopyAction.js +1 -1
  16. package/esm/actions/CustomAction.js +7 -7
  17. package/esm/actions/DialogAction.js +8 -8
  18. package/esm/actions/DrawerAction.js +8 -8
  19. package/esm/actions/EmailAction.js +1 -1
  20. package/esm/actions/EventAction.js +9 -9
  21. package/esm/actions/LinkAction.js +1 -1
  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/PrintAction.js +1 -1
  26. package/esm/actions/StatusAction.js +1 -1
  27. package/esm/actions/SwitchAction.js +1 -1
  28. package/esm/actions/ToastAction.js +1 -1
  29. package/esm/actions/WaitAction.js +1 -1
  30. package/esm/components/Animations.js +7 -7
  31. package/esm/components/CustomStyle.js +1 -1
  32. package/esm/components/ErrorBoundary.js +1 -1
  33. package/esm/components/LazyComponent.js +1 -1
  34. package/esm/components/Overlay.js +7 -7
  35. package/esm/components/PopOver.js +9 -7
  36. package/esm/env.js +1 -1
  37. package/esm/envOverwrite.js +1 -1
  38. package/esm/factory.js +1 -1
  39. package/esm/globalVar.js +1 -1
  40. package/esm/globalVarClientHandler.js +1 -1
  41. package/esm/globalVarDefaultValueHandler.js +1 -1
  42. package/esm/index.d.ts +2 -2
  43. package/esm/index.js +8 -8
  44. package/esm/locale.js +1 -1
  45. package/esm/polyfills.js +1 -1
  46. package/esm/renderers/Form.d.ts +5 -1
  47. package/esm/renderers/Form.js +72 -24
  48. package/esm/renderers/Item.js +1 -1
  49. package/esm/renderers/Options.js +1 -1
  50. package/esm/renderers/Placeholder.js +1 -1
  51. package/esm/renderers/builtin.js +1 -1
  52. package/esm/renderers/register.js +1 -1
  53. package/esm/renderers/wrapControl.d.ts +0 -1
  54. package/esm/renderers/wrapControl.js +30 -14
  55. package/esm/store/app.d.ts +2 -0
  56. package/esm/store/app.js +8 -8
  57. package/esm/store/combo.d.ts +132 -0
  58. package/esm/store/combo.js +24 -2
  59. package/esm/store/crud.d.ts +3 -0
  60. package/esm/store/crud.js +6 -2
  61. package/esm/store/form.d.ts +52 -0
  62. package/esm/store/form.js +3 -3
  63. package/esm/store/formItem.d.ts +1 -0
  64. package/esm/store/formItem.js +4 -2
  65. package/esm/store/iRenderer.d.ts +2 -0
  66. package/esm/store/iRenderer.js +9 -3
  67. package/esm/store/index.js +1 -1
  68. package/esm/store/list.d.ts +2 -0
  69. package/esm/store/list.js +1 -1
  70. package/esm/store/manager.js +1 -1
  71. package/esm/store/modal.d.ts +4 -0
  72. package/esm/store/modal.js +7 -2
  73. package/esm/store/node.js +1 -1
  74. package/esm/store/pagination.d.ts +2 -0
  75. package/esm/store/pagination.js +1 -1
  76. package/esm/store/root.d.ts +8 -2
  77. package/esm/store/root.js +142 -72
  78. package/esm/store/service.d.ts +2 -0
  79. package/esm/store/service.js +8 -8
  80. package/esm/store/status.js +1 -1
  81. package/esm/store/table.d.ts +146 -92
  82. package/esm/store/table.js +36 -19
  83. package/esm/store/table2.d.ts +2 -0
  84. package/esm/store/table2.js +4 -3
  85. package/esm/theme.js +1 -1
  86. package/esm/utils/Animation.js +1 -1
  87. package/esm/utils/ColorScale.js +1 -1
  88. package/esm/utils/DataSchema.js +1 -1
  89. package/esm/utils/DataScope.js +1 -1
  90. package/esm/utils/RootClose.js +1 -1
  91. package/esm/utils/SimpleMap.js +1 -1
  92. package/esm/utils/animations.js +1 -1
  93. package/esm/utils/api.js +8 -3
  94. package/esm/utils/arraySlice.js +1 -1
  95. package/esm/utils/attachmentAdpator.js +1 -1
  96. package/esm/utils/autobind.js +1 -1
  97. package/esm/utils/browser.js +1 -1
  98. package/esm/utils/columnsSplit.js +1 -1
  99. package/esm/utils/concatData.js +1 -1
  100. package/esm/utils/dataMapping.js +1 -1
  101. package/esm/utils/date.js +6 -9
  102. package/esm/utils/debug.js +1 -1
  103. package/esm/utils/decodeEntity.js +1 -1
  104. package/esm/utils/dom.js +6 -3
  105. package/esm/utils/errors.js +2 -1
  106. package/esm/utils/escapeHtml.js +1 -1
  107. package/esm/utils/filter-schema.js +1 -1
  108. package/esm/utils/filter.js +1 -1
  109. package/esm/utils/formatDuration.js +1 -1
  110. package/esm/utils/formula.js +2 -2
  111. package/esm/utils/getPageId.js +1 -1
  112. package/esm/utils/getVariable.js +1 -1
  113. package/esm/utils/grammar.js +1 -1
  114. package/esm/utils/handleAction.js +1 -1
  115. package/esm/utils/helper.js +3 -3
  116. package/esm/utils/highlight.js +1 -1
  117. package/esm/utils/icon.js +1 -1
  118. package/esm/utils/image.js +1 -1
  119. package/esm/utils/index.d.ts +1 -1
  120. package/esm/utils/index.js +9 -9
  121. package/esm/utils/isPureVariable.js +2 -2
  122. package/esm/utils/json-schema-2-amis-schema.js +1 -1
  123. package/esm/utils/keyToPath.js +1 -1
  124. package/esm/utils/labelToString.js +1 -1
  125. package/esm/utils/loopTooMuch.js +1 -1
  126. package/esm/utils/makeSorter.js +1 -1
  127. package/esm/utils/math.js +1 -1
  128. package/esm/utils/memoryParse.js +1 -1
  129. package/esm/utils/normalizeLink.js +1 -1
  130. package/esm/utils/normalizeOptions.js +6 -2
  131. package/esm/utils/object.js +1 -1
  132. package/esm/utils/offset.js +1 -1
  133. package/esm/utils/offsetParent.js +1 -1
  134. package/esm/utils/optionValueCompare.js +1 -1
  135. package/esm/utils/position.js +1 -1
  136. package/esm/utils/prettyBytes.js +1 -1
  137. package/esm/utils/printElement.js +1 -1
  138. package/esm/utils/renderer-event.js +1 -1
  139. package/esm/utils/replaceText.js +1 -1
  140. package/esm/utils/resize-sensor.d.ts +3 -1
  141. package/esm/utils/resize-sensor.js +63 -29
  142. package/esm/utils/resolveCondition.js +2 -2
  143. package/esm/utils/resolveVariable.js +1 -1
  144. package/esm/utils/resolveVariableAndFilter.js +4 -3
  145. package/esm/utils/resolveVariableAndFilterForAsync.js +1 -1
  146. package/esm/utils/scrollPosition.js +1 -1
  147. package/esm/utils/string2regExp.js +1 -1
  148. package/esm/utils/stripNumber.js +1 -1
  149. package/esm/utils/style-helper.d.ts +12 -1
  150. package/esm/utils/style-helper.js +30 -18
  151. package/esm/utils/style.d.ts +13 -0
  152. package/esm/utils/style.js +44 -4
  153. package/esm/utils/toNumber.js +1 -1
  154. package/esm/utils/tokenize.js +1 -1
  155. package/esm/utils/tpl-builtin.d.ts +1 -0
  156. package/esm/utils/tpl-builtin.js +7 -3
  157. package/esm/utils/tpl-lodash.js +1 -1
  158. package/esm/utils/tpl.js +6 -2
  159. package/esm/utils/uncontrollable.js +1 -1
  160. package/esm/utils/validateId.js +1 -1
  161. package/esm/utils/validations.js +2 -2
  162. package/esm/utils/visitedCache.js +1 -1
  163. package/lib/Root.js +1 -1
  164. package/lib/RootRenderer.d.ts +1 -1
  165. package/lib/RootRenderer.js +15 -7
  166. package/lib/SchemaRenderer.js +10 -5
  167. package/lib/Scoped.js +1 -1
  168. package/lib/StatusScoped.js +1 -1
  169. package/lib/StyleManager.js +1 -1
  170. package/lib/WithRootStore.js +1 -1
  171. package/lib/WithStore.js +1 -1
  172. package/lib/actions/Action.js +62 -14
  173. package/lib/actions/AjaxAction.js +2 -2
  174. package/lib/actions/BreakAction.js +1 -1
  175. package/lib/actions/BroadcastAction.js +1 -1
  176. package/lib/actions/CmptAction.js +48 -43
  177. package/lib/actions/ContinueAction.js +1 -1
  178. package/lib/actions/CopyAction.js +1 -1
  179. package/lib/actions/CustomAction.js +7 -7
  180. package/lib/actions/DialogAction.js +8 -8
  181. package/lib/actions/DrawerAction.js +8 -8
  182. package/lib/actions/EmailAction.js +1 -1
  183. package/lib/actions/EventAction.js +9 -9
  184. package/lib/actions/LinkAction.js +1 -1
  185. package/lib/actions/LoopAction.js +1 -1
  186. package/lib/actions/PageAction.js +1 -1
  187. package/lib/actions/ParallelAction.js +1 -1
  188. package/lib/actions/PrintAction.js +1 -1
  189. package/lib/actions/StatusAction.js +1 -1
  190. package/lib/actions/SwitchAction.js +1 -1
  191. package/lib/actions/ToastAction.js +1 -1
  192. package/lib/actions/WaitAction.js +1 -1
  193. package/lib/components/Animations.js +7 -7
  194. package/lib/components/CustomStyle.js +1 -1
  195. package/lib/components/ErrorBoundary.js +1 -1
  196. package/lib/components/LazyComponent.js +1 -1
  197. package/lib/components/Overlay.js +7 -7
  198. package/lib/components/PopOver.js +9 -7
  199. package/lib/env.js +1 -1
  200. package/lib/envOverwrite.js +1 -1
  201. package/lib/factory.js +1 -1
  202. package/lib/globalVar.js +1 -1
  203. package/lib/globalVarClientHandler.js +1 -1
  204. package/lib/globalVarDefaultValueHandler.js +1 -1
  205. package/lib/index.d.ts +2 -2
  206. package/lib/index.js +12 -6
  207. package/lib/locale.js +1 -1
  208. package/lib/polyfills.js +1 -1
  209. package/lib/renderers/Form.d.ts +5 -1
  210. package/lib/renderers/Form.js +71 -23
  211. package/lib/renderers/Item.js +1 -1
  212. package/lib/renderers/Options.js +1 -1
  213. package/lib/renderers/Placeholder.js +1 -1
  214. package/lib/renderers/builtin.js +1 -1
  215. package/lib/renderers/register.js +1 -1
  216. package/lib/renderers/wrapControl.d.ts +0 -1
  217. package/lib/renderers/wrapControl.js +30 -14
  218. package/lib/store/app.d.ts +2 -0
  219. package/lib/store/app.js +8 -8
  220. package/lib/store/combo.d.ts +156 -25
  221. package/lib/store/combo.js +24 -2
  222. package/lib/store/crud.d.ts +3 -0
  223. package/lib/store/crud.js +6 -2
  224. package/lib/store/form.d.ts +62 -11
  225. package/lib/store/form.js +3 -3
  226. package/lib/store/formItem.d.ts +1 -0
  227. package/lib/store/formItem.js +4 -2
  228. package/lib/store/iRenderer.d.ts +2 -0
  229. package/lib/store/iRenderer.js +9 -3
  230. package/lib/store/index.js +1 -1
  231. package/lib/store/list.d.ts +2 -0
  232. package/lib/store/list.js +1 -1
  233. package/lib/store/manager.js +1 -1
  234. package/lib/store/modal.d.ts +4 -0
  235. package/lib/store/modal.js +7 -2
  236. package/lib/store/node.js +1 -1
  237. package/lib/store/pagination.d.ts +2 -0
  238. package/lib/store/pagination.js +1 -1
  239. package/lib/store/root.d.ts +8 -3
  240. package/lib/store/root.js +140 -70
  241. package/lib/store/service.d.ts +2 -0
  242. package/lib/store/service.js +8 -8
  243. package/lib/store/status.js +1 -1
  244. package/lib/store/table.d.ts +166 -113
  245. package/lib/store/table.js +36 -19
  246. package/lib/store/table2.d.ts +2 -0
  247. package/lib/store/table2.js +4 -3
  248. package/lib/theme.js +1 -1
  249. package/lib/utils/Animation.js +1 -1
  250. package/lib/utils/ColorScale.js +1 -1
  251. package/lib/utils/DataSchema.js +1 -1
  252. package/lib/utils/DataScope.js +1 -1
  253. package/lib/utils/RootClose.js +1 -1
  254. package/lib/utils/SimpleMap.js +1 -1
  255. package/lib/utils/animations.js +1 -1
  256. package/lib/utils/api.js +8 -3
  257. package/lib/utils/arraySlice.js +1 -1
  258. package/lib/utils/attachmentAdpator.js +1 -1
  259. package/lib/utils/autobind.js +1 -1
  260. package/lib/utils/browser.js +1 -1
  261. package/lib/utils/columnsSplit.js +1 -1
  262. package/lib/utils/concatData.js +1 -1
  263. package/lib/utils/dataMapping.js +1 -1
  264. package/lib/utils/date.js +6 -9
  265. package/lib/utils/debug.js +1 -1
  266. package/lib/utils/decodeEntity.js +1 -1
  267. package/lib/utils/dom.js +6 -3
  268. package/lib/utils/errors.js +2 -1
  269. package/lib/utils/escapeHtml.js +1 -1
  270. package/lib/utils/filter-schema.js +1 -1
  271. package/lib/utils/filter.js +1 -1
  272. package/lib/utils/formatDuration.js +1 -1
  273. package/lib/utils/formula.js +2 -2
  274. package/lib/utils/getPageId.js +1 -1
  275. package/lib/utils/getVariable.js +1 -1
  276. package/lib/utils/grammar.js +1 -1
  277. package/lib/utils/handleAction.js +1 -1
  278. package/lib/utils/helper.js +3 -3
  279. package/lib/utils/highlight.js +1 -1
  280. package/lib/utils/icon.js +1 -1
  281. package/lib/utils/image.js +1 -1
  282. package/lib/utils/index.d.ts +1 -1
  283. package/lib/utils/index.js +22 -20
  284. package/lib/utils/isPureVariable.js +2 -2
  285. package/lib/utils/json-schema-2-amis-schema.js +1 -1
  286. package/lib/utils/keyToPath.js +1 -1
  287. package/lib/utils/labelToString.js +1 -1
  288. package/lib/utils/loopTooMuch.js +1 -1
  289. package/lib/utils/makeSorter.js +1 -1
  290. package/lib/utils/math.js +1 -1
  291. package/lib/utils/memoryParse.js +1 -1
  292. package/lib/utils/normalizeLink.js +1 -1
  293. package/lib/utils/normalizeOptions.js +6 -2
  294. package/lib/utils/object.js +1 -1
  295. package/lib/utils/offset.js +1 -1
  296. package/lib/utils/offsetParent.js +1 -1
  297. package/lib/utils/optionValueCompare.js +1 -1
  298. package/lib/utils/position.js +1 -1
  299. package/lib/utils/prettyBytes.js +1 -1
  300. package/lib/utils/printElement.js +1 -1
  301. package/lib/utils/renderer-event.js +1 -1
  302. package/lib/utils/replaceText.js +1 -1
  303. package/lib/utils/resize-sensor.d.ts +3 -1
  304. package/lib/utils/resize-sensor.js +64 -28
  305. package/lib/utils/resolveCondition.js +2 -2
  306. package/lib/utils/resolveVariable.js +1 -1
  307. package/lib/utils/resolveVariableAndFilter.js +3 -2
  308. package/lib/utils/resolveVariableAndFilterForAsync.js +1 -1
  309. package/lib/utils/scrollPosition.js +1 -1
  310. package/lib/utils/string2regExp.js +1 -1
  311. package/lib/utils/stripNumber.js +1 -1
  312. package/lib/utils/style-helper.d.ts +12 -1
  313. package/lib/utils/style-helper.js +30 -17
  314. package/lib/utils/style.d.ts +13 -0
  315. package/lib/utils/style.js +45 -3
  316. package/lib/utils/toNumber.js +1 -1
  317. package/lib/utils/tokenize.js +1 -1
  318. package/lib/utils/tpl-builtin.d.ts +1 -0
  319. package/lib/utils/tpl-builtin.js +7 -2
  320. package/lib/utils/tpl-lodash.js +1 -1
  321. package/lib/utils/tpl.js +6 -2
  322. package/lib/utils/uncontrollable.js +1 -1
  323. package/lib/utils/validateId.js +1 -1
  324. package/lib/utils/validations.js +2 -2
  325. package/lib/utils/visitedCache.js +1 -1
  326. package/package.json +5 -3
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v6.13.0-beta.2
2
+ * amis-core v6.13.0-beta.21
3
3
  * Copyright 2018-2025 fex
4
4
  */
5
5
 
@@ -63,8 +63,10 @@ var iRendererStore = StoreNode.named('iRendererStore')
63
63
  pristineRaw: types.optional(types.frozen(), {}),
64
64
  upStreamData: types.optional(types.frozen(), {}),
65
65
  action: types.optional(types.frozen(), undefined),
66
+ dialogSchema: types.frozen(),
66
67
  dialogOpen: false,
67
68
  dialogData: types.optional(types.frozen(), undefined),
69
+ drawerSchema: types.frozen(),
68
70
  drawerOpen: false,
69
71
  drawerData: types.optional(types.frozen(), undefined)
70
72
  })
@@ -240,8 +242,6 @@ var iRendererStore = StoreNode.named('iRendererStore')
240
242
  }
241
243
  });
242
244
  self.action = action;
243
- self.dialogData = false;
244
- self.drawerOpen = false;
245
245
  },
246
246
  openDialog: function (ctx, additonal, callback, scoped) {
247
247
  var _a, _b;
@@ -264,12 +264,15 @@ var iRendererStore = StoreNode.named('iRendererStore')
264
264
  else {
265
265
  self.dialogData = data;
266
266
  }
267
+ self.dialogSchema = self.action.dialog;
267
268
  self.dialogOpen = true;
268
269
  callback && dialogCallbacks.set(self.dialogData, callback);
269
270
  dialogScoped = scoped || null;
270
271
  },
271
272
  closeDialog: function (confirmed, data) {
272
273
  var callback = dialogCallbacks.get(self.dialogData);
274
+ // 不要过早的清空,否则内部组件提前销毁,会出现 store 异常读取问题
275
+ // self.dialogSchema = null;
273
276
  self.dialogOpen = false;
274
277
  dialogScoped = null;
275
278
  if (callback) {
@@ -298,6 +301,7 @@ var iRendererStore = StoreNode.named('iRendererStore')
298
301
  else {
299
302
  self.drawerData = data;
300
303
  }
304
+ self.drawerSchema = self.action.drawer;
301
305
  self.drawerOpen = true;
302
306
  if (callback) {
303
307
  dialogCallbacks.set(self.drawerData, callback);
@@ -306,6 +310,8 @@ var iRendererStore = StoreNode.named('iRendererStore')
306
310
  },
307
311
  closeDrawer: function (confirmed, data) {
308
312
  var callback = dialogCallbacks.get(self.drawerData);
313
+ // 不要过早的清空,否则内部组件提前销毁,会出现 store 异常读取问题
314
+ // self.drawerSchema = null;
309
315
  self.drawerOpen = false;
310
316
  drawerScoped = null;
311
317
  if (callback) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v6.13.0-beta.2
2
+ * amis-core v6.13.0-beta.21
3
3
  * Copyright 2018-2025 fex
4
4
  */
5
5
 
@@ -37,8 +37,10 @@ export declare const ListStore: import("mobx-state-tree").IModelType<{
37
37
  pristineRaw: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
38
38
  upStreamData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
39
39
  action: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
40
+ dialogSchema: import("mobx-state-tree").IType<any, any, any>;
40
41
  dialogOpen: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
41
42
  dialogData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
43
+ drawerSchema: import("mobx-state-tree").IType<any, any, any>;
42
44
  drawerOpen: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
43
45
  drawerData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
44
46
  } & {
package/esm/store/list.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v6.13.0-beta.2
2
+ * amis-core v6.13.0-beta.21
3
3
  * Copyright 2018-2025 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v6.13.0-beta.2
2
+ * amis-core v6.13.0-beta.21
3
3
  * Copyright 2018-2025 fex
4
4
  */
5
5
 
@@ -15,8 +15,10 @@ export declare const ModalStore: import("mobx-state-tree").IModelType<{
15
15
  pristineRaw: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
16
16
  upStreamData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
17
17
  action: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
18
+ dialogSchema: import("mobx-state-tree").IType<any, any, any>;
18
19
  dialogOpen: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
19
20
  dialogData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
21
+ drawerSchema: import("mobx-state-tree").IType<any, any, any>;
20
22
  drawerOpen: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
21
23
  drawerData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
22
24
  } & {
@@ -34,6 +36,7 @@ export declare const ModalStore: import("mobx-state-tree").IModelType<{
34
36
  entered: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
35
37
  resizeCoord: import("mobx-state-tree").IType<number | undefined, number, number>;
36
38
  schema: import("mobx-state-tree").IType<any, any, any>;
39
+ isFullscreen: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
37
40
  }, {
38
41
  readonly parentStore: any;
39
42
  readonly __: any;
@@ -87,6 +90,7 @@ export declare const ModalStore: import("mobx-state-tree").IModelType<{
87
90
  reset(): void;
88
91
  setResizeCoord(value: number): void;
89
92
  setSchema(schema: any): void;
93
+ setFullScreen(isFullscreen?: boolean): void;
90
94
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
91
95
  export type IModalStore = Instance<typeof ModalStore>;
92
96
  export type SModalStore = SnapshotIn<typeof ModalStore>;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v6.13.0-beta.2
2
+ * amis-core v6.13.0-beta.21
3
3
  * Copyright 2018-2025 fex
4
4
  */
5
5
 
@@ -13,7 +13,8 @@ var ModalStore = ServiceStore.named('ModalStore')
13
13
  form: types.frozen(),
14
14
  entered: false,
15
15
  resizeCoord: 0,
16
- schema: types.frozen()
16
+ schema: types.frozen(),
17
+ isFullscreen: false
17
18
  })
18
19
  .views(function (self) {
19
20
  return {
@@ -43,6 +44,10 @@ var ModalStore = ServiceStore.named('ModalStore')
43
44
  return;
44
45
  }
45
46
  self.schema = schema;
47
+ },
48
+ setFullScreen: function (isFullscreen) {
49
+ if (isFullscreen === void 0) { isFullscreen = false; }
50
+ self.isFullscreen = isFullscreen;
46
51
  }
47
52
  };
48
53
  });
package/esm/store/node.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v6.13.0-beta.2
2
+ * amis-core v6.13.0-beta.21
3
3
  * Copyright 2018-2025 fex
4
4
  */
5
5
 
@@ -15,8 +15,10 @@ export declare const PaginationStore: import("mobx-state-tree").IModelType<{
15
15
  pristineRaw: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
16
16
  upStreamData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
17
17
  action: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
18
+ dialogSchema: import("mobx-state-tree").IType<any, any, any>;
18
19
  dialogOpen: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
19
20
  dialogData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
21
+ drawerSchema: import("mobx-state-tree").IType<any, any, any>;
20
22
  drawerOpen: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
21
23
  drawerData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
22
24
  } & {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v6.13.0-beta.2
2
+ * amis-core v6.13.0-beta.21
3
3
  * Copyright 2018-2025 fex
4
4
  */
5
5
 
@@ -17,8 +17,10 @@ export declare const RootStore: import("mobx-state-tree").IModelType<{
17
17
  pristineRaw: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
18
18
  upStreamData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
19
19
  action: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
20
+ dialogSchema: import("mobx-state-tree").IType<any, any, any>;
20
21
  dialogOpen: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
21
22
  dialogData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
23
+ drawerSchema: import("mobx-state-tree").IType<any, any, any>;
22
24
  drawerOpen: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
23
25
  drawerData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
24
26
  } & {
@@ -84,14 +86,16 @@ export declare const RootStore: import("mobx-state-tree").IModelType<{
84
86
  fetchSchema: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
85
87
  checkRemote: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
86
88
  } & {
87
- context: {};
89
+ context: any;
90
+ legacyGlobalTempContext: any;
88
91
  globalVars: GlobalVariableItemFull[];
89
92
  globalData: any;
90
93
  } & {
91
94
  readonly nextGlobalData: any;
92
95
  readonly downStream: any;
93
96
  } & {
94
- updateContext(context: any): void;
97
+ updateContextBySetter(context: any): void;
98
+ updateContext(context: any, isInit?: boolean): void;
95
99
  updateGlobalVarState(key: string, state: Partial<GlobalVariableState>): void;
96
100
  setGlobalVars: (vars?: Array<GlobalVariableItem>) => Promise<any>;
97
101
  updateGlobalVarValue: (key: string, value: any) => void;
@@ -104,7 +108,9 @@ export declare const RootStore: import("mobx-state-tree").IModelType<{
104
108
  updateLocation(location?: any, parseFn?: Function): void;
105
109
  init: (schema: any) => Promise<any>;
106
110
  syncGlobalVarStates: () => void;
111
+ syncLegacyGlobalVarStates: () => void;
107
112
  addSyncGlobalVarStatePendingTask: (fn: (callback: () => void) => void, callback?: () => void) => void;
113
+ afterCreate(): void;
108
114
  afterDestroy(): void;
109
115
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
110
116
  export type IRootStore = Instance<typeof RootStore>;
package/esm/store/root.js CHANGED
@@ -1,34 +1,34 @@
1
1
  /**
2
- * amis-core v6.13.0-beta.2
2
+ * amis-core v6.13.0-beta.21
3
3
  * Copyright 2018-2025 fex
4
4
  */
5
5
 
6
- import { __assign, __generator, __values, __awaiter, __read } from 'tslib';
7
- import { types, flow } from 'mobx-state-tree';
6
+ import { __assign, __generator, __rest, __values, __awaiter, __read } from 'tslib';
7
+ import { types, flow, isAlive, addDisposer } from 'mobx-state-tree';
8
8
  import { parseQuery, isObjectShallowModified } from '../utils/helper.js';
9
9
  import { ServiceStore } from './service.js';
10
+ import 'amis-formula';
11
+ import 'moment';
12
+ import { extractObjectChain, createObjectFromChain, cloneObject } from '../utils/object.js';
13
+ import '../utils/memoryParse.js';
14
+ import '@rc-component/mini-decimal';
15
+ import isPlainObject from 'lodash/isPlainObject';
16
+ import '../utils/filter.js';
10
17
  import '../utils/api.js';
11
18
  import 'file-saver';
12
19
  import '../utils/browser.js';
13
20
  import '../utils/ColorScale.js';
14
21
  import 'react';
15
22
  import 'lodash/chunk';
16
- import { createObject, extractObjectChain, createObjectFromChain } from '../utils/object.js';
17
- import '../utils/memoryParse.js';
18
- import 'amis-formula';
19
- import isPlainObject from 'lodash/isPlainObject';
20
23
  import '../utils/DataSchema.js';
21
24
  import '../utils/DataScope.js';
22
- import 'moment';
23
25
  import '../utils/debug.js';
24
26
  import 'react-dom';
25
27
  import '../utils/errors.js';
26
28
  import '../utils/tpl.js';
27
- import '../utils/filter.js';
28
29
  import 'lodash/isObject';
29
30
  import 'lodash/isString';
30
31
  import 'lodash/isBoolean';
31
- import '@rc-component/mini-decimal';
32
32
  import '../utils/image.js';
33
33
  import 'lodash/isEqual';
34
34
  import '../actions/Action.js';
@@ -46,7 +46,7 @@ import 'uncontrollable';
46
46
  import 'hoist-non-react-statics';
47
47
  import '../utils/validations.js';
48
48
  import '../utils/resolveCondition.js';
49
- import 'mobx';
49
+ import { reaction } from 'mobx';
50
50
  import '../utils/Animation.js';
51
51
  import { createGlobalVarState, buildGlobalVariable } from '../globalVar.js';
52
52
 
@@ -66,6 +66,7 @@ var RootStore = ServiceStore.named('RootStore')
66
66
  .volatile(function (self) {
67
67
  return {
68
68
  context: {},
69
+ legacyGlobalTempContext: {},
69
70
  globalVars: [],
70
71
  globalData: {
71
72
  global: {},
@@ -77,13 +78,53 @@ var RootStore = ServiceStore.named('RootStore')
77
78
  get nextGlobalData() {
78
79
  var globalData = {};
79
80
  var globalState = {};
80
- if (self.globalVarTempStates.size) {
81
+ var chain = extractObjectChain(self.data);
82
+ var touched = false;
83
+ var saved = true;
84
+ var errors = {};
85
+ var initialized = true;
86
+ self.globalVarTempStates.forEach(function (state, key) {
87
+ globalData[key] = state.value;
88
+ touched = touched || state.touched;
89
+ if (!state.saved) {
90
+ saved = false;
91
+ }
92
+ if (state.errorMessages.length) {
93
+ errors[key] = state.errorMessages;
94
+ }
95
+ if (!state.initialized) {
96
+ initialized = false;
97
+ }
98
+ });
99
+ globalState = {
100
+ fields: self.globalVarTempStates.toJSON(),
101
+ initialized: initialized,
102
+ touched: touched,
103
+ saved: saved,
104
+ errors: errors,
105
+ valid: !Object.keys(errors).length
106
+ };
107
+ chain.unshift({
108
+ global: globalData,
109
+ globalState: globalState
110
+ });
111
+ chain.unshift(self.legacyGlobalTempContext);
112
+ chain.unshift(self.context);
113
+ return createObjectFromChain(chain);
114
+ },
115
+ get downStream() {
116
+ var result = self.data;
117
+ if (self.context || self.query) {
118
+ var chain = extractObjectChain(result);
119
+ // 数据链中添加 global 和 globalState
120
+ // 对应的是全局变量的值和全局变量的状态
121
+ var globalData_1 = {};
81
122
  var touched_1 = false;
82
123
  var saved_1 = true;
83
124
  var errors_1 = {};
84
125
  var initialized_1 = true;
85
- self.globalVarTempStates.forEach(function (state, key) {
86
- globalData[key] = state.value;
126
+ self.globalVarStates.forEach(function (state, key) {
127
+ globalData_1[key] = state.value;
87
128
  touched_1 = touched_1 || state.touched;
88
129
  if (!state.saved) {
89
130
  saved_1 = false;
@@ -95,59 +136,19 @@ var RootStore = ServiceStore.named('RootStore')
95
136
  initialized_1 = false;
96
137
  }
97
138
  });
98
- globalState = {
99
- fields: self.globalVarTempStates.toJSON(),
139
+ // 保存全局变量的值和状态
140
+ Object.assign(self.globalData.global, globalData_1);
141
+ Object.assign(self.globalData.globalState, {
142
+ fields: self.globalVarStates.toJSON(),
100
143
  initialized: initialized_1,
101
144
  touched: touched_1,
102
145
  saved: saved_1,
103
146
  errors: errors_1,
104
147
  valid: !Object.keys(errors_1).length
105
- };
106
- }
107
- return createObject(self.context, {
108
- global: globalData,
109
- globalState: globalState
110
- });
111
- },
112
- get downStream() {
113
- var result = self.data;
114
- if (self.context || self.query || self.globalVarStates.size) {
115
- var chain = extractObjectChain(result);
116
- // 数据链中添加 global 和 globalState
117
- // 对应的是全局变量的值和全局变量的状态
118
- if (self.globalVarStates.size) {
119
- var globalData_1 = {};
120
- var touched_2 = false;
121
- var saved_2 = true;
122
- var errors_2 = {};
123
- var initialized_2 = true;
124
- self.globalVarStates.forEach(function (state, key) {
125
- globalData_1[key] = state.value;
126
- touched_2 = touched_2 || state.touched;
127
- if (!state.saved) {
128
- saved_2 = false;
129
- }
130
- if (state.errorMessages.length) {
131
- errors_2[key] = state.errorMessages;
132
- }
133
- if (!state.initialized) {
134
- initialized_2 = false;
135
- }
136
- });
137
- // 保存全局变量的值和状态
138
- Object.assign(self.globalData.global, globalData_1);
139
- Object.assign(self.globalData.globalState, {
140
- fields: self.globalVarStates.toJSON(),
141
- initialized: initialized_2,
142
- touched: touched_2,
143
- saved: saved_2,
144
- errors: errors_2,
145
- valid: !Object.keys(errors_2).length
146
- });
147
- // self.globalData 一直都是那个对象,这样组件里面始终拿到的都是最新的
148
- chain.unshift(self.globalData);
149
- }
150
- self.context && chain.unshift(self.context);
148
+ });
149
+ // self.globalData 一直都是那个对象,这样组件里面始终拿到的都是最新的
150
+ chain.unshift(self.globalData);
151
+ chain.unshift(self.context);
151
152
  self.query &&
152
153
  chain.splice(chain.length - 1, 0, __assign(__assign({}, self.query), { __query: self.query }));
153
154
  result = createObjectFromChain(chain);
@@ -409,17 +410,18 @@ var RootStore = ServiceStore.named('RootStore')
409
410
  }
410
411
  // 设置全局变量,返回一个Promise
411
412
  var setGlobalVars = flow(function setGlobalVars(vars) {
412
- var _a, newVars, updateVars, removeVars, _b;
413
- return __generator(this, function (_c) {
414
- switch (_c.label) {
413
+ var _a, newVars, updateVars, removeVars, globalVars;
414
+ return __generator(this, function (_b) {
415
+ switch (_b.label) {
415
416
  case 0:
416
417
  _a = diffVariables(vars || [], self.globalVars), newVars = _a.newVars, updateVars = _a.updateVars, removeVars = _a.removeVars;
417
- // 初始化全局变量
418
- _b = self;
419
418
  return [4 /*yield*/, initializeGlobalVars(newVars, updateVars)];
420
419
  case 1:
421
- // 初始化全局变量
422
- _b.globalVars = _c.sent();
420
+ globalVars = _b.sent();
421
+ if (!isAlive(self)) {
422
+ return [2 /*return*/];
423
+ }
424
+ self.globalVars = globalVars;
423
425
  removeVars.forEach(function (item) {
424
426
  self.globalVarTempStates.delete(item.key);
425
427
  });
@@ -601,6 +603,13 @@ var RootStore = ServiceStore.named('RootStore')
601
603
  self.globalVarStates.set(key, __assign({}, state));
602
604
  });
603
605
  }
606
+ function syncLegacyGlobalVarStates() {
607
+ if (self.legacyGlobalTempContext.__page !== self.context.__page ||
608
+ self.legacyGlobalTempContext.appVariables !== self.context.appVariables) {
609
+ Object.assign(self.context, self.legacyGlobalTempContext);
610
+ self.data = cloneObject(self.data);
611
+ }
612
+ }
604
613
  var pendingCount = 0;
605
614
  var callbacks = [];
606
615
  function addSyncGlobalVarStatePendingTask(fn, callback) {
@@ -611,15 +620,68 @@ var RootStore = ServiceStore.named('RootStore')
611
620
  if (pendingCount === 0) {
612
621
  callbacks.forEach(function (callback) { return callback(); });
613
622
  callbacks = [];
614
- self.syncGlobalVarStates();
623
+ if (isAlive(self)) {
624
+ self.syncGlobalVarStates();
625
+ self.syncLegacyGlobalVarStates();
626
+ }
627
+ }
628
+ });
629
+ }
630
+ function observeSet(obj, callback) {
631
+ if (!obj || obj.__observed) {
632
+ // 如果已经被观察过了,就不需要再观察了
633
+ return obj;
634
+ }
635
+ var timer = 0;
636
+ return new Proxy(__assign({}, obj), {
637
+ get: function (target, prop) {
638
+ if (prop === '__observed') {
639
+ return true;
640
+ }
641
+ return Reflect.get(target, prop);
642
+ },
643
+ set: function (target, prop, value) {
644
+ Reflect.set(target, prop, value);
645
+ cancelAnimationFrame(timer);
646
+ timer = requestAnimationFrame(function () { return callback(target); });
647
+ console.warn("Don't modify the context directly.");
648
+ return true;
615
649
  }
616
650
  });
617
651
  }
618
652
  return {
619
- updateContext: function (context) {
653
+ updateContextBySetter: function (context) {
654
+ this.updateContext(context);
655
+ self.data = cloneObject(self.data);
656
+ },
657
+ updateContext: function (context, isInit) {
620
658
  // 因为 context 不是受控属性,直接共用引用好了
621
659
  // 否则还会触发孩子节点的重新渲染
622
- Object.assign(self.context, context);
660
+ if (isInit === void 0) { isInit = false; }
661
+ var _a = context || {}, __page = _a.__page, appVariables = _a.appVariables, rest = __rest(_a, ["__page", "appVariables"]);
662
+ // 对历史用法做兼容
663
+ if (__page || appVariables) {
664
+ // 有部分用户直接在自定义动作脚本里面修改 __page 或者 appVariables 变量
665
+ // 奇怪的是之前的实现方式这种修改是会更新变更的
666
+ // 所以这里用 Proxy 来解决不更新的问题
667
+ __page = __page
668
+ ? observeSet(__page, function (__page) {
669
+ return self.updateContextBySetter(__assign(__assign({}, self.context), { __page: __page }));
670
+ })
671
+ : __page;
672
+ appVariables = appVariables
673
+ ? observeSet(appVariables, function (appVariables) {
674
+ return self.updateContextBySetter(__assign(__assign({}, self.context), { appVariables: appVariables }));
675
+ })
676
+ : appVariables;
677
+ if (isInit) {
678
+ self.context.__page = __page;
679
+ self.context.appVariables = appVariables;
680
+ }
681
+ self.legacyGlobalTempContext.__page = __page;
682
+ self.legacyGlobalTempContext.appVariables = appVariables;
683
+ }
684
+ Object.assign(self.context, rest);
623
685
  },
624
686
  updateGlobalVarState: function (key, state) {
625
687
  var origin = self.globalVarTempStates.get(key);
@@ -642,7 +704,15 @@ var RootStore = ServiceStore.named('RootStore')
642
704
  },
643
705
  init: init,
644
706
  syncGlobalVarStates: syncGlobalVarStates,
707
+ syncLegacyGlobalVarStates: syncLegacyGlobalVarStates,
645
708
  addSyncGlobalVarStatePendingTask: addSyncGlobalVarStatePendingTask,
709
+ afterCreate: function () {
710
+ addDisposer(self, reaction(function () { return self.nextGlobalData; }, function () {
711
+ return self.addSyncGlobalVarStatePendingTask(function (callback) {
712
+ return requestAnimationFrame(callback);
713
+ });
714
+ }));
715
+ },
646
716
  afterDestroy: function () {
647
717
  lazySaveGlobalVarValues.flush();
648
718
  }
@@ -16,8 +16,10 @@ export declare const ServiceStore: import("mobx-state-tree").IModelType<{
16
16
  pristineRaw: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
17
17
  upStreamData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
18
18
  action: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
19
+ dialogSchema: import("mobx-state-tree").IType<any, any, any>;
19
20
  dialogOpen: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
20
21
  dialogData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
22
+ drawerSchema: import("mobx-state-tree").IType<any, any, any>;
21
23
  drawerOpen: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
22
24
  drawerData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
23
25
  } & {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v6.13.0-beta.2
2
+ * amis-core v6.13.0-beta.21
3
3
  * Copyright 2018-2025 fex
4
4
  */
5
5
 
@@ -12,26 +12,26 @@ import { normalizeApiResponseData } from '../utils/api.js';
12
12
  import { replaceText } from '../utils/replaceText.js';
13
13
  import { concatData } from '../utils/concatData.js';
14
14
  import { envOverwrite } from '../envOverwrite.js';
15
+ import 'amis-formula';
16
+ import 'moment';
17
+ import { isObject, extendObject } from '../utils/object.js';
18
+ import '../utils/memoryParse.js';
19
+ import '@rc-component/mini-decimal';
20
+ import 'lodash/isPlainObject';
21
+ import '../utils/filter.js';
15
22
  import 'file-saver';
16
23
  import '../utils/browser.js';
17
24
  import '../utils/ColorScale.js';
18
25
  import 'react';
19
26
  import 'lodash/chunk';
20
- import '../utils/memoryParse.js';
21
- import 'amis-formula';
22
- import 'lodash/isPlainObject';
23
- import { isObject, extendObject } from '../utils/object.js';
24
27
  import '../utils/DataSchema.js';
25
28
  import '../utils/DataScope.js';
26
- import 'moment';
27
29
  import '../utils/debug.js';
28
30
  import 'react-dom';
29
31
  import { filter } from '../utils/tpl.js';
30
- import '../utils/filter.js';
31
32
  import 'lodash/isObject';
32
33
  import 'lodash/isString';
33
34
  import 'lodash/isBoolean';
34
- import '@rc-component/mini-decimal';
35
35
  import '../utils/image.js';
36
36
  import 'lodash/isEqual';
37
37
  import '../actions/Action.js';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v6.13.0-beta.2
2
+ * amis-core v6.13.0-beta.21
3
3
  * Copyright 2018-2025 fex
4
4
  */
5
5