amis-ui 2.0.2 → 2.2.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 (633) hide show
  1. package/esm/components/404.js +1 -1
  2. package/esm/components/Alert.js +1 -1
  3. package/esm/components/Alert2.js +2 -2
  4. package/esm/components/AnchorNav.js +8 -8
  5. package/esm/components/ArrayInput.js +1 -1
  6. package/esm/components/AsideNav.d.ts +11 -11
  7. package/esm/components/AsideNav.js +1 -1
  8. package/esm/components/AssociatedSelection.js +1 -1
  9. package/esm/components/Avatar.js +1 -1
  10. package/esm/components/Badge.d.ts +1 -1
  11. package/esm/components/Badge.js +2 -4
  12. package/esm/components/BaiduMapPicker.js +3 -3
  13. package/esm/components/BarCode.js +38 -2
  14. package/esm/components/Breadcrumb.js +2 -2
  15. package/esm/components/Button.js +1 -1
  16. package/esm/components/CalendarMobile.js +1 -1
  17. package/esm/components/Card.js +1 -1
  18. package/esm/components/Cascader.js +3 -9
  19. package/esm/components/ChainedSelection.js +1 -1
  20. package/esm/components/Checkbox.js +1 -1
  21. package/esm/components/CityArea.js +2 -2
  22. package/esm/components/CityDB.js +4097 -2
  23. package/esm/components/CodeMirror.js +1 -1
  24. package/esm/components/Collapse.js +1 -1
  25. package/esm/components/CollapseGroup.js +1 -1
  26. package/esm/components/ColorPicker.js +198 -2
  27. package/esm/components/ContextMenu.js +1 -1
  28. package/esm/components/DatePicker.d.ts +43 -40
  29. package/esm/components/DatePicker.js +11 -4
  30. package/esm/components/DateRangePicker.d.ts +144 -81
  31. package/esm/components/DateRangePicker.js +191 -80
  32. package/esm/components/Drawer.d.ts +10 -10
  33. package/esm/components/Drawer.js +1 -1
  34. package/esm/components/Editor.d.ts +47 -41
  35. package/esm/components/Editor.js +9 -8
  36. package/esm/components/Form.js +1 -1
  37. package/esm/components/FormField.js +1 -1
  38. package/esm/components/GridNav.js +1 -1
  39. package/esm/components/GroupedSelection.js +1 -1
  40. package/esm/components/Html.js +1 -1
  41. package/esm/components/ImageGallery.d.ts +70 -40
  42. package/esm/components/ImageGallery.js +97 -15
  43. package/esm/components/Input.js +1 -1
  44. package/esm/components/InputBox.js +1 -1
  45. package/esm/components/InputBoxWithSuggestion.js +1 -1
  46. package/esm/components/Layout.js +1 -1
  47. package/esm/components/Link.js +1 -1
  48. package/esm/components/ListGroup.d.ts +10 -10
  49. package/esm/components/ListGroup.js +1 -1
  50. package/esm/components/ListMenu.js +1 -1
  51. package/esm/components/LocationPicker.js +1 -1
  52. package/esm/components/Markdown.js +56 -2
  53. package/esm/components/Modal.d.ts +60 -58
  54. package/esm/components/Modal.js +9 -4
  55. package/esm/components/ModalManager.js +1 -1
  56. package/esm/components/NumberInput.js +2 -2
  57. package/esm/components/Pagination.d.ts +49 -66
  58. package/esm/components/Pagination.js +4 -4
  59. package/esm/components/Picker.js +1 -1
  60. package/esm/components/PickerColumn.js +1 -1
  61. package/esm/components/PickerContainer.js +1 -1
  62. package/esm/components/PopOverContainer.d.ts +1 -0
  63. package/esm/components/PopOverContainer.js +3 -3
  64. package/esm/components/PopUp.js +1 -1
  65. package/esm/components/Progress.d.ts +16 -10
  66. package/esm/components/Progress.js +27 -5
  67. package/esm/components/PullRefresh.js +1 -1
  68. package/esm/components/Radios.js +1 -1
  69. package/esm/components/Range.js +3 -2
  70. package/esm/components/Rating.js +1 -1
  71. package/esm/components/ResultBox.js +7 -3
  72. package/esm/components/ResultList.js +1 -1
  73. package/esm/components/ResultTableList.js +1 -1
  74. package/esm/components/ResultTreeList.js +1 -1
  75. package/esm/components/RichText.js +258 -2
  76. package/esm/components/SearchBox.js +1 -1
  77. package/esm/components/Select.d.ts +194 -193
  78. package/esm/components/Select.js +9 -5
  79. package/esm/components/Selection.js +1 -1
  80. package/esm/components/SparkLine.d.ts +40 -40
  81. package/esm/components/SparkLine.js +1 -1
  82. package/esm/components/Spinner.js +1 -1
  83. package/esm/components/Steps.js +1 -1
  84. package/esm/components/Switch.js +1 -1
  85. package/esm/components/TableSelection.js +1 -1
  86. package/esm/components/Tabs.d.ts +149 -13
  87. package/esm/components/Tabs.js +39 -11
  88. package/esm/components/TabsTransfer.js +1 -1
  89. package/esm/components/TabsTransferPicker.js +1 -1
  90. package/esm/components/Tag.js +1 -1
  91. package/esm/components/Textarea.js +4 -2
  92. package/esm/components/Timeline.js +1 -1
  93. package/esm/components/TimelineItem.js +4 -4
  94. package/esm/components/Tinymce.d.ts +1 -3
  95. package/esm/components/Tinymce.js +561 -2
  96. package/esm/components/TitleBar.js +1 -1
  97. package/esm/components/Toast.js +1 -1
  98. package/esm/components/Tooltip.js +1 -1
  99. package/esm/components/TooltipWrapper.js +1 -1
  100. package/esm/components/Transfer.js +11 -4
  101. package/esm/components/TransferDropDown.js +4 -5
  102. package/esm/components/TransferPicker.js +1 -1
  103. package/esm/components/TransferSearch.js +1 -1
  104. package/esm/components/Tree.js +34 -33
  105. package/esm/components/TreeSelection.js +1 -1
  106. package/esm/components/UserSelect.js +5 -3
  107. package/esm/components/UserTabSelect.js +1 -1
  108. package/esm/components/WithRemoteConfig.js +1 -1
  109. package/esm/components/WithStore.js +1 -1
  110. package/esm/components/calendar/Calendar.d.ts +1 -0
  111. package/esm/components/calendar/Calendar.js +7 -2
  112. package/esm/components/calendar/CalendarContainer.js +1 -1
  113. package/esm/components/calendar/DaysView.d.ts +1 -1
  114. package/esm/components/calendar/DaysView.js +65 -29
  115. package/esm/components/calendar/MonthsView.js +1 -1
  116. package/esm/components/calendar/QuartersView.js +1 -1
  117. package/esm/components/calendar/TimeView.d.ts +0 -1
  118. package/esm/components/calendar/TimeView.js +5 -6
  119. package/esm/components/calendar/YearsView.js +1 -1
  120. package/esm/components/condition-builder/Expression.js +1 -1
  121. package/esm/components/condition-builder/Field.js +1 -1
  122. package/esm/components/condition-builder/Formula.js +1 -1
  123. package/esm/components/condition-builder/Func.js +1 -1
  124. package/esm/components/condition-builder/Group.js +1 -1
  125. package/esm/components/condition-builder/GroupOrItem.js +4 -4
  126. package/esm/components/condition-builder/InputSwitch.js +1 -1
  127. package/esm/components/condition-builder/Item.js +1 -1
  128. package/esm/components/condition-builder/Value.js +1 -1
  129. package/esm/components/condition-builder/config.js +1 -1
  130. package/esm/components/condition-builder/index.js +1 -1
  131. package/esm/components/formula/Editor.js +1 -1
  132. package/esm/components/formula/FuncList.js +1 -1
  133. package/esm/components/formula/Picker.d.ts +1 -0
  134. package/esm/components/formula/Picker.js +10 -1
  135. package/esm/components/formula/VariableList.js +1 -1
  136. package/esm/components/formula/plugin.d.ts +1 -0
  137. package/esm/components/formula/plugin.js +11 -4
  138. package/esm/components/icons.d.ts +2 -1
  139. package/esm/components/icons.js +18 -1
  140. package/esm/components/json-schema/Array.js +1 -1
  141. package/esm/components/json-schema/Item.js +1 -1
  142. package/esm/components/json-schema/Object.js +1 -1
  143. package/esm/components/json-schema/index.js +1 -1
  144. package/esm/components/schema-editor/Array.js +1 -1
  145. package/esm/components/schema-editor/Common.js +1 -1
  146. package/esm/components/schema-editor/Item.js +1 -1
  147. package/esm/components/schema-editor/Object.js +1 -1
  148. package/esm/components/schema-editor/SchemaVariableList.js +1 -1
  149. package/esm/components/schema-editor/SchemaVariableListPicker.js +1 -1
  150. package/esm/components/schema-editor/index.js +1 -1
  151. package/esm/components/table/Cell.d.ts +2 -1
  152. package/esm/components/table/Cell.js +1 -1
  153. package/esm/components/table/HeadCellDropDown.d.ts +3 -1
  154. package/esm/components/table/HeadCellDropDown.js +1 -1
  155. package/esm/components/table/HeadCellFilter.d.ts +3 -2
  156. package/esm/components/table/HeadCellFilter.js +4 -4
  157. package/esm/components/table/HeadCellSelect.d.ts +3 -2
  158. package/esm/components/table/HeadCellSelect.js +4 -2
  159. package/esm/components/table/HeadCellSort.d.ts +4 -3
  160. package/esm/components/table/HeadCellSort.js +6 -6
  161. package/esm/components/table/ItemActionsWrapper.js +1 -1
  162. package/esm/components/table/index.d.ts +3 -4
  163. package/esm/components/table/index.js +9 -9
  164. package/esm/components/virtual-list/SizeAndPositionManager.js +1 -1
  165. package/esm/components/virtual-list/constants.js +1 -1
  166. package/esm/components/virtual-list/index.d.ts +3 -3
  167. package/esm/components/virtual-list/index.js +1 -1
  168. package/esm/hooks/use-set-state.js +1 -1
  169. package/esm/hooks/use-touch.js +1 -1
  170. package/esm/hooks/use-update-effect.js +1 -1
  171. package/esm/hooks/use-validation-resolver.js +1 -1
  172. package/esm/icons/alert-danger.svg.js +2 -2
  173. package/esm/icons/alert-info.svg.js +1 -1
  174. package/esm/icons/alert-success.svg.js +2 -2
  175. package/esm/icons/alert-warning.svg.js +2 -2
  176. package/esm/icons/back.svg.js +1 -1
  177. package/esm/icons/calendar.svg.js +1 -1
  178. package/esm/icons/caret.svg.js +1 -1
  179. package/esm/icons/check-circle.svg.js +36 -0
  180. package/esm/icons/check.svg.js +1 -1
  181. package/esm/icons/clock.svg.js +1 -1
  182. package/esm/icons/close-small.svg.js +1 -1
  183. package/esm/icons/close.svg.js +1 -1
  184. package/esm/icons/cloud-upload.svg.js +1 -1
  185. package/esm/icons/column-filter.svg.js +1 -1
  186. package/esm/icons/columns.svg.js +1 -1
  187. package/esm/icons/compress-alt.svg.js +1 -1
  188. package/esm/icons/copy.svg.js +1 -1
  189. package/esm/icons/date.svg.js +1 -1
  190. package/esm/icons/department.svg.js +1 -1
  191. package/esm/icons/desk-empty.svg.js +1 -1
  192. package/esm/icons/dot.svg.js +1 -1
  193. package/esm/icons/down-arrow-bold.svg.js +2 -2
  194. package/esm/icons/down.svg.js +31 -0
  195. package/esm/icons/download.svg.js +1 -1
  196. package/esm/icons/drag-bar.svg.js +1 -1
  197. package/esm/icons/drag.svg.js +1 -1
  198. package/esm/icons/edit.svg.js +1 -2
  199. package/esm/icons/ellipsis-v.svg.js +1 -1
  200. package/esm/icons/enter.svg.js +1 -1
  201. package/esm/icons/exchange.svg.js +1 -1
  202. package/esm/icons/expand-alt.svg.js +1 -1
  203. package/esm/icons/fail.svg.js +1 -1
  204. package/esm/icons/file.svg.js +1 -1
  205. package/esm/icons/filter.svg.js +1 -1
  206. package/esm/icons/folder.svg.js +1 -1
  207. package/esm/icons/function.svg.js +1 -1
  208. package/esm/icons/home.svg.js +1 -1
  209. package/esm/icons/image.svg.js +1 -1
  210. package/esm/icons/info-circle.svg.js +1 -1
  211. package/esm/icons/info.svg.js +1 -1
  212. package/esm/icons/input-clear.svg.js +1 -1
  213. package/esm/icons/invisible.svg.js +1 -1
  214. package/esm/icons/left-arrow.svg.js +7 -4
  215. package/esm/icons/loading-outline.svg.js +1 -1
  216. package/esm/icons/location.svg.js +1 -1
  217. package/esm/icons/menu.svg.js +1 -1
  218. package/esm/icons/minus.svg.js +1 -1
  219. package/esm/icons/move.svg.js +1 -1
  220. package/esm/icons/mute.svg.js +1 -1
  221. package/esm/icons/new-edit.svg.js +24 -0
  222. package/esm/icons/pause.svg.js +1 -1
  223. package/esm/icons/pencil.svg.js +1 -1
  224. package/esm/icons/play.svg.js +1 -1
  225. package/esm/icons/plus-cicle.svg.js +1 -1
  226. package/esm/icons/plus-fine.svg.js +1 -1
  227. package/esm/icons/plus.svg.js +1 -1
  228. package/esm/icons/post.svg.js +1 -1
  229. package/esm/icons/question-mark.svg.js +1 -1
  230. package/esm/icons/question.svg.js +1 -1
  231. package/esm/icons/redo.svg.js +1 -1
  232. package/esm/icons/refresh.svg.js +1 -1
  233. package/esm/icons/reload.svg.js +1 -1
  234. package/esm/icons/remove.svg.js +1 -1
  235. package/esm/icons/retry.svg.js +1 -1
  236. package/esm/icons/right-arrow-bold.svg.js +1 -1
  237. package/esm/icons/right-arrow.svg.js +7 -4
  238. package/esm/icons/right-double-arrow.svg.js +24 -0
  239. package/esm/icons/role.svg.js +1 -1
  240. package/esm/icons/rotate-left.svg.js +24 -0
  241. package/esm/icons/rotate-right.svg.js +24 -0
  242. package/esm/icons/scale-origin.svg.js +26 -0
  243. package/esm/icons/schedule.svg.js +1 -1
  244. package/esm/icons/search.svg.js +1 -1
  245. package/esm/icons/setting.svg.js +1 -1
  246. package/esm/icons/slider-handle-icon.svg.js +1 -1
  247. package/esm/icons/sort-asc.svg.js +1 -1
  248. package/esm/icons/sort-default.svg.js +1 -1
  249. package/esm/icons/sort-desc.svg.js +1 -1
  250. package/esm/icons/star.svg.js +2 -2
  251. package/esm/icons/status-close.svg.js +1 -1
  252. package/esm/icons/status-fail.svg.js +1 -1
  253. package/esm/icons/status-info.svg.js +1 -1
  254. package/esm/icons/status-success.svg.js +1 -1
  255. package/esm/icons/status-warning.svg.js +1 -1
  256. package/esm/icons/steps-finsh.svg.js +24 -0
  257. package/esm/icons/success.svg.js +1 -1
  258. package/esm/icons/transparent.svg.js +1 -1
  259. package/esm/icons/trash.svg.js +1 -1
  260. package/esm/icons/tree-down.svg.js +1 -1
  261. package/esm/icons/undo.svg.js +1 -1
  262. package/esm/icons/upload.svg.js +1 -1
  263. package/esm/icons/user-remove.svg.js +1 -1
  264. package/esm/icons/view.svg.js +1 -1
  265. package/esm/icons/volume.svg.js +1 -1
  266. package/esm/icons/warning-mark.svg.js +1 -1
  267. package/esm/icons/warning.svg.js +1 -1
  268. package/esm/icons/window-restore.svg.js +1 -1
  269. package/esm/icons/zoom-in.svg.js +1 -1
  270. package/esm/icons/zoom-out.svg.js +1 -1
  271. package/esm/index.js +2 -1
  272. package/esm/locale/de-DE.js +25 -5
  273. package/esm/locale/en-US.js +21 -1
  274. package/esm/locale/zh-CN.js +25 -7
  275. package/esm/themes/ang.js +1 -1
  276. package/esm/themes/antd.js +1 -1
  277. package/esm/themes/cxd.js +1 -1
  278. package/esm/themes/dark.js +1 -1
  279. package/lib/components/404.js +1 -1
  280. package/lib/components/Alert.js +1 -1
  281. package/lib/components/Alert2.js +2 -2
  282. package/lib/components/AnchorNav.js +8 -8
  283. package/lib/components/ArrayInput.js +1 -1
  284. package/lib/components/AsideNav.d.ts +11 -11
  285. package/lib/components/AsideNav.js +1 -1
  286. package/lib/components/AssociatedSelection.js +1 -1
  287. package/lib/components/Avatar.js +1 -1
  288. package/lib/components/Badge.d.ts +1 -1
  289. package/lib/components/Badge.js +2 -4
  290. package/lib/components/BaiduMapPicker.js +3 -3
  291. package/lib/components/BarCode.js +41 -4
  292. package/lib/components/Breadcrumb.js +2 -2
  293. package/lib/components/Button.js +1 -1
  294. package/lib/components/CalendarMobile.js +1 -1
  295. package/lib/components/Card.js +1 -1
  296. package/lib/components/Cascader.js +3 -9
  297. package/lib/components/ChainedSelection.js +1 -1
  298. package/lib/components/Checkbox.js +1 -1
  299. package/lib/components/CityArea.js +2 -2
  300. package/lib/components/CityDB.js +4099 -8
  301. package/lib/components/CodeMirror.js +1 -1
  302. package/lib/components/Collapse.js +1 -1
  303. package/lib/components/CollapseGroup.js +1 -1
  304. package/lib/components/ColorPicker.js +200 -4
  305. package/lib/components/ContextMenu.js +1 -1
  306. package/lib/components/DatePicker.d.ts +43 -40
  307. package/lib/components/DatePicker.js +11 -4
  308. package/lib/components/DateRangePicker.d.ts +144 -81
  309. package/lib/components/DateRangePicker.js +191 -78
  310. package/lib/components/Drawer.d.ts +10 -10
  311. package/lib/components/Drawer.js +1 -1
  312. package/lib/components/Editor.d.ts +47 -41
  313. package/lib/components/Editor.js +9 -9
  314. package/lib/components/Form.js +1 -1
  315. package/lib/components/FormField.js +1 -1
  316. package/lib/components/GridNav.js +1 -1
  317. package/lib/components/GroupedSelection.js +1 -1
  318. package/lib/components/Html.js +1 -1
  319. package/lib/components/ImageGallery.d.ts +70 -40
  320. package/lib/components/ImageGallery.js +97 -14
  321. package/lib/components/Input.js +1 -1
  322. package/lib/components/InputBox.js +1 -1
  323. package/lib/components/InputBoxWithSuggestion.js +1 -1
  324. package/lib/components/Layout.js +1 -1
  325. package/lib/components/Link.js +1 -1
  326. package/lib/components/ListGroup.d.ts +10 -10
  327. package/lib/components/ListGroup.js +1 -1
  328. package/lib/components/ListMenu.js +1 -1
  329. package/lib/components/LocationPicker.js +1 -1
  330. package/lib/components/Markdown.js +59 -4
  331. package/lib/components/Modal.d.ts +60 -58
  332. package/lib/components/Modal.js +9 -4
  333. package/lib/components/ModalManager.js +1 -1
  334. package/lib/components/NumberInput.js +2 -2
  335. package/lib/components/Pagination.d.ts +49 -66
  336. package/lib/components/Pagination.js +4 -4
  337. package/lib/components/Picker.js +1 -1
  338. package/lib/components/PickerColumn.js +1 -1
  339. package/lib/components/PickerContainer.js +1 -1
  340. package/lib/components/PopOverContainer.d.ts +1 -0
  341. package/lib/components/PopOverContainer.js +3 -3
  342. package/lib/components/PopUp.js +1 -1
  343. package/lib/components/Progress.d.ts +16 -10
  344. package/lib/components/Progress.js +27 -5
  345. package/lib/components/PullRefresh.js +1 -1
  346. package/lib/components/Radios.js +1 -1
  347. package/lib/components/Range.js +3 -2
  348. package/lib/components/Rating.js +1 -1
  349. package/lib/components/ResultBox.js +7 -3
  350. package/lib/components/ResultList.js +1 -1
  351. package/lib/components/ResultTableList.js +1 -1
  352. package/lib/components/ResultTreeList.js +1 -1
  353. package/lib/components/RichText.js +261 -3
  354. package/lib/components/SearchBox.js +1 -1
  355. package/lib/components/Select.d.ts +194 -193
  356. package/lib/components/Select.js +8 -4
  357. package/lib/components/Selection.js +1 -1
  358. package/lib/components/SparkLine.d.ts +40 -40
  359. package/lib/components/SparkLine.js +1 -1
  360. package/lib/components/Spinner.js +1 -1
  361. package/lib/components/Steps.js +1 -1
  362. package/lib/components/Switch.js +1 -1
  363. package/lib/components/TableSelection.js +1 -1
  364. package/lib/components/Tabs.d.ts +149 -13
  365. package/lib/components/Tabs.js +39 -11
  366. package/lib/components/TabsTransfer.js +1 -1
  367. package/lib/components/TabsTransferPicker.js +1 -1
  368. package/lib/components/Tag.js +1 -1
  369. package/lib/components/Textarea.js +4 -2
  370. package/lib/components/Timeline.js +1 -1
  371. package/lib/components/TimelineItem.js +4 -4
  372. package/lib/components/Tinymce.d.ts +1 -3
  373. package/lib/components/Tinymce.js +563 -3
  374. package/lib/components/TitleBar.js +1 -1
  375. package/lib/components/Toast.js +1 -1
  376. package/lib/components/Tooltip.js +1 -1
  377. package/lib/components/TooltipWrapper.js +1 -1
  378. package/lib/components/Transfer.js +11 -4
  379. package/lib/components/TransferDropDown.js +4 -5
  380. package/lib/components/TransferPicker.js +1 -1
  381. package/lib/components/TransferSearch.js +1 -1
  382. package/lib/components/Tree.js +34 -33
  383. package/lib/components/TreeSelection.js +1 -1
  384. package/lib/components/UserSelect.js +5 -3
  385. package/lib/components/UserTabSelect.js +1 -1
  386. package/lib/components/WithRemoteConfig.js +1 -1
  387. package/lib/components/WithStore.js +1 -1
  388. package/lib/components/calendar/Calendar.d.ts +1 -0
  389. package/lib/components/calendar/Calendar.js +7 -2
  390. package/lib/components/calendar/CalendarContainer.js +1 -1
  391. package/lib/components/calendar/DaysView.d.ts +1 -1
  392. package/lib/components/calendar/DaysView.js +69 -29
  393. package/lib/components/calendar/MonthsView.js +1 -1
  394. package/lib/components/calendar/QuartersView.js +1 -1
  395. package/lib/components/calendar/TimeView.d.ts +0 -1
  396. package/lib/components/calendar/TimeView.js +5 -6
  397. package/lib/components/calendar/YearsView.js +1 -1
  398. package/lib/components/condition-builder/Expression.js +1 -1
  399. package/lib/components/condition-builder/Field.js +1 -1
  400. package/lib/components/condition-builder/Formula.js +1 -1
  401. package/lib/components/condition-builder/Func.js +1 -1
  402. package/lib/components/condition-builder/Group.js +1 -1
  403. package/lib/components/condition-builder/GroupOrItem.js +4 -4
  404. package/lib/components/condition-builder/InputSwitch.js +1 -1
  405. package/lib/components/condition-builder/Item.js +1 -1
  406. package/lib/components/condition-builder/Value.js +1 -1
  407. package/lib/components/condition-builder/config.js +1 -1
  408. package/lib/components/condition-builder/index.js +1 -1
  409. package/lib/components/formula/Editor.js +1 -1
  410. package/lib/components/formula/FuncList.js +1 -1
  411. package/lib/components/formula/Picker.d.ts +1 -0
  412. package/lib/components/formula/Picker.js +10 -1
  413. package/lib/components/formula/VariableList.js +1 -1
  414. package/lib/components/formula/plugin.d.ts +1 -0
  415. package/lib/components/formula/plugin.js +11 -4
  416. package/lib/components/icons.d.ts +2 -1
  417. package/lib/components/icons.js +18 -1
  418. package/lib/components/json-schema/Array.js +1 -1
  419. package/lib/components/json-schema/Item.js +1 -1
  420. package/lib/components/json-schema/Object.js +1 -1
  421. package/lib/components/json-schema/index.js +1 -1
  422. package/lib/components/schema-editor/Array.js +1 -1
  423. package/lib/components/schema-editor/Common.js +1 -1
  424. package/lib/components/schema-editor/Item.js +1 -1
  425. package/lib/components/schema-editor/Object.js +1 -1
  426. package/lib/components/schema-editor/SchemaVariableList.js +1 -1
  427. package/lib/components/schema-editor/SchemaVariableListPicker.js +1 -1
  428. package/lib/components/schema-editor/index.js +1 -1
  429. package/lib/components/table/Cell.d.ts +2 -1
  430. package/lib/components/table/Cell.js +1 -1
  431. package/lib/components/table/HeadCellDropDown.d.ts +3 -1
  432. package/lib/components/table/HeadCellDropDown.js +1 -1
  433. package/lib/components/table/HeadCellFilter.d.ts +3 -2
  434. package/lib/components/table/HeadCellFilter.js +4 -4
  435. package/lib/components/table/HeadCellSelect.d.ts +3 -2
  436. package/lib/components/table/HeadCellSelect.js +4 -2
  437. package/lib/components/table/HeadCellSort.d.ts +4 -3
  438. package/lib/components/table/HeadCellSort.js +6 -6
  439. package/lib/components/table/ItemActionsWrapper.js +1 -1
  440. package/lib/components/table/index.d.ts +3 -4
  441. package/lib/components/table/index.js +9 -9
  442. package/lib/components/virtual-list/SizeAndPositionManager.js +1 -1
  443. package/lib/components/virtual-list/constants.js +1 -1
  444. package/lib/components/virtual-list/index.d.ts +3 -3
  445. package/lib/components/virtual-list/index.js +1 -1
  446. package/lib/helper.css +0 -8335
  447. package/lib/hooks/use-set-state.js +1 -1
  448. package/lib/hooks/use-touch.js +1 -1
  449. package/lib/hooks/use-update-effect.js +1 -1
  450. package/lib/hooks/use-validation-resolver.js +1 -1
  451. package/lib/icons/alert-danger.svg.js +2 -2
  452. package/lib/icons/alert-info.svg.js +1 -1
  453. package/lib/icons/alert-success.svg.js +2 -2
  454. package/lib/icons/alert-warning.svg.js +2 -2
  455. package/lib/icons/back.svg.js +1 -1
  456. package/lib/icons/calendar.svg.js +1 -1
  457. package/lib/icons/caret.svg.js +1 -1
  458. package/lib/icons/check-circle.svg.js +60 -0
  459. package/lib/icons/check.svg.js +1 -1
  460. package/lib/icons/clock.svg.js +1 -1
  461. package/lib/icons/close-small.svg.js +1 -1
  462. package/lib/icons/close.svg.js +1 -1
  463. package/lib/icons/cloud-upload.svg.js +1 -1
  464. package/lib/icons/column-filter.svg.js +1 -1
  465. package/lib/icons/columns.svg.js +1 -1
  466. package/lib/icons/compress-alt.svg.js +1 -1
  467. package/lib/icons/copy.svg.js +1 -1
  468. package/lib/icons/date.svg.js +1 -1
  469. package/lib/icons/department.svg.js +1 -1
  470. package/lib/icons/desk-empty.svg.js +1 -1
  471. package/lib/icons/dot.svg.js +1 -1
  472. package/lib/icons/down-arrow-bold.svg.js +2 -2
  473. package/lib/icons/down.svg.js +55 -0
  474. package/lib/icons/download.svg.js +1 -1
  475. package/lib/icons/drag-bar.svg.js +1 -1
  476. package/lib/icons/drag.svg.js +1 -1
  477. package/lib/icons/edit.svg.js +1 -2
  478. package/lib/icons/ellipsis-v.svg.js +1 -1
  479. package/lib/icons/enter.svg.js +1 -1
  480. package/lib/icons/exchange.svg.js +1 -1
  481. package/lib/icons/expand-alt.svg.js +1 -1
  482. package/lib/icons/fail.svg.js +1 -1
  483. package/lib/icons/file.svg.js +1 -1
  484. package/lib/icons/filter.svg.js +1 -1
  485. package/lib/icons/folder.svg.js +1 -1
  486. package/lib/icons/function.svg.js +1 -1
  487. package/lib/icons/home.svg.js +1 -1
  488. package/lib/icons/image.svg.js +1 -1
  489. package/lib/icons/info-circle.svg.js +1 -1
  490. package/lib/icons/info.svg.js +1 -1
  491. package/lib/icons/input-clear.svg.js +1 -1
  492. package/lib/icons/invisible.svg.js +1 -1
  493. package/lib/icons/left-arrow.svg.js +7 -4
  494. package/lib/icons/loading-outline.svg.js +1 -1
  495. package/lib/icons/location.svg.js +1 -1
  496. package/lib/icons/menu.svg.js +1 -1
  497. package/lib/icons/minus.svg.js +1 -1
  498. package/lib/icons/move.svg.js +1 -1
  499. package/lib/icons/mute.svg.js +1 -1
  500. package/lib/icons/new-edit.svg.js +48 -0
  501. package/lib/icons/pause.svg.js +1 -1
  502. package/lib/icons/pencil.svg.js +1 -1
  503. package/lib/icons/play.svg.js +1 -1
  504. package/lib/icons/plus-cicle.svg.js +1 -1
  505. package/lib/icons/plus-fine.svg.js +1 -1
  506. package/lib/icons/plus.svg.js +1 -1
  507. package/lib/icons/post.svg.js +1 -1
  508. package/lib/icons/question-mark.svg.js +1 -1
  509. package/lib/icons/question.svg.js +1 -1
  510. package/lib/icons/redo.svg.js +1 -1
  511. package/lib/icons/refresh.svg.js +1 -1
  512. package/lib/icons/reload.svg.js +1 -1
  513. package/lib/icons/remove.svg.js +1 -1
  514. package/lib/icons/retry.svg.js +1 -1
  515. package/lib/icons/right-arrow-bold.svg.js +1 -1
  516. package/lib/icons/right-arrow.svg.js +7 -4
  517. package/lib/icons/right-double-arrow.svg.js +48 -0
  518. package/lib/icons/role.svg.js +1 -1
  519. package/lib/icons/rotate-left.svg.js +48 -0
  520. package/lib/icons/rotate-right.svg.js +48 -0
  521. package/lib/icons/scale-origin.svg.js +50 -0
  522. package/lib/icons/schedule.svg.js +1 -1
  523. package/lib/icons/search.svg.js +1 -1
  524. package/lib/icons/setting.svg.js +1 -1
  525. package/lib/icons/slider-handle-icon.svg.js +1 -1
  526. package/lib/icons/sort-asc.svg.js +1 -1
  527. package/lib/icons/sort-default.svg.js +1 -1
  528. package/lib/icons/sort-desc.svg.js +1 -1
  529. package/lib/icons/star.svg.js +2 -2
  530. package/lib/icons/status-close.svg.js +1 -1
  531. package/lib/icons/status-fail.svg.js +1 -1
  532. package/lib/icons/status-info.svg.js +1 -1
  533. package/lib/icons/status-success.svg.js +1 -1
  534. package/lib/icons/status-warning.svg.js +1 -1
  535. package/lib/icons/steps-finsh.svg.js +48 -0
  536. package/lib/icons/success.svg.js +1 -1
  537. package/lib/icons/transparent.svg.js +1 -1
  538. package/lib/icons/trash.svg.js +1 -1
  539. package/lib/icons/tree-down.svg.js +1 -1
  540. package/lib/icons/undo.svg.js +1 -1
  541. package/lib/icons/upload.svg.js +1 -1
  542. package/lib/icons/user-remove.svg.js +1 -1
  543. package/lib/icons/view.svg.js +1 -1
  544. package/lib/icons/volume.svg.js +1 -1
  545. package/lib/icons/warning-mark.svg.js +1 -1
  546. package/lib/icons/warning.svg.js +1 -1
  547. package/lib/icons/window-restore.svg.js +1 -1
  548. package/lib/icons/zoom-in.svg.js +1 -1
  549. package/lib/icons/zoom-out.svg.js +1 -1
  550. package/lib/index.js +3 -1
  551. package/lib/locale/de-DE.js +25 -5
  552. package/lib/locale/en-US.js +21 -1
  553. package/lib/locale/zh-CN.js +25 -7
  554. package/lib/scss/helper.scss.js +3 -5
  555. package/lib/scss/themes/ang.scss.js +3 -5
  556. package/lib/scss/themes/antd.scss.js +3 -5
  557. package/lib/scss/themes/cxd.scss.js +3 -5
  558. package/lib/scss/themes/dark.scss.js +3 -5
  559. package/lib/scss/themes/default.scss.js +3 -5
  560. package/lib/themes/ang.css +1751 -913
  561. package/lib/themes/ang.js +1 -1
  562. package/lib/themes/antd.css +1751 -913
  563. package/lib/themes/antd.js +1 -1
  564. package/lib/themes/cxd.css +1800 -961
  565. package/lib/themes/cxd.js +1 -1
  566. package/lib/themes/dark.css +1755 -917
  567. package/lib/themes/dark.js +1 -1
  568. package/lib/themes/default.css +1800 -961
  569. package/package.json +14 -12
  570. package/scss/_properties.scss +100 -23
  571. package/scss/base/_typography.scss +4 -0
  572. package/scss/components/_alert.scss +15 -0
  573. package/scss/components/_anchor-nav.scss +22 -7
  574. package/scss/components/_badge.scss +1 -0
  575. package/scss/components/_breadcrumb.scss +12 -1
  576. package/scss/components/_card.scss +4 -0
  577. package/scss/components/_collapse-group.scss +13 -1
  578. package/scss/components/_collapse.scss +2 -1
  579. package/scss/components/_column-toggler.scss +7 -1
  580. package/scss/components/_crud.scss +10 -2
  581. package/scss/components/_crud2.scss +10 -2
  582. package/scss/components/_drawer.scss +58 -5
  583. package/scss/components/_dropdown.scss +1 -0
  584. package/scss/components/_image-gallery.scss +62 -0
  585. package/scss/components/_input-box.scss +1 -0
  586. package/scss/components/_modal.scss +7 -10
  587. package/scss/components/_page.scss +1 -1
  588. package/scss/components/_pagination.scss +4 -3
  589. package/scss/components/_progress.scss +15 -1
  590. package/scss/components/_result-box.scss +5 -6
  591. package/scss/components/_search-box.scss +4 -0
  592. package/scss/components/_steps.scss +23 -12
  593. package/scss/components/_table.scss +124 -12
  594. package/scss/components/{_table-v2.scss → _table2.scss} +1 -1
  595. package/scss/components/_tabs.scss +91 -5
  596. package/scss/components/_timeline.scss +15 -1
  597. package/scss/components/form/_checks.scss +13 -2
  598. package/scss/components/form/_date-range.scss +40 -11
  599. package/scss/components/form/_date.scss +99 -33
  600. package/scss/components/form/_editor.scss +11 -0
  601. package/scss/components/form/_form.scss +14 -3
  602. package/scss/components/form/_nested-select.scss +6 -0
  603. package/scss/components/form/_number.scss +18 -13
  604. package/scss/components/form/_picker.scss +8 -0
  605. package/scss/components/form/_rating.scss +2 -2
  606. package/scss/components/form/_select.scss +34 -3
  607. package/scss/components/form/_selection.scss +1 -0
  608. package/scss/components/form/_text.scss +6 -0
  609. package/scss/components/form/_textarea.scss +15 -11
  610. package/scss/components/form/_transfer.scss +33 -11
  611. package/scss/components/form/_tree.scss +33 -7
  612. package/scss/components/react-datetime.scss +6 -1
  613. package/scss/themes/_common.scss +1 -1
  614. package/scss/themes/_cxd-variables.scss +9 -8
  615. package/scss/themes/cxd.scss +6 -8
  616. package/esm/components/BarCode2.js +0 -42
  617. package/esm/components/CityDB2.js +0 -4101
  618. package/esm/components/ColorPicker2.js +0 -202
  619. package/esm/components/Markdown2.js +0 -60
  620. package/esm/components/RichText2.js +0 -262
  621. package/esm/components/Tinymce2.js +0 -548
  622. package/lib/components/BarCode2.js +0 -52
  623. package/lib/components/CityDB2.js +0 -4108
  624. package/lib/components/ColorPicker2.js +0 -211
  625. package/lib/components/Markdown2.js +0 -70
  626. package/lib/components/RichText2.js +0 -272
  627. package/lib/components/Tinymce2.js +0 -557
  628. package/lib/scss/helper.scss2.js +0 -12
  629. package/lib/scss/themes/ang.scss2.js +0 -12
  630. package/lib/scss/themes/antd.scss2.js +0 -12
  631. package/lib/scss/themes/cxd.scss2.js +0 -12
  632. package/lib/scss/themes/dark.scss2.js +0 -12
  633. package/lib/scss/themes/default.scss2.js +0 -12
@@ -1,211 +0,0 @@
1
- /**
2
- * amis-ui v2.0.2
3
- * Copyright 2018-2022 fex
4
- */
5
-
6
- 'use strict';
7
-
8
- Object.defineProperty(exports, '__esModule', { value: true });
9
-
10
- var tslib = require('tslib');
11
- var React = require('react');
12
- var reactDom = require('react-dom');
13
- var reactColor = require('react-color');
14
- var icons = require('./icons.js');
15
- var amisCore = require('amis-core');
16
- var PopUp = require('./PopUp.js');
17
-
18
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
19
-
20
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
21
-
22
- /**
23
- * @file ColorPicker
24
- * @description 颜色选择器组件
25
- * @author fex
26
- */
27
- var ColorControl = /** @class */ (function (_super) {
28
- tslib.__extends(ColorControl, _super);
29
- function ColorControl(props) {
30
- var _this = _super.call(this, props) || this;
31
- _this.state = {
32
- isOpened: false,
33
- isFocused: false,
34
- inputValue: _this.props.value || ''
35
- };
36
- _this.open = _this.open.bind(_this);
37
- _this.close = _this.close.bind(_this);
38
- _this.focus = _this.focus.bind(_this);
39
- _this.blur = _this.blur.bind(_this);
40
- _this.handleChange = _this.handleChange.bind(_this);
41
- _this.handleFocus = _this.handleFocus.bind(_this);
42
- _this.handleBlur = _this.handleBlur.bind(_this);
43
- _this.clearValue = _this.clearValue.bind(_this);
44
- _this.handleInputChange = _this.handleInputChange.bind(_this);
45
- _this.handleClick = _this.handleClick.bind(_this);
46
- _this.preview = React__default["default"].createRef();
47
- _this.input = React__default["default"].createRef();
48
- return _this;
49
- }
50
- ColorControl.prototype.componentDidUpdate = function (prevProps) {
51
- var props = this.props;
52
- if (prevProps.value !== props.value) {
53
- this.setState({
54
- inputValue: props.value || ''
55
- });
56
- }
57
- };
58
- ColorControl.prototype.handleFocus = function () {
59
- this.setState({
60
- isFocused: true
61
- });
62
- };
63
- ColorControl.prototype.handleBlur = function () {
64
- this.setState({
65
- isFocused: false,
66
- inputValue: this.props.value
67
- });
68
- };
69
- ColorControl.prototype.focus = function () {
70
- this.input.current && this.input.current.focus();
71
- };
72
- ColorControl.prototype.blur = function () {
73
- this.input.current && this.input.current.blur();
74
- };
75
- ColorControl.prototype.open = function (fn) {
76
- if (this.props.disabled) {
77
- return;
78
- }
79
- this.setState({
80
- isOpened: true
81
- }, fn);
82
- };
83
- ColorControl.prototype.close = function () {
84
- this.setState({
85
- isOpened: false
86
- });
87
- };
88
- ColorControl.prototype.clearValue = function () {
89
- var _a = this.props, onChange = _a.onChange, resetValue = _a.resetValue;
90
- onChange(resetValue || '');
91
- };
92
- ColorControl.prototype.handleClick = function () {
93
- this.state.isOpened ? this.close() : this.open(this.focus);
94
- };
95
- ColorControl.prototype.handleInputChange = function (e) {
96
- var _this = this;
97
- if (!this.props.allowCustomColor) {
98
- return;
99
- }
100
- var onChange = this.props.onChange;
101
- this.setState({
102
- inputValue: e.currentTarget.value
103
- }, function () {
104
- var isValidated = _this.validateColor(_this.state.inputValue);
105
- if (isValidated) {
106
- onChange(_this.state.inputValue);
107
- }
108
- });
109
- };
110
- ColorControl.prototype.validateColor = function (value) {
111
- if (value === '') {
112
- return false;
113
- }
114
- if (value === 'inherit') {
115
- return false;
116
- }
117
- if (value === 'transparent') {
118
- return false;
119
- }
120
- var image = document.createElement('img');
121
- image.style.color = 'rgb(0, 0, 0)';
122
- image.style.color = value;
123
- if (image.style.color !== 'rgb(0, 0, 0)') {
124
- return true;
125
- }
126
- image.style.color = 'rgb(255, 255, 255)';
127
- image.style.color = value;
128
- return image.style.color !== 'rgb(255, 255, 255)';
129
- };
130
- ColorControl.prototype.handleChange = function (color) {
131
- var _a = this.props, onChange = _a.onChange, format = _a.format
132
- // closeOnSelect
133
- ;
134
- if (format === 'rgba') {
135
- onChange("rgba(".concat(color.rgb.r, ", ").concat(color.rgb.g, ", ").concat(color.rgb.b, ", ").concat(color.rgb.a, ")"));
136
- }
137
- else if (format === 'rgb') {
138
- onChange("rgb(".concat(color.rgb.r, ", ").concat(color.rgb.g, ", ").concat(color.rgb.b, ")"));
139
- }
140
- else if (format === 'hsl') {
141
- onChange("hsl(".concat(Math.round(color.hsl.h), ", ").concat(Math.round(color.hsl.s * 100), "%, ").concat(Math.round(color.hsl.l * 100), "%)"));
142
- }
143
- else {
144
- onChange(color.hex);
145
- }
146
- // closeOnSelect && this.close();
147
- };
148
- ColorControl.prototype.render = function () {
149
- var _this = this;
150
- var _a = this.props, ns = _a.classPrefix, className = _a.className, popoverClassName = _a.popoverClassName, value = _a.value, placeholder = _a.placeholder, disabled = _a.disabled, popOverContainer = _a.popOverContainer, format = _a.format, clearable = _a.clearable, placement = _a.placement, cx = _a.classnames, presetColors = _a.presetColors, allowCustomColor = _a.allowCustomColor, useMobileUI = _a.useMobileUI;
151
- var __ = this.props.translate;
152
- var isOpened = this.state.isOpened;
153
- var isFocused = this.state.isFocused;
154
- var mobileUI = useMobileUI && amisCore.isMobile();
155
- return (React__default["default"].createElement("div", { className: cx("ColorPicker", {
156
- 'is-disabled': disabled,
157
- 'is-focused': isFocused,
158
- 'is-opened': isOpened
159
- }, className) },
160
- React__default["default"].createElement("span", { onClick: this.handleClick, className: cx('ColorPicker-preview') },
161
- React__default["default"].createElement("i", { ref: this.preview, className: "".concat(ns, "ColorPicker-previewIcon"), style: { background: this.state.inputValue || '#ccc' } })),
162
- React__default["default"].createElement("input", { ref: this.input, type: "text", autoComplete: "off", size: 10, className: cx('ColorPicker-input'), value: this.state.inputValue || '', placeholder: __(placeholder), disabled: disabled, onChange: this.handleInputChange, onFocus: this.handleFocus, onBlur: this.handleBlur, onClick: this.handleClick, readOnly: mobileUI }),
163
- clearable && !disabled && value ? (React__default["default"].createElement("a", { onClick: this.clearValue, className: cx('ColorPicker-clear') },
164
- React__default["default"].createElement(icons.Icon, { icon: "input-clear", className: "icon" }))) : null,
165
- React__default["default"].createElement("span", { className: cx('ColorPicker-arrow') },
166
- React__default["default"].createElement(icons.Icon, { icon: "caret", className: "icon", onClick: this.handleClick })),
167
- !mobileUI && isOpened ? (React__default["default"].createElement(amisCore.Overlay, { placement: placement || 'auto', target: function () { return reactDom.findDOMNode(_this); }, onHide: this.close, container: popOverContainer || (function () { return reactDom.findDOMNode(_this); }), rootClose: false, show: true },
168
- React__default["default"].createElement(amisCore.PopOver, { classPrefix: ns, className: cx('ColorPicker-popover', popoverClassName), onHide: this.close, overlay: true }, allowCustomColor ? (React__default["default"].createElement(reactColor.SketchPicker, { styles: {}, disableAlpha: !!~['rgb', 'hex'].indexOf(format), color: value, presetColors: presetColors, onChangeComplete: this.handleChange })) : (React__default["default"].createElement(reactColor.GithubPicker, { color: value, colors: Array.isArray(presetColors)
169
- ? presetColors
170
- .filter(function (item) { return typeof item === 'string' || amisCore.isObject(item); })
171
- .map(function (item) {
172
- return typeof item === 'string'
173
- ? item
174
- : amisCore.isObject(item)
175
- ? item === null || item === void 0 ? void 0 : item.color
176
- : item;
177
- })
178
- : undefined, onChangeComplete: this.handleChange }))))) : null,
179
- mobileUI && (React__default["default"].createElement(PopUp["default"], { className: cx("".concat(ns, "ColorPicker-popup")), container: popOverContainer, isShow: isOpened, onHide: this.handleClick }, allowCustomColor ? (React__default["default"].createElement(reactColor.SketchPicker, { styles: {}, disableAlpha: !!~['rgb', 'hex'].indexOf(format), color: value, presetColors: presetColors, onChangeComplete: this.handleChange })) : (React__default["default"].createElement(reactColor.GithubPicker, { color: value, colors: Array.isArray(presetColors)
180
- ? presetColors
181
- .filter(function (item) { return typeof item === 'string' || amisCore.isObject(item); })
182
- .map(function (item) {
183
- return typeof item === 'string'
184
- ? item
185
- : amisCore.isObject(item)
186
- ? item === null || item === void 0 ? void 0 : item.color
187
- : item;
188
- })
189
- : undefined, onChangeComplete: this.handleChange }))))));
190
- };
191
- ColorControl.defaultProps = {
192
- format: 'hex',
193
- clearable: true,
194
- placeholder: 'ColorPicker.placeholder',
195
- allowCustomColor: true
196
- // closeOnSelect: true
197
- };
198
- tslib.__decorate([
199
- amisCore.autobind,
200
- tslib.__metadata("design:type", Function),
201
- tslib.__metadata("design:paramtypes", [String]),
202
- tslib.__metadata("design:returntype", void 0)
203
- ], ColorControl.prototype, "validateColor", null);
204
- return ColorControl;
205
- }(React__default["default"].PureComponent));
206
- var ColorPicker = amisCore.themeable(amisCore.localeable(amisCore.uncontrollable(ColorControl, {
207
- value: 'onChange'
208
- })));
209
-
210
- exports.ColorControl = ColorControl;
211
- exports["default"] = ColorPicker;
@@ -1,70 +0,0 @@
1
- /**
2
- * amis-ui v2.0.2
3
- * Copyright 2018-2022 fex
4
- */
5
-
6
- 'use strict';
7
-
8
- Object.defineProperty(exports, '__esModule', { value: true });
9
-
10
- var tslib = require('tslib');
11
- var React = require('react');
12
- var markdownIt = require('markdown-it');
13
- var markdownItHtml5Media = require('markdown-it-html5-media');
14
-
15
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
-
17
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
18
- var markdownIt__default = /*#__PURE__*/_interopDefaultLegacy(markdownIt);
19
-
20
- var doMarkdown = markdownIt__default["default"]();
21
- doMarkdown.use(markdownItHtml5Media.html5Media);
22
- function markdown(content, options) {
23
- if (options) {
24
- doMarkdown.set(options);
25
- }
26
- return doMarkdown.render(content);
27
- }
28
- var Markdown = /** @class */ (function (_super) {
29
- tslib.__extends(Markdown, _super);
30
- function Markdown(props) {
31
- var _this = _super.call(this, props) || this;
32
- _this.htmlRef = _this.htmlRef.bind(_this);
33
- return _this;
34
- }
35
- Markdown.prototype.htmlRef = function (dom) {
36
- this.dom = dom;
37
- if (!dom) {
38
- return;
39
- }
40
- this._render();
41
- };
42
- Markdown.prototype.componentDidUpdate = function (nextProps) {
43
- if (this.props.content !== nextProps.content) {
44
- this._render();
45
- }
46
- };
47
- Markdown.prototype._render = function () {
48
- return tslib.__awaiter(this, void 0, void 0, function () {
49
- var _a, content, options;
50
- return tslib.__generator(this, function (_b) {
51
- _a = this.props, content = _a.content, options = _a.options;
52
- this.dom.innerHTML = markdown(content, options);
53
- return [2 /*return*/];
54
- });
55
- });
56
- };
57
- Markdown.prototype.render = function () {
58
- return (React__default["default"].createElement("div", { "data-testid": "markdown-body", className: "markdown-body", ref: this.htmlRef }));
59
- };
60
- Markdown.defaultProps = {
61
- content: '',
62
- options: {
63
- linkify: true
64
- }
65
- };
66
- return Markdown;
67
- }(React__default["default"].Component));
68
-
69
- exports["default"] = Markdown;
70
- exports.markdown = markdown;
@@ -1,272 +0,0 @@
1
- /**
2
- * amis-ui v2.0.2
3
- * Copyright 2018-2022 fex
4
- */
5
-
6
- 'use strict';
7
-
8
- Object.defineProperty(exports, '__esModule', { value: true });
9
-
10
- var tslib = require('tslib');
11
- var React = require('react');
12
- var FroalaEditor = require('froala-editor');
13
- var Froala = require('froala-editor/js/froala_editor.min.js');
14
- require('froala-editor/js/plugins/align.min');
15
- require('froala-editor/js/plugins/colors.min');
16
- require('froala-editor/js/plugins/char_counter.min');
17
- require('froala-editor/js/plugins/code_view.min');
18
- require('froala-editor/js/plugins/draggable.min');
19
- require('froala-editor/js/plugins/entities.min');
20
- require('froala-editor/js/plugins/font_family.min');
21
- require('froala-editor/js/plugins/font_size.min');
22
- require('froala-editor/js/plugins/forms.min');
23
- require('froala-editor/js/plugins/fullscreen.min');
24
- require('froala-editor/js/plugins/help.min');
25
- require('froala-editor/js/plugins/image.min');
26
- require('froala-editor/js/plugins/inline_class.min');
27
- require('froala-editor/js/plugins/inline_style.min');
28
- require('froala-editor/js/plugins/line_breaker.min');
29
- require('froala-editor/js/plugins/line_height.min');
30
- require('froala-editor/js/plugins/link.min');
31
- require('froala-editor/js/plugins/lists.min');
32
- require('froala-editor/js/plugins/paragraph_format.min');
33
- require('froala-editor/js/plugins/paragraph_style.min');
34
- require('froala-editor/js/plugins/print.min');
35
- require('froala-editor/js/plugins/quick_insert.min');
36
- require('froala-editor/js/plugins/quote.min');
37
- require('froala-editor/js/plugins/save.min');
38
- require('froala-editor/js/plugins/special_characters.min');
39
- require('froala-editor/js/plugins/table.min');
40
- require('froala-editor/js/plugins/url.min');
41
- require('froala-editor/js/plugins/video.min');
42
- require('froala-editor/js/plugins/word_paste.min');
43
- require('froala-editor/js/languages/zh_cn.js');
44
-
45
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
46
-
47
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
48
- var FroalaEditor__default = /*#__PURE__*/_interopDefaultLegacy(FroalaEditor);
49
- var Froala__default = /*#__PURE__*/_interopDefaultLegacy(Froala);
50
-
51
- /**
52
- * @file RichText
53
- * @description
54
- * @author fex
55
- */
56
- // 代码来源于:https://github.com/froala/react-froala-wysiwyg/blob/master/lib/FroalaEditorFunctionality.jsx
57
- // 改动原因是model 同步有些问题,有时候不更新,所以基于官方代码改造一下。
58
- // 目前发现的问题是,如果 model 数据修改,如果此时 editor 还没有初始化完成则不会同步成功
59
- var FroalaEditorComponent = /** @class */ (function (_super) {
60
- tslib.__extends(FroalaEditorComponent, _super);
61
- function FroalaEditorComponent(props) {
62
- var _this = _super.call(this, props) || this;
63
- _this.listeningEvents = [];
64
- _this.element = null;
65
- _this.editor = null;
66
- _this.config = {
67
- immediateReactModelUpdate: false,
68
- reactIgnoreAttrs: null
69
- };
70
- _this.editorInitialized = false;
71
- _this.INNER_HTML_ATTR = 'innerHTML';
72
- _this.oldModel = null;
73
- return _this;
74
- }
75
- // After first time render.
76
- FroalaEditorComponent.prototype.componentDidMount = function () {
77
- this.createEditor();
78
- };
79
- FroalaEditorComponent.prototype.componentWillUnmount = function () {
80
- this.destroyEditor();
81
- };
82
- FroalaEditorComponent.prototype.componentDidUpdate = function () {
83
- if (JSON.stringify(this.oldModel) == JSON.stringify(this.props.model)) {
84
- return;
85
- }
86
- this.setContent();
87
- };
88
- // Return cloned object
89
- FroalaEditorComponent.prototype.clone = function (item) {
90
- var me = this;
91
- if (!item) {
92
- return item;
93
- } // null, undefined values check
94
- var types = [Number, String, Boolean], result;
95
- // normalizing primitives if someone did new String('aaa'), or new Number('444');
96
- types.forEach(function (type) {
97
- if (item instanceof type) {
98
- result = type(item);
99
- }
100
- });
101
- if (typeof result == 'undefined') {
102
- if (Object.prototype.toString.call(item) === '[object Array]') {
103
- result = [];
104
- item.forEach(function (child, index, array) {
105
- result[index] = me.clone(child);
106
- });
107
- }
108
- else if (typeof item == 'object') {
109
- // testing that this is DOM
110
- if (item.nodeType && typeof item.cloneNode == 'function') {
111
- result = item.cloneNode(true);
112
- }
113
- else if (!item.prototype) {
114
- // check that this is a literal
115
- if (item instanceof Date) {
116
- result = new Date(item);
117
- }
118
- else {
119
- // it is an object literal
120
- result = {};
121
- for (var i in item) {
122
- result[i] = me.clone(item[i]);
123
- }
124
- }
125
- }
126
- else {
127
- {
128
- result = item;
129
- }
130
- }
131
- }
132
- else {
133
- result = item;
134
- }
135
- }
136
- return result;
137
- };
138
- FroalaEditorComponent.prototype.createEditor = function () {
139
- var _this = this;
140
- if (this.editorInitialized) {
141
- return;
142
- }
143
- this.config = this.clone(this.props.config || this.config);
144
- this.config = tslib.__assign({}, this.config);
145
- this.element = this.el;
146
- if (this.props.model) {
147
- this.element.innerHTML = this.props.model;
148
- }
149
- this.setContent();
150
- // Default initialized.
151
- this.registerEvent('initialized', this.config.events && this.config.events.initialized);
152
- // Check if events are set.
153
- if (!this.config.events)
154
- this.config.events = {};
155
- this.config.events.initialized = function () {
156
- _this.editorInitialized = true;
157
- _this.initListeners();
158
- };
159
- this.editor = new FroalaEditor__default["default"](this.element, this.config);
160
- };
161
- FroalaEditorComponent.prototype.setContent = function () {
162
- var _this = this;
163
- if (this.props.model || this.props.model == '') {
164
- this.oldModel = this.props.model;
165
- if (this.editorInitialized) {
166
- this.setNormalTagContent();
167
- }
168
- else {
169
- if (!this._initEvents)
170
- this._initEvents = [];
171
- this._initEvents.push(function () { return _this.setNormalTagContent(); });
172
- }
173
- }
174
- };
175
- FroalaEditorComponent.prototype.setNormalTagContent = function () {
176
- var self = this;
177
- self.editor.html && self.editor.html.set(self.props.model || '');
178
- if (self.editorInitialized && self.editor.undo) {
179
- //This will reset the undo stack everytime the model changes externally. Can we fix this?
180
- self.editor.undo.reset();
181
- self.editor.undo.saveStep();
182
- }
183
- };
184
- FroalaEditorComponent.prototype.destroyEditor = function () {
185
- if (this.element) {
186
- this.editor.destroy && this.editor.destroy();
187
- this.listeningEvents.length = 0;
188
- this.element = null;
189
- this.editorInitialized = false;
190
- this._initEvents = [];
191
- }
192
- };
193
- FroalaEditorComponent.prototype.getEditor = function () {
194
- if (this.element) {
195
- return this.editor;
196
- }
197
- return null;
198
- };
199
- FroalaEditorComponent.prototype.updateModel = function () {
200
- if (!this.props.onModelChange) {
201
- return;
202
- }
203
- var modelContent = '';
204
- var returnedHtml = this.editor.html.get();
205
- if (typeof returnedHtml === 'string') {
206
- modelContent = returnedHtml;
207
- }
208
- this.oldModel = modelContent;
209
- this.props.onModelChange(modelContent);
210
- };
211
- FroalaEditorComponent.prototype.initListeners = function () {
212
- var self = this;
213
- // bind contentChange and keyup event to froalaModel
214
- this.editor.events.on('contentChanged', function () {
215
- self.updateModel();
216
- });
217
- if (this.config.immediateReactModelUpdate) {
218
- this.editor.events.on('keyup', function () {
219
- self.updateModel();
220
- });
221
- }
222
- // Call init events.
223
- if (this._initEvents) {
224
- for (var i = 0; i < this._initEvents.length; i++) {
225
- this._initEvents[i].call(this.editor);
226
- }
227
- }
228
- };
229
- // register event on jquery editor element
230
- FroalaEditorComponent.prototype.registerEvent = function (eventName, callback) {
231
- if (!eventName || !callback) {
232
- return;
233
- }
234
- if (eventName == 'initialized') {
235
- if (!this._initEvents)
236
- this._initEvents = [];
237
- this._initEvents.push(callback);
238
- }
239
- else {
240
- if (!this.config.events) {
241
- this.config.events = {};
242
- }
243
- this.config.events[eventName] = callback;
244
- }
245
- };
246
- FroalaEditorComponent.prototype.render = function () {
247
- var _this = this;
248
- return (React__default["default"].createElement("textarea", { ref: function (el) { return (_this.el = el); } }, this.props.children));
249
- };
250
- return FroalaEditorComponent;
251
- }(React__default["default"].Component));
252
- var default_1 = /** @class */ (function (_super) {
253
- tslib.__extends(default_1, _super);
254
- function default_1(props) {
255
- var _this = _super.call(this, props) || this;
256
- Froala__default["default"].VIDEO_PROVIDERS = [
257
- {
258
- test_regex: /.*/,
259
- url_regex: '',
260
- url_text: '',
261
- html: '<span class="fr-video fr-dvb fr-draggable" contenteditable="false" draggable="true"><video class="fr-draggable" controls="" data-msg="ok" data-status="0" src="{url}" style="width: 600px;"></video></span>'
262
- }
263
- ];
264
- return _this;
265
- }
266
- default_1.prototype.render = function () {
267
- return (React__default["default"].createElement(FroalaEditorComponent, { config: this.props.config, model: this.props.model, onModelChange: this.props.onModelChange }));
268
- };
269
- return default_1;
270
- }(React__default["default"].Component));
271
-
272
- exports["default"] = default_1;