amis-core 2.6.0 → 2.7.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 (451) hide show
  1. package/package.json +2 -2
  2. package/esm/Root.d.ts +0 -46
  3. package/esm/Root.js +0 -89
  4. package/esm/RootRenderer.d.ts +0 -27
  5. package/esm/RootRenderer.js +0 -279
  6. package/esm/SchemaRenderer.d.ts +0 -37
  7. package/esm/SchemaRenderer.js +0 -332
  8. package/esm/Scoped.d.ts +0 -38
  9. package/esm/Scoped.js +0 -262
  10. package/esm/WithRootStore.d.ts +0 -719
  11. package/esm/WithRootStore.js +0 -34
  12. package/esm/WithStore.d.ts +0 -5
  13. package/esm/WithStore.js +0 -181
  14. package/esm/actions/Action.d.ts +0 -40
  15. package/esm/actions/Action.js +0 -186
  16. package/esm/actions/AjaxAction.d.ts +0 -27
  17. package/esm/actions/AjaxAction.js +0 -96
  18. package/esm/actions/BreakAction.d.ts +0 -15
  19. package/esm/actions/BreakAction.js +0 -31
  20. package/esm/actions/BroadcastAction.d.ts +0 -19
  21. package/esm/actions/BroadcastAction.js +0 -46
  22. package/esm/actions/CmptAction.d.ts +0 -21
  23. package/esm/actions/CmptAction.js +0 -66
  24. package/esm/actions/ContinueAction.d.ts +0 -15
  25. package/esm/actions/ContinueAction.js +0 -31
  26. package/esm/actions/CopyAction.d.ts +0 -20
  27. package/esm/actions/CopyAction.js +0 -39
  28. package/esm/actions/CustomAction.d.ts +0 -22
  29. package/esm/actions/CustomAction.js +0 -74
  30. package/esm/actions/DialogAction.d.ts +0 -60
  31. package/esm/actions/DialogAction.js +0 -101
  32. package/esm/actions/DrawerAction.d.ts +0 -33
  33. package/esm/actions/DrawerAction.js +0 -65
  34. package/esm/actions/EmailAction.d.ts +0 -23
  35. package/esm/actions/EmailAction.js +0 -39
  36. package/esm/actions/LinkAction.d.ts +0 -24
  37. package/esm/actions/LinkAction.js +0 -43
  38. package/esm/actions/LoopAction.d.ts +0 -19
  39. package/esm/actions/LoopAction.js +0 -103
  40. package/esm/actions/PageAction.d.ts +0 -39
  41. package/esm/actions/PageAction.js +0 -74
  42. package/esm/actions/ParallelAction.d.ts +0 -8
  43. package/esm/actions/ParallelAction.js +0 -36
  44. package/esm/actions/SwitchAction.d.ts +0 -11
  45. package/esm/actions/SwitchAction.js +0 -48
  46. package/esm/actions/ToastAction.d.ts +0 -19
  47. package/esm/actions/ToastAction.js +0 -31
  48. package/esm/actions/index.d.ts +0 -20
  49. package/esm/components/LazyComponent.d.ts +0 -32
  50. package/esm/components/LazyComponent.js +0 -90
  51. package/esm/components/Overlay.d.ts +0 -44
  52. package/esm/components/Overlay.js +0 -255
  53. package/esm/components/PopOver.d.ts +0 -90
  54. package/esm/components/PopOver.js +0 -120
  55. package/esm/env.d.ts +0 -176
  56. package/esm/env.js +0 -12
  57. package/esm/envOverwrite.d.ts +0 -4
  58. package/esm/envOverwrite.js +0 -39
  59. package/esm/factory.d.ts +0 -85
  60. package/esm/factory.js +0 -301
  61. package/esm/index.d.ts +0 -44
  62. package/esm/index.js +0 -174
  63. package/esm/locale.d.ts +0 -84
  64. package/esm/locale.js +0 -117
  65. package/esm/renderers/Form.d.ts +0 -389
  66. package/esm/renderers/Form.js +0 -1221
  67. package/esm/renderers/Item.d.ts +0 -906
  68. package/esm/renderers/Item.js +0 -863
  69. package/esm/renderers/Options.d.ts +0 -158
  70. package/esm/renderers/Options.js +0 -908
  71. package/esm/renderers/Placeholder.d.ts +0 -6
  72. package/esm/renderers/Placeholder.js +0 -23
  73. package/esm/renderers/builtin.d.ts +0 -1
  74. package/esm/renderers/builtin.js +0 -25
  75. package/esm/renderers/register.d.ts +0 -6
  76. package/esm/renderers/register.js +0 -79
  77. package/esm/renderers/wrapControl.d.ts +0 -437
  78. package/esm/renderers/wrapControl.js +0 -509
  79. package/esm/store/app.d.ts +0 -92
  80. package/esm/store/app.js +0 -189
  81. package/esm/store/combo.d.ts +0 -10223
  82. package/esm/store/combo.js +0 -149
  83. package/esm/store/crud.d.ts +0 -128
  84. package/esm/store/crud.js +0 -447
  85. package/esm/store/form.d.ts +0 -4252
  86. package/esm/store/form.js +0 -650
  87. package/esm/store/formItem.d.ts +0 -133
  88. package/esm/store/formItem.js +0 -847
  89. package/esm/store/iRenderer.d.ts +0 -46
  90. package/esm/store/iRenderer.js +0 -185
  91. package/esm/store/index.d.ts +0 -125
  92. package/esm/store/index.js +0 -90
  93. package/esm/store/list.d.ts +0 -272
  94. package/esm/store/list.js +0 -246
  95. package/esm/store/manager.d.ts +0 -115
  96. package/esm/store/manager.js +0 -49
  97. package/esm/store/modal.d.ts +0 -84
  98. package/esm/store/modal.js +0 -50
  99. package/esm/store/node.d.ts +0 -22
  100. package/esm/store/node.js +0 -89
  101. package/esm/store/pagination.d.ts +0 -58
  102. package/esm/store/pagination.js +0 -56
  103. package/esm/store/root.d.ts +0 -85
  104. package/esm/store/root.js +0 -53
  105. package/esm/store/service.d.ts +0 -71
  106. package/esm/store/service.js +0 -411
  107. package/esm/store/table.d.ts +0 -10085
  108. package/esm/store/table.js +0 -1136
  109. package/esm/store/table2.d.ts +0 -474
  110. package/esm/store/table2.js +0 -560
  111. package/esm/theme.d.ts +0 -89
  112. package/esm/theme.js +0 -127
  113. package/esm/types.d.ts +0 -489
  114. package/esm/utils/Animation.d.ts +0 -22
  115. package/esm/utils/Animation.js +0 -285
  116. package/esm/utils/ColorScale.d.ts +0 -19
  117. package/esm/utils/ColorScale.js +0 -100
  118. package/esm/utils/DataSchema.d.ts +0 -25
  119. package/esm/utils/DataSchema.js +0 -112
  120. package/esm/utils/DataScope.d.ts +0 -26
  121. package/esm/utils/DataScope.js +0 -158
  122. package/esm/utils/RootClose.d.ts +0 -4
  123. package/esm/utils/RootClose.js +0 -22
  124. package/esm/utils/SimpleMap.d.ts +0 -8
  125. package/esm/utils/SimpleMap.js +0 -37
  126. package/esm/utils/api.d.ts +0 -34
  127. package/esm/utils/api.js +0 -595
  128. package/esm/utils/attachmentAdpator.d.ts +0 -8
  129. package/esm/utils/attachmentAdpator.js +0 -86
  130. package/esm/utils/autobind.d.ts +0 -7
  131. package/esm/utils/autobind.js +0 -89
  132. package/esm/utils/columnsSplit.d.ts +0 -1
  133. package/esm/utils/columnsSplit.js +0 -42
  134. package/esm/utils/dataMapping.d.ts +0 -9
  135. package/esm/utils/dataMapping.js +0 -141
  136. package/esm/utils/date.d.ts +0 -4
  137. package/esm/utils/date.js +0 -80
  138. package/esm/utils/debug.d.ts +0 -29
  139. package/esm/utils/debug.js +0 -379
  140. package/esm/utils/decodeEntity.d.ts +0 -5
  141. package/esm/utils/decodeEntity.js +0 -16
  142. package/esm/utils/dom.d.ts +0 -13
  143. package/esm/utils/dom.js +0 -188
  144. package/esm/utils/errors.d.ts +0 -6
  145. package/esm/utils/errors.js +0 -19
  146. package/esm/utils/escapeHtml.d.ts +0 -1
  147. package/esm/utils/escapeHtml.js +0 -20
  148. package/esm/utils/filter-schema.d.ts +0 -13
  149. package/esm/utils/filter-schema.js +0 -68
  150. package/esm/utils/filter.d.ts +0 -1
  151. package/esm/utils/filter.js +0 -493
  152. package/esm/utils/formatDuration.d.ts +0 -1
  153. package/esm/utils/formatDuration.js +0 -23
  154. package/esm/utils/formula.d.ts +0 -16
  155. package/esm/utils/formula.js +0 -219
  156. package/esm/utils/getVariable.d.ts +0 -3
  157. package/esm/utils/getVariable.js +0 -25
  158. package/esm/utils/grammar.d.ts +0 -4
  159. package/esm/utils/grammar.js +0 -50
  160. package/esm/utils/handleAction.d.ts +0 -7
  161. package/esm/utils/handleAction.js +0 -34
  162. package/esm/utils/helper.d.ts +0 -323
  163. package/esm/utils/helper.js +0 -1261
  164. package/esm/utils/highlight.d.ts +0 -1
  165. package/esm/utils/highlight.js +0 -44
  166. package/esm/utils/icon.d.ts +0 -16
  167. package/esm/utils/icon.js +0 -35
  168. package/esm/utils/image.d.ts +0 -18
  169. package/esm/utils/image.js +0 -47
  170. package/esm/utils/index.d.ts +0 -55
  171. package/esm/utils/isPureVariable.d.ts +0 -1
  172. package/esm/utils/isPureVariable.js +0 -22
  173. package/esm/utils/json-schema-2-amis-schema.d.ts +0 -6
  174. package/esm/utils/json-schema-2-amis-schema.js +0 -56
  175. package/esm/utils/keyToPath.d.ts +0 -6
  176. package/esm/utils/keyToPath.js +0 -30
  177. package/esm/utils/makeSorter.d.ts +0 -1
  178. package/esm/utils/makeSorter.js +0 -26
  179. package/esm/utils/normalizeLink.d.ts +0 -1
  180. package/esm/utils/normalizeLink.js +0 -43
  181. package/esm/utils/normalizeOptions.d.ts +0 -7
  182. package/esm/utils/normalizeOptions.js +0 -84
  183. package/esm/utils/object.d.ts +0 -15
  184. package/esm/utils/object.js +0 -142
  185. package/esm/utils/offset.d.ts +0 -15
  186. package/esm/utils/offset.js +0 -32
  187. package/esm/utils/offsetParent.d.ts +0 -5
  188. package/esm/utils/offsetParent.js +0 -23
  189. package/esm/utils/optionValueCompare.d.ts +0 -3
  190. package/esm/utils/optionValueCompare.js +0 -25
  191. package/esm/utils/position.d.ts +0 -26
  192. package/esm/utils/position.js +0 -54
  193. package/esm/utils/prettyBytes.d.ts +0 -1
  194. package/esm/utils/prettyBytes.js +0 -25
  195. package/esm/utils/renderer-event.d.ts +0 -62
  196. package/esm/utils/renderer-event.js +0 -206
  197. package/esm/utils/replaceText.d.ts +0 -3
  198. package/esm/utils/replaceText.js +0 -38
  199. package/esm/utils/resize-sensor.d.ts +0 -6
  200. package/esm/utils/resize-sensor.js +0 -172
  201. package/esm/utils/resolveVariable.d.ts +0 -1
  202. package/esm/utils/resolveVariable.js +0 -35
  203. package/esm/utils/resolveVariableAndFilter.d.ts +0 -1
  204. package/esm/utils/resolveVariableAndFilter.js +0 -33
  205. package/esm/utils/scrollPosition.d.ts +0 -16
  206. package/esm/utils/scrollPosition.js +0 -33
  207. package/esm/utils/string2regExp.d.ts +0 -1
  208. package/esm/utils/string2regExp.js +0 -14
  209. package/esm/utils/stripNumber.d.ts +0 -1
  210. package/esm/utils/stripNumber.js +0 -16
  211. package/esm/utils/style.d.ts +0 -10
  212. package/esm/utils/style.js +0 -58
  213. package/esm/utils/toNumber.d.ts +0 -7
  214. package/esm/utils/toNumber.js +0 -18
  215. package/esm/utils/tokenize.d.ts +0 -1
  216. package/esm/utils/tokenize.js +0 -29
  217. package/esm/utils/tpl-builtin.d.ts +0 -18
  218. package/esm/utils/tpl-builtin.js +0 -59
  219. package/esm/utils/tpl-lodash.d.ts +0 -4
  220. package/esm/utils/tpl-lodash.js +0 -62
  221. package/esm/utils/tpl.d.ts +0 -11
  222. package/esm/utils/tpl.js +0 -131
  223. package/esm/utils/uncontrollable.d.ts +0 -4
  224. package/esm/utils/uncontrollable.js +0 -14
  225. package/esm/utils/validations.d.ts +0 -39
  226. package/esm/utils/validations.js +0 -440
  227. package/lib/Root.d.ts +0 -46
  228. package/lib/Root.js +0 -102
  229. package/lib/RootRenderer.d.ts +0 -27
  230. package/lib/RootRenderer.js +0 -290
  231. package/lib/SchemaRenderer.d.ts +0 -37
  232. package/lib/SchemaRenderer.js +0 -342
  233. package/lib/Scoped.d.ts +0 -38
  234. package/lib/Scoped.js +0 -274
  235. package/lib/WithRootStore.d.ts +0 -719
  236. package/lib/WithRootStore.js +0 -44
  237. package/lib/WithStore.d.ts +0 -5
  238. package/lib/WithStore.js +0 -190
  239. package/lib/actions/Action.d.ts +0 -40
  240. package/lib/actions/Action.js +0 -197
  241. package/lib/actions/AjaxAction.d.ts +0 -27
  242. package/lib/actions/AjaxAction.js +0 -100
  243. package/lib/actions/BreakAction.d.ts +0 -15
  244. package/lib/actions/BreakAction.js +0 -35
  245. package/lib/actions/BroadcastAction.d.ts +0 -19
  246. package/lib/actions/BroadcastAction.js +0 -50
  247. package/lib/actions/CmptAction.d.ts +0 -21
  248. package/lib/actions/CmptAction.js +0 -70
  249. package/lib/actions/ContinueAction.d.ts +0 -15
  250. package/lib/actions/ContinueAction.js +0 -35
  251. package/lib/actions/CopyAction.d.ts +0 -20
  252. package/lib/actions/CopyAction.js +0 -43
  253. package/lib/actions/CustomAction.d.ts +0 -22
  254. package/lib/actions/CustomAction.js +0 -78
  255. package/lib/actions/DialogAction.d.ts +0 -60
  256. package/lib/actions/DialogAction.js +0 -108
  257. package/lib/actions/DrawerAction.d.ts +0 -33
  258. package/lib/actions/DrawerAction.js +0 -70
  259. package/lib/actions/EmailAction.d.ts +0 -23
  260. package/lib/actions/EmailAction.js +0 -48
  261. package/lib/actions/LinkAction.d.ts +0 -24
  262. package/lib/actions/LinkAction.js +0 -47
  263. package/lib/actions/LoopAction.d.ts +0 -19
  264. package/lib/actions/LoopAction.js +0 -107
  265. package/lib/actions/PageAction.d.ts +0 -39
  266. package/lib/actions/PageAction.js +0 -80
  267. package/lib/actions/ParallelAction.d.ts +0 -8
  268. package/lib/actions/ParallelAction.js +0 -40
  269. package/lib/actions/SwitchAction.d.ts +0 -11
  270. package/lib/actions/SwitchAction.js +0 -52
  271. package/lib/actions/ToastAction.d.ts +0 -19
  272. package/lib/actions/ToastAction.js +0 -35
  273. package/lib/actions/index.d.ts +0 -20
  274. package/lib/components/LazyComponent.d.ts +0 -32
  275. package/lib/components/LazyComponent.js +0 -99
  276. package/lib/components/Overlay.d.ts +0 -44
  277. package/lib/components/Overlay.js +0 -266
  278. package/lib/components/PopOver.d.ts +0 -90
  279. package/lib/components/PopOver.js +0 -129
  280. package/lib/env.d.ts +0 -176
  281. package/lib/env.js +0 -20
  282. package/lib/envOverwrite.d.ts +0 -4
  283. package/lib/envOverwrite.js +0 -43
  284. package/lib/factory.d.ts +0 -85
  285. package/lib/factory.js +0 -324
  286. package/lib/index.d.ts +0 -44
  287. package/lib/index.js +0 -460
  288. package/lib/locale.d.ts +0 -84
  289. package/lib/locale.js +0 -133
  290. package/lib/renderers/Form.d.ts +0 -389
  291. package/lib/renderers/Form.js +0 -1234
  292. package/lib/renderers/Item.d.ts +0 -906
  293. package/lib/renderers/Item.js +0 -879
  294. package/lib/renderers/Options.d.ts +0 -158
  295. package/lib/renderers/Options.js +0 -920
  296. package/lib/renderers/Placeholder.d.ts +0 -6
  297. package/lib/renderers/Placeholder.js +0 -31
  298. package/lib/renderers/builtin.d.ts +0 -1
  299. package/lib/renderers/builtin.js +0 -27
  300. package/lib/renderers/register.d.ts +0 -6
  301. package/lib/renderers/register.js +0 -83
  302. package/lib/renderers/wrapControl.d.ts +0 -437
  303. package/lib/renderers/wrapControl.js +0 -520
  304. package/lib/store/app.d.ts +0 -92
  305. package/lib/store/app.js +0 -193
  306. package/lib/store/combo.d.ts +0 -10223
  307. package/lib/store/combo.js +0 -154
  308. package/lib/store/crud.d.ts +0 -128
  309. package/lib/store/crud.js +0 -455
  310. package/lib/store/form.d.ts +0 -4252
  311. package/lib/store/form.js +0 -664
  312. package/lib/store/formItem.d.ts +0 -133
  313. package/lib/store/formItem.js +0 -858
  314. package/lib/store/iRenderer.d.ts +0 -46
  315. package/lib/store/iRenderer.js +0 -189
  316. package/lib/store/index.d.ts +0 -125
  317. package/lib/store/index.js +0 -101
  318. package/lib/store/list.d.ts +0 -272
  319. package/lib/store/list.js +0 -256
  320. package/lib/store/manager.d.ts +0 -115
  321. package/lib/store/manager.js +0 -56
  322. package/lib/store/modal.d.ts +0 -84
  323. package/lib/store/modal.js +0 -54
  324. package/lib/store/node.d.ts +0 -22
  325. package/lib/store/node.js +0 -93
  326. package/lib/store/pagination.d.ts +0 -58
  327. package/lib/store/pagination.js +0 -60
  328. package/lib/store/root.d.ts +0 -85
  329. package/lib/store/root.js +0 -57
  330. package/lib/store/service.d.ts +0 -71
  331. package/lib/store/service.js +0 -415
  332. package/lib/store/table.d.ts +0 -10085
  333. package/lib/store/table.js +0 -1148
  334. package/lib/store/table2.d.ts +0 -474
  335. package/lib/store/table2.js +0 -571
  336. package/lib/theme.d.ts +0 -89
  337. package/lib/theme.js +0 -145
  338. package/lib/types.d.ts +0 -489
  339. package/lib/utils/Animation.d.ts +0 -22
  340. package/lib/utils/Animation.js +0 -290
  341. package/lib/utils/ColorScale.d.ts +0 -19
  342. package/lib/utils/ColorScale.js +0 -105
  343. package/lib/utils/DataSchema.d.ts +0 -25
  344. package/lib/utils/DataSchema.js +0 -116
  345. package/lib/utils/DataScope.d.ts +0 -26
  346. package/lib/utils/DataScope.js +0 -162
  347. package/lib/utils/RootClose.d.ts +0 -4
  348. package/lib/utils/RootClose.js +0 -30
  349. package/lib/utils/SimpleMap.d.ts +0 -8
  350. package/lib/utils/SimpleMap.js +0 -46
  351. package/lib/utils/api.d.ts +0 -34
  352. package/lib/utils/api.js +0 -621
  353. package/lib/utils/attachmentAdpator.d.ts +0 -8
  354. package/lib/utils/attachmentAdpator.js +0 -91
  355. package/lib/utils/autobind.d.ts +0 -7
  356. package/lib/utils/autobind.js +0 -94
  357. package/lib/utils/columnsSplit.d.ts +0 -1
  358. package/lib/utils/columnsSplit.js +0 -51
  359. package/lib/utils/dataMapping.d.ts +0 -9
  360. package/lib/utils/dataMapping.js +0 -151
  361. package/lib/utils/date.d.ts +0 -4
  362. package/lib/utils/date.js +0 -90
  363. package/lib/utils/debug.d.ts +0 -29
  364. package/lib/utils/debug.js +0 -392
  365. package/lib/utils/decodeEntity.d.ts +0 -5
  366. package/lib/utils/decodeEntity.js +0 -20
  367. package/lib/utils/dom.d.ts +0 -13
  368. package/lib/utils/dom.js +0 -199
  369. package/lib/utils/errors.d.ts +0 -6
  370. package/lib/utils/errors.js +0 -23
  371. package/lib/utils/escapeHtml.d.ts +0 -1
  372. package/lib/utils/escapeHtml.js +0 -24
  373. package/lib/utils/filter-schema.d.ts +0 -13
  374. package/lib/utils/filter-schema.js +0 -78
  375. package/lib/utils/filter.d.ts +0 -1
  376. package/lib/utils/filter.js +0 -503
  377. package/lib/utils/formatDuration.d.ts +0 -1
  378. package/lib/utils/formatDuration.js +0 -27
  379. package/lib/utils/formula.d.ts +0 -16
  380. package/lib/utils/formula.js +0 -234
  381. package/lib/utils/getVariable.d.ts +0 -3
  382. package/lib/utils/getVariable.js +0 -29
  383. package/lib/utils/grammar.d.ts +0 -4
  384. package/lib/utils/grammar.js +0 -54
  385. package/lib/utils/handleAction.d.ts +0 -7
  386. package/lib/utils/handleAction.js +0 -39
  387. package/lib/utils/helper.d.ts +0 -323
  388. package/lib/utils/helper.js +0 -1361
  389. package/lib/utils/highlight.d.ts +0 -1
  390. package/lib/utils/highlight.js +0 -52
  391. package/lib/utils/icon.d.ts +0 -16
  392. package/lib/utils/icon.js +0 -43
  393. package/lib/utils/image.d.ts +0 -18
  394. package/lib/utils/image.js +0 -56
  395. package/lib/utils/index.d.ts +0 -55
  396. package/lib/utils/isPureVariable.d.ts +0 -1
  397. package/lib/utils/isPureVariable.js +0 -26
  398. package/lib/utils/json-schema-2-amis-schema.d.ts +0 -6
  399. package/lib/utils/json-schema-2-amis-schema.js +0 -60
  400. package/lib/utils/keyToPath.d.ts +0 -6
  401. package/lib/utils/keyToPath.js +0 -34
  402. package/lib/utils/makeSorter.d.ts +0 -1
  403. package/lib/utils/makeSorter.js +0 -30
  404. package/lib/utils/normalizeLink.d.ts +0 -1
  405. package/lib/utils/normalizeLink.js +0 -47
  406. package/lib/utils/normalizeOptions.d.ts +0 -7
  407. package/lib/utils/normalizeOptions.js +0 -92
  408. package/lib/utils/object.d.ts +0 -15
  409. package/lib/utils/object.js +0 -156
  410. package/lib/utils/offset.d.ts +0 -15
  411. package/lib/utils/offset.js +0 -37
  412. package/lib/utils/offsetParent.d.ts +0 -5
  413. package/lib/utils/offsetParent.js +0 -28
  414. package/lib/utils/optionValueCompare.d.ts +0 -3
  415. package/lib/utils/optionValueCompare.js +0 -30
  416. package/lib/utils/position.d.ts +0 -26
  417. package/lib/utils/position.js +0 -59
  418. package/lib/utils/prettyBytes.d.ts +0 -1
  419. package/lib/utils/prettyBytes.js +0 -29
  420. package/lib/utils/renderer-event.d.ts +0 -62
  421. package/lib/utils/renderer-event.js +0 -218
  422. package/lib/utils/replaceText.d.ts +0 -3
  423. package/lib/utils/replaceText.js +0 -46
  424. package/lib/utils/resize-sensor.d.ts +0 -6
  425. package/lib/utils/resize-sensor.js +0 -177
  426. package/lib/utils/resolveVariable.d.ts +0 -1
  427. package/lib/utils/resolveVariable.js +0 -39
  428. package/lib/utils/resolveVariableAndFilter.d.ts +0 -1
  429. package/lib/utils/resolveVariableAndFilter.js +0 -37
  430. package/lib/utils/scrollPosition.d.ts +0 -16
  431. package/lib/utils/scrollPosition.js +0 -37
  432. package/lib/utils/string2regExp.d.ts +0 -1
  433. package/lib/utils/string2regExp.js +0 -18
  434. package/lib/utils/stripNumber.d.ts +0 -1
  435. package/lib/utils/stripNumber.js +0 -20
  436. package/lib/utils/style.d.ts +0 -10
  437. package/lib/utils/style.js +0 -67
  438. package/lib/utils/toNumber.d.ts +0 -7
  439. package/lib/utils/toNumber.js +0 -22
  440. package/lib/utils/tokenize.d.ts +0 -1
  441. package/lib/utils/tokenize.js +0 -33
  442. package/lib/utils/tpl-builtin.d.ts +0 -18
  443. package/lib/utils/tpl-builtin.js +0 -75
  444. package/lib/utils/tpl-lodash.d.ts +0 -4
  445. package/lib/utils/tpl-lodash.js +0 -71
  446. package/lib/utils/tpl.d.ts +0 -11
  447. package/lib/utils/tpl.js +0 -140
  448. package/lib/utils/uncontrollable.d.ts +0 -4
  449. package/lib/utils/uncontrollable.js +0 -22
  450. package/lib/utils/validations.d.ts +0 -39
  451. package/lib/utils/validations.js +0 -455
@@ -1,520 +0,0 @@
1
- /**
2
- * amis-core v2.6.0
3
- * Copyright 2018-2022 fex
4
- */
5
-
6
- 'use strict';
7
-
8
- Object.defineProperty(exports, '__esModule', { value: true });
9
-
10
- var tslib = require('tslib');
11
- var React = require('react');
12
- var debounce = require('lodash/debounce');
13
- var isEqual = require('lodash/isEqual');
14
- var combo = require('../store/combo.js');
15
- var helper = require('../utils/helper.js');
16
- var formula = require('../utils/formula.js');
17
- var Scoped = require('../Scoped.js');
18
- var formItem = require('../store/formItem.js');
19
- var mobxStateTree = require('mobx-state-tree');
20
- var mobxReact = require('mobx-react');
21
- var hoistNonReactStatic = require('hoist-non-react-statics');
22
- var WithRootStore = require('../WithRootStore.js');
23
- var table = require('../store/table.js');
24
- var getVariable = require('../utils/getVariable.js');
25
-
26
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
27
-
28
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
29
- var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
30
- var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
31
- var hoistNonReactStatic__default = /*#__PURE__*/_interopDefaultLegacy(hoistNonReactStatic);
32
-
33
- function wrapControl(ComposedComponent) {
34
- var _a;
35
- var result = hoistNonReactStatic__default["default"](WithRootStore.withRootStore(mobxReact.observer((_a = /** @class */ (function (_super) {
36
- tslib.__extends(class_1, _super);
37
- function class_1(props) {
38
- var _this = this;
39
- var _a, _b;
40
- _this = _super.call(this, props) || this;
41
- _this.value = undefined;
42
- _this.lazyEmitChange = debounce__default["default"](_this.emitChange.bind(_this), 250, {
43
- trailing: true,
44
- leading: false
45
- });
46
- var _c = _this.props, form = _c.formStore, formItem$1 = _c.formItem, rootStore = _c.rootStore, store = _c.store, onChange = _c.onChange, data = _c.data, _d = _c.$schema, name = _d.name, id = _d.id, type = _d.type, required = _d.required, validations = _d.validations, validationErrors = _d.validationErrors, unique = _d.unique, value = _d.value, multiple = _d.multiple, delimiter = _d.delimiter, valueField = _d.valueField, labelField = _d.labelField, joinValues = _d.joinValues, extractValue = _d.extractValue, selectFirst = _d.selectFirst, autoFill = _d.autoFill, clearValueOnHidden = _d.clearValueOnHidden, validateApi = _d.validateApi, minLength = _d.minLength, maxLength = _d.maxLength, validateOnChange = _d.validateOnChange, label = _d.label;
47
- _this.getValue = _this.getValue.bind(_this);
48
- _this.setValue = _this.setValue.bind(_this);
49
- _this.handleChange = _this.handleChange.bind(_this);
50
- _this.setPrinstineValue = _this.setPrinstineValue.bind(_this);
51
- _this.controlRef = _this.controlRef.bind(_this);
52
- _this.handleBlur = _this.handleBlur.bind(_this);
53
- if (!name) {
54
- // 一般情况下这些表单项都是需要 name 的,提示一下
55
- if (typeof type === 'string' &&
56
- (type.startsWith('input-') ||
57
- type.endsWith('select') ||
58
- type === 'switch' ||
59
- type === 'textarea' ||
60
- type === 'radios') &&
61
- type !== 'input-group') {
62
- console.warn('name is required', _this.props.$schema);
63
- }
64
- return _this;
65
- }
66
- var propValue = _this.props.value;
67
- var model = rootStore.addStore({
68
- id: helper.guid(),
69
- path: _this.props.$path,
70
- storeType: formItem.FormItemStore.name,
71
- parentId: store === null || store === void 0 ? void 0 : store.id,
72
- name: name
73
- });
74
- _this.model = model;
75
- // @issue 打算干掉这个
76
- formItem$1 === null || formItem$1 === void 0 ? void 0 : formItem$1.addSubFormItem(model);
77
- model.config({
78
- id: id,
79
- type: type,
80
- required: required,
81
- unique: unique,
82
- value: value,
83
- rules: validations,
84
- messages: validationErrors,
85
- multiple: multiple,
86
- delimiter: delimiter,
87
- valueField: valueField,
88
- labelField: labelField,
89
- joinValues: joinValues,
90
- extractValue: extractValue,
91
- selectFirst: selectFirst,
92
- autoFill: autoFill,
93
- clearValueOnHidden: clearValueOnHidden,
94
- validateApi: validateApi,
95
- minLength: minLength,
96
- maxLength: maxLength,
97
- validateOnChange: validateOnChange,
98
- label: label
99
- });
100
- // issue 这个逻辑应该在 combo 里面自己实现。
101
- if (_this.model.unique &&
102
- ((_a = form === null || form === void 0 ? void 0 : form.parentStore) === null || _a === void 0 ? void 0 : _a.storeType) === combo.ComboStore.name) {
103
- var combo$1 = form.parentStore;
104
- combo$1.bindUniuqueItem(model);
105
- }
106
- if (propValue !== undefined && propValue !== null) {
107
- // 同步 value: 优先使用 props 中的 value
108
- model.changeTmpValue(propValue);
109
- }
110
- else {
111
- // 备注: 此处的 value 是 schema 中的 value(和props.defaultValue相同)
112
- var curTmpValue = formula.isExpression(value)
113
- ? formula.FormulaExec['formula'](value, data) // 对组件默认值进行运算
114
- : (_b = store === null || store === void 0 ? void 0 : store.getValueByName(model.name)) !== null && _b !== void 0 ? _b : formula.replaceExpression(value); // 优先使用公式表达式
115
- // 同步 value
116
- model.changeTmpValue(curTmpValue);
117
- if (onChange &&
118
- value !== undefined &&
119
- curTmpValue !== undefined) {
120
- // 组件默认值支持表达式需要: 避免初始化时上下文中丢失组件默认值
121
- onChange(model.tmpValue, model.name, false, true);
122
- }
123
- }
124
- if (onChange &&
125
- typeof propValue === 'undefined' &&
126
- typeof (store === null || store === void 0 ? void 0 : store.getValueByName(model.name, false)) === 'undefined' &&
127
- // todo 后续再优化这个判断,
128
- // 目前 input-table 中默认值会给冲掉,所以加上这个判断
129
- // 对应 issue 为 https://github.com/baidu/amis/issues/2674
130
- (store === null || store === void 0 ? void 0 : store.storeType) !== table.TableStore.name) {
131
- // 如果没有初始值,通过 onChange 设置过去
132
- onChange(model.tmpValue, model.name, false, true);
133
- }
134
- return _this;
135
- }
136
- class_1.prototype.componentDidMount = function () {
137
- var _this = this;
138
- var _a = this.props; _a.store; _a.formStore; var _b = _a.$schema, name = _b.name, validate = _b.validate, addHook = _a.addHook;
139
- // 提交前先把之前的 lazyEmit 执行一下。
140
- this.hook3 = function () {
141
- _this.lazyEmitChange.flush();
142
- };
143
- addHook === null || addHook === void 0 ? void 0 : addHook(this.hook3, 'flush');
144
- var formItem = this.model;
145
- if (formItem && validate) {
146
- var finalValidate_1 = helper.promisify(validate.bind(formItem));
147
- this.hook2 = function () {
148
- formItem.clearError('control:valdiate');
149
- return finalValidate_1(_this.props.data, _this.getValue(), name).then(function (ret) {
150
- if ((typeof ret === 'string' || Array.isArray(ret)) && ret) {
151
- formItem.addError(ret, 'control:valdiate');
152
- }
153
- });
154
- };
155
- addHook === null || addHook === void 0 ? void 0 : addHook(this.hook2);
156
- }
157
- };
158
- class_1.prototype.componentDidUpdate = function (prevProps) {
159
- var props = this.props;
160
- props.formStore;
161
- var model = this.model;
162
- if (model &&
163
- helper.anyChanged([
164
- 'id',
165
- 'validations',
166
- 'validationErrors',
167
- 'value',
168
- 'defaultValue',
169
- 'required',
170
- 'unique',
171
- 'multiple',
172
- 'delimiter',
173
- 'valueField',
174
- 'labelField',
175
- 'joinValues',
176
- 'extractValue',
177
- 'selectFirst',
178
- 'autoFill',
179
- 'clearValueOnHidden',
180
- 'validateApi',
181
- 'minLength',
182
- 'maxLength',
183
- 'label'
184
- ], prevProps.$schema, props.$schema)) {
185
- model.config({
186
- required: props.$schema.required,
187
- id: props.$schema.id,
188
- unique: props.$schema.unique,
189
- value: props.$schema.value,
190
- rules: props.$schema.validations,
191
- multiple: props.$schema.multiple,
192
- delimiter: props.$schema.delimiter,
193
- valueField: props.$schema.valueField,
194
- labelField: props.$schema.labelField,
195
- joinValues: props.$schema.joinValues,
196
- extractValue: props.$schema.extractValue,
197
- messages: props.$schema.validationErrors,
198
- selectFirst: props.$schema.selectFirst,
199
- autoFill: props.$schema.autoFill,
200
- clearValueOnHidden: props.$schema.clearValueOnHidden,
201
- validateApi: props.$schema.validateApi,
202
- minLength: props.$schema.minLength,
203
- maxLength: props.$schema.maxLength,
204
- label: props.$schema.label
205
- });
206
- }
207
- // 此处需要同时考虑 defaultValue 和 value
208
- if (model && typeof props.value !== 'undefined') {
209
- // 渲染器中的 value 优先
210
- if (!isEqual__default["default"](props.value, prevProps.value) &&
211
- !isEqual__default["default"](props.value, model.tmpValue)) {
212
- // 外部直接传入的 value 无需执行运算器
213
- model.changeTmpValue(props.value);
214
- }
215
- }
216
- else if (model &&
217
- typeof props.defaultValue !== 'undefined' &&
218
- formula.isExpression(props.defaultValue)) {
219
- // 渲染器中的 defaultValue 优先(备注: SchemaRenderer中会将 value 改成 defaultValue)
220
- if (!isEqual__default["default"](props.defaultValue, prevProps.defaultValue) ||
221
- (props.data !== prevProps.data &&
222
- formula.isNeedFormula(props.defaultValue, props.data, prevProps.data))) {
223
- var curResult = formula.FormulaExec['formula'](props.defaultValue, props.data);
224
- var prevResult = formula.FormulaExec['formula'](prevProps.defaultValue, prevProps.data);
225
- if (!isEqual__default["default"](curResult, prevResult) &&
226
- !isEqual__default["default"](curResult, model.tmpValue)) {
227
- // 识别上下文变动、自身数值变动、公式运算结果变动
228
- model.changeTmpValue(curResult);
229
- if (props.onChange) {
230
- props.onChange(curResult, model.name, false);
231
- }
232
- }
233
- }
234
- }
235
- else if (model) {
236
- var valueByName = getVariable.getVariable(props.data, model.name);
237
- if (isEqual__default["default"](props.defaultValue, prevProps.defaultValue)) {
238
- // value 非公式表达式时,name 值优先,若 defaultValue 主动变动时,则使用 defaultValue
239
- if (
240
- // 然后才是查看关联的 name 属性值是否变化
241
- props.data !== prevProps.data &&
242
- (!model.emitedValue ||
243
- isEqual__default["default"](model.emitedValue, model.tmpValue))) {
244
- model.changeEmitedValue(undefined);
245
- var prevValueByName = getVariable.getVariable(props.data, model.name);
246
- if ((!isEqual__default["default"](valueByName, prevValueByName) ||
247
- getVariable.getVariable(props.data, model.name, false) !==
248
- getVariable.getVariable(prevProps.data, model.name, false)) &&
249
- !isEqual__default["default"](valueByName, model.tmpValue)) {
250
- model.changeTmpValue(valueByName);
251
- }
252
- }
253
- }
254
- else if (!isEqual__default["default"](props.defaultValue, prevProps.defaultValue) &&
255
- !isEqual__default["default"](props.defaultValue, model.tmpValue)) {
256
- // 组件默认值非公式
257
- var curValue = formula.replaceExpression(props.defaultValue);
258
- model.changeTmpValue(curValue);
259
- if (props.onChange) {
260
- props.onChange(curValue, model.name, false);
261
- }
262
- }
263
- }
264
- };
265
- class_1.prototype.componentWillUnmount = function () {
266
- var _a, _b, _c, _d, _e, _f, _g;
267
- this.hook && ((_b = (_a = this.props).removeHook) === null || _b === void 0 ? void 0 : _b.call(_a, this.hook));
268
- this.hook2 && ((_d = (_c = this.props).removeHook) === null || _d === void 0 ? void 0 : _d.call(_c, this.hook2));
269
- this.hook3 && ((_f = (_e = this.props).removeHook) === null || _f === void 0 ? void 0 : _f.call(_e, this.hook3, 'flush'));
270
- // this.lazyEmitChange.flush();
271
- this.lazyEmitChange.cancel();
272
- (_g = this.reaction) === null || _g === void 0 ? void 0 : _g.call(this);
273
- this.disposeModel();
274
- };
275
- class_1.prototype.disposeModel = function () {
276
- var _a;
277
- var _b = this.props, form = _b.formStore, formItem = _b.formItem, rootStore = _b.rootStore;
278
- if (this.model &&
279
- this.model.unique &&
280
- (form === null || form === void 0 ? void 0 : form.parentStore) &&
281
- (form === null || form === void 0 ? void 0 : form.parentStore.storeType) === combo.ComboStore.name) {
282
- var combo$1 = form.parentStore;
283
- combo$1.unBindUniuqueItem(this.model);
284
- }
285
- if (this.model) {
286
- formItem &&
287
- mobxStateTree.isAlive(formItem) &&
288
- formItem.removeSubFormItem(this.model);
289
- this.model.clearValueOnHidden &&
290
- ((_a = this.model.form) === null || _a === void 0 ? void 0 : _a.deleteValueByName(this.model.name));
291
- mobxStateTree.isAlive(rootStore) && rootStore.removeStore(this.model);
292
- }
293
- delete this.model;
294
- };
295
- class_1.prototype.controlRef = function (control) {
296
- var _this = this;
297
- var _a = this.props, addHook = _a.addHook, removeHook = _a.removeHook; _a.formStore; var name = _a.$schema.name;
298
- // 因为 control 有可能被 n 层 hoc 包裹。
299
- while (control && control.getWrappedInstance) {
300
- control = control.getWrappedInstance();
301
- }
302
- if (control && control.validate && this.model) {
303
- var formItem_1 = this.model;
304
- var validate_1 = helper.promisify(control.validate.bind(control));
305
- this.hook = function () {
306
- formItem_1.clearError('component:valdiate');
307
- return validate_1(_this.props.data, _this.getValue(), name).then(function (ret) {
308
- if ((typeof ret === 'string' || Array.isArray(ret)) &&
309
- ret) {
310
- formItem_1.setError(ret, 'component:valdiate');
311
- }
312
- });
313
- };
314
- addHook === null || addHook === void 0 ? void 0 : addHook(this.hook);
315
- }
316
- else if (!control && this.hook) {
317
- removeHook === null || removeHook === void 0 ? void 0 : removeHook(this.hook);
318
- this.hook = undefined;
319
- }
320
- // 注册到 Scoped 上
321
- var originRef = this.control;
322
- this.control = control;
323
- var scoped = this.context;
324
- if (control) {
325
- scoped.registerComponent(this.control);
326
- }
327
- else if (originRef) {
328
- scoped.unRegisterComponent(originRef);
329
- }
330
- };
331
- class_1.prototype.validate = function () {
332
- return tslib.__awaiter(this, void 0, void 0, function () {
333
- var _a, form, data, formItemDispatchEvent, result, combo$1, group, validPromises, validPromises;
334
- return tslib.__generator(this, function (_b) {
335
- switch (_b.label) {
336
- case 0:
337
- _a = this.props, form = _a.formStore, data = _a.data, formItemDispatchEvent = _a.formItemDispatchEvent;
338
- if (!this.model) return [3 /*break*/, 4];
339
- if (!(this.model.unique &&
340
- (form === null || form === void 0 ? void 0 : form.parentStore) &&
341
- form.parentStore.storeType === combo.ComboStore.name)) return [3 /*break*/, 2];
342
- combo$1 = form.parentStore;
343
- group = combo$1.uniques.get(this.model.name);
344
- validPromises = group.items.map(function (item) {
345
- return item.validate(data);
346
- });
347
- return [4 /*yield*/, Promise.all(validPromises)];
348
- case 1:
349
- result = _b.sent();
350
- return [3 /*break*/, 4];
351
- case 2:
352
- validPromises = form === null || form === void 0 ? void 0 : form.getItemsByName(this.model.name).map(function (item) { return item.validate(data); });
353
- if (!(validPromises && validPromises.length)) return [3 /*break*/, 4];
354
- return [4 /*yield*/, Promise.all(validPromises)];
355
- case 3:
356
- result = _b.sent();
357
- _b.label = 4;
358
- case 4:
359
- if (result && result.length) {
360
- if (result.indexOf(false) > -1) {
361
- formItemDispatchEvent('formItemValidateError', data);
362
- }
363
- else {
364
- formItemDispatchEvent('formItemValidateSucc', data);
365
- }
366
- }
367
- return [2 /*return*/];
368
- }
369
- });
370
- });
371
- };
372
- class_1.prototype.handleChange = function (value, submitOnChange, changeImmediately) {
373
- if (submitOnChange === void 0) { submitOnChange = this.props.$schema.submitOnChange; }
374
- if (changeImmediately === void 0) { changeImmediately = false; }
375
- var _a = this.props; _a.formStore; var onChange = _a.onChange, _b = _a.$schema, type = _b.type, pipeOut = _b.pipeOut, conrolChangeImmediately = _b.changeImmediately, formInited = _a.formInited, data = _a.data;
376
- if (!this.model ||
377
- // todo 以后想办法不要強耦合类型。
378
- ~[
379
- 'service',
380
- 'group',
381
- 'hbox',
382
- 'panel',
383
- 'grid',
384
- 'input-group'
385
- ].indexOf(type)) {
386
- onChange && onChange.apply(null, arguments);
387
- return;
388
- }
389
- if (pipeOut) {
390
- var oldValue = this.model.value;
391
- value = pipeOut(value, oldValue, data);
392
- }
393
- this.model.changeTmpValue(value);
394
- if (changeImmediately || conrolChangeImmediately || !formInited) {
395
- this.emitChange(submitOnChange);
396
- }
397
- else {
398
- // this.props.onTmpValueChange?.(value, this.model.name);
399
- this.lazyEmitChange(submitOnChange);
400
- }
401
- };
402
- class_1.prototype.emitChange = function (submitOnChange) {
403
- var _a;
404
- if (submitOnChange === void 0) { submitOnChange = this.props.$schema.submitOnChange; }
405
- var _b = this.props, form = _b.formStore, onChange = _b.onChange, _c = _b.$schema, name = _c.name, id = _c.id, label = _c.label, type = _c.type, onFormItemChange = _c.onChange; _c.maxLength; _c.minLength; var data = _b.data, env = _b.env, validateOnChange = _b.validateOnChange, formSubmited = _b.formSubmited;
406
- if (!this.model) {
407
- return;
408
- }
409
- var value = this.model.tmpValue;
410
- var oldValue = getVariable.getVariable(data, this.model.name, false);
411
- if (oldValue === value) {
412
- return;
413
- }
414
- if (type !== 'input-password') {
415
- env === null || env === void 0 ? void 0 : env.tracker({
416
- eventType: 'formItemChange',
417
- eventData: {
418
- id: id,
419
- name: name,
420
- label: label,
421
- type: type,
422
- value: value
423
- }
424
- }, this.props);
425
- }
426
- this.model.changeEmitedValue(value);
427
- if ((onFormItemChange === null || onFormItemChange === void 0 ? void 0 : onFormItemChange(value, oldValue, this.model, form)) === false) {
428
- return;
429
- }
430
- var validated = this.model.validated;
431
- onChange === null || onChange === void 0 ? void 0 : onChange(value, name, submitOnChange === true);
432
- if (
433
- // 如果配置了 minLength 或者 maxLength 就切成及时验证
434
- // this.model.rules.minLength ||
435
- // this.model.rules.maxLength ||
436
- validateOnChange === true ||
437
- (validateOnChange !== false && (formSubmited || validated))) {
438
- this.validate();
439
- }
440
- else if (validateOnChange === false) {
441
- (_a = this.model) === null || _a === void 0 ? void 0 : _a.reset();
442
- }
443
- };
444
- class_1.prototype.handleBlur = function (e) {
445
- var _a = this.props, onBlur = _a.onBlur, validateOnBlur = _a.$schema.validateOnBlur;
446
- if (validateOnBlur && this.model) {
447
- this.validate();
448
- }
449
- onBlur && onBlur(e);
450
- };
451
- class_1.prototype.setPrinstineValue = function (value) {
452
- if (!this.model) {
453
- return;
454
- }
455
- var _a = this.props; _a.formStore; var name = _a.name, pipeOut = _a.$schema.pipeOut, onChange = _a.onChange, oldValue = _a.value, data = _a.data;
456
- if (pipeOut) {
457
- value = pipeOut(value, oldValue, data);
458
- }
459
- onChange === null || onChange === void 0 ? void 0 : onChange(value, name, false, true);
460
- };
461
- class_1.prototype.getValue = function () {
462
- var _a = this.props, data = _a.formStore, control = _a.$schema;
463
- var value = this.model ? this.model.tmpValue : control.value;
464
- if (control.pipeIn) {
465
- value = control.pipeIn(value, data);
466
- }
467
- return value;
468
- };
469
- // 兼容老版本用法,新版本直接用 onChange 就可以。
470
- class_1.prototype.setValue = function (value, key) {
471
- var _a;
472
- var _b = this.props, name = _b.$schema.name, onBulkChange = _b.onBulkChange;
473
- if (!key || key === name) {
474
- this.handleChange(value);
475
- }
476
- else {
477
- onBulkChange &&
478
- onBulkChange((_a = {},
479
- _a[key] = value,
480
- _a));
481
- }
482
- };
483
- class_1.prototype.render = function () {
484
- var _a;
485
- var _b = this.props, controlWidth = _b.controlWidth, disabled = _b.disabled, formMode = _b.formMode, control = _b.$schema, store = _b.store, data = _b.data, invisible = _b.invisible;
486
- if (invisible) {
487
- return null;
488
- }
489
- var value = this.getValue();
490
- var model = this.model;
491
- var injectedProps = {
492
- defaultSize: controlWidth,
493
- disabled: disabled !== null && disabled !== void 0 ? disabled : control.disabled,
494
- formItem: this.model,
495
- formMode: control.mode || formMode,
496
- ref: this.controlRef,
497
- data: data || (store === null || store === void 0 ? void 0 : store.data),
498
- value: value,
499
- defaultValue: control.value,
500
- formItemValue: value,
501
- onChange: this.handleChange,
502
- onBlur: this.handleBlur,
503
- setValue: this.setValue,
504
- getValue: this.getValue,
505
- prinstine: model ? model.prinstine : undefined,
506
- setPrinstineValue: this.setPrinstineValue,
507
- // !没了这个, tree 里的 options 渲染会出问题
508
- _filteredOptions: (_a = this.model) === null || _a === void 0 ? void 0 : _a.filteredOptions
509
- };
510
- return (React__default["default"].createElement(ComposedComponent, tslib.__assign({}, this.props, injectedProps)));
511
- };
512
- return class_1;
513
- }(React__default["default"].Component)),
514
- _a.contextType = Scoped.ScopedContext,
515
- _a.defaultProps = {},
516
- _a))), ComposedComponent);
517
- return result;
518
- }
519
-
520
- exports.wrapControl = wrapControl;
@@ -1,92 +0,0 @@
1
- import { Instance, SnapshotIn } from 'mobx-state-tree';
2
- import { RendererEnv } from '../factory';
3
- import { NavigationObject } from '../types';
4
- export declare const AppStore: import("mobx-state-tree").IModelType<{
5
- id: import("mobx-state-tree").ISimpleType<string>;
6
- path: import("mobx-state-tree").IType<string | undefined, string, string>;
7
- storeType: import("mobx-state-tree").ISimpleType<string>;
8
- disposed: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
9
- parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
10
- childrenIds: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
11
- } & {
12
- hasRemoteData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
13
- data: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
14
- initedAt: import("mobx-state-tree").IType<number | undefined, number, number>;
15
- updatedAt: import("mobx-state-tree").IType<number | undefined, number, number>;
16
- pristine: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
17
- action: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
18
- dialogOpen: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
19
- dialogData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
20
- drawerOpen: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
21
- drawerData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
22
- } & {
23
- msg: import("mobx-state-tree").IType<string | undefined, string, string>;
24
- error: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
25
- fetching: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
26
- saving: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
27
- busying: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
28
- checking: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
29
- initializing: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
30
- schema: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
31
- schemaKey: import("mobx-state-tree").IType<string | undefined, string, string>;
32
- } & {
33
- pages: import("mobx-state-tree").IType<any, any, any>;
34
- activePage: import("mobx-state-tree").IType<any, any, any>;
35
- folded: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
36
- offScreen: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
37
- }, {
38
- readonly parentStore: any;
39
- readonly __: any;
40
- readonly hasChildren: boolean;
41
- readonly children: any[];
42
- } & {
43
- onChildStoreDispose(child: any): void;
44
- syncProps(props: any, prevProps: any, list?: string[]): void;
45
- dispose: (callback?: (() => void) | undefined) => void;
46
- addChildId: (id: string) => void;
47
- removeChildId: (id: string) => void;
48
- } & {
49
- getValueByName(name: string, canAccessSuper?: boolean): any;
50
- getPristineValueByName(name: string): any;
51
- } & {
52
- initData(data?: object, skipSetPristine?: boolean): void;
53
- reset(): void;
54
- updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
55
- changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;
56
- setCurrentAction(action: object): void;
57
- openDialog(ctx: any, additonal?: object | undefined, callback?: ((ret: any) => void) | undefined): void;
58
- closeDialog(result?: any): void;
59
- openDrawer(ctx: any, additonal?: object | undefined, callback?: ((ret: any) => void) | undefined): void;
60
- closeDrawer(result?: any): void;
61
- } & {
62
- readonly loading: boolean;
63
- } & {
64
- markFetching: (fetching?: boolean) => void;
65
- markSaving: (saving?: boolean) => void;
66
- markBusying: (busying?: boolean) => void;
67
- fetchInitData: (api: import("../types").Api, data?: object | undefined, options?: import("../types").fetchOptions | undefined) => Promise<any>;
68
- fetchData: (api: import("../types").Api, data?: object | undefined, options?: import("../types").fetchOptions | undefined) => Promise<any>;
69
- reInitData: (data: object | undefined, replace?: boolean) => void;
70
- updateMessage: (msg?: string | undefined, error?: boolean) => void;
71
- clearMessage: () => void;
72
- setHasRemoteData: () => void;
73
- saveRemote: (api: import("../types").Api, data?: object | undefined, options?: import("../types").fetchOptions | undefined) => Promise<any>;
74
- fetchSchema: (api: import("../types").Api, data?: object | undefined, options?: import("../types").fetchOptions | undefined) => Promise<any>;
75
- checkRemote: (api: import("../types").Api, data?: object | undefined, options?: import("../types").fetchOptions | undefined) => Promise<any>;
76
- } & {
77
- readonly navigations: NavigationObject[];
78
- readonly bcn: any;
79
- readonly pageData: object;
80
- } & {
81
- toggleFolded(): void;
82
- toggleOffScreen(): void;
83
- setPages(pages: any): void;
84
- rewrite(to: string, env: RendererEnv): void;
85
- setActivePage(page: any, env: RendererEnv & {
86
- showFullBreadcrumbPath?: boolean;
87
- showBreadcrumbHomePath?: boolean;
88
- }, params?: any): void;
89
- updateActivePage(env: RendererEnv): void;
90
- }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
91
- export type IAppStore = Instance<typeof AppStore>;
92
- export type SAppStore = SnapshotIn<typeof AppStore>;