amis-core 2.0.0-rc.9 → 2.0.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 (311) hide show
  1. package/esm/Root.js +3 -2
  2. package/esm/RootRenderer.js +1 -1
  3. package/esm/SchemaRenderer.js +1 -1
  4. package/esm/Scoped.js +1 -1
  5. package/esm/WithRootStore.js +1 -1
  6. package/esm/WithStore.js +1 -1
  7. package/esm/_virtual/index.js +8 -0
  8. package/esm/_virtual/index2.js +8 -0
  9. package/esm/_virtual/react-is.development.js +8 -0
  10. package/esm/_virtual/react-is.production.min.js +8 -0
  11. package/esm/actions/Action.js +9 -5
  12. package/esm/actions/AjaxAction.d.ts +2 -0
  13. package/esm/actions/AjaxAction.js +24 -16
  14. package/esm/actions/BreakAction.js +1 -1
  15. package/esm/actions/BroadcastAction.js +1 -1
  16. package/esm/actions/CmptAction.js +1 -1
  17. package/esm/actions/ContinueAction.js +1 -1
  18. package/esm/actions/CopyAction.js +1 -1
  19. package/esm/actions/CustomAction.js +1 -1
  20. package/esm/actions/Decorators.d.ts +1 -1
  21. package/esm/actions/Decorators.js +14 -7
  22. package/esm/actions/DialogAction.js +1 -1
  23. package/esm/actions/DrawerAction.js +1 -1
  24. package/esm/actions/EmailAction.js +1 -1
  25. package/esm/actions/LinkAction.js +1 -1
  26. package/esm/actions/LoopAction.js +1 -1
  27. package/esm/actions/PageAction.js +1 -1
  28. package/esm/actions/ParallelAction.js +1 -1
  29. package/esm/actions/SwitchAction.js +1 -1
  30. package/esm/actions/ToastAction.js +1 -1
  31. package/esm/components/LazyComponent.js +1 -1
  32. package/esm/components/Overlay.d.ts +41 -0
  33. package/esm/components/Overlay.js +234 -0
  34. package/esm/components/PopOver.d.ts +90 -0
  35. package/esm/components/PopOver.js +118 -0
  36. package/esm/env.js +1 -1
  37. package/esm/envOverwrite.js +1 -1
  38. package/esm/factory.js +2 -2
  39. package/esm/index.d.ts +3 -1
  40. package/esm/index.js +3 -1
  41. package/esm/index2.js +6 -2
  42. package/esm/locale.js +1 -1
  43. package/esm/node_modules/@restart/hooks/esm/useCommittedRef.js +1 -1
  44. package/esm/node_modules/@restart/hooks/esm/useEventCallback.js +1 -1
  45. package/esm/node_modules/dom-helpers/esm/addEventListener.js +1 -1
  46. package/esm/node_modules/dom-helpers/esm/canUseDOM.js +1 -1
  47. package/esm/node_modules/dom-helpers/esm/contains.js +1 -1
  48. package/esm/node_modules/dom-helpers/esm/listen.js +1 -1
  49. package/esm/node_modules/dom-helpers/esm/ownerDocument.js +1 -1
  50. package/esm/node_modules/dom-helpers/esm/removeEventListener.js +1 -1
  51. package/esm/node_modules/object-assign/index.js +104 -0
  52. package/esm/node_modules/prop-types/checkPropTypes.js +120 -0
  53. package/esm/node_modules/prop-types/factoryWithThrowingShims.js +79 -0
  54. package/esm/node_modules/prop-types/factoryWithTypeCheckers.js +630 -0
  55. package/esm/node_modules/prop-types/index.js +32 -0
  56. package/esm/node_modules/prop-types/lib/ReactPropTypesSecret.js +26 -0
  57. package/esm/node_modules/prop-types/lib/has.js +16 -0
  58. package/esm/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +195 -0
  59. package/esm/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +31 -0
  60. package/esm/node_modules/prop-types/node_modules/react-is/index.js +26 -0
  61. package/esm/node_modules/react-overlays/esm/Portal.js +35 -0
  62. package/esm/node_modules/react-overlays/esm/ownerDocument.js +1 -1
  63. package/esm/node_modules/react-overlays/esm/safeFindDOMNode.js +1 -1
  64. package/esm/node_modules/react-overlays/esm/useRootClose.js +1 -1
  65. package/esm/node_modules/react-overlays/esm/useWaitForDOMRef.js +46 -0
  66. package/esm/node_modules/warning/warning.js +1 -1
  67. package/esm/renderers/Form.d.ts +10 -4
  68. package/esm/renderers/Form.js +260 -249
  69. package/esm/renderers/Item.d.ts +89 -3
  70. package/esm/renderers/Item.js +253 -40
  71. package/esm/renderers/Options.js +13 -9
  72. package/esm/renderers/Placeholder.js +1 -1
  73. package/esm/renderers/builtin.js +1 -1
  74. package/esm/renderers/wrapControl.js +1 -1
  75. package/esm/store/app.js +1 -1
  76. package/esm/store/combo.d.ts +1837 -143
  77. package/esm/store/combo.js +1 -1
  78. package/esm/store/crud.d.ts +3 -0
  79. package/esm/store/crud.js +37 -10
  80. package/esm/store/form.d.ts +856 -9
  81. package/esm/store/form.js +49 -12
  82. package/esm/store/formItem.d.ts +3 -1
  83. package/esm/store/formItem.js +5 -7
  84. package/esm/store/iRenderer.js +1 -1
  85. package/esm/store/index.js +1 -1
  86. package/esm/store/list.d.ts +2 -0
  87. package/esm/store/list.js +9 -1
  88. package/esm/store/manager.js +1 -1
  89. package/esm/store/modal.js +1 -1
  90. package/esm/store/node.js +1 -1
  91. package/esm/store/pagination.js +1 -1
  92. package/esm/store/root.js +1 -1
  93. package/esm/store/service.js +1 -1
  94. package/esm/store/table-v2.d.ts +1 -0
  95. package/esm/store/table-v2.js +19 -3
  96. package/esm/store/table.d.ts +1818 -132
  97. package/esm/store/table.js +1 -1
  98. package/esm/theme.js +1 -1
  99. package/esm/types.d.ts +1 -1
  100. package/esm/utils/Animation.js +1 -1
  101. package/esm/utils/ColorScale.js +1 -1
  102. package/esm/utils/DataSchema.js +1 -1
  103. package/esm/utils/DataScope.d.ts +5 -1
  104. package/esm/utils/DataScope.js +18 -7
  105. package/esm/utils/RootClose.js +1 -1
  106. package/esm/utils/SimpleMap.js +1 -1
  107. package/esm/utils/api.js +1 -1
  108. package/esm/utils/attachmentAdpator.js +1 -1
  109. package/esm/utils/autobind.js +1 -1
  110. package/esm/utils/columnsSplit.js +1 -1
  111. package/esm/utils/dataMapping.js +1 -1
  112. package/esm/utils/date.js +1 -1
  113. package/esm/utils/debug.js +8 -2
  114. package/esm/utils/dom.js +1 -1
  115. package/esm/utils/errors.js +1 -1
  116. package/esm/utils/escapeHtml.js +1 -1
  117. package/esm/utils/filter-schema.js +1 -1
  118. package/esm/utils/filter.js +1 -1
  119. package/esm/utils/formatDuration.js +1 -1
  120. package/esm/utils/formula.js +1 -1
  121. package/esm/utils/getVariable.js +1 -1
  122. package/esm/utils/grammar.js +1 -1
  123. package/esm/utils/handleAction.js +1 -1
  124. package/esm/utils/helper.d.ts +1 -1
  125. package/esm/utils/helper.js +6 -4
  126. package/esm/utils/highlight.js +1 -1
  127. package/esm/utils/icon.js +1 -1
  128. package/esm/utils/image.js +1 -1
  129. package/esm/utils/isPureVariable.js +14 -4
  130. package/esm/utils/json-schema-2-amis-schema.js +1 -1
  131. package/esm/utils/keyToPath.js +1 -1
  132. package/esm/utils/makeSorter.js +1 -1
  133. package/esm/utils/normalizeLink.js +1 -1
  134. package/esm/utils/normalizeOptions.js +1 -1
  135. package/esm/utils/object.js +1 -1
  136. package/esm/utils/offset.js +1 -1
  137. package/esm/utils/offsetParent.js +1 -1
  138. package/esm/utils/optionValueCompare.js +1 -1
  139. package/esm/utils/position.js +1 -1
  140. package/esm/utils/prettyBytes.js +1 -1
  141. package/esm/utils/renderer-event.js +1 -1
  142. package/esm/utils/replaceText.js +1 -1
  143. package/esm/utils/resize-sensor.js +1 -1
  144. package/esm/utils/resolveVariable.js +1 -1
  145. package/esm/utils/resolveVariableAndFilter.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.js +1 -1
  150. package/esm/utils/tokenize.js +1 -1
  151. package/esm/utils/tpl-builtin.js +1 -1
  152. package/esm/utils/tpl-lodash.js +1 -1
  153. package/esm/utils/tpl.js +1 -1
  154. package/esm/utils/uncontrollable.js +1 -1
  155. package/esm/utils/validations.js +1 -1
  156. package/lib/Root.js +3 -2
  157. package/lib/RootRenderer.js +1 -1
  158. package/lib/SchemaRenderer.js +1 -1
  159. package/lib/Scoped.js +1 -1
  160. package/lib/WithRootStore.js +1 -1
  161. package/lib/WithStore.js +1 -1
  162. package/lib/_virtual/index.js +12 -0
  163. package/lib/_virtual/index2.js +12 -0
  164. package/lib/_virtual/react-is.development.js +12 -0
  165. package/lib/_virtual/react-is.production.min.js +12 -0
  166. package/lib/actions/Action.js +8 -4
  167. package/lib/actions/AjaxAction.d.ts +2 -0
  168. package/lib/actions/AjaxAction.js +24 -16
  169. package/lib/actions/BreakAction.js +1 -1
  170. package/lib/actions/BroadcastAction.js +1 -1
  171. package/lib/actions/CmptAction.js +1 -1
  172. package/lib/actions/ContinueAction.js +1 -1
  173. package/lib/actions/CopyAction.js +1 -1
  174. package/lib/actions/CustomAction.js +1 -1
  175. package/lib/actions/Decorators.d.ts +1 -1
  176. package/lib/actions/Decorators.js +14 -7
  177. package/lib/actions/DialogAction.js +1 -1
  178. package/lib/actions/DrawerAction.js +1 -1
  179. package/lib/actions/EmailAction.js +1 -1
  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/SwitchAction.js +1 -1
  185. package/lib/actions/ToastAction.js +1 -1
  186. package/lib/components/LazyComponent.js +1 -1
  187. package/lib/components/Overlay.d.ts +41 -0
  188. package/lib/components/Overlay.js +244 -0
  189. package/lib/components/PopOver.d.ts +90 -0
  190. package/lib/components/PopOver.js +127 -0
  191. package/lib/env.js +1 -1
  192. package/lib/envOverwrite.js +1 -1
  193. package/lib/factory.js +2 -2
  194. package/lib/index.d.ts +3 -1
  195. package/lib/index.js +5 -1
  196. package/lib/index2.js +8 -4
  197. package/lib/locale.js +1 -1
  198. package/lib/node_modules/@restart/hooks/esm/useCommittedRef.js +1 -1
  199. package/lib/node_modules/@restart/hooks/esm/useEventCallback.js +1 -1
  200. package/lib/node_modules/dom-helpers/esm/addEventListener.js +1 -1
  201. package/lib/node_modules/dom-helpers/esm/canUseDOM.js +1 -1
  202. package/lib/node_modules/dom-helpers/esm/contains.js +1 -1
  203. package/lib/node_modules/dom-helpers/esm/listen.js +1 -1
  204. package/lib/node_modules/dom-helpers/esm/ownerDocument.js +1 -1
  205. package/lib/node_modules/dom-helpers/esm/removeEventListener.js +1 -1
  206. package/lib/node_modules/object-assign/index.js +108 -0
  207. package/lib/node_modules/prop-types/checkPropTypes.js +124 -0
  208. package/lib/node_modules/prop-types/factoryWithThrowingShims.js +83 -0
  209. package/lib/node_modules/prop-types/factoryWithTypeCheckers.js +634 -0
  210. package/lib/node_modules/prop-types/index.js +35 -0
  211. package/lib/node_modules/prop-types/lib/ReactPropTypesSecret.js +30 -0
  212. package/lib/node_modules/prop-types/lib/has.js +20 -0
  213. package/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +199 -0
  214. package/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +35 -0
  215. package/lib/node_modules/prop-types/node_modules/react-is/index.js +30 -0
  216. package/lib/node_modules/react-overlays/esm/Portal.js +44 -0
  217. package/lib/node_modules/react-overlays/esm/ownerDocument.js +1 -1
  218. package/lib/node_modules/react-overlays/esm/safeFindDOMNode.js +1 -1
  219. package/lib/node_modules/react-overlays/esm/useRootClose.js +1 -1
  220. package/lib/node_modules/react-overlays/esm/useWaitForDOMRef.js +51 -0
  221. package/lib/node_modules/warning/warning.js +1 -1
  222. package/lib/renderers/Form.d.ts +10 -4
  223. package/lib/renderers/Form.js +260 -249
  224. package/lib/renderers/Item.d.ts +89 -3
  225. package/lib/renderers/Item.js +252 -39
  226. package/lib/renderers/Options.js +12 -8
  227. package/lib/renderers/Placeholder.js +1 -1
  228. package/lib/renderers/builtin.js +1 -1
  229. package/lib/renderers/wrapControl.js +1 -1
  230. package/lib/store/app.js +1 -1
  231. package/lib/store/combo.d.ts +1837 -143
  232. package/lib/store/combo.js +1 -1
  233. package/lib/store/crud.d.ts +3 -0
  234. package/lib/store/crud.js +37 -10
  235. package/lib/store/form.d.ts +856 -9
  236. package/lib/store/form.js +50 -12
  237. package/lib/store/formItem.d.ts +3 -1
  238. package/lib/store/formItem.js +5 -7
  239. package/lib/store/iRenderer.js +1 -1
  240. package/lib/store/index.js +1 -1
  241. package/lib/store/list.d.ts +2 -0
  242. package/lib/store/list.js +9 -1
  243. package/lib/store/manager.js +1 -1
  244. package/lib/store/modal.js +1 -1
  245. package/lib/store/node.js +1 -1
  246. package/lib/store/pagination.js +1 -1
  247. package/lib/store/root.js +1 -1
  248. package/lib/store/service.js +1 -1
  249. package/lib/store/table-v2.d.ts +1 -0
  250. package/lib/store/table-v2.js +19 -3
  251. package/lib/store/table.d.ts +1818 -132
  252. package/lib/store/table.js +1 -1
  253. package/lib/theme.js +1 -1
  254. package/lib/types.d.ts +1 -1
  255. package/lib/utils/Animation.js +1 -1
  256. package/lib/utils/ColorScale.js +1 -1
  257. package/lib/utils/DataSchema.js +1 -1
  258. package/lib/utils/DataScope.d.ts +5 -1
  259. package/lib/utils/DataScope.js +17 -6
  260. package/lib/utils/RootClose.js +1 -1
  261. package/lib/utils/SimpleMap.js +1 -1
  262. package/lib/utils/api.js +1 -1
  263. package/lib/utils/attachmentAdpator.js +1 -1
  264. package/lib/utils/autobind.js +1 -1
  265. package/lib/utils/columnsSplit.js +1 -1
  266. package/lib/utils/dataMapping.js +1 -1
  267. package/lib/utils/date.js +1 -1
  268. package/lib/utils/debug.js +8 -2
  269. package/lib/utils/dom.js +1 -1
  270. package/lib/utils/errors.js +1 -1
  271. package/lib/utils/escapeHtml.js +1 -1
  272. package/lib/utils/filter-schema.js +1 -1
  273. package/lib/utils/filter.js +1 -1
  274. package/lib/utils/formatDuration.js +1 -1
  275. package/lib/utils/formula.js +1 -1
  276. package/lib/utils/getVariable.js +1 -1
  277. package/lib/utils/grammar.js +1 -1
  278. package/lib/utils/handleAction.js +1 -1
  279. package/lib/utils/helper.d.ts +1 -1
  280. package/lib/utils/helper.js +6 -4
  281. package/lib/utils/highlight.js +1 -1
  282. package/lib/utils/icon.js +1 -1
  283. package/lib/utils/image.js +1 -1
  284. package/lib/utils/isPureVariable.js +14 -4
  285. package/lib/utils/json-schema-2-amis-schema.js +1 -1
  286. package/lib/utils/keyToPath.js +1 -1
  287. package/lib/utils/makeSorter.js +1 -1
  288. package/lib/utils/normalizeLink.js +1 -1
  289. package/lib/utils/normalizeOptions.js +1 -1
  290. package/lib/utils/object.js +1 -1
  291. package/lib/utils/offset.js +1 -1
  292. package/lib/utils/offsetParent.js +1 -1
  293. package/lib/utils/optionValueCompare.js +1 -1
  294. package/lib/utils/position.js +1 -1
  295. package/lib/utils/prettyBytes.js +1 -1
  296. package/lib/utils/renderer-event.js +1 -1
  297. package/lib/utils/replaceText.js +1 -1
  298. package/lib/utils/resize-sensor.js +1 -1
  299. package/lib/utils/resolveVariable.js +1 -1
  300. package/lib/utils/resolveVariableAndFilter.js +1 -1
  301. package/lib/utils/scrollPosition.js +1 -1
  302. package/lib/utils/string2regExp.js +1 -1
  303. package/lib/utils/stripNumber.js +1 -1
  304. package/lib/utils/style.js +1 -1
  305. package/lib/utils/tokenize.js +1 -1
  306. package/lib/utils/tpl-builtin.js +1 -1
  307. package/lib/utils/tpl-lodash.js +1 -1
  308. package/lib/utils/tpl.js +1 -1
  309. package/lib/utils/uncontrollable.js +1 -1
  310. package/lib/utils/validations.js +1 -1
  311. package/package.json +4 -2
package/esm/Root.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -55,8 +55,9 @@ var Root = /** @class */ (function (_super) {
55
55
  }(React.Component));
56
56
  function renderChildren(prefix, node, props) {
57
57
  if (Array.isArray(node)) {
58
+ var elemKey = props.key || props.propKey || props.id || '';
58
59
  return node.map(function (node, index) {
59
- return renderChild("".concat(prefix, "/").concat(index), node, __assign(__assign({}, props), { key: "".concat(props.key ? "".concat(props.key, "-") : '').concat(index) }));
60
+ return renderChild("".concat(prefix, "/").concat(index), node, __assign(__assign({}, props), { key: "".concat(elemKey ? "".concat(elemKey, "-") : '').concat(index) }));
60
61
  });
61
62
  }
62
63
  return renderChild(prefix, node, props);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
package/esm/Scoped.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
package/esm/WithStore.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -0,0 +1,8 @@
1
+ /**
2
+ * amis-core v2.0.0
3
+ * Copyright 2018-2022 fex
4
+ */
5
+
6
+ var propTypes = {exports: {}};
7
+
8
+ export { propTypes as p };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * amis-core v2.0.0
3
+ * Copyright 2018-2022 fex
4
+ */
5
+
6
+ var reactIs = {exports: {}};
7
+
8
+ export { reactIs as r };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * amis-core v2.0.0
3
+ * Copyright 2018-2022 fex
4
+ */
5
+
6
+ var reactIs_development = {};
7
+
8
+ export { reactIs_development as __exports };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * amis-core v2.0.0
3
+ * Copyright 2018-2022 fex
4
+ */
5
+
6
+ var reactIs_production_min = {};
7
+
8
+ export { reactIs_production_min as __exports };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -8,7 +8,7 @@ import '../utils/helper.js';
8
8
  import { evalExpression } from '../utils/tpl.js';
9
9
  import 'amis-formula';
10
10
  import 'moment';
11
- import { extendObject } from '../utils/object.js';
11
+ import { createObject } from '../utils/object.js';
12
12
  import { dataMapping } from '../utils/dataMapping.js';
13
13
  import '../utils/filter.js';
14
14
 
@@ -80,9 +80,13 @@ var runAction = function (actionInstrance, actionConfig, renderer, event) { retu
80
80
  return __generator(this, function (_b) {
81
81
  switch (_b.label) {
82
82
  case 0:
83
- mergeData = extendObject(renderer.props.data, {
84
- event: event
85
- });
83
+ mergeData = renderer.props.data.__super
84
+ ? createObject(createObject(renderer.props.data.__super, {
85
+ event: event
86
+ }), renderer.props.data)
87
+ : createObject({
88
+ event: event
89
+ }, renderer.props.data);
86
90
  expression = (_a = actionConfig.expression) !== null && _a !== void 0 ? _a : actionConfig.execOn;
87
91
  if (expression && !evalExpression(expression, mergeData)) {
88
92
  return [2 /*return*/];
@@ -21,5 +21,7 @@ export interface IAjaxAction extends ListenerAction {
21
21
  * @implements {Action}
22
22
  */
23
23
  export declare class AjaxAction implements RendererAction {
24
+ fetcherType: string;
25
+ constructor(fetcherType?: string);
24
26
  run(action: IAjaxAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<any>;
25
27
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -19,39 +19,46 @@ import { createObject } from '../utils/object.js';
19
19
  * @implements {Action}
20
20
  */
21
21
  var AjaxAction = /** @class */ (function () {
22
- function AjaxAction() {
22
+ function AjaxAction(fetcherType) {
23
+ if (fetcherType === void 0) { fetcherType = 'ajax'; }
24
+ this.fetcherType = fetcherType;
23
25
  }
24
26
  AjaxAction.prototype.run = function (action, renderer, event) {
25
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
27
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
26
28
  return __awaiter(this, void 0, void 0, function () {
27
29
  var env, result, responseData, msg, e_1, result;
28
- var _m;
29
- return __generator(this, function (_o) {
30
- switch (_o.label) {
30
+ var _o;
31
+ return __generator(this, function (_p) {
32
+ switch (_p.label) {
31
33
  case 0:
32
34
  if (!((_a = renderer.props.env) === null || _a === void 0 ? void 0 : _a.fetcher)) {
33
35
  throw new Error('env.fetcher is required!');
34
36
  }
37
+ if (this.fetcherType === 'download' && action.actionType === 'download') {
38
+ if ((_b = action.args) === null || _b === void 0 ? void 0 : _b.api) {
39
+ action.args.api.responseType = 'blob';
40
+ }
41
+ }
35
42
  env = event.context.env;
36
- _o.label = 1;
43
+ _p.label = 1;
37
44
  case 1:
38
- _o.trys.push([1, 3, , 4]);
39
- return [4 /*yield*/, env.fetcher((_b = action.args) === null || _b === void 0 ? void 0 : _b.api, omit((_c = action.args) !== null && _c !== void 0 ? _c : {}, ['api', 'options', 'messages']), (_e = (_d = action.args) === null || _d === void 0 ? void 0 : _d.options) !== null && _e !== void 0 ? _e : {})];
45
+ _p.trys.push([1, 3, , 4]);
46
+ return [4 /*yield*/, env.fetcher((_c = action.args) === null || _c === void 0 ? void 0 : _c.api, omit((_d = action.args) !== null && _d !== void 0 ? _d : {}, ['api', 'options', 'messages']), (_f = (_e = action.args) === null || _e === void 0 ? void 0 : _e.options) !== null && _f !== void 0 ? _f : {})];
40
47
  case 2:
41
- result = _o.sent();
48
+ result = _p.sent();
42
49
  if (!isEmpty(result.data) || result.ok) {
43
50
  responseData = normalizeApiResponseData(result.data);
44
51
  // 记录请求返回的数据
45
52
  event.setData(createObject(event.data, action.outputVar
46
- ? (_m = {},
47
- _m["".concat(action.outputVar)] = responseData,
48
- _m) : responseData));
53
+ ? (_o = {},
54
+ _o["".concat(action.outputVar)] = responseData,
55
+ _o) : responseData));
49
56
  }
50
57
  if (!result.ok) {
51
- throw new ServerError((_h = (_g = (_f = action.args) === null || _f === void 0 ? void 0 : _f.messages) === null || _g === void 0 ? void 0 : _g.failed) !== null && _h !== void 0 ? _h : result.msg, result);
58
+ throw new ServerError((_j = (_h = (_g = action.args) === null || _g === void 0 ? void 0 : _g.messages) === null || _h === void 0 ? void 0 : _h.failed) !== null && _j !== void 0 ? _j : result.msg, result);
52
59
  }
53
60
  else {
54
- msg = (_l = (_k = (_j = action.args) === null || _j === void 0 ? void 0 : _j.messages) === null || _k === void 0 ? void 0 : _k.success) !== null && _l !== void 0 ? _l : result.msg;
61
+ msg = (_m = (_l = (_k = action.args) === null || _k === void 0 ? void 0 : _k.messages) === null || _l === void 0 ? void 0 : _l.success) !== null && _m !== void 0 ? _m : result.msg;
55
62
  msg &&
56
63
  env.notify('success', msg, result.msgTimeout !== undefined
57
64
  ? {
@@ -62,7 +69,7 @@ var AjaxAction = /** @class */ (function () {
62
69
  }
63
70
  return [2 /*return*/, result.data];
64
71
  case 3:
65
- e_1 = _o.sent();
72
+ e_1 = _p.sent();
66
73
  if (e_1.type === 'ServerError') {
67
74
  result = e_1.response;
68
75
  env.notify('error', e_1.message, result.msgTimeout !== undefined
@@ -84,5 +91,6 @@ var AjaxAction = /** @class */ (function () {
84
91
  return AjaxAction;
85
92
  }());
86
93
  registerAction('ajax', new AjaxAction());
94
+ registerAction('download', new AjaxAction('download'));
87
95
 
88
96
  export { AjaxAction };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -15,7 +15,7 @@ export declare function rendererEventDispatcher<T extends FormControlProps, E =
15
15
  * @param ctx 上下文数据
16
16
  * @returns {Function}
17
17
  */
18
- export declare function bindRendererEvent<T extends FormControlProps, E = any>(event: E, ctx?: Record<string, any>): (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<any>) => {
18
+ export declare function bindRendererEvent<T extends FormControlProps, E = any>(event: E, ctx?: Record<string, any>, preventable?: boolean): (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<any>) => {
19
19
  value: (...params: any[]) => Promise<any>;
20
20
  enumerable?: boolean | undefined;
21
21
  configurable?: boolean | undefined;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -31,7 +31,8 @@ function rendererEventDispatcher(props, e, ctx) {
31
31
  * @param ctx 上下文数据
32
32
  * @returns {Function}
33
33
  */
34
- function bindRendererEvent(event, ctx) {
34
+ function bindRendererEvent(event, ctx, preventable) {
35
+ if (preventable === void 0) { preventable = true; }
35
36
  return function (target, propertyKey, descriptor) {
36
37
  var fn = descriptor.value && typeof descriptor.value === 'function'
37
38
  ? descriptor.value
@@ -57,15 +58,21 @@ function bindRendererEvent(event, ctx) {
57
58
  if (typeof event === 'string' && event === 'clear') {
58
59
  value = triggerProps === null || triggerProps === void 0 ? void 0 : triggerProps.resetValue;
59
60
  }
60
- return [4 /*yield*/, rendererEventDispatcher(triggerProps, event, {
61
- value: value
62
- })];
63
- case 1:
61
+ if (!(preventable === false)) return [3 /*break*/, 1];
62
+ rendererEventDispatcher(triggerProps, event, {
63
+ value: value
64
+ });
65
+ return [3 /*break*/, 3];
66
+ case 1: return [4 /*yield*/, rendererEventDispatcher(triggerProps, event, {
67
+ value: value
68
+ })];
69
+ case 2:
64
70
  dispatcher = _a.sent();
65
71
  if (dispatcher === null || dispatcher === void 0 ? void 0 : dispatcher.prevented) {
66
72
  return [2 /*return*/];
67
73
  }
68
- return [2 /*return*/, fn.apply(this, __spreadArray([], params, true))];
74
+ _a.label = 3;
75
+ case 3: return [2 /*return*/, fn.apply(this, __spreadArray([], params, true))];
69
76
  }
70
77
  });
71
78
  });
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.0.0-rc.9
2
+ * amis-core v2.0.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @file Overlay
3
+ * @description
4
+ * @author fex
5
+ */
6
+ import React from 'react';
7
+ interface OverlayProps {
8
+ placement?: string;
9
+ show?: boolean;
10
+ transition?: React.ElementType;
11
+ containerPadding?: number;
12
+ shouldUpdatePosition?: boolean;
13
+ rootClose?: boolean;
14
+ onHide?(props: any, ...args: any[]): any;
15
+ container?: React.ReactNode | Function;
16
+ target?: React.ReactNode | Function;
17
+ watchTargetSizeChange?: boolean;
18
+ offset?: [number, number];
19
+ onEnter?(node: HTMLElement): any;
20
+ onEntering?(node: HTMLElement): any;
21
+ onEntered?(node: HTMLElement): any;
22
+ onExit?(node: HTMLElement): any;
23
+ onExiting?(node: HTMLElement): any;
24
+ onExited?(node: HTMLElement): any;
25
+ }
26
+ interface OverlayState {
27
+ exited: boolean;
28
+ }
29
+ export default class Overlay extends React.Component<OverlayProps, OverlayState> {
30
+ static defaultProps: {
31
+ placement: string;
32
+ };
33
+ constructor(props: OverlayProps);
34
+ position: any;
35
+ positionRef: (position: any) => void;
36
+ updatePosition(): void;
37
+ componentDidUpdate(prevProps: OverlayProps): void;
38
+ onHiddenListener(node: HTMLElement): void;
39
+ render(): JSX.Element | null;
40
+ }
41
+ export {};