amis 1.5.6-beta.5 → 1.6.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 (435) hide show
  1. package/.husky/pre-commit +1 -1
  2. package/lib/Schema.d.ts +3 -2
  3. package/lib/Schema.js.map +1 -1
  4. package/lib/components/AssociatedSelection.d.ts +84 -84
  5. package/lib/components/AssociatedSelection.js +2 -2
  6. package/lib/components/AssociatedSelection.js.map +2 -2
  7. package/lib/components/Avatar.d.ts +135 -0
  8. package/lib/components/Avatar.js +120 -0
  9. package/lib/components/Avatar.js.map +13 -0
  10. package/lib/components/BaiduMapPicker.js.map +2 -2
  11. package/lib/components/CalendarMobile.d.ts +547 -0
  12. package/lib/components/CalendarMobile.js +432 -0
  13. package/lib/components/CalendarMobile.js.map +13 -0
  14. package/lib/components/Card.js +1 -1
  15. package/lib/components/Card.js.map +2 -2
  16. package/lib/components/Cascader.d.ts +123 -0
  17. package/lib/components/Cascader.js +487 -0
  18. package/lib/components/Cascader.js.map +13 -0
  19. package/lib/components/ChainedSelection.d.ts +84 -84
  20. package/lib/components/ChainedSelection.js +15 -3
  21. package/lib/components/ChainedSelection.js.map +2 -2
  22. package/lib/components/CityArea.d.ts +527 -0
  23. package/lib/components/CityArea.js +177 -0
  24. package/lib/components/CityArea.js.map +13 -0
  25. package/lib/components/Collapse.js +1 -1
  26. package/lib/components/Collapse.js.map +2 -2
  27. package/lib/components/ColorPicker.d.ts +84 -84
  28. package/lib/components/ColorPicker.js +4 -3
  29. package/lib/components/ColorPicker.js.map +2 -2
  30. package/lib/components/DatePicker.d.ts +85 -84
  31. package/lib/components/DatePicker.js +15 -8
  32. package/lib/components/DatePicker.js.map +2 -2
  33. package/lib/components/DateRangePicker.d.ts +85 -84
  34. package/lib/components/DateRangePicker.js +18 -6
  35. package/lib/components/DateRangePicker.js.map +2 -2
  36. package/lib/components/GroupedSelection.d.ts +84 -84
  37. package/lib/components/GroupedSelection.js +14 -2
  38. package/lib/components/GroupedSelection.js.map +2 -2
  39. package/lib/components/MonthRangePicker.d.ts +85 -84
  40. package/lib/components/MonthRangePicker.js +16 -6
  41. package/lib/components/MonthRangePicker.js.map +2 -2
  42. package/lib/components/Overlay.d.ts +1 -1
  43. package/lib/components/Overlay.js.map +1 -1
  44. package/lib/components/Picker.d.ts +1 -0
  45. package/lib/components/Picker.js +16 -7
  46. package/lib/components/Picker.js.map +2 -2
  47. package/lib/components/PickerColumn.d.ts +1 -0
  48. package/lib/components/PickerColumn.js +21 -18
  49. package/lib/components/PickerColumn.js.map +2 -2
  50. package/lib/components/PickerContainer.d.ts +3 -0
  51. package/lib/components/PickerContainer.js +12 -5
  52. package/lib/components/PickerContainer.js.map +2 -2
  53. package/lib/components/PopOverContainer.d.ts +1 -0
  54. package/lib/components/PopOverContainer.js +5 -3
  55. package/lib/components/PopOverContainer.js.map +2 -2
  56. package/lib/components/PopUp.d.ts +1041 -28
  57. package/lib/components/PopUp.js +32 -8
  58. package/lib/components/PopUp.js.map +2 -2
  59. package/lib/components/Rating.d.ts +203 -73
  60. package/lib/components/Rating.js +147 -31
  61. package/lib/components/Rating.js.map +2 -2
  62. package/lib/components/ResultBox.d.ts +85 -84
  63. package/lib/components/ResultBox.js +9 -4
  64. package/lib/components/ResultBox.js.map +2 -2
  65. package/lib/components/ResultList.d.ts +9 -2
  66. package/lib/components/ResultList.js +22 -2
  67. package/lib/components/ResultList.js.map +2 -2
  68. package/lib/components/Select.d.ts +237 -237
  69. package/lib/components/Select.js +9 -6
  70. package/lib/components/Select.js.map +2 -2
  71. package/lib/components/Selection.d.ts +94 -86
  72. package/lib/components/Selection.js +11 -2
  73. package/lib/components/Selection.js.map +2 -2
  74. package/lib/components/Steps.js.map +2 -2
  75. package/lib/components/TableSelection.d.ts +85 -85
  76. package/lib/components/TableSelection.js +1 -9
  77. package/lib/components/TableSelection.js.map +2 -2
  78. package/lib/components/Tabs.js +31 -33
  79. package/lib/components/Tabs.js.map +2 -2
  80. package/lib/components/TabsTransfer.d.ts +87 -256
  81. package/lib/components/TabsTransfer.js +52 -9
  82. package/lib/components/TabsTransfer.js.map +2 -2
  83. package/lib/components/TabsTransferPicker.d.ts +1 -1
  84. package/lib/components/TabsTransferPicker.js +20 -18
  85. package/lib/components/TabsTransferPicker.js.map +2 -2
  86. package/lib/components/Timeline.d.ts +69 -0
  87. package/lib/components/Timeline.js +16 -0
  88. package/lib/components/Timeline.js.map +13 -0
  89. package/lib/components/TimelineItem.d.ts +516 -0
  90. package/lib/components/TimelineItem.js +41 -0
  91. package/lib/components/TimelineItem.js.map +13 -0
  92. package/lib/components/Transfer.d.ts +100 -98
  93. package/lib/components/Transfer.js +2 -3
  94. package/lib/components/Transfer.js.map +2 -2
  95. package/lib/components/TransferDropDown.d.ts +85 -84
  96. package/lib/components/TransferDropDown.js +9 -10
  97. package/lib/components/TransferDropDown.js.map +2 -2
  98. package/lib/components/TransferPicker.d.ts +1 -0
  99. package/lib/components/TransferPicker.js +19 -4
  100. package/lib/components/TransferPicker.js.map +2 -2
  101. package/lib/components/TreeSelection.d.ts +85 -85
  102. package/lib/components/TreeSelection.js +7 -1
  103. package/lib/components/TreeSelection.js.map +2 -2
  104. package/lib/components/calendar/Calendar.d.ts +19 -0
  105. package/lib/components/calendar/Calendar.js +71 -1
  106. package/lib/components/calendar/Calendar.js.map +2 -2
  107. package/lib/components/calendar/DaysView.d.ts +21 -0
  108. package/lib/components/calendar/DaysView.js +76 -17
  109. package/lib/components/calendar/DaysView.js.map +2 -2
  110. package/lib/components/calendar/MonthsView.d.ts +34 -0
  111. package/lib/components/calendar/MonthsView.js +68 -3
  112. package/lib/components/calendar/MonthsView.js.map +2 -2
  113. package/lib/components/calendar/QuartersView.d.ts +1 -0
  114. package/lib/components/calendar/QuartersView.js +2 -2
  115. package/lib/components/calendar/QuartersView.js.map +2 -2
  116. package/lib/components/calendar/TimeView.d.ts +30 -18
  117. package/lib/components/calendar/TimeView.js +47 -8
  118. package/lib/components/calendar/TimeView.js.map +2 -2
  119. package/lib/components/calendar/YearsView.d.ts +6 -0
  120. package/lib/components/calendar/YearsView.js +21 -10
  121. package/lib/components/calendar/YearsView.js.map +2 -2
  122. package/lib/components/condition-builder/Field.js +1 -4
  123. package/lib/components/condition-builder/Field.js.map +2 -2
  124. package/lib/components/condition-builder/Func.js +1 -1
  125. package/lib/components/condition-builder/Func.js.map +2 -2
  126. package/lib/components/formula/Editor.d.ts +3 -0
  127. package/lib/components/formula/Editor.js +3 -2
  128. package/lib/components/formula/Editor.js.map +2 -2
  129. package/lib/components/formula/FuncList.js +2 -1
  130. package/lib/components/formula/FuncList.js.map +2 -2
  131. package/lib/components/formula/Picker.js +1 -1
  132. package/lib/components/formula/Picker.js.map +2 -2
  133. package/lib/components/icons.js +4 -0
  134. package/lib/components/icons.js.map +2 -2
  135. package/lib/components/index.d.ts +2 -1
  136. package/lib/components/index.js +4 -2
  137. package/lib/components/index.js.map +2 -2
  138. package/lib/components/virtual-list/SizeAndPositionManager.js.map +2 -2
  139. package/lib/components/virtual-list/index.js +1 -2
  140. package/lib/components/virtual-list/index.js.map +2 -2
  141. package/lib/factory.js +5 -0
  142. package/lib/factory.js.map +2 -2
  143. package/lib/icons/star.js +12 -0
  144. package/lib/icons/tree-down.js +7 -0
  145. package/lib/index.d.ts +1 -0
  146. package/lib/index.js +2 -1
  147. package/lib/index.js.map +2 -2
  148. package/lib/locale/de-DE.js +17 -2
  149. package/lib/locale/de-DE.js.map +2 -2
  150. package/lib/locale/en-US.js +17 -2
  151. package/lib/locale/en-US.js.map +2 -2
  152. package/lib/locale/zh-CN.js +16 -1
  153. package/lib/locale/zh-CN.js.map +2 -2
  154. package/lib/renderers/Avatar.d.ts +35 -26
  155. package/lib/renderers/Avatar.js +14 -19
  156. package/lib/renderers/Avatar.js.map +2 -2
  157. package/lib/renderers/CRUD.js +1 -2
  158. package/lib/renderers/CRUD.js.map +2 -2
  159. package/lib/renderers/Card.js +6 -5
  160. package/lib/renderers/Card.js.map +2 -2
  161. package/lib/renderers/Custom.js.map +2 -2
  162. package/lib/renderers/DropDownButton.d.ts +11 -2
  163. package/lib/renderers/DropDownButton.js +30 -12
  164. package/lib/renderers/DropDownButton.js.map +2 -2
  165. package/lib/renderers/Each.js +5 -2
  166. package/lib/renderers/Each.js.map +2 -2
  167. package/lib/renderers/Flex.js +1 -5
  168. package/lib/renderers/Flex.js.map +2 -2
  169. package/lib/renderers/Form/ChartRadios.js.map +2 -2
  170. package/lib/renderers/Form/Checkboxes.js.map +2 -2
  171. package/lib/renderers/Form/CityDB.js +526 -2
  172. package/lib/renderers/Form/CityDB.js.map +2 -2
  173. package/lib/renderers/Form/DiffEditor.js +2 -1
  174. package/lib/renderers/Form/DiffEditor.js.map +2 -2
  175. package/lib/renderers/Form/InputCity.d.ts +85 -84
  176. package/lib/renderers/Form/InputCity.js +4 -2
  177. package/lib/renderers/Form/InputCity.js.map +2 -2
  178. package/lib/renderers/Form/InputColor.d.ts +84 -84
  179. package/lib/renderers/Form/InputColor.js +6 -2
  180. package/lib/renderers/Form/InputColor.js.map +2 -2
  181. package/lib/renderers/Form/InputDate.js +10 -5
  182. package/lib/renderers/Form/InputDate.js.map +2 -2
  183. package/lib/renderers/Form/InputDateRange.js +6 -2
  184. package/lib/renderers/Form/InputDateRange.js.map +2 -2
  185. package/lib/renderers/Form/InputFormula.d.ts +4 -1
  186. package/lib/renderers/Form/InputFormula.js +2 -2
  187. package/lib/renderers/Form/InputFormula.js.map +2 -2
  188. package/lib/renderers/Form/InputImage.d.ts +1 -0
  189. package/lib/renderers/Form/InputImage.js +8 -4
  190. package/lib/renderers/Form/InputImage.js.map +2 -2
  191. package/lib/renderers/Form/InputMonthRange.js +1 -1
  192. package/lib/renderers/Form/InputMonthRange.js.map +2 -2
  193. package/lib/renderers/Form/InputQuarterRange.js +1 -1
  194. package/lib/renderers/Form/InputQuarterRange.js.map +2 -2
  195. package/lib/renderers/Form/InputRating.d.ts +37 -0
  196. package/lib/renderers/Form/InputRating.js +6 -2
  197. package/lib/renderers/Form/InputRating.js.map +2 -2
  198. package/lib/renderers/Form/InputYearRange.js +1 -1
  199. package/lib/renderers/Form/InputYearRange.js.map +2 -2
  200. package/lib/renderers/Form/Item.d.ts +10 -14
  201. package/lib/renderers/Form/Item.js +18 -9
  202. package/lib/renderers/Form/Item.js.map +2 -2
  203. package/lib/renderers/Form/NestedSelect.d.ts +1 -0
  204. package/lib/renderers/Form/NestedSelect.js +8 -4
  205. package/lib/renderers/Form/NestedSelect.js.map +2 -2
  206. package/lib/renderers/Form/Select.d.ts +2 -0
  207. package/lib/renderers/Form/Select.js +7 -4
  208. package/lib/renderers/Form/Select.js.map +2 -2
  209. package/lib/renderers/Form/TabsTransfer.d.ts +5 -32
  210. package/lib/renderers/Form/TabsTransfer.js +20 -1
  211. package/lib/renderers/Form/TabsTransfer.js.map +2 -2
  212. package/lib/renderers/Form/TabsTransferPicker.d.ts +5 -35
  213. package/lib/renderers/Form/TabsTransferPicker.js +21 -2
  214. package/lib/renderers/Form/TabsTransferPicker.js.map +2 -2
  215. package/lib/renderers/Form/Transfer.d.ts +15 -4
  216. package/lib/renderers/Form/Transfer.js +55 -18
  217. package/lib/renderers/Form/Transfer.js.map +2 -2
  218. package/lib/renderers/Form/TransferPicker.d.ts +3 -32
  219. package/lib/renderers/Form/TransferPicker.js +1 -1
  220. package/lib/renderers/Form/TransferPicker.js.map +2 -2
  221. package/lib/renderers/Form/TreeSelect.js +4 -4
  222. package/lib/renderers/Form/TreeSelect.js.map +2 -2
  223. package/lib/renderers/Form/index.js +2 -1
  224. package/lib/renderers/Form/index.js.map +2 -2
  225. package/lib/renderers/IFrame.js +0 -2
  226. package/lib/renderers/IFrame.js.map +2 -2
  227. package/lib/renderers/Json.js +7 -0
  228. package/lib/renderers/Json.js.map +2 -2
  229. package/lib/renderers/Nav.js +4 -1
  230. package/lib/renderers/Nav.js.map +2 -2
  231. package/lib/renderers/Remark.d.ts +4 -0
  232. package/lib/renderers/Remark.js +39 -7
  233. package/lib/renderers/Remark.js.map +2 -2
  234. package/lib/renderers/Steps.js +5 -5
  235. package/lib/renderers/Steps.js.map +2 -2
  236. package/lib/renderers/Table/TableRow.js +4 -1
  237. package/lib/renderers/Table/TableRow.js.map +2 -2
  238. package/lib/renderers/Table/index.js +4 -1
  239. package/lib/renderers/Table/index.js.map +2 -2
  240. package/lib/renderers/Tabs.js +1 -1
  241. package/lib/renderers/Tabs.js.map +2 -2
  242. package/lib/renderers/Timeline.d.ts +65 -0
  243. package/lib/renderers/Timeline.js +54 -0
  244. package/lib/renderers/Timeline.js.map +13 -0
  245. package/lib/renderers/Video.js.map +2 -2
  246. package/lib/schemaExtend.js +23 -9
  247. package/lib/schemaExtend.js.map +2 -2
  248. package/lib/store/combo.js.map +2 -2
  249. package/lib/store/formItem.js +6 -6
  250. package/lib/store/formItem.js.map +2 -2
  251. package/lib/store/table.js +1 -1
  252. package/lib/store/table.js.map +2 -2
  253. package/lib/themes/ang-ie11.css +1018 -67
  254. package/lib/themes/ang.css +1018 -67
  255. package/lib/themes/ang.css.map +1 -1
  256. package/lib/themes/antd-ie11.css +1053 -67
  257. package/lib/themes/antd.css +1053 -67
  258. package/lib/themes/antd.css.map +1 -1
  259. package/lib/themes/cxd-ie11.css +1058 -78
  260. package/lib/themes/cxd.css +1058 -78
  261. package/lib/themes/cxd.css.map +1 -1
  262. package/lib/themes/dark-ie11.css +1019 -67
  263. package/lib/themes/dark.css +1019 -67
  264. package/lib/themes/dark.css.map +1 -1
  265. package/lib/themes/default.css +1058 -78
  266. package/lib/themes/default.css.map +1 -1
  267. package/lib/utils/RootClose.js +3 -1
  268. package/lib/utils/RootClose.js.map +2 -2
  269. package/lib/utils/helper.d.ts +1 -6
  270. package/lib/utils/helper.js +6 -17
  271. package/lib/utils/helper.js.map +2 -2
  272. package/package.json +12 -6
  273. package/schema.json +3696 -971
  274. package/scss/_properties.scss +21 -7
  275. package/scss/components/_avatar.scss +27 -9
  276. package/scss/components/_calendar.scss +287 -0
  277. package/scss/components/_card.scss +1 -1
  278. package/scss/components/_cascader.scss +102 -0
  279. package/scss/components/_city-area.scss +27 -0
  280. package/scss/components/_collapse-group.scss +1 -3
  281. package/scss/components/_dropdown.scss +39 -9
  282. package/scss/components/_formula.scss +30 -6
  283. package/scss/components/_modal.scss +18 -0
  284. package/scss/components/_panel.scss +45 -0
  285. package/scss/components/_picker-columns.scss +15 -5
  286. package/scss/components/_popup.scss +42 -15
  287. package/scss/components/_result-box.scss +31 -0
  288. package/scss/components/_timeline.scss +198 -0
  289. package/scss/components/form/_checks.scss +2 -0
  290. package/scss/components/form/_color.scss +2 -2
  291. package/scss/components/form/_date-range.scss +1 -1
  292. package/scss/components/form/_date.scss +46 -1
  293. package/scss/components/form/_form.scss +168 -0
  294. package/scss/components/form/_nested-select.scss +3 -0
  295. package/scss/components/form/_rating.scss +60 -21
  296. package/scss/components/form/_result-list.scss +2 -0
  297. package/scss/components/form/_select.scss +32 -3
  298. package/scss/components/form/_selection.scss +5 -4
  299. package/scss/components/form/_transfer.scss +3 -0
  300. package/scss/components/form/_tree-select.scss +1 -1
  301. package/scss/themes/_antd-variables.scss +42 -0
  302. package/scss/themes/_common.scss +3 -0
  303. package/scss/themes/_cxd-variables.scss +51 -2
  304. package/scss/themes/_dark-variables.scss +1 -0
  305. package/scss/themes/cxd.scss +0 -12
  306. package/sdk/ang-ie11.css +1278 -141
  307. package/sdk/ang.css +1296 -153
  308. package/sdk/antd-ie11.css +1278 -141
  309. package/sdk/antd.css +1331 -153
  310. package/sdk/charts.js +14 -14
  311. package/sdk/codemirror.js +7 -7
  312. package/sdk/color-picker.js +65 -65
  313. package/sdk/cropperjs.js +2 -2
  314. package/sdk/cxd-ie11.css +1258 -132
  315. package/sdk/cxd.css +1338 -168
  316. package/sdk/dark-ie11.css +1278 -141
  317. package/sdk/dark.css +1297 -153
  318. package/sdk/exceljs.js +1 -1
  319. package/sdk/locale/de-DE.js +17 -2
  320. package/sdk/markdown.js +69 -69
  321. package/sdk/papaparse.js +1 -1
  322. package/sdk/renderers/Form/CityDB.js +1 -1
  323. package/sdk/rest.js +18 -18
  324. package/sdk/rich-text.js +62 -62
  325. package/sdk/sdk-ie11.css +1258 -132
  326. package/sdk/sdk.css +1338 -168
  327. package/sdk/sdk.js +1242 -1218
  328. package/sdk/thirds/hls.js/hls.js +1 -1
  329. package/sdk/thirds/mpegts.js/mpegts.js +1 -1
  330. package/sdk/tinymce.js +57 -57
  331. package/src/Schema.ts +3 -0
  332. package/src/components/AssociatedSelection.tsx +5 -1
  333. package/src/components/Avatar.tsx +253 -0
  334. package/src/components/BaiduMapPicker.tsx +19 -14
  335. package/src/components/CalendarMobile.tsx +563 -0
  336. package/src/components/Card.tsx +2 -2
  337. package/src/components/Cascader.tsx +564 -0
  338. package/src/components/ChainedSelection.tsx +16 -3
  339. package/src/components/CityArea.tsx +315 -0
  340. package/src/components/Collapse.tsx +1 -1
  341. package/src/components/ColorPicker.tsx +41 -40
  342. package/src/components/DatePicker.tsx +54 -38
  343. package/src/components/DateRangePicker.tsx +83 -29
  344. package/src/components/GroupedSelection.tsx +14 -2
  345. package/src/components/MonthRangePicker.tsx +76 -30
  346. package/src/components/Overlay.tsx +1 -1
  347. package/src/components/Picker.tsx +55 -35
  348. package/src/components/PickerColumn.tsx +43 -36
  349. package/src/components/PickerContainer.tsx +13 -1
  350. package/src/components/PopOverContainer.tsx +31 -17
  351. package/src/components/PopUp.tsx +84 -57
  352. package/src/components/Rating.tsx +235 -47
  353. package/src/components/ResultBox.tsx +14 -2
  354. package/src/components/ResultList.tsx +36 -6
  355. package/src/components/Select.tsx +20 -23
  356. package/src/components/Selection.tsx +21 -3
  357. package/src/components/Steps.tsx +23 -10
  358. package/src/components/TableSelection.tsx +1 -44
  359. package/src/components/Tabs.tsx +65 -54
  360. package/src/components/TabsTransfer.tsx +78 -9
  361. package/src/components/TabsTransferPicker.tsx +25 -13
  362. package/src/components/Timeline.tsx +31 -0
  363. package/src/components/TimelineItem.tsx +107 -0
  364. package/src/components/Transfer.tsx +11 -8
  365. package/src/components/TransferDropDown.tsx +20 -12
  366. package/src/components/TransferPicker.tsx +25 -4
  367. package/src/components/TreeSelection.tsx +7 -1
  368. package/src/components/calendar/Calendar.tsx +101 -4
  369. package/src/components/calendar/DaysView.tsx +165 -33
  370. package/src/components/calendar/MonthsView.tsx +108 -1
  371. package/src/components/calendar/QuartersView.tsx +3 -2
  372. package/src/components/calendar/TimeView.tsx +104 -41
  373. package/src/components/calendar/YearsView.tsx +34 -17
  374. package/src/components/condition-builder/Field.tsx +1 -3
  375. package/src/components/condition-builder/Func.tsx +1 -1
  376. package/src/components/formula/Editor.tsx +16 -11
  377. package/src/components/formula/FuncList.tsx +3 -1
  378. package/src/components/formula/Picker.tsx +2 -1
  379. package/src/components/icons.tsx +4 -0
  380. package/src/components/index.tsx +2 -0
  381. package/src/components/virtual-list/SizeAndPositionManager.ts +6 -3
  382. package/src/components/virtual-list/index.tsx +4 -6
  383. package/src/factory.tsx +6 -0
  384. package/src/icons/star.svg +12 -0
  385. package/src/icons/tree-down.svg +5 -0
  386. package/src/index.tsx +1 -0
  387. package/src/locale/de-DE.ts +17 -2
  388. package/src/locale/en-US.ts +17 -2
  389. package/src/locale/zh-CN.ts +16 -1
  390. package/src/renderers/Avatar.tsx +83 -74
  391. package/src/renderers/CRUD.tsx +1 -3
  392. package/src/renderers/Card.tsx +10 -6
  393. package/src/renderers/Custom.tsx +6 -3
  394. package/src/renderers/DropDownButton.tsx +69 -35
  395. package/src/renderers/Each.tsx +4 -4
  396. package/src/renderers/Flex.tsx +3 -7
  397. package/src/renderers/Form/ChartRadios.tsx +2 -7
  398. package/src/renderers/Form/Checkboxes.tsx +1 -1
  399. package/src/renderers/Form/CityDB.ts +526 -2
  400. package/src/renderers/Form/DiffEditor.tsx +2 -3
  401. package/src/renderers/Form/InputCity.tsx +23 -3
  402. package/src/renderers/Form/InputColor.tsx +21 -2
  403. package/src/renderers/Form/InputDate.tsx +48 -20
  404. package/src/renderers/Form/InputDateRange.tsx +9 -2
  405. package/src/renderers/Form/InputFormula.tsx +9 -4
  406. package/src/renderers/Form/InputImage.tsx +9 -4
  407. package/src/renderers/Form/InputMonthRange.tsx +0 -1
  408. package/src/renderers/Form/InputQuarterRange.tsx +0 -1
  409. package/src/renderers/Form/InputRating.tsx +66 -3
  410. package/src/renderers/Form/InputYearRange.tsx +0 -1
  411. package/src/renderers/Form/Item.tsx +29 -8
  412. package/src/renderers/Form/NestedSelect.tsx +32 -4
  413. package/src/renderers/Form/Select.tsx +15 -3
  414. package/src/renderers/Form/TabsTransfer.tsx +28 -38
  415. package/src/renderers/Form/TabsTransferPicker.tsx +28 -46
  416. package/src/renderers/Form/Transfer.tsx +75 -24
  417. package/src/renderers/Form/TransferPicker.tsx +6 -38
  418. package/src/renderers/Form/TreeSelect.tsx +18 -16
  419. package/src/renderers/Form/index.tsx +2 -1
  420. package/src/renderers/IFrame.tsx +0 -2
  421. package/src/renderers/Json.tsx +5 -0
  422. package/src/renderers/Nav.tsx +4 -1
  423. package/src/renderers/Remark.tsx +68 -18
  424. package/src/renderers/Steps.tsx +11 -13
  425. package/src/renderers/Table/TableRow.tsx +3 -1
  426. package/src/renderers/Table/index.tsx +7 -1
  427. package/src/renderers/Tabs.tsx +6 -2
  428. package/src/renderers/Timeline.tsx +141 -0
  429. package/src/renderers/Video.tsx +4 -20
  430. package/src/schemaExtend.ts +22 -10
  431. package/src/store/combo.ts +1 -3
  432. package/src/store/formItem.ts +2 -2
  433. package/src/store/table.ts +2 -1
  434. package/src/utils/RootClose.ts +5 -1
  435. package/src/utils/helper.ts +6 -16
@@ -2,11 +2,12 @@ import React from 'react';
2
2
  import {Renderer, RendererProps} from '../factory';
3
3
  import {Api, SchemaNode, Schema, Action} from '../types';
4
4
  import cx from 'classnames';
5
- import TooltipWrapper from '../components/TooltipWrapper';
5
+ import TooltipWrapper, {TooltipObject} from '../components/TooltipWrapper';
6
6
  import {filter} from '../utils/tpl';
7
- import {themeable} from '../theme';
7
+ import {ClassNamesFn, themeable} from '../theme';
8
8
  import {hasIcon, Icon} from '../components/icons';
9
9
  import {BaseSchema, SchemaClassName, SchemaIcon, SchemaTpl} from '../Schema';
10
+ import {autobind, isMobile} from '../utils/helper';
10
11
 
11
12
  /**
12
13
  * 提示渲染器,默认会显示个小图标,鼠标放上来的时候显示配置的内容。
@@ -91,6 +92,51 @@ class Remark extends React.Component<RemarkProps> {
91
92
  trigger: ['hover', 'focus'] as Array<'hover' | 'click' | 'focus'>
92
93
  };
93
94
 
95
+ @autobind
96
+ showModalTip(tooltip?: string | TooltipObject) {
97
+ let {onAction, data} = this.props;
98
+ return (e: React.MouseEvent) => {
99
+ onAction &&
100
+ onAction(
101
+ e,
102
+ {
103
+ actionType: 'dialog',
104
+ dialog: {
105
+ title:
106
+ tooltip && typeof tooltip !== 'string' ? tooltip.title : '',
107
+ body:
108
+ tooltip && typeof tooltip !== 'string'
109
+ ? tooltip.content
110
+ : tooltip,
111
+ actions: []
112
+ }
113
+ },
114
+ data
115
+ );
116
+ };
117
+ }
118
+
119
+ renderLabel(finalIcon: any, finalLabel: string, cx: ClassNamesFn) {
120
+ return (
121
+ <>
122
+ {finalLabel ? <span>{finalLabel}</span> : null}
123
+ {finalIcon ? (
124
+ hasIcon(finalIcon) ? (
125
+ <span className={cx('Remark-icon')}>
126
+ <Icon icon={finalIcon} />
127
+ </span>
128
+ ) : (
129
+ <i className={cx('Remark-icon', finalIcon)} />
130
+ )
131
+ ) : finalIcon === false && finalLabel ? null : (
132
+ <span className={cx('Remark-icon icon')}>
133
+ <Icon icon="question-mark" />
134
+ </span>
135
+ )}
136
+ </>
137
+ );
138
+ }
139
+
94
140
  render() {
95
141
  const {
96
142
  className,
@@ -106,17 +152,34 @@ class Remark extends React.Component<RemarkProps> {
106
152
  content,
107
153
  data,
108
154
  env,
109
- tooltipClassName
155
+ tooltipClassName,
156
+ useMobileUI
110
157
  } = this.props;
111
158
 
112
159
  const finalIcon = tooltip?.icon ?? icon;
113
160
  const finalLabel = tooltip?.label ?? label;
161
+ const parsedTip = filterContents(tooltip || content, data);
162
+
163
+ // 移动端使用弹框提示
164
+ if (isMobile() && useMobileUI) {
165
+ return (
166
+ <div
167
+ className={cx(
168
+ `Remark`,
169
+ (tooltip && tooltip.className) || className || `Remark--warning`
170
+ )}
171
+ onClick={this.showModalTip(parsedTip)}
172
+ >
173
+ {this.renderLabel(finalIcon, finalLabel, cx)}
174
+ </div>
175
+ );
176
+ }
114
177
 
115
178
  return (
116
179
  <TooltipWrapper
117
180
  classPrefix={ns}
118
181
  classnames={cx}
119
- tooltip={filterContents(tooltip || content, data)}
182
+ tooltip={parsedTip}
120
183
  tooltipClassName={
121
184
  (tooltip && tooltip.tooltipClassName) || tooltipClassName
122
185
  }
@@ -132,20 +195,7 @@ class Remark extends React.Component<RemarkProps> {
132
195
  (tooltip && tooltip.className) || className || `Remark--warning`
133
196
  )}
134
197
  >
135
- {finalLabel ? <span>{finalLabel}</span> : null}
136
- {finalIcon ? (
137
- hasIcon(finalIcon) ? (
138
- <span className={cx('Remark-icon')}>
139
- <Icon icon={finalIcon} />
140
- </span>
141
- ) : (
142
- <i className={cx('Remark-icon', finalIcon)} />
143
- )
144
- ) : finalIcon === false && finalLabel ? null : (
145
- <span className={cx('Remark-icon icon')}>
146
- <Icon icon="question-mark" />
147
- </span>
148
- )}
198
+ {this.renderLabel(finalIcon, finalLabel, cx)}
149
199
  </div>
150
200
  </TooltipWrapper>
151
201
  );
@@ -60,9 +60,11 @@ export interface StepsSchema extends BaseSchema {
60
60
  */
61
61
  name?: string;
62
62
 
63
- status?: StepStatus | {
64
- [propName: string]: StepStatus;
65
- };
63
+ status?:
64
+ | StepStatus
65
+ | {
66
+ [propName: string]: StepStatus;
67
+ };
66
68
 
67
69
  /**
68
70
  * 展示模式
@@ -84,7 +86,7 @@ export function StepsCmpt(props: StepsProps) {
84
86
  source,
85
87
  config,
86
88
  render,
87
- env
89
+ useMobileUI
88
90
  } = props;
89
91
 
90
92
  const stepsRow =
@@ -92,9 +94,8 @@ export function StepsCmpt(props: StepsProps) {
92
94
  config ||
93
95
  steps ||
94
96
  [];
95
- const resolveRender = (val?: string | SchemaCollection) => typeof val === 'string'
96
- ? filter(val, data)
97
- : val && render('inner', val);
97
+ const resolveRender = (val?: string | SchemaCollection) =>
98
+ typeof val === 'string' ? filter(val, data) : val && render('inner', val);
98
99
  const value = getPropValue(props) ?? 0;
99
100
  const resolveValue =
100
101
  typeof value === 'string' && isNaN(+value)
@@ -112,13 +113,10 @@ export function StepsCmpt(props: StepsProps) {
112
113
  title: resolveRender(step.title),
113
114
  subTitle: resolveRender(step.subTitle),
114
115
  description: resolveRender(step.description)
115
- }
116
+ };
116
117
  });
117
118
 
118
- function getStepStatus(
119
- step: StepSchema,
120
- i: number
121
- ): StepStatus {
119
+ function getStepStatus(step: StepSchema, i: number): StepStatus {
122
120
  let stepStatus;
123
121
 
124
122
  if (typeof status === 'string') {
@@ -141,7 +139,7 @@ export function StepsCmpt(props: StepsProps) {
141
139
  className={className}
142
140
  status={status}
143
141
  mode={mode}
144
- useMobileUI={env.useMobileUI}
142
+ useMobileUI={useMobileUI}
145
143
  ></Steps>
146
144
  );
147
145
  }
@@ -45,8 +45,10 @@ export class TableRow extends React.Component<TableRowProps> {
45
45
  const {itemAction, onAction, item} = this.props;
46
46
  if (itemAction) {
47
47
  onAction && onAction(e, itemAction, item?.data);
48
+ item.toggle();
49
+ } else {
50
+ this.props.onCheck(this.props.item);
48
51
  }
49
- this.props.onCheck(this.props.item);
50
52
  }
51
53
 
52
54
  handleAction(e: React.UIEvent<any>, action: Action, ctx: any) {
@@ -1173,6 +1173,7 @@ export default class Table extends React.Component<TableProps, object> {
1173
1173
  group: 'table',
1174
1174
  animation: 150,
1175
1175
  handle: `.${ns}Table-dragCell`,
1176
+ filter: `.${ns}Table-dragCell.is-dragDisabled`,
1176
1177
  ghostClass: 'is-dragging',
1177
1178
  onEnd: (e: any) => {
1178
1179
  // 没有移动
@@ -1857,7 +1858,12 @@ export default class Table extends React.Component<TableProps, object> {
1857
1858
  );
1858
1859
  } else if (column.type === '__dragme') {
1859
1860
  return (
1860
- <td key={props.key} className={cx(column.pristine.className)}>
1861
+ <td
1862
+ key={props.key}
1863
+ className={cx(column.pristine.className, {
1864
+ 'is-dragDisabled': !item.draggable
1865
+ })}
1866
+ >
1861
1867
  {item.draggable ? <Icon icon="drag-bar" className="icon" /> : null}
1862
1868
  </td>
1863
1869
  );
@@ -21,7 +21,11 @@ import {
21
21
  } from '../Schema';
22
22
  import {ActionSchema} from './Action';
23
23
  import {filter} from '../utils/tpl';
24
- import {resolveVariable, tokenize} from '../utils/tpl-builtin';
24
+ import {
25
+ resolveVariable,
26
+ tokenize,
27
+ resolveVariableAndFilter
28
+ } from '../utils/tpl-builtin';
25
29
  import {FormSchemaHorizontal} from './Form/index';
26
30
  import {str2AsyncFunction} from '../utils/api';
27
31
 
@@ -461,7 +465,7 @@ export default class Tabs extends React.Component<TabsProps, TabsState> {
461
465
  } = this.props;
462
466
 
463
467
  const mode = tabsMode || dMode;
464
- const arr = resolveVariable(source, data);
468
+ const arr = resolveVariableAndFilter(source, data, '| raw');
465
469
  let mountOnEnter = this.props.mountOnEnter;
466
470
 
467
471
  // 如果在form下面,其他tabs默认需要渲染出来
@@ -0,0 +1,141 @@
1
+ import React from 'react';
2
+ import {Renderer, RendererProps} from '../factory';
3
+ import {BaseSchema, SchemaApi, SchemaCollection, SchemaTokenizeableString} from '../Schema';
4
+ import {resolveVariable} from '../utils/tpl-builtin';
5
+ import Timeline from '../components/Timeline';
6
+ import {filter} from '../utils/tpl';
7
+ import { RemoteOptionsProps, withRemoteConfig } from '../components/WithRemoteConfig';
8
+
9
+ export interface TimelineItemSchema extends Omit<BaseSchema, 'type'> {
10
+ /**
11
+ * 时间点
12
+ */
13
+ time: string;
14
+
15
+ /**
16
+ * 时间节点标题
17
+ */
18
+ title?: SchemaCollection;
19
+
20
+ /**
21
+ * 详细内容
22
+ */
23
+ detail?: string;
24
+
25
+ /**
26
+ * detail折叠时文案
27
+ */
28
+ detailCollapsedText?: string;
29
+
30
+ /**
31
+ * detail展开时文案
32
+ */
33
+ detailExpandedText?: string;
34
+
35
+ /**
36
+ * 时间点圆圈颜色
37
+ */
38
+ color?: string;
39
+
40
+ /**
41
+ * 图标
42
+ */
43
+ icon?: SchemaCollection;
44
+ }
45
+
46
+ export interface TimelineSchema extends BaseSchema {
47
+ /**
48
+ * 指定为 Timeline 时间轴渲染器
49
+ */
50
+ type: 'timeline';
51
+
52
+ /**
53
+ * 节点数据
54
+ */
55
+ items?: Array<TimelineItemSchema>;
56
+
57
+ /**
58
+ * API 或 数据映射
59
+ */
60
+ source?: SchemaApi  | SchemaTokenizeableString;
61
+
62
+ /**
63
+ * 文字相对于时间轴展示方向
64
+ */
65
+ mode?: 'left' | 'right' | 'alternate';
66
+
67
+ /**
68
+ * 展示方向
69
+ */
70
+ direction?: 'horizontal' | 'vertical'
71
+
72
+ /**
73
+ * 节点倒序
74
+ */
75
+ reverse?: boolean,
76
+ }
77
+
78
+ export interface TimelineProps
79
+ extends RendererProps,
80
+ Omit<TimelineSchema, 'className'> {}
81
+
82
+ export function TimelineCmpt(props: TimelineProps) {
83
+ const {
84
+ items,
85
+ mode,
86
+ direction,
87
+ reverse,
88
+ data,
89
+ config,
90
+ source,
91
+ render
92
+ } = props;
93
+
94
+ // 获取源数据
95
+ const timelineItemsRow: Array<TimelineItemSchema> = config || items || [];
96
+
97
+ // 渲染内容
98
+ const resolveRender = (region: string, val?: SchemaCollection) => typeof val === 'string'
99
+ ? filter(val, data)
100
+ : (val && render(region, val));
101
+
102
+ // 处理源数据
103
+ const resolveTimelineItems =
104
+ timelineItemsRow?.map((timelineItem: TimelineItemSchema) => {
105
+ return {
106
+ ...timelineItem,
107
+ icon: resolveRender('icon', timelineItem.icon),
108
+ title: resolveRender('title', timelineItem.title),
109
+ }
110
+ });
111
+
112
+
113
+ return (<Timeline
114
+ items = {resolveTimelineItems}
115
+ direction = {direction}
116
+ reverse = {reverse}
117
+ mode = {mode}
118
+ />)
119
+ }
120
+
121
+ const TimelineWithRemoteConfig = withRemoteConfig({
122
+ adaptor: data => data.items || data
123
+ })(
124
+ class extends React.Component<
125
+ RemoteOptionsProps & React.ComponentProps<typeof TimelineCmpt>
126
+ > {
127
+ render() {
128
+ const {config, deferLoad, loading, updateConfig, ...rest} = this.props;
129
+ return <TimelineCmpt config={config} {...rest} />;
130
+ }
131
+ }
132
+ );
133
+
134
+ @Renderer({
135
+ type: 'timeline'
136
+ })
137
+ export class TimelineRenderer extends React.Component<TimelineProps> {
138
+ render() {
139
+ return <TimelineWithRemoteConfig {...this.props} />;
140
+ }
141
+ }
@@ -149,16 +149,8 @@ export class FlvSource extends React.Component<FlvSourceProps, any> {
149
149
  unsubscribe: any;
150
150
 
151
151
  componentDidMount() {
152
- let {
153
- src,
154
- video,
155
- config,
156
- manager,
157
- isLive,
158
- autoPlay,
159
- actions,
160
- setError
161
- } = this.props;
152
+ let {src, video, config, manager, isLive, autoPlay, actions, setError} =
153
+ this.props;
162
154
 
163
155
  this.initFlv({
164
156
  video,
@@ -174,16 +166,8 @@ export class FlvSource extends React.Component<FlvSourceProps, any> {
174
166
 
175
167
  componentDidUpdate(prevProps: FlvSourceProps) {
176
168
  const props = this.props;
177
- let {
178
- autoPlay,
179
- actions,
180
- src,
181
- setError,
182
- isLive,
183
- config,
184
- video,
185
- manager
186
- } = props;
169
+ let {autoPlay, actions, src, setError, isLive, config, video, manager} =
170
+ props;
187
171
 
188
172
  if (src !== prevProps.src) {
189
173
  setError('');
@@ -18,15 +18,22 @@ addSchemaFilter(function (schema: Schema, renderer, props?: any) {
18
18
  const arr: Array<any> = [];
19
19
  Object.keys(value).forEach(key => {
20
20
  const valueType = typeof value[key];
21
- arr.push({
22
- key: key || '',
23
- value:
24
- valueType === 'string' ||
25
- valueType === 'number' ||
26
- valueType === 'boolean'
27
- ? value[key]
28
- : JSON.stringify(value[key])
29
- });
21
+ if (key.endsWith('___tmp')) {
22
+ arr.push({
23
+ key: key.replace('___tmp', ''),
24
+ value: ''
25
+ });
26
+ } else {
27
+ arr.push({
28
+ key: key || '',
29
+ value:
30
+ valueType === 'string' ||
31
+ valueType === 'number' ||
32
+ valueType === 'boolean'
33
+ ? value[key]
34
+ : JSON.stringify(value[key])
35
+ });
36
+ }
30
37
  });
31
38
  return arr;
32
39
  },
@@ -41,7 +48,12 @@ addSchemaFilter(function (schema: Schema, renderer, props?: any) {
41
48
  try {
42
49
  value = JSON.parse(value);
43
50
  } catch (e) {}
44
- obj[key] = value;
51
+ // 如果先输入了 a 作为 key,想输入 aa 的时候会先进入这里,导致无法输入 aa,因此当遇到 key 相同的时候加个 ___tmp 后缀
52
+ if (key in obj && typeof value === 'undefined') {
53
+ obj[key + '___tmp'] = '';
54
+ } else {
55
+ obj[key] = value;
56
+ }
45
57
  });
46
58
  return obj;
47
59
  },
@@ -11,9 +11,7 @@ export const UniqueGroup = types
11
11
  })
12
12
  .views(self => ({
13
13
  get items() {
14
- return self.itemsRef.map(
15
- id => (getStoreById(id) as any) as IFormItemStore
16
- );
14
+ return self.itemsRef.map(id => getStoreById(id) as any as IFormItemStore);
17
15
  }
18
16
  }))
19
17
  .actions(self => ({
@@ -590,8 +590,8 @@ export const FormItemStore = StoreNode.named('FormItemStore')
590
590
 
591
591
  let options: Array<IOption> =
592
592
  json.data?.options ||
593
- json.data.items ||
594
- json.data.rows ||
593
+ json.data?.items ||
594
+ json.data?.rows ||
595
595
  json.data ||
596
596
  [];
597
597
 
@@ -751,7 +751,8 @@ export const TableStore = iRendererStore
751
751
  pristine: item,
752
752
  toggled: item.toggled !== false,
753
753
  breakpoint: item.breakpoint,
754
- isPrimary: index === 3
754
+ isPrimary: index === 3,
755
+ className: item.className || ''
755
756
  }));
756
757
 
757
758
  self.columns.replace(columns as any);
@@ -4,9 +4,13 @@
4
4
 
5
5
  import React, {useState} from 'react';
6
6
  import useRootClose from 'react-overlays/useRootClose';
7
+ import {findDOMNode} from 'react-dom';
7
8
 
8
9
  export const RootClose = ({children, onRootClose, ...props}: any) => {
9
- const [rootElement, attachRef] = useState(null);
10
+ const [rootComponent, attachRef] = useState(null);
11
+ const rootElement = findDOMNode(rootComponent) as Element;
12
+
10
13
  useRootClose(rootElement, onRootClose, props);
14
+
11
15
  return typeof children === 'function' ? children(attachRef) : children;
12
16
  };
@@ -1585,30 +1585,20 @@ export function JSONTraverse(
1585
1585
  });
1586
1586
  }
1587
1587
 
1588
- export function convertDateArrayToDate(
1588
+ export function convertArrayValueToMoment(
1589
1589
  value: number[],
1590
1590
  types: string[],
1591
- date: moment.Moment
1592
- ): moment.Moment | null {
1593
- if (value.length === 0) return date;
1591
+ mom: moment.Moment
1592
+ ): moment.Moment {
1593
+ if (value.length === 0) return mom;
1594
1594
  for (let i = 0; i < types.length; i++) {
1595
1595
  const type = types[i];
1596
1596
  // @ts-ignore
1597
- date[type](value[i]);
1597
+ mom.set(type, value[i]);
1598
1598
  }
1599
- return date;
1599
+ return mom;
1600
1600
  }
1601
1601
 
1602
- export function convertDateToObject(value: moment.Moment) {
1603
- if (value) {
1604
- return {
1605
- year: value.year(),
1606
- month: parseInt(value.format('MM'), 10),
1607
- day: parseInt(value.format('DD'), 10)
1608
- };
1609
- }
1610
- return null;
1611
- }
1612
1602
 
1613
1603
  export function getRange(min: number, max: number, step: number = 1) {
1614
1604
  const arr = [];