@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
package/Selector/index.js DELETED
@@ -1,2175 +0,0 @@
1
- import { _ as _toConsumableArray } from '../_verture/toConsumableArray-81040c9e.js';
2
- import { _ as _slicedToArray } from '../_verture/slicedToArray-76060636.js';
3
- import { r as regenerator } from '../_verture/index-beef914f.js';
4
- import { a as __awaiter, _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
5
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
6
- import { useState, useRef, useEffect, Fragment as Fragment$1 } from 'react';
7
- import { Radio } from '../Radio/index.js';
8
- import { Checkbox } from '../Checkbox/index.js';
9
- import { Popover } from '../Popover/index.js';
10
- import AutoTips from '../AutoTips/index.js';
11
- import { Loading } from '../Loading/index.js';
12
- import CloseIcon from '@para-ui/icons/Close';
13
- import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
14
- import { u as useFormatMessage } from '../_verture/useFormatMessage-703f8b20.js';
15
- import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
16
- import { Search } from '../Search/index.js';
17
- import { Breadcrumbs } from '../Breadcrumbs/index.js';
18
- import Empty from '../Empty/index.js';
19
- import SearchIcon from '@para-ui/icons/Search';
20
- import Refresh from '@para-ui/icons/Refresh';
21
- import { ArrayToObject, Get, Post, Cancel } from '@paraview/lib';
22
- import { u as useGlobalProps } from '../_verture/useGlobalProps-1b846a65.js';
23
- import '../_verture/unsupportedIterableToArray-cb478f24.js';
24
- import '../Label/index.js';
25
- import '../Help/index.js';
26
- import '../Tooltip/index.js';
27
- import 'rc-tooltip';
28
- import 'rc-tooltip/lib/placements';
29
- import 'clsx';
30
- import '@para-ui/icons/Help';
31
- import '../_verture/usePopupContainer-87febeb9.js';
32
- import '@para-ui/icons/LoadingF';
33
- import '@para-ui/core/GlobalContext';
34
- import '../TextField/index.js';
35
- import '../_verture/typeof-498dd2b1.js';
36
- import '@para-ui/icons/PreviewClose';
37
- import '@para-ui/icons/PreviewOpen';
38
- import '@para-ui/icons/CloseCircle';
39
- import '../HelperText/index.js';
40
- import '../_verture/index-77f9e0fb.js';
41
- import 'rc-dropdown';
42
- import 'dayjs';
43
- import '../Button/index.js';
44
- import '@para-ui/icons/Forbid';
45
- import '@para-ui/icons/Down';
46
- import '@para-ui/icons/More';
47
- import '@para-ui/icons/Return';
48
-
49
- var en = {
50
- root: 'root',
51
- selectAll: 'Select all',
52
- seeMore: 'See more',
53
- selected: 'Selected',
54
- pleaseEnter: 'Please enter',
55
- searchResult: 'Search result',
56
- detail: 'Details',
57
- child: 'Level'
58
- };
59
-
60
- var zh = {
61
- root: '根',
62
- selectAll: '全选',
63
- seeMore: '查看更多',
64
- selected: '已选',
65
- pleaseEnter: '请输入',
66
- searchResult: '搜索结果',
67
- detail: '详情',
68
- child: '下级'
69
- };
70
-
71
- var localeJson = {
72
- zh: zh,
73
- en: en
74
- };
75
-
76
- var css_248z$3 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-selector-node {\n display: flex;\n justify-content: space-between;\n align-items: center;\n cursor: pointer;\n}\n.paraui-v3-selector-node:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-selector-node > .selector-node-left {\n display: flex;\n align-items: center;\n flex: 1;\n overflow: hidden;\n padding-right: 16px;\n}\n.paraui-v3-selector-node > .selector-node-left > .selector-node-radio {\n margin-right: 8px;\n display: flex;\n align-items: center;\n padding: 0;\n}\n.paraui-v3-selector-node > .selector-node-left > .selector-node-radio .radio-box {\n top: 0;\n}\n.paraui-v3-selector-node > .selector-node-left > .selector-node-check {\n margin-right: 8px;\n display: flex;\n align-items: center;\n padding: 0;\n}\n.paraui-v3-selector-node > .selector-node-left > .selector-node-check .checkbox-box {\n top: 0;\n}\n.paraui-v3-selector-node > .selector-node-left > .node-img {\n display: inline-block;\n width: 30px;\n height: 30px;\n margin-right: 8px;\n}\n.paraui-v3-selector-node > .selector-node-left > .node-img img {\n width: 30px;\n height: 30px;\n border-radius: 50%;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-branch {\n height: 36px;\n padding: 0 16px;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-branch > .selector-node-left > .main-title {\n font-size: 14px;\n color: rgb(46, 55, 67);\n white-space: nowrap;\n height: 20px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-branch > .selector-node-left > .sub-title {\n margin-left: 8px;\n font-size: 14px;\n color: rgba(46, 55, 67, 0.4);\n white-space: nowrap;\n height: 20px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-branch > .selector-node-left > .tag {\n margin-left: 8px;\n background-color: rgba(54, 102, 214, 0.05);\n color: rgb(54, 102, 214);\n border-radius: 2px;\n font-size: 12px;\n padding: 0px 6px;\n white-space: nowrap;\n height: 17px;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-leaf {\n padding: 6px 16px;\n height: 48px;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-leaf > .selector-node-left > .title-box {\n flex: 1;\n overflow: hidden;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-leaf > .selector-node-left > .title-box > .main-title-box {\n display: flex;\n white-space: nowrap;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-leaf > .selector-node-left > .title-box > .main-title-box > .main-title {\n font-size: 14px;\n color: rgb(46, 55, 67);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-leaf > .selector-node-left > .title-box > .main-title-box > .tag {\n margin-left: 8px;\n background-color: rgba(54, 102, 214, 0.05);\n color: rgb(54, 102, 214);\n border-radius: 2px;\n font-size: 12px;\n padding: 1px 6px;\n white-space: nowrap;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-leaf > .selector-node-left > .title-box > .sub-title {\n font-size: 12px;\n color: rgba(46, 55, 67, 0.4);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.paraui-v3-selector-node > .selector-node-right {\n display: flex;\n align-items: center;\n height: 100%;\n}\n.paraui-v3-selector-node > .selector-node-right > .detail {\n font-size: 14px;\n color: rgb(54, 102, 214);\n white-space: nowrap;\n padding: 0 4px;\n cursor: pointer;\n height: 24px;\n line-height: 24px;\n border-radius: 2px;\n}\n.paraui-v3-selector-node > .selector-node-right > .detail:hover {\n background-color: rgba(54, 102, 214, 0.05);\n}\n.paraui-v3-selector-node > .selector-node-right > .line {\n border-left: 1px solid rgba(171, 176, 185, 0.2);\n margin: 0 8px;\n content: \"\";\n display: inline-block;\n height: 12px;\n}\n.paraui-v3-selector-node > .selector-node-right > .lower-child {\n font-size: 14px;\n color: rgb(54, 102, 214);\n white-space: nowrap;\n padding: 0 4px;\n cursor: pointer;\n height: 24px;\n line-height: 24px;\n border-radius: 2px;\n}\n.paraui-v3-selector-node > .selector-node-right > .lower-child:hover {\n background-color: rgba(54, 102, 214, 0.05);\n}\n.paraui-v3-selector-node > .selector-node-right > .close {\n display: flex;\n align-items: center;\n color: rgb(54, 102, 214);\n white-space: nowrap;\n padding: 0 4px;\n cursor: pointer;\n height: 24px;\n line-height: 24px;\n border-radius: 2px;\n}\n.paraui-v3-selector-node > .selector-node-right > .close:hover {\n background-color: rgba(54, 102, 214, 0.05);\n}\n.paraui-v3-selector-node > .selector-node-right > .close:hover > svg {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-selector-node > .selector-node-right > .close > svg {\n font-size: 16px;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-edit > .selector-node-right > .detail, .paraui-v3-selector-node.paraui-v3-selector-node-edit > .selector-node-right > .lower-child {\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-edit > .selector-node-right > .detail:hover, .paraui-v3-selector-node.paraui-v3-selector-node-edit > .selector-node-right > .lower-child:hover {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-disabled {\n cursor: not-allowed;\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-disabled.paraui-v3-selector-node-branch > .selector-node-left > .main-title {\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-disabled.paraui-v3-selector-node-leaf > .selector-node-left > .title-box > .main-title-box > .main-title {\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-disabled > .selector-node-right > .lower-child {\n cursor: not-allowed;\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-v3-selector-node.paraui-v3-selector-node-disabled-child > .selector-node-right > .lower-child {\n cursor: not-allowed;\n color: rgba(46, 55, 67, 0.4);\n}\n\n.paraui-v3-selector-detail .selector-detail-popover-content.selector-detail-popover-content-loading {\n min-width: 100px;\n min-height: 50px;\n}";
77
- styleInject(css_248z$3);
78
-
79
- var SelectorNode = function SelectorNode(props) {
80
- var className = props.className,
81
- style = props.style,
82
- _props$nodeMode = props.nodeMode,
83
- nodeMode = _props$nodeMode === void 0 ? 'branch' : _props$nodeMode,
84
- _props$useCase = props.useCase,
85
- useCase = _props$useCase === void 0 ? 'view' : _props$useCase,
86
- img = props.img,
87
- selectMode = props.selectMode,
88
- mainTitle = props.mainTitle,
89
- subTitle = props.subTitle,
90
- tag = props.tag,
91
- tagStyle = props.tagStyle,
92
- detail = props.detail,
93
- detailRender = props.detailRender,
94
- leftRender = props.leftRender,
95
- child = props.child,
96
- close = props.close,
97
- checked = props.checked,
98
- indeterminate = props.indeterminate,
99
- disabled = props.disabled,
100
- disabledChild = props.disabledChild,
101
- onLevel = props.onLevel,
102
- onSelect = props.onSelect,
103
- onClose = props.onClose;
104
- var intl = useFormatMessage('Selector', localeJson);
105
- var _useState = useState(),
106
- _useState2 = _slicedToArray(_useState, 2),
107
- detailDom = _useState2[0],
108
- setDetailDom = _useState2[1]; // 详情内容
109
- var _useState3 = useState(false),
110
- _useState4 = _slicedToArray(_useState3, 2),
111
- detailDomLoading = _useState4[0],
112
- setDetailDomLoading = _useState4[1]; // 详情loading
113
- var detailRef = useRef();
114
- /** 点击节点 */
115
- var onClickNode = function onClickNode() {
116
- if (disabled) return;
117
- onSelect && onSelect();
118
- };
119
- /** 点击下级 */
120
- var onLevelBtn = function onLevelBtn(e) {
121
- e.stopPropagation();
122
- if (disabled || disabledChild) return;
123
- onLevel && onLevel();
124
- };
125
- /** 点击详情 */
126
- var onClickDetail = function onClickDetail(e) {
127
- e.stopPropagation();
128
- };
129
- /** 点击× */
130
- var onCloseCom = function onCloseCom(e) {
131
- e.stopPropagation();
132
- onClose && onClose();
133
- };
134
- /** 详情显示隐藏 */
135
- var onVisibleChange = function onVisibleChange(bol) {
136
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
137
- var Dom;
138
- return regenerator.wrap(function _callee$(_context) {
139
- while (1) switch (_context.prev = _context.next) {
140
- case 0:
141
- if (detailRender) {
142
- _context.next = 2;
143
- break;
144
- }
145
- return _context.abrupt("return");
146
- case 2:
147
- setDetailDomLoading(false);
148
- if (bol) {
149
- _context.next = 5;
150
- break;
151
- }
152
- return _context.abrupt("return", setDetailDom(null));
153
- case 5:
154
- setDetailDomLoading(true);
155
- detailRef.current && detailRef.current.classList.add('selector-detail-popover-content-loading');
156
- _context.next = 9;
157
- return detailRender();
158
- case 9:
159
- Dom = _context.sent;
160
- detailRef.current && detailRef.current.classList.remove('selector-detail-popover-content-loading');
161
- setDetailDomLoading(false);
162
- setDetailDom(Dom);
163
- case 13:
164
- case "end":
165
- return _context.stop();
166
- }
167
- }, _callee);
168
- }));
169
- };
170
- /** 处理头像 */
171
- var handImg = function handImg() {
172
- if (!img) return null;
173
- var imgDom = img;
174
- if (typeof img === "string") imgDom = jsx("img", {
175
- src: img
176
- });
177
- return jsx("span", Object.assign({
178
- className: "node-img"
179
- }, {
180
- children: imgDom
181
- }));
182
- };
183
- /** 处理选择框 */
184
- var handSelectDom = function handSelectDom() {
185
- if (selectMode === 'radio') return jsx(Radio, {
186
- size: "small",
187
- className: 'selector-node-radio',
188
- checked: checked,
189
- disabled: disabled
190
- });
191
- if (selectMode === 'check') return jsx(Checkbox, {
192
- size: "small",
193
- className: 'selector-node-check',
194
- checked: checked,
195
- disabled: disabled,
196
- indeterminate: indeterminate
197
- });
198
- return null;
199
- };
200
- /** 处理详情弹窗 */
201
- var handDetailDom = function handDetailDom() {
202
- return jsxs("div", Object.assign({
203
- className: "selector-detail-popover-content",
204
- ref: detailRef
205
- }, {
206
- children: [detailDom, detailDomLoading && jsx(Loading, {})]
207
- }));
208
- };
209
- /** 处理详情 */
210
- var handDetail = function handDetail() {
211
- if (!detail) return null;
212
- return jsx(Popover, Object.assign({
213
- content: handDetailDom(),
214
- trigger: 'hover',
215
- placement: 'bottomRight',
216
- overlayClassName: $prefixCls + '-selector-detail',
217
- onVisibleChange: onVisibleChange
218
- }, {
219
- children: jsx("span", Object.assign({
220
- className: "detail",
221
- onClick: onClickDetail
222
- }, {
223
- children: intl({
224
- id: 'detail'
225
- })
226
- }))
227
- }));
228
- };
229
- /** 处理标签内容 */
230
- var handNodeLeft = function handNodeLeft() {
231
- if (nodeMode === 'branch') {
232
- return jsxs(Fragment, {
233
- children: [mainTitle && jsx("span", Object.assign({
234
- className: "main-title"
235
- }, {
236
- children: jsx(AutoTips, {
237
- children: mainTitle
238
- })
239
- })), subTitle && jsx("span", Object.assign({
240
- className: "sub-title"
241
- }, {
242
- children: jsx(AutoTips, {
243
- children: subTitle
244
- })
245
- })), tag && jsx("span", Object.assign({
246
- className: "tag",
247
- style: tagStyle
248
- }, {
249
- children: tag
250
- }))]
251
- });
252
- }
253
- if (nodeMode === 'leaf') {
254
- return jsxs("div", Object.assign({
255
- className: "title-box"
256
- }, {
257
- children: [jsxs("div", Object.assign({
258
- className: "main-title-box"
259
- }, {
260
- children: [mainTitle && jsx("span", Object.assign({
261
- className: "main-title"
262
- }, {
263
- children: jsx(AutoTips, {
264
- children: mainTitle
265
- })
266
- })), tag && jsx("span", Object.assign({
267
- className: "tag",
268
- style: tagStyle
269
- }, {
270
- children: tag
271
- }))]
272
- })), subTitle && jsx("div", Object.assign({
273
- className: "sub-title"
274
- }, {
275
- children: jsx(AutoTips, {
276
- children: subTitle
277
- })
278
- }))]
279
- }));
280
- }
281
- };
282
- /** 处理左侧内容 */
283
- var handLeftContent = function handLeftContent() {
284
- if (leftRender) return leftRender();
285
- return jsxs(Fragment, {
286
- children: [handSelectDom(), handImg(), handNodeLeft()]
287
- });
288
- };
289
- /** 处理className */
290
- var handClass = function handClass() {
291
- var str = $prefixCls + '-selector-node';
292
- str += " ".concat($prefixCls, "-selector-node-").concat(useCase);
293
- str += " ".concat($prefixCls, "-selector-node-").concat(nodeMode);
294
- if (disabled) str += " ".concat($prefixCls, "-selector-node-disabled");
295
- if (disabledChild) str += " ".concat($prefixCls, "-selector-node-disabled-child");
296
- if (className) str += ' ' + className;
297
- return str;
298
- };
299
- return jsxs("div", Object.assign({
300
- className: handClass(),
301
- style: style,
302
- onClick: onClickNode
303
- }, {
304
- children: [jsx("div", Object.assign({
305
- className: "selector-node-left"
306
- }, {
307
- children: handLeftContent()
308
- })), jsxs("div", Object.assign({
309
- className: "selector-node-right"
310
- }, {
311
- children: [handDetail(), detail && child && jsx("span", {
312
- className: "line"
313
- }), child && jsx("span", Object.assign({
314
- className: "lower-child",
315
- onClick: onLevelBtn
316
- }, {
317
- children: intl({
318
- id: 'child'
319
- })
320
- })), detail && close && jsx("span", {
321
- className: "line"
322
- }), close && jsx("span", Object.assign({
323
- className: "close",
324
- onClick: onCloseCom
325
- }, {
326
- children: jsx(CloseIcon, {})
327
- }))]
328
- }))]
329
- }));
330
- };
331
-
332
- var css_248z$2 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-selector-main {\n padding: 16px 0 0 0;\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n}\n.paraui-v3-selector-main > .selectot-main-search {\n padding: 0 16px;\n margin-bottom: 16px;\n}\n.paraui-v3-selector-main > .selector-main-box {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content > .nav-box {\n padding: 0 16px;\n margin-bottom: 12px;\n line-height: 0;\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content > .selector-main-list-no-data {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-bottom: 16px;\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content > .selector-main-list {\n overflow-y: hidden;\n padding-bottom: 16px;\n display: flex;\n flex-direction: column;\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-all-check {\n position: relative;\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-all-check + .selector-group-title.selector-group-title-first {\n margin-top: 4px;\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content {\n overflow-y: hidden;\n position: relative;\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content:before {\n content: \"\";\n position: absolute;\n height: 36px;\n width: 100%;\n pointer-events: none;\n top: 0;\n left: 0;\n z-index: 1;\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content:after {\n content: \"\";\n position: absolute;\n height: 36px;\n width: 100%;\n pointer-events: none;\n bottom: 0;\n left: 0;\n z-index: 1;\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content.selector-main-list-scroll-top:after {\n box-shadow: inset 0px -10px 10px -8px rgba(0, 0, 0, 0.05);\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content.selector-main-list-scroll-middle:before {\n box-shadow: inset 0px 10px 10px -8px rgba(0, 0, 0, 0.05);\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content.selector-main-list-scroll-middle:after {\n box-shadow: inset 0px -10px 10px -8px rgba(0, 0, 0, 0.05);\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content.selector-main-list-scroll-bottom:before {\n box-shadow: inset 0px 10px 10px -8px rgba(0, 0, 0, 0.05);\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content > .selector-main-list-content-box {\n height: 100%;\n overflow-y: auto;\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content > .selector-main-list-content-box > .selector-group-title {\n padding: 0 12px;\n margin-top: 24px;\n margin-bottom: 12px;\n font-size: 14px;\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content > .selector-main-list-content-box > .selector-group-title.selector-group-title-first {\n margin-top: 0;\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-more {\n padding: 0 16px;\n cursor: pointer;\n font-size: 14px;\n color: rgb(54, 102, 214);\n line-height: 36px;\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-more:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content.selector-main-search-content {\n /*position: absolute;\n left: 0;\n top: 0;*/\n width: 100%;\n height: 100%;\n background-color: white;\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content.selector-main-search-content > .selector-main-list {\n padding-bottom: 16px;\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content.selector-main-content-all-check > .selector-main-list > .selector-main-list-content {\n max-height: calc(100% - 36px);\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content.selector-main-content-load-more > .selector-main-list > .selector-main-list-content {\n max-height: calc(100% - 36px);\n}\n.paraui-v3-selector-main > .selector-main-box > .selector-main-content.selector-main-content-all-check.selector-main-content-load-more > .selector-main-list > .selector-main-list-content {\n max-height: calc(100% - 36px - 36px);\n}\n.paraui-v3-selector-main.paraui-v3-selector-main-select > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-more {\n padding-left: 38px;\n}\n.paraui-v3-selector-main.paraui-v3-selector-main-show-search > .selector-main-box {\n height: calc(100% - 52px);\n}\n.paraui-v3-selector-main.paraui-v3-selector-main-show-search > .selector-main-box > .selector-main-content.selector-main-list-box {\n display: none;\n}\n.paraui-v3-selector-main.paraui-v3-selector-main-search > .selector-main-box {\n height: calc(100% - 52px);\n}";
333
- styleInject(css_248z$2);
334
-
335
- var SelectorMainContent = function SelectorMainContent(props) {
336
- var className = props.className,
337
- value = props.value;
338
- props.rowKey;
339
- var _props$nodeMode = props.nodeMode,
340
- nodeMode = _props$nodeMode === void 0 ? 'branch' : _props$nodeMode,
341
- selectMode = props.selectMode,
342
- _props$loadMore = props.loadMore,
343
- loadMore = _props$loadMore === void 0 ? false : _props$loadMore,
344
- _props$isAllCheck = props.isAllCheck,
345
- isAllCheck = _props$isAllCheck === void 0 ? false : _props$isAllCheck,
346
- detail = props.detail,
347
- detailRender = props.detailRender,
348
- isLazy = props.isLazy,
349
- list = props.list,
350
- groupType = props.groupType,
351
- breadcrumbs = props.breadcrumbs,
352
- _props$breadcrumbsSep = props.breadcrumbsSeparator,
353
- breadcrumbsSeparator = _props$breadcrumbsSep === void 0 ? '-' : _props$breadcrumbsSep,
354
- _props$breadcrumbsLis = props.breadcrumbsList,
355
- breadcrumbsList = _props$breadcrumbsLis === void 0 ? [] : _props$breadcrumbsLis,
356
- fieldConfig = props.fieldConfig,
357
- disabled = props.disabled,
358
- disabledChild = props.disabledChild,
359
- emptyProps = props.emptyProps,
360
- loading = props.loading,
361
- onClickBreadcrumbs = props.onClickBreadcrumbs,
362
- _onLevel = props.onLevel,
363
- _onSelect = props.onSelect,
364
- onLoad = props.onLoad,
365
- onAllCheck = props.onAllCheck;
366
- var intl = useFormatMessage('Selector', localeJson);
367
- var _useState = useState({}),
368
- _useState2 = _slicedToArray(_useState, 2),
369
- listCom = _useState2[0],
370
- setListCom = _useState2[1];
371
- var constData = useRef({
372
- listTypeJson: {},
373
- fieldConfig: {},
374
- resizeTimer: null
375
- });
376
- var scrolltRef = useRef(null);
377
- var contentRef = useRef(null);
378
- constData.current.listTypeJson = ArrayToObject('value', groupType);
379
- constData.current.fieldConfig = fieldConfig || {};
380
- useEffect(function () {
381
- changeResize();
382
- return function () {
383
- clearTimeout(constData.current.resizeTimer);
384
- };
385
- }, []);
386
- useEffect(function () {
387
- if (list && groupType && groupType.length > 0) {
388
- var json = {};
389
- for (var i = 0, l = list.length; i < l; i++) {
390
- var item = list[i];
391
- var type = item.type;
392
- if (!json[type]) json[type] = [];
393
- json[type].push(item);
394
- }
395
- setListCom(json);
396
- }
397
- }, [list]);
398
- /** 屏幕发生改变 */
399
- var changeResize = function changeResize() {
400
- clearTimeout(constData.current.resizeTimer);
401
- constData.current.resizeTimer = setTimeout(function () {
402
- onScroll();
403
- }, 100);
404
- };
405
- /** 滚动 */
406
- var onScroll = function onScroll() {
407
- if (!contentRef.current || !scrolltRef.current) return;
408
- var scrollBox = scrolltRef.current;
409
- var contentBox = contentRef.current;
410
- contentBox.classList.remove('selector-main-list-scroll-top', 'selector-main-list-scroll-bottom', 'selector-main-list-scroll-middle');
411
- if (scrollBox.scrollHeight <= scrollBox.clientHeight) return;
412
- // 滚动条初始化
413
- if (scrollBox.scrollTop === 0) {
414
- contentBox.classList.add('selector-main-list-scroll-top');
415
- return;
416
- }
417
- // 滚动到底部
418
- if (scrollBox.clientHeight + scrollBox.scrollTop === scrollBox.scrollHeight) {
419
- contentBox.classList.add('selector-main-list-scroll-bottom');
420
- return;
421
- }
422
- // 滚动条在中间
423
- contentBox.classList.add('selector-main-list-scroll-middle');
424
- };
425
- /** 判断是否全选,半选 */
426
- var handAllCheckFunc = function handAllCheckFunc() {
427
- var json = {
428
- checked: false,
429
- indeterminate: false
430
- };
431
- // 不存在value, 没有数据, 全选没转态
432
- if (!value || !list || list.length === 0) return json;
433
- for (var i = 0, l = list.length; i < l; i++) {
434
- var item = list[i];
435
- var key = item.key;
436
- var disabledItem = handDisabled(item);
437
- if (disabledItem) {
438
- if (value[key]) json.checked = true;
439
- continue;
440
- }
441
- if (value[key]) {
442
- json.checked = true;
443
- } else {
444
- json.indeterminate = true;
445
- }
446
- }
447
- // 半选
448
- if (json.checked && json.indeterminate) {
449
- json.checked = false;
450
- return json;
451
- }
452
- // 全不选
453
- if (!json.checked && json.indeterminate) {
454
- json.indeterminate = false;
455
- return json;
456
- }
457
- return json;
458
- };
459
- /** 处理禁用状态 */
460
- var handDisabled = function handDisabled(item) {
461
- if (disabled) {
462
- if (disabled === true) return true;
463
- if (disabled instanceof Array) {
464
- if (item.key && disabled.indexOf(item.key) !== -1) {
465
- return true;
466
- }
467
- }
468
- }
469
- if (item.disabled) return true;
470
- return false;
471
- };
472
- /** 处理禁用下级状态 */
473
- var handDisabledChild = function handDisabledChild(item) {
474
- if (disabledChild) {
475
- if (disabledChild === true) return true;
476
- if (disabledChild instanceof Array) {
477
- if (item.key && disabledChild.indexOf(item.key) !== -1) {
478
- return true;
479
- }
480
- }
481
- }
482
- if (item.disabledChild) return true;
483
- return false;
484
- };
485
- /** 全选 */
486
- var handAllCheck = function handAllCheck() {
487
- // 只存在复选框模式
488
- if (!isAllCheck || selectMode !== "check") return null;
489
- var checkJson = handAllCheckFunc();
490
- var onAllCheckCom = function onAllCheckCom() {
491
- var bol = true;
492
- if (checkJson.checked) bol = false;
493
- onAllCheck && onAllCheck(bol);
494
- };
495
- return jsx(SelectorNode, Object.assign({
496
- disabled: disabled === true,
497
- nodeMode: 'branch',
498
- mainTitle: intl({
499
- id: 'selectAll'
500
- }),
501
- selectMode: 'check'
502
- }, checkJson, {
503
- onSelect: onAllCheckCom,
504
- className: 'selector-all-check'
505
- }));
506
- };
507
- /** 点击查看更多 */
508
- var clickLoad = function clickLoad() {
509
- onLoad && onLoad();
510
- };
511
- /** 查看更多 */
512
- var handLoadMore = function handLoadMore() {
513
- if (!loadMore) return null;
514
- return jsx("div", Object.assign({
515
- className: "selector-main-list-more",
516
- onClick: clickLoad
517
- }, {
518
- children: jsx("span", Object.assign({
519
- className: "more-btn"
520
- }, {
521
- children: intl({
522
- id: 'seeMore'
523
- })
524
- }))
525
- }));
526
- };
527
- /** 判断是否选中 */
528
- var handCheck = function handCheck(item) {
529
- var bol = false;
530
- if (value && value[item.key]) bol = true;
531
- return bol;
532
- };
533
- /** 处理每个节点的配置 */
534
- var handNodeConfig = function handNodeConfig(item) {
535
- var json = {
536
- useCase: 'view',
537
- detail: detail,
538
- nodeMode: nodeMode,
539
- disabled: handDisabled(item),
540
- disabledChild: handDisabledChild(item),
541
- onLevel: function onLevel() {
542
- return _onLevel && _onLevel(item);
543
- },
544
- onSelect: function onSelect() {
545
- return _onSelect && _onSelect(item);
546
- },
547
- checked: handCheck(item)
548
- };
549
- /** 节点类型 */
550
- if (item.leaf !== undefined) json.nodeMode = item.leaf ? 'leaf' : 'branch';
551
- /** 渲染字段 */
552
- var arr = ['img', 'mainTitle', 'subTitle', 'tag', 'tagStyle'];
553
- for (var i = 0, l = arr.length; i < l; i++) {
554
- var key = arr[i];
555
- json[key] = item[key];
556
- }
557
- /** 判断是否具有选择 */
558
- if (item.choice !== false) {
559
- // 当前节点可选择
560
- if (selectMode) json.selectMode = selectMode;
561
- }
562
- /** 判断是否具有下级 */
563
- if (isLazy) {
564
- // 懒加载
565
- json.child = item.child;
566
- } else {
567
- // 全量数据
568
- var children = item.children || [];
569
- if (children && children.length > 0) {
570
- json.child = true;
571
- }
572
- // 强制设置下级
573
- if (item.child !== undefined) json.child = item.child;
574
- }
575
- /** 详情render */
576
- if (detailRender) {
577
- json.detailRender = function () {
578
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
579
- var Dom;
580
- return regenerator.wrap(function _callee$(_context) {
581
- while (1) switch (_context.prev = _context.next) {
582
- case 0:
583
- _context.next = 2;
584
- return detailRender(item, true);
585
- case 2:
586
- Dom = _context.sent;
587
- return _context.abrupt("return", Dom);
588
- case 4:
589
- case "end":
590
- return _context.stop();
591
- }
592
- }, _callee);
593
- }));
594
- };
595
- }
596
- if (item.detail !== undefined) json.detail = item.detail;
597
- return json;
598
- };
599
- /** 渲染list节点 */
600
- var handListNode = function handListNode(arr) {
601
- return arr === null || arr === void 0 ? void 0 : arr.map(function (item, index) {
602
- return jsx(SelectorNode, Object.assign({}, handNodeConfig(item)), index);
603
- });
604
- };
605
- /** 处理节点dom */
606
- var handNode = function handNode() {
607
- // 分组渲染
608
- if (groupType && groupType.length > 0) {
609
- return jsx(Fragment, {
610
- children: groupType.map(function (item, index) {
611
- var type = item.value;
612
- var listData = listCom[type] || [];
613
- var str = 'selector-group-title';
614
- if (index === 0) str += ' selector-group-title-first';
615
- return jsxs(Fragment$1, {
616
- children: [listData.length > 0 && jsx("div", Object.assign({
617
- className: str
618
- }, {
619
- children: item.label || type
620
- })), handListNode(listData)]
621
- }, index);
622
- })
623
- });
624
- }
625
- return handListNode(list || []);
626
- };
627
- /** 点击面包屑 */
628
- var onClickBreadcrums = function onClickBreadcrums(item) {
629
- onClickBreadcrumbs && onClickBreadcrumbs(item);
630
- };
631
- /** 面包屑dom */
632
- var handBreadcrumbs = function handBreadcrumbs() {
633
- if (!breadcrumbs || breadcrumbsList.length === 0) return null;
634
- return jsx("div", Object.assign({
635
- className: "nav-box"
636
- }, {
637
- children: jsx(Breadcrumbs, {
638
- list: breadcrumbsList,
639
- separator: breadcrumbsSeparator,
640
- onClickItem: onClickBreadcrums
641
- })
642
- }));
643
- };
644
- /** 处理内容 */
645
- var handContent = function handContent() {
646
- if ((list === null || list === void 0 ? void 0 : list.length) === 0 && !loading) {
647
- // 空状态
648
- return jsx("div", Object.assign({
649
- className: "selector-main-list-no-data"
650
- }, {
651
- children: jsx(Empty, Object.assign({}, emptyProps, {
652
- size: (emptyProps === null || emptyProps === void 0 ? void 0 : emptyProps.size) || "small"
653
- }))
654
- }));
655
- }
656
- return jsxs("div", Object.assign({
657
- className: "selector-main-list"
658
- }, {
659
- children: [handAllCheck(), jsx("div", Object.assign({
660
- className: "selector-main-list-content",
661
- ref: contentRef
662
- }, {
663
- children: jsx("div", Object.assign({
664
- className: "selector-main-list-content-box",
665
- ref: scrolltRef,
666
- onScroll: onScroll
667
- }, {
668
- children: handNode()
669
- }))
670
- })), handLoadMore()]
671
- }));
672
- };
673
- var handClass = function handClass() {
674
- var str = 'selector-main-content';
675
- if (className) str += ' ' + className;
676
- if (disabled) str += ' selector-main-content-disabled';
677
- if (isAllCheck && selectMode === "check") str += ' selector-main-content-all-check';
678
- if (loadMore) str += ' selector-main-content-load-more';
679
- return str;
680
- };
681
- changeResize();
682
- return jsxs("div", Object.assign({
683
- className: handClass()
684
- }, {
685
- children: [handBreadcrumbs(), handContent()]
686
- }));
687
- };
688
- var SelectorMain = function SelectorMain(props) {
689
- var className = props.className,
690
- style = props.style,
691
- url = props.url,
692
- value = props.value,
693
- _props$rowKey2 = props.rowKey,
694
- rowKey = _props$rowKey2 === void 0 ? 'key' : _props$rowKey2,
695
- _props$nodeMode2 = props.nodeMode,
696
- nodeMode = _props$nodeMode2 === void 0 ? 'branch' : _props$nodeMode2,
697
- selectMode = props.selectMode,
698
- _props$loadMore2 = props.loadMore,
699
- loadMore = _props$loadMore2 === void 0 ? false : _props$loadMore2,
700
- _props$searchLoadMore = props.searchLoadMore,
701
- searchLoadMore = _props$searchLoadMore === void 0 ? false : _props$searchLoadMore,
702
- _props$isAllCheck2 = props.isAllCheck,
703
- isAllCheck = _props$isAllCheck2 === void 0 ? false : _props$isAllCheck2,
704
- disabled = props.disabled,
705
- disabledChild = props.disabledChild,
706
- detail = props.detail,
707
- detailRender = props.detailRender,
708
- isLazy = props.isLazy,
709
- list = props.list,
710
- groupType = props.groupType,
711
- groupRange = props.groupRange,
712
- search = props.search,
713
- _props$searchVal = props.searchVal,
714
- searchVal = _props$searchVal === void 0 ? '' : _props$searchVal,
715
- searchPlaceholder = props.searchPlaceholder,
716
- searchTrigger = props.searchTrigger,
717
- searchLoading = props.searchLoading,
718
- searchList = props.searchList,
719
- loading = props.loading,
720
- breadcrumbs = props.breadcrumbs,
721
- _props$breadcrumbsSep2 = props.breadcrumbsSeparator,
722
- breadcrumbsSeparator = _props$breadcrumbsSep2 === void 0 ? '-' : _props$breadcrumbsSep2,
723
- _props$breadcrumbsLis2 = props.breadcrumbsList,
724
- breadcrumbsList = _props$breadcrumbsLis2 === void 0 ? [] : _props$breadcrumbsLis2,
725
- fieldConfig = props.fieldConfig,
726
- onClickBreadcrumbs = props.onClickBreadcrumbs,
727
- onLevel = props.onLevel,
728
- onSelect = props.onSelect,
729
- onLoad = props.onLoad,
730
- onAllCheck = props.onAllCheck,
731
- onSearch = props.onSearch,
732
- onRefresh = props.onRefresh;
733
- var intl = useFormatMessage('Selector', localeJson);
734
- var _useState3 = useState(false),
735
- _useState4 = _slicedToArray(_useState3, 2),
736
- showSearch = _useState4[0],
737
- setShowSearch = _useState4[1]; // 显示搜索/
738
- var _useState5 = useState(''),
739
- _useState6 = _slicedToArray(_useState5, 2),
740
- searchStr = _useState6[0],
741
- setSearchStr = _useState6[1];
742
- var constData = useRef({
743
- searchTimer: null,
744
- searchStr: ''
745
- });
746
- useEffect(function () {
747
- if (!searchVal) return;
748
- constData.current.searchStr = searchVal.val;
749
- setSearchStr(searchVal.val);
750
- if (searchVal.val !== '') setShowSearch(true);
751
- }, [searchVal]);
752
- /** 改变搜索框 */
753
- var changeSearch = function changeSearch(val) {
754
- setSearchStr(val);
755
- constData.current.searchStr = val;
756
- if (searchTrigger !== 'onEnter') onSearchCom();
757
- };
758
- /** 搜索框回车事件 */
759
- var onEnterSearch = function onEnterSearch() {
760
- onSearchCom(true);
761
- };
762
- /** 点击搜索按钮 */
763
- var onClickRightIcon = function onClickRightIcon() {
764
- onSearchCom(true);
765
- };
766
- /** 点击清除按钮 */
767
- var onClear = function onClear() {
768
- onSearchCom();
769
- };
770
- /** 向外抛出搜索事件 */
771
- var onSearchCom = function onSearchCom(bol) {
772
- clearTimeout(constData.current.searchTimer);
773
- constData.current.searchTimer = setTimeout(function () {
774
- setShowSearch(!!constData.current.searchStr);
775
- onSearch && onSearch(constData.current.searchStr, !!bol);
776
- }, 300);
777
- };
778
- /** 搜索dom */
779
- var handSearchDom = function handSearchDom() {
780
- var handSearchIcon = function handSearchIcon() {
781
- if (!searchStr) {
782
- // 本地数据且没有自定义刷新事件
783
- if (!url && !onRefresh) {
784
- return null;
785
- }
786
- return jsx(Refresh, {});
787
- }
788
- return jsx(SearchIcon, {});
789
- };
790
- return jsx(Fragment, {
791
- children: search && jsx(Search, {
792
- className: 'selectot-main-search',
793
- value: searchStr,
794
- rightIconExist: true,
795
- showBtn: false,
796
- rightIcon: handSearchIcon(),
797
- btnType: "inside",
798
- onChange: changeSearch,
799
- onEnter: onEnterSearch,
800
- onClear: onClear,
801
- placeholder: searchPlaceholder || intl({
802
- id: 'pleaseEnter'
803
- }),
804
- onClickRightIcon: onClickRightIcon
805
- })
806
- });
807
- };
808
- /** 点击下级
809
- * @param isSearch {boolean}
810
- * */
811
- var onLevelCom = function onLevelCom(isSearch) {
812
- return function (item) {
813
- if (isSearch) {
814
- constData.current.searchStr = '';
815
- setSearchStr('');
816
- setShowSearch(false);
817
- }
818
- onLevel && onLevel(item, isSearch);
819
- };
820
- };
821
- /**
822
- * 加载更多
823
- * @param isSearch {boolean} 是否搜索
824
- * */
825
- var onLoadCom = function onLoadCom(isSearch) {
826
- return function () {
827
- onLoad && onLoad(isSearch);
828
- };
829
- };
830
- /** 渲染列表 */
831
- var handListDom = function handListDom() {
832
- return jsx(SelectorMainContent, {
833
- className: "selector-main-list-box",
834
- value: value,
835
- rowKey: rowKey,
836
- nodeMode: nodeMode,
837
- selectMode: selectMode,
838
- loadMore: loadMore,
839
- isAllCheck: isAllCheck,
840
- disabled: disabled,
841
- disabledChild: disabledChild,
842
- detail: detail,
843
- detailRender: detailRender,
844
- isLazy: isLazy,
845
- list: list,
846
- loading: loading,
847
- groupType: groupRange === 'list' || groupRange === 'searchList' ? groupType : undefined,
848
- breadcrumbs: breadcrumbs,
849
- breadcrumbsSeparator: breadcrumbsSeparator,
850
- breadcrumbsList: breadcrumbsList,
851
- fieldConfig: fieldConfig,
852
- onClickBreadcrumbs: onClickBreadcrumbs,
853
- onLevel: onLevelCom(false),
854
- onSelect: onSelect,
855
- onLoad: onLoadCom(false),
856
- onAllCheck: onAllCheck
857
- }, "list");
858
- };
859
- /** 渲染搜索列表 */
860
- var handSearchList = function handSearchList() {
861
- if (!showSearch) return;
862
- return jsx(SelectorMainContent, {
863
- className: 'selector-main-search-content',
864
- value: value,
865
- rowKey: rowKey,
866
- nodeMode: nodeMode,
867
- selectMode: selectMode,
868
- loadMore: searchLoadMore,
869
- isAllCheck: false,
870
- disabled: disabled,
871
- disabledChild: disabledChild,
872
- detail: detail,
873
- detailRender: detailRender,
874
- isLazy: isLazy,
875
- list: searchList,
876
- groupType: groupRange === 'search' || groupRange === 'searchList' ? groupType : undefined,
877
- fieldConfig: fieldConfig,
878
- loading: searchLoading,
879
- onSelect: onSelect,
880
- onLevel: onLevelCom(true),
881
- onLoad: onLoadCom(true)
882
- }, "search");
883
- };
884
- /** 处理loading */
885
- var handLoading = function handLoading() {
886
- if (searchLoading || loading) {
887
- return jsx(Loading, {});
888
- }
889
- };
890
- // 处理class
891
- var handClass = function handClass() {
892
- var str = $prefixCls + '-selector-main';
893
- if (className) str += ' ' + className;
894
- if (selectMode === 'check') str += " ".concat($prefixCls, "-selector-main-select");
895
- if (showSearch) str += " ".concat($prefixCls, "-selector-main-show-search");
896
- if (search) str += " ".concat($prefixCls, "-selector-main-search");
897
- if (disabled === true) str += " ".concat($prefixCls, "-selector-main-disabled");
898
- return str;
899
- };
900
- return jsxs("div", Object.assign({
901
- className: handClass(),
902
- style: style
903
- }, {
904
- children: [handSearchDom(), jsxs("div", Object.assign({
905
- className: "selector-main-box"
906
- }, {
907
- children: [handListDom(), handSearchList(), handLoading()]
908
- }))]
909
- }));
910
- };
911
-
912
- var css_248z$1 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-selector-data.paraui-v3-selector-data-node > .selector-data-node-box {\n padding: 24px 0 16px 0;\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n.paraui-v3-selector-data.paraui-v3-selector-data-node > .selector-data-node-box > .title {\n font-size: 14px;\n color: rgb(46, 55, 67);\n padding: 0 16px;\n margin-bottom: 16px;\n}\n.paraui-v3-selector-data.paraui-v3-selector-data-node > .selector-data-node-box > .title > .title-content {\n margin-left: 8px;\n}\n.paraui-v3-selector-data.paraui-v3-selector-data-node > .selector-data-node-box > .content {\n overflow-y: auto;\n}\n.paraui-v3-selector-data.paraui-v3-selector-data-tag > .selector-data-tag-box {\n padding-top: 12px;\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n.paraui-v3-selector-data.paraui-v3-selector-data-tag > .selector-data-tag-box > .title {\n font-size: 14px;\n color: rgb(46, 55, 67);\n padding: 0 16px;\n}\n.paraui-v3-selector-data.paraui-v3-selector-data-tag > .selector-data-tag-box > .content {\n padding: 0 16px 12px 16px;\n overflow: auto;\n}\n.paraui-v3-selector-data.paraui-v3-selector-data-tag > .selector-data-tag-box > .content > .content-tag {\n display: inline-flex;\n height: 24px;\n align-items: center;\n padding: 0 8px;\n border-radius: 2px;\n background-color: rgba(171, 176, 185, 0.2);\n margin-right: 8px;\n margin-top: 6px;\n max-width: calc(100% - 8px);\n}\n.paraui-v3-selector-data.paraui-v3-selector-data-tag > .selector-data-tag-box > .content > .content-tag > span {\n font-size: 12px;\n color: rgb(46, 55, 67);\n overflow: hidden;\n}\n.paraui-v3-selector-data.paraui-v3-selector-data-tag > .selector-data-tag-box > .content > .content-tag > svg {\n font-size: 16px;\n margin-left: 4px;\n color: rgba(46, 55, 67, 0.7);\n cursor: pointer;\n}";
913
- styleInject(css_248z$1);
914
-
915
- var SelectorData = function SelectorData(props) {
916
- var className = props.className,
917
- _props$layout = props.layout,
918
- layout = _props$layout === void 0 ? 'node' : _props$layout,
919
- style = props.style,
920
- list = props.list,
921
- groupType = props.groupType,
922
- nodeMode = props.nodeMode,
923
- backDataFieldConfig = props.backDataFieldConfig,
924
- detail = props.detail,
925
- detailRender = props.detailRender,
926
- disabled = props.disabled,
927
- handSelectorNodeInfo = props.handSelectorNodeInfo,
928
- selectDataTitleRender = props.selectDataTitleRender,
929
- selectRenderItem = props.selectRenderItem,
930
- selectRender = props.selectRender,
931
- _onClose = props.onClose;
932
- var intl = useFormatMessage('Selector', localeJson);
933
- var _useState = useState({}),
934
- _useState2 = _slicedToArray(_useState, 2),
935
- listCom = _useState2[0],
936
- setListCom = _useState2[1];
937
- var constData = useRef({
938
- listTypeJson: {},
939
- backDataFieldConfig: {}
940
- });
941
- constData.current.listTypeJson = ArrayToObject('value', groupType);
942
- constData.current.backDataFieldConfig = backDataFieldConfig || {};
943
- useEffect(function () {
944
- if (list && groupType && groupType.length > 0) {
945
- var json = {};
946
- for (var i = 0, l = list.length; i < l; i++) {
947
- var item = list[i];
948
- var type = item[constData.current.backDataFieldConfig.type || ''];
949
- if (!json[type]) json[type] = [];
950
- json[type].push(item);
951
- }
952
- setListCom(json);
953
- }
954
- }, [list]);
955
- /** 处理禁用 */
956
- var handDisabled = function handDisabled(itemConfig) {
957
- if (disabled) {
958
- if (disabled === true) return true;
959
- if (disabled instanceof Array) {
960
- var keyStr = (backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.key) || '';
961
- var val = itemConfig[keyStr];
962
- if (disabled.indexOf(val) !== -1) {
963
- return true;
964
- }
965
- }
966
- }
967
- return false;
968
- };
969
- /** 处理每个节点的配置 */
970
- var handNodeConfig = function handNodeConfig(itemConfig, index) {
971
- var item = itemConfig;
972
- if (handSelectorNodeInfo) item = handSelectorNodeInfo(itemConfig);
973
- var disabledItem = handDisabled(itemConfig);
974
- var json = {
975
- useCase: 'edit',
976
- close: !disabledItem,
977
- detail: detail,
978
- data: item,
979
- nodeMode: nodeMode,
980
- onClose: function onClose() {
981
- return _onClose && _onClose(item, index);
982
- },
983
- disabled: handDisabled(itemConfig),
984
- tagStyle: item.tagStyle
985
- };
986
- if (selectRenderItem) {
987
- json.leftRender = function () {
988
- return selectRenderItem(itemConfig);
989
- };
990
- }
991
- /** 节点类型 */
992
- if (item.leaf !== undefined) json.nodeMode = item.leaf ? 'leaf' : 'branch';
993
- /** 渲染字段 */
994
- var arr = ['img', 'mainTitle', 'subTitle', 'tag'];
995
- for (var i = 0, l = arr.length; i < l; i++) {
996
- var key = arr[i] || '';
997
- var backName = backDataFieldConfig && backDataFieldConfig[key] || '';
998
- json[key] = item[backName];
999
- }
1000
- /** 详情render */
1001
- if (detailRender) {
1002
- json.detailRender = function () {
1003
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
1004
- var Dom;
1005
- return regenerator.wrap(function _callee$(_context) {
1006
- while (1) switch (_context.prev = _context.next) {
1007
- case 0:
1008
- _context.next = 2;
1009
- return detailRender(item, false);
1010
- case 2:
1011
- Dom = _context.sent;
1012
- return _context.abrupt("return", Dom);
1013
- case 4:
1014
- case "end":
1015
- return _context.stop();
1016
- }
1017
- }, _callee);
1018
- }));
1019
- };
1020
- }
1021
- if (item.detail !== undefined) json.detail = item.detail;
1022
- /** 是否具有删除 */
1023
- if (item.close !== undefined) json.close = item.close;
1024
- return json;
1025
- };
1026
- /** 处理节点 */
1027
- var handNode = function handNode() {
1028
- if (selectRender) {
1029
- return selectRender(list || []);
1030
- }
1031
- return list === null || list === void 0 ? void 0 : list.map(function (item, index) {
1032
- return jsx(SelectorNode, Object.assign({}, handNodeConfig(item, index)), index);
1033
- });
1034
- };
1035
- /** 处理标题 */
1036
- var handTitle = function handTitle() {
1037
- var handTitleTag = function handTitleTag() {
1038
- if (selectDataTitleRender) return selectDataTitleRender(list);
1039
- if (groupType) {
1040
- return jsx(Fragment, {
1041
- children: groupType.map(function (item, index) {
1042
- var num = 0;
1043
- var val = item.value;
1044
- if (listCom[val]) num = listCom[val].length;
1045
- if (num === 0) return;
1046
- return jsxs("span", Object.assign({
1047
- className: "title-content"
1048
- }, {
1049
- children: [num, "\u4E2A", item.label || item.value]
1050
- }), index);
1051
- })
1052
- });
1053
- }
1054
- };
1055
- return jsxs("div", Object.assign({
1056
- className: "title"
1057
- }, {
1058
- children: [jsxs("span", Object.assign({
1059
- className: "title-tip"
1060
- }, {
1061
- children: [intl({
1062
- id: 'selected'
1063
- }), ":"]
1064
- })), handTitleTag()]
1065
- }));
1066
- };
1067
- // 处理节点内容
1068
- var handContentNode = function handContentNode() {
1069
- return jsxs("div", Object.assign({
1070
- className: "selector-data-node-box"
1071
- }, {
1072
- children: [handTitle(), jsx("div", Object.assign({
1073
- className: "content"
1074
- }, {
1075
- children: handNode()
1076
- }))]
1077
- }));
1078
- };
1079
- // 处理内容
1080
- var handDetailTagContent = function handDetailTagContent() {
1081
- if (selectRender) {
1082
- return selectRender(list || []);
1083
- }
1084
- return jsx(Fragment, {
1085
- children: list === null || list === void 0 ? void 0 : list.map(function (item, index) {
1086
- var disabledItem = handDisabled(item);
1087
- return jsxs("span", Object.assign({
1088
- className: "content-tag"
1089
- }, {
1090
- children: [jsx("span", {
1091
- children: selectRenderItem ? selectRenderItem(item) : jsx(AutoTips, {
1092
- children: item[(backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.mainTitle) || ''] || item[(backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.key) || '']
1093
- })
1094
- }), !disabledItem && jsx(CloseIcon, {
1095
- onClick: function onClick() {
1096
- return _onClose && _onClose(item, index);
1097
- }
1098
- })]
1099
- }), index);
1100
- })
1101
- });
1102
- };
1103
- // 处理tag内容
1104
- var handContentTag = function handContentTag() {
1105
- return jsxs("div", Object.assign({
1106
- className: "selector-data-tag-box"
1107
- }, {
1108
- children: [handTitle(), jsx("div", Object.assign({
1109
- className: "content"
1110
- }, {
1111
- children: handDetailTagContent()
1112
- }))]
1113
- }));
1114
- };
1115
- var handClass = function handClass() {
1116
- var str = $prefixCls + '-selector-data';
1117
- if (layout) str += " ".concat($prefixCls, "-selector-data-").concat(layout);
1118
- if (disabled === true) str += " ".concat($prefixCls, "-selector-data-disabled");
1119
- if (className) str += ' ' + className;
1120
- return str;
1121
- };
1122
- return jsx("div", Object.assign({
1123
- className: handClass(),
1124
- style: style
1125
- }, {
1126
- children: layout === 'node' ? handContentNode() : handContentTag()
1127
- }));
1128
- };
1129
-
1130
- /**
1131
- * 发送请求
1132
- * @param obj {ReqFuncProps} 请求信息
1133
- */
1134
- var reqFunc = function reqFunc(obj) {
1135
- var method = obj.method,
1136
- data = obj.data,
1137
- otherProps = __rest(obj, ["method", "data"]);
1138
- if (method === 'Get') {
1139
- return Get(Object.assign({
1140
- params: data
1141
- }, otherProps));
1142
- }
1143
- if (method === 'Post') {
1144
- return Post(Object.assign({
1145
- data: data
1146
- }, otherProps));
1147
- }
1148
- };
1149
-
1150
- var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-selector {\n border: 1px solid rgba(171, 176, 185, 0.4);\n border-radius: 4px;\n display: flex;\n height: 100%;\n width: 100%;\n}\n.paraui-v3-selector.paraui-v3-selector-lr > .paraui-v3-selector-main {\n width: 50%;\n}\n.paraui-v3-selector.paraui-v3-selector-lr > .paraui-v3-selector-data {\n width: 50%;\n border-left: 1px solid rgba(171, 176, 185, 0.4);\n}\n.paraui-v3-selector.paraui-v3-selector-tb {\n flex-direction: column;\n}\n.paraui-v3-selector.paraui-v3-selector-tb > .paraui-v3-selector-data {\n border-bottom: 1px solid rgba(171, 176, 185, 0.4);\n max-height: 106px;\n}\n.paraui-v3-selector.paraui-v3-selector-tb > .paraui-v3-selector-main {\n overflow-y: auto;\n height: auto;\n flex: 1;\n}";
1151
- styleInject(css_248z);
1152
-
1153
- var handFieldConfig = function handFieldConfig(fieldConfig, rowKey) {
1154
- var json = Object.assign({
1155
- mainTitle: 'label',
1156
- children: 'children',
1157
- parentId: 'parentId',
1158
- key: rowKey,
1159
- type: 'type'
1160
- }, fieldConfig);
1161
- return json;
1162
- };
1163
- var Selector = function Selector(props) {
1164
- var _useGlobalProps = useGlobalProps(props, 'Selector'),
1165
- className = _useGlobalProps.className,
1166
- style = _useGlobalProps.style,
1167
- _useGlobalProps$rowKe = _useGlobalProps.rowKey,
1168
- rowKey = _useGlobalProps$rowKe === void 0 ? 'key' : _useGlobalProps$rowKe,
1169
- _useGlobalProps$layou = _useGlobalProps.layout,
1170
- layout = _useGlobalProps$layou === void 0 ? 'lr' : _useGlobalProps$layou,
1171
- _useGlobalProps$nodeM = _useGlobalProps.nodeMode,
1172
- nodeMode = _useGlobalProps$nodeM === void 0 ? 'branch' : _useGlobalProps$nodeM,
1173
- selectMode = _useGlobalProps.selectMode,
1174
- refresh = _useGlobalProps.refresh,
1175
- ctx = _useGlobalProps.ctx,
1176
- url = _useGlobalProps.url,
1177
- _useGlobalProps$metho = _useGlobalProps.method,
1178
- method = _useGlobalProps$metho === void 0 ? 'Get' : _useGlobalProps$metho,
1179
- value = _useGlobalProps.value,
1180
- defaultValue = _useGlobalProps.defaultValue,
1181
- data = _useGlobalProps.data,
1182
- _useGlobalProps$pagin = _useGlobalProps.pagination,
1183
- pagination = _useGlobalProps$pagin === void 0 ? false : _useGlobalProps$pagin,
1184
- _useGlobalProps$size = _useGlobalProps.size,
1185
- size = _useGlobalProps$size === void 0 ? 10 : _useGlobalProps$size,
1186
- _useGlobalProps$isLaz = _useGlobalProps.isLazy,
1187
- isLazy = _useGlobalProps$isLaz === void 0 ? false : _useGlobalProps$isLaz,
1188
- _useGlobalProps$isAll = _useGlobalProps.isAllCheck,
1189
- isAllCheck = _useGlobalProps$isAll === void 0 ? true : _useGlobalProps$isAll,
1190
- disabled = _useGlobalProps.disabled,
1191
- disabledChild = _useGlobalProps.disabledChild,
1192
- detail = _useGlobalProps.detail,
1193
- detailRender = _useGlobalProps.detailRender,
1194
- backDataFieldConfig = _useGlobalProps.backDataFieldConfig,
1195
- search = _useGlobalProps.search,
1196
- searchPlaceholder = _useGlobalProps.searchPlaceholder,
1197
- _useGlobalProps$searc = _useGlobalProps.searchTrigger,
1198
- searchTrigger = _useGlobalProps$searc === void 0 ? 'onChange' : _useGlobalProps$searc,
1199
- _useGlobalProps$bread = _useGlobalProps.breadcrumbs,
1200
- breadcrumbs = _useGlobalProps$bread === void 0 ? true : _useGlobalProps$bread,
1201
- breadcrumbsSeparator = _useGlobalProps.breadcrumbsSeparator,
1202
- breadcrumbsHead = _useGlobalProps.breadcrumbsHead,
1203
- _useGlobalProps$showb = _useGlobalProps.showbreadcrumbsHead,
1204
- showbreadcrumbsHead = _useGlobalProps$showb === void 0 ? true : _useGlobalProps$showb,
1205
- groupType = _useGlobalProps.groupType,
1206
- _useGlobalProps$group = _useGlobalProps.groupRange,
1207
- groupRange = _useGlobalProps$group === void 0 ? 'search' : _useGlobalProps$group,
1208
- emptyProps = _useGlobalProps.emptyProps,
1209
- selectRenderItem = _useGlobalProps.selectRenderItem,
1210
- selectRender = _useGlobalProps.selectRender,
1211
- onChange = _useGlobalProps.onChange,
1212
- onSelect = _useGlobalProps.onSelect,
1213
- onSearch = _useGlobalProps.onSearch,
1214
- onRefresh = _useGlobalProps.onRefresh;
1215
- var intl = useFormatMessage('Selector', localeJson);
1216
- var fieldConfigHand = handFieldConfig(props.fieldConfig, rowKey); // 字段配置,对应数据字段
1217
- var selectorFieldConfigHand = Object.assign(Object.assign({}, fieldConfigHand), backDataFieldConfig); // 选中值字段配置,对应数据字段
1218
- var _useState = useState([]),
1219
- _useState2 = _slicedToArray(_useState, 2),
1220
- currentData = _useState2[0],
1221
- setCurrentData = _useState2[1]; // 当前展示的数据
1222
- var _useState3 = useState(false),
1223
- _useState4 = _slicedToArray(_useState3, 2),
1224
- loadMore = _useState4[0],
1225
- setLoadMore = _useState4[1]; // 加载更多
1226
- var _useState5 = useState([]),
1227
- _useState6 = _slicedToArray(_useState5, 2),
1228
- valueCom = _useState6[0],
1229
- setValueCom = _useState6[1]; // 绑定的值
1230
- var _useState7 = useState({}),
1231
- _useState8 = _slicedToArray(_useState7, 2),
1232
- valueJsonCom = _useState8[0],
1233
- setValueJsonCom = _useState8[1]; // 绑定的值,json
1234
- var _useState9 = useState([]),
1235
- _useState10 = _slicedToArray(_useState9, 2),
1236
- breadcrumbsList = _useState10[0],
1237
- setBreadcrumbsList = _useState10[1]; // 面包屑
1238
- var _useState11 = useState(false),
1239
- _useState12 = _slicedToArray(_useState11, 2),
1240
- searchLoading = _useState12[0],
1241
- setSearchLoading = _useState12[1]; // 搜索loading
1242
- var _useState13 = useState({
1243
- val: ''
1244
- }),
1245
- _useState14 = _slicedToArray(_useState13, 2),
1246
- searchVal = _useState14[0],
1247
- setSearchVal = _useState14[1]; // 搜索值
1248
- var _useState15 = useState([]),
1249
- _useState16 = _slicedToArray(_useState15, 2),
1250
- searchList = _useState16[0],
1251
- setSearchList = _useState16[1]; // 搜索数据
1252
- var _useState17 = useState(false),
1253
- _useState18 = _slicedToArray(_useState17, 2),
1254
- searchLoadMore = _useState18[0],
1255
- setSearchLoadMore = _useState18[1]; // 是否显示搜索的加载更多按钮
1256
- var _useState19 = useState(true),
1257
- _useState20 = _slicedToArray(_useState19, 2),
1258
- loadingCom = _useState20[0],
1259
- setLoadingCom = _useState20[1];
1260
- var _useState21 = useState(),
1261
- _useState22 = _slicedToArray(_useState21, 2),
1262
- refreshCom = _useState22[0],
1263
- setRefreshCom = _useState22[1];
1264
- var constData = useRef({
1265
- /** 对象集合 所有的 */
1266
- jsonData: {},
1267
- /** 浅拷贝对象 所有的 */
1268
- jsonDataCopy: {},
1269
- /** 第一层数据 */
1270
- oneDataList: [],
1271
- /** 当前页数据源 本地数据为当前页所有的数据,请求数据为当前展示的数据 */
1272
- currentSourceData: [],
1273
- /** 当前选中值的mapping */
1274
- selectValueJson: {},
1275
- /** 面包屑数据 带根/搜索 */
1276
- breadcrumbsList: [],
1277
- /** 接口id */
1278
- reqId: Math.random().toString(),
1279
- /** 请求数据 */
1280
- reqParams: {
1281
- size: 10,
1282
- pagination: false,
1283
- isLazy: false
1284
- },
1285
- /** 不是懒加载, 是否请求过 */
1286
- noLazyReq: false,
1287
- /** 更改数据定时器 */
1288
- reqTimer: null,
1289
- /** 页数 */
1290
- page: 1,
1291
- /** 搜索值 */
1292
- searchVal: '',
1293
- /** 搜索点了下级,记录搜索前的面包屑,null说明没有储存过 */
1294
- beforeSearchBreadcrumbs: null,
1295
- /** 搜索配置 */
1296
- searchConfig: {
1297
- page: 1,
1298
- size: 10,
1299
- reqId: Math.random().toString(),
1300
- /** 当前页数据源 本地数据为当前页所有的数据,请求数据为当前展示的数据 */
1301
- currentSourceData: []
1302
- }
1303
- }); // 常量
1304
- constData.current.reqParams.size = size;
1305
- constData.current.reqParams.pagination = pagination;
1306
- constData.current.reqParams.isLazy = isLazy;
1307
- // 本地数据 有接口的全量数据 -> 走本地数据逻辑
1308
- var isReqLocalData = props.data || !constData.current.reqParams.isLazy && constData.current.noLazyReq;
1309
- useEffect(function () {
1310
- if (defaultValue !== undefined) handValue(defaultValue);
1311
- return function () {
1312
- clearTimeout(constData.current.reqTimer);
1313
- };
1314
- }, []);
1315
- useEffect(function () {
1316
- if (value !== undefined) handValue(value);
1317
- }, [value]);
1318
- // 处理源数据
1319
- useEffect(function () {
1320
- if (data) {
1321
- var treeData = convertTree(data, false);
1322
- constData.current.oneDataList = treeData;
1323
- constData.current.currentSourceData = treeData;
1324
- setBreadcrumbsList([]);
1325
- handInitCurrent();
1326
- }
1327
- }, [data]);
1328
- useEffect(function () {
1329
- if (url) {
1330
- setBreadcrumbsList([]);
1331
- handInitCurrent();
1332
- }
1333
- }, [url]);
1334
- // 请求数据
1335
- useEffect(function () {
1336
- clearTimeout(constData.current.reqTimer);
1337
- if (props.url) Cancel(constData.current.reqId);
1338
- constData.current.reqTimer = setTimeout(function () {
1339
- // 本地数据 不是懒加载的全量接口数据
1340
- if (isReqLocalData) {
1341
- var currentSourceData = constData.current.currentSourceData;
1342
- if (constData.current.reqParams.pagination) {
1343
- // 分页
1344
- var sliceData = currentSourceData.slice(0, constData.current.page * constData.current.reqParams.size);
1345
- setCurrentData(sliceData);
1346
- // 没有加载更多
1347
- if (constData.current.page * constData.current.reqParams.size >= currentSourceData.length) {
1348
- setLoadMore(false);
1349
- } else {
1350
- setLoadMore(true);
1351
- }
1352
- } else {
1353
- // 不分页
1354
- setCurrentData(currentSourceData);
1355
- }
1356
- setLoadingCom(false);
1357
- }
1358
- // 远程数据
1359
- if (props.url) {
1360
- var obj = {
1361
- method: method,
1362
- url: props.url,
1363
- ctx: ctx,
1364
- uuid: constData.current.reqId,
1365
- data: Object.assign({
1366
- parentId: handParentId()
1367
- }, props.params)
1368
- };
1369
- // 懒加载
1370
- if (constData.current.reqParams.isLazy) {
1371
- // 分页
1372
- if (constData.current.reqParams.pagination) {
1373
- obj.data.size = constData.current.reqParams.size;
1374
- obj.data.page = constData.current.page;
1375
- }
1376
- handReq(props.paramsCallback ? props.paramsCallback(obj) : obj);
1377
- } else {
1378
- // 不是懒加载 全量数据 只请求一次
1379
- if (!constData.current.noLazyReq) handReq(props.paramsCallback ? props.paramsCallback(obj) : obj);
1380
- }
1381
- }
1382
- }, 50);
1383
- }, [refreshCom]);
1384
- useEffect(function () {
1385
- if (refresh) refreshFunc();
1386
- }, [refresh]);
1387
- /** 刷新 */
1388
- var refreshFunc = function refreshFunc() {
1389
- if (!isReqLocalData) {
1390
- constData.current.currentSourceData = [];
1391
- }
1392
- handInitCurrent();
1393
- };
1394
- /**
1395
- * 处理节点数据
1396
- * @param item 节点数据
1397
- * @param bol 是否是搜索
1398
- * */
1399
- var handNodeData = function handNodeData(item, bol) {
1400
- var itemData = {
1401
- key: item[rowKey],
1402
- parentId: item[fieldConfigHand.parentId],
1403
- type: item[fieldConfigHand.type],
1404
- img: item[fieldConfigHand.img],
1405
- mainTitle: item[fieldConfigHand.mainTitle],
1406
- subTitle: item[fieldConfigHand.subTitle],
1407
- tag: item[fieldConfigHand.tag],
1408
- children: [],
1409
- disabled: false,
1410
- disabledChild: false,
1411
- choice: selectMode !== undefined,
1412
- detail: detail,
1413
- leaf: nodeMode === 'leaf',
1414
- //child: false,
1415
- data: item
1416
- };
1417
- // 如果外部存在节点回调
1418
- if (props.handNodeInfo) itemData = props.handNodeInfo(itemData, bol);
1419
- return itemData;
1420
- };
1421
- /**
1422
- * 转换树结构 记录原始数据,跟处理过的数据
1423
- * @param arr 数据源
1424
- * @param notTree true不生成树
1425
- * @param isSearch 是否搜索
1426
- * */
1427
- var convertTree = function convertTree(arr, notTree, isSearch) {
1428
- var handArr = [];
1429
- var json = {};
1430
- // 生成mappingd对象
1431
- var recurrence = function recurrence(list) {
1432
- for (var i = 0, l = list.length; i < l; i++) {
1433
- var item = list[i];
1434
- var keyStr = item[rowKey];
1435
- var itemData = handNodeData(item, !!isSearch);
1436
- json[keyStr] = itemData;
1437
- var childrenName = fieldConfigHand.children;
1438
- constData.current.jsonDataCopy[keyStr] = item; // 原始数据
1439
- constData.current.jsonData[keyStr] = itemData; // 处理过的数据
1440
- if (item[childrenName]) {
1441
- recurrence(item[childrenName]);
1442
- }
1443
- }
1444
- };
1445
- recurrence(arr);
1446
- // 生成tree数据
1447
- var arrKey = Object.keys(json);
1448
- for (var i = 0, l = arrKey.length; i < l; i++) {
1449
- var keyStr = arrKey[i];
1450
- var item = json[keyStr];
1451
- var parentId = item.parentId || '';
1452
- if (notTree) {
1453
- handArr.push(item);
1454
- continue;
1455
- }
1456
- if (parentId && json[parentId]) {
1457
- if (!json[parentId].children) json[parentId].children = [];
1458
- json[parentId].children.push(item);
1459
- } else {
1460
- handArr.push(item);
1461
- }
1462
- }
1463
- return handArr;
1464
- };
1465
- /** 处理parentId */
1466
- var handParentId = function handParentId() {
1467
- var parentId;
1468
- // 面包屑最后一项做parent
1469
- if (constData.current.breadcrumbsList.length > 0) {
1470
- // 包含了根,所以要多加1
1471
- var item = constData.current.breadcrumbsList[constData.current.breadcrumbsList.length - 1];
1472
- parentId = item.value;
1473
- } else {
1474
- if (props.breadcrumbsHead) parentId = props.breadcrumbsHead.value; // 根
1475
- }
1476
- // 显示首级, 面包屑只有一层, 拿首级
1477
- if (showbreadcrumbsHead && constData.current.breadcrumbsList.length === 1) {
1478
- parentId = undefined;
1479
- if (props.breadcrumbsHead) parentId = props.breadcrumbsHead.value; // 根
1480
- }
1481
-
1482
- return parentId;
1483
- };
1484
- /** 请求 */
1485
- var handReq = function handReq(obj) {
1486
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
1487
- var _yield$reqFunc, data, err;
1488
- return regenerator.wrap(function _callee$(_context) {
1489
- while (1) switch (_context.prev = _context.next) {
1490
- case 0:
1491
- setLoadingCom(true);
1492
- _context.next = 3;
1493
- return reqFunc(obj);
1494
- case 3:
1495
- _yield$reqFunc = _context.sent;
1496
- data = _yield$reqFunc.data;
1497
- err = _yield$reqFunc.err;
1498
- if (!err) {
1499
- _context.next = 10;
1500
- break;
1501
- }
1502
- setLoadingCom(false);
1503
- if (constData.current.reqParams.isLazy) {
1504
- // 懒加载
1505
- if (constData.current.reqParams.pagination) {
1506
- // 分页 第一页不处理
1507
- if (constData.current.page !== 1) constData.current.page = constData.current.page - 1;
1508
- }
1509
- }
1510
- return _context.abrupt("return");
1511
- case 10:
1512
- if (!props.requestCallback) {
1513
- _context.next = 13;
1514
- break;
1515
- }
1516
- props.requestCallback(data, function (handData) {
1517
- setLoadingCom(false);
1518
- handReqData(handData);
1519
- });
1520
- return _context.abrupt("return");
1521
- case 13:
1522
- setLoadingCom(false);
1523
- handReqData(data);
1524
- case 15:
1525
- case "end":
1526
- return _context.stop();
1527
- }
1528
- }, _callee);
1529
- }));
1530
- };
1531
- /** 接口回来处理数据 */
1532
- var handReqData = function handReqData(resultData) {
1533
- if (constData.current.reqParams.isLazy) {
1534
- // 懒加载
1535
- if (constData.current.reqParams.pagination) {
1536
- // 分页
1537
- var result = resultData.data || {};
1538
- var arr = result.list || [];
1539
- var total = result.total;
1540
- var arrHand = convertTree(arr, true);
1541
- var currentD = [].concat(_toConsumableArray(constData.current.currentSourceData), _toConsumableArray(arrHand));
1542
- constData.current.currentSourceData = currentD;
1543
- setCurrentData(currentD);
1544
- if (constData.current.page * constData.current.reqParams.size >= total) {
1545
- setLoadMore(false);
1546
- } else {
1547
- setLoadMore(true);
1548
- }
1549
- } else {
1550
- // 不分页 必须返回平铺的数组
1551
- var _arr = resultData.data || [];
1552
- var treeData = convertTree(_arr, true);
1553
- constData.current.currentSourceData = treeData;
1554
- setCurrentData(treeData);
1555
- }
1556
- } else {
1557
- // 不是懒加载 只请求一次
1558
- constData.current.noLazyReq = true;
1559
- var _arr2 = resultData.data || [];
1560
- var _treeData = convertTree(_arr2, false);
1561
- constData.current.oneDataList = _treeData; // 第一层数据
1562
- constData.current.currentSourceData = _treeData;
1563
- handInitCurrent();
1564
- }
1565
- };
1566
- /** 当前页初始更新 */
1567
- var handInitCurrent = function handInitCurrent() {
1568
- constData.current.page = 1;
1569
- setRefreshCom(Math.random());
1570
- };
1571
- /** 处理value */
1572
- var handValue = function handValue(val) {
1573
- var handVal = !val ? [] : [val];
1574
- if (val instanceof Array) {
1575
- handVal = _toConsumableArray(val);
1576
- }
1577
- var json = ArrayToObject(selectorFieldConfigHand.key, handVal);
1578
- constData.current.selectValueJson = json;
1579
- setValueJsonCom(json);
1580
- setValueCom(_toConsumableArray(handVal));
1581
- };
1582
- /** 点击下级,添加面包屑 */
1583
- var onLevelAddBreadcrumbs = function onLevelAddBreadcrumbs(item, isSearch) {
1584
- var arr = _toConsumableArray(breadcrumbsList);
1585
- if (isSearch) {
1586
- arr = [];
1587
- if (constData.current.beforeSearchBreadcrumbs === null) {
1588
- // 记录搜索之前的面包屑
1589
- constData.current.beforeSearchBreadcrumbs = _toConsumableArray(breadcrumbsList);
1590
- }
1591
- }
1592
- arr.push({
1593
- label: item.mainTitle,
1594
- value: item.key || ''
1595
- });
1596
- setBreadcrumbsList(arr);
1597
- };
1598
- /** 点击下级 */
1599
- var onLevelCom = function onLevelCom(item, isSearch) {
1600
- onLevelAddBreadcrumbs(item, isSearch);
1601
- if (isReqLocalData) {
1602
- // 本地数据
1603
- constData.current.currentSourceData = item.children || [];
1604
- handInitCurrent();
1605
- } else {
1606
- // 请求数据
1607
- if (constData.current.reqParams.isLazy) {
1608
- // 懒加载
1609
- if (constData.current.reqParams.pagination) {
1610
- // 分页
1611
- constData.current.currentSourceData = [];
1612
- }
1613
- handInitCurrent();
1614
- }
1615
- }
1616
- };
1617
- /** 处理抛出去的数据 */
1618
- var handEmitValue = function handEmitValue(item) {
1619
- var arr = ['key', 'img', 'mainTitle', 'subTitle', 'tag'];
1620
- if (props.groupType && props.groupType.length > 0) {
1621
- arr.push('type');
1622
- }
1623
- var json = {};
1624
- for (var i = 0, l = arr.length; i < l; i++) {
1625
- var arrItem = arr[i];
1626
- var name = selectorFieldConfigHand[arrItem];
1627
- if (name) json[name] = item[arrItem];
1628
- }
1629
- return json;
1630
- };
1631
- /**
1632
- * 向外触发onchane事件
1633
- * @param val 向外抛的值
1634
- * @param valCom 设置组件的值
1635
- * @param node 处理过的节点数据
1636
- * @param rowData 原始数据节点
1637
- * */
1638
- var onChangeEmit = function onChangeEmit(val, valCom, node, rowData) {
1639
- onChange && onChange(val, node, rowData);
1640
- if (value == undefined) {
1641
- handValue(!val ? [] : val);
1642
- }
1643
- };
1644
- /** 选择数据 */
1645
- var onSelectCom = function onSelectCom(item) {
1646
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee2() {
1647
- var keyStr, selectVal, bol, json, arr, node, rowData, i, l, valueComItem, valueComItemId, _json;
1648
- return regenerator.wrap(function _callee2$(_context2) {
1649
- while (1) switch (_context2.prev = _context2.next) {
1650
- case 0:
1651
- keyStr = item.key || ''; // key
1652
- // 单选且选中,点击不触发
1653
- if (!(selectMode === 'radio' && valueJsonCom[keyStr])) {
1654
- _context2.next = 3;
1655
- break;
1656
- }
1657
- return _context2.abrupt("return");
1658
- case 3:
1659
- selectVal = constData.current.selectValueJson[keyStr]; // 存在选中值当中 -> 选中变不选中
1660
- if (!onSelect) {
1661
- _context2.next = 10;
1662
- break;
1663
- }
1664
- _context2.next = 7;
1665
- return onSelect(item, selectMode === 'radio' ? true : !selectVal, false);
1666
- case 7:
1667
- bol = _context2.sent;
1668
- if (!bol) {
1669
- _context2.next = 10;
1670
- break;
1671
- }
1672
- return _context2.abrupt("return");
1673
- case 10:
1674
- // 单选
1675
- if (selectMode === 'radio') {
1676
- json = handEmitValue(item);
1677
- onChangeEmit(json, [json], constData.current.jsonData[keyStr], constData.current.jsonDataCopy[keyStr]);
1678
- }
1679
- // 多选
1680
- if (selectMode === 'check') {
1681
- arr = [];
1682
- node = {}; // 处理过得数据
1683
- rowData = {}; // 原始数据
1684
- // 把即将不选中的值,从valueCom里面拿掉
1685
- for (i = 0, l = valueCom.length; i < l; i++) {
1686
- valueComItem = valueCom[i]; // 选中valueCom都保留
1687
- // 不选中 保留valueCom里面的key不等于当前的key
1688
- if (!selectVal || item.key !== valueComItem[selectorFieldConfigHand.key]) {
1689
- valueComItemId = valueComItem[selectorFieldConfigHand.key];
1690
- node[valueComItemId] = constData.current.jsonData[valueComItemId];
1691
- rowData[valueComItemId] = constData.current.jsonDataCopy[valueComItemId];
1692
- arr.push(valueComItem);
1693
- }
1694
- }
1695
- // 不选中 -> 选中
1696
- if (!selectVal) {
1697
- _json = handEmitValue(item);
1698
- node[keyStr] = constData.current.jsonData[keyStr];
1699
- rowData[keyStr] = constData.current.jsonDataCopy[keyStr];
1700
- arr.push(_json);
1701
- }
1702
- onChangeEmit(arr, arr, node, rowData);
1703
- }
1704
- case 12:
1705
- case "end":
1706
- return _context2.stop();
1707
- }
1708
- }, _callee2);
1709
- }));
1710
- };
1711
- /** 处理禁用状态 */
1712
- var handDisabled = function handDisabled(item) {
1713
- if (disabled) {
1714
- if (disabled === true) return true;
1715
- if (disabled instanceof Array) {
1716
- if (item.key && disabled.indexOf(item.key) !== -1) {
1717
- return true;
1718
- }
1719
- }
1720
- }
1721
- if (item.disabled) return true;
1722
- return false;
1723
- };
1724
- /**
1725
- * 点击全选
1726
- * @param bol true全选
1727
- * */
1728
- var onAllCheckCom = function onAllCheckCom(bol) {
1729
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee3() {
1730
- var arrList, arrVal, arrval1, node, rowData, selectArr, selectEmitData, i, l, item, keyStr, disabledItem, _i, _l, _item, _keyStr, emitArr, flag;
1731
- return regenerator.wrap(function _callee3$(_context3) {
1732
- while (1) switch (_context3.prev = _context3.next) {
1733
- case 0:
1734
- arrList = _toConsumableArray(currentData); // 当前列的数据
1735
- arrVal = _toConsumableArray(valueCom); // 全选 绑定的值
1736
- arrval1 = []; // 全不选 绑定的值
1737
- node = {}; // 处理过得数据
1738
- rowData = {}; // 原始数据
1739
- selectArr = []; // 全不选 - 当前列选中值
1740
- selectEmitData = []; // 选择事件抛出去的值
1741
- // 循环当前列数据
1742
- i = 0, l = arrList.length;
1743
- case 8:
1744
- if (!(i < l)) {
1745
- _context3.next = 18;
1746
- break;
1747
- }
1748
- item = arrList[i];
1749
- keyStr = item.key || '';
1750
- disabledItem = handDisabled(item);
1751
- if (!disabledItem) {
1752
- _context3.next = 14;
1753
- break;
1754
- }
1755
- return _context3.abrupt("continue", 15);
1756
- case 14:
1757
- if (bol) {
1758
- // 全选
1759
- if (!constData.current.selectValueJson[keyStr]) {
1760
- // 不存在选中值中
1761
- arrVal.push(handEmitValue(item));
1762
- selectEmitData.push(item);
1763
- }
1764
- } else {
1765
- // 全不选
1766
- if (constData.current.selectValueJson[keyStr]) {
1767
- // 存在选中值中,拿掉
1768
- selectArr.push(keyStr);
1769
- selectEmitData.push(item);
1770
- }
1771
- }
1772
- case 15:
1773
- i++;
1774
- _context3.next = 8;
1775
- break;
1776
- case 18:
1777
- for (_i = 0, _l = arrVal.length; _i < _l; _i++) {
1778
- _item = arrVal[_i];
1779
- _keyStr = _item[selectorFieldConfigHand.key];
1780
- if (bol) {
1781
- // 全选
1782
- node[_keyStr] = constData.current.jsonData[_keyStr];
1783
- rowData[_keyStr] = constData.current.jsonDataCopy[_keyStr];
1784
- } else {
1785
- // 全不选
1786
- if (selectArr.indexOf(_keyStr) === -1) {
1787
- // 不存在 全不选 - 当前列选中值
1788
- node[_keyStr] = constData.current.jsonData[_keyStr];
1789
- rowData[_keyStr] = constData.current.jsonDataCopy[_keyStr];
1790
- arrval1.push(_item);
1791
- }
1792
- }
1793
- }
1794
- emitArr = bol ? arrVal : arrval1;
1795
- if (!onSelect) {
1796
- _context3.next = 26;
1797
- break;
1798
- }
1799
- _context3.next = 23;
1800
- return onSelect(selectEmitData, !!bol, false);
1801
- case 23:
1802
- flag = _context3.sent;
1803
- if (!flag) {
1804
- _context3.next = 26;
1805
- break;
1806
- }
1807
- return _context3.abrupt("return");
1808
- case 26:
1809
- onChangeEmit(emitArr, emitArr, node, rowData);
1810
- case 27:
1811
- case "end":
1812
- return _context3.stop();
1813
- }
1814
- }, _callee3);
1815
- }));
1816
- };
1817
- /** 点击查看更多 */
1818
- var onLoadCom = function onLoadCom(isSearch) {
1819
- if (isSearch) {
1820
- // 搜索
1821
- constData.current.searchConfig.page = constData.current.searchConfig.page + 1;
1822
- reqSearch();
1823
- return;
1824
- }
1825
- constData.current.page = constData.current.page + 1;
1826
- setRefreshCom(Math.random());
1827
- };
1828
- /** 处理面包屑数组 */
1829
- var handBreadcrumbsList = function handBreadcrumbsList() {
1830
- var arr = _toConsumableArray(breadcrumbsList);
1831
- // 根路径
1832
- var oneItem = breadcrumbsHead || {
1833
- label: intl({
1834
- id: 'root'
1835
- }),
1836
- value: '_paraui_first_floor'
1837
- };
1838
- // 具有搜索结果的上下级
1839
- if (constData.current.searchVal) {
1840
- arr.unshift({
1841
- label: props.searchBreadcrumbs ? props.searchBreadcrumbs : intl({
1842
- id: 'searchResult'
1843
- }),
1844
- value: '_paraui_search'
1845
- });
1846
- }
1847
- if (showbreadcrumbsHead) arr.unshift(oneItem);
1848
- constData.current.breadcrumbsList = arr;
1849
- return arr;
1850
- };
1851
- /** 截取面包屑数据 */
1852
- var spliceBreadcrumbs = function spliceBreadcrumbs(item) {
1853
- var arr = [];
1854
- for (var i = 0, l = breadcrumbsList.length; i < l; i++) {
1855
- var itemB = breadcrumbsList[i];
1856
- arr.push(itemB);
1857
- if (itemB.value === item.value) {
1858
- break;
1859
- }
1860
- }
1861
- return arr;
1862
- };
1863
- /** 点击面包屑 */
1864
- var onClickBreadcrumbsCom = function onClickBreadcrumbsCom(item) {
1865
- var list = constData.current.breadcrumbsList;
1866
- // 点击最后一层,不触发数据变更
1867
- if (list.length === 0 || item.value === list[list.length - 1].value) {
1868
- return;
1869
- }
1870
- var keyStr = item.value || '';
1871
- var oneValue = breadcrumbsHead ? breadcrumbsHead.value : '_paraui_first_floor';
1872
- // 点击搜索结果,显示上一次的搜索
1873
- if (item.value === '_paraui_search') {
1874
- setSearchVal({
1875
- val: constData.current.searchVal
1876
- });
1877
- setBreadcrumbsList(_toConsumableArray(constData.current.beforeSearchBreadcrumbs || []));
1878
- return;
1879
- }
1880
- // 点击根路径且具有搜索面包屑
1881
- if (constData.current.beforeSearchBreadcrumbs && item.value === oneValue) {
1882
- // 清空搜索态
1883
- constData.current.searchVal = '';
1884
- constData.current.beforeSearchBreadcrumbs = null;
1885
- setSearchVal({
1886
- val: ''
1887
- });
1888
- handBreadcrumbsList();
1889
- }
1890
- // 设置面包屑
1891
- if (keyStr === oneValue) {
1892
- // 第一层
1893
- setBreadcrumbsList([]);
1894
- } else {
1895
- // 除了第一级,最后一级
1896
- setBreadcrumbsList(spliceBreadcrumbs(item));
1897
- }
1898
- if (isReqLocalData) {
1899
- if (keyStr === oneValue) {
1900
- // 第一层
1901
- constData.current.currentSourceData = _toConsumableArray(constData.current.oneDataList);
1902
- } else {
1903
- // 除了第一级,最后一级
1904
- var itemData = constData.current.jsonData[keyStr];
1905
- constData.current.currentSourceData = itemData[fieldConfigHand.children];
1906
- }
1907
- } else {
1908
- // 请求数据
1909
- if (constData.current.reqParams.isLazy) {
1910
- // 懒加载
1911
- if (constData.current.reqParams.pagination) {
1912
- // 分页
1913
- constData.current.currentSourceData = [];
1914
- }
1915
- }
1916
- }
1917
- handInitCurrent();
1918
- };
1919
- /** 处理搜索的请求 */
1920
- var handSearchData = function handSearchData(resultData) {
1921
- var isTree = resultData.isTree;
1922
- if (constData.current.reqParams.pagination) {
1923
- // 分页
1924
- var result = resultData.data || {};
1925
- var arr = result.list || [];
1926
- var total = result.total;
1927
- var arrHand = convertTree(arr, !isTree, true); // 搜索默认不生成树
1928
- var currentD = [].concat(_toConsumableArray(constData.current.searchConfig.currentSourceData), _toConsumableArray(arrHand));
1929
- constData.current.searchConfig.currentSourceData = currentD;
1930
- setSearchList(currentD);
1931
- if (constData.current.searchConfig.page * constData.current.searchConfig.size >= total) {
1932
- setSearchLoadMore(false);
1933
- } else {
1934
- setSearchLoadMore(true);
1935
- }
1936
- } else {
1937
- // 不分页 必须返回平铺的数组
1938
- var _arr3 = resultData.data || [];
1939
- var treeData = convertTree(_arr3, !isTree, true); // 搜索默认不生成树
1940
- constData.current.searchConfig.currentSourceData = treeData;
1941
- setSearchList(treeData);
1942
- }
1943
- };
1944
- /** 处理搜索接口 */
1945
- var handReqSearchResult = function handReqSearchResult(result) {
1946
- var data = result.data,
1947
- err = result.err;
1948
- if (err) {
1949
- setSearchLoading(false);
1950
- if (constData.current.reqParams.pagination) {
1951
- // 分页 第一页不处理
1952
- if (constData.current.searchConfig.page !== 1) constData.current.searchConfig.page = constData.current.searchConfig.page - 1;
1953
- }
1954
- return;
1955
- }
1956
- if (props.requestCallback) {
1957
- props.requestCallback(data, function (handData) {
1958
- setSearchLoading(false);
1959
- handSearchData(handData);
1960
- }, true);
1961
- return;
1962
- }
1963
- setSearchLoading(false);
1964
- handSearchData(data);
1965
- };
1966
- /** 搜索请求 */
1967
- var reqSearch = function reqSearch() {
1968
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee4() {
1969
- var _a, reqParams, _result, obj, result;
1970
- return regenerator.wrap(function _callee4$(_context4) {
1971
- while (1) switch (_context4.prev = _context4.next) {
1972
- case 0:
1973
- if (!onSearch) {
1974
- _context4.next = 8;
1975
- break;
1976
- }
1977
- reqParams = {};
1978
- if (constData.current.reqParams.pagination) {
1979
- reqParams.size = constData.current.searchConfig.size;
1980
- reqParams.page = constData.current.searchConfig.page;
1981
- }
1982
- _context4.next = 5;
1983
- return onSearch(constData.current.searchVal, reqParams);
1984
- case 5:
1985
- _result = _context4.sent;
1986
- handReqSearchResult(_result);
1987
- return _context4.abrupt("return");
1988
- case 8:
1989
- obj = {
1990
- method: method,
1991
- url: props.url || '',
1992
- ctx: ctx,
1993
- uuid: constData.current.reqId,
1994
- data: Object.assign({
1995
- searchKey: (_a = constData.current.searchVal) === null || _a === void 0 ? void 0 : _a.trim()
1996
- }, props.params)
1997
- };
1998
- if (constData.current.reqParams.pagination) {
1999
- obj.data.size = constData.current.searchConfig.size;
2000
- obj.data.page = constData.current.searchConfig.page;
2001
- }
2002
- obj = props.paramsCallback ? props.paramsCallback(obj, true) : obj;
2003
- _context4.next = 13;
2004
- return reqFunc(obj);
2005
- case 13:
2006
- result = _context4.sent;
2007
- handReqSearchResult(result);
2008
- case 15:
2009
- case "end":
2010
- return _context4.stop();
2011
- }
2012
- }, _callee4);
2013
- }));
2014
- };
2015
- /**
2016
- * 递归寻找子级
2017
- * */
2018
- var convertChild = function convertChild(id, arr) {
2019
- var arrHnad = arr;
2020
- var recurrence = function recurrence(arrItem) {
2021
- for (var i = 0, l = arrItem.length; i < l; i++) {
2022
- var item = arrItem[i];
2023
- var rowId = item[rowKey];
2024
- var arrChild = item.children || [];
2025
- if (rowId === id) {
2026
- arrHnad = arrChild;
2027
- return;
2028
- }
2029
- recurrence(arrChild);
2030
- }
2031
- };
2032
- recurrence(arr);
2033
- return arrHnad;
2034
- };
2035
- /** 搜索回调
2036
- * @param bol 搜索框为空的情况下,触发搜索
2037
- * */
2038
- var onSearchCom = function onSearchCom(val, bol) {
2039
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee5() {
2040
- var parentId, arr;
2041
- return regenerator.wrap(function _callee5$(_context5) {
2042
- while (1) switch (_context5.prev = _context5.next) {
2043
- case 0:
2044
- setSearchLoading(true);
2045
- constData.current.searchVal = val;
2046
- if (!(val === '')) {
2047
- _context5.next = 8;
2048
- break;
2049
- }
2050
- setSearchList([]);
2051
- setSearchLoading(false);
2052
- if (constData.current.beforeSearchBreadcrumbs) {
2053
- // 从搜索恢复到正常列表
2054
- constData.current.breadcrumbsList = _toConsumableArray(constData.current.beforeSearchBreadcrumbs);
2055
- setBreadcrumbsList(_toConsumableArray(constData.current.beforeSearchBreadcrumbs));
2056
- constData.current.beforeSearchBreadcrumbs = null;
2057
- if (isReqLocalData) {
2058
- // 本地全量数据
2059
- // 搜索点过下级,修改了当前显示的数据
2060
- // 从搜索恢复到正常列表, 需要从原始数据,取出当前层级对应的数据
2061
- parentId = handParentId();
2062
- arr = convertChild(parentId, constData.current.oneDataList);
2063
- constData.current.currentSourceData = arr;
2064
- }
2065
- refreshFunc();
2066
- }
2067
- if (bol) {
2068
- // 当前页刷新
2069
- refreshFunc();
2070
- onRefresh && onRefresh();
2071
- }
2072
- return _context5.abrupt("return");
2073
- case 8:
2074
- constData.current.searchConfig.page = 1;
2075
- constData.current.searchConfig.currentSourceData = [];
2076
- reqSearch();
2077
- case 11:
2078
- case "end":
2079
- return _context5.stop();
2080
- }
2081
- }, _callee5);
2082
- }));
2083
- };
2084
- /** 删除数据 */
2085
- var onCloseCom = function onCloseCom(item, index) {
2086
- if (selectMode === 'radio') {
2087
- onChangeEmit(null, [], {}, {});
2088
- }
2089
- if (selectMode === 'check') {
2090
- var arr = _toConsumableArray(valueCom);
2091
- arr.splice(index, 1);
2092
- var node = {}; // 处理过得数据
2093
- var rowData = {}; // 原始数据
2094
- for (var i = 0, l = arr.length; i < l; i++) {
2095
- var _item2 = arr[i];
2096
- var keyStr = _item2[selectorFieldConfigHand.key];
2097
- node[keyStr] = constData.current.jsonData[keyStr];
2098
- rowData[keyStr] = constData.current.jsonDataCopy[keyStr];
2099
- }
2100
- onChangeEmit(arr, arr, node, rowData);
2101
- }
2102
- };
2103
- /** 处理返回数据dom配置 */
2104
- var handSelectorData = function handSelectorData() {
2105
- return jsx(SelectorData, {
2106
- layout: layout === 'tb' ? 'tag' : 'node',
2107
- backDataFieldConfig: selectorFieldConfigHand,
2108
- groupType: groupType,
2109
- handSelectorNodeInfo: props.handSelectorNodeInfo,
2110
- list: valueCom,
2111
- nodeMode: nodeMode,
2112
- detail: detail,
2113
- detailRender: detailRender,
2114
- emptyProps: emptyProps,
2115
- onClose: onCloseCom,
2116
- selectDataTitleRender: props.selectDataTitleRender,
2117
- selectRenderItem: selectRenderItem,
2118
- selectRender: selectRender,
2119
- disabled: disabled
2120
- });
2121
- };
2122
- // 处理className
2123
- var handClass = function handClass() {
2124
- var str = "".concat($prefixCls, "-selector");
2125
- if (className) str += ' ' + className;
2126
- if (layout) str += " ".concat($prefixCls, "-selector-").concat(layout);
2127
- if (selectMode) str += " ".concat($prefixCls, "-selector-").concat(selectMode);
2128
- if (disabled === true) str += " ".concat($prefixCls, "-selector-disabled");
2129
- return str;
2130
- };
2131
- return jsxs("div", Object.assign({
2132
- className: handClass(),
2133
- style: style
2134
- }, {
2135
- children: [layout === 'tb' && handSelectorData(), jsx(SelectorMain, {
2136
- url: url,
2137
- rowKey: rowKey,
2138
- value: valueJsonCom,
2139
- loadMore: loadMore,
2140
- isAllCheck: isAllCheck,
2141
- list: currentData,
2142
- groupType: groupType,
2143
- groupRange: groupRange,
2144
- fieldConfig: fieldConfigHand,
2145
- nodeMode: nodeMode,
2146
- selectMode: selectMode,
2147
- isLazy: isLazy,
2148
- detail: detail,
2149
- detailRender: detailRender,
2150
- search: search,
2151
- searchTrigger: searchTrigger,
2152
- searchPlaceholder: searchPlaceholder,
2153
- searchLoading: searchLoading,
2154
- searchVal: searchVal,
2155
- disabled: disabled,
2156
- disabledChild: disabledChild,
2157
- loading: loadingCom,
2158
- searchLoadMore: searchLoadMore,
2159
- searchList: searchList,
2160
- breadcrumbs: breadcrumbs,
2161
- breadcrumbsSeparator: breadcrumbsSeparator,
2162
- breadcrumbsList: handBreadcrumbsList(),
2163
- emptyProps: emptyProps,
2164
- onLevel: onLevelCom,
2165
- onSelect: onSelectCom,
2166
- onLoad: onLoadCom,
2167
- onAllCheck: onAllCheckCom,
2168
- onClickBreadcrumbs: onClickBreadcrumbsCom,
2169
- onSearch: onSearchCom,
2170
- onRefresh: onRefresh
2171
- }), layout === 'lr' && handSelectorData()]
2172
- }));
2173
- };
2174
-
2175
- export { Selector as default, handFieldConfig };