amis 2.4.0 → 2.5.0-rc.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (545) hide show
  1. package/esm/Schema.d.ts +17 -17
  2. package/esm/compat.js +1 -1
  3. package/esm/index.js +1 -1
  4. package/esm/preset.js +1 -1
  5. package/esm/renderers/Action.d.ts +3 -48
  6. package/esm/renderers/Action.js +8 -4
  7. package/esm/renderers/Alert.js +1 -1
  8. package/esm/renderers/AnchorNav.d.ts +1 -1
  9. package/esm/renderers/AnchorNav.js +1 -1
  10. package/esm/renderers/App.js +15 -4
  11. package/esm/renderers/Audio.js +1 -1
  12. package/esm/renderers/Avatar.js +1 -1
  13. package/esm/renderers/BarCode.js +1 -1
  14. package/esm/renderers/Breadcrumb.d.ts +4 -4
  15. package/esm/renderers/Breadcrumb.js +1 -1
  16. package/esm/renderers/ButtonGroup.js +1 -1
  17. package/esm/renderers/CRUD.d.ts +9 -7
  18. package/esm/renderers/CRUD.js +22 -9
  19. package/esm/renderers/CRUD2.d.ts +5 -5
  20. package/esm/renderers/CRUD2.js +1 -1
  21. package/esm/renderers/Calendar.js +1 -1
  22. package/esm/renderers/Card.d.ts +1 -1
  23. package/esm/renderers/Card.js +1 -1
  24. package/esm/renderers/Card2.js +1 -1
  25. package/esm/renderers/Cards.d.ts +2 -2
  26. package/esm/renderers/Cards.js +1 -1
  27. package/esm/renderers/Carousel.js +1 -1
  28. package/esm/renderers/Chart.d.ts +17 -3
  29. package/esm/renderers/Chart.js +108 -29
  30. package/esm/renderers/Code.d.ts +3 -3
  31. package/esm/renderers/Code.js +1 -1
  32. package/esm/renderers/Collapse.js +1 -1
  33. package/esm/renderers/CollapseGroup.js +1 -1
  34. package/esm/renderers/Color.js +1 -1
  35. package/esm/renderers/Container.js +1 -1
  36. package/esm/renderers/Copyable.d.ts +1 -1
  37. package/esm/renderers/Copyable.js +1 -1
  38. package/esm/renderers/Custom.js +1 -1
  39. package/esm/renderers/Date.js +1 -1
  40. package/esm/renderers/DateRange.js +1 -1
  41. package/esm/renderers/Dialog.d.ts +9 -1201
  42. package/esm/renderers/Dialog.js +1 -1
  43. package/esm/renderers/Divider.js +1 -1
  44. package/esm/renderers/Drawer.d.ts +1 -1
  45. package/esm/renderers/Drawer.js +1 -1
  46. package/esm/renderers/DropDownButton.d.ts +1 -1
  47. package/esm/renderers/DropDownButton.js +1 -1
  48. package/esm/renderers/Each.js +1 -1
  49. package/esm/renderers/Flex.js +1 -1
  50. package/esm/renderers/Form/ButtonGroupSelect.js +1 -1
  51. package/esm/renderers/Form/ButtonToolbar.js +1 -1
  52. package/esm/renderers/Form/ChainedSelect.js +1 -1
  53. package/esm/renderers/Form/ChartRadios.js +1 -1
  54. package/esm/renderers/Form/Checkbox.js +1 -1
  55. package/esm/renderers/Form/Checkboxes.js +1 -1
  56. package/esm/renderers/Form/Combo.d.ts +10 -5
  57. package/esm/renderers/Form/Combo.js +119 -92
  58. package/esm/renderers/Form/ConditionBuilder.js +1 -1
  59. package/esm/renderers/Form/Control.js +1 -1
  60. package/esm/renderers/Form/DiffEditor.d.ts +3 -3
  61. package/esm/renderers/Form/DiffEditor.js +1 -1
  62. package/esm/renderers/Form/Editor.d.ts +3 -3
  63. package/esm/renderers/Form/Editor.js +1 -1
  64. package/esm/renderers/Form/FieldSet.js +1 -1
  65. package/esm/renderers/Form/Formula.js +1 -1
  66. package/esm/renderers/Form/Group.d.ts +1 -1
  67. package/esm/renderers/Form/Group.js +4 -3
  68. package/esm/renderers/Form/Hidden.js +1 -1
  69. package/esm/renderers/Form/IconPicker.js +1 -1
  70. package/esm/renderers/Form/IconPickerIcons.js +1 -1
  71. package/esm/renderers/Form/IconSelect.js +1 -1
  72. package/esm/renderers/Form/IconSelectStore.d.ts +1 -1
  73. package/esm/renderers/Form/IconSelectStore.js +1 -1
  74. package/esm/renderers/Form/InputArray.d.ts +4 -0
  75. package/esm/renderers/Form/InputArray.js +11 -3
  76. package/esm/renderers/Form/InputCity.d.ts +2 -560
  77. package/esm/renderers/Form/InputCity.js +2 -9
  78. package/esm/renderers/Form/InputColor.d.ts +2 -454
  79. package/esm/renderers/Form/InputColor.js +1 -1
  80. package/esm/renderers/Form/InputDate.js +1 -1
  81. package/esm/renderers/Form/InputDateRange.js +1 -1
  82. package/esm/renderers/Form/InputExcel.d.ts +2 -2
  83. package/esm/renderers/Form/InputExcel.js +1 -1
  84. package/esm/renderers/Form/InputFile.d.ts +2 -2
  85. package/esm/renderers/Form/InputFile.js +1 -1
  86. package/esm/renderers/Form/InputFormula.js +1 -1
  87. package/esm/renderers/Form/InputGroup.js +1 -1
  88. package/esm/renderers/Form/InputImage.d.ts +2 -2
  89. package/esm/renderers/Form/InputImage.js +1 -1
  90. package/esm/renderers/Form/InputMonthRange.d.ts +0 -1
  91. package/esm/renderers/Form/InputMonthRange.js +1 -1
  92. package/esm/renderers/Form/InputNumber.d.ts +3 -3
  93. package/esm/renderers/Form/InputNumber.js +9 -7
  94. package/esm/renderers/Form/InputQuarterRange.d.ts +0 -1
  95. package/esm/renderers/Form/InputQuarterRange.js +1 -1
  96. package/esm/renderers/Form/InputRange.d.ts +7 -7
  97. package/esm/renderers/Form/InputRange.js +1 -1
  98. package/esm/renderers/Form/InputRating.js +26 -4
  99. package/esm/renderers/Form/InputRepeat.js +1 -1
  100. package/esm/renderers/Form/InputRichText.js +1 -1
  101. package/esm/renderers/Form/InputSubForm.js +1 -1
  102. package/esm/renderers/Form/InputTable.d.ts +13 -1
  103. package/esm/renderers/Form/InputTable.js +87 -46
  104. package/esm/renderers/Form/InputTag.d.ts +3 -2
  105. package/esm/renderers/Form/InputTag.js +15 -8
  106. package/esm/renderers/Form/InputText.d.ts +1 -1
  107. package/esm/renderers/Form/InputText.js +24 -18
  108. package/esm/renderers/Form/InputTree.d.ts +1 -1
  109. package/esm/renderers/Form/InputTree.js +4 -4
  110. package/esm/renderers/Form/InputYearRange.d.ts +0 -1
  111. package/esm/renderers/Form/InputYearRange.js +1 -1
  112. package/esm/renderers/Form/JSONSchema.js +1 -1
  113. package/esm/renderers/Form/JSONSchemaEditor.js +1 -1
  114. package/esm/renderers/Form/ListSelect.js +1 -1
  115. package/esm/renderers/Form/LocationPicker.js +1 -1
  116. package/esm/renderers/Form/MatrixCheckboxes.js +1 -1
  117. package/esm/renderers/Form/NestedSelect.js +1 -1
  118. package/esm/renderers/Form/Picker.js +1 -1
  119. package/esm/renderers/Form/Radios.js +9 -7
  120. package/esm/renderers/Form/Select.d.ts +1 -1
  121. package/esm/renderers/Form/Select.js +9 -7
  122. package/esm/renderers/Form/Static.js +1 -1
  123. package/esm/renderers/Form/StaticHoc.js +1 -1
  124. package/esm/renderers/Form/Switch.d.ts +1 -1
  125. package/esm/renderers/Form/Switch.js +1 -1
  126. package/esm/renderers/Form/TabsTransfer.d.ts +1 -2
  127. package/esm/renderers/Form/TabsTransfer.js +4 -4
  128. package/esm/renderers/Form/TabsTransferPicker.d.ts +1 -2
  129. package/esm/renderers/Form/TabsTransferPicker.js +4 -4
  130. package/esm/renderers/Form/Textarea.d.ts +1 -1
  131. package/esm/renderers/Form/Textarea.js +2 -2
  132. package/esm/renderers/Form/Transfer.d.ts +12 -2
  133. package/esm/renderers/Form/Transfer.js +6 -6
  134. package/esm/renderers/Form/TransferPicker.d.ts +0 -1
  135. package/esm/renderers/Form/TransferPicker.js +4 -4
  136. package/esm/renderers/Form/TreeSelect.d.ts +9 -0
  137. package/esm/renderers/Form/TreeSelect.js +6 -6
  138. package/esm/renderers/Form/UUID.js +1 -1
  139. package/esm/renderers/Form/UserSelect.js +1 -1
  140. package/esm/renderers/Grid.d.ts +3 -3
  141. package/esm/renderers/Grid.js +1 -1
  142. package/esm/renderers/Grid2D.d.ts +2 -2
  143. package/esm/renderers/Grid2D.js +1 -1
  144. package/esm/renderers/GridNav.js +1 -1
  145. package/esm/renderers/HBox.d.ts +2 -2
  146. package/esm/renderers/HBox.js +1 -1
  147. package/esm/renderers/IFrame.d.ts +5 -2
  148. package/esm/renderers/IFrame.js +65 -24
  149. package/esm/renderers/Icon.js +2 -3
  150. package/esm/renderers/Image.d.ts +2 -263
  151. package/esm/renderers/Image.js +1 -1
  152. package/esm/renderers/Images.js +1 -1
  153. package/esm/renderers/Json.js +1 -1
  154. package/esm/renderers/Link.js +1 -1
  155. package/esm/renderers/List.d.ts +2 -2
  156. package/esm/renderers/List.js +3 -2
  157. package/esm/renderers/Log.d.ts +1 -1
  158. package/esm/renderers/Log.js +14 -14
  159. package/esm/renderers/Mapping.d.ts +2 -250
  160. package/esm/renderers/Mapping.js +1 -1
  161. package/esm/renderers/Markdown.js +1 -1
  162. package/esm/renderers/MultilineText.js +1 -1
  163. package/esm/renderers/Nav.d.ts +2 -39
  164. package/esm/renderers/Nav.js +1 -1
  165. package/esm/renderers/Operation.js +1 -1
  166. package/esm/renderers/Page.d.ts +1 -1
  167. package/esm/renderers/Page.js +30 -15
  168. package/esm/renderers/Pagination.js +1 -1
  169. package/esm/renderers/PaginationWrapper.js +1 -1
  170. package/esm/renderers/Panel.js +1 -1
  171. package/esm/renderers/Password.js +1 -1
  172. package/esm/renderers/Plain.js +1 -1
  173. package/esm/renderers/PopOver.d.ts +1 -1
  174. package/esm/renderers/PopOver.js +1 -1
  175. package/esm/renderers/Portlet.js +1 -1
  176. package/esm/renderers/Progress.js +1 -1
  177. package/esm/renderers/Property.d.ts +2 -2
  178. package/esm/renderers/Property.js +1 -1
  179. package/esm/renderers/QRCode.js +1 -1
  180. package/esm/renderers/QuickEdit.d.ts +2 -2
  181. package/esm/renderers/QuickEdit.js +1 -1
  182. package/esm/renderers/Remark.d.ts +2 -34
  183. package/esm/renderers/Remark.js +3 -3
  184. package/esm/renderers/SearchBox.d.ts +10 -4
  185. package/esm/renderers/SearchBox.js +74 -13
  186. package/esm/renderers/Service.d.ts +5 -5
  187. package/esm/renderers/Service.js +22 -5
  188. package/esm/renderers/SparkLine.js +1 -1
  189. package/esm/renderers/Spinner.js +1 -1
  190. package/esm/renderers/Status.js +1 -1
  191. package/esm/renderers/Steps.d.ts +1 -1
  192. package/esm/renderers/Steps.js +1 -1
  193. package/esm/renderers/Table/ColumnToggler.js +1 -1
  194. package/esm/renderers/Table/HeadCellFilterDropdown.js +1 -1
  195. package/esm/renderers/Table/HeadCellSearchDropdown.js +1 -1
  196. package/esm/renderers/Table/ItemActionsWrapper.d.ts +0 -1
  197. package/esm/renderers/Table/ItemActionsWrapper.js +1 -1
  198. package/esm/renderers/Table/TableBody.js +1 -1
  199. package/esm/renderers/Table/TableCell.js +1 -1
  200. package/esm/renderers/Table/TableContent.d.ts +1 -1
  201. package/esm/renderers/Table/TableContent.js +7 -5
  202. package/esm/renderers/Table/TableRow.d.ts +1 -1
  203. package/esm/renderers/Table/TableRow.js +6 -4
  204. package/esm/renderers/Table/exportExcel.js +2 -2
  205. package/esm/renderers/Table/index.d.ts +6 -6
  206. package/esm/renderers/Table/index.js +25 -4
  207. package/esm/renderers/Table2/ColumnToggler.js +1 -1
  208. package/esm/renderers/Table2/HeadCellSearchDropdown.js +1 -1
  209. package/esm/renderers/Table2/TableCell.js +1 -1
  210. package/esm/renderers/Table2/index.d.ts +2 -2
  211. package/esm/renderers/Table2/index.js +1 -1
  212. package/esm/renderers/TableView.d.ts +3 -3
  213. package/esm/renderers/TableView.js +1 -1
  214. package/esm/renderers/Tabs.d.ts +2 -2
  215. package/esm/renderers/Tabs.js +1 -1
  216. package/esm/renderers/Tag.js +1 -1
  217. package/esm/renderers/Tasks.js +1 -1
  218. package/esm/renderers/Timeline.d.ts +7 -2
  219. package/esm/renderers/Timeline.js +6 -3
  220. package/esm/renderers/TooltipWrapper.js +1 -1
  221. package/esm/renderers/Tpl.d.ts +4 -0
  222. package/esm/renderers/Tpl.js +20 -6
  223. package/esm/renderers/VBox.d.ts +1 -1
  224. package/esm/renderers/VBox.js +1 -1
  225. package/esm/renderers/Video.js +1 -1
  226. package/esm/renderers/WebComponent.js +1 -1
  227. package/esm/renderers/Wizard.d.ts +1 -1
  228. package/esm/renderers/Wizard.js +1 -1
  229. package/esm/renderers/Words.d.ts +1 -1
  230. package/esm/renderers/Words.js +1 -1
  231. package/esm/renderers/Wrapper.js +1 -1
  232. package/esm/schemaExtend.js +1 -1
  233. package/esm/types.d.ts +5 -6
  234. package/lib/Schema.d.ts +17 -17
  235. package/lib/compat.js +1 -1
  236. package/lib/helper.css +1 -1
  237. package/lib/index.js +1 -1
  238. package/lib/preset.js +1 -1
  239. package/lib/renderers/Action.d.ts +3 -48
  240. package/lib/renderers/Action.js +8 -4
  241. package/lib/renderers/Alert.js +1 -1
  242. package/lib/renderers/AnchorNav.d.ts +1 -1
  243. package/lib/renderers/AnchorNav.js +1 -1
  244. package/lib/renderers/App.js +15 -4
  245. package/lib/renderers/Audio.js +1 -1
  246. package/lib/renderers/Avatar.js +1 -1
  247. package/lib/renderers/BarCode.js +1 -1
  248. package/lib/renderers/Breadcrumb.d.ts +4 -4
  249. package/lib/renderers/Breadcrumb.js +1 -1
  250. package/lib/renderers/ButtonGroup.js +1 -1
  251. package/lib/renderers/CRUD.d.ts +9 -7
  252. package/lib/renderers/CRUD.js +22 -9
  253. package/lib/renderers/CRUD2.d.ts +5 -5
  254. package/lib/renderers/CRUD2.js +1 -1
  255. package/lib/renderers/Calendar.js +1 -1
  256. package/lib/renderers/Card.d.ts +1 -1
  257. package/lib/renderers/Card.js +1 -1
  258. package/lib/renderers/Card2.js +1 -1
  259. package/lib/renderers/Cards.d.ts +2 -2
  260. package/lib/renderers/Cards.js +1 -1
  261. package/lib/renderers/Carousel.js +1 -1
  262. package/lib/renderers/Chart.d.ts +17 -3
  263. package/lib/renderers/Chart.js +107 -27
  264. package/lib/renderers/Code.d.ts +3 -3
  265. package/lib/renderers/Code.js +1 -1
  266. package/lib/renderers/Collapse.js +1 -1
  267. package/lib/renderers/CollapseGroup.js +1 -1
  268. package/lib/renderers/Color.js +1 -1
  269. package/lib/renderers/Container.js +1 -1
  270. package/lib/renderers/Copyable.d.ts +1 -1
  271. package/lib/renderers/Copyable.js +1 -1
  272. package/lib/renderers/Custom.js +1 -1
  273. package/lib/renderers/Date.js +1 -1
  274. package/lib/renderers/DateRange.js +1 -1
  275. package/lib/renderers/Dialog.d.ts +9 -1201
  276. package/lib/renderers/Dialog.js +1 -1
  277. package/lib/renderers/Divider.js +1 -1
  278. package/lib/renderers/Drawer.d.ts +1 -1
  279. package/lib/renderers/Drawer.js +1 -1
  280. package/lib/renderers/DropDownButton.d.ts +1 -1
  281. package/lib/renderers/DropDownButton.js +1 -1
  282. package/lib/renderers/Each.js +1 -1
  283. package/lib/renderers/Flex.js +1 -1
  284. package/lib/renderers/Form/ButtonGroupSelect.js +1 -1
  285. package/lib/renderers/Form/ButtonToolbar.js +1 -1
  286. package/lib/renderers/Form/ChainedSelect.js +1 -1
  287. package/lib/renderers/Form/ChartRadios.js +1 -1
  288. package/lib/renderers/Form/Checkbox.js +1 -1
  289. package/lib/renderers/Form/Checkboxes.js +1 -1
  290. package/lib/renderers/Form/Combo.d.ts +10 -5
  291. package/lib/renderers/Form/Combo.js +118 -91
  292. package/lib/renderers/Form/ConditionBuilder.js +1 -1
  293. package/lib/renderers/Form/Control.js +1 -1
  294. package/lib/renderers/Form/DiffEditor.d.ts +3 -3
  295. package/lib/renderers/Form/DiffEditor.js +1 -1
  296. package/lib/renderers/Form/Editor.d.ts +3 -3
  297. package/lib/renderers/Form/Editor.js +1 -1
  298. package/lib/renderers/Form/FieldSet.js +1 -1
  299. package/lib/renderers/Form/Formula.js +1 -1
  300. package/lib/renderers/Form/Group.d.ts +1 -1
  301. package/lib/renderers/Form/Group.js +4 -3
  302. package/lib/renderers/Form/Hidden.js +1 -1
  303. package/lib/renderers/Form/IconPicker.js +1 -1
  304. package/lib/renderers/Form/IconPickerIcons.js +1 -1
  305. package/lib/renderers/Form/IconSelect.js +1 -1
  306. package/lib/renderers/Form/IconSelectStore.d.ts +1 -1
  307. package/lib/renderers/Form/IconSelectStore.js +1 -1
  308. package/lib/renderers/Form/InputArray.d.ts +4 -0
  309. package/lib/renderers/Form/InputArray.js +11 -3
  310. package/lib/renderers/Form/InputCity.d.ts +2 -560
  311. package/lib/renderers/Form/InputCity.js +2 -9
  312. package/lib/renderers/Form/InputColor.d.ts +2 -454
  313. package/lib/renderers/Form/InputColor.js +1 -1
  314. package/lib/renderers/Form/InputDate.js +1 -1
  315. package/lib/renderers/Form/InputDateRange.js +1 -1
  316. package/lib/renderers/Form/InputExcel.d.ts +2 -2
  317. package/lib/renderers/Form/InputExcel.js +1 -1
  318. package/lib/renderers/Form/InputFile.d.ts +2 -2
  319. package/lib/renderers/Form/InputFile.js +1 -1
  320. package/lib/renderers/Form/InputFormula.js +1 -1
  321. package/lib/renderers/Form/InputGroup.js +1 -1
  322. package/lib/renderers/Form/InputImage.d.ts +2 -2
  323. package/lib/renderers/Form/InputImage.js +1 -1
  324. package/lib/renderers/Form/InputMonthRange.d.ts +0 -1
  325. package/lib/renderers/Form/InputMonthRange.js +1 -1
  326. package/lib/renderers/Form/InputNumber.d.ts +3 -3
  327. package/lib/renderers/Form/InputNumber.js +8 -6
  328. package/lib/renderers/Form/InputQuarterRange.d.ts +0 -1
  329. package/lib/renderers/Form/InputQuarterRange.js +1 -1
  330. package/lib/renderers/Form/InputRange.d.ts +7 -7
  331. package/lib/renderers/Form/InputRange.js +1 -1
  332. package/lib/renderers/Form/InputRating.js +25 -3
  333. package/lib/renderers/Form/InputRepeat.js +1 -1
  334. package/lib/renderers/Form/InputRichText.js +1 -1
  335. package/lib/renderers/Form/InputSubForm.js +1 -1
  336. package/lib/renderers/Form/InputTable.d.ts +13 -1
  337. package/lib/renderers/Form/InputTable.js +87 -45
  338. package/lib/renderers/Form/InputTag.d.ts +3 -2
  339. package/lib/renderers/Form/InputTag.js +15 -8
  340. package/lib/renderers/Form/InputText.d.ts +1 -1
  341. package/lib/renderers/Form/InputText.js +24 -18
  342. package/lib/renderers/Form/InputTree.d.ts +1 -1
  343. package/lib/renderers/Form/InputTree.js +3 -3
  344. package/lib/renderers/Form/InputYearRange.d.ts +0 -1
  345. package/lib/renderers/Form/InputYearRange.js +1 -1
  346. package/lib/renderers/Form/JSONSchema.js +1 -1
  347. package/lib/renderers/Form/JSONSchemaEditor.js +1 -1
  348. package/lib/renderers/Form/ListSelect.js +1 -1
  349. package/lib/renderers/Form/LocationPicker.js +1 -1
  350. package/lib/renderers/Form/MatrixCheckboxes.js +1 -1
  351. package/lib/renderers/Form/NestedSelect.js +1 -1
  352. package/lib/renderers/Form/Picker.js +1 -1
  353. package/lib/renderers/Form/Radios.js +9 -7
  354. package/lib/renderers/Form/Select.d.ts +1 -1
  355. package/lib/renderers/Form/Select.js +9 -7
  356. package/lib/renderers/Form/Static.js +1 -1
  357. package/lib/renderers/Form/StaticHoc.js +1 -1
  358. package/lib/renderers/Form/Switch.d.ts +1 -1
  359. package/lib/renderers/Form/Switch.js +1 -1
  360. package/lib/renderers/Form/TabsTransfer.d.ts +1 -2
  361. package/lib/renderers/Form/TabsTransfer.js +3 -3
  362. package/lib/renderers/Form/TabsTransferPicker.d.ts +1 -2
  363. package/lib/renderers/Form/TabsTransferPicker.js +3 -3
  364. package/lib/renderers/Form/Textarea.d.ts +1 -1
  365. package/lib/renderers/Form/Textarea.js +2 -2
  366. package/lib/renderers/Form/Transfer.d.ts +12 -2
  367. package/lib/renderers/Form/Transfer.js +5 -5
  368. package/lib/renderers/Form/TransferPicker.d.ts +0 -1
  369. package/lib/renderers/Form/TransferPicker.js +3 -3
  370. package/lib/renderers/Form/TreeSelect.d.ts +9 -0
  371. package/lib/renderers/Form/TreeSelect.js +5 -5
  372. package/lib/renderers/Form/UUID.js +1 -1
  373. package/lib/renderers/Form/UserSelect.js +1 -1
  374. package/lib/renderers/Grid.d.ts +3 -3
  375. package/lib/renderers/Grid.js +1 -1
  376. package/lib/renderers/Grid2D.d.ts +2 -2
  377. package/lib/renderers/Grid2D.js +1 -1
  378. package/lib/renderers/GridNav.js +1 -1
  379. package/lib/renderers/HBox.d.ts +2 -2
  380. package/lib/renderers/HBox.js +1 -1
  381. package/lib/renderers/IFrame.d.ts +5 -2
  382. package/lib/renderers/IFrame.js +63 -22
  383. package/lib/renderers/Icon.js +2 -3
  384. package/lib/renderers/Image.d.ts +2 -263
  385. package/lib/renderers/Image.js +1 -1
  386. package/lib/renderers/Images.js +1 -1
  387. package/lib/renderers/Json.js +1 -1
  388. package/lib/renderers/Link.js +1 -1
  389. package/lib/renderers/List.d.ts +2 -2
  390. package/lib/renderers/List.js +3 -2
  391. package/lib/renderers/Log.d.ts +1 -1
  392. package/lib/renderers/Log.js +14 -14
  393. package/lib/renderers/Mapping.d.ts +2 -250
  394. package/lib/renderers/Mapping.js +1 -1
  395. package/lib/renderers/Markdown.js +1 -1
  396. package/lib/renderers/MultilineText.js +1 -1
  397. package/lib/renderers/Nav.d.ts +2 -39
  398. package/lib/renderers/Nav.js +1 -1
  399. package/lib/renderers/Operation.js +1 -1
  400. package/lib/renderers/Page.d.ts +1 -1
  401. package/lib/renderers/Page.js +30 -15
  402. package/lib/renderers/Pagination.js +1 -1
  403. package/lib/renderers/PaginationWrapper.js +1 -1
  404. package/lib/renderers/Panel.js +1 -1
  405. package/lib/renderers/Password.js +1 -1
  406. package/lib/renderers/Plain.js +1 -1
  407. package/lib/renderers/PopOver.d.ts +1 -1
  408. package/lib/renderers/PopOver.js +1 -1
  409. package/lib/renderers/Portlet.js +1 -1
  410. package/lib/renderers/Progress.js +1 -1
  411. package/lib/renderers/Property.d.ts +2 -2
  412. package/lib/renderers/Property.js +1 -1
  413. package/lib/renderers/QRCode.js +1 -1
  414. package/lib/renderers/QuickEdit.d.ts +2 -2
  415. package/lib/renderers/QuickEdit.js +1 -1
  416. package/lib/renderers/Remark.d.ts +2 -34
  417. package/lib/renderers/Remark.js +2 -2
  418. package/lib/renderers/SearchBox.d.ts +10 -4
  419. package/lib/renderers/SearchBox.js +72 -11
  420. package/lib/renderers/Service.d.ts +5 -5
  421. package/lib/renderers/Service.js +22 -5
  422. package/lib/renderers/SparkLine.js +1 -1
  423. package/lib/renderers/Spinner.js +1 -1
  424. package/lib/renderers/Status.js +1 -1
  425. package/lib/renderers/Steps.d.ts +1 -1
  426. package/lib/renderers/Steps.js +1 -1
  427. package/lib/renderers/Table/ColumnToggler.js +1 -1
  428. package/lib/renderers/Table/HeadCellFilterDropdown.js +1 -1
  429. package/lib/renderers/Table/HeadCellSearchDropdown.js +1 -1
  430. package/lib/renderers/Table/ItemActionsWrapper.d.ts +0 -1
  431. package/lib/renderers/Table/ItemActionsWrapper.js +1 -1
  432. package/lib/renderers/Table/TableBody.js +1 -1
  433. package/lib/renderers/Table/TableCell.js +1 -1
  434. package/lib/renderers/Table/TableContent.d.ts +1 -1
  435. package/lib/renderers/Table/TableContent.js +7 -5
  436. package/lib/renderers/Table/TableRow.d.ts +1 -1
  437. package/lib/renderers/Table/TableRow.js +6 -4
  438. package/lib/renderers/Table/exportExcel.js +2 -2
  439. package/lib/renderers/Table/index.d.ts +6 -6
  440. package/lib/renderers/Table/index.js +26 -4
  441. package/lib/renderers/Table2/ColumnToggler.js +1 -1
  442. package/lib/renderers/Table2/HeadCellSearchDropdown.js +1 -1
  443. package/lib/renderers/Table2/TableCell.js +1 -1
  444. package/lib/renderers/Table2/index.d.ts +2 -2
  445. package/lib/renderers/Table2/index.js +1 -1
  446. package/lib/renderers/TableView.d.ts +3 -3
  447. package/lib/renderers/TableView.js +1 -1
  448. package/lib/renderers/Tabs.d.ts +2 -2
  449. package/lib/renderers/Tabs.js +1 -1
  450. package/lib/renderers/Tag.js +1 -1
  451. package/lib/renderers/Tasks.js +1 -1
  452. package/lib/renderers/Timeline.d.ts +7 -2
  453. package/lib/renderers/Timeline.js +5 -2
  454. package/lib/renderers/TooltipWrapper.js +1 -1
  455. package/lib/renderers/Tpl.d.ts +4 -0
  456. package/lib/renderers/Tpl.js +20 -6
  457. package/lib/renderers/VBox.d.ts +1 -1
  458. package/lib/renderers/VBox.js +1 -1
  459. package/lib/renderers/Video.js +1 -1
  460. package/lib/renderers/WebComponent.js +1 -1
  461. package/lib/renderers/Wizard.d.ts +1 -1
  462. package/lib/renderers/Wizard.js +1 -1
  463. package/lib/renderers/Words.d.ts +1 -1
  464. package/lib/renderers/Words.js +1 -1
  465. package/lib/renderers/Wrapper.js +1 -1
  466. package/lib/schemaExtend.js +1 -1
  467. package/lib/themes/ang-ie11.css +3886 -3800
  468. package/lib/themes/ang.css +1989 -806
  469. package/lib/themes/antd-ie11.css +1856 -1790
  470. package/lib/themes/antd.css +1784 -1790
  471. package/lib/themes/cxd-ie11.css +810 -728
  472. package/lib/themes/cxd.css +1836 -2210
  473. package/lib/themes/dark-ie11.css +3926 -3841
  474. package/lib/themes/dark.css +2015 -922
  475. package/lib/themes/default-ie11.css +810 -728
  476. package/lib/themes/default.css +1836 -2210
  477. package/lib/types.d.ts +5 -6
  478. package/package.json +7 -7
  479. package/schema.json +182 -57
  480. package/sdk/ang-ie11.css +3965 -3862
  481. package/sdk/ang.css +2040 -838
  482. package/sdk/antd-ie11.css +1915 -1831
  483. package/sdk/antd.css +1836 -1824
  484. package/sdk/barcode.js +50 -50
  485. package/sdk/charts.js +16 -16
  486. package/sdk/codemirror.js +7 -7
  487. package/sdk/color-picker.js +65 -65
  488. package/sdk/cropperjs.js +6 -5
  489. package/sdk/cxd-ie11.css +866 -768
  490. package/sdk/cxd.css +1824 -2182
  491. package/sdk/dark-ie11.css +4004 -3903
  492. package/sdk/dark.css +2064 -954
  493. package/sdk/exceljs.js +1 -1
  494. package/sdk/helper.css +1 -1
  495. package/sdk/locale/de-DE.js +6 -0
  496. package/sdk/markdown.js +68 -68
  497. package/sdk/papaparse.js +1 -1
  498. package/sdk/rest.js +17 -17
  499. package/sdk/rich-text.js +62 -62
  500. package/sdk/sdk-ie11.css +866 -768
  501. package/sdk/sdk.css +1824 -2182
  502. package/sdk/sdk.js +1492 -1476
  503. package/sdk/thirds/@fortawesome/fontawesome-free/webfonts/fa-brands-400.ttf +0 -0
  504. package/sdk/thirds/@fortawesome/fontawesome-free/webfonts/fa-brands-400.woff2 +0 -0
  505. package/sdk/thirds/@fortawesome/fontawesome-free/webfonts/fa-regular-400.ttf +0 -0
  506. package/sdk/thirds/@fortawesome/fontawesome-free/webfonts/fa-regular-400.woff2 +0 -0
  507. package/sdk/thirds/@fortawesome/fontawesome-free/webfonts/fa-solid-900.ttf +0 -0
  508. package/sdk/thirds/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2 +0 -0
  509. package/sdk/thirds/@fortawesome/fontawesome-free/webfonts/fa-v4compatibility.ttf +0 -0
  510. package/sdk/thirds/@fortawesome/fontawesome-free/webfonts/fa-v4compatibility.woff2 +0 -0
  511. package/sdk/thirds/hls.js/hls.js +1 -1
  512. package/sdk/thirds/mpegts.js/mpegts.js +2 -2
  513. package/sdk/tinymce.js +53 -53
  514. package/esm/_virtual/MiniDecimal.js +0 -8
  515. package/esm/_virtual/classCallCheck.js +0 -8
  516. package/esm/_virtual/createClass.js +0 -8
  517. package/esm/_virtual/interopRequireDefault.js +0 -8
  518. package/esm/_virtual/numberUtil.js +0 -8
  519. package/esm/_virtual/supportUtil.js +0 -8
  520. package/esm/node_modules/@babel/runtime/helpers/classCallCheck.js +0 -24
  521. package/esm/node_modules/@babel/runtime/helpers/createClass.js +0 -36
  522. package/esm/node_modules/@babel/runtime/helpers/interopRequireDefault.js +0 -15
  523. package/esm/node_modules/rc-input-number/lib/utils/MiniDecimal.js +0 -345
  524. package/esm/node_modules/rc-input-number/lib/utils/numberUtil.js +0 -146
  525. package/esm/node_modules/rc-input-number/lib/utils/supportUtil.js +0 -25
  526. package/esm/renderers/Table-v2/ColumnToggler.d.ts +0 -19
  527. package/esm/renderers/Table-v2/ColumnToggler.js +0 -88
  528. package/esm/renderers/Table-v2/HeadCellSearchDropdown.d.ts +0 -29
  529. package/esm/renderers/Table-v2/HeadCellSearchDropdown.js +0 -206
  530. package/esm/renderers/Table-v2/TableCell.d.ts +0 -6
  531. package/esm/renderers/Table-v2/TableCell.js +0 -30
  532. package/esm/renderers/Table-v2/index.d.ts +0 -285
  533. package/esm/renderers/Table-v2/index.js +0 -833
  534. package/lib/_virtual/MiniDecimal.js +0 -12
  535. package/lib/_virtual/classCallCheck.js +0 -12
  536. package/lib/_virtual/createClass.js +0 -12
  537. package/lib/_virtual/interopRequireDefault.js +0 -12
  538. package/lib/_virtual/numberUtil.js +0 -12
  539. package/lib/_virtual/supportUtil.js +0 -12
  540. package/lib/node_modules/@babel/runtime/helpers/classCallCheck.js +0 -28
  541. package/lib/node_modules/@babel/runtime/helpers/createClass.js +0 -40
  542. package/lib/node_modules/@babel/runtime/helpers/interopRequireDefault.js +0 -17
  543. package/lib/node_modules/rc-input-number/lib/utils/MiniDecimal.js +0 -349
  544. package/lib/node_modules/rc-input-number/lib/utils/numberUtil.js +0 -150
  545. package/lib/node_modules/rc-input-number/lib/utils/supportUtil.js +0 -29
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis v2.4.0
2
+ * amis v2.5.0-rc.0
3
3
  * Copyright 2018-2022 baidu
4
4
  */
5
5
 
@@ -111,8 +111,8 @@ interface NumberState {
111
111
  unit?: string;
112
112
  unitOptions?: Option[];
113
113
  }
114
- export declare type InputNumberRendererEvent = 'blur' | 'focus' | 'change';
115
- export declare type InputNumberRendererAction = 'clear';
114
+ export type InputNumberRendererEvent = 'blur' | 'focus' | 'change';
115
+ export type InputNumberRendererAction = 'clear';
116
116
  export default class NumberControl extends React.Component<NumberProps, NumberState> {
117
117
  input?: HTMLInputElement;
118
118
  static defaultProps: Partial<NumberProps>;
@@ -125,8 +125,8 @@ export default class NumberControl extends React.Component<NumberProps, NumberSt
125
125
  getValue(inputValue: any): any;
126
126
  dispatchEvent(eventName: string): Promise<void>;
127
127
  handleChange(inputValue: any): Promise<void>;
128
- /** 处理数字类的props,支持从数据域获取变量值 */
129
128
  filterNum(value: number | string | undefined): number | undefined;
129
+ filterNum(value: number | string | undefined, isbig: boolean | undefined): number | string | undefined;
130
130
  handleChangeUnit(option: Option): void;
131
131
  componentDidUpdate(prevProps: NumberProps): void;
132
132
  inputRef(ref: any): void;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis v2.4.0
2
+ * amis v2.5.0-rc.0
3
3
  * Copyright 2018-2022 baidu
4
4
  */
5
5
 
@@ -9,7 +9,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
10
  var tslib = require('tslib');
11
11
  var React = require('react');
12
- var MiniDecimal = require('../../node_modules/rc-input-number/lib/utils/MiniDecimal.js');
12
+ var MiniDecimal = require('rc-input-number/lib/utils/MiniDecimal');
13
13
  var amisCore = require('amis-core');
14
14
  var cx = require('classnames');
15
15
  var amisUi = require('amis-ui');
@@ -57,7 +57,7 @@ var NumberControl = /** @class */ (function (_super) {
57
57
  }
58
58
  else if (actionType === 'reset') {
59
59
  var finalPrecision = amisUi.NumberInput.normalizePrecision(this.filterNum(precision), this.filterNum(step));
60
- var value = amisUi.NumberInput.normalizeValue(resetValue !== null && resetValue !== void 0 ? resetValue : '', this.filterNum(min), this.filterNum(max), finalPrecision, resetValue !== null && resetValue !== void 0 ? resetValue : '', big);
60
+ var value = amisUi.NumberInput.normalizeValue(resetValue !== null && resetValue !== void 0 ? resetValue : '', this.filterNum(min, big), this.filterNum(max, big), finalPrecision, resetValue !== null && resetValue !== void 0 ? resetValue : '', big);
61
61
  onChange === null || onChange === void 0 ? void 0 : onChange(value);
62
62
  }
63
63
  };
@@ -131,13 +131,15 @@ var NumberControl = /** @class */ (function (_super) {
131
131
  });
132
132
  };
133
133
  /** 处理数字类的props,支持从数据域获取变量值 */
134
- NumberControl.prototype.filterNum = function (value) {
134
+ NumberControl.prototype.filterNum = function (value, isbig) {
135
+ if (isbig === void 0) { isbig = false; }
135
136
  if (typeof value === 'undefined') {
136
137
  return undefined;
137
138
  }
138
139
  if (typeof value !== 'number') {
139
140
  value = amisCore.filter(value, this.props.data);
140
- value = /^[-]?\d+/.test(value) ? +value : undefined;
141
+ // 大数模式,不转数字
142
+ value = /^[-]?\d+/.test(value) ? (isbig ? value : +value) : undefined;
141
143
  }
142
144
  return value;
143
145
  };
@@ -211,7 +213,7 @@ var NumberControl = /** @class */ (function (_super) {
211
213
  return (React__default["default"].createElement("div", { className: cx__default["default"]("".concat(ns, "NumberControl"), (_a = {},
212
214
  _a["".concat(ns, "NumberControl--withUnit")] = unitOptions,
213
215
  _a), className) },
214
- React__default["default"].createElement(amisUi.NumberInput, { inputRef: this.inputRef, value: finalValue, resetValue: resetValue, step: step, max: this.filterNum(max), min: this.filterNum(min), formatter: formatter, parser: parser, onChange: this.handleChange, disabled: disabled, placeholder: placeholder, precision: finalPrecision, showSteps: showSteps, borderMode: borderMode, readOnly: readOnly, onFocus: function () { return _this.dispatchEvent('focus'); }, onBlur: function () { return _this.dispatchEvent('blur'); }, keyboard: keyboard, displayMode: displayMode, big: big }),
216
+ React__default["default"].createElement(amisUi.NumberInput, { inputRef: this.inputRef, value: finalValue, resetValue: resetValue, step: step, max: this.filterNum(max, big), min: this.filterNum(min, big), formatter: formatter, parser: parser, onChange: this.handleChange, disabled: disabled, placeholder: placeholder, precision: finalPrecision, showSteps: showSteps, borderMode: borderMode, readOnly: readOnly, onFocus: function () { return _this.dispatchEvent('focus'); }, onBlur: function () { return _this.dispatchEvent('blur'); }, keyboard: keyboard, displayMode: displayMode, big: big }),
215
217
  unitOptions ? (React__default["default"].createElement(amisUi.Select, { value: unit, clearable: false, options: this.state.unitOptions || [], onChange: this.handleChangeUnit })) : null));
216
218
  };
217
219
  NumberControl.defaultProps = {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import InputDateRange, { DateRangeControlSchema } from './InputDateRange';
3
2
  /**
4
3
  * QuarterRange 季度范围控件
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis v2.4.0
2
+ * amis v2.5.0-rc.0
3
3
  * Copyright 2018-2022 baidu
4
4
  */
5
5
 
@@ -5,11 +5,11 @@ import { FormBaseControlSchema, SchemaObject } from '../../Schema';
5
5
  * Range
6
6
  * 文档:https://baidu.gitee.io/amis/docs/components/form/range
7
7
  */
8
- export declare type Value = string | MultipleValue | number | [number, number];
9
- export declare type FormatValue = MultipleValue | number;
10
- export declare type TooltipPosType = 'auto' | 'top' | 'right' | 'bottom' | 'left';
11
- export declare type InputRangeRendererEvent = 'change' | 'blur' | 'focus';
12
- export declare type InputRangeRendererAction = 'clear';
8
+ export type Value = string | MultipleValue | number | [number, number];
9
+ export type FormatValue = MultipleValue | number;
10
+ export type TooltipPosType = 'auto' | 'top' | 'right' | 'bottom' | 'left';
11
+ export type InputRangeRendererEvent = 'change' | 'blur' | 'focus';
12
+ export type InputRangeRendererAction = 'clear';
13
13
  export interface RangeControlSchema extends FormBaseControlSchema {
14
14
  type: 'input-range';
15
15
  /**
@@ -77,10 +77,10 @@ export interface RangeControlSchema extends FormBaseControlSchema {
77
77
  */
78
78
  clearable?: boolean;
79
79
  }
80
- declare type MarksType = {
80
+ type MarksType = {
81
81
  [index: string | number]: MarksValue;
82
82
  };
83
- declare type MarksValue = string | number | SchemaObject | {
83
+ type MarksValue = string | number | SchemaObject | {
84
84
  style?: React.CSSProperties;
85
85
  label?: string;
86
86
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis v2.4.0
2
+ * amis v2.5.0-rc.0
3
3
  * Copyright 2018-2022 baidu
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis v2.4.0
2
+ * amis v2.5.0-rc.0
3
3
  * Copyright 2018-2022 baidu
4
4
  */
5
5
 
@@ -58,8 +58,11 @@ var RatingControl = /** @class */ (function (_super) {
58
58
  };
59
59
  RatingControl.prototype.render = function () {
60
60
  var _a = this.props, className = _a.className, value = _a.value, count = _a.count, half = _a.half, readOnly = _a.readOnly, disabled = _a.disabled, onHoverChange = _a.onHoverChange, allowClear = _a.allowClear, char = _a.char, inactiveColor = _a.inactiveColor, colors = _a.colors, texts = _a.texts, charClassName = _a.charClassName, textClassName = _a.textClassName, textPosition = _a.textPosition, cx = _a.classnames;
61
+ var finalCount = getFinalCount(count, this.props.data);
62
+ // 限制最大 100 星,避免渲染卡死问题
63
+ finalCount > 100 && (finalCount = 100);
61
64
  return (React__default["default"].createElement("div", { className: cx('RatingControl', className) },
62
- React__default["default"].createElement(amisUi.Rating, { classnames: cx, value: value, disabled: disabled, count: count, half: half, allowClear: allowClear, readOnly: readOnly, char: char, inactiveColor: inactiveColor, colors: colors, texts: texts, charClassName: charClassName, textClassName: textClassName, textPosition: textPosition, onChange: this.handleChange, onHoverChange: function (value) {
65
+ React__default["default"].createElement(amisUi.Rating, { classnames: cx, value: value, disabled: disabled, count: finalCount, half: half, allowClear: allowClear, readOnly: readOnly, char: char, inactiveColor: inactiveColor, colors: colors, texts: texts, charClassName: charClassName, textClassName: textClassName, textPosition: textPosition, onChange: this.handleChange, onHoverChange: function (value) {
63
66
  onHoverChange && onHoverChange(value);
64
67
  } })));
65
68
  };
@@ -83,6 +86,12 @@ var RatingControl = /** @class */ (function (_super) {
83
86
  ], RatingControl.prototype, "render", null);
84
87
  return RatingControl;
85
88
  }(React__default["default"].Component));
89
+ function getFinalCount(name, data) {
90
+ if (typeof name === 'number') {
91
+ return name;
92
+ }
93
+ return amisCore.toNumber(amisCore.filter(name, data));
94
+ }
86
95
  /** @class */ ((function (_super) {
87
96
  tslib.__extends(RatingControlRenderer, _super);
88
97
  function RatingControlRenderer() {
@@ -91,7 +100,20 @@ var RatingControl = /** @class */ (function (_super) {
91
100
  RatingControlRenderer = tslib.__decorate([
92
101
  amisCore.FormItem({
93
102
  type: 'input-rating',
94
- sizeMutable: false
103
+ sizeMutable: false,
104
+ shouldComponentUpdate: function (props, prevProps) {
105
+ return getFinalCount(props.count, props.data) !==
106
+ getFinalCount(prevProps.count, prevProps.data);
107
+ },
108
+ detectProps: [
109
+ 'half',
110
+ 'allowClear',
111
+ 'colors',
112
+ 'inactiveColor',
113
+ 'texts',
114
+ 'textPosition',
115
+ 'char'
116
+ ]
95
117
  })
96
118
  ], RatingControlRenderer);
97
119
  return RatingControlRenderer;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis v2.4.0
2
+ * amis v2.5.0-rc.0
3
3
  * Copyright 2018-2022 baidu
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis v2.4.0
2
+ * amis v2.5.0-rc.0
3
3
  * Copyright 2018-2022 baidu
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis v2.4.0
2
+ * amis v2.5.0-rc.0
3
3
  * Copyright 2018-2022 baidu
4
4
  */
5
5
 
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { FormControlProps, FormBaseControl, SimpleMap, RendererData, ActionObject, ITableStore } from 'amis-core';
3
3
  import { TableSchema } from '../Table';
4
4
  import { SchemaApi } from '../../Schema';
5
+ import type { SchemaTokenizeableString } from '../../Schema';
5
6
  export interface TableControlSchema extends FormBaseControl, Omit<TableSchema, 'type'> {
6
7
  type: 'input-table';
7
8
  /**
@@ -120,6 +121,14 @@ export interface TableControlSchema extends FormBaseControl, Omit<TableSchema, '
120
121
  * 分页个数,默认不分页
121
122
  */
122
123
  perPage?: number;
124
+ /**
125
+ * 限制最大个数
126
+ */
127
+ maxLength?: number | SchemaTokenizeableString;
128
+ /**
129
+ * 限制最小个数
130
+ */
131
+ minLength?: number | SchemaTokenizeableString;
123
132
  }
124
133
  export interface TableProps extends FormControlProps, Omit<TableControlSchema, 'type' | 'className' | 'descriptionClassName' | 'inputClassName'> {
125
134
  }
@@ -142,6 +151,8 @@ export default class FormTable extends React.Component<TableProps, TableState> {
142
151
  confirmBtnIcon: string;
143
152
  cancelBtnIcon: string;
144
153
  valueField: string;
154
+ minLength: number;
155
+ maxLength: number;
145
156
  };
146
157
  static propsList: Array<string>;
147
158
  entries: SimpleMap<any, number>;
@@ -153,13 +164,14 @@ export default class FormTable extends React.Component<TableProps, TableState> {
153
164
  constructor(props: TableProps);
154
165
  componentDidUpdate(nextProps: TableProps): void;
155
166
  componentWillUnmount(): void;
167
+ resolveVariableProps(props: TableProps, key: 'minLength' | 'maxLength'): number;
156
168
  subFormRef(form: any, x: number, y: number): void;
157
169
  validate(): Promise<string | void>;
158
170
  emitValue(): void;
159
171
  doAction(action: ActionObject, ctx: RendererData, ...rest: Array<any>): Promise<any>;
160
172
  copyItem(index: number): void;
161
173
  addItem(index: number): void;
162
- startEdit(index: number, isCreate?: boolean): void;
174
+ startEdit(index: number, isCreate?: boolean, isCopy?: boolean): void;
163
175
  confirmEdit(): Promise<void>;
164
176
  cancelEdit(): void;
165
177
  removeItem(index: number): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * amis v2.4.0
2
+ * amis v2.5.0-rc.0
3
3
  * Copyright 2018-2022 baidu
4
4
  */
5
5
 
@@ -18,6 +18,7 @@ var isEqual = require('lodash/isEqual');
18
18
  var inRange = require('lodash/inRange');
19
19
  var find = require('lodash/find');
20
20
  var moment = require('moment');
21
+ var merge = require('lodash/merge');
21
22
 
22
23
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
23
24
 
@@ -29,6 +30,7 @@ var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
29
30
  var inRange__default = /*#__PURE__*/_interopDefaultLegacy(inRange);
30
31
  var find__default = /*#__PURE__*/_interopDefaultLegacy(find);
31
32
  var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
33
+ var merge__default = /*#__PURE__*/_interopDefaultLegacy(merge);
32
34
 
33
35
  var FormTable = /** @class */ (function (_super) {
34
36
  tslib.__extends(FormTable, _super);
@@ -69,17 +71,42 @@ var FormTable = /** @class */ (function (_super) {
69
71
  FormTable.prototype.componentWillUnmount = function () {
70
72
  this.entries.dispose();
71
73
  };
74
+ FormTable.prototype.resolveVariableProps = function (props, key) {
75
+ var defaultMap = {
76
+ minLength: 0,
77
+ maxLength: Infinity
78
+ };
79
+ var value = props[key];
80
+ if (!value) {
81
+ return defaultMap[key];
82
+ }
83
+ if (typeof value === 'string') {
84
+ if (amisCore.isPureVariable(value)) {
85
+ var resolved = amisCore.resolveVariableAndFilter(value, props.data, '| raw');
86
+ value = (typeof resolved === 'number' && resolved >= 0
87
+ ? resolved
88
+ : defaultMap[key]);
89
+ }
90
+ else {
91
+ var parsed = parseInt(value, 10);
92
+ value = (isNaN(parsed) ? defaultMap[key] : parsed);
93
+ }
94
+ }
95
+ return value;
96
+ };
72
97
  FormTable.prototype.subFormRef = function (form, x, y) {
73
98
  this.subForms["".concat(x, "-").concat(y)] = form;
74
99
  };
75
100
  FormTable.prototype.validate = function () {
76
101
  return tslib.__awaiter(this, void 0, void 0, function () {
77
- var _a, value, minLength, maxLength, __, columns, subForms_1, results_1, msg, uniqueColumn_1, children;
102
+ var _a, value, __, columns, minLength, maxLength, subForms_1, results_1, msg, uniqueColumn_1, children;
78
103
  var _this = this;
79
104
  return tslib.__generator(this, function (_b) {
80
105
  switch (_b.label) {
81
106
  case 0:
82
- _a = this.props, value = _a.value, minLength = _a.minLength, maxLength = _a.maxLength, __ = _a.translate, columns = _a.columns;
107
+ _a = this.props, value = _a.value, __ = _a.translate, columns = _a.columns;
108
+ minLength = this.resolveVariableProps(this.props, 'minLength');
109
+ maxLength = this.resolveVariableProps(this.props, 'maxLength');
83
110
  // todo: 如果当前正在编辑中,表单提交了,应该先让正在编辑的东西提交然后再做验证。
84
111
  if (~this.state.editIndex) {
85
112
  return [2 /*return*/, __('Table.editing')];
@@ -139,17 +166,18 @@ var FormTable = /** @class */ (function (_super) {
139
166
  onChange === null || onChange === void 0 ? void 0 : onChange(items);
140
167
  };
141
168
  FormTable.prototype.doAction = function (action, ctx) {
169
+ var _a, _b;
142
170
  var rest = [];
143
171
  for (var _i = 2; _i < arguments.length; _i++) {
144
172
  rest[_i - 2] = arguments[_i];
145
173
  }
146
174
  return tslib.__awaiter(this, void 0, void 0, function () {
147
- var _a, onAction, valueField, env, needConfirm, addable, addApi, __, items_1, toAdd_1, payload, items_2, toRemove;
175
+ var _c, onAction, valueField, env, needConfirm, addable, addApi, __, items_1, toAdd_1, payload, items_2, toRemove;
148
176
  var _this = this;
149
- return tslib.__generator(this, function (_b) {
150
- switch (_b.label) {
177
+ return tslib.__generator(this, function (_d) {
178
+ switch (_d.label) {
151
179
  case 0:
152
- _a = this.props, onAction = _a.onAction, valueField = _a.valueField, env = _a.env, _a.onChange, _a.editable, needConfirm = _a.needConfirm, addable = _a.addable, addApi = _a.addApi, __ = _a.translate;
180
+ _c = this.props, onAction = _c.onAction, valueField = _c.valueField, env = _c.env, _c.onChange, _c.editable, needConfirm = _c.needConfirm, addable = _c.addable, addApi = _c.addApi, __ = _c.translate;
153
181
  if (!(action.actionType === 'add')) return [3 /*break*/, 6];
154
182
  if (addable === false) {
155
183
  return [2 /*return*/];
@@ -160,9 +188,9 @@ var FormTable = /** @class */ (function (_super) {
160
188
  if (!amisCore.isEffectiveApi(addApi, ctx)) return [3 /*break*/, 2];
161
189
  return [4 /*yield*/, env.fetcher(addApi, ctx)];
162
190
  case 1:
163
- payload = _b.sent();
191
+ payload = _d.sent();
164
192
  if (payload && !payload.ok) {
165
- env.notify('error', payload.msg || __('fetchFailed'));
193
+ env.notify('error', (_b = (_a = addApi === null || addApi === void 0 ? void 0 : addApi.messages) === null || _a === void 0 ? void 0 : _a.failed) !== null && _b !== void 0 ? _b : (payload.msg || __('fetchFailed')));
166
194
  return [2 /*return*/];
167
195
  }
168
196
  else if (payload && payload.ok) {
@@ -171,7 +199,7 @@ var FormTable = /** @class */ (function (_super) {
171
199
  return [3 /*break*/, 3];
172
200
  case 2:
173
201
  toAdd_1 = amisCore.dataMapping(action.payload, ctx);
174
- _b.label = 3;
202
+ _d.label = 3;
175
203
  case 3:
176
204
  toAdd_1 = Array.isArray(toAdd_1) ? toAdd_1 : [toAdd_1];
177
205
  toAdd_1.forEach(function (toAdd) {
@@ -216,7 +244,7 @@ var FormTable = /** @class */ (function (_super) {
216
244
  // todo 如果配置删除 Api 怎么办?
217
245
  return [2 /*return*/];
218
246
  }
219
- _b.label = 7;
247
+ _d.label = 7;
220
248
  case 7: return [2 /*return*/, onAction && onAction.apply(void 0, tslib.__spreadArray([action, ctx], rest, false))];
221
249
  }
222
250
  });
@@ -235,7 +263,7 @@ var FormTable = /** @class */ (function (_super) {
235
263
  _this.emitValue();
236
264
  }
237
265
  else {
238
- _this.startEdit(index, true);
266
+ _this.startEdit(index, true, true);
239
267
  }
240
268
  });
241
269
  };
@@ -269,7 +297,7 @@ var FormTable = /** @class */ (function (_super) {
269
297
  }
270
298
  });
271
299
  }
272
- value = tslib.__assign(tslib.__assign({}, value), scaffold);
300
+ value = merge__default["default"]({}, value, scaffold);
273
301
  if (needConfirm === false) {
274
302
  delete value.__isPlaceholder;
275
303
  }
@@ -286,23 +314,25 @@ var FormTable = /** @class */ (function (_super) {
286
314
  }
287
315
  });
288
316
  };
289
- FormTable.prototype.startEdit = function (index, isCreate) {
317
+ FormTable.prototype.startEdit = function (index, isCreate, isCopy) {
290
318
  if (isCreate === void 0) { isCreate = false; }
319
+ if (isCopy === void 0) { isCopy = false; }
291
320
  this.setState({
292
321
  editIndex: index,
293
322
  isCreateMode: isCreate,
294
- raw: this.state.items[index],
323
+ raw: isCopy ? undefined : this.state.items[index],
295
324
  columns: this.buildColumns(this.props, isCreate)
296
325
  });
297
326
  };
298
327
  FormTable.prototype.confirmEdit = function () {
328
+ var _a, _b;
299
329
  return tslib.__awaiter(this, void 0, void 0, function () {
300
- var _a, addApi, updateApi, data, env, __, subForms, items, item, isNew, remote;
330
+ var _c, addApi, updateApi, data, env, __, subForms, items, item, isNew, remote, apiMsg;
301
331
  var _this = this;
302
- return tslib.__generator(this, function (_b) {
303
- switch (_b.label) {
332
+ return tslib.__generator(this, function (_d) {
333
+ switch (_d.label) {
304
334
  case 0:
305
- _a = this.props, addApi = _a.addApi, updateApi = _a.updateApi, data = _a.data, env = _a.env, __ = _a.translate;
335
+ _c = this.props, addApi = _c.addApi, updateApi = _c.updateApi, data = _c.data, env = _c.env, __ = _c.translate;
306
336
  subForms = [];
307
337
  Object.keys(this.subForms).forEach(function (key) { return _this.subForms[key] && subForms.push(_this.subForms[key]); });
308
338
  subForms.forEach(function (form) { return form.flush(); });
@@ -310,26 +340,27 @@ var FormTable = /** @class */ (function (_super) {
310
340
  item = tslib.__assign({}, items[this.state.editIndex]);
311
341
  isNew = item.__isPlaceholder;
312
342
  remote = null;
343
+ apiMsg = undefined;
313
344
  if (!(isNew && amisCore.isEffectiveApi(addApi, amisCore.createObject(data, item)))) return [3 /*break*/, 2];
314
345
  return [4 /*yield*/, env.fetcher(addApi, amisCore.createObject(data, item))];
315
346
  case 1:
316
- remote = _b.sent();
347
+ remote = _d.sent();
348
+ apiMsg = (_a = addApi === null || addApi === void 0 ? void 0 : addApi.messages) === null || _a === void 0 ? void 0 : _a.failed;
317
349
  return [3 /*break*/, 4];
318
350
  case 2:
319
351
  if (!amisCore.isEffectiveApi(updateApi, amisCore.createObject(data, item))) return [3 /*break*/, 4];
320
352
  return [4 /*yield*/, env.fetcher(updateApi, amisCore.createObject(data, item))];
321
353
  case 3:
322
- remote = _b.sent();
323
- _b.label = 4;
354
+ remote = _d.sent();
355
+ apiMsg = (_b = updateApi === null || updateApi === void 0 ? void 0 : updateApi.messages) === null || _b === void 0 ? void 0 : _b.failed;
356
+ _d.label = 4;
324
357
  case 4:
325
358
  if (remote && !remote.ok) {
326
- env.notify('error', remote.msg || __('saveFailed'));
359
+ env.notify('error', apiMsg !== null && apiMsg !== void 0 ? apiMsg : (remote.msg || __('saveFailed')));
327
360
  return [2 /*return*/];
328
361
  }
329
362
  else if (remote && remote.ok) {
330
- item = tslib.__assign(tslib.__assign({}, ((isNew ? addApi : updateApi).replaceData
331
- ? {}
332
- : item)), remote.data);
363
+ item = merge__default["default"]({}, (isNew ? addApi : updateApi).replaceData ? {} : item, remote.data);
333
364
  }
334
365
  delete item.__isPlaceholder;
335
366
  items.splice(this.state.editIndex, 1, item);
@@ -345,12 +376,12 @@ var FormTable = /** @class */ (function (_super) {
345
376
  };
346
377
  FormTable.prototype.cancelEdit = function () {
347
378
  var items = this.state.items.concat();
348
- if (this.state.isCreateMode) {
349
- items = items.filter(function (item) { return !item.__isPlaceholder; });
350
- }
351
- else if (this.state.raw) {
379
+ if (this.state.raw) {
352
380
  items.splice(this.state.editIndex, 1, this.state.raw);
353
381
  }
382
+ else {
383
+ items.splice(this.state.editIndex, 1);
384
+ }
354
385
  this.setState({
355
386
  editIndex: -1,
356
387
  raw: undefined,
@@ -358,12 +389,13 @@ var FormTable = /** @class */ (function (_super) {
358
389
  }, this.emitValue);
359
390
  };
360
391
  FormTable.prototype.removeItem = function (index) {
392
+ var _a, _b;
361
393
  return tslib.__awaiter(this, void 0, void 0, function () {
362
- var _a, value, onChange, deleteApi, deleteConfirmText, env, data, __, newValue, item, ctx, confirmed, result;
363
- return tslib.__generator(this, function (_b) {
364
- switch (_b.label) {
394
+ var _c, value, onChange, deleteApi, deleteConfirmText, env, data, __, newValue, item, ctx, confirmed, result;
395
+ return tslib.__generator(this, function (_d) {
396
+ switch (_d.label) {
365
397
  case 0:
366
- _a = this.props, value = _a.value, onChange = _a.onChange, deleteApi = _a.deleteApi, deleteConfirmText = _a.deleteConfirmText, env = _a.env, data = _a.data, __ = _a.translate;
398
+ _c = this.props, value = _c.value, onChange = _c.onChange, deleteApi = _c.deleteApi, deleteConfirmText = _c.deleteConfirmText, env = _c.env, data = _c.data, __ = _c.translate;
367
399
  newValue = Array.isArray(value) ? value.concat() : [];
368
400
  item = newValue[index];
369
401
  if (!item) {
@@ -373,19 +405,19 @@ var FormTable = /** @class */ (function (_super) {
373
405
  if (!amisCore.isEffectiveApi(deleteApi, ctx)) return [3 /*break*/, 3];
374
406
  return [4 /*yield*/, env.confirm(deleteConfirmText ? amisCore.filter(deleteConfirmText, ctx) : __('deleteConfirm'))];
375
407
  case 1:
376
- confirmed = _b.sent();
408
+ confirmed = _d.sent();
377
409
  if (!confirmed) {
378
410
  // 如果不确认,则跳过!
379
411
  return [2 /*return*/];
380
412
  }
381
413
  return [4 /*yield*/, env.fetcher(deleteApi, ctx)];
382
414
  case 2:
383
- result = _b.sent();
415
+ result = _d.sent();
384
416
  if (!result.ok) {
385
- env.notify('error', __('deleteFailed'));
417
+ env.notify('error', (_b = (_a = deleteApi === null || deleteApi === void 0 ? void 0 : deleteApi.messages) === null || _a === void 0 ? void 0 : _a.failed) !== null && _b !== void 0 ? _b : __('deleteFailed'));
386
418
  return [2 /*return*/];
387
419
  }
388
- _b.label = 3;
420
+ _d.label = 3;
389
421
  case 3:
390
422
  this.removeEntry(item);
391
423
  newValue.splice(index, 1);
@@ -427,12 +459,15 @@ var FormTable = /** @class */ (function (_super) {
427
459
  var __ = this.props.translate;
428
460
  var needConfirm = this.props.needConfirm;
429
461
  var showIndex = this.props.showIndex;
462
+ var minLength = this.resolveVariableProps(this.props, 'minLength');
463
+ var maxLength = this.resolveVariableProps(this.props, 'maxLength');
430
464
  var btns = [];
431
465
  if (props.addable && props.showAddBtn !== false) {
432
466
  btns.push({
433
467
  children: function (_a) {
434
468
  var key = _a.key, rowIndex = _a.rowIndex, offset = _a.offset;
435
- return ~_this.state.editIndex && needConfirm !== false ? null : (React__default["default"].createElement(amisUi.Button, { classPrefix: ns, size: "sm", key: key, level: "link", tooltip: __('Table.addRow'), tooltipContainer: env && env.getModalContainer ? env.getModalContainer : undefined, onClick: _this.addItem.bind(_this, rowIndex + offset, undefined) },
469
+ return (~_this.state.editIndex && needConfirm !== false) ||
470
+ maxLength <= _this.state.items.length ? null : (React__default["default"].createElement(amisUi.Button, { classPrefix: ns, size: "sm", key: key, level: "link", tooltip: __('Table.addRow'), tooltipContainer: env && env.getModalContainer ? env.getModalContainer : undefined, onClick: _this.addItem.bind(_this, rowIndex + offset, undefined) },
436
471
  props.addBtnLabel ? React__default["default"].createElement("span", null, props.addBtnLabel) : null,
437
472
  props.addBtnIcon ? (typeof props.addBtnIcon === 'string' ? (React__default["default"].createElement(amisUi.Icon, { icon: props.addBtnIcon, className: "icon" })) : (amisCore.generateIcon(props.classnames, props.addBtnIcon))) : null));
438
473
  }
@@ -497,8 +532,9 @@ var FormTable = /** @class */ (function (_super) {
497
532
  btns.push({
498
533
  children: function (_a) {
499
534
  var key = _a.key, rowIndex = _a.rowIndex, data = _a.data, offset = _a.offset;
500
- return (~_this.state.editIndex || (data && data.__isPlaceholder)) &&
501
- needConfirm !== false ? null : (React__default["default"].createElement(amisUi.Button, { classPrefix: ns, size: "sm", key: key, level: "link", tooltip: __('Table.deleteRow'), tooltipContainer: env && env.getModalContainer ? env.getModalContainer : undefined, onClick: _this.removeItem.bind(_this, rowIndex + offset) },
535
+ return ((~_this.state.editIndex || (data && data.__isPlaceholder)) &&
536
+ needConfirm !== false) ||
537
+ minLength >= _this.state.items.length ? null : (React__default["default"].createElement(amisUi.Button, { classPrefix: ns, size: "sm", key: key, level: "link", tooltip: __('Table.deleteRow'), tooltipContainer: env && env.getModalContainer ? env.getModalContainer : undefined, onClick: _this.removeItem.bind(_this, rowIndex + offset) },
502
538
  props.deleteBtnLabel ? (React__default["default"].createElement("span", null, props.deleteBtnLabel)) : null,
503
539
  props.deleteBtnIcon ? (typeof props.deleteBtnIcon === 'string' ? (React__default["default"].createElement(amisUi.Icon, { icon: props.deleteBtnIcon, className: "icon" })) : (amisCore.generateIcon(props.classnames, props.deleteBtnIcon))) : null));
504
540
  }
@@ -571,7 +607,7 @@ var FormTable = /** @class */ (function (_super) {
571
607
  indexes[0] += (page - 1) * perPage;
572
608
  }
573
609
  var origin = amisCore.getTree(items, indexes);
574
- var data = tslib.__assign(tslib.__assign({}, origin), diff[index]);
610
+ var data = merge__default["default"]({}, origin, diff[index]);
575
611
  items = amisCore.spliceTree(items, indexes, 1, data);
576
612
  });
577
613
  }
@@ -583,7 +619,7 @@ var FormTable = /** @class */ (function (_super) {
583
619
  indexes[0] += (page - 1) * perPage;
584
620
  }
585
621
  var origin_2 = amisCore.getTree(items, indexes);
586
- var data = tslib.__assign(tslib.__assign({}, origin_2), diff);
622
+ var data = merge__default["default"]({}, origin_2, diff);
587
623
  items = amisCore.spliceTree(items, indexes, 1, data);
588
624
  this.entries.set(data, this.entries.get(origin_2) || this.entityId++);
589
625
  // this.entries.delete(origin); // 反正最后都会清理的,先不删了吧。
@@ -650,6 +686,7 @@ var FormTable = /** @class */ (function (_super) {
650
686
  var _this = this;
651
687
  var _a, _b;
652
688
  var _c = this.props, className = _c.className; _c.value; var showAddBtn = _c.showAddBtn, disabled = _c.disabled, render = _c.render, placeholder = _c.placeholder, draggable = _c.draggable, addable = _c.addable, columnsTogglable = _c.columnsTogglable, combineNum = _c.combineNum, combineFromIndex = _c.combineFromIndex, __ = _c.translate, canAccessSuperData = _c.canAccessSuperData, expandConfig = _c.expandConfig, affixRow = _c.affixRow, prefixRow = _c.prefixRow, formInited = _c.formInited, perPage = _c.perPage, cx = _c.classnames, rowClassName = _c.rowClassName, rowClassNameExpr = _c.rowClassNameExpr, _d = _c.affixHeader, affixHeader = _d === void 0 ? false : _d, _e = _c.autoFillHeight, autoFillHeight = _e === void 0 ? false : _e, tableContentClassName = _c.tableContentClassName;
689
+ var maxLength = this.resolveVariableProps(this.props, 'maxLength');
653
690
  if (formInited === false) {
654
691
  return null;
655
692
  }
@@ -699,7 +736,10 @@ var FormTable = /** @class */ (function (_super) {
699
736
  // TODO: 这里是为了处理columns里使用value变量添加的,目前会影响初始化数据加载后的组件行为,先回滚
700
737
  // onPristineChange: this.handlePristineChange
701
738
  }),
702
- (addable && showAddBtn !== false) || showPager ? (React__default["default"].createElement("div", { className: cx('InputTable-toolbar') },
739
+ (addable &&
740
+ showAddBtn !== false &&
741
+ (!maxLength || maxLength > items.length)) ||
742
+ showPager ? (React__default["default"].createElement("div", { className: cx('InputTable-toolbar') },
703
743
  addable && showAddBtn !== false ? (React__default["default"].createElement(amisUi.Button, { disabled: disabled, size: "sm", onClick: function () { return _this.addItem(_this.state.items.length); } },
704
744
  React__default["default"].createElement(amisUi.Icon, { icon: "plus", className: "icon" }),
705
745
  React__default["default"].createElement("span", null, __('add')))) : null,
@@ -723,7 +763,9 @@ var FormTable = /** @class */ (function (_super) {
723
763
  deleteBtnIcon: 'minus',
724
764
  confirmBtnIcon: 'check',
725
765
  cancelBtnIcon: 'close',
726
- valueField: ''
766
+ valueField: '',
767
+ minLength: 0,
768
+ maxLength: Infinity
727
769
  };
728
770
  FormTable.propsList = [
729
771
  'onChange',
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { OptionsControlProps, Option } from 'amis-core';
3
3
  import { ActionObject } from 'amis-core';
4
4
  import { FormOptionsSchema } from '../../Schema';
5
+ import { TooltipWrapperSchema } from '../TooltipWrapper';
5
6
  /**
6
7
  * Tag 输入框
7
8
  * 文档:https://baidu.gitee.io/amis/docs/components/form/tag
@@ -31,7 +32,7 @@ export interface TagControlSchema extends FormOptionsSchema {
31
32
  /**
32
33
  * 收纳标签的Popover配置
33
34
  */
34
- overflowTagPopover?: object;
35
+ overflowTagPopover?: TooltipWrapperSchema;
35
36
  /** 是否开启批量添加模式 */
36
37
  enableBatchAdd: boolean;
37
38
  /**
@@ -41,7 +42,7 @@ export interface TagControlSchema extends FormOptionsSchema {
41
42
  */
42
43
  separator?: string;
43
44
  }
44
- export declare type InputTagValidationType = 'max' | 'maxLength';
45
+ export type InputTagValidationType = 'max' | 'maxLength';
45
46
  export interface TagProps extends OptionsControlProps {
46
47
  placeholder?: string;
47
48
  clearable: boolean;