amis-core 3.1.0 → 3.2.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 (281) hide show
  1. package/esm/Root.js +1 -1
  2. package/esm/RootRenderer.d.ts +1 -1
  3. package/esm/RootRenderer.js +2 -2
  4. package/esm/SchemaRenderer.js +3 -2
  5. package/esm/Scoped.js +2 -1
  6. package/esm/StatusScoped.js +1 -1
  7. package/esm/WithRootStore.d.ts +4 -24
  8. package/esm/WithRootStore.js +12 -4
  9. package/esm/WithStore.js +23 -16
  10. package/esm/actions/Action.js +14 -14
  11. package/esm/actions/AjaxAction.js +1 -1
  12. package/esm/actions/BreakAction.js +1 -1
  13. package/esm/actions/BroadcastAction.js +1 -1
  14. package/esm/actions/CmptAction.js +2 -2
  15. package/esm/actions/ContinueAction.js +1 -1
  16. package/esm/actions/CopyAction.js +1 -1
  17. package/esm/actions/CustomAction.js +2 -1
  18. package/esm/actions/DialogAction.d.ts +2 -0
  19. package/esm/actions/DialogAction.js +40 -23
  20. package/esm/actions/DrawerAction.js +4 -4
  21. package/esm/actions/EmailAction.js +1 -1
  22. package/esm/actions/LinkAction.js +1 -1
  23. package/esm/actions/LoopAction.js +1 -1
  24. package/esm/actions/PageAction.js +1 -1
  25. package/esm/actions/ParallelAction.js +1 -1
  26. package/esm/actions/SwitchAction.js +1 -1
  27. package/esm/actions/ToastAction.js +1 -1
  28. package/esm/components/CustomStyle.js +1 -1
  29. package/esm/components/LazyComponent.js +1 -1
  30. package/esm/components/Overlay.js +2 -1
  31. package/esm/components/PopOver.js +2 -1
  32. package/esm/env.js +1 -1
  33. package/esm/envOverwrite.js +1 -1
  34. package/esm/factory.js +1 -1
  35. package/esm/index.d.ts +1 -0
  36. package/esm/index.js +6 -4
  37. package/esm/locale.js +1 -1
  38. package/esm/polyfills.d.ts +3 -0
  39. package/esm/polyfills.js +18 -0
  40. package/esm/renderers/Form.d.ts +1 -1
  41. package/esm/renderers/Form.js +17 -7
  42. package/esm/renderers/Item.d.ts +88 -59
  43. package/esm/renderers/Item.js +86 -40
  44. package/esm/renderers/Options.js +1 -1
  45. package/esm/renderers/Placeholder.js +1 -1
  46. package/esm/renderers/builtin.js +1 -1
  47. package/esm/renderers/register.js +1 -1
  48. package/esm/renderers/wrapControl.d.ts +4 -24
  49. package/esm/renderers/wrapControl.js +51 -53
  50. package/esm/store/app.js +37 -3
  51. package/esm/store/combo.d.ts +168 -28
  52. package/esm/store/combo.js +1 -1
  53. package/esm/store/crud.d.ts +3 -2
  54. package/esm/store/crud.js +12 -5
  55. package/esm/store/form.d.ts +72 -12
  56. package/esm/store/form.js +4 -4
  57. package/esm/store/formItem.d.ts +2 -1
  58. package/esm/store/formItem.js +7 -2
  59. package/esm/store/iRenderer.js +2 -1
  60. package/esm/store/index.js +1 -1
  61. package/esm/store/list.d.ts +1 -0
  62. package/esm/store/list.js +8 -2
  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 +2 -1
  68. package/esm/store/service.js +14 -9
  69. package/esm/store/status.js +1 -1
  70. package/esm/store/table.d.ts +145 -24
  71. package/esm/store/table.js +8 -2
  72. package/esm/store/table2.js +1 -1
  73. package/esm/theme.js +1 -1
  74. package/esm/types.d.ts +5 -2
  75. package/esm/utils/Animation.js +1 -1
  76. package/esm/utils/ColorScale.js +1 -1
  77. package/esm/utils/DataSchema.d.ts +3 -2
  78. package/esm/utils/DataSchema.js +27 -7
  79. package/esm/utils/DataScope.d.ts +10 -3
  80. package/esm/utils/DataScope.js +50 -12
  81. package/esm/utils/RootClose.js +1 -1
  82. package/esm/utils/SimpleMap.js +1 -1
  83. package/esm/utils/api.js +40 -32
  84. package/esm/utils/arraySlice.d.ts +1 -0
  85. package/esm/utils/arraySlice.js +76 -0
  86. package/esm/utils/attachmentAdpator.js +1 -1
  87. package/esm/utils/autobind.js +1 -1
  88. package/esm/utils/columnsSplit.js +1 -1
  89. package/esm/utils/dataMapping.js +26 -18
  90. package/esm/utils/date.js +1 -1
  91. package/esm/utils/debug.js +1 -1
  92. package/esm/utils/decodeEntity.js +1 -1
  93. package/esm/utils/dom.js +4 -1
  94. package/esm/utils/errors.js +1 -1
  95. package/esm/utils/escapeHtml.js +1 -1
  96. package/esm/utils/filter-schema.js +1 -1
  97. package/esm/utils/filter.js +1 -1
  98. package/esm/utils/formatDuration.js +1 -1
  99. package/esm/utils/formula.js +1 -1
  100. package/esm/utils/getVariable.js +1 -1
  101. package/esm/utils/grammar.js +1 -1
  102. package/esm/utils/handleAction.js +1 -1
  103. package/esm/utils/helper.d.ts +8 -1
  104. package/esm/utils/helper.js +57 -10
  105. package/esm/utils/highlight.js +1 -1
  106. package/esm/utils/icon.js +1 -1
  107. package/esm/utils/image.js +1 -1
  108. package/esm/utils/index.d.ts +1 -0
  109. package/esm/utils/isPureVariable.js +1 -1
  110. package/esm/utils/json-schema-2-amis-schema.js +1 -1
  111. package/esm/utils/keyToPath.js +1 -1
  112. package/esm/utils/makeSorter.js +1 -1
  113. package/esm/utils/memoryParse.js +1 -1
  114. package/esm/utils/normalizeLink.js +18 -9
  115. package/esm/utils/normalizeOptions.js +1 -1
  116. package/esm/utils/object.js +1 -1
  117. package/esm/utils/offset.js +1 -1
  118. package/esm/utils/offsetParent.js +1 -1
  119. package/esm/utils/optionValueCompare.js +1 -1
  120. package/esm/utils/position.js +1 -1
  121. package/esm/utils/prettyBytes.js +1 -1
  122. package/esm/utils/renderer-event.js +1 -1
  123. package/esm/utils/replaceText.js +1 -1
  124. package/esm/utils/resize-sensor.js +1 -1
  125. package/esm/utils/resolveCondition.js +1 -1
  126. package/esm/utils/resolveVariable.js +1 -1
  127. package/esm/utils/resolveVariableAndFilter.js +1 -1
  128. package/esm/utils/resolveVariableAndFilterForAsync.js +1 -1
  129. package/esm/utils/scrollPosition.js +1 -1
  130. package/esm/utils/string2regExp.js +1 -1
  131. package/esm/utils/stripNumber.js +1 -1
  132. package/esm/utils/style-helper.js +1 -1
  133. package/esm/utils/style.js +1 -1
  134. package/esm/utils/toNumber.js +1 -1
  135. package/esm/utils/tokenize.js +1 -1
  136. package/esm/utils/tpl-builtin.js +1 -1
  137. package/esm/utils/tpl-lodash.js +1 -1
  138. package/esm/utils/tpl.js +1 -1
  139. package/esm/utils/uncontrollable.js +1 -1
  140. package/esm/utils/validations.js +1 -1
  141. package/lib/Root.js +1 -1
  142. package/lib/RootRenderer.d.ts +1 -1
  143. package/lib/RootRenderer.js +2 -2
  144. package/lib/SchemaRenderer.js +3 -2
  145. package/lib/Scoped.js +2 -1
  146. package/lib/StatusScoped.js +1 -1
  147. package/lib/WithRootStore.d.ts +4 -24
  148. package/lib/WithRootStore.js +12 -4
  149. package/lib/WithStore.js +23 -16
  150. package/lib/actions/Action.js +14 -14
  151. package/lib/actions/AjaxAction.js +1 -1
  152. package/lib/actions/BreakAction.js +1 -1
  153. package/lib/actions/BroadcastAction.js +1 -1
  154. package/lib/actions/CmptAction.js +2 -2
  155. package/lib/actions/ContinueAction.js +1 -1
  156. package/lib/actions/CopyAction.js +1 -1
  157. package/lib/actions/CustomAction.js +2 -1
  158. package/lib/actions/DialogAction.d.ts +2 -0
  159. package/lib/actions/DialogAction.js +40 -23
  160. package/lib/actions/DrawerAction.js +4 -4
  161. package/lib/actions/EmailAction.js +1 -1
  162. package/lib/actions/LinkAction.js +1 -1
  163. package/lib/actions/LoopAction.js +1 -1
  164. package/lib/actions/PageAction.js +1 -1
  165. package/lib/actions/ParallelAction.js +1 -1
  166. package/lib/actions/SwitchAction.js +1 -1
  167. package/lib/actions/ToastAction.js +1 -1
  168. package/lib/components/CustomStyle.js +1 -1
  169. package/lib/components/LazyComponent.js +1 -1
  170. package/lib/components/Overlay.js +2 -1
  171. package/lib/components/PopOver.js +2 -1
  172. package/lib/env.js +1 -1
  173. package/lib/envOverwrite.js +1 -1
  174. package/lib/factory.js +1 -1
  175. package/lib/index.d.ts +1 -0
  176. package/lib/index.js +7 -2
  177. package/lib/locale.js +1 -1
  178. package/lib/polyfills.d.ts +3 -0
  179. package/lib/polyfills.js +20 -0
  180. package/lib/renderers/Form.d.ts +1 -1
  181. package/lib/renderers/Form.js +17 -7
  182. package/lib/renderers/Item.d.ts +88 -59
  183. package/lib/renderers/Item.js +86 -40
  184. package/lib/renderers/Options.js +1 -1
  185. package/lib/renderers/Placeholder.js +1 -1
  186. package/lib/renderers/builtin.js +1 -1
  187. package/lib/renderers/register.js +1 -1
  188. package/lib/renderers/wrapControl.d.ts +4 -24
  189. package/lib/renderers/wrapControl.js +51 -53
  190. package/lib/store/app.js +36 -2
  191. package/lib/store/combo.d.ts +168 -28
  192. package/lib/store/combo.js +1 -1
  193. package/lib/store/crud.d.ts +3 -2
  194. package/lib/store/crud.js +12 -5
  195. package/lib/store/form.d.ts +72 -12
  196. package/lib/store/form.js +4 -4
  197. package/lib/store/formItem.d.ts +2 -1
  198. package/lib/store/formItem.js +7 -2
  199. package/lib/store/iRenderer.js +2 -1
  200. package/lib/store/index.js +1 -1
  201. package/lib/store/list.d.ts +1 -0
  202. package/lib/store/list.js +8 -2
  203. package/lib/store/manager.js +1 -1
  204. package/lib/store/modal.js +1 -1
  205. package/lib/store/node.js +1 -1
  206. package/lib/store/pagination.js +1 -1
  207. package/lib/store/root.js +2 -1
  208. package/lib/store/service.js +14 -9
  209. package/lib/store/status.js +1 -1
  210. package/lib/store/table.d.ts +145 -24
  211. package/lib/store/table.js +7 -1
  212. package/lib/store/table2.js +1 -1
  213. package/lib/theme.js +1 -1
  214. package/lib/types.d.ts +5 -2
  215. package/lib/utils/Animation.js +1 -1
  216. package/lib/utils/ColorScale.js +1 -1
  217. package/lib/utils/DataSchema.d.ts +3 -2
  218. package/lib/utils/DataSchema.js +27 -7
  219. package/lib/utils/DataScope.d.ts +10 -3
  220. package/lib/utils/DataScope.js +50 -11
  221. package/lib/utils/RootClose.js +1 -1
  222. package/lib/utils/SimpleMap.js +1 -1
  223. package/lib/utils/api.js +39 -31
  224. package/lib/utils/arraySlice.d.ts +1 -0
  225. package/lib/utils/arraySlice.js +80 -0
  226. package/lib/utils/attachmentAdpator.js +1 -1
  227. package/lib/utils/autobind.js +1 -1
  228. package/lib/utils/columnsSplit.js +1 -1
  229. package/lib/utils/dataMapping.js +26 -18
  230. package/lib/utils/date.js +1 -1
  231. package/lib/utils/debug.js +1 -1
  232. package/lib/utils/decodeEntity.js +1 -1
  233. package/lib/utils/dom.js +4 -1
  234. package/lib/utils/errors.js +1 -1
  235. package/lib/utils/escapeHtml.js +1 -1
  236. package/lib/utils/filter-schema.js +1 -1
  237. package/lib/utils/filter.js +1 -1
  238. package/lib/utils/formatDuration.js +1 -1
  239. package/lib/utils/formula.js +1 -1
  240. package/lib/utils/getVariable.js +1 -1
  241. package/lib/utils/grammar.js +1 -1
  242. package/lib/utils/handleAction.js +1 -1
  243. package/lib/utils/helper.d.ts +8 -1
  244. package/lib/utils/helper.js +57 -9
  245. package/lib/utils/highlight.js +1 -1
  246. package/lib/utils/icon.js +1 -1
  247. package/lib/utils/image.js +1 -1
  248. package/lib/utils/index.d.ts +1 -0
  249. package/lib/utils/isPureVariable.js +1 -1
  250. package/lib/utils/json-schema-2-amis-schema.js +1 -1
  251. package/lib/utils/keyToPath.js +1 -1
  252. package/lib/utils/makeSorter.js +1 -1
  253. package/lib/utils/memoryParse.js +1 -1
  254. package/lib/utils/normalizeLink.js +18 -9
  255. package/lib/utils/normalizeOptions.js +1 -1
  256. package/lib/utils/object.js +1 -1
  257. package/lib/utils/offset.js +1 -1
  258. package/lib/utils/offsetParent.js +1 -1
  259. package/lib/utils/optionValueCompare.js +1 -1
  260. package/lib/utils/position.js +1 -1
  261. package/lib/utils/prettyBytes.js +1 -1
  262. package/lib/utils/renderer-event.js +1 -1
  263. package/lib/utils/replaceText.js +1 -1
  264. package/lib/utils/resize-sensor.js +1 -1
  265. package/lib/utils/resolveCondition.js +1 -1
  266. package/lib/utils/resolveVariable.js +1 -1
  267. package/lib/utils/resolveVariableAndFilter.js +1 -1
  268. package/lib/utils/resolveVariableAndFilterForAsync.js +1 -1
  269. package/lib/utils/scrollPosition.js +1 -1
  270. package/lib/utils/string2regExp.js +1 -1
  271. package/lib/utils/stripNumber.js +1 -1
  272. package/lib/utils/style-helper.js +1 -1
  273. package/lib/utils/style.js +1 -1
  274. package/lib/utils/toNumber.js +1 -1
  275. package/lib/utils/tokenize.js +1 -1
  276. package/lib/utils/tpl-builtin.js +1 -1
  277. package/lib/utils/tpl-lodash.js +1 -1
  278. package/lib/utils/tpl.js +1 -1
  279. package/lib/utils/uncontrollable.js +1 -1
  280. package/lib/utils/validations.js +1 -1
  281. package/package.json +8 -3
package/esm/index.d.ts CHANGED
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { Renderer, getRendererByName, getRenderers, registerRenderer, unRegisterRenderer, resolveRenderer, filterSchema, clearStoresCache, updateEnv, addSchemaFilter, extendDefaultEnv } from './factory';
9
9
  import type { RenderOptions, RendererConfig, RendererProps } from './factory';
10
+ import './polyfills';
10
11
  import './renderers/builtin';
11
12
  import './renderers/register';
12
13
  export * from './utils/index';
package/esm/index.js CHANGED
@@ -1,11 +1,12 @@
1
1
  /**
2
- * amis-core v3.1.0
2
+ * amis-core v3.2.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
6
6
  import { __assign, __rest } from 'tslib';
7
7
  import { stores, defaultOptions } from './factory.js';
8
8
  export { Renderer, addSchemaFilter, clearStoresCache, extendDefaultEnv, filterSchema, getRendererByName, getRenderers, registerRenderer, resolveRenderer, unRegisterRenderer, updateEnv } from './factory.js';
9
+ import './polyfills.js';
9
10
  import './renderers/builtin.js';
10
11
  import './renderers/register.js';
11
12
  import { wrapFetcher } from './utils/api.js';
@@ -16,7 +17,7 @@ export { ColorScale } from './utils/ColorScale.js';
16
17
  export { columnsSplit } from './utils/columnsSplit.js';
17
18
  export { dataMapping, resolveMapping, resolveMappingObject } from './utils/dataMapping.js';
18
19
  export { DataSchema } from './utils/DataSchema.js';
19
- export { DataScope } from './utils/DataScope.js';
20
+ export { DATASCHEMA_TYPE_MAP, DataScope } from './utils/DataScope.js';
20
21
  export { filterDate, normalizeDate, parseDuration, relativeValueRe } from './utils/date.js';
21
22
  import { enableDebug } from './utils/debug.js';
22
23
  export { DebugWrapper, debug, enableDebug, warning } from './utils/debug.js';
@@ -33,7 +34,7 @@ export { handleAction } from './utils/handleAction.js';
33
34
  import { promisify } from './utils/helper.js';
34
35
  import * as helper from './utils/helper.js';
35
36
  export { helper as utils };
36
- export { JSONTraverse, SkipOperation, __uri, anyChanged, autobind, bulkBindFunctions, camel, chainEvents, chainFunctions, convertArrayValueToMoment, detectPropValueChanged, difference, eachTree, everyTree, filterTree, findIndex, findObjectsWithKey, findTree, findTreeAll, findTreeIndex, flattenTree, flattenTreeWithLeafNodes, getLevelFromClassName, getPropValue, getRange, getScrollParent, getScrollbarWidth, getTree, getTreeAncestors, getTreeDepth, getTreeParent, getWidthRate, guid, hasAbility, hasFile, hasOwnPropertyInPath, hasVisibleExpression, hashCode, immutableExtends, injectPropsToObject, isArrayChildrenModified, isBreakpoint, isClickOnInput, isDisabled, isEmpty, isMobile, isNumeric, isObjectShallowModified, isSuperDataModified, isUnfolded, isVisible, lcFirst, loadScript, loadStyle, makeColumnClassBuild, makeHorizontalDeeper, mapObject, mapTree, noop, normalizeNodePath, object2formData, omitControls, padArr, parseQuery, pickEventsProps, preventDefault, promisify, qsparse, qsstringify, range, removeHTMLTag, repeatCount, rmUndefined, someTree, sortArray, spliceTree, syncDataFromSuper, ucFirst, until, uuid, uuidv4, visibilityFilter } from './utils/helper.js';
37
+ export { JSONTraverse, JSONValueMap, SkipOperation, __uri, anyChanged, autobind, bulkBindFunctions, camel, chainEvents, chainFunctions, convertArrayValueToMoment, detectPropValueChanged, difference, eachTree, everyTree, filterTree, findIndex, findObjectsWithKey, findTree, findTreeAll, findTreeIndex, flattenTree, flattenTreeWithLeafNodes, getLevelFromClassName, getPropValue, getRange, getScrollParent, getScrollbarWidth, getTree, getTreeAncestors, getTreeDepth, getTreeParent, getWidthRate, guid, hasAbility, hasFile, hasOwnPropertyInPath, hasVisibleExpression, hashCode, immutableExtends, injectPropsToObject, isArrayChildrenModified, isBreakpoint, isClickOnInput, isDisabled, isEmpty, isMobile, isNumeric, isObjectShallowModified, isSuperDataModified, isUnfolded, isVisible, lcFirst, loadScript, loadStyle, makeColumnClassBuild, makeHorizontalDeeper, mapObject, mapTree, noop, normalizeNodePath, object2formData, omitControls, padArr, parseQuery, pickEventsProps, preventDefault, promisify, qsparse, qsstringify, range, removeHTMLTag, repeatCount, rmUndefined, someTree, sortArray, spliceTree, syncDataFromSuper, ucFirst, until, uuid, uuidv4, visibilityFilter } from './utils/helper.js';
37
38
  export { highlight } from './utils/highlight.js';
38
39
  export { generateIcon } from './utils/icon.js';
39
40
  export { getImageDimensions, toDataURL } from './utils/image.js';
@@ -70,6 +71,7 @@ export { toNumber } from './utils/toNumber.js';
70
71
  export { decodeEntity } from './utils/decodeEntity.js';
71
72
  export { addStyle, findOrCreactStyle, formatStyle, getValueByPath, inheritValueMap, insertCustomStyle, insertStyle, valueMap as styleMap, valueMap } from './utils/style-helper.js';
72
73
  export { getConditionComputers, registerConditionComputer, resolveCondition, setConditionComputeErrorHandler } from './utils/resolveCondition.js';
74
+ export { arraySlice } from './utils/arraySlice.js';
73
75
  export { default as animation } from './utils/Animation.js';
74
76
  import { RendererStore } from './store/index.js';
75
77
  export { RegisterStore, RendererStore } from './store/index.js';
@@ -136,7 +138,7 @@ export { StoreNode } from './store/node.js';
136
138
  */
137
139
  var classPrefix = getClassPrefix();
138
140
  // @ts-ignore
139
- var version = '3.1.0';
141
+ var version = '3.2.0';
140
142
  function render(schema, props, options, pathPrefix) {
141
143
  if (props === void 0) { props = {}; }
142
144
  if (options === void 0) { options = {}; }
package/esm/locale.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.1.0
2
+ * amis-core v3.2.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -0,0 +1,3 @@
1
+ /**
2
+ * 用于放一些关键的 polyfill
3
+ */
@@ -0,0 +1,18 @@
1
+ /**
2
+ * amis-core v3.2.0
3
+ * Copyright 2018-2023 fex
4
+ */
5
+
6
+ /**
7
+ * 用于放一些关键的 polyfill
8
+ */
9
+ // ios 老版本没有这个会报错
10
+ if (!('DragEvent' in window)) {
11
+ Object.defineProperty(window, 'DragEvent', {
12
+ value: /** @class */ (function () {
13
+ function DragEvent() {
14
+ }
15
+ return DragEvent;
16
+ }())
17
+ });
18
+ }
@@ -354,7 +354,7 @@ export default class Form extends React.Component<FormProps, object> {
354
354
  handleFormSubmit(e: React.UIEvent<any>): any;
355
355
  handleReset(action: any): (data: any) => void;
356
356
  handleAction(e: React.UIEvent<any> | void, action: ActionObject, data: object, throwErrors?: boolean, delegate?: IScopedContext): Promise<any>;
357
- handleQuery(query: any): void;
357
+ handleQuery(query: any): any;
358
358
  handleDialogConfirm(values: object[], action: ActionObject, ctx: any, targets: Array<any>): void;
359
359
  handleDialogClose(confirmed?: boolean): void;
360
360
  handleDrawerConfirm(values: object[], action: ActionObject, ctx: any, targets: Array<any>): void;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v3.1.0
2
+ * amis-core v3.2.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -183,7 +183,7 @@ var Form = /** @class */ (function (_super) {
183
183
  case 0:
184
184
  _b = this.props, data = _b.data, store = _b.store, dispatchEvent = _b.dispatchEvent;
185
185
  if (store.fetching) {
186
- return [2 /*return*/];
186
+ return [2 /*return*/, value];
187
187
  }
188
188
  // 派发init事件,参数为初始化数据
189
189
  return [4 /*yield*/, dispatchEvent('inited', createObject(data, __assign(__assign({}, value === null || value === void 0 ? void 0 : value.data), { responseData: (_a = value === null || value === void 0 ? void 0 : value.data) !== null && _a !== void 0 ? _a : {}, responseStatus: store.error ? 1 : 0, responseMsg: store.msg })))];
@@ -305,7 +305,8 @@ var Form = /** @class */ (function (_super) {
305
305
  Form.prototype.initInterval = function (value) {
306
306
  var _a = this.props, interval = _a.interval, silentPolling = _a.silentPolling, stopAutoRefreshWhen = _a.stopAutoRefreshWhen, data = _a.data;
307
307
  clearTimeout(this.timer);
308
- interval &&
308
+ (value === null || value === void 0 ? void 0 : value.ok) &&
309
+ interval &&
309
310
  this.mounted &&
310
311
  (!stopAutoRefreshWhen || !evalExpression(stopAutoRefreshWhen, data)) &&
311
312
  (this.timer = setTimeout(silentPolling ? this.silentReload : this.reload, Math.max(interval, 1000)));
@@ -552,7 +553,7 @@ var Form = /** @class */ (function (_super) {
552
553
  _this.reloadTarget(filterTarget(action.target, values), values);
553
554
  }
554
555
  else if (action.actionType === 'dialog') {
555
- store.openDialog(data);
556
+ store.openDialog(data, undefined, action.callback);
556
557
  }
557
558
  else if (action.actionType === 'drawer') {
558
559
  store.openDrawer(data);
@@ -679,7 +680,7 @@ var Form = /** @class */ (function (_super) {
679
680
  }
680
681
  else if (action.actionType === 'dialog') {
681
682
  store.setCurrentAction(action);
682
- store.openDialog(data);
683
+ store.openDialog(data, undefined, action.callback);
683
684
  }
684
685
  else if (action.actionType === 'drawer') {
685
686
  store.setCurrentAction(action);
@@ -752,12 +753,21 @@ var Form = /** @class */ (function (_super) {
752
753
  });
753
754
  };
754
755
  Form.prototype.handleQuery = function (query) {
755
- var _a, _b;
756
756
  if (this.props.initApi) {
757
+ // 如果是分页动作,则看接口里面有没有用,没用则 return false
758
+ // 让组件自己去排序
759
+ if ((query === null || query === void 0 ? void 0 : query.hasOwnProperty('orderBy')) &&
760
+ !isApiOutdated(this.props.initApi, this.props.initApi, this.props.store.data, createObject(this.props.store.data, query))) {
761
+ return false;
762
+ }
757
763
  this.receive(query);
764
+ return;
765
+ }
766
+ if (this.props.onQuery) {
767
+ return this.props.onQuery(query);
758
768
  }
759
769
  else {
760
- (_b = (_a = this.props).onQuery) === null || _b === void 0 ? void 0 : _b.call(_a, query);
770
+ return false;
761
771
  }
762
772
  };
763
773
  Form.prototype.handleDialogConfirm = function (values, action, ctx, targets) {
@@ -4,7 +4,7 @@ import hoistNonReactStatic from 'hoist-non-react-statics';
4
4
  import { IFormItemStore, IFormStore } from '../store/form';
5
5
  import { RendererProps, TestFunc, RendererConfig } from '../factory';
6
6
  import { FormHorizontal, FormSchemaBase } from './Form';
7
- import { BaseApiObject, BaseSchemaWithoutType, ClassName, Schema } from '../types';
7
+ import { ActionObject, BaseApiObject, BaseSchemaWithoutType, ClassName, Schema } from '../types';
8
8
  export type LabelAlign = 'right' | 'left';
9
9
  export interface FormBaseControl extends BaseSchemaWithoutType {
10
10
  /**
@@ -444,8 +444,9 @@ export declare class FormItemWrap extends React.Component<FormItemProps> {
444
444
  label: any;
445
445
  })[];
446
446
  } | undefined;
447
- hanldeSubmit(values: any): void;
448
- hanldeClose(): void;
447
+ handleSubmit(values: any): void;
448
+ handleAction(e: React.UIEvent<any>, action: ActionObject, data: object): void;
449
+ handleClose(): void;
449
450
  handleOpenDialog(schema: Schema, data: any): Promise<unknown>;
450
451
  handleDialogConfirm([values]: Array<any>): void;
451
452
  handleDialogClose(confirmed?: boolean): void;
@@ -460,30 +461,10 @@ export declare class FormItemWrap extends React.Component<FormItemProps> {
460
461
  }
461
462
  export declare const detectProps: string[];
462
463
  export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (Control: FormControlComponent) => {
463
- new (props: Omit<any, "rootStore"> | Readonly<Omit<any, "rootStore">>): {
464
- render(): React.JSX.Element;
465
- context: unknown;
466
- setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<any, "rootStore">>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
467
- forceUpdate(callback?: (() => void) | undefined): void;
468
- readonly props: Readonly<Omit<any, "rootStore">>;
469
- state: Readonly<{}>;
470
- refs: {
471
- [key: string]: React.ReactInstance;
472
- };
473
- componentDidMount?(): void;
474
- shouldComponentUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): boolean;
475
- componentWillUnmount?(): void;
476
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
477
- getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<any, "rootStore">>, prevState: Readonly<{}>): any;
478
- componentDidUpdate?(prevProps: Readonly<Omit<any, "rootStore">>, prevState: Readonly<{}>, snapshot?: any): void;
479
- componentWillMount?(): void;
480
- UNSAFE_componentWillMount?(): void;
481
- componentWillReceiveProps?(nextProps: Readonly<Omit<any, "rootStore">>, nextContext: any): void;
482
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<any, "rootStore">>, nextContext: any): void;
483
- componentWillUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): void;
484
- UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): void;
485
- };
486
- new (props: Omit<any, "rootStore">, context: any): {
464
+ new (props: Omit<any, "rootStore">): {
465
+ ref: any;
466
+ getWrappedInstance(): any;
467
+ refFn(ref: any): void;
487
468
  render(): React.JSX.Element;
488
469
  context: unknown;
489
470
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<any, "rootStore">>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -527,12 +508,15 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
527
508
  readonly hasChildren: boolean;
528
509
  readonly children: any[];
529
510
  } & {
511
+ /**
512
+ * 显示一个小图标, 鼠标放上去的时候显示提示内容
513
+ */
530
514
  onChildStoreDispose(child: any): void;
531
515
  syncProps(props: any, prevProps: any, list?: string[]): void;
532
- dispose: (callback?: (() => void) | undefined) => void; /**
516
+ dispose: (callback?: (() => void) | undefined) => void;
517
+ addChildId: (id: string) => void; /**
533
518
  * 当配置为水平布局的时候,用来配置具体的左右分配。
534
519
  */
535
- addChildId: (id: string) => void;
536
520
  removeChildId: (id: string) => void;
537
521
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
538
522
  id: import("mobx-state-tree").ISimpleType<string>;
@@ -547,12 +531,15 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
547
531
  readonly hasChildren: boolean;
548
532
  readonly children: any[];
549
533
  } & {
534
+ /**
535
+ * 显示一个小图标, 鼠标放上去的时候显示提示内容
536
+ */
550
537
  onChildStoreDispose(child: any): void;
551
538
  syncProps(props: any, prevProps: any, list?: string[]): void;
552
- dispose: (callback?: (() => void) | undefined) => void; /**
539
+ dispose: (callback?: (() => void) | undefined) => void;
540
+ addChildId: (id: string) => void; /**
553
541
  * 当配置为水平布局的时候,用来配置具体的左右分配。
554
542
  */
555
- addChildId: (id: string) => void;
556
543
  removeChildId: (id: string) => void;
557
544
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
558
545
  readonly stores: {
@@ -569,12 +556,15 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
569
556
  readonly hasChildren: boolean;
570
557
  readonly children: any[];
571
558
  } & {
559
+ /**
560
+ * 显示一个小图标, 鼠标放上去的时候显示提示内容
561
+ */
572
562
  onChildStoreDispose(child: any): void;
573
563
  syncProps(props: any, prevProps: any, list?: string[]): void;
574
- dispose: (callback?: (() => void) | undefined) => void; /**
564
+ dispose: (callback?: (() => void) | undefined) => void;
565
+ addChildId: (id: string) => void; /**
575
566
  * 当配置为水平布局的时候,用来配置具体的左右分配。
576
567
  */
577
- addChildId: (id: string) => void;
578
568
  removeChildId: (id: string) => void;
579
569
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
580
570
  id: import("mobx-state-tree").ISimpleType<string>;
@@ -589,12 +579,15 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
589
579
  readonly hasChildren: boolean;
590
580
  readonly children: any[];
591
581
  } & {
582
+ /**
583
+ * 显示一个小图标, 鼠标放上去的时候显示提示内容
584
+ */
592
585
  onChildStoreDispose(child: any): void;
593
586
  syncProps(props: any, prevProps: any, list?: string[]): void;
594
- dispose: (callback?: (() => void) | undefined) => void; /**
587
+ dispose: (callback?: (() => void) | undefined) => void;
588
+ addChildId: (id: string) => void; /**
595
589
  * 当配置为水平布局的时候,用来配置具体的左右分配。
596
590
  */
597
- addChildId: (id: string) => void;
598
591
  removeChildId: (id: string) => void;
599
592
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
600
593
  };
@@ -618,12 +611,15 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
618
611
  readonly hasChildren: boolean;
619
612
  readonly children: any[];
620
613
  } & {
614
+ /**
615
+ * 显示一个小图标, 鼠标放上去的时候显示提示内容
616
+ */
621
617
  onChildStoreDispose(child: any): void;
622
618
  syncProps(props: any, prevProps: any, list?: string[]): void;
623
- dispose: (callback?: (() => void) | undefined) => void; /**
619
+ dispose: (callback?: (() => void) | undefined) => void;
620
+ addChildId: (id: string) => void; /**
624
621
  * 当配置为水平布局的时候,用来配置具体的左右分配。
625
622
  */
626
- addChildId: (id: string) => void;
627
623
  removeChildId: (id: string) => void;
628
624
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
629
625
  id: import("mobx-state-tree").ISimpleType<string>;
@@ -638,12 +634,15 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
638
634
  readonly hasChildren: boolean;
639
635
  readonly children: any[];
640
636
  } & {
637
+ /**
638
+ * 显示一个小图标, 鼠标放上去的时候显示提示内容
639
+ */
641
640
  onChildStoreDispose(child: any): void;
642
641
  syncProps(props: any, prevProps: any, list?: string[]): void;
643
- dispose: (callback?: (() => void) | undefined) => void; /**
642
+ dispose: (callback?: (() => void) | undefined) => void;
643
+ addChildId: (id: string) => void; /**
644
644
  * 当配置为水平布局的时候,用来配置具体的左右分配。
645
645
  */
646
- addChildId: (id: string) => void;
647
646
  removeChildId: (id: string) => void;
648
647
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
649
648
  removeStore(store: {
@@ -659,12 +658,15 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
659
658
  readonly hasChildren: boolean;
660
659
  readonly children: any[];
661
660
  } & {
661
+ /**
662
+ * 显示一个小图标, 鼠标放上去的时候显示提示内容
663
+ */
662
664
  onChildStoreDispose(child: any): void;
663
665
  syncProps(props: any, prevProps: any, list?: string[]): void;
664
- dispose: (callback?: (() => void) | undefined) => void; /**
666
+ dispose: (callback?: (() => void) | undefined) => void;
667
+ addChildId: (id: string) => void; /**
665
668
  * 当配置为水平布局的时候,用来配置具体的左右分配。
666
669
  */
667
- addChildId: (id: string) => void;
668
670
  removeChildId: (id: string) => void;
669
671
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
670
672
  id: import("mobx-state-tree").ISimpleType<string>;
@@ -679,12 +681,15 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
679
681
  readonly hasChildren: boolean;
680
682
  readonly children: any[];
681
683
  } & {
684
+ /**
685
+ * 显示一个小图标, 鼠标放上去的时候显示提示内容
686
+ */
682
687
  onChildStoreDispose(child: any): void;
683
688
  syncProps(props: any, prevProps: any, list?: string[]): void;
684
- dispose: (callback?: (() => void) | undefined) => void; /**
689
+ dispose: (callback?: (() => void) | undefined) => void;
690
+ addChildId: (id: string) => void; /**
685
691
  * 当配置为水平布局的时候,用来配置具体的左右分配。
686
692
  */
687
- addChildId: (id: string) => void;
688
693
  removeChildId: (id: string) => void;
689
694
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>): void;
690
695
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
@@ -707,12 +712,15 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
707
712
  readonly hasChildren: boolean;
708
713
  readonly children: any[];
709
714
  } & {
715
+ /**
716
+ * 显示一个小图标, 鼠标放上去的时候显示提示内容
717
+ */
710
718
  onChildStoreDispose(child: any): void;
711
719
  syncProps(props: any, prevProps: any, list?: string[]): void;
712
- dispose: (callback?: (() => void) | undefined) => void; /**
720
+ dispose: (callback?: (() => void) | undefined) => void;
721
+ addChildId: (id: string) => void; /**
713
722
  * 当配置为水平布局的时候,用来配置具体的左右分配。
714
723
  */
715
- addChildId: (id: string) => void;
716
724
  removeChildId: (id: string) => void;
717
725
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
718
726
  id: import("mobx-state-tree").ISimpleType<string>;
@@ -727,12 +735,15 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
727
735
  readonly hasChildren: boolean;
728
736
  readonly children: any[];
729
737
  } & {
738
+ /**
739
+ * 显示一个小图标, 鼠标放上去的时候显示提示内容
740
+ */
730
741
  onChildStoreDispose(child: any): void;
731
742
  syncProps(props: any, prevProps: any, list?: string[]): void;
732
- dispose: (callback?: (() => void) | undefined) => void; /**
743
+ dispose: (callback?: (() => void) | undefined) => void;
744
+ addChildId: (id: string) => void; /**
733
745
  * 当配置为水平布局的时候,用来配置具体的左右分配。
734
746
  */
735
- addChildId: (id: string) => void;
736
747
  removeChildId: (id: string) => void;
737
748
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
738
749
  readonly stores: {
@@ -749,12 +760,15 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
749
760
  readonly hasChildren: boolean;
750
761
  readonly children: any[];
751
762
  } & {
763
+ /**
764
+ * 显示一个小图标, 鼠标放上去的时候显示提示内容
765
+ */
752
766
  onChildStoreDispose(child: any): void;
753
767
  syncProps(props: any, prevProps: any, list?: string[]): void;
754
- dispose: (callback?: (() => void) | undefined) => void; /**
768
+ dispose: (callback?: (() => void) | undefined) => void;
769
+ addChildId: (id: string) => void; /**
755
770
  * 当配置为水平布局的时候,用来配置具体的左右分配。
756
771
  */
757
- addChildId: (id: string) => void;
758
772
  removeChildId: (id: string) => void;
759
773
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
760
774
  id: import("mobx-state-tree").ISimpleType<string>;
@@ -769,12 +783,15 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
769
783
  readonly hasChildren: boolean;
770
784
  readonly children: any[];
771
785
  } & {
786
+ /**
787
+ * 显示一个小图标, 鼠标放上去的时候显示提示内容
788
+ */
772
789
  onChildStoreDispose(child: any): void;
773
790
  syncProps(props: any, prevProps: any, list?: string[]): void;
774
- dispose: (callback?: (() => void) | undefined) => void; /**
791
+ dispose: (callback?: (() => void) | undefined) => void;
792
+ addChildId: (id: string) => void; /**
775
793
  * 当配置为水平布局的时候,用来配置具体的左右分配。
776
794
  */
777
- addChildId: (id: string) => void;
778
795
  removeChildId: (id: string) => void;
779
796
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
780
797
  };
@@ -798,12 +815,15 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
798
815
  readonly hasChildren: boolean;
799
816
  readonly children: any[];
800
817
  } & {
818
+ /**
819
+ * 显示一个小图标, 鼠标放上去的时候显示提示内容
820
+ */
801
821
  onChildStoreDispose(child: any): void;
802
822
  syncProps(props: any, prevProps: any, list?: string[]): void;
803
- dispose: (callback?: (() => void) | undefined) => void; /**
823
+ dispose: (callback?: (() => void) | undefined) => void;
824
+ addChildId: (id: string) => void; /**
804
825
  * 当配置为水平布局的时候,用来配置具体的左右分配。
805
826
  */
806
- addChildId: (id: string) => void;
807
827
  removeChildId: (id: string) => void;
808
828
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
809
829
  id: import("mobx-state-tree").ISimpleType<string>;
@@ -818,12 +838,15 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
818
838
  readonly hasChildren: boolean;
819
839
  readonly children: any[];
820
840
  } & {
841
+ /**
842
+ * 显示一个小图标, 鼠标放上去的时候显示提示内容
843
+ */
821
844
  onChildStoreDispose(child: any): void;
822
845
  syncProps(props: any, prevProps: any, list?: string[]): void;
823
- dispose: (callback?: (() => void) | undefined) => void; /**
846
+ dispose: (callback?: (() => void) | undefined) => void;
847
+ addChildId: (id: string) => void; /**
824
848
  * 当配置为水平布局的时候,用来配置具体的左右分配。
825
849
  */
826
- addChildId: (id: string) => void;
827
850
  removeChildId: (id: string) => void;
828
851
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
829
852
  removeStore(store: {
@@ -839,12 +862,15 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
839
862
  readonly hasChildren: boolean;
840
863
  readonly children: any[];
841
864
  } & {
865
+ /**
866
+ * 显示一个小图标, 鼠标放上去的时候显示提示内容
867
+ */
842
868
  onChildStoreDispose(child: any): void;
843
869
  syncProps(props: any, prevProps: any, list?: string[]): void;
844
- dispose: (callback?: (() => void) | undefined) => void; /**
870
+ dispose: (callback?: (() => void) | undefined) => void;
871
+ addChildId: (id: string) => void; /**
845
872
  * 当配置为水平布局的时候,用来配置具体的左右分配。
846
873
  */
847
- addChildId: (id: string) => void;
848
874
  removeChildId: (id: string) => void;
849
875
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
850
876
  id: import("mobx-state-tree").ISimpleType<string>;
@@ -859,12 +885,15 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
859
885
  readonly hasChildren: boolean;
860
886
  readonly children: any[];
861
887
  } & {
888
+ /**
889
+ * 显示一个小图标, 鼠标放上去的时候显示提示内容
890
+ */
862
891
  onChildStoreDispose(child: any): void;
863
892
  syncProps(props: any, prevProps: any, list?: string[]): void;
864
- dispose: (callback?: (() => void) | undefined) => void; /**
893
+ dispose: (callback?: (() => void) | undefined) => void;
894
+ addChildId: (id: string) => void; /**
865
895
  * 当配置为水平布局的时候,用来配置具体的左右分配。
866
896
  */
867
- addChildId: (id: string) => void;
868
897
  removeChildId: (id: string) => void;
869
898
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>): void;
870
899
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;