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