@para-ui/core 3.0.55 → 3.0.56

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