amis-core 2.9.0 → 3.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 (265) hide show
  1. package/esm/Root.js +1 -1
  2. package/esm/RootRenderer.js +1 -1
  3. package/esm/SchemaRenderer.d.ts +1 -0
  4. package/esm/SchemaRenderer.js +7 -5
  5. package/esm/Scoped.js +1 -1
  6. package/esm/WithRootStore.js +1 -1
  7. package/esm/WithStore.js +1 -1
  8. package/esm/actions/Action.js +8 -2
  9. package/esm/actions/AjaxAction.js +1 -1
  10. package/esm/actions/BreakAction.js +1 -1
  11. package/esm/actions/BroadcastAction.js +1 -1
  12. package/esm/actions/CmptAction.js +1 -1
  13. package/esm/actions/ContinueAction.js +1 -1
  14. package/esm/actions/CopyAction.js +1 -1
  15. package/esm/actions/CustomAction.js +1 -1
  16. package/esm/actions/DialogAction.js +5 -1
  17. package/esm/actions/DrawerAction.js +1 -1
  18. package/esm/actions/EmailAction.js +1 -1
  19. package/esm/actions/LinkAction.js +1 -1
  20. package/esm/actions/LoopAction.js +1 -1
  21. package/esm/actions/PageAction.js +1 -1
  22. package/esm/actions/ParallelAction.js +1 -1
  23. package/esm/actions/SwitchAction.js +1 -1
  24. package/esm/actions/ToastAction.js +1 -1
  25. package/esm/components/LazyComponent.js +1 -1
  26. package/esm/components/Overlay.d.ts +2 -2
  27. package/esm/components/Overlay.js +1 -1
  28. package/esm/components/PopOver.js +1 -1
  29. package/esm/env.js +1 -1
  30. package/esm/envOverwrite.js +1 -1
  31. package/esm/factory.d.ts +2 -1
  32. package/esm/factory.js +3 -3
  33. package/esm/index.d.ts +8 -3
  34. package/esm/index.js +10 -9
  35. package/esm/locale.js +1 -1
  36. package/esm/renderers/Form.d.ts +1 -1
  37. package/esm/renderers/Form.js +1 -1
  38. package/esm/renderers/Item.js +10 -7
  39. package/esm/renderers/Options.js +3 -3
  40. package/esm/renderers/Placeholder.js +1 -1
  41. package/esm/renderers/builtin.js +1 -1
  42. package/esm/renderers/register.js +1 -1
  43. package/esm/renderers/wrapControl.js +1 -1
  44. package/esm/store/app.js +1 -1
  45. package/esm/store/combo.js +1 -1
  46. package/esm/store/crud.js +22 -8
  47. package/esm/store/form.js +1 -1
  48. package/esm/store/formItem.js +2 -2
  49. package/esm/store/iRenderer.js +1 -1
  50. package/esm/store/index.js +1 -1
  51. package/esm/store/list.js +1 -1
  52. package/esm/store/manager.js +1 -1
  53. package/esm/store/modal.js +1 -1
  54. package/esm/store/node.js +1 -1
  55. package/esm/store/pagination.js +2 -2
  56. package/esm/store/root.js +1 -1
  57. package/esm/store/service.js +1 -1
  58. package/esm/store/table.d.ts +24 -23
  59. package/esm/store/table.js +17 -4
  60. package/esm/store/table2.d.ts +5 -5
  61. package/esm/store/table2.js +23 -19
  62. package/esm/theme.js +1 -1
  63. package/esm/types.d.ts +6 -0
  64. package/esm/utils/Animation.js +1 -1
  65. package/esm/utils/ColorScale.js +1 -1
  66. package/esm/utils/DataSchema.js +1 -1
  67. package/esm/utils/DataScope.js +1 -1
  68. package/esm/utils/RootClose.js +1 -1
  69. package/esm/utils/SimpleMap.js +1 -1
  70. package/esm/utils/api.js +9 -2
  71. package/esm/utils/attachmentAdpator.js +1 -1
  72. package/esm/utils/autobind.js +1 -1
  73. package/esm/utils/columnsSplit.js +1 -1
  74. package/esm/utils/dataMapping.js +1 -1
  75. package/esm/utils/date.js +1 -1
  76. package/esm/utils/debug.js +4 -4
  77. package/esm/utils/decodeEntity.js +1 -1
  78. package/esm/utils/dom.d.ts +2 -0
  79. package/esm/utils/dom.js +47 -10
  80. package/esm/utils/errors.js +1 -1
  81. package/esm/utils/escapeHtml.js +1 -1
  82. package/esm/utils/filter-schema.js +1 -1
  83. package/esm/utils/filter.js +1 -1
  84. package/esm/utils/formatDuration.js +1 -1
  85. package/esm/utils/formula.js +2 -2
  86. package/esm/utils/getVariable.js +1 -1
  87. package/esm/utils/grammar.js +1 -1
  88. package/esm/utils/handleAction.js +1 -1
  89. package/esm/utils/helper.d.ts +7 -0
  90. package/esm/utils/helper.js +28 -3
  91. package/esm/utils/highlight.js +1 -1
  92. package/esm/utils/icon.d.ts +6 -1
  93. package/esm/utils/icon.js +6 -1
  94. package/esm/utils/image.js +1 -1
  95. package/esm/utils/isPureVariable.js +1 -1
  96. package/esm/utils/json-schema-2-amis-schema.js +1 -1
  97. package/esm/utils/keyToPath.js +1 -1
  98. package/esm/utils/makeSorter.js +1 -1
  99. package/esm/utils/normalizeLink.js +1 -1
  100. package/esm/utils/normalizeOptions.js +1 -1
  101. package/esm/utils/object.js +1 -1
  102. package/esm/utils/offset.js +1 -1
  103. package/esm/utils/offsetParent.js +1 -1
  104. package/esm/utils/optionValueCompare.js +1 -1
  105. package/esm/utils/position.js +1 -1
  106. package/esm/utils/prettyBytes.js +1 -1
  107. package/esm/utils/renderer-event.js +35 -32
  108. package/esm/utils/replaceText.js +1 -1
  109. package/esm/utils/resize-sensor.js +1 -1
  110. package/esm/utils/resolveCondition.d.ts +1 -0
  111. package/esm/utils/resolveCondition.js +19 -4
  112. package/esm/utils/resolveVariable.js +1 -1
  113. package/esm/utils/resolveVariableAndFilter.js +1 -1
  114. package/esm/utils/resolveVariableAndFilterForAsync.d.ts +6 -1
  115. package/esm/utils/resolveVariableAndFilterForAsync.js +20 -3
  116. package/esm/utils/scrollPosition.js +1 -1
  117. package/esm/utils/string2regExp.js +1 -1
  118. package/esm/utils/stripNumber.js +1 -1
  119. package/esm/utils/style-helper.d.ts +9 -4
  120. package/esm/utils/style-helper.js +81 -16
  121. package/esm/utils/style.js +2 -2
  122. package/esm/utils/toNumber.js +1 -1
  123. package/esm/utils/tokenize.d.ts +1 -0
  124. package/esm/utils/tokenize.js +34 -3
  125. package/esm/utils/tpl-builtin.d.ts +2 -1
  126. package/esm/utils/tpl-builtin.js +18 -3
  127. package/esm/utils/tpl-lodash.js +3 -2
  128. package/esm/utils/tpl.d.ts +2 -0
  129. package/esm/utils/tpl.js +24 -2
  130. package/esm/utils/uncontrollable.js +1 -1
  131. package/esm/utils/validations.d.ts +4 -1
  132. package/esm/utils/validations.js +27 -12
  133. package/lib/Root.js +1 -1
  134. package/lib/RootRenderer.js +1 -1
  135. package/lib/SchemaRenderer.d.ts +1 -0
  136. package/lib/SchemaRenderer.js +7 -4
  137. package/lib/Scoped.js +1 -1
  138. package/lib/WithRootStore.js +1 -1
  139. package/lib/WithStore.js +1 -1
  140. package/lib/actions/Action.js +8 -2
  141. package/lib/actions/AjaxAction.js +1 -1
  142. package/lib/actions/BreakAction.js +1 -1
  143. package/lib/actions/BroadcastAction.js +1 -1
  144. package/lib/actions/CmptAction.js +1 -1
  145. package/lib/actions/ContinueAction.js +1 -1
  146. package/lib/actions/CopyAction.js +1 -1
  147. package/lib/actions/CustomAction.js +1 -1
  148. package/lib/actions/DialogAction.js +5 -1
  149. package/lib/actions/DrawerAction.js +1 -1
  150. package/lib/actions/EmailAction.js +1 -1
  151. package/lib/actions/LinkAction.js +1 -1
  152. package/lib/actions/LoopAction.js +1 -1
  153. package/lib/actions/PageAction.js +1 -1
  154. package/lib/actions/ParallelAction.js +1 -1
  155. package/lib/actions/SwitchAction.js +1 -1
  156. package/lib/actions/ToastAction.js +1 -1
  157. package/lib/components/LazyComponent.js +1 -1
  158. package/lib/components/Overlay.d.ts +2 -2
  159. package/lib/components/Overlay.js +1 -1
  160. package/lib/components/PopOver.js +1 -1
  161. package/lib/env.js +1 -1
  162. package/lib/envOverwrite.js +1 -1
  163. package/lib/factory.d.ts +2 -1
  164. package/lib/factory.js +3 -3
  165. package/lib/index.d.ts +8 -3
  166. package/lib/index.js +14 -2
  167. package/lib/locale.js +1 -1
  168. package/lib/renderers/Form.d.ts +1 -1
  169. package/lib/renderers/Form.js +1 -1
  170. package/lib/renderers/Item.js +10 -7
  171. package/lib/renderers/Options.js +3 -3
  172. package/lib/renderers/Placeholder.js +1 -1
  173. package/lib/renderers/builtin.js +1 -1
  174. package/lib/renderers/register.js +1 -1
  175. package/lib/renderers/wrapControl.js +1 -1
  176. package/lib/store/app.js +1 -1
  177. package/lib/store/combo.js +1 -1
  178. package/lib/store/crud.js +22 -8
  179. package/lib/store/form.js +1 -1
  180. package/lib/store/formItem.js +2 -2
  181. package/lib/store/iRenderer.js +1 -1
  182. package/lib/store/index.js +1 -1
  183. package/lib/store/list.js +1 -1
  184. package/lib/store/manager.js +1 -1
  185. package/lib/store/modal.js +1 -1
  186. package/lib/store/node.js +1 -1
  187. package/lib/store/pagination.js +2 -2
  188. package/lib/store/root.js +1 -1
  189. package/lib/store/service.js +1 -1
  190. package/lib/store/table.d.ts +24 -23
  191. package/lib/store/table.js +17 -4
  192. package/lib/store/table2.d.ts +5 -5
  193. package/lib/store/table2.js +23 -19
  194. package/lib/theme.js +1 -1
  195. package/lib/types.d.ts +6 -0
  196. package/lib/utils/Animation.js +1 -1
  197. package/lib/utils/ColorScale.js +1 -1
  198. package/lib/utils/DataSchema.js +1 -1
  199. package/lib/utils/DataScope.js +1 -1
  200. package/lib/utils/RootClose.js +1 -1
  201. package/lib/utils/SimpleMap.js +1 -1
  202. package/lib/utils/api.js +9 -2
  203. package/lib/utils/attachmentAdpator.js +1 -1
  204. package/lib/utils/autobind.js +1 -1
  205. package/lib/utils/columnsSplit.js +1 -1
  206. package/lib/utils/dataMapping.js +1 -1
  207. package/lib/utils/date.js +1 -1
  208. package/lib/utils/debug.js +4 -4
  209. package/lib/utils/decodeEntity.js +1 -1
  210. package/lib/utils/dom.d.ts +2 -0
  211. package/lib/utils/dom.js +48 -9
  212. package/lib/utils/errors.js +1 -1
  213. package/lib/utils/escapeHtml.js +1 -1
  214. package/lib/utils/filter-schema.js +1 -1
  215. package/lib/utils/filter.js +1 -1
  216. package/lib/utils/formatDuration.js +1 -1
  217. package/lib/utils/formula.js +2 -2
  218. package/lib/utils/getVariable.js +1 -1
  219. package/lib/utils/grammar.js +1 -1
  220. package/lib/utils/handleAction.js +1 -1
  221. package/lib/utils/helper.d.ts +7 -0
  222. package/lib/utils/helper.js +29 -2
  223. package/lib/utils/highlight.js +1 -1
  224. package/lib/utils/icon.d.ts +6 -1
  225. package/lib/utils/icon.js +6 -1
  226. package/lib/utils/image.js +1 -1
  227. package/lib/utils/isPureVariable.js +1 -1
  228. package/lib/utils/json-schema-2-amis-schema.js +1 -1
  229. package/lib/utils/keyToPath.js +1 -1
  230. package/lib/utils/makeSorter.js +1 -1
  231. package/lib/utils/normalizeLink.js +1 -1
  232. package/lib/utils/normalizeOptions.js +1 -1
  233. package/lib/utils/object.js +1 -1
  234. package/lib/utils/offset.js +1 -1
  235. package/lib/utils/offsetParent.js +1 -1
  236. package/lib/utils/optionValueCompare.js +1 -1
  237. package/lib/utils/position.js +1 -1
  238. package/lib/utils/prettyBytes.js +1 -1
  239. package/lib/utils/renderer-event.js +35 -32
  240. package/lib/utils/replaceText.js +1 -1
  241. package/lib/utils/resize-sensor.js +1 -1
  242. package/lib/utils/resolveCondition.d.ts +1 -0
  243. package/lib/utils/resolveCondition.js +19 -3
  244. package/lib/utils/resolveVariable.js +1 -1
  245. package/lib/utils/resolveVariableAndFilter.js +1 -1
  246. package/lib/utils/resolveVariableAndFilterForAsync.d.ts +6 -1
  247. package/lib/utils/resolveVariableAndFilterForAsync.js +20 -2
  248. package/lib/utils/scrollPosition.js +1 -1
  249. package/lib/utils/string2regExp.js +1 -1
  250. package/lib/utils/stripNumber.js +1 -1
  251. package/lib/utils/style-helper.d.ts +9 -4
  252. package/lib/utils/style-helper.js +86 -15
  253. package/lib/utils/style.js +2 -2
  254. package/lib/utils/toNumber.js +1 -1
  255. package/lib/utils/tokenize.d.ts +1 -0
  256. package/lib/utils/tokenize.js +33 -1
  257. package/lib/utils/tpl-builtin.d.ts +2 -1
  258. package/lib/utils/tpl-builtin.js +17 -2
  259. package/lib/utils/tpl-lodash.js +3 -2
  260. package/lib/utils/tpl.d.ts +2 -0
  261. package/lib/utils/tpl.js +24 -1
  262. package/lib/utils/uncontrollable.js +1 -1
  263. package/lib/utils/validations.d.ts +4 -1
  264. package/lib/utils/validations.js +27 -12
  265. package/package.json +3 -3
package/esm/Root.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -8,6 +8,7 @@ interface SchemaRendererProps extends Partial<RendererProps> {
8
8
  $path: string;
9
9
  env: RendererEnv;
10
10
  }
11
+ export declare const RENDERER_TRANSMISSION_OMIT_PROPS: string[];
11
12
  export declare class SchemaRenderer extends React.Component<SchemaRendererProps, any> {
12
13
  static displayName: string;
13
14
  static contextType: React.Context<IScopedContext>;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -25,7 +25,7 @@ import { resolveVariableAndFilter } from './utils/resolveVariableAndFilter.js';
25
25
  import './utils/filter.js';
26
26
  import { buildStyle } from './utils/style.js';
27
27
 
28
- var defaultOmitList = [
28
+ var RENDERER_TRANSMISSION_OMIT_PROPS = [
29
29
  'type',
30
30
  'name',
31
31
  '$ref',
@@ -50,7 +50,9 @@ var defaultOmitList = [
50
50
  'mode',
51
51
  'body',
52
52
  'id',
53
- 'inputOnly'
53
+ 'inputOnly',
54
+ 'label',
55
+ 'renderLabel'
54
56
  ];
55
57
  var componentCache = new SimpleMap();
56
58
  var SchemaRenderer = /** @class */ (function (_super) {
@@ -168,7 +170,7 @@ var SchemaRenderer = /** @class */ (function (_super) {
168
170
  if (subProps === void 0) { subProps = {}; }
169
171
  var _a = this.props; _a.schema; _a.$path; var env = _a.env, render = _a.render, rest = __rest(_a, ["schema", "$path", "env", "render"]);
170
172
  var $path = this.resolveRenderer(this.props).path;
171
- var omitList = defaultOmitList.concat();
173
+ var omitList = RENDERER_TRANSMISSION_OMIT_PROPS.concat();
172
174
  if (this.renderer) {
173
175
  var Component = this.renderer.component;
174
176
  Component.propsList &&
@@ -341,4 +343,4 @@ var PlaceholderComponent = /** @class */ (function (_super) {
341
343
  return PlaceholderComponent;
342
344
  }(React.Component));
343
345
 
344
- export { SchemaRenderer };
346
+ export { RENDERER_TRANSMISSION_OMIT_PROPS, SchemaRenderer };
package/esm/Scoped.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
package/esm/WithStore.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -198,7 +198,13 @@ var runAction = function (actionInstrance, actionConfig, renderer, event) { retu
198
198
  _d.label = 6;
199
199
  case 6:
200
200
  args = dataMapping(actionConfig.args, mergeData, function (key) {
201
- return ['adaptor', 'responseAdaptor', 'requestAdaptor', 'responseData'].includes(key);
201
+ return [
202
+ 'adaptor',
203
+ 'responseAdaptor',
204
+ 'requestAdaptor',
205
+ 'responseData',
206
+ 'condition'
207
+ ].includes(key);
202
208
  });
203
209
  afterMappingData = dataMapping(actionConfig.data, mergeData);
204
210
  actionData = args && Object.keys(args).length
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -20,6 +20,10 @@ var DialogAction = /** @class */ (function () {
20
20
  var _a, _b, _c;
21
21
  return __awaiter(this, void 0, void 0, function () {
22
22
  return __generator(this, function (_d) {
23
+ // 防止editor preview模式下执行
24
+ if (action.$$id !== undefined) {
25
+ return [2 /*return*/];
26
+ }
23
27
  (_b = (_a = renderer.props).onAction) === null || _b === void 0 ? void 0 : _b.call(_a, event, {
24
28
  actionType: 'dialog',
25
29
  dialog: ((_c = action.args) === null || _c === void 0 ? void 0 : _c.dialog) || action.dialog,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -13,9 +13,9 @@ interface OverlayProps {
13
13
  shouldUpdatePosition?: boolean;
14
14
  rootClose?: boolean;
15
15
  onHide?(props: any, ...args: any[]): any;
16
- container?: HTMLElement | (() => HTMLElement | null | undefined);
16
+ container?: HTMLElement | React.ReactNode | (() => HTMLElement | React.ReactNode | null | undefined);
17
17
  containerSelector?: string;
18
- target?: React.ReactNode | Function;
18
+ target?: React.ReactNode | HTMLElement | Function;
19
19
  watchTargetSizeChange?: boolean;
20
20
  offset?: [number, number];
21
21
  onEnter?(node: HTMLElement): any;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
package/esm/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
package/esm/factory.d.ts CHANGED
@@ -4,7 +4,7 @@ import { fetcherResult, SchemaNode, Schema, PlainObject } from './types';
4
4
  import { ThemeProps } from './theme';
5
5
  import { LocaleProps } from './locale';
6
6
  import type { RendererEnv } from './env';
7
- import { OnEventProps } from './utils/renderer-event';
7
+ import { OnEventProps, RendererEvent } from './utils/renderer-event';
8
8
  export interface TestFunc {
9
9
  (path: string, schema?: Schema, resolveRenderer?: (path: string, schema?: Schema, props?: any) => null | RendererConfig): boolean;
10
10
  }
@@ -35,6 +35,7 @@ export interface RendererProps extends ThemeProps, LocaleProps, OnEventProps {
35
35
  style?: {
36
36
  [propName: string]: any;
37
37
  };
38
+ onBroadcast?: (type: string, rawEvent: RendererEvent<any>, ctx: any) => any;
38
39
  [propName: string]: any;
39
40
  }
40
41
  export type RendererComponent = React.ComponentType<RendererProps> & {
package/esm/factory.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -138,11 +138,11 @@ var defaultOptions = {
138
138
  }
139
139
  },
140
140
  isCancel: function () {
141
- console.error('Please implement isCancel. see https://baidu.gitee.io/amis/docs/start/getting-started#%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97');
141
+ console.error('Please implement isCancel. see https://aisuda.bce.baidu.com/amis/zh-CN/start/getting-started#%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97');
142
142
  return false;
143
143
  },
144
144
  updateLocation: function () {
145
- console.error('Please implement updateLocation. see https://baidu.gitee.io/amis/docs/start/getting-started#%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97');
145
+ console.error('Please implement updateLocation. see https://aisuda.bce.baidu.com/amis/zh-CN/start/getting-started#%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97');
146
146
  },
147
147
  jumpTo: function (to, action) {
148
148
  if (to === 'goBack') {
package/esm/index.d.ts CHANGED
@@ -14,10 +14,11 @@ export * from './types';
14
14
  export * from './store';
15
15
  import * as utils from './utils/helper';
16
16
  import { RegisterStore } from './store';
17
+ import type { IColumn, IColumn2, IRow, IRow2 } from './store';
17
18
  import { setDefaultLocale, getDefaultLocale, makeTranslator, register as registerLocale, extendLocale, removeLocaleData, localeable } from './locale';
18
19
  import type { LocaleProps, TranslateFn } from './locale';
19
20
  import Scoped, { ScopedContext } from './Scoped';
20
- import type { IScopedContext } from './Scoped';
21
+ import type { ScopedComponentType, IScopedContext } from './Scoped';
21
22
  import { classnames, getClassPrefix, setDefaultTheme, theme, getTheme, themeable, makeClassnames } from './theme';
22
23
  import type { ClassNamesFn, ThemeProps } from './theme';
23
24
  declare const classPrefix: string | undefined;
@@ -37,7 +38,11 @@ import LazyComponent from './components/LazyComponent';
37
38
  import Overlay from './components/Overlay';
38
39
  import PopOver from './components/PopOver';
39
40
  import { FormRenderer } from './renderers/Form';
40
- import type { FormHorizontal } from './renderers/Form';
41
+ import type { FormHorizontal, FormSchemaBase } from './renderers/Form';
42
+ import type { OnEventProps } from './utils/index';
43
+ import { valueMap as styleMap } from './utils/style-helper';
44
+ import { RENDERER_TRANSMISSION_OMIT_PROPS } from './SchemaRenderer';
45
+ import type { IItem } from './store/list';
41
46
  export declare const version = "__buildVersion";
42
- export { clearStoresCache, updateEnv, Renderer, RendererProps, RenderOptions, RendererEnv, EnvContext, RegisterStore, FormItem, FormItemWrap, FormItemProps, OptionsControl, FormRenderer, FormHorizontal, utils, getRendererByName, registerRenderer, unRegisterRenderer, getRenderers, registerFormItem, getFormItemByName, registerOptionsControl, resolveRenderer, filterSchema, Scoped, ScopedContext, IScopedContext, setDefaultTheme, theme, themeable, ThemeProps, getTheme, classPrefix, getClassPrefix, classnames, makeClassnames, getDefaultLocale, setDefaultLocale, registerLocale, makeTranslator, extendLocale, removeLocaleData, localeable, LocaleProps, TranslateFn, ClassNamesFn, parse, lexer, Evaluator, AsyncEvaluator, FilterContext, filters, getFilters, registerFilter, extendsFilters, registerFunction, evaluate, evaluateForAsync, LazyComponent, Overlay, PopOver, addSchemaFilter, OptionsControlProps, FormOptionsControl, FormControlProps, FormBaseControl, extendDefaultEnv, addRootWrapper, RendererConfig };
47
+ export { clearStoresCache, updateEnv, Renderer, RendererProps, RenderOptions, RendererEnv, EnvContext, RegisterStore, FormItem, FormItemWrap, FormItemProps, OptionsControl, FormRenderer, FormHorizontal, utils, getRendererByName, registerRenderer, unRegisterRenderer, getRenderers, registerFormItem, getFormItemByName, registerOptionsControl, resolveRenderer, filterSchema, Scoped, ScopedContext, IScopedContext, setDefaultTheme, theme, themeable, ThemeProps, getTheme, classPrefix, getClassPrefix, classnames, makeClassnames, getDefaultLocale, setDefaultLocale, registerLocale, makeTranslator, extendLocale, removeLocaleData, localeable, LocaleProps, TranslateFn, ClassNamesFn, parse, lexer, Evaluator, AsyncEvaluator, FilterContext, filters, getFilters, registerFilter, extendsFilters, registerFunction, evaluate, evaluateForAsync, LazyComponent, Overlay, PopOver, addSchemaFilter, OptionsControlProps, FormOptionsControl, FormControlProps, FormBaseControl, extendDefaultEnv, addRootWrapper, RendererConfig, styleMap, RENDERER_TRANSMISSION_OMIT_PROPS, ScopedComponentType, IItem, IColumn, IRow, IColumn2, IRow2, OnEventProps, FormSchemaBase };
43
48
  export declare function render(schema: Schema, props?: RootRenderProps, options?: RenderOptions, pathPrefix?: string): JSX.Element;
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -20,7 +20,7 @@ export { DataScope } from './utils/DataScope.js';
20
20
  export { filterDate, parseDuration, relativeValueRe } from './utils/date.js';
21
21
  import { enableDebug } from './utils/debug.js';
22
22
  export { DebugWrapper, debug, enableDebug, warning } from './utils/debug.js';
23
- export { calculatePosition, getContainer, getStyleNumber, ownerDocument } from './utils/dom.js';
23
+ export { calculatePosition, getContainer, getStyleNumber, ownerDocument, renderTextByKeyword } from './utils/dom.js';
24
24
  export { ServerError } from './utils/errors.js';
25
25
  export { escapeHtml } from './utils/escapeHtml.js';
26
26
  export { getExprProperties } from './utils/filter-schema.js';
@@ -33,7 +33,7 @@ export { handleAction } from './utils/handleAction.js';
33
33
  import { promisify } from './utils/helper.js';
34
34
  import * as helper from './utils/helper.js';
35
35
  export { helper as utils };
36
- export { JSONTraverse, SkipOperation, __uri, anyChanged, autobind, bulkBindFunctions, camel, chainEvents, chainFunctions, convertArrayValueToMoment, detectPropValueChanged, difference, eachTree, everyTree, filterTree, findIndex, findObjectsWithKey, findTree, 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, 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';
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
37
  export { highlight } from './utils/highlight.js';
38
38
  export { generateIcon } from './utils/icon.js';
39
39
  export { getImageDimensions, toDataURL } from './utils/image.js';
@@ -55,21 +55,21 @@ export { replaceText } from './utils/replaceText.js';
55
55
  export { getComputedStyle, resizeSensor } from './utils/resize-sensor.js';
56
56
  export { resolveVariable } from './utils/resolveVariable.js';
57
57
  export { resolveVariableAndFilter } from './utils/resolveVariableAndFilter.js';
58
- export { resolveVariableAndFilterForAsync } from './utils/resolveVariableAndFilterForAsync.js';
58
+ export { resolveVariableAndFilterForAsync, setFormulaEvalErrorHandler } from './utils/resolveVariableAndFilterForAsync.js';
59
59
  export { RootClose } from './utils/RootClose.js';
60
60
  export { scrollPosition } from './utils/scrollPosition.js';
61
61
  export { SimpleMap } from './utils/SimpleMap.js';
62
62
  export { string2regExp } from './utils/string2regExp.js';
63
63
  export { buildStyle } from './utils/style.js';
64
- export { tokenize } from './utils/tokenize.js';
64
+ export { asyncTokenize, tokenize } from './utils/tokenize.js';
65
65
  export { register } from './utils/tpl-builtin.js';
66
- export { evalExpression, evalExpressionWithConditionBuilder, evalJS, filter, registerTplEnginer, setCustomEvalExpression, setCustomEvalJs } from './utils/tpl.js';
66
+ export { asyncFilter, evalExpression, evalExpressionWithConditionBuilder, evalJS, filter, registerTplEnginer, setCustomEvalExpression, setCustomEvalJs } from './utils/tpl.js';
67
67
  export { uncontrollable } from './utils/uncontrollable.js';
68
68
  export { addRule, str2rules, validate, validateMessages, validateObject, validations } from './utils/validations.js';
69
69
  export { toNumber } from './utils/toNumber.js';
70
70
  export { decodeEntity } from './utils/decodeEntity.js';
71
- export { addStyle, findOrCreactStyle, formatStyle, insertCustomStyle, insertStyle, valueMap } from './utils/style-helper.js';
72
- export { getConditionComputers, registerConditionComputer, resolveCondition } from './utils/resolveCondition.js';
71
+ export { addStyle, findOrCreactStyle, formatStyle, getValueByPath, inheritValueMap, insertCustomStyle, insertStyle, valueMap as styleMap, valueMap } from './utils/style-helper.js';
72
+ export { getConditionComputers, registerConditionComputer, resolveCondition, setConditionComputeErrorHandler } from './utils/resolveCondition.js';
73
73
  export { default as animation } from './utils/Animation.js';
74
74
  import { RendererStore } from './store/index.js';
75
75
  export { RegisterStore, RendererStore } from './store/index.js';
@@ -109,6 +109,7 @@ export { default as LazyComponent } from './components/LazyComponent.js';
109
109
  export { default as Overlay } from './components/Overlay.js';
110
110
  export { default as PopOver } from './components/PopOver.js';
111
111
  export { FormRenderer } from './renderers/Form.js';
112
+ export { RENDERER_TRANSMISSION_OMIT_PROPS } from './SchemaRenderer.js';
112
113
  export { stripNumber } from './utils/stripNumber.js';
113
114
  export { iRendererStore } from './store/iRenderer.js';
114
115
  export { ServiceStore } from './store/service.js';
@@ -133,7 +134,7 @@ export { StoreNode } from './store/node.js';
133
134
  */
134
135
  var classPrefix = getClassPrefix();
135
136
  // @ts-ignore
136
- var version = '2.9.0';
137
+ var version = '3.0.0';
137
138
  function render(schema, props, options, pathPrefix) {
138
139
  if (props === void 0) { props = {}; }
139
140
  if (options === void 0) { options = {}; }
package/esm/locale.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -120,7 +120,7 @@ export interface FormSchemaBase {
120
120
  /**
121
121
  * Form 用来保存数据的 api。
122
122
  *
123
- * 详情:https://baidu.gitee.io/amis/docs/components/form/index#%E8%A1%A8%E5%8D%95%E6%8F%90%E4%BA%A4
123
+ * 详情:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/index#%E8%A1%A8%E5%8D%95%E6%8F%90%E4%BA%A4
124
124
  */
125
125
  api?: string | BaseApiObject;
126
126
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -334,7 +334,8 @@ var FormItemWrap = /** @class */ (function (_super) {
334
334
  var controlSize = size || defaultSize;
335
335
  return renderControl(__assign(__assign({}, rest), { onOpenDialog: this.handleOpenDialog, type: type, classnames: cx, formItem: model, className: cx("Form-control", (_a = {
336
336
  'is-inline': !!rest.inline && !mobileUI,
337
- 'is-error': model && !model.valid
337
+ 'is-error': model && !model.valid,
338
+ 'is-full': size === 'full'
338
339
  },
339
340
  _a["Form-control--withSize Form-control--size".concat(ucFirst(controlSize))] = sizeMutable !== false &&
340
341
  typeof controlSize === 'string' &&
@@ -345,15 +346,15 @@ var FormItemWrap = /** @class */ (function (_super) {
345
346
  return null;
346
347
  };
347
348
  FormItemWrap.prototype.render = function () {
348
- var _a = this.props, formMode = _a.formMode, inputOnly = _a.inputOnly, wrap = _a.wrap, render = _a.render, model = _a.formItem, css = _a.css, id = _a.id, labelClassName = _a.labelClassName, descriptionClassName = _a.descriptionClassName;
349
+ var _a = this.props, formMode = _a.formMode, inputOnly = _a.inputOnly, wrap = _a.wrap, render = _a.render, model = _a.formItem, css = _a.css, themeCss = _a.themeCss, id = _a.id, labelClassName = _a.labelClassName, descriptionClassName = _a.descriptionClassName;
349
350
  var mode = this.props.mode || formMode;
350
- insertCustomStyle(css, [
351
+ insertCustomStyle(themeCss || css, [
351
352
  {
352
353
  key: 'labelClassName',
353
354
  value: labelClassName
354
355
  }
355
356
  ], id + '-label');
356
- insertCustomStyle(css, [
357
+ insertCustomStyle(themeCss || css, [
357
358
  {
358
359
  key: 'descriptionClassName',
359
360
  value: descriptionClassName
@@ -767,7 +768,8 @@ var detectProps = [
767
768
  'embed',
768
769
  'displayMode',
769
770
  'revealPassword',
770
- 'loading'
771
+ 'loading',
772
+ 'themeCss'
771
773
  ];
772
774
  function asFormItem(config) {
773
775
  return function (Control) {
@@ -838,7 +840,8 @@ function asFormItem(config) {
838
840
  return (React.createElement(React.Fragment, null,
839
841
  React.createElement(Control, __assign({}, rest, { useMobileUI: useMobileUI, onOpenDialog: this.handleOpenDialog, size: config.sizeMutable !== false ? undefined : size, onFocus: this.handleFocus, onBlur: this.handleBlur, type: type, classnames: cx, ref: isSFC ? undefined : this.refFn, forwardedRef: isSFC ? this.refFn : undefined, formItem: model, className: cx("Form-control", (_a = {
840
842
  'is-inline': !!rest.inline && !mobileUI,
841
- 'is-error': model && !model.valid
843
+ 'is-error': model && !model.valid,
844
+ 'is-full': size === 'full'
842
845
  },
843
846
  _a["Form-control--withSize Form-control--size".concat(ucFirst(controlSize))] = config.sizeMutable !== false &&
844
847
  typeof controlSize === 'string' &&
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -183,8 +183,8 @@ function registerOptionsControl(config) {
183
183
  switch (_b.label) {
184
184
  case 0:
185
185
  _a = this.props, dispatchEvent = _a.dispatchEvent, options = _a.options;
186
- return [4 /*yield*/, dispatchEvent(eventName, resolveEventData(this.props, { value: eventData, options: options, items: options }, // 为了保持名字统一
187
- 'value'))];
186
+ return [4 /*yield*/, dispatchEvent(eventName, resolveEventData(this.props, { value: eventData, options: options, items: options } // 为了保持名字统一
187
+ ))];
188
188
  case 1:
189
189
  rendererEvent = _b.sent();
190
190
  // 返回阻塞标识
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
package/esm/store/app.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.9.0
2
+ * amis-core v3.0.0
3
3
  * Copyright 2018-2023 fex
4
4
  */
5
5