amis-core 2.3.2-beta.1 → 2.4.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 (313) hide show
  1. package/esm/Root.js +1 -1
  2. package/esm/RootRenderer.js +1 -1
  3. package/esm/SchemaRenderer.js +10 -3
  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 +1 -1
  8. package/esm/actions/Action.d.ts +2 -1
  9. package/esm/actions/Action.js +90 -15
  10. package/esm/actions/AjaxAction.js +2 -3
  11. package/esm/actions/BreakAction.js +1 -1
  12. package/esm/actions/BroadcastAction.d.ts +4 -1
  13. package/esm/actions/BroadcastAction.js +8 -8
  14. package/esm/actions/CmptAction.d.ts +1 -1
  15. package/esm/actions/CmptAction.js +5 -2
  16. package/esm/actions/ContinueAction.js +1 -1
  17. package/esm/actions/CopyAction.js +1 -1
  18. package/esm/actions/CustomAction.d.ts +6 -1
  19. package/esm/actions/CustomAction.js +7 -7
  20. package/esm/actions/DialogAction.d.ts +4 -1
  21. package/esm/actions/DialogAction.js +9 -5
  22. package/esm/actions/DrawerAction.d.ts +4 -1
  23. package/esm/actions/DrawerAction.js +9 -5
  24. package/esm/actions/EmailAction.js +1 -1
  25. package/esm/actions/LinkAction.js +5 -6
  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.js +3 -2
  33. package/esm/components/PopOver.js +2 -3
  34. package/esm/env.js +1 -1
  35. package/esm/envOverwrite.js +1 -1
  36. package/esm/factory.d.ts +1 -1
  37. package/esm/factory.js +2 -2
  38. package/esm/index.d.ts +20 -9
  39. package/esm/index.js +5 -2
  40. package/esm/locale.js +1 -1
  41. package/esm/node_modules/@restart/hooks/esm/useCommittedRef.js +1 -1
  42. package/esm/node_modules/@restart/hooks/esm/useEventCallback.js +1 -1
  43. package/esm/node_modules/dom-helpers/esm/addEventListener.js +1 -1
  44. package/esm/node_modules/dom-helpers/esm/canUseDOM.js +1 -1
  45. package/esm/node_modules/dom-helpers/esm/contains.js +1 -1
  46. package/esm/node_modules/dom-helpers/esm/listen.js +1 -1
  47. package/esm/node_modules/dom-helpers/esm/ownerDocument.js +1 -1
  48. package/esm/node_modules/dom-helpers/esm/removeEventListener.js +1 -1
  49. package/esm/node_modules/prop-types/factoryWithThrowingShims.js +51 -60
  50. package/esm/node_modules/prop-types/index.js +4 -13
  51. package/esm/node_modules/prop-types/lib/ReactPropTypesSecret.js +4 -13
  52. package/esm/node_modules/react-overlays/esm/Portal.js +1 -1
  53. package/esm/node_modules/react-overlays/esm/ownerDocument.js +1 -1
  54. package/esm/node_modules/react-overlays/esm/safeFindDOMNode.js +1 -1
  55. package/esm/node_modules/react-overlays/esm/useRootClose.js +1 -3
  56. package/esm/node_modules/react-overlays/esm/useWaitForDOMRef.js +1 -1
  57. package/esm/renderers/Form.d.ts +7 -1
  58. package/esm/renderers/Form.js +17 -6
  59. package/esm/renderers/Item.d.ts +6 -6
  60. package/esm/renderers/Item.js +24 -16
  61. package/esm/renderers/Options.d.ts +1 -1
  62. package/esm/renderers/Options.js +2 -2
  63. package/esm/renderers/Placeholder.js +1 -1
  64. package/esm/renderers/builtin.js +1 -1
  65. package/esm/renderers/wrapControl.js +1 -1
  66. package/esm/store/app.js +1 -1
  67. package/esm/store/combo.js +1 -1
  68. package/esm/store/crud.js +1 -1
  69. package/esm/store/form.js +2 -2
  70. package/esm/store/formItem.js +1 -1
  71. package/esm/store/iRenderer.js +1 -1
  72. package/esm/store/index.d.ts +26 -13
  73. package/esm/store/index.js +2 -2
  74. package/esm/store/list.js +1 -1
  75. package/esm/store/manager.js +1 -1
  76. package/esm/store/modal.js +1 -1
  77. package/esm/store/node.js +1 -1
  78. package/esm/store/pagination.js +1 -1
  79. package/esm/store/root.d.ts +2 -0
  80. package/esm/store/root.js +10 -4
  81. package/esm/store/service.js +1 -1
  82. package/esm/store/table.js +1 -1
  83. package/esm/store/table2.js +1 -1
  84. package/esm/theme.js +1 -1
  85. package/esm/types.d.ts +27 -0
  86. package/esm/utils/Animation.js +1 -1
  87. package/esm/utils/ColorScale.js +1 -1
  88. package/esm/utils/DataSchema.js +1 -1
  89. package/esm/utils/DataScope.js +1 -1
  90. package/esm/utils/RootClose.js +1 -1
  91. package/esm/utils/SimpleMap.js +1 -1
  92. package/esm/utils/api.d.ts +1 -1
  93. package/esm/utils/api.js +17 -5
  94. package/esm/utils/attachmentAdpator.js +1 -1
  95. package/esm/utils/autobind.js +1 -1
  96. package/esm/utils/columnsSplit.js +1 -1
  97. package/esm/utils/dataMapping.js +1 -1
  98. package/esm/utils/date.js +1 -1
  99. package/esm/utils/debug.js +1 -1
  100. package/esm/utils/decodeEntity.d.ts +5 -0
  101. package/esm/utils/decodeEntity.js +16 -0
  102. package/esm/utils/dom.js +1 -1
  103. package/esm/utils/errors.js +1 -1
  104. package/esm/utils/escapeHtml.js +1 -1
  105. package/esm/utils/filter-schema.js +1 -1
  106. package/esm/utils/filter.js +7 -5
  107. package/esm/utils/formatDuration.js +1 -1
  108. package/esm/utils/formula.js +1 -1
  109. package/esm/utils/getVariable.js +1 -1
  110. package/esm/utils/grammar.js +1 -1
  111. package/esm/utils/handleAction.js +1 -1
  112. package/esm/utils/helper.js +6 -1
  113. package/esm/utils/highlight.js +1 -1
  114. package/esm/utils/icon.d.ts +5 -1
  115. package/esm/utils/icon.js +11 -1
  116. package/esm/utils/image.js +1 -1
  117. package/esm/utils/index.d.ts +1 -0
  118. package/esm/utils/isPureVariable.js +1 -1
  119. package/esm/utils/json-schema-2-amis-schema.js +1 -1
  120. package/esm/utils/keyToPath.js +1 -1
  121. package/esm/utils/makeSorter.js +1 -1
  122. package/esm/utils/normalizeLink.js +1 -1
  123. package/esm/utils/normalizeOptions.js +1 -1
  124. package/esm/utils/object.js +1 -1
  125. package/esm/utils/offset.js +1 -1
  126. package/esm/utils/offsetParent.js +1 -1
  127. package/esm/utils/optionValueCompare.js +1 -1
  128. package/esm/utils/position.js +1 -1
  129. package/esm/utils/prettyBytes.js +1 -1
  130. package/esm/utils/renderer-event.js +1 -1
  131. package/esm/utils/replaceText.js +1 -1
  132. package/esm/utils/resize-sensor.js +1 -1
  133. package/esm/utils/resolveVariable.js +1 -1
  134. package/esm/utils/resolveVariableAndFilter.js +1 -1
  135. package/esm/utils/scrollPosition.js +1 -1
  136. package/esm/utils/string2regExp.js +1 -1
  137. package/esm/utils/stripNumber.js +1 -1
  138. package/esm/utils/style.js +1 -1
  139. package/esm/utils/toNumber.js +1 -1
  140. package/esm/utils/tokenize.js +1 -1
  141. package/esm/utils/tpl-builtin.js +1 -1
  142. package/esm/utils/tpl-lodash.js +1 -1
  143. package/esm/utils/tpl.js +1 -1
  144. package/esm/utils/uncontrollable.js +1 -1
  145. package/esm/utils/validations.js +1 -1
  146. package/lib/Root.js +1 -1
  147. package/lib/RootRenderer.js +1 -1
  148. package/lib/SchemaRenderer.js +10 -3
  149. package/lib/Scoped.js +1 -1
  150. package/lib/WithRootStore.js +1 -1
  151. package/lib/WithStore.js +1 -1
  152. package/lib/_virtual/index.js +1 -1
  153. package/lib/actions/Action.d.ts +2 -1
  154. package/lib/actions/Action.js +94 -15
  155. package/lib/actions/AjaxAction.js +2 -7
  156. package/lib/actions/BreakAction.js +1 -1
  157. package/lib/actions/BroadcastAction.d.ts +4 -1
  158. package/lib/actions/BroadcastAction.js +8 -8
  159. package/lib/actions/CmptAction.d.ts +1 -1
  160. package/lib/actions/CmptAction.js +5 -2
  161. package/lib/actions/ContinueAction.js +1 -1
  162. package/lib/actions/CopyAction.js +1 -1
  163. package/lib/actions/CustomAction.d.ts +6 -1
  164. package/lib/actions/CustomAction.js +7 -7
  165. package/lib/actions/DialogAction.d.ts +4 -1
  166. package/lib/actions/DialogAction.js +9 -5
  167. package/lib/actions/DrawerAction.d.ts +4 -1
  168. package/lib/actions/DrawerAction.js +9 -5
  169. package/lib/actions/EmailAction.js +1 -1
  170. package/lib/actions/LinkAction.js +5 -10
  171. package/lib/actions/LoopAction.js +1 -1
  172. package/lib/actions/PageAction.js +1 -1
  173. package/lib/actions/ParallelAction.js +1 -1
  174. package/lib/actions/SwitchAction.js +1 -1
  175. package/lib/actions/ToastAction.js +1 -1
  176. package/lib/components/LazyComponent.js +1 -1
  177. package/lib/components/Overlay.js +3 -2
  178. package/lib/components/PopOver.js +2 -3
  179. package/lib/env.js +1 -1
  180. package/lib/envOverwrite.js +1 -1
  181. package/lib/factory.d.ts +1 -1
  182. package/lib/factory.js +2 -2
  183. package/lib/index.d.ts +20 -9
  184. package/lib/index.js +6 -1
  185. package/lib/locale.js +1 -1
  186. package/lib/node_modules/@restart/hooks/esm/useCommittedRef.js +1 -1
  187. package/lib/node_modules/@restart/hooks/esm/useEventCallback.js +1 -1
  188. package/lib/node_modules/dom-helpers/esm/addEventListener.js +1 -1
  189. package/lib/node_modules/dom-helpers/esm/canUseDOM.js +1 -1
  190. package/lib/node_modules/dom-helpers/esm/contains.js +1 -1
  191. package/lib/node_modules/dom-helpers/esm/listen.js +1 -1
  192. package/lib/node_modules/dom-helpers/esm/ownerDocument.js +1 -1
  193. package/lib/node_modules/dom-helpers/esm/removeEventListener.js +1 -1
  194. package/lib/node_modules/prop-types/factoryWithThrowingShims.js +51 -60
  195. package/lib/node_modules/prop-types/index.js +3 -12
  196. package/lib/node_modules/prop-types/lib/ReactPropTypesSecret.js +4 -13
  197. package/lib/node_modules/react-overlays/esm/Portal.js +1 -1
  198. package/lib/node_modules/react-overlays/esm/ownerDocument.js +1 -1
  199. package/lib/node_modules/react-overlays/esm/safeFindDOMNode.js +1 -1
  200. package/lib/node_modules/react-overlays/esm/useRootClose.js +1 -3
  201. package/lib/node_modules/react-overlays/esm/useWaitForDOMRef.js +1 -1
  202. package/lib/renderers/Form.d.ts +7 -1
  203. package/lib/renderers/Form.js +17 -6
  204. package/lib/renderers/Item.d.ts +6 -6
  205. package/lib/renderers/Item.js +24 -16
  206. package/lib/renderers/Options.d.ts +1 -1
  207. package/lib/renderers/Options.js +2 -2
  208. package/lib/renderers/Placeholder.js +1 -1
  209. package/lib/renderers/builtin.js +1 -1
  210. package/lib/renderers/wrapControl.js +1 -1
  211. package/lib/store/app.js +1 -1
  212. package/lib/store/combo.js +1 -1
  213. package/lib/store/crud.js +1 -1
  214. package/lib/store/form.js +2 -2
  215. package/lib/store/formItem.js +1 -1
  216. package/lib/store/iRenderer.js +1 -1
  217. package/lib/store/index.d.ts +26 -13
  218. package/lib/store/index.js +2 -2
  219. package/lib/store/list.js +1 -1
  220. package/lib/store/manager.js +1 -1
  221. package/lib/store/modal.js +1 -1
  222. package/lib/store/node.js +1 -1
  223. package/lib/store/pagination.js +1 -1
  224. package/lib/store/root.d.ts +2 -0
  225. package/lib/store/root.js +9 -3
  226. package/lib/store/service.js +1 -1
  227. package/lib/store/table.js +1 -1
  228. package/lib/store/table2.js +1 -1
  229. package/lib/theme.js +1 -1
  230. package/lib/types.d.ts +27 -0
  231. package/lib/utils/Animation.js +1 -1
  232. package/lib/utils/ColorScale.js +1 -1
  233. package/lib/utils/DataSchema.js +1 -1
  234. package/lib/utils/DataScope.js +1 -1
  235. package/lib/utils/RootClose.js +1 -1
  236. package/lib/utils/SimpleMap.js +1 -1
  237. package/lib/utils/api.d.ts +1 -1
  238. package/lib/utils/api.js +16 -4
  239. package/lib/utils/attachmentAdpator.js +1 -1
  240. package/lib/utils/autobind.js +1 -1
  241. package/lib/utils/columnsSplit.js +1 -1
  242. package/lib/utils/dataMapping.js +1 -1
  243. package/lib/utils/date.js +1 -1
  244. package/lib/utils/debug.js +1 -1
  245. package/lib/utils/decodeEntity.d.ts +5 -0
  246. package/lib/utils/decodeEntity.js +20 -0
  247. package/lib/utils/dom.js +1 -1
  248. package/lib/utils/errors.js +1 -1
  249. package/lib/utils/escapeHtml.js +1 -1
  250. package/lib/utils/filter-schema.js +1 -1
  251. package/lib/utils/filter.js +7 -5
  252. package/lib/utils/formatDuration.js +1 -1
  253. package/lib/utils/formula.js +1 -1
  254. package/lib/utils/getVariable.js +1 -1
  255. package/lib/utils/grammar.js +1 -1
  256. package/lib/utils/handleAction.js +1 -1
  257. package/lib/utils/helper.js +6 -1
  258. package/lib/utils/highlight.js +1 -1
  259. package/lib/utils/icon.d.ts +5 -1
  260. package/lib/utils/icon.js +11 -1
  261. package/lib/utils/image.js +1 -1
  262. package/lib/utils/index.d.ts +1 -0
  263. package/lib/utils/isPureVariable.js +1 -1
  264. package/lib/utils/json-schema-2-amis-schema.js +1 -1
  265. package/lib/utils/keyToPath.js +1 -1
  266. package/lib/utils/makeSorter.js +1 -1
  267. package/lib/utils/normalizeLink.js +1 -1
  268. package/lib/utils/normalizeOptions.js +1 -1
  269. package/lib/utils/object.js +1 -1
  270. package/lib/utils/offset.js +1 -1
  271. package/lib/utils/offsetParent.js +1 -1
  272. package/lib/utils/optionValueCompare.js +1 -1
  273. package/lib/utils/position.js +1 -1
  274. package/lib/utils/prettyBytes.js +1 -1
  275. package/lib/utils/renderer-event.js +1 -1
  276. package/lib/utils/replaceText.js +1 -1
  277. package/lib/utils/resize-sensor.js +1 -1
  278. package/lib/utils/resolveVariable.js +1 -1
  279. package/lib/utils/resolveVariableAndFilter.js +1 -1
  280. package/lib/utils/scrollPosition.js +1 -1
  281. package/lib/utils/string2regExp.js +1 -1
  282. package/lib/utils/stripNumber.js +1 -1
  283. package/lib/utils/style.js +1 -1
  284. package/lib/utils/toNumber.js +1 -1
  285. package/lib/utils/tokenize.js +1 -1
  286. package/lib/utils/tpl-builtin.js +1 -1
  287. package/lib/utils/tpl-lodash.js +1 -1
  288. package/lib/utils/tpl.js +1 -1
  289. package/lib/utils/uncontrollable.js +1 -1
  290. package/lib/utils/validations.js +1 -1
  291. package/package.json +4 -3
  292. package/esm/_virtual/index2.js +0 -8
  293. package/esm/_virtual/react-is.development.js +0 -8
  294. package/esm/_virtual/react-is.production.min.js +0 -8
  295. package/esm/node_modules/object-assign/index.js +0 -104
  296. package/esm/node_modules/prop-types/checkPropTypes.js +0 -120
  297. package/esm/node_modules/prop-types/factoryWithTypeCheckers.js +0 -630
  298. package/esm/node_modules/prop-types/lib/has.js +0 -16
  299. package/esm/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +0 -195
  300. package/esm/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +0 -31
  301. package/esm/node_modules/prop-types/node_modules/react-is/index.js +0 -26
  302. package/esm/node_modules/warning/warning.js +0 -67
  303. package/lib/_virtual/index2.js +0 -12
  304. package/lib/_virtual/react-is.development.js +0 -12
  305. package/lib/_virtual/react-is.production.min.js +0 -12
  306. package/lib/node_modules/object-assign/index.js +0 -108
  307. package/lib/node_modules/prop-types/checkPropTypes.js +0 -124
  308. package/lib/node_modules/prop-types/factoryWithTypeCheckers.js +0 -634
  309. package/lib/node_modules/prop-types/lib/has.js +0 -20
  310. package/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +0 -199
  311. package/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +0 -35
  312. package/lib/node_modules/prop-types/node_modules/react-is/index.js +0 -30
  313. package/lib/node_modules/warning/warning.js +0 -71
package/lib/index.d.ts CHANGED
@@ -6,27 +6,38 @@
6
6
  * This source code is licensed under the Apache license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- import { Renderer, getRendererByName, getRenderers, registerRenderer, unRegisterRenderer, resolveRenderer, filterSchema, clearStoresCache, updateEnv, RenderOptions, addSchemaFilter, RendererProps, extendDefaultEnv, RendererConfig } from './factory';
9
+ import { Renderer, getRendererByName, getRenderers, registerRenderer, unRegisterRenderer, resolveRenderer, filterSchema, clearStoresCache, updateEnv, addSchemaFilter, extendDefaultEnv } from './factory';
10
+ import type { RenderOptions, RendererConfig, RendererProps } from './factory';
10
11
  import './renderers/builtin';
11
12
  export * from './utils/index';
12
13
  export * from './types';
13
14
  export * from './store';
14
15
  import * as utils from './utils/helper';
15
16
  import { RegisterStore } from './store';
16
- import { setDefaultLocale, getDefaultLocale, makeTranslator, register as registerLocale, extendLocale, localeable, LocaleProps, TranslateFn } from './locale';
17
- import Scoped, { IScopedContext, ScopedContext } from './Scoped';
18
- import { classnames, getClassPrefix, setDefaultTheme, theme, getTheme, ThemeProps, themeable, ClassNamesFn, makeClassnames } from './theme';
17
+ import { setDefaultLocale, getDefaultLocale, makeTranslator, register as registerLocale, extendLocale, localeable } from './locale';
18
+ import type { LocaleProps, TranslateFn } from './locale';
19
+ import Scoped, { ScopedContext } from './Scoped';
20
+ import type { IScopedContext } from './Scoped';
21
+ import { classnames, getClassPrefix, setDefaultTheme, theme, getTheme, themeable, makeClassnames } from './theme';
22
+ import type { ClassNamesFn, ThemeProps } from './theme';
19
23
  declare const classPrefix: string | undefined;
20
24
  export * from './actions';
21
- import FormItem, { FormBaseControl, FormControlProps, FormItemWrap, FormItemProps, registerFormItem, getFormItemByName } from './renderers/Item';
22
- import { FormOptionsControl, OptionsControl, OptionsControlProps, registerOptionsControl } from './renderers/Options';
25
+ import FormItem, { FormItemWrap, registerFormItem, getFormItemByName } from './renderers/Item';
26
+ import type { FormBaseControl, FormControlProps, FormItemProps } from './renderers/Item';
27
+ import { OptionsControl, registerOptionsControl } from './renderers/Options';
28
+ import type { OptionsControlProps } from './renderers/Options';
29
+ import type { FormOptionsControl } from './renderers/Options';
23
30
  import { Schema } from './types';
24
31
  import { addRootWrapper, RootRenderProps } from './Root';
25
- import { EnvContext, RendererEnv } from './env';
26
- import { evaluate, Evaluator, extendsFilters, FilterContext, filters, getFilters, lexer, parse, registerFilter } from 'amis-formula';
32
+ import { EnvContext } from './env';
33
+ import type { RendererEnv } from './env';
34
+ import { evaluate, Evaluator, extendsFilters, filters, getFilters, lexer, parse, registerFilter } from 'amis-formula';
35
+ import type { FilterContext } from 'amis-formula';
27
36
  import LazyComponent from './components/LazyComponent';
28
37
  import Overlay from './components/Overlay';
29
38
  import PopOver from './components/PopOver';
30
- import { FormHorizontal, FormRenderer } from './renderers/Form';
39
+ import { FormRenderer } from './renderers/Form';
40
+ import type { FormHorizontal } from './renderers/Form';
41
+ export declare const version: any;
31
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, localeable, LocaleProps, TranslateFn, ClassNamesFn, parse, lexer, Evaluator, FilterContext, filters, getFilters, registerFilter, extendsFilters, evaluate, LazyComponent, Overlay, PopOver, addSchemaFilter, OptionsControlProps, FormOptionsControl, FormControlProps, FormBaseControl, extendDefaultEnv, addRootWrapper, RendererConfig };
32
43
  export declare function render(schema: Schema, props?: RootRenderProps, options?: RenderOptions, pathPrefix?: string): JSX.Element;
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -62,6 +62,7 @@ var tpl = require('./utils/tpl.js');
62
62
  var uncontrollable = require('./utils/uncontrollable.js');
63
63
  var validations = require('./utils/validations.js');
64
64
  var toNumber = require('./utils/toNumber.js');
65
+ var decodeEntity = require('./utils/decodeEntity.js');
65
66
  var Animation = require('./utils/Animation.js');
66
67
  var index = require('./store/index.js');
67
68
  var mobxStateTree = require('mobx-state-tree');
@@ -116,6 +117,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
116
117
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
117
118
 
118
119
  var classPrefix = theme.getClassPrefix();
120
+ // @ts-ignore
121
+ var version = "2.4.0";
119
122
  function render(schema, props, options, pathPrefix) {
120
123
  if (props === void 0) { props = {}; }
121
124
  if (options === void 0) { options = {}; }
@@ -361,6 +364,7 @@ exports.validateMessages = validations.validateMessages;
361
364
  exports.validateObject = validations.validateObject;
362
365
  exports.validations = validations.validations;
363
366
  exports.toNumber = toNumber.toNumber;
367
+ exports.decodeEntity = decodeEntity.decodeEntity;
364
368
  exports.animation = Animation["default"];
365
369
  exports.RegisterStore = index.RegisterStore;
366
370
  exports.RendererStore = index.RendererStore;
@@ -447,3 +451,4 @@ exports.AppStore = app.AppStore;
447
451
  exports.StoreNode = node.StoreNode;
448
452
  exports.classPrefix = classPrefix;
449
453
  exports.render = render;
454
+ exports.version = version;
package/lib/locale.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -7,7 +7,7 @@
7
7
 
8
8
  Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
- var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret.js');
10
+ var ReactPropTypesSecret$1 = require('./lib/ReactPropTypesSecret.js');
11
11
 
12
12
  /**
13
13
  * Copyright (c) 2013-present, Facebook, Inc.
@@ -16,68 +16,59 @@ var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret.js');
16
16
  * LICENSE file in the root directory of this source tree.
17
17
  */
18
18
 
19
- var factoryWithThrowingShims;
20
- var hasRequiredFactoryWithThrowingShims;
19
+ var ReactPropTypesSecret = ReactPropTypesSecret$1["default"];
21
20
 
22
- function requireFactoryWithThrowingShims () {
23
- if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
24
- hasRequiredFactoryWithThrowingShims = 1;
21
+ function emptyFunction() {}
22
+ function emptyFunctionWithReset() {}
23
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
25
24
 
26
- var ReactPropTypesSecret$1 = ReactPropTypesSecret.__require();
25
+ var factoryWithThrowingShims = function() {
26
+ function shim(props, propName, componentName, location, propFullName, secret) {
27
+ if (secret === ReactPropTypesSecret) {
28
+ // It is still safe when called from React.
29
+ return;
30
+ }
31
+ var err = new Error(
32
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
33
+ 'Use PropTypes.checkPropTypes() to call them. ' +
34
+ 'Read more at http://fb.me/use-check-prop-types'
35
+ );
36
+ err.name = 'Invariant Violation';
37
+ throw err;
38
+ } shim.isRequired = shim;
39
+ function getShim() {
40
+ return shim;
41
+ } // Important!
42
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
43
+ var ReactPropTypes = {
44
+ array: shim,
45
+ bigint: shim,
46
+ bool: shim,
47
+ func: shim,
48
+ number: shim,
49
+ object: shim,
50
+ string: shim,
51
+ symbol: shim,
27
52
 
28
- function emptyFunction() {}
29
- function emptyFunctionWithReset() {}
30
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
53
+ any: shim,
54
+ arrayOf: getShim,
55
+ element: shim,
56
+ elementType: shim,
57
+ instanceOf: getShim,
58
+ node: shim,
59
+ objectOf: getShim,
60
+ oneOf: getShim,
61
+ oneOfType: getShim,
62
+ shape: getShim,
63
+ exact: getShim,
31
64
 
32
- factoryWithThrowingShims = function() {
33
- function shim(props, propName, componentName, location, propFullName, secret) {
34
- if (secret === ReactPropTypesSecret$1) {
35
- // It is still safe when called from React.
36
- return;
37
- }
38
- var err = new Error(
39
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
40
- 'Use PropTypes.checkPropTypes() to call them. ' +
41
- 'Read more at http://fb.me/use-check-prop-types'
42
- );
43
- err.name = 'Invariant Violation';
44
- throw err;
45
- } shim.isRequired = shim;
46
- function getShim() {
47
- return shim;
48
- } // Important!
49
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
50
- var ReactPropTypes = {
51
- array: shim,
52
- bigint: shim,
53
- bool: shim,
54
- func: shim,
55
- number: shim,
56
- object: shim,
57
- string: shim,
58
- symbol: shim,
65
+ checkPropTypes: emptyFunctionWithReset,
66
+ resetWarningCache: emptyFunction
67
+ };
59
68
 
60
- any: shim,
61
- arrayOf: getShim,
62
- element: shim,
63
- elementType: shim,
64
- instanceOf: getShim,
65
- node: shim,
66
- objectOf: getShim,
67
- oneOf: getShim,
68
- oneOfType: getShim,
69
- shape: getShim,
70
- exact: getShim,
69
+ ReactPropTypes.PropTypes = ReactPropTypes;
71
70
 
72
- checkPropTypes: emptyFunctionWithReset,
73
- resetWarningCache: emptyFunction
74
- };
71
+ return ReactPropTypes;
72
+ };
75
73
 
76
- ReactPropTypes.PropTypes = ReactPropTypes;
77
-
78
- return ReactPropTypes;
79
- };
80
- return factoryWithThrowingShims;
81
- }
82
-
83
- exports.__require = requireFactoryWithThrowingShims;
74
+ exports["default"] = factoryWithThrowingShims;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -8,8 +8,6 @@
8
8
  Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
10
  var index = require('../../_virtual/index.js');
11
- var index$1 = require('./node_modules/react-is/index.js');
12
- var factoryWithTypeCheckers = require('./factoryWithTypeCheckers.js');
13
11
  var factoryWithThrowingShims = require('./factoryWithThrowingShims.js');
14
12
 
15
13
  /**
@@ -19,17 +17,10 @@ var factoryWithThrowingShims = require('./factoryWithThrowingShims.js');
19
17
  * LICENSE file in the root directory of this source tree.
20
18
  */
21
19
 
22
- if (process.env.NODE_ENV !== 'production') {
23
- var ReactIs = index$1.__require();
24
-
25
- // By explicitly using `prop-types` you are opting into new development behavior.
26
- // http://fb.me/prop-types-in-prod
27
- var throwOnDirectAccess = true;
28
- index.propTypes.exports = factoryWithTypeCheckers.__require()(ReactIs.isElement, throwOnDirectAccess);
29
- } else {
20
+ {
30
21
  // By explicitly using `prop-types` you are opting into new production behavior.
31
22
  // http://fb.me/prop-types-in-prod
32
- index.propTypes.exports = factoryWithThrowingShims.__require()();
23
+ index.propTypes.exports = factoryWithThrowingShims["default"]();
33
24
  }
34
25
 
35
26
  exports["default"] = index.propTypes.exports;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -14,17 +14,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
14
14
  * LICENSE file in the root directory of this source tree.
15
15
  */
16
16
 
17
- var ReactPropTypesSecret_1;
18
- var hasRequiredReactPropTypesSecret;
17
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
19
18
 
20
- function requireReactPropTypesSecret () {
21
- if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
22
- hasRequiredReactPropTypesSecret = 1;
19
+ var ReactPropTypesSecret_1 = ReactPropTypesSecret;
23
20
 
24
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
25
-
26
- ReactPropTypesSecret_1 = ReactPropTypesSecret;
27
- return ReactPropTypesSecret_1;
28
- }
29
-
30
- exports.__require = requireReactPropTypesSecret;
21
+ exports["default"] = ReactPropTypesSecret_1;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -11,7 +11,6 @@ var contains = require('../../dom-helpers/esm/contains.js');
11
11
  var listen = require('../../dom-helpers/esm/listen.js');
12
12
  var React = require('react');
13
13
  var useEventCallback = require('../../@restart/hooks/esm/useEventCallback.js');
14
- var warning = require('../../warning/warning.js');
15
14
  var ownerDocument = require('./ownerDocument.js');
16
15
 
17
16
  var escapeKeyCode = 27;
@@ -52,7 +51,6 @@ function useRootClose(ref, onRootClose, _temp) {
52
51
  var onClose = onRootClose || noop;
53
52
  var handleMouseCapture = React.useCallback(function (e) {
54
53
  var currentTarget = getRefTarget(ref);
55
- warning["default"](!!currentTarget, 'RootClose captured a close event but does not have a ref to compare it to. ' + 'useRootClose(), should be passed a ref that resolves to a DOM node');
56
54
  preventMouseRootCloseRef.current = !currentTarget || isModifiedEvent(e) || !isLeftClickEvent(e) || !!contains["default"](currentTarget, e.target);
57
55
  }, [ref]);
58
56
  var handleMouse = useEventCallback["default"](function (e) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -2,7 +2,7 @@
2
2
  import React from 'react';
3
3
  import { RendererProps } from '../factory';
4
4
  import { IFormStore } from '../store/form';
5
- import { SchemaNode, ActionObject, ClassName, BaseApiObject } from '../types';
5
+ import { SchemaNode, ActionObject, ClassName, BaseApiObject, SchemaExpression, SchemaClassName } from '../types';
6
6
  import { IScopedContext } from '../Scoped';
7
7
  import type { LabelAlign } from './Item';
8
8
  export interface FormHorizontal {
@@ -236,6 +236,12 @@ export interface FormSchemaBase {
236
236
  * label自定义宽度,默认单位为px
237
237
  */
238
238
  labelWidth?: number | string;
239
+ /**
240
+ * 展示态时的className
241
+ */
242
+ static?: boolean;
243
+ staticOn?: SchemaExpression;
244
+ staticClassName?: SchemaClassName;
239
245
  }
240
246
  export declare type FormGroup = FormSchemaBase & {
241
247
  title?: string;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis-core v2.3.2-beta.1
2
+ * amis-core v2.4.0
3
3
  * Copyright 2018-2022 fex
4
4
  */
5
5
 
@@ -866,7 +866,7 @@ var Form = /** @class */ (function (_super) {
866
866
  }
867
867
  var props = tslib.__assign(tslib.__assign({}, this.props), otherProps);
868
868
  var form = this.props.store;
869
- var render = props.render, mode = props.mode, horizontal = props.horizontal, store = props.store, disabled = props.disabled, controlWidth = props.controlWidth, resolveDefinitions = props.resolveDefinitions, lazyChange = props.lazyChange; props.formLazyChange; var dispatchEvent = props.dispatchEvent, labelAlign = props.labelAlign, labelWidth = props.labelWidth;
869
+ var render = props.render, mode = props.mode, horizontal = props.horizontal, store = props.store, disabled = props.disabled, controlWidth = props.controlWidth, resolveDefinitions = props.resolveDefinitions, lazyChange = props.lazyChange; props.formLazyChange; var dispatchEvent = props.dispatchEvent, labelAlign = props.labelAlign, labelWidth = props.labelWidth, _a = props.static, isStatic = _a === void 0 ? false : _a;
870
870
  var subProps = {
871
871
  formStore: form,
872
872
  data: store.data,
@@ -885,6 +885,13 @@ var Form = /** @class */ (function (_super) {
885
885
  disabled: disabled ||
886
886
  control.disabled ||
887
887
  (form.loading ? true : undefined),
888
+ /**
889
+ * 静态展示 优先级逻辑
890
+ * 1. 表单子项 static: true 始终保持静态
891
+ * 2. 表单子项 static: false 或 不配置,跟随父表单
892
+ * 3. 动作控制 表单子项 时,无视配置,优先级最高
893
+ */
894
+ static: control.static || isStatic,
888
895
  btnDisabled: disabled || form.loading || form.validating,
889
896
  onAction: this.handleAction,
890
897
  onQuery: this.handleQuery,
@@ -908,14 +915,14 @@ var Form = /** @class */ (function (_super) {
908
915
  return render("".concat(region ? "".concat(region, "/") : '').concat(key), subSchema, subProps);
909
916
  };
910
917
  Form.prototype.renderBody = function () {
911
- var _a = this.props, body = _a.body, mode = _a.mode, className = _a.className, cx = _a.classnames, debug = _a.debug, debugConfig = _a.debugConfig, $path = _a.$path, store = _a.store, columnCount = _a.columnCount, render = _a.render;
918
+ var _a = this.props, body = _a.body, mode = _a.mode, className = _a.className, cx = _a.classnames, debug = _a.debug, debugConfig = _a.debugConfig, $path = _a.$path, store = _a.store, columnCount = _a.columnCount, render = _a.render, staticClassName = _a.staticClassName, _b = _a.static, isStatic = _b === void 0 ? false : _b;
912
919
  var restError = store.restError;
913
920
  var WrapperComponent = this.props.wrapperComponent ||
914
921
  (/(?:\/|^)form\//.test($path) ? 'div' : 'form');
915
922
  var padDom = helper.repeatCount(columnCount && Array.isArray(body)
916
923
  ? columnCount - (body.length % columnCount)
917
924
  : 0, function (index) { return (React__default["default"].createElement("div", { className: cx("Form-item Form-item--".concat(mode, " is-placeholder")), key: index })); });
918
- return (React__default["default"].createElement(WrapperComponent, { className: cx("Form", "Form--".concat(mode || 'normal'), columnCount ? "Form--column Form--column-".concat(columnCount) : null, className), onSubmit: this.handleFormSubmit, noValidate: true },
925
+ return (React__default["default"].createElement(WrapperComponent, { className: cx("Form", "Form--".concat(mode || 'normal'), columnCount ? "Form--column Form--column-".concat(columnCount) : null, staticClassName && isStatic ? staticClassName : className, isStatic ? 'Form--isStatic' : null), onSubmit: this.handleFormSubmit, noValidate: true },
919
926
  React__default["default"].createElement("input", { type: "submit", style: { display: 'none' } }),
920
927
  debug
921
928
  ? render('form-debug-json', extend__default["default"]({
@@ -954,7 +961,7 @@ var Form = /** @class */ (function (_super) {
954
961
  })));
955
962
  };
956
963
  Form.prototype.render = function () {
957
- var _a = this.props; _a.$path; _a.$schema; var wrapWithPanel = _a.wrapWithPanel, render = _a.render, title = _a.title, store = _a.store, panelClassName = _a.panelClassName, headerClassName = _a.headerClassName, footerClassName = _a.footerClassName, footerWrapClassName = _a.footerWrapClassName, actionsClassName = _a.actionsClassName, bodyClassName = _a.bodyClassName, cx = _a.classnames, affixFooter = _a.affixFooter, lazyLoad = _a.lazyLoad, __ = _a.translate, footer = _a.footer; _a.formStore;
964
+ var _a = this.props; _a.$path; _a.$schema; var wrapWithPanel = _a.wrapWithPanel, render = _a.render, title = _a.title, store = _a.store, panelClassName = _a.panelClassName, headerClassName = _a.headerClassName, footerClassName = _a.footerClassName, footerWrapClassName = _a.footerWrapClassName, actionsClassName = _a.actionsClassName, bodyClassName = _a.bodyClassName, cx = _a.classnames, affixFooter = _a.affixFooter, lazyLoad = _a.lazyLoad, __ = _a.translate, footer = _a.footer;
958
965
  var body = this.renderBody();
959
966
  if (wrapWithPanel) {
960
967
  body = render('body', {
@@ -1167,7 +1174,11 @@ var FormRenderer = /** @class */ (function (_super) {
1167
1174
  return _super.prototype.receive.call(this, values, undefined, replace);
1168
1175
  };
1169
1176
  FormRenderer.prototype.setData = function (values, replace) {
1170
- return _super.prototype.setValues.call(this, values);
1177
+ var _a = this.props, onChange = _a.onChange, store = _a.store;
1178
+ _super.prototype.setValues.call(this, values);
1179
+ // 触发表单change
1180
+ onChange &&
1181
+ onChange(store.data, helper.difference(store.data, store.pristine), this.props);
1171
1182
  };
1172
1183
  FormRenderer.contextType = Scoped.ScopedContext;
1173
1184
  FormRenderer = tslib.__decorate([
@@ -516,9 +516,6 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
516
516
  readonly fetcher: any;
517
517
  readonly notify: any;
518
518
  readonly isCancel: (value: any) => boolean;
519
- /**
520
- * 输入提示,聚焦的时候显示
521
- */
522
519
  readonly __: import("..").TranslateFn<any>;
523
520
  getStoreById(id: string): {
524
521
  id: string;
@@ -612,6 +609,9 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
612
609
  addStore(store: {
613
610
  [propName: string]: any;
614
611
  storeType: string;
612
+ /**
613
+ * 表单 control 是否为 inline 模式。
614
+ */
615
615
  id: string;
616
616
  path: string;
617
617
  parentId?: string | undefined;
@@ -707,9 +707,6 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
707
707
  readonly fetcher: any;
708
708
  readonly notify: any;
709
709
  readonly isCancel: (value: any) => boolean;
710
- /**
711
- * 输入提示,聚焦的时候显示
712
- */
713
710
  readonly __: import("..").TranslateFn<any>;
714
711
  getStoreById(id: string): {
715
712
  id: string;
@@ -803,6 +800,9 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
803
800
  addStore(store: {
804
801
  [propName: string]: any;
805
802
  storeType: string;
803
+ /**
804
+ * 表单 control 是否为 inline 模式。
805
+ */
806
806
  id: string;
807
807
  path: string;
808
808
  parentId?: string | undefined;