@para-ui/core 3.0.53 → 3.0.55

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 (407) hide show
  1. package/README.md +24 -0
  2. package/package.json +1 -1
  3. package/AutoBox/index.d.ts +0 -34
  4. package/AutoBox/index.js +0 -277
  5. package/AutoBox/protal.d.ts +0 -17
  6. package/AutoTips/autoTipsMultiline/index.d.ts +0 -18
  7. package/AutoTips/index.d.ts +0 -35
  8. package/AutoTips/index.js +0 -271
  9. package/Breadcrumbs/index.d.ts +0 -53
  10. package/Breadcrumbs/index.js +0 -266
  11. package/Breadcrumbs/lang/en_US.d.ts +0 -4
  12. package/Breadcrumbs/lang/index.d.ts +0 -9
  13. package/Breadcrumbs/lang/zh_CN.d.ts +0 -4
  14. package/Button/SplitButton.d.ts +0 -64
  15. package/Button/index.d.ts +0 -79
  16. package/Button/index.js +0 -376
  17. package/Button/lang/en_US.d.ts +0 -4
  18. package/Button/lang/index.d.ts +0 -9
  19. package/Button/lang/zh_CN.d.ts +0 -4
  20. package/ButtonGroup/index.d.ts +0 -33
  21. package/ButtonGroup/index.js +0 -124
  22. package/Carousel/index.d.ts +0 -38
  23. package/Carousel/index.js +0 -78
  24. package/Cascader/index.d.ts +0 -54
  25. package/Cascader/index.js +0 -159
  26. package/Cascader/lang/en_US.d.ts +0 -4
  27. package/Cascader/lang/index.d.ts +0 -9
  28. package/Cascader/lang/zh_CN.d.ts +0 -4
  29. package/Checkbox/index.d.ts +0 -40
  30. package/Checkbox/index.js +0 -109
  31. package/CheckboxGroup/index.d.ts +0 -45
  32. package/CheckboxGroup/index.js +0 -142
  33. package/Collapse/collapsePanel.d.ts +0 -30
  34. package/Collapse/index.d.ts +0 -57
  35. package/Collapse/index.js +0 -152
  36. package/Collapse/motion.d.ts +0 -5
  37. package/Collapse/util.d.ts +0 -11
  38. package/CollapseBox/index.d.ts +0 -27
  39. package/CollapseBox/index.js +0 -148
  40. package/CollapseBox/util.d.ts +0 -5
  41. package/CollapseLayout/index.d.ts +0 -53
  42. package/CollapseLayout/index.js +0 -176
  43. package/ColorPicker/index.d.ts +0 -4
  44. package/ColorPicker/index.js +0 -4
  45. package/ComboSelect/index.d.ts +0 -6
  46. package/ComboSelect/index.js +0 -1049
  47. package/ComboSelect/interface.d.ts +0 -146
  48. package/ComboSelect/lang/en_US.d.ts +0 -9
  49. package/ComboSelect/lang/index.d.ts +0 -19
  50. package/ComboSelect/lang/zh_CN.d.ts +0 -9
  51. package/ComboSelect/utils.d.ts +0 -9
  52. package/Container/index.d.ts +0 -77
  53. package/Container/index.js +0 -232
  54. package/DatePicker/PickerButton.d.ts +0 -3
  55. package/DatePicker/PickerTag.d.ts +0 -3
  56. package/DatePicker/generatePicker/generateRangePicker.d.ts +0 -4
  57. package/DatePicker/generatePicker/generateSinglePicker.d.ts +0 -11
  58. package/DatePicker/generatePicker/index.d.ts +0 -95
  59. package/DatePicker/index.d.ts +0 -18
  60. package/DatePicker/index.js +0 -633
  61. package/DatePicker/lang/en_US.d.ts +0 -3
  62. package/DatePicker/lang/index.d.ts +0 -7
  63. package/DatePicker/lang/zh_CN.d.ts +0 -3
  64. package/DatePicker/util.d.ts +0 -22
  65. package/Desktop/index.d.ts +0 -57
  66. package/Desktop/index.js +0 -746
  67. package/DragVerify/index.d.ts +0 -36
  68. package/DragVerify/index.js +0 -385
  69. package/DragVerify/lang/en_US.d.ts +0 -5
  70. package/DragVerify/lang/index.d.ts +0 -11
  71. package/DragVerify/lang/zh_CN.d.ts +0 -5
  72. package/Drawer/index.d.ts +0 -11
  73. package/Drawer/index.js +0 -235
  74. package/Drawer/interface.d.ts +0 -92
  75. package/Drawer/lang/en_US.d.ts +0 -5
  76. package/Drawer/lang/index.d.ts +0 -11
  77. package/Drawer/lang/zh_CN.d.ts +0 -5
  78. package/Dropdown/index.d.ts +0 -40
  79. package/Dropdown/index.js +0 -10
  80. package/DynamicMultiBox/formItem.d.ts +0 -14
  81. package/DynamicMultiBox/index.d.ts +0 -5
  82. package/DynamicMultiBox/index.js +0 -1313
  83. package/DynamicMultiBox/interface.d.ts +0 -161
  84. package/DynamicMultiBox/rowForm.d.ts +0 -24
  85. package/Empty/images/index.d.ts +0 -3
  86. package/Empty/index.d.ts +0 -30
  87. package/Empty/index.js +0 -642
  88. package/Empty/lang/en_US.d.ts +0 -6
  89. package/Empty/lang/index.d.ts +0 -13
  90. package/Empty/lang/zh_CN.d.ts +0 -6
  91. package/Form/index.d.ts +0 -187
  92. package/Form/index.js +0 -355
  93. package/FormItem/compoments/defaultCompoments/index.d.ts +0 -19
  94. package/FormItem/compoments/formCheckboxGroup/index.d.ts +0 -8
  95. package/FormItem/compoments/formFile/index.d.ts +0 -38
  96. package/FormItem/compoments/formRadioGroup/index.d.ts +0 -8
  97. package/FormItem/compoments/formSelect/index.d.ts +0 -18
  98. package/FormItem/errorTips.d.ts +0 -12
  99. package/FormItem/index.d.ts +0 -152
  100. package/FormItem/index.js +0 -78
  101. package/FormItem/itemType.d.ts +0 -42
  102. package/FormItem/validateFunction.d.ts +0 -15
  103. package/FunctionModal/dialog.d.ts +0 -58
  104. package/FunctionModal/index.d.ts +0 -8
  105. package/FunctionModal/index.js +0 -43
  106. package/FunctionModal/modalContext.d.ts +0 -15
  107. package/GlobalContext/componentsProps.d.ts +0 -21
  108. package/GlobalContext/confirmLocale.d.ts +0 -7
  109. package/GlobalContext/constant.d.ts +0 -8
  110. package/GlobalContext/index.d.ts +0 -28
  111. package/GlobalContext/index.js +0 -41
  112. package/GlobalContext/intl.d.ts +0 -34
  113. package/GlobalContext/useFormatMessage.d.ts +0 -3
  114. package/GlobalContext/usePopupContainer.d.ts +0 -4
  115. package/Help/index.d.ts +0 -24
  116. package/Help/index.js +0 -41
  117. package/HelperText/index.d.ts +0 -27
  118. package/HelperText/index.js +0 -34
  119. package/Hooks/useGlobalProps.d.ts +0 -1
  120. package/InputLang/index.d.ts +0 -46
  121. package/InputLang/index.js +0 -247
  122. package/InputNumber/index.d.ts +0 -71
  123. package/InputNumber/index.js +0 -277
  124. package/Label/index.d.ts +0 -37
  125. package/Label/index.js +0 -85
  126. package/Loading/index.d.ts +0 -17
  127. package/Loading/index.js +0 -47
  128. package/Menu/footerExpansion.d.ts +0 -9
  129. package/Menu/index.d.ts +0 -10
  130. package/Menu/index.js +0 -1105
  131. package/Menu/interface.d.ts +0 -141
  132. package/Menu/logo.d.ts +0 -9
  133. package/Menu/verticalMenuList.d.ts +0 -14
  134. package/Message/index.d.ts +0 -99
  135. package/Message/index.js +0 -246
  136. package/Modal/Confirm/index.d.ts +0 -65
  137. package/Modal/index.d.ts +0 -99
  138. package/Modal/index.js +0 -421
  139. package/Modal/lang/en_US.d.ts +0 -5
  140. package/Modal/lang/index.d.ts +0 -11
  141. package/Modal/lang/zh_CN.d.ts +0 -5
  142. package/MultiBox/index.d.ts +0 -58
  143. package/MultiBox/index.js +0 -272
  144. package/MultiBox/lang/en_US.d.ts +0 -4
  145. package/MultiBox/lang/index.d.ts +0 -9
  146. package/MultiBox/lang/zh_CN.d.ts +0 -4
  147. package/Notification/index.d.ts +0 -74
  148. package/Notification/index.js +0 -252
  149. package/OperateBtn/index.d.ts +0 -59
  150. package/OperateBtn/index.js +0 -237
  151. package/OperateBtn/lang/en_US.d.ts +0 -4
  152. package/OperateBtn/lang/index.d.ts +0 -9
  153. package/OperateBtn/lang/zh_CN.d.ts +0 -4
  154. package/PageHeader/horizontalMeun.d.ts +0 -9
  155. package/PageHeader/horizontalMeunRight.d.ts +0 -9
  156. package/PageHeader/index.d.ts +0 -10
  157. package/PageHeader/index.js +0 -1050
  158. package/PageHeader/interface.d.ts +0 -169
  159. package/Pagination/index.d.ts +0 -46
  160. package/Pagination/index.js +0 -461
  161. package/Pagination/lang/en_US.d.ts +0 -8
  162. package/Pagination/lang/index.d.ts +0 -17
  163. package/Pagination/lang/zh_CN.d.ts +0 -8
  164. package/ParauiProvider/index.d.ts +0 -8
  165. package/ParauiProvider/index.js +0 -52
  166. package/PasswordRules/index.d.ts +0 -46
  167. package/PasswordRules/index.js +0 -113
  168. package/PopConfirm/index.d.ts +0 -61
  169. package/PopConfirm/index.js +0 -194
  170. package/PopConfirm/lang/en_US.d.ts +0 -5
  171. package/PopConfirm/lang/index.d.ts +0 -11
  172. package/PopConfirm/lang/zh_CN.d.ts +0 -5
  173. package/Popover/index.d.ts +0 -16
  174. package/Popover/index.js +0 -59
  175. package/Progress/Line.d.ts +0 -47
  176. package/Progress/Steps.d.ts +0 -17
  177. package/Progress/index.d.ts +0 -83
  178. package/Progress/index.js +0 -323
  179. package/Progress/utils.d.ts +0 -6
  180. package/Querying/images/index.d.ts +0 -3
  181. package/Querying/index.d.ts +0 -26
  182. package/Querying/index.js +0 -760
  183. package/Querying/lang/en_US.d.ts +0 -4
  184. package/Querying/lang/index.d.ts +0 -9
  185. package/Querying/lang/zh_CN.d.ts +0 -4
  186. package/Radio/index.d.ts +0 -38
  187. package/Radio/index.js +0 -97
  188. package/RadioGroup/index.d.ts +0 -46
  189. package/RadioGroup/index.js +0 -134
  190. package/Search/index.d.ts +0 -57
  191. package/Search/index.js +0 -208
  192. package/Select/index.d.ts +0 -93
  193. package/Select/index.js +0 -1146
  194. package/Select/lang/en_US.d.ts +0 -5
  195. package/Select/lang/index.d.ts +0 -11
  196. package/Select/lang/zh_CN.d.ts +0 -5
  197. package/SelectInput/index.d.ts +0 -12
  198. package/SelectInput/index.js +0 -55
  199. package/Selector/index.d.ts +0 -11
  200. package/Selector/index.js +0 -2175
  201. package/Selector/interface.d.ts +0 -432
  202. package/Selector/lang/en_US.d.ts +0 -11
  203. package/Selector/lang/index.d.ts +0 -23
  204. package/Selector/lang/zh_CN.d.ts +0 -11
  205. package/Selector/selectorData/index.d.ts +0 -10
  206. package/Selector/selectorMain/index.d.ts +0 -10
  207. package/Selector/selectorNode/index.d.ts +0 -10
  208. package/Selector/util.d.ts +0 -15
  209. package/SelectorPicker/index.d.ts +0 -53
  210. package/SelectorPicker/index.js +0 -444
  211. package/SelectorPicker/lang/en_US.d.ts +0 -5
  212. package/SelectorPicker/lang/index.d.ts +0 -11
  213. package/SelectorPicker/lang/zh_CN.d.ts +0 -5
  214. package/SingleBox/index.d.ts +0 -44
  215. package/SingleBox/index.js +0 -224
  216. package/SingleBox/lang/en_US.d.ts +0 -4
  217. package/SingleBox/lang/index.d.ts +0 -9
  218. package/SingleBox/lang/zh_CN.d.ts +0 -4
  219. package/Slider/index.d.ts +0 -14
  220. package/Slider/index.js +0 -119
  221. package/Slider/interface.d.ts +0 -102
  222. package/Split/index.d.ts +0 -7
  223. package/Split/index.js +0 -123
  224. package/Status/index.d.ts +0 -21
  225. package/Status/index.js +0 -37
  226. package/Stepper/icons.d.ts +0 -5
  227. package/Stepper/index.d.ts +0 -59
  228. package/Stepper/index.js +0 -97
  229. package/Switch/index.d.ts +0 -78
  230. package/Switch/index.js +0 -71
  231. package/Table/index.d.ts +0 -10
  232. package/Table/index.js +0 -2999
  233. package/Table/interface.d.ts +0 -346
  234. package/Table/lang/en_US.d.ts +0 -8
  235. package/Table/lang/index.d.ts +0 -17
  236. package/Table/lang/zh_CN.d.ts +0 -8
  237. package/Table/tableBody.d.ts +0 -9
  238. package/Table/tableBodyElement/index.d.ts +0 -15
  239. package/Table/tableBodyInterface.d.ts +0 -73
  240. package/Table/tableContainer/index.d.ts +0 -16
  241. package/Table/tableElement/index.d.ts +0 -17
  242. package/Table/tableHead.d.ts +0 -9
  243. package/Table/tableHeadElement/index.d.ts +0 -15
  244. package/Table/tableHeadInterface.d.ts +0 -37
  245. package/Table/tablePagination.d.ts +0 -9
  246. package/Table/tablePaginationInterface.d.ts +0 -27
  247. package/Table/tdElement/index.d.ts +0 -15
  248. package/Table/thElement/index.d.ts +0 -28
  249. package/Table/trElement/index.d.ts +0 -15
  250. package/Table/util.d.ts +0 -34
  251. package/Tabs/index.d.ts +0 -69
  252. package/Tabs/index.js +0 -205
  253. package/Tabs/lang/en_US.d.ts +0 -4
  254. package/Tabs/lang/index.d.ts +0 -9
  255. package/Tabs/lang/zh_CN.d.ts +0 -4
  256. package/Tag/TagGroup.d.ts +0 -66
  257. package/Tag/index.d.ts +0 -34
  258. package/Tag/index.js +0 -259
  259. package/TextEditor/common.d.ts +0 -11
  260. package/TextEditor/index.d.ts +0 -127
  261. package/TextEditor/index.js +0 -286
  262. package/TextField/index.d.ts +0 -90
  263. package/TextField/index.js +0 -611
  264. package/TimePicker/index.d.ts +0 -22
  265. package/TimePicker/index.js +0 -80
  266. package/TimePicker/locale/en_US.d.ts +0 -3
  267. package/TimePicker/locale/zh_CN.d.ts +0 -3
  268. package/TimePicker/style/index.d.ts +0 -1
  269. package/Timeline/TimelineItem.d.ts +0 -30
  270. package/Timeline/index.d.ts +0 -32
  271. package/Timeline/index.js +0 -148
  272. package/Title/index.d.ts +0 -30
  273. package/Title/index.js +0 -50
  274. package/ToggleButton/ToggleButtonGroup.d.ts +0 -49
  275. package/ToggleButton/index.d.ts +0 -49
  276. package/ToggleButton/index.js +0 -193
  277. package/Tooltip/index.d.ts +0 -11
  278. package/Tooltip/index.js +0 -368
  279. package/Tooltip/interface.d.ts +0 -35
  280. package/Tooltip/utils.d.ts +0 -18
  281. package/Transfer/box.d.ts +0 -38
  282. package/Transfer/index.d.ts +0 -32
  283. package/Transfer/index.js +0 -611
  284. package/Transfer/lang/en_US.d.ts +0 -10
  285. package/Transfer/lang/index.d.ts +0 -21
  286. package/Transfer/lang/zh_CN.d.ts +0 -10
  287. package/Transfer/useClick.d.ts +0 -3
  288. package/Tree/OperateBar/index.d.ts +0 -13
  289. package/Tree/Tree.d.ts +0 -4
  290. package/Tree/index.d.ts +0 -5
  291. package/Tree/index.js +0 -38
  292. package/Tree/interface.d.ts +0 -210
  293. package/Tree/lang/en_US.d.ts +0 -8
  294. package/Tree/lang/index.d.ts +0 -17
  295. package/Tree/lang/zh_CN.d.ts +0 -8
  296. package/Tree/utils/closestPolyfill.d.ts +0 -0
  297. package/Tree/utils/tools.d.ts +0 -25
  298. package/Tree/utils/treeUtil.d.ts +0 -15
  299. package/Upload/Dragger/index.d.ts +0 -10
  300. package/Upload/ErroTip/index.d.ts +0 -13
  301. package/Upload/ImageUpload/index.d.ts +0 -16
  302. package/Upload/ImgCrop/EasyCrop.d.ts +0 -17
  303. package/Upload/ImgCrop/constants.d.ts +0 -7
  304. package/Upload/ImgCrop/index.d.ts +0 -6
  305. package/Upload/ImgCrop/interface.d.ts +0 -48
  306. package/Upload/UploadList/index.d.ts +0 -5
  307. package/Upload/index.d.ts +0 -15
  308. package/Upload/index.js +0 -1446
  309. package/Upload/interface.d.ts +0 -136
  310. package/Upload/lang/en_US.d.ts +0 -12
  311. package/Upload/lang/index.d.ts +0 -25
  312. package/Upload/lang/zh_CN.d.ts +0 -12
  313. package/_verture/constant-66aa48a1.js +0 -10
  314. package/_verture/defineProperty-62acccfc.js +0 -34
  315. package/_verture/index-74f820ba.js +0 -1355
  316. package/_verture/index-77f9e0fb.js +0 -236
  317. package/_verture/index-9fd86055.js +0 -711
  318. package/_verture/index-a369ca3f.js +0 -4
  319. package/_verture/index-beef914f.js +0 -340
  320. package/_verture/index-e2881a53.js +0 -16
  321. package/_verture/intl-5cbb940c.js +0 -57
  322. package/_verture/modalContext-92bb0e16.js +0 -201
  323. package/_verture/slicedToArray-76060636.js +0 -43
  324. package/_verture/sortable.esm-49896035.js +0 -3791
  325. package/_verture/style-inject.es-300983ab.js +0 -28
  326. package/_verture/toConsumableArray-81040c9e.js +0 -19
  327. package/_verture/tslib.es6-55ed4bd2.js +0 -38
  328. package/_verture/typeof-498dd2b1.js +0 -11
  329. package/_verture/unsupportedIterableToArray-cb478f24.js +0 -16
  330. package/_verture/useFormatMessage-703f8b20.js +0 -20
  331. package/_verture/useGlobalProps-1b846a65.js +0 -11
  332. package/_verture/usePopupContainer-87febeb9.js +0 -68
  333. package/_verture/util-7e1fb1e2.js +0 -18
  334. package/index.d.ts +0 -144
  335. package/index.js +0 -180
  336. package/umd/AutoBox.js +0 -43
  337. package/umd/AutoTips.js +0 -15
  338. package/umd/Breadcrumbs.js +0 -42
  339. package/umd/Button.js +0 -43
  340. package/umd/ButtonGroup.js +0 -43
  341. package/umd/Carousel.js +0 -6
  342. package/umd/Cascader.js +0 -43
  343. package/umd/Checkbox.js +0 -42
  344. package/umd/CheckboxGroup.js +0 -42
  345. package/umd/Collapse.js +0 -43
  346. package/umd/CollapseBox.js +0 -1
  347. package/umd/CollapseLayout.js +0 -29
  348. package/umd/ColorPicker.js +0 -1
  349. package/umd/ComboSelect.js +0 -42
  350. package/umd/Container.js +0 -1
  351. package/umd/DatePicker.js +0 -42
  352. package/umd/Desktop.js +0 -42
  353. package/umd/DragVerify.js +0 -28
  354. package/umd/Drawer.js +0 -43
  355. package/umd/Dropdown.js +0 -15
  356. package/umd/DynamicMultiBox.js +0 -54
  357. package/umd/Empty.js +0 -15
  358. package/umd/Form.js +0 -42
  359. package/umd/FormItem.js +0 -42
  360. package/umd/FunctionModal.js +0 -42
  361. package/umd/GlobalContext.js +0 -1
  362. package/umd/Help.js +0 -42
  363. package/umd/HelperText.js +0 -1
  364. package/umd/InputLang.js +0 -42
  365. package/umd/InputNumber.js +0 -42
  366. package/umd/Label.js +0 -42
  367. package/umd/Loading.js +0 -29
  368. package/umd/Menu.js +0 -29
  369. package/umd/Message.js +0 -30
  370. package/umd/Modal.js +0 -42
  371. package/umd/MultiBox.js +0 -42
  372. package/umd/Notification.js +0 -43
  373. package/umd/OperateBtn.js +0 -42
  374. package/umd/PageHeader.js +0 -42
  375. package/umd/Pagination.js +0 -42
  376. package/umd/ParauiProvider.js +0 -15
  377. package/umd/PasswordRules.js +0 -29
  378. package/umd/PopConfirm.js +0 -42
  379. package/umd/Popover.js +0 -15
  380. package/umd/Progress.js +0 -35
  381. package/umd/Querying.js +0 -15
  382. package/umd/Radio.js +0 -42
  383. package/umd/RadioGroup.js +0 -42
  384. package/umd/Search.js +0 -42
  385. package/umd/Select.js +0 -42
  386. package/umd/SelectInput.js +0 -42
  387. package/umd/Selector.js +0 -42
  388. package/umd/SelectorPicker.js +0 -42
  389. package/umd/SingleBox.js +0 -42
  390. package/umd/Slider.js +0 -15
  391. package/umd/Split.js +0 -1
  392. package/umd/Status.js +0 -1
  393. package/umd/Stepper.js +0 -42
  394. package/umd/Switch.js +0 -42
  395. package/umd/Table.js +0 -42
  396. package/umd/Tabs.js +0 -42
  397. package/umd/Tag.js +0 -43
  398. package/umd/TextEditor.js +0 -205
  399. package/umd/TextField.js +0 -42
  400. package/umd/TimePicker.js +0 -42
  401. package/umd/Timeline.js +0 -1
  402. package/umd/Title.js +0 -1
  403. package/umd/ToggleButton.js +0 -43
  404. package/umd/Tooltip.js +0 -15
  405. package/umd/Transfer.js +0 -49
  406. package/umd/Tree.js +0 -42
  407. package/umd/Upload.js +0 -56
@@ -1,1313 +0,0 @@
1
- import { _ as _defineProperty } from '../_verture/defineProperty-62acccfc.js';
2
- import { _ as _toConsumableArray } from '../_verture/toConsumableArray-81040c9e.js';
3
- import { _ as _slicedToArray } from '../_verture/slicedToArray-76060636.js';
4
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
5
- import React__default, { useState, useRef, useEffect, useMemo } from 'react';
6
- import { Popover } from '../Popover/index.js';
7
- import Label from '../Label/index.js';
8
- import { CheckboxGroup } from '../CheckboxGroup/index.js';
9
- import { Panel, Delete, Drag, PlusCircleF } from '@para-ui/icons';
10
- import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
11
- import { TextField } from '../TextField/index.js';
12
- import Select from '../Select/index.js';
13
- import { Switch } from '../Switch/index.js';
14
- import { InputNumber } from '../InputNumber/index.js';
15
- import { InputLang } from '../InputLang/index.js';
16
- import { ComboSelect } from '../ComboSelect/index.js';
17
- import DatePicker from '../DatePicker/index.js';
18
- import AutoTips from '../AutoTips/index.js';
19
- import { UUID } from '@paraview/lib';
20
- import { s as sortable_esm } from '../_verture/sortable.esm-49896035.js';
21
- import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
22
- import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
23
- import '../_verture/typeof-498dd2b1.js';
24
- import '../_verture/unsupportedIterableToArray-cb478f24.js';
25
- import '../Tooltip/index.js';
26
- import 'rc-tooltip';
27
- import 'rc-tooltip/lib/placements';
28
- import 'clsx';
29
- import '../_verture/usePopupContainer-87febeb9.js';
30
- import '../Help/index.js';
31
- import '@para-ui/icons/Help';
32
- import '../Checkbox/index.js';
33
- import '../HelperText/index.js';
34
- import '@para-ui/icons/PreviewClose';
35
- import '@para-ui/icons/PreviewOpen';
36
- import '@para-ui/icons/CloseCircle';
37
- import '../Loading/index.js';
38
- import '@para-ui/icons/LoadingF';
39
- import '../_verture/useGlobalProps-1b846a65.js';
40
- import '@para-ui/core/GlobalContext';
41
- import '../_verture/index-77f9e0fb.js';
42
- import 'rc-dropdown';
43
- import 'dayjs';
44
- import '../Empty/index.js';
45
- import '../_verture/useFormatMessage-703f8b20.js';
46
- import '@para-ui/icons/Close';
47
- import '@para-ui/icons/Down';
48
- import '@para-ui/icons/Check';
49
- import '@para-ui/icons/Search';
50
- import 'rc-switch';
51
- import 'rc-input-number';
52
- import '@para-ui/icons/Up';
53
- import '@para-ui/icons/Minus';
54
- import '@para-ui/icons/Plus';
55
- import '../MultiBox/index.js';
56
- import '@para-ui/icons/Delete';
57
- import '@para-ui/icons/PlusCircleF';
58
- import '@para-ui/icons/Application';
59
- import '../Table/index.js';
60
- import '../_verture/index-beef914f.js';
61
- import '../Button/index.js';
62
- import '@para-ui/icons/Forbid';
63
- import '@para-ui/icons/ScreenF';
64
- import '@para-ui/icons/UpTriangleF';
65
- import '@para-ui/icons/DownTriangleF';
66
- import '@para-ui/icons/Panel';
67
- import '../Radio/index.js';
68
- import '../OperateBtn/index.js';
69
- import '@para-ui/icons/More';
70
- import '../Pagination/index.js';
71
- import '@para-ui/icons/DoubleLeft';
72
- import '@para-ui/icons/Left';
73
- import 'rc-pagination';
74
- import '@para-ui/icons/Right';
75
- import '@para-ui/icons/DoubleRight';
76
- import '../_verture/index-74f820ba.js';
77
- import 'rc-tree';
78
- import '@para-ui/icons/Document';
79
- import 'react-dom';
80
- import '@para-ui/icons/EditFile';
81
- import '@para-ui/icons/PlusCircle';
82
- import '@para-ui/icons/MoreCircle';
83
- import 'rc-picker/es/generate/dayjs';
84
- import '../Tag/index.js';
85
- import 'rc-picker';
86
- import '@para-ui/icons/Calendar';
87
- import '@para-ui/icons/Time';
88
- import 'rc-picker/lib/locale/en_US';
89
- import 'rc-picker/lib/locale/zh_CN';
90
- import '@para-ui/icons/SortRight';
91
-
92
- function getAugmentedNamespace(n) {
93
- var f = n.default;
94
- if (typeof f == "function") {
95
- var a = function () {
96
- return f.apply(this, arguments);
97
- };
98
- a.prototype = f.prototype;
99
- } else a = {};
100
- Object.defineProperty(a, '__esModule', {value: true});
101
- Object.keys(n).forEach(function (k) {
102
- var d = Object.getOwnPropertyDescriptor(n, k);
103
- Object.defineProperty(a, k, d.get ? d : {
104
- enumerable: true,
105
- get: function () {
106
- return n[k];
107
- }
108
- });
109
- });
110
- return a;
111
- }
112
-
113
- var FormItem = function FormItem(props) {
114
- var onChange = props.onChange,
115
- formItemProps = props.formItemProps,
116
- _props$valueList = props.valueList,
117
- valueList = _props$valueList === void 0 ? [] : _props$valueList,
118
- _props$errors = props.errors,
119
- errors = _props$errors === void 0 ? [] : _props$errors;
120
- var _a = formItemProps || {},
121
- _a$name = _a.name,
122
- name = _a$name === void 0 ? '' : _a$name,
123
- inputType = _a.inputType,
124
- customRender = _a.customRender,
125
- rowIndex = _a.rowIndex,
126
- id = _a.id,
127
- list = _a.list,
128
- isDisabled = _a.isDisabled;
129
- _a.isFixed;
130
- _a.selected;
131
- var text = _a.text,
132
- rest = __rest(_a, ["name", "inputType", "customRender", "rowIndex", "id", "list", "isDisabled", "isFixed", "selected", "text"]);
133
- var disabled = typeof isDisabled === 'function' ? isDisabled(rowIndex, name, valueList) : isDisabled;
134
- var getComponent = function getComponent() {
135
- switch (inputType) {
136
- case 'TextField':
137
- return getTextField();
138
- case 'Select':
139
- return getSelection();
140
- case 'InputNumber':
141
- return getInputNumber();
142
- case 'Switch':
143
- return getSwitch();
144
- case 'InputLang':
145
- return getInputLang();
146
- case 'ComboSelect':
147
- return getComboSelect();
148
- case 'DatePicker':
149
- return getDatePicker();
150
- case 'custom':
151
- return getCustomCompo();
152
- default:
153
- return null;
154
- }
155
- };
156
- /**
157
- * @description: 输入框回调
158
- * @param {any} value value值
159
- */
160
- var inputChange = function inputChange(value) {
161
- onChange && onChange(id, value);
162
- };
163
- /**
164
- * @description: 日期选择回调
165
- * @return {*}
166
- * @param {Dayjs} date 选择的日期moment类型
167
- * @param {string} dateString 选择的日期
168
- */
169
- var onDatePickerChange = function onDatePickerChange(date, dateString) {
170
- onChange && onChange(id, date ? date : dateString);
171
- };
172
- /**
173
- * @description: 返回输入框组件
174
- * @param {*} ReactNode
175
- */
176
- var getTextField = function getTextField() {
177
- return jsx(TextField, Object.assign({}, rest, {
178
- required: false,
179
- label: '',
180
- disabled: disabled,
181
- onChange: function onChange(e) {
182
- return inputChange(e.target.value);
183
- }
184
- }));
185
- };
186
- /**
187
- * @description: 返回下拉框组件
188
- * @return {*} ReactNode
189
- */
190
- var getSelection = function getSelection() {
191
- var selectList = typeof list === 'function' ? list && list(rowIndex, id, name, valueList) : list || [];
192
- return jsx(Select, Object.assign({}, rest, {
193
- list: selectList,
194
- required: false,
195
- label: '',
196
- disabled: disabled,
197
- onChange: function onChange(value) {
198
- return inputChange(value);
199
- },
200
- getPopupContainer: function getPopupContainer() {
201
- return document.body;
202
- }
203
- }));
204
- };
205
- /**
206
- * @description: 返回开关组件
207
- * @return {*}
208
- * @param {*} ReactNode
209
- */
210
- var getSwitch = function getSwitch() {
211
- var switchText = typeof text === 'function' ? text(rowIndex, name, valueList) : text;
212
- return jsxs("div", Object.assign({
213
- className: 'multi-value-switch'
214
- }, {
215
- children: [switchText && jsx("div", Object.assign({
216
- className: 'switch-text'
217
- }, {
218
- children: jsx(AutoTips, {
219
- children: switchText
220
- })
221
- })), jsx("div", Object.assign({
222
- className: 'switch'
223
- }, {
224
- children: jsx(Switch, Object.assign({}, rest, {
225
- label: '',
226
- labelPlacement: 'start',
227
- onChange: function onChange(checked) {
228
- return inputChange(checked);
229
- }
230
- }))
231
- }))]
232
- }));
233
- };
234
- /**
235
- * @description: 返回数字输入框组件
236
- * @return {*}
237
- */
238
- var getInputNumber = function getInputNumber() {
239
- return jsx(InputNumber, Object.assign({}, rest, {
240
- required: false,
241
- label: '',
242
- disabled: disabled,
243
- onChange: function onChange(value) {
244
- return inputChange(value);
245
- }
246
- }));
247
- };
248
- /**
249
- * @description: 返回国际化输入框
250
- * @return {*}
251
- */
252
- var getInputLang = function getInputLang() {
253
- return jsx(InputLang, Object.assign({}, rest, {
254
- required: false,
255
- label: '',
256
- onChange: function onChange(value) {
257
- return inputChange(value);
258
- }
259
- }));
260
- };
261
- /**
262
- * @description: 返回日期选择框组件
263
- * @return {*}
264
- */
265
- var getDatePicker = function getDatePicker() {
266
- return jsx(DatePicker, Object.assign({}, rest, {
267
- required: false,
268
- label: '',
269
- disabled: disabled,
270
- onChange: onDatePickerChange,
271
- getPopupContainer: function getPopupContainer() {
272
- return document.body;
273
- }
274
- }));
275
- };
276
- /**
277
- * @description: 返回组合选择器下拉框
278
- * @return {*}
279
- */
280
- var getComboSelect = function getComboSelect() {
281
- return jsx(ComboSelect, Object.assign({}, rest, {
282
- required: false,
283
- label: '',
284
- disabled: disabled,
285
- onChange: function onChange(options) {
286
- return inputChange(options);
287
- }
288
- }));
289
- };
290
- /**
291
- * @description: 返回自定义组件
292
- * @return {*}
293
- */
294
- var getCustomCompo = function getCustomCompo() {
295
- return jsx(Fragment, {
296
- children: customRender && customRender(name, rowIndex, valueList, errors)
297
- });
298
- };
299
- return jsx(Fragment, {
300
- children: getComponent()
301
- });
302
- };
303
-
304
- var RowForm = function RowForm(props) {
305
- var _props$valueList = props.valueList,
306
- valueList = _props$valueList === void 0 ? [] : _props$valueList,
307
- rowError = props.rowError,
308
- _props$errors = props.errors,
309
- errors = _props$errors === void 0 ? [] : _props$errors,
310
- onFormItemChange = props.onFormItemChange,
311
- _props$config = props.config,
312
- config = _props$config === void 0 ? [] : _props$config,
313
- rowIndex = props.rowIndex,
314
- icon = props.icon;
315
- /**
316
- * @desc 回调
317
- * @param id 表单所处行中的id
318
- * @param value 表单值
319
- * @param name 表单名
320
- * */
321
- var _onChange = function onChange(id, value, name) {
322
- onFormItemChange && onFormItemChange(name, id, value);
323
- };
324
- var renderFormItem = function renderFormItem() {
325
- var rowValue = valueList === null || valueList === void 0 ? void 0 : valueList[rowIndex];
326
- return jsx(Fragment, {
327
- children: (config === null || config === void 0 ? void 0 : config.length) > 0 && config.map(function (data) {
328
- var formItemProps = (data === null || data === void 0 ? void 0 : data.inputType) !== 'Switch' ? Object.assign({
329
- rowIndex: rowIndex,
330
- id: rowValue.id,
331
- value: rowValue === null || rowValue === void 0 ? void 0 : rowValue[data.name || ''],
332
- error: !!(rowError === null || rowError === void 0 ? void 0 : rowError[data.name || '']),
333
- helperText: rowError === null || rowError === void 0 ? void 0 : rowError[data.name || '']
334
- }, data) : Object.assign({
335
- rowIndex: rowIndex,
336
- id: rowValue.id,
337
- checked: rowValue === null || rowValue === void 0 ? void 0 : rowValue[data.name || '']
338
- }, data);
339
- return jsxs("div", Object.assign({
340
- className: "form-item ".concat((data === null || data === void 0 ? void 0 : data.inputType) === 'Switch' ? 'row-form-switch' : '')
341
- }, {
342
- children: [jsx(FormItem, {
343
- valueList: valueList,
344
- errors: errors,
345
- formItemProps: formItemProps,
346
- onChange: function onChange(id, value) {
347
- return _onChange(id, value, (data === null || data === void 0 ? void 0 : data.name) || '');
348
- }
349
- }), icon && icon]
350
- }), data.name);
351
- })
352
- });
353
- };
354
- return jsx(Fragment, {
355
- children: renderFormItem()
356
- });
357
- };
358
-
359
- var dist = {exports: {}};
360
-
361
- var require$$0 = /*@__PURE__*/getAugmentedNamespace(sortable_esm);
362
-
363
- var classnames = {exports: {}};
364
-
365
- /*!
366
- Copyright (c) 2018 Jed Watson.
367
- Licensed under the MIT License (MIT), see
368
- http://jedwatson.github.io/classnames
369
- */
370
-
371
- (function (module) {
372
- /* global define */
373
-
374
- (function () {
375
-
376
- var hasOwn = {}.hasOwnProperty;
377
-
378
- function classNames() {
379
- var classes = [];
380
-
381
- for (var i = 0; i < arguments.length; i++) {
382
- var arg = arguments[i];
383
- if (!arg) continue;
384
-
385
- var argType = typeof arg;
386
-
387
- if (argType === 'string' || argType === 'number') {
388
- classes.push(arg);
389
- } else if (Array.isArray(arg)) {
390
- if (arg.length) {
391
- var inner = classNames.apply(null, arg);
392
- if (inner) {
393
- classes.push(inner);
394
- }
395
- }
396
- } else if (argType === 'object') {
397
- if (arg.toString === Object.prototype.toString) {
398
- for (var key in arg) {
399
- if (hasOwn.call(arg, key) && arg[key]) {
400
- classes.push(key);
401
- }
402
- }
403
- } else {
404
- classes.push(arg.toString());
405
- }
406
- }
407
- }
408
-
409
- return classes.join(' ');
410
- }
411
-
412
- if (module.exports) {
413
- classNames.default = classNames;
414
- module.exports = classNames;
415
- } else {
416
- window.classNames = classNames;
417
- }
418
- }());
419
- } (classnames));
420
-
421
- var isProduction = process.env.NODE_ENV === 'production';
422
- var prefix = 'Invariant failed';
423
- function invariant(condition, message) {
424
- if (condition) {
425
- return;
426
- }
427
- if (isProduction) {
428
- throw new Error(prefix);
429
- }
430
- var provided = typeof message === 'function' ? message() : message;
431
- var value = provided ? prefix + ": " + provided : prefix;
432
- throw new Error(value);
433
- }
434
-
435
- var tinyInvariant_esm = /*#__PURE__*/Object.freeze({
436
- __proto__: null,
437
- 'default': invariant
438
- });
439
-
440
- var require$$3 = /*@__PURE__*/getAugmentedNamespace(tinyInvariant_esm);
441
-
442
- (function (module) {
443
- var $8zHUo$sortablejs = require$$0;
444
- var $8zHUo$classnames = classnames.exports;
445
- var $8zHUo$react = React__default;
446
- var $8zHUo$tinyinvariant = require$$3;
447
-
448
- function $parcel$interopDefault(a) {
449
- return a && a.__esModule ? a.default : a;
450
- }
451
- function $parcel$export(e, n, v, s) {
452
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
453
- }
454
- function $parcel$exportWildcard(dest, source) {
455
- Object.keys(source).forEach(function(key) {
456
- if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
457
- return;
458
- }
459
-
460
- Object.defineProperty(dest, key, {
461
- enumerable: true,
462
- get: function get() {
463
- return source[key];
464
- }
465
- });
466
- });
467
-
468
- return dest;
469
- }
470
-
471
- $parcel$export(module.exports, "Sortable", () => $882b6d93070905b3$re_export$Sortable);
472
- $parcel$export(module.exports, "Direction", () => $882b6d93070905b3$re_export$Direction);
473
- $parcel$export(module.exports, "DOMRect", () => $882b6d93070905b3$re_export$DOMRect);
474
- $parcel$export(module.exports, "GroupOptions", () => $882b6d93070905b3$re_export$GroupOptions);
475
- $parcel$export(module.exports, "MoveEvent", () => $882b6d93070905b3$re_export$MoveEvent);
476
- $parcel$export(module.exports, "Options", () => $882b6d93070905b3$re_export$Options);
477
- $parcel$export(module.exports, "PullResult", () => $882b6d93070905b3$re_export$PullResult);
478
- $parcel$export(module.exports, "PutResult", () => $882b6d93070905b3$re_export$PutResult);
479
- $parcel$export(module.exports, "SortableEvent", () => $882b6d93070905b3$re_export$SortableEvent);
480
- $parcel$export(module.exports, "SortableOptions", () => $882b6d93070905b3$re_export$SortableOptions);
481
- $parcel$export(module.exports, "Utils", () => $882b6d93070905b3$re_export$Utils);
482
- $parcel$export(module.exports, "ReactSortable", () => $7fe8e3ea572bda7a$export$11bbed9ee0012c13);
483
-
484
-
485
-
486
-
487
-
488
- function $eb03e74f8f7db1f3$export$1d0aa160432dfea5(node) {
489
- if (node.parentElement !== null) node.parentElement.removeChild(node);
490
- }
491
- function $eb03e74f8f7db1f3$export$6d240faa51aa562f(parent, newChild, index) {
492
- const refChild = parent.children[index] || null;
493
- parent.insertBefore(newChild, refChild);
494
- }
495
- function $eb03e74f8f7db1f3$export$77f49a256021c8de(customs) {
496
- customs.forEach((curr)=>$eb03e74f8f7db1f3$export$1d0aa160432dfea5(curr.element)
497
- );
498
- }
499
- function $eb03e74f8f7db1f3$export$a6177d5829f70ebc(customs) {
500
- customs.forEach((curr)=>{
501
- $eb03e74f8f7db1f3$export$6d240faa51aa562f(curr.parentElement, curr.element, curr.oldIndex);
502
- });
503
- }
504
- function $eb03e74f8f7db1f3$export$4655efe700f887a(evt, list) {
505
- const mode = $eb03e74f8f7db1f3$export$1fc0f6205829e19c(evt);
506
- const parentElement = {
507
- parentElement: evt.from
508
- };
509
- let custom = [];
510
- switch(mode){
511
- case "normal":
512
- /* eslint-disable */ const item = {
513
- element: evt.item,
514
- newIndex: evt.newIndex,
515
- oldIndex: evt.oldIndex,
516
- parentElement: evt.from
517
- };
518
- custom = [
519
- item
520
- ];
521
- break;
522
- case "swap":
523
- const drag = {
524
- element: evt.item,
525
- oldIndex: evt.oldIndex,
526
- newIndex: evt.newIndex,
527
- ...parentElement
528
- };
529
- const swap = {
530
- element: evt.swapItem,
531
- oldIndex: evt.newIndex,
532
- newIndex: evt.oldIndex,
533
- ...parentElement
534
- };
535
- custom = [
536
- drag,
537
- swap
538
- ];
539
- break;
540
- case "multidrag":
541
- custom = evt.oldIndicies.map((curr, index)=>({
542
- element: curr.multiDragElement,
543
- oldIndex: curr.index,
544
- newIndex: evt.newIndicies[index].index,
545
- ...parentElement
546
- })
547
- );
548
- break;
549
- }
550
- /* eslint-enable */ const customs = $eb03e74f8f7db1f3$export$bc06a3af7dc65f53(custom, list);
551
- return customs;
552
- }
553
- function $eb03e74f8f7db1f3$export$c25cf8080bd305ec(normalized, list) {
554
- const a = $eb03e74f8f7db1f3$export$be2da95e6167b0bd(normalized, list);
555
- const b = $eb03e74f8f7db1f3$export$eca851ee65ae17e4(normalized, a);
556
- return b;
557
- }
558
- function $eb03e74f8f7db1f3$export$be2da95e6167b0bd(normalized, list) {
559
- const newList = [
560
- ...list
561
- ];
562
- normalized.concat().reverse().forEach((curr)=>newList.splice(curr.oldIndex, 1)
563
- );
564
- return newList;
565
- }
566
- function $eb03e74f8f7db1f3$export$eca851ee65ae17e4(normalized, list, evt, clone) {
567
- const newList = [
568
- ...list
569
- ];
570
- normalized.forEach((curr)=>{
571
- const newItem = clone && evt && clone(curr.item, evt);
572
- newList.splice(curr.newIndex, 0, newItem || curr.item);
573
- });
574
- return newList;
575
- }
576
- function $eb03e74f8f7db1f3$export$1fc0f6205829e19c(evt) {
577
- if (evt.oldIndicies && evt.oldIndicies.length > 0) return "multidrag";
578
- if (evt.swapItem) return "swap";
579
- return "normal";
580
- }
581
- function $eb03e74f8f7db1f3$export$bc06a3af7dc65f53(inputs, list) {
582
- const normalized = inputs.map((curr)=>({
583
- ...curr,
584
- item: list[curr.oldIndex]
585
- })
586
- ).sort((a, b)=>a.oldIndex - b.oldIndex
587
- );
588
- return normalized;
589
- }
590
- function $eb03e74f8f7db1f3$export$7553c81e62e31b7e(props) {
591
- /* eslint-disable */ const { list: // react sortable props
592
- list , setList: setList , children: children , tag: tag , style: style , className: className , clone: clone , onAdd: // sortable options that have methods we want to overwrite
593
- onAdd , onChange: onChange , onChoose: onChoose , onClone: onClone , onEnd: onEnd , onFilter: onFilter , onRemove: onRemove , onSort: onSort , onStart: onStart , onUnchoose: onUnchoose , onUpdate: onUpdate , onMove: onMove , onSpill: onSpill , onSelect: onSelect , onDeselect: onDeselect , ...options } = props;
594
- /* eslint-enable */ return options;
595
- }
596
-
597
-
598
- /** Holds a global reference for which react element is being dragged */ // @todo - use context to manage this. How does one use 2 different providers?
599
- const $7fe8e3ea572bda7a$var$store = {
600
- dragging: null
601
- };
602
- class $7fe8e3ea572bda7a$export$11bbed9ee0012c13 extends $8zHUo$react.Component {
603
- constructor(props){
604
- super(props);
605
- // @todo forward ref this component
606
- this.ref = /*#__PURE__*/ $8zHUo$react.createRef();
607
- // make all state false because we can't change sortable unless a mouse gesture is made.
608
- const newList = [
609
- ...props.list
610
- ];
611
- newList.forEach((item)=>{
612
- Object.assign(item, {
613
- chosen: false,
614
- selected: false
615
- });
616
- });
617
- props.setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
618
- ($parcel$interopDefault($8zHUo$tinyinvariant))(//@ts-expect-error: Doesn't exist. Will deprecate soon.
619
- !props.plugins, `
620
- Plugins prop is no longer supported.
621
- Instead, mount it with "Sortable.mount(new MultiDrag())"
622
- Please read the updated README.md at https://github.com/SortableJS/react-sortablejs.
623
- `);
624
- }
625
- componentDidMount() {
626
- if (this.ref.current === null) return;
627
- const newOptions = this.makeOptions();
628
- ($parcel$interopDefault($8zHUo$sortablejs)).create(this.ref.current, newOptions);
629
- }
630
- componentDidUpdate(prevProps) {
631
- if (prevProps.disabled !== this.props.disabled && this.sortable) this.sortable.option("disabled", this.props.disabled);
632
- }
633
- render() {
634
- const { tag: tag , style: style , className: className , id: id } = this.props;
635
- const classicProps = {
636
- style: style,
637
- className: className,
638
- id: id
639
- };
640
- // if no tag, default to a `div` element.
641
- const newTag = !tag || tag === null ? "div" : tag;
642
- return(/*#__PURE__*/ $8zHUo$react.createElement(newTag, {
643
- // @todo - find a way (perhaps with the callback) to allow AntD components to work
644
- ref: this.ref,
645
- ...classicProps
646
- }, this.getChildren()));
647
- }
648
- getChildren() {
649
- const { children: children , dataIdAttr: dataIdAttr , selectedClass: selectedClass = "sortable-selected" , chosenClass: chosenClass = "sortable-chosen" , dragClass: /* eslint-disable */ dragClass = "sortable-drag" , fallbackClass: fallbackClass = "sortable-falback" , ghostClass: ghostClass = "sortable-ghost" , swapClass: swapClass = "sortable-swap-highlight" , filter: /* eslint-enable */ filter = "sortable-filter" , list: list , } = this.props;
650
- // if no children, don't do anything.
651
- if (!children || children == null) return null;
652
- const dataid = dataIdAttr || "data-id";
653
- /* eslint-disable-next-line */ return $8zHUo$react.Children.map(children, (child, index)=>{
654
- if (child === undefined) return undefined;
655
- const item = list[index] || {
656
- };
657
- const { className: prevClassName } = child.props;
658
- // @todo - handle the function if avalable. I don't think anyone will be doing this soon.
659
- const filtered = typeof filter === "string" && {
660
- [filter.replace(".", "")]: !!item.filtered
661
- };
662
- const className = ($parcel$interopDefault($8zHUo$classnames))(prevClassName, {
663
- [selectedClass]: item.selected,
664
- [chosenClass]: item.chosen,
665
- ...filtered
666
- });
667
- return(/*#__PURE__*/ $8zHUo$react.cloneElement(child, {
668
- [dataid]: child.key,
669
- className: className
670
- }));
671
- });
672
- }
673
- /** Appends the `sortable` property to this component */ get sortable() {
674
- const el = this.ref.current;
675
- if (el === null) return null;
676
- const key = Object.keys(el).find((k)=>k.includes("Sortable")
677
- );
678
- if (!key) return null;
679
- //@ts-expect-error: fix me.
680
- return el[key];
681
- }
682
- /** Converts all the props from `ReactSortable` into the `options` object that `Sortable.create(el, [options])` can use. */ makeOptions() {
683
- const DOMHandlers = [
684
- "onAdd",
685
- "onChoose",
686
- "onDeselect",
687
- "onEnd",
688
- "onRemove",
689
- "onSelect",
690
- "onSpill",
691
- "onStart",
692
- "onUnchoose",
693
- "onUpdate",
694
- ];
695
- const NonDOMHandlers = [
696
- "onChange",
697
- "onClone",
698
- "onFilter",
699
- "onSort",
700
- ];
701
- const newOptions = $eb03e74f8f7db1f3$export$7553c81e62e31b7e(this.props);
702
- DOMHandlers.forEach((name)=>newOptions[name] = this.prepareOnHandlerPropAndDOM(name)
703
- );
704
- NonDOMHandlers.forEach((name)=>newOptions[name] = this.prepareOnHandlerProp(name)
705
- );
706
- /** onMove has 2 arguments and needs to be handled seperately. */ const onMove1 = (evt, originalEvt)=>{
707
- const { onMove: onMove } = this.props;
708
- const defaultValue = evt.willInsertAfter || -1;
709
- if (!onMove) return defaultValue;
710
- const result = onMove(evt, originalEvt, this.sortable, $7fe8e3ea572bda7a$var$store);
711
- if (typeof result === "undefined") return false;
712
- return result;
713
- };
714
- return {
715
- ...newOptions,
716
- onMove: onMove1
717
- };
718
- }
719
- /** Prepares a method that will be used in the sortable options to call an `on[Handler]` prop & an `on[Handler]` ReactSortable method. */ prepareOnHandlerPropAndDOM(evtName) {
720
- return (evt)=>{
721
- // call the component prop
722
- this.callOnHandlerProp(evt, evtName);
723
- // calls state change
724
- //@ts-expect-error: until @types multidrag item is in
725
- this[evtName](evt);
726
- };
727
- }
728
- /** Prepares a method that will be used in the sortable options to call an `on[Handler]` prop */ prepareOnHandlerProp(evtName) {
729
- return (evt)=>{
730
- // call the component prop
731
- this.callOnHandlerProp(evt, evtName);
732
- };
733
- }
734
- /** Calls the `props.on[Handler]` function */ callOnHandlerProp(evt, evtName) {
735
- const propEvent = this.props[evtName];
736
- if (propEvent) propEvent(evt, this.sortable, $7fe8e3ea572bda7a$var$store);
737
- }
738
- // SORTABLE DOM HANDLING
739
- onAdd(evt) {
740
- const { list: list , setList: setList , clone: clone } = this.props;
741
- /* eslint-disable-next-line */ const otherList = [
742
- ...$7fe8e3ea572bda7a$var$store.dragging.props.list
743
- ];
744
- const customs = $eb03e74f8f7db1f3$export$4655efe700f887a(evt, otherList);
745
- $eb03e74f8f7db1f3$export$77f49a256021c8de(customs);
746
- const newList = $eb03e74f8f7db1f3$export$eca851ee65ae17e4(customs, list, evt, clone);
747
- newList.forEach((item)=>{
748
- Object.assign(item, {
749
- selected: false
750
- });
751
- });
752
- setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
753
- }
754
- onRemove(evt) {
755
- const { list: list , setList: setList } = this.props;
756
- const mode = $eb03e74f8f7db1f3$export$1fc0f6205829e19c(evt);
757
- const customs = $eb03e74f8f7db1f3$export$4655efe700f887a(evt, list);
758
- $eb03e74f8f7db1f3$export$a6177d5829f70ebc(customs);
759
- let newList = [
760
- ...list
761
- ];
762
- // remove state if not in clone mode. otherwise, keep.
763
- if (evt.pullMode !== "clone") newList = $eb03e74f8f7db1f3$export$be2da95e6167b0bd(customs, newList);
764
- else {
765
- // switch used to get the clone
766
- let customClones = customs;
767
- switch(mode){
768
- case "multidrag":
769
- customClones = customs.map((item, index)=>({
770
- ...item,
771
- element: evt.clones[index]
772
- })
773
- );
774
- break;
775
- case "normal":
776
- customClones = customs.map((item)=>({
777
- ...item,
778
- element: evt.clone
779
- })
780
- );
781
- break;
782
- case "swap":
783
- default:
784
- ($parcel$interopDefault($8zHUo$tinyinvariant))(true, `mode "${mode}" cannot clone. Please remove "props.clone" from <ReactSortable/> when using the "${mode}" plugin`);
785
- }
786
- $eb03e74f8f7db1f3$export$77f49a256021c8de(customClones);
787
- // replace selected items with cloned items
788
- customs.forEach((curr)=>{
789
- const index = curr.oldIndex;
790
- /* eslint-disable-next-line */ const newItem = this.props.clone(curr.item, evt);
791
- newList.splice(index, 1, newItem);
792
- });
793
- }
794
- // remove item.selected from list
795
- newList.forEach((item)=>{
796
- Object.assign(item, {
797
- selected: false
798
- });
799
- });
800
- setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
801
- }
802
- onUpdate(evt) {
803
- const { list: list , setList: setList } = this.props;
804
- const customs = $eb03e74f8f7db1f3$export$4655efe700f887a(evt, list);
805
- $eb03e74f8f7db1f3$export$77f49a256021c8de(customs);
806
- $eb03e74f8f7db1f3$export$a6177d5829f70ebc(customs);
807
- const newList = $eb03e74f8f7db1f3$export$c25cf8080bd305ec(customs, list);
808
- return setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
809
- }
810
- onStart() {
811
- $7fe8e3ea572bda7a$var$store.dragging = this;
812
- }
813
- onEnd() {
814
- $7fe8e3ea572bda7a$var$store.dragging = null;
815
- }
816
- onChoose(evt) {
817
- const { list: list , setList: setList } = this.props;
818
- const newList = list.map((item, index)=>{
819
- if (index === evt.oldIndex) Object.assign(item, {
820
- chosen: true
821
- });
822
- return item;
823
- });
824
- setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
825
- }
826
- onUnchoose(evt) {
827
- const { list: list , setList: setList } = this.props;
828
- const newList = list.map((item, index)=>{
829
- if (index === evt.oldIndex) Object.assign(item, {
830
- chosen: false
831
- });
832
- return item;
833
- });
834
- setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
835
- }
836
- onSpill(evt) {
837
- const { removeOnSpill: removeOnSpill , revertOnSpill: revertOnSpill } = this.props;
838
- if (removeOnSpill && !revertOnSpill) $eb03e74f8f7db1f3$export$1d0aa160432dfea5(evt.item);
839
- }
840
- onSelect(evt) {
841
- const { list: list , setList: setList } = this.props;
842
- const newList = [
843
- ...list
844
- ];
845
- newList.forEach((item)=>{
846
- Object.assign(item, {
847
- chosen: false
848
- });
849
- });
850
- evt.newIndicies.forEach((curr)=>{
851
- const index = curr.index;
852
- if (index === -1) {
853
- console.log(`"${evt.type}" had indice of "${curr.index}", which is probably -1 and doesn't usually happen here.`);
854
- console.log(evt);
855
- return;
856
- }
857
- newList[index].selected = true;
858
- });
859
- setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
860
- }
861
- onDeselect(evt) {
862
- const { list: list , setList: setList } = this.props;
863
- const newList = [
864
- ...list
865
- ];
866
- newList.forEach((item)=>{
867
- Object.assign(item, {
868
- chosen: false
869
- });
870
- });
871
- evt.newIndicies.forEach((curr)=>{
872
- const index = curr.index;
873
- if (index === -1) return;
874
- newList[index].selected = true;
875
- });
876
- setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
877
- }
878
- }
879
- $7fe8e3ea572bda7a$export$11bbed9ee0012c13.defaultProps = {
880
- clone: (item)=>item
881
- };
882
-
883
-
884
- var $faefaad95e5fcca0$exports = {};
885
-
886
-
887
- $parcel$exportWildcard(module.exports, $faefaad95e5fcca0$exports);
888
-
889
-
890
-
891
- } (dist));
892
-
893
- var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-dynamic-multi-box {\n width: 100%;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content {\n width: 100%;\n position: relative;\n overflow-x: auto;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .title-config {\n width: 100%;\n display: flex;\n align-items: center;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .title-config .title-config-row {\n display: flex;\n flex: 1;\n align-items: center;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .title-config .title-config-row .title-config-row-item {\n display: flex;\n align-items: center;\n flex: 1;\n min-width: 180px;\n margin-right: 12px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .title-config .title-config-row .row-form-switch {\n flex: 0;\n min-width: 80px;\n align-items: center;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .title-config .filter-panel {\n width: 36px;\n height: 36px;\n padding: 6px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .title-config .filter-panel svg {\n font-size: 24px;\n color: rgba(46, 55, 67, 0.7);\n cursor: pointer;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .title-config .filter-panel svg:hover {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 {\n width: 40px;\n display: flex;\n align-items: center;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon-panel {\n width: 36px;\n height: 36px;\n padding: 6px;\n cursor: pointer;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon-panel svg {\n font-size: 24px;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon-panel svg:hover {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon {\n width: 36px;\n height: 36px;\n padding: 6px;\n cursor: pointer;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon svg {\n font-size: 24px;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon:hover {\n background: rgba(171, 176, 185, 0.12);\n border-radius: 4px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon:hover svg {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .hidden-icon {\n display: none;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .center-line {\n width: 1px;\n height: 12px;\n border: 1px solid rgba(171, 176, 185, 0.4);\n margin: 0 3px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .blank-block {\n width: 44px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-80 {\n width: 80px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .content-row-form {\n width: 100%;\n display: flex;\n align-items: flex-start;\n min-height: 48px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .content-row-form .form-item {\n display: flex;\n align-items: flex-start;\n flex: 1;\n min-width: 180px;\n margin-right: 12px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .content-row-form .row-form-switch {\n flex: 0;\n box-sizing: content-box;\n align-items: center;\n height: 36px;\n min-width: 80px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .content-row-form .paraui-v3-helper-text {\n min-height: 12px;\n}\n.paraui-v3-dynamic-multi-box .add-button {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 36px;\n background: rgba(171, 176, 185, 0.12);\n border: 1px dashed rgba(171, 176, 185, 0.4);\n border-radius: 4px;\n}\n.paraui-v3-dynamic-multi-box .add-button .text {\n font-size: 14px;\n margin-left: 8px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-add-button-top-20 {\n margin-top: 20px;\n}\n.paraui-v3-dynamic-multi-box .normal-button {\n cursor: pointer;\n}\n.paraui-v3-dynamic-multi-box .normal-button .text {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-dynamic-multi-box .normal-button:hover {\n background: rgba(54, 102, 214, 0.05);\n border: 1px dashed rgba(54, 102, 214, 0.4);\n}\n.paraui-v3-dynamic-multi-box .disabled-add .text {\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-v3-dynamic-multi-box .disabled-add svg {\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-v3-dynamic-multi-box .paraui-v3-comboselect,\n.paraui-v3-dynamic-multi-box .paraui-v3-picker-wrapper {\n width: 100%;\n}\n.paraui-v3-dynamic-multi-box .multi-value-switch {\n width: 100%;\n display: flex;\n align-items: center;\n}\n.paraui-v3-dynamic-multi-box .multi-value-switch .switch-text {\n color: rgba(46, 55, 67, 0.4);\n margin-right: 4px;\n overflow: hidden;\n}\n.paraui-v3-dynamic-multi-box .multi-value-switch .switch {\n flex: 1;\n}\n\n.paraui-v3-dynamic-multi-box-popover .filter-config {\n width: 200px;\n max-height: 300px;\n padding-top: 16px;\n overflow-y: auto;\n}\n.paraui-v3-dynamic-multi-box-popover .filter-config .check-list {\n padding: 0 12px;\n overflow-y: auto;\n}\n.paraui-v3-dynamic-multi-box-popover .filter-config .check-list .title {\n font-size: 12px;\n color: rgba(46, 55, 67, 0.4);\n margin-bottom: 12px;\n}\n.paraui-v3-dynamic-multi-box-popover .filter-config .check-list .paraui-v3-check-box {\n margin-bottom: 22px;\n}\n.paraui-v3-dynamic-multi-box-popover .filter-config .check-list .paraui-v3-check-box:last-child {\n margin-bottom: 22px;\n}\n.paraui-v3-dynamic-multi-box-popover .filter-config .restore-default {\n display: flex;\n justify-content: center;\n align-items: center;\n position: sticky;\n width: 100%;\n left: 0;\n bottom: 0;\n top: -2px;\n height: 44px;\n color: rgb(54, 102, 214);\n cursor: pointer;\n border-top: 1px solid rgba(171, 176, 185, 0.12);\n background-color: #fff;\n}\n.paraui-v3-dynamic-multi-box-popover .no-other-property {\n width: 200px;\n padding: 16px 0;\n text-align: center;\n font-size: 12px;\n color: rgba(46, 55, 67, 0.4);\n}";
894
- styleInject(css_248z);
895
-
896
- var DynamicMultiBox = function DynamicMultiBox(props) {
897
- var valueList = props.valueList,
898
- _props$config = props.config,
899
- config = _props$config === void 0 ? [] : _props$config,
900
- _props$errors = props.errors,
901
- errors = _props$errors === void 0 ? [] : _props$errors,
902
- _props$isSort = props.isSort,
903
- isSort = _props$isSort === void 0 ? false : _props$isSort,
904
- _props$isFilter = props.isFilter,
905
- isFilter = _props$isFilter === void 0 ? false : _props$isFilter,
906
- className = props.className,
907
- _props$disabledAdd = props.disabledAdd,
908
- disabledAdd = _props$disabledAdd === void 0 ? false : _props$disabledAdd,
909
- _props$titleMode = props.titleMode,
910
- titleMode = _props$titleMode === void 0 ? 'all' : _props$titleMode,
911
- checkedValue = props.checkedValue,
912
- icon = props.icon,
913
- _props$deleteDisable = props.deleteDisable,
914
- deleteDisable = _props$deleteDisable === void 0 ? [] : _props$deleteDisable,
915
- singleTitle = props.singleTitle,
916
- initValue = props.initValue,
917
- popoverClassName = props.popoverClassName,
918
- onChange = props.onChange,
919
- onAdd = props.onAdd,
920
- onFilter = props.onFilter,
921
- onDelete = props.onDelete,
922
- onSort = props.onSort;
923
- var _useState = useState([]),
924
- _useState2 = _slicedToArray(_useState, 2),
925
- checked = _useState2[0],
926
- setChecked = _useState2[1];
927
- var domRef = useRef(null);
928
- var _useState3 = useState([]),
929
- _useState4 = _slicedToArray(_useState3, 2),
930
- fixedConfig = _useState4[0],
931
- setFixedConfig = _useState4[1];
932
- var _useState5 = useState([]),
933
- _useState6 = _slicedToArray(_useState5, 2),
934
- selectedConfig = _useState6[0],
935
- setSelectedConfig = _useState6[1];
936
- useEffect(function () {
937
- if (checkedValue) setChecked(checkedValue);
938
- }, [checkedValue]);
939
- useEffect(function () {
940
- if (!(config === null || config === void 0 ? void 0 : config.length)) return;
941
- // 筛选出固定字段
942
- var fixedArr = (config === null || config === void 0 ? void 0 : config.filter(function (item) {
943
- return item.isFixed;
944
- })) || [];
945
- setFixedConfig(fixedArr);
946
- }, [config]);
947
- useEffect(function () {
948
- if (!(config === null || config === void 0 ? void 0 : config.length)) return;
949
- // 通过透传的checkedValue映射出对应的配置
950
- var selectedArr = (config === null || config === void 0 ? void 0 : config.filter(function (item) {
951
- return !item.isFixed && (checked === null || checked === void 0 ? void 0 : checked.includes(item.name));
952
- })) || [];
953
- setSelectedConfig(selectedArr);
954
- }, [config, checked]);
955
- /**
956
- * @desc 内容产生滚动时,给新增按增加marginTop: 20
957
- * */
958
- useEffect(function () {
959
- monitorScroll();
960
- }, []);
961
- /**
962
- * @desc 筛选回调
963
- * */
964
- var onCheckChange = function onCheckChange(val) {
965
- // 1、更新selectedConfig配置 2、更新valueList 3、更新errors
966
- // 区分正选反选
967
- var bool = (val === null || val === void 0 ? void 0 : val.length) > (checked === null || checked === void 0 ? void 0 : checked.length);
968
- // 当前选中数据和上一次选择数据取差值
969
- var currentVal = getArrDiffSet(val, checked);
970
- var valueArr = _toConsumableArray(valueList);
971
- var errorArr = _toConsumableArray(errors);
972
- if (bool) {
973
- valueArr = handleCheckedConfig(valueArr, currentVal);
974
- errorArr = handleCheckedConfig(errorArr, currentVal);
975
- } else {
976
- handleUncheckedConfig(valueArr, currentVal);
977
- handleUncheckedConfig(errorArr, currentVal);
978
- }
979
- setChecked(val);
980
- onFilter && onFilter({
981
- name: currentVal,
982
- checkedVal: val,
983
- valueList: valueArr,
984
- errors: errorArr
985
- });
986
- monitorScroll();
987
- };
988
- /** 监听内容是否产生横向滚动*/
989
- var monitorScroll = function monitorScroll() {
990
- setTimeout(function () {
991
- var dom = document.querySelector('#multi-value-add-button');
992
- if ((domRef === null || domRef === void 0 ? void 0 : domRef.current.offsetWidth) < (domRef === null || domRef === void 0 ? void 0 : domRef.current.scrollWidth)) dom === null || dom === void 0 ? void 0 : dom.classList.add('multi-value-add-button-top-20');else dom === null || dom === void 0 ? void 0 : dom.classList.remove('multi-value-add-button-top-20');
993
- }, 0);
994
- };
995
- /**
996
- * @desc 筛选恢复默认,
997
- * */
998
- var onRestoreDefault = function onRestoreDefault() {
999
- if (!(checked === null || checked === void 0 ? void 0 : checked.length)) return;
1000
- var valueArr = _toConsumableArray(valueList);
1001
- var errorArr = _toConsumableArray(errors);
1002
- restoreData(valueArr, checked);
1003
- restoreData(errorArr, checked);
1004
- setChecked([]);
1005
- setSelectedConfig([]);
1006
- onFilter && onFilter({
1007
- valueList: valueArr,
1008
- errors: errorArr
1009
- });
1010
- };
1011
- /**
1012
- * @desc 数据重置
1013
- * */
1014
- var restoreData = function restoreData(data, checked) {
1015
- data.forEach(function (item) {
1016
- for (var key in item) {
1017
- if (checked.includes(key)) delete item[key];
1018
- }
1019
- });
1020
- };
1021
- /**
1022
- * @desc 反选时更新错误集合errors和valueList集合
1023
- * @param dataArr 错误集合errors或者valueList集合
1024
- * @param currentVal 反选值
1025
- * */
1026
- var handleUncheckedConfig = function handleUncheckedConfig() {
1027
- var dataArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1028
- var currentVal = arguments.length > 1 ? arguments[1] : undefined;
1029
- dataArr.forEach(function (item) {
1030
- for (var itemKey in item) {
1031
- if (itemKey === currentVal) delete item[itemKey];
1032
- }
1033
- });
1034
- };
1035
- /**
1036
- * @desc 正选时更新错误集合errors和valueList集合
1037
- * @param dataArr 错误集合errors或者valueList集合
1038
- * @param currentVal 正选值
1039
- * */
1040
- var handleCheckedConfig = function handleCheckedConfig(dataArr, currentVal) {
1041
- return dataArr.map(function (item) {
1042
- return Object.assign(Object.assign({}, item), _defineProperty({}, currentVal, ''));
1043
- });
1044
- };
1045
- /**
1046
- * 弹窗筛选器内容
1047
- * */
1048
- var renderPopoverContent = function renderPopoverContent() {
1049
- var filterConfig = config.filter(function (item) {
1050
- return !item.isFixed;
1051
- });
1052
- return jsx(Fragment, {
1053
- children: filterConfig && (filterConfig === null || filterConfig === void 0 ? void 0 : filterConfig.length) > 0 ? jsxs("div", Object.assign({
1054
- className: "filter-config"
1055
- }, {
1056
- children: [jsxs("div", Object.assign({
1057
- className: "check-list"
1058
- }, {
1059
- children: [jsx("div", Object.assign({
1060
- className: "title"
1061
- }, {
1062
- children: "\u8868\u5355\u914D\u7F6E (\u975E\u5FC5\u586B\u9879)"
1063
- })), jsx(CheckboxGroup, {
1064
- list: filterConfig,
1065
- row: false,
1066
- value: checked,
1067
- onChange: onCheckChange
1068
- })]
1069
- })), jsx("div", Object.assign({
1070
- className: "restore-default",
1071
- onClick: onRestoreDefault
1072
- }, {
1073
- children: "\u6062\u590D\u9ED8\u8BA4"
1074
- }))]
1075
- })) : jsx("div", Object.assign({
1076
- className: "no-other-property"
1077
- }, {
1078
- children: "\u6682\u65E0\u5176\u4ED6\u5C5E\u6027"
1079
- }))
1080
- });
1081
- };
1082
- var popoverHandClass = function popoverHandClass() {
1083
- var str = $prefixCls + '-dynamic-multi-box-popover';
1084
- if (popoverClassName) str += ' ' + popoverClassName;
1085
- return str;
1086
- };
1087
- /**
1088
- * 渲染表头
1089
- * */
1090
- var renderTitle = useMemo(function () {
1091
- var _a, _b;
1092
- if (!((_a = [].concat(_toConsumableArray(fixedConfig), _toConsumableArray(selectedConfig))) === null || _a === void 0 ? void 0 : _a.length)) return null;
1093
- return jsxs("div", Object.assign({
1094
- className: 'title-config'
1095
- }, {
1096
- children: [titleMode === 'all' ? jsx("div", Object.assign({
1097
- className: 'title-config-row'
1098
- }, {
1099
- children: (_b = [].concat(_toConsumableArray(fixedConfig), _toConsumableArray(selectedConfig))) === null || _b === void 0 ? void 0 : _b.map(function (item, index) {
1100
- var label = item.label,
1101
- required = item.required,
1102
- className = item.className,
1103
- inputType = item.inputType;
1104
- return jsx("div", Object.assign({
1105
- className: "title-config-row-item ".concat(inputType === 'Switch' ? 'row-form-switch' : '', " ").concat(className)
1106
- }, {
1107
- children: jsx(Label, {
1108
- required: required,
1109
- label: label
1110
- })
1111
- }), index);
1112
- })
1113
- })) : titleMode === 'single' ? jsx(Label, {
1114
- required: singleTitle === null || singleTitle === void 0 ? void 0 : singleTitle.required,
1115
- label: singleTitle === null || singleTitle === void 0 ? void 0 : singleTitle.label
1116
- }) : null, jsxs("div", Object.assign({
1117
- className: "operator-column-40 ".concat(isSort && (valueList === null || valueList === void 0 ? void 0 : valueList.length) > 1 ? 'operator-column-80' : '')
1118
- }, {
1119
- children: [isSort && jsx("div", {
1120
- className: 'blank-block'
1121
- }), isFilter && jsx(Popover, Object.assign({
1122
- placement: 'bottom-end',
1123
- content: renderPopoverContent(),
1124
- getPopupContainer: function getPopupContainer() {
1125
- return document.body;
1126
- },
1127
- overlayClassName: popoverHandClass()
1128
- }, {
1129
- children: jsx("div", Object.assign({
1130
- className: 'operator-column-icon-panel'
1131
- }, {
1132
- children: jsx(Panel, {})
1133
- }))
1134
- }))]
1135
- }))]
1136
- }));
1137
- }, [titleMode, fixedConfig, selectedConfig, isSort, isFilter, checked, onCheckChange, onRestoreDefault]);
1138
- /**
1139
- *@desc 渲染内容
1140
- * */
1141
- var renderContent = useMemo(function () {
1142
- if (valueList && (valueList === null || valueList === void 0 ? void 0 : valueList.length) > 0) {
1143
- var showDeleteIcon = valueList.length > 1;
1144
- return jsx(Fragment, {
1145
- children: valueList.map(function (item, rowIndex) {
1146
- var _a;
1147
- var id = item.id;
1148
- var rowError = (_a = errors === null || errors === void 0 ? void 0 : errors.filter(function (item) {
1149
- return item.id === id;
1150
- })) === null || _a === void 0 ? void 0 : _a[0];
1151
- return jsxs("div", Object.assign({
1152
- className: 'content-row-form'
1153
- }, {
1154
- children: [jsx(RowForm, {
1155
- rowIndex: rowIndex,
1156
- valueList: valueList,
1157
- errors: errors,
1158
- rowError: rowError,
1159
- onFormItemChange: function onFormItemChange(name, id, value) {
1160
- return _onFormItemChange(name, id, value, rowIndex);
1161
- },
1162
- icon: icon,
1163
- config: [].concat(_toConsumableArray(fixedConfig), _toConsumableArray(selectedConfig))
1164
- }), jsxs("div", Object.assign({
1165
- className: "operator-column-40 ".concat(isSort && showDeleteIcon ? 'operator-column-80' : '')
1166
- }, {
1167
- children: [jsx("div", Object.assign({
1168
- className: "operator-column-icon delete-icon ".concat(!showDeleteIcon || deleteDisable.includes(id) ? 'hidden-icon' : ''),
1169
- onClick: function onClick() {
1170
- return onDeleteEvent(rowIndex);
1171
- }
1172
- }, {
1173
- children: jsx(Delete, {})
1174
- })), jsx("div", {
1175
- className: 'blank-block'
1176
- }), isSort && jsx("div", Object.assign({
1177
- className: !showDeleteIcon || deleteDisable.includes(id) ? 'hidden-icon' : 'center-line'
1178
- }, {
1179
- children: jsx("div", {
1180
- className: 'line'
1181
- })
1182
- })), isSort && jsx("div", Object.assign({
1183
- className: "sort-handler operator-column-icon ".concat(!showDeleteIcon ? 'hidden-icon' : '')
1184
- }, {
1185
- children: jsx(Drag, {})
1186
- }))]
1187
- }))]
1188
- }), rowIndex);
1189
- })
1190
- });
1191
- } else return null;
1192
- }, [valueList, isSort, isFilter, errors, fixedConfig, selectedConfig]);
1193
- /**
1194
- * @desc 删除事件
1195
- * */
1196
- var onDeleteEvent = function onDeleteEvent(rowIndex) {
1197
- var valueArr = _toConsumableArray(valueList);
1198
- var errorArr = _toConsumableArray(errors);
1199
- valueArr.splice(rowIndex, 1);
1200
- errorArr.splice(rowIndex, 1);
1201
- onDelete && onDelete(valueArr, errorArr);
1202
- };
1203
- /**
1204
- * @desc 表单回调
1205
- * @param value 表单回调值
1206
- * @param name
1207
- * @param rowIndex 表单所处行下标
1208
- * @param id 表单所处行中的id
1209
- * */
1210
- var _onFormItemChange = function _onFormItemChange(name, id, value, rowIndex) {
1211
- var valueArr = _toConsumableArray(valueList);
1212
- Object.keys(valueArr[rowIndex]).forEach(function (key) {
1213
- if (name === key) valueArr[rowIndex][key] = value;
1214
- });
1215
- onChange && onChange(valueArr, {
1216
- name: name,
1217
- id: id,
1218
- value: value,
1219
- rowIndex: rowIndex
1220
- });
1221
- };
1222
- /**
1223
- * @desc 新增事件
1224
- * */
1225
- var onAddEvent = function onAddEvent() {
1226
- // 根据配置进行valueList更新
1227
- var valueArr = _toConsumableArray(valueList || []);
1228
- var errorArr = _toConsumableArray(errors);
1229
- var id = UUID();
1230
- // 取出已经筛选的配置数据
1231
- var configArr = [].concat(_toConsumableArray(fixedConfig), _toConsumableArray(selectedConfig));
1232
- valueArr.push(Object.assign(Object.assign({}, getNewItem(configArr, 'value')), {
1233
- id: id
1234
- }));
1235
- errorArr.push(Object.assign(Object.assign({}, getNewItem(configArr, 'error')), {
1236
- id: id
1237
- }));
1238
- onAdd && onAdd(valueArr, errorArr);
1239
- };
1240
- /**
1241
- * @desc 新增时,获取valueList和errors的新增项
1242
- * @param configArr 配置表
1243
- * @param type 区分值和错误
1244
- * */
1245
- var getNewItem = function getNewItem(configArr, type) {
1246
- return configArr.reduce(function (acc, cur) {
1247
- return Object.assign(Object.assign({}, acc), _defineProperty({}, cur.name, type === 'value' ? initValue === null || initValue === void 0 ? void 0 : initValue[cur.name] : ''));
1248
- }, {});
1249
- };
1250
- /**
1251
- * @desc 排序
1252
- * @param newValueList 排序后的数组
1253
- * */
1254
- var onDragSort = function onDragSort(newValueList) {
1255
- // 获取排序后 id映射下标集合
1256
- var idMapIndex = newValueList.reduce(function (acc, cur, index) {
1257
- return Object.assign(Object.assign({}, acc), _defineProperty({}, cur.id, index));
1258
- }, {});
1259
- // 需要交换的下标集合
1260
- var swapIds = [];
1261
- valueList.forEach(function (item, idx) {
1262
- if (idx !== idMapIndex[item.id]) swapIds.push(idx);
1263
- });
1264
- onSort && onSort(newValueList, swapIds);
1265
- };
1266
- /**
1267
- * @description: 获取两个数组的差值
1268
- * @param {string} currentVal
1269
- * @param {string} preVal
1270
- */
1271
- var getArrDiffSet = function getArrDiffSet(currentVal, preVal) {
1272
- return currentVal.concat(preVal).filter(function (v) {
1273
- return !currentVal.includes(v) || !preVal.includes(v);
1274
- })[0];
1275
- };
1276
- /**
1277
- * @desc 处理className
1278
- * */
1279
- var handClass = function handClass() {
1280
- var str = $prefixCls + '-dynamic-multi-box';
1281
- if (className) str += ' ' + className;
1282
- return str;
1283
- };
1284
- return jsxs("div", Object.assign({
1285
- className: handClass()
1286
- }, {
1287
- children: [jsxs("div", Object.assign({
1288
- className: 'multi-value-content',
1289
- ref: domRef
1290
- }, {
1291
- children: [renderTitle, jsx(dist.exports.ReactSortable, Object.assign({
1292
- list: valueList,
1293
- handle: '.sort-handler',
1294
- animation: 150,
1295
- setList: onDragSort
1296
- }, {
1297
- children: renderContent
1298
- }))]
1299
- })), jsxs("div", Object.assign({
1300
- className: "add-button ".concat(disabledAdd ? 'disabled-add' : 'normal-button'),
1301
- onClick: onAddEvent,
1302
- id: 'multi-value-add-button'
1303
- }, {
1304
- children: [jsx(PlusCircleF, {}), jsx("span", Object.assign({
1305
- className: 'text'
1306
- }, {
1307
- children: "\u65B0 \u589E"
1308
- }))]
1309
- }))]
1310
- }));
1311
- };
1312
-
1313
- export { DynamicMultiBox as default };