@para-ui/core 4.0.0-rc.4 → 4.0.0-rc.6

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 (188) hide show
  1. package/AutoBox/index.js +72 -85
  2. package/AutoTips/index.js +72 -95
  3. package/Badge/index.js +17 -16
  4. package/Breadcrumbs/index.js +57 -73
  5. package/Button/index.js +90 -118
  6. package/ButtonGroup/index.js +30 -33
  7. package/Carousel/index.js +29 -33
  8. package/Cascader/index.js +9 -10
  9. package/Checkbox/index.js +28 -35
  10. package/CheckboxGroup/index.js +43 -58
  11. package/Collapse/index.js +52 -49
  12. package/CollapseBox/index.js +65 -70
  13. package/CollapseLayout/index.js +106 -101
  14. package/ColorPicker/index.js +3 -3
  15. package/ComboSelect/index.js +260 -337
  16. package/ComboSelect/lang/en_US.d.ts +1 -0
  17. package/ComboSelect/lang/index.d.ts +2 -0
  18. package/ComboSelect/lang/zh_CN.d.ts +1 -0
  19. package/ComboSelect/utils.d.ts +6 -0
  20. package/Container/index.js +17 -21
  21. package/CopyText/index.js +50 -83
  22. package/DatePicker/index.js +24 -27
  23. package/Descriptions/index.js +50 -59
  24. package/Desktop/index.js +161 -180
  25. package/DragVerify/index.js +77 -113
  26. package/Drawer/index.js +80 -95
  27. package/Dropdown/index.js +3 -3
  28. package/DynamicMultiBox/index.js +222 -224
  29. package/DynamicMultiBox/interface.d.ts +7 -0
  30. package/Empty/index.js +26 -28
  31. package/Form/index.js +70 -74
  32. package/FormItem/index.js +18 -15
  33. package/FunctionModal/index.js +7 -14
  34. package/GlobalContext/index.js +17 -20
  35. package/Help/index.js +9 -12
  36. package/HelperText/index.js +11 -11
  37. package/InputLang/index.js +104 -124
  38. package/InputNumber/index.js +62 -81
  39. package/Label/index.js +19 -21
  40. package/Loading/index.js +11 -10
  41. package/Menu/index.js +302 -371
  42. package/Message/index.js +104 -113
  43. package/Modal/index.js +122 -148
  44. package/MultiBox/index.d.ts +5 -0
  45. package/MultiBox/index.js +111 -115
  46. package/Notification/index.js +105 -103
  47. package/OperateBtn/index.d.ts +3 -0
  48. package/OperateBtn/index.js +77 -107
  49. package/PageHeader/index.js +327 -406
  50. package/Pagination/index.js +107 -137
  51. package/ParauiProvider/index.js +20 -22
  52. package/PasswordRules/index.js +36 -40
  53. package/PopConfirm/index.js +60 -77
  54. package/Popover/index.js +12 -12
  55. package/Progress/index.js +72 -74
  56. package/Querying/index.js +22 -23
  57. package/README.md +2 -0
  58. package/Radio/index.js +27 -34
  59. package/RadioGroup/index.js +38 -52
  60. package/Search/index.js +34 -43
  61. package/Select/index.js +281 -345
  62. package/SelectInput/index.js +8 -13
  63. package/Selector/index.js +582 -796
  64. package/SelectorPicker/index.js +113 -134
  65. package/SingleBox/index.d.ts +5 -0
  66. package/SingleBox/index.js +92 -88
  67. package/Slider/index.js +46 -57
  68. package/Status/index.js +14 -13
  69. package/Stepper/index.js +24 -25
  70. package/Styles/theme.scss +9 -9
  71. package/Switch/index.js +32 -35
  72. package/Table/index.js +360 -494
  73. package/Tabs/index.js +100 -100
  74. package/Tag/index.js +64 -82
  75. package/TextEditor/index.js +78 -100
  76. package/TextField/index.js +142 -183
  77. package/TimePicker/index.js +29 -28
  78. package/Timeline/index.js +50 -47
  79. package/Title/index.js +32 -34
  80. package/ToggleButton/index.js +29 -29
  81. package/Tooltip/index.js +52 -56
  82. package/Transfer/index.js +117 -154
  83. package/Tree/index.js +9 -10
  84. package/Upload/index.js +125 -143
  85. package/Upload/interface.d.ts +2 -0
  86. package/_verture/{constant-0d9802f7.js → constant-5317fc89.js} +2 -2
  87. package/_verture/{index-5a7e2438.js → index-3cdaba96.js} +967 -934
  88. package/_verture/{index-b1f80962.js → index-4fafd0a0.js} +6 -8
  89. package/_verture/{index-024bbc9b.js → index-775ad32d.js} +29 -25
  90. package/_verture/{index-05f7bf11.js → index-c568f272.js} +2 -2
  91. package/_verture/{index-232d890b.js → index-d63bd287.js} +1 -1
  92. package/_verture/index-da9097d3.js +239 -0
  93. package/_verture/{index-9331b116.js → index-e0f9064d.js} +125 -134
  94. package/_verture/intl-f2f27722.js +69 -0
  95. package/_verture/{modalContext-736ff215.js → modalContext-8534f23d.js} +36 -64
  96. package/_verture/{slicedToArray-a8206399.js → slicedToArray-75fa4188.js} +15 -2
  97. package/_verture/{toConsumableArray-8f4c9589.js → toConsumableArray-c7a8028f.js} +1 -1
  98. package/_verture/{useFormatMessage-703f8b20.js → useFormatMessage-eb13cf56.js} +5 -4
  99. package/_verture/{useGlobalProps-1b846a65.js → useGlobalProps-1e416658.js} +4 -3
  100. package/_verture/{usePopupContainer-87febeb9.js → usePopupContainer-635f66f4.js} +16 -15
  101. package/_verture/{util-7e1fb1e2.js → util-82646c4f.js} +5 -4
  102. package/_verture/utils-c17b5265.js +97 -0
  103. package/index.js +24 -23
  104. package/locale/en-US.d.ts +1 -0
  105. package/locale/index.d.ts +2 -0
  106. package/locale/index.js +10 -8
  107. package/locale/zh-CN.d.ts +1 -0
  108. package/package.json +11 -10
  109. package/umd/AutoBox.js +9 -8
  110. package/umd/AutoTips.js +9 -8
  111. package/umd/Badge.js +1 -1
  112. package/umd/Breadcrumbs.js +9 -8
  113. package/umd/Button.js +9 -8
  114. package/umd/ButtonGroup.js +9 -8
  115. package/umd/Carousel.js +5 -5
  116. package/umd/Cascader.js +9 -8
  117. package/umd/Checkbox.js +9 -8
  118. package/umd/CheckboxGroup.js +9 -8
  119. package/umd/Collapse.js +8 -7
  120. package/umd/CollapseBox.js +1 -1
  121. package/umd/CollapseLayout.js +4 -4
  122. package/umd/ColorPicker.js +1 -1
  123. package/umd/ComboSelect.js +9 -8
  124. package/umd/Container.js +1 -1
  125. package/umd/CopyText.js +9 -8
  126. package/umd/DatePicker.js +9 -8
  127. package/umd/Descriptions.js +9 -8
  128. package/umd/Desktop.js +9 -8
  129. package/umd/DragVerify.js +4 -4
  130. package/umd/Drawer.js +9 -8
  131. package/umd/Dropdown.js +6 -5
  132. package/umd/DynamicMultiBox.js +11 -10
  133. package/umd/Empty.js +1 -1
  134. package/umd/Form.js +9 -8
  135. package/umd/FormItem.js +9 -8
  136. package/umd/FunctionModal.js +9 -8
  137. package/umd/GlobalContext.js +1 -1
  138. package/umd/Help.js +9 -8
  139. package/umd/HelperText.js +1 -1
  140. package/umd/InputLang.js +9 -8
  141. package/umd/InputNumber.js +9 -8
  142. package/umd/Label.js +9 -8
  143. package/umd/Loading.js +4 -4
  144. package/umd/Menu.js +4 -4
  145. package/umd/Message.js +4 -4
  146. package/umd/Modal.js +9 -8
  147. package/umd/MultiBox.js +9 -8
  148. package/umd/Notification.js +8 -7
  149. package/umd/OperateBtn.js +9 -8
  150. package/umd/PageHeader.js +9 -8
  151. package/umd/Pagination.js +9 -8
  152. package/umd/ParauiProvider.js +1 -1
  153. package/umd/PasswordRules.js +4 -4
  154. package/umd/PopConfirm.js +9 -8
  155. package/umd/Popover.js +9 -8
  156. package/umd/Progress.js +5 -5
  157. package/umd/Querying.js +1 -1
  158. package/umd/Radio.js +9 -8
  159. package/umd/RadioGroup.js +9 -8
  160. package/umd/Search.js +9 -8
  161. package/umd/Select.js +9 -8
  162. package/umd/SelectInput.js +9 -8
  163. package/umd/Selector.js +9 -8
  164. package/umd/SelectorPicker.js +9 -8
  165. package/umd/SingleBox.js +9 -8
  166. package/umd/Slider.js +6 -5
  167. package/umd/Status.js +4 -4
  168. package/umd/Stepper.js +9 -8
  169. package/umd/Switch.js +9 -8
  170. package/umd/Table.js +9 -8
  171. package/umd/Tabs.js +9 -8
  172. package/umd/Tag.js +9 -8
  173. package/umd/TextEditor.js +22 -21
  174. package/umd/TextField.js +9 -8
  175. package/umd/TimePicker.js +9 -8
  176. package/umd/Timeline.js +1 -1
  177. package/umd/Title.js +9 -8
  178. package/umd/ToggleButton.js +9 -8
  179. package/umd/Tooltip.js +9 -8
  180. package/umd/Transfer.js +10 -9
  181. package/umd/Tree.js +9 -8
  182. package/umd/Upload.js +10 -9
  183. package/umd/locale.js +1 -1
  184. package/_verture/index-e9007d6a.js +0 -236
  185. package/_verture/intl-5c1ec055.js +0 -81
  186. package/_verture/unsupportedIterableToArray-cb478f24.js +0 -16
  187. package/_verture/utils-418da0a4.js +0 -73
  188. /package/_verture/{typeof-c310ee4a.js → typeof-b240b062.js} +0 -0
package/Selector/index.js CHANGED
@@ -1,17 +1,16 @@
1
- import { _ as _toConsumableArray } from '../_verture/toConsumableArray-8f4c9589.js';
2
- import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
3
- import { r as regenerator } from '../_verture/index-232d890b.js';
4
1
  import { a as __awaiter, _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
5
2
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
6
3
  import { useState, useRef, useEffect, Fragment as Fragment$1 } from 'react';
4
+ import { _ as _slicedToArray } from '../_verture/slicedToArray-75fa4188.js';
5
+ import { r as regenerator } from '../_verture/index-d63bd287.js';
7
6
  import { Radio } from '../Radio/index.js';
8
7
  import { Checkbox } from '../Checkbox/index.js';
9
8
  import { Popover } from '../Popover/index.js';
10
9
  import AutoTips from '../AutoTips/index.js';
11
10
  import { Loading } from '../Loading/index.js';
12
11
  import CloseIcon from '@para-ui/icons/Close';
13
- import { $ as $prefixCls } from '../_verture/constant-0d9802f7.js';
14
- import { u as useFormatMessage } from '../_verture/useFormatMessage-703f8b20.js';
12
+ import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
13
+ import { u as useFormatMessage } from '../_verture/useFormatMessage-eb13cf56.js';
15
14
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
16
15
  import { Search } from '../Search/index.js';
17
16
  import { Breadcrumbs } from '../Breadcrumbs/index.js';
@@ -19,9 +18,8 @@ import Empty from '../Empty/index.js';
19
18
  import SearchIcon from '@para-ui/icons/Search';
20
19
  import Refresh from '@para-ui/icons/Refresh';
21
20
  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 '../_verture/typeof-c310ee4a.js';
21
+ import { u as useGlobalProps } from '../_verture/useGlobalProps-1e416658.js';
22
+ import '../_verture/typeof-b240b062.js';
25
23
  import '../Label/index.js';
26
24
  import '../Help/index.js';
27
25
  import '../Tooltip/index.js';
@@ -30,16 +28,15 @@ import 'rc-tooltip/lib/placements';
30
28
  import 'clsx';
31
29
  import '@para-ui/icons/Forbid';
32
30
  import '@para-ui/icons/Help';
33
- import '../_verture/usePopupContainer-87febeb9.js';
31
+ import '../_verture/usePopupContainer-635f66f4.js';
34
32
  import '@para-ui/icons/LoadingF';
35
33
  import '@para-ui/core/GlobalContext';
36
34
  import '../TextField/index.js';
37
- import '../_verture/typeof-adeedc13.js';
38
35
  import '@para-ui/icons/PreviewClose';
39
36
  import '@para-ui/icons/PreviewOpen';
40
37
  import '@para-ui/icons/CloseCircleF';
41
38
  import '../HelperText/index.js';
42
- import '../_verture/index-e9007d6a.js';
39
+ import '../_verture/index-da9097d3.js';
43
40
  import 'rc-dropdown';
44
41
  import 'dayjs';
45
42
  import '@para-ui/icons/More';
@@ -68,8 +65,8 @@ var zh = {
68
65
  };
69
66
 
70
67
  var localeJson = {
71
- zh: zh,
72
- en: en
68
+ zh,
69
+ en
73
70
  };
74
71
 
75
72
  var css_248z$3 = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-selector-node {\n display: flex;\n justify-content: space-between;\n align-items: center;\n cursor: pointer;\n}\n.paraui-v4-selector-node:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-selector-node > .selector-node-left {\n display: flex;\n align-items: center;\n flex: 1;\n overflow: hidden;\n padding-right: 10px;\n}\n.paraui-v4-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-v4-selector-node > .selector-node-left > .selector-node-radio .radio-box {\n top: 0;\n}\n.paraui-v4-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-v4-selector-node > .selector-node-left > .selector-node-check .checkbox-box {\n top: 0;\n}\n.paraui-v4-selector-node > .selector-node-left > .node-img {\n display: inline-block;\n width: 30px;\n height: 30px;\n margin-right: 8px;\n}\n.paraui-v4-selector-node > .selector-node-left > .node-img img {\n width: 30px;\n height: 30px;\n border-radius: 50%;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-branch {\n height: 30px;\n padding: 0 10px;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-branch.paraui-v4-selector-node-img {\n height: 44px;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-branch > .selector-node-left > .main-title {\n font-size: 14px;\n color: rgb(29, 33, 38);\n white-space: nowrap;\n height: 20px;\n line-height: 20px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-branch > .selector-node-left > .sub-title {\n margin-left: 8px;\n font-size: 14px;\n color: rgb(161, 168, 179);\n white-space: nowrap;\n height: 20px;\n line-height: 20px;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 30px;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-branch > .selector-node-left > .tag {\n margin-left: 8px;\n background-color: rgba(46, 101, 230, 0.1);\n color: rgb(46, 101, 230);\n border-radius: 2px;\n font-size: 12px;\n padding: 0px 6px;\n white-space: nowrap;\n height: 20px;\n line-height: 20px;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-leaf {\n padding: 0px 10px;\n height: 44px;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-leaf > .selector-node-left > .title-box {\n flex: 1;\n overflow: hidden;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-leaf > .selector-node-left > .title-box > .main-title-box {\n display: flex;\n align-items: center;\n white-space: nowrap;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-leaf > .selector-node-left > .title-box > .main-title-box > .main-title {\n font-size: 14px;\n color: rgb(29, 33, 38);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-leaf > .selector-node-left > .title-box > .main-title-box > .tag {\n margin-left: 8px;\n background-color: rgba(46, 101, 230, 0.1);\n color: rgb(46, 101, 230);\n border-radius: 2px;\n font-size: 12px;\n padding: 0px 6px;\n white-space: nowrap;\n height: 20px;\n line-height: 20px;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-leaf > .selector-node-left > .title-box > .sub-title {\n font-size: 12px;\n color: rgb(161, 168, 179);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.paraui-v4-selector-node > .selector-node-right {\n display: flex;\n align-items: center;\n height: 100%;\n}\n.paraui-v4-selector-node > .selector-node-right > .detail {\n font-size: 14px;\n color: rgb(46, 101, 230);\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-v4-selector-node > .selector-node-right > .detail:hover {\n background-color: rgba(212, 218, 227, 0.4);\n}\n.paraui-v4-selector-node > .selector-node-right > .line {\n border-left: 1px solid rgb(213, 224, 250);\n margin: 0 8px;\n content: \"\";\n display: inline-block;\n height: 12px;\n}\n.paraui-v4-selector-node > .selector-node-right > .lower-child {\n font-size: 14px;\n color: rgb(46, 101, 230);\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-v4-selector-node > .selector-node-right > .lower-child:hover {\n background-color: rgb(234, 236, 241);\n}\n.paraui-v4-selector-node > .selector-node-right > .close {\n display: flex;\n align-items: center;\n color: rgb(46, 101, 230);\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-v4-selector-node > .selector-node-right > .close:hover > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-selector-node > .selector-node-right > .close > svg {\n font-size: 16px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-edit > .selector-node-right > .detail, .paraui-v4-selector-node.paraui-v4-selector-node-edit > .selector-node-right > .lower-child {\n color: rgb(92, 101, 115);\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-edit > .selector-node-right > .detail:hover, .paraui-v4-selector-node.paraui-v4-selector-node-edit > .selector-node-right > .lower-child:hover {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-disabled {\n cursor: not-allowed;\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-disabled.paraui-v4-selector-node-branch > .selector-node-left > .main-title {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-disabled.paraui-v4-selector-node-leaf > .selector-node-left > .title-box > .main-title-box > .main-title {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-disabled > .selector-node-right > .lower-child {\n cursor: not-allowed;\n color: rgb(161, 168, 179);\n}\n.paraui-v4-selector-node.paraui-v4-selector-node-disabled-child > .selector-node-right > .lower-child {\n cursor: not-allowed;\n color: rgb(161, 168, 179);\n}\n\n.paraui-v4-selector-detail .selector-detail-popover-content.selector-detail-popover-content-loading {\n min-width: 100px;\n min-height: 50px;\n}";
@@ -332,63 +329,57 @@ var SelectorNode = function SelectorNode(props) {
332
329
  var css_248z$2 = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-selector-main {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n}\n.paraui-v4-selector-main > .selectot-main-search {\n margin-bottom: 16px;\n border-bottom: 1px solid rgb(234, 236, 241);\n}\n.paraui-v4-selector-main > .selectot-main-search .text-field-content {\n border: none;\n height: 32px;\n}\n.paraui-v4-selector-main > .selectot-main-search .text-field-content .text-field-content-within-input {\n height: 32px !important;\n}\n.paraui-v4-selector-main > .selectot-main-search .text-field-content .text-field-content-within-input .text-field-label-placeholder {\n line-height: 32px !important;\n}\n.paraui-v4-selector-main > .selector-main-box {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .nav-box {\n padding: 0 6px;\n margin-bottom: 4px;\n margin-top: 10px;\n line-height: 0;\n}\n.paraui-v4-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-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list {\n overflow-y: hidden;\n display: flex;\n flex-direction: column;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-all-check {\n position: relative;\n}\n.paraui-v4-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-v4-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-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content:before {\n content: \"\";\n position: absolute;\n height: 30px;\n width: 100%;\n pointer-events: none;\n top: 0;\n left: 0;\n z-index: 1;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-content:after {\n content: \"\";\n position: absolute;\n height: 30px;\n width: 100%;\n pointer-events: none;\n bottom: 0;\n left: 0;\n z-index: 1;\n}\n.paraui-v4-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-v4-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-v4-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-v4-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-v4-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-v4-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: 16px;\n margin-bottom: 4px;\n font-size: 14px;\n color: rgb(161, 168, 179);\n}\n.paraui-v4-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-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-more {\n padding: 0 10px;\n cursor: pointer;\n font-size: 14px;\n color: rgb(46, 101, 230);\n line-height: 30px;\n}\n.paraui-v4-selector-main > .selector-main-box > .selector-main-content > .selector-main-list > .selector-main-list-more:hover {\n color: rgb(87, 131, 235);\n}\n.paraui-v4-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-v4-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% - 30px);\n}\n.paraui-v4-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% - 30px);\n}\n.paraui-v4-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% - 30px - 30px);\n}\n.paraui-v4-selector-main.paraui-v4-selector-main-show-search > .selector-main-box {\n height: calc(100% - 49px);\n}\n.paraui-v4-selector-main.paraui-v4-selector-main-show-search > .selector-main-box > .selector-main-content.selector-main-list-box {\n display: none;\n}\n.paraui-v4-selector-main.paraui-v4-selector-main-search > .selector-main-box {\n height: calc(100% - 49px);\n}\n.paraui-v4-selector-main.paraui-v4-selector-main-search > .selector-main-box .selector-main-content .nav-box {\n margin-top: 0;\n}";
333
330
  styleInject(css_248z$2);
334
331
 
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({
332
+ const SelectorMainContent = props => {
333
+ const {
334
+ className,
335
+ value,
336
+ rowKey = 'key',
337
+ nodeMode = 'branch',
338
+ selectMode,
339
+ loadMore = false,
340
+ isAllCheck = false,
341
+ detail,
342
+ detailRender,
343
+ isLazy,
344
+ list,
345
+ groupType,
346
+ breadcrumbs,
347
+ breadcrumbsSeparator = '-',
348
+ breadcrumbsList = [],
349
+ fieldConfig,
350
+ disabled,
351
+ disabledChild,
352
+ emptyProps,
353
+ loading,
354
+ onClickBreadcrumbs,
355
+ onLevel,
356
+ onSelect,
357
+ onLoad,
358
+ onAllCheck
359
+ } = props;
360
+ const intl = useFormatMessage('Selector', localeJson);
361
+ const [listCom, setListCom] = useState({});
362
+ const constData = useRef({
372
363
  listTypeJson: {},
373
364
  fieldConfig: {},
374
365
  resizeTimer: null
375
366
  });
376
- var scrolltRef = useRef(null);
377
- var contentRef = useRef(null);
367
+ const scrolltRef = useRef(null);
368
+ const contentRef = useRef(null);
378
369
  constData.current.listTypeJson = ArrayToObject('value', groupType);
379
370
  constData.current.fieldConfig = fieldConfig || {};
380
- useEffect(function () {
371
+ useEffect(() => {
381
372
  changeResize();
382
- return function () {
373
+ return () => {
383
374
  clearTimeout(constData.current.resizeTimer);
384
375
  };
385
376
  }, []);
386
- useEffect(function () {
377
+ useEffect(() => {
387
378
  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;
379
+ const json = {};
380
+ for (let i = 0, l = list.length; i < l; i++) {
381
+ const item = list[i];
382
+ const type = item.type;
392
383
  if (!json[type]) json[type] = [];
393
384
  json[type].push(item);
394
385
  }
@@ -396,17 +387,17 @@ var SelectorMainContent = function SelectorMainContent(props) {
396
387
  }
397
388
  }, [list]);
398
389
  /** 屏幕发生改变 */
399
- var changeResize = function changeResize() {
390
+ const changeResize = () => {
400
391
  clearTimeout(constData.current.resizeTimer);
401
- constData.current.resizeTimer = setTimeout(function () {
392
+ constData.current.resizeTimer = setTimeout(() => {
402
393
  onScroll();
403
394
  }, 100);
404
395
  };
405
396
  /** 滚动 */
406
- var onScroll = function onScroll() {
397
+ const onScroll = () => {
407
398
  if (!contentRef.current || !scrolltRef.current) return;
408
- var scrollBox = scrolltRef.current;
409
- var contentBox = contentRef.current;
399
+ const scrollBox = scrolltRef.current;
400
+ const contentBox = contentRef.current;
410
401
  contentBox.classList.remove('selector-main-list-scroll-top', 'selector-main-list-scroll-bottom', 'selector-main-list-scroll-middle');
411
402
  if (scrollBox.scrollHeight <= scrollBox.clientHeight) return;
412
403
  // 滚动条初始化
@@ -423,17 +414,17 @@ var SelectorMainContent = function SelectorMainContent(props) {
423
414
  contentBox.classList.add('selector-main-list-scroll-middle');
424
415
  };
425
416
  /** 判断是否全选,半选 */
426
- var handAllCheckFunc = function handAllCheckFunc() {
427
- var json = {
417
+ const handAllCheckFunc = () => {
418
+ const json = {
428
419
  checked: false,
429
420
  indeterminate: false
430
421
  };
431
422
  // 不存在value, 没有数据, 全选没转态
432
423
  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);
424
+ for (let i = 0, l = list.length; i < l; i++) {
425
+ const item = list[i];
426
+ const key = item.key;
427
+ const disabledItem = handDisabled(item);
437
428
  if (disabledItem) {
438
429
  if (value[key]) json.checked = true;
439
430
  continue;
@@ -457,7 +448,7 @@ var SelectorMainContent = function SelectorMainContent(props) {
457
448
  return json;
458
449
  };
459
450
  /** 处理禁用状态 */
460
- var handDisabled = function handDisabled(item) {
451
+ const handDisabled = item => {
461
452
  if (disabled) {
462
453
  if (disabled === true) return true;
463
454
  if (disabled instanceof Array) {
@@ -470,7 +461,7 @@ var SelectorMainContent = function SelectorMainContent(props) {
470
461
  return false;
471
462
  };
472
463
  /** 处理禁用下级状态 */
473
- var handDisabledChild = function handDisabledChild(item) {
464
+ const handDisabledChild = item => {
474
465
  if (disabledChild) {
475
466
  if (disabledChild === true) return true;
476
467
  if (disabledChild instanceof Array) {
@@ -483,12 +474,12 @@ var SelectorMainContent = function SelectorMainContent(props) {
483
474
  return false;
484
475
  };
485
476
  /** 全选 */
486
- var handAllCheck = function handAllCheck() {
477
+ const handAllCheck = () => {
487
478
  // 只存在复选框模式
488
479
  if (!isAllCheck || selectMode !== 'check') return null;
489
- var checkJson = handAllCheckFunc();
490
- var onAllCheckCom = function onAllCheckCom() {
491
- var bol = true;
480
+ const checkJson = handAllCheckFunc();
481
+ const onAllCheckCom = () => {
482
+ let bol = true;
492
483
  if (checkJson.checked) bol = false;
493
484
  onAllCheck && onAllCheck(bol);
494
485
  };
@@ -505,11 +496,11 @@ var SelectorMainContent = function SelectorMainContent(props) {
505
496
  }));
506
497
  };
507
498
  /** 点击查看更多 */
508
- var clickLoad = function clickLoad() {
499
+ const clickLoad = () => {
509
500
  onLoad && onLoad();
510
501
  };
511
502
  /** 查看更多 */
512
- var handLoadMore = function handLoadMore() {
503
+ const handLoadMore = () => {
513
504
  if (!loadMore) return null;
514
505
  return jsx("div", Object.assign({
515
506
  className: "selector-main-list-more",
@@ -525,33 +516,29 @@ var SelectorMainContent = function SelectorMainContent(props) {
525
516
  }));
526
517
  };
527
518
  /** 判断是否选中 */
528
- var handCheck = function handCheck(item) {
529
- var bol = false;
519
+ const handCheck = item => {
520
+ let bol = false;
530
521
  if (value && value[item.key]) bol = true;
531
522
  return bol;
532
523
  };
533
524
  /** 处理每个节点的配置 */
534
- var handNodeConfig = function handNodeConfig(item) {
535
- var json = {
525
+ const handNodeConfig = item => {
526
+ const json = {
536
527
  useCase: 'view',
537
- detail: detail,
538
- nodeMode: nodeMode,
528
+ detail,
529
+ nodeMode,
539
530
  disabled: handDisabled(item),
540
531
  disabledChild: handDisabledChild(item),
541
- onLevel: function onLevel() {
542
- return _onLevel && _onLevel(item);
543
- },
544
- onSelect: function onSelect() {
545
- return _onSelect && _onSelect(item);
546
- },
532
+ onLevel: () => onLevel && onLevel(item),
533
+ onSelect: () => onSelect && onSelect(item),
547
534
  checked: handCheck(item)
548
535
  };
549
536
  /** 节点类型 */
550
537
  if (item.leaf !== undefined) json.nodeMode = item.leaf ? 'leaf' : 'branch';
551
538
  /** 渲染字段 */
552
- var arr = ['img', 'mainTitle', 'subTitle', 'tag', 'tagStyle'];
553
- for (var i = 0, l = arr.length; i < l; i++) {
554
- var key = arr[i];
539
+ const arr = ['img', 'mainTitle', 'subTitle', 'tag', 'tagStyle'];
540
+ for (let i = 0, l = arr.length; i < l; i++) {
541
+ const key = arr[i];
555
542
  json[key] = item[key];
556
543
  }
557
544
  /** 判断是否具有选择 */
@@ -565,7 +552,7 @@ var SelectorMainContent = function SelectorMainContent(props) {
565
552
  json.child = item.child;
566
553
  } else {
567
554
  // 全量数据
568
- var children = item.children || [];
555
+ const children = item.children || [];
569
556
  if (children && children.length > 0) {
570
557
  json.child = true;
571
558
  }
@@ -574,43 +561,29 @@ var SelectorMainContent = function SelectorMainContent(props) {
574
561
  }
575
562
  /** 详情render */
576
563
  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
- };
564
+ json.detailRender = () => __awaiter(void 0, void 0, void 0, function* () {
565
+ const Dom = yield detailRender(item, true);
566
+ return Dom;
567
+ });
595
568
  }
596
569
  if (item.detail !== undefined) json.detail = item.detail;
597
570
  return json;
598
571
  };
599
572
  /** 渲染list节点 */
600
- var handListNode = function handListNode(arr) {
601
- return arr === null || arr === void 0 ? void 0 : arr.map(function (item, index) {
573
+ const handListNode = arr => {
574
+ return arr === null || arr === void 0 ? void 0 : arr.map((item, index) => {
602
575
  return jsx(SelectorNode, Object.assign({}, handNodeConfig(item)), index);
603
576
  });
604
577
  };
605
578
  /** 处理节点dom */
606
- var handNode = function handNode() {
579
+ const handNode = () => {
607
580
  // 分组渲染
608
581
  if (groupType && groupType.length > 0) {
609
582
  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';
583
+ children: groupType.map((item, index) => {
584
+ const type = item.value;
585
+ const listData = listCom[type] || [];
586
+ let str = 'selector-group-title';
614
587
  if (index === 0) str += ' selector-group-title-first';
615
588
  return jsxs(Fragment$1, {
616
589
  children: [listData.length > 0 && jsx("div", Object.assign({
@@ -625,11 +598,11 @@ var SelectorMainContent = function SelectorMainContent(props) {
625
598
  return handListNode(list || []);
626
599
  };
627
600
  /** 点击面包屑 */
628
- var onClickBreadcrums = function onClickBreadcrums(item) {
601
+ const onClickBreadcrums = item => {
629
602
  onClickBreadcrumbs && onClickBreadcrumbs(item);
630
603
  };
631
604
  /** 面包屑dom */
632
- var handBreadcrumbs = function handBreadcrumbs() {
605
+ const handBreadcrumbs = () => {
633
606
  if (!breadcrumbs || breadcrumbsList.length === 0) return null;
634
607
  return jsx("div", Object.assign({
635
608
  className: "nav-box"
@@ -642,7 +615,7 @@ var SelectorMainContent = function SelectorMainContent(props) {
642
615
  }));
643
616
  };
644
617
  /** 处理内容 */
645
- var handContent = function handContent() {
618
+ const handContent = () => {
646
619
  if ((list === null || list === void 0 ? void 0 : list.length) === 0 && !loading) {
647
620
  // 空状态
648
621
  return jsx("div", Object.assign({
@@ -670,8 +643,8 @@ var SelectorMainContent = function SelectorMainContent(props) {
670
643
  })), handLoadMore()]
671
644
  }));
672
645
  };
673
- var handClass = function handClass() {
674
- var str = 'selector-main-content';
646
+ const handClass = () => {
647
+ let str = 'selector-main-content';
675
648
  if (className) str += " ".concat(className);
676
649
  if (disabled) str += ' selector-main-content-disabled';
677
650
  if (isAllCheck && selectMode === 'check') str += ' selector-main-content-all-check';
@@ -685,99 +658,87 @@ var SelectorMainContent = function SelectorMainContent(props) {
685
658
  children: [handBreadcrumbs(), handContent()]
686
659
  }));
687
660
  };
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({
661
+ const SelectorMain = props => {
662
+ const {
663
+ className,
664
+ style,
665
+ url,
666
+ value,
667
+ rowKey = 'key',
668
+ nodeMode = 'branch',
669
+ selectMode,
670
+ loadMore = false,
671
+ searchLoadMore = false,
672
+ isAllCheck = false,
673
+ disabled,
674
+ disabledChild,
675
+ detail,
676
+ detailRender,
677
+ isLazy,
678
+ list,
679
+ groupType,
680
+ groupRange,
681
+ search,
682
+ searchVal = '',
683
+ searchPlaceholder,
684
+ searchTrigger,
685
+ searchLoading,
686
+ searchList,
687
+ loading,
688
+ breadcrumbs,
689
+ breadcrumbsSeparator = '-',
690
+ breadcrumbsList = [],
691
+ fieldConfig,
692
+ onClickBreadcrumbs,
693
+ onLevel,
694
+ onSelect,
695
+ onLoad,
696
+ onAllCheck,
697
+ onSearch,
698
+ onRefresh
699
+ } = props;
700
+ const intl = useFormatMessage('Selector', localeJson);
701
+ const [showSearch, setShowSearch] = useState(false); // 显示搜索/
702
+ const [searchStr, setSearchStr] = useState('');
703
+ const constData = useRef({
743
704
  searchTimer: null,
744
705
  searchStr: ''
745
706
  });
746
- useEffect(function () {
707
+ useEffect(() => {
747
708
  if (!searchVal) return;
748
709
  constData.current.searchStr = searchVal.val;
749
710
  setSearchStr(searchVal.val);
750
711
  if (searchVal.val !== '') setShowSearch(true);
751
712
  }, [searchVal]);
752
713
  /** 改变搜索框 */
753
- var changeSearch = function changeSearch(val) {
714
+ const changeSearch = val => {
754
715
  setSearchStr(val);
755
716
  constData.current.searchStr = val;
756
717
  if (searchTrigger !== 'onEnter') onSearchCom();
757
718
  };
758
719
  /** 搜索框回车事件 */
759
- var onEnterSearch = function onEnterSearch() {
720
+ const onEnterSearch = () => {
760
721
  onSearchCom(true);
761
722
  };
762
723
  /** 点击搜索按钮 */
763
- var onClickRightIcon = function onClickRightIcon() {
724
+ const onClickRightIcon = () => {
764
725
  onSearchCom(true);
765
726
  };
766
727
  /** 点击清除按钮 */
767
- var onClear = function onClear() {
728
+ const onClear = () => {
768
729
  onSearchCom();
769
730
  };
770
731
  /** 向外抛出搜索事件 */
771
- var onSearchCom = function onSearchCom(bol) {
732
+ const onSearchCom = bol => {
772
733
  clearTimeout(constData.current.searchTimer);
773
- constData.current.searchTimer = setTimeout(function () {
734
+ constData.current.searchTimer = setTimeout(() => {
774
735
  setShowSearch(!!constData.current.searchStr);
775
736
  onSearch && onSearch(constData.current.searchStr, !!bol);
776
737
  }, 300);
777
738
  };
778
739
  /** 搜索dom */
779
- var handSearchDom = function handSearchDom() {
780
- var handSearchIcon = function handSearchIcon() {
740
+ const handSearchDom = () => {
741
+ const handSearchIcon = () => {
781
742
  if (!searchStr) {
782
743
  // 本地数据且没有自定义刷新事件
783
744
  if (!url && !onRefresh) {
@@ -808,27 +769,23 @@ var SelectorMain = function SelectorMain(props) {
808
769
  /** 点击下级
809
770
  * @param isSearch {boolean}
810
771
  * */
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
- };
772
+ const onLevelCom = isSearch => item => {
773
+ if (isSearch) {
774
+ constData.current.searchStr = '';
775
+ setSearchStr('');
776
+ setShowSearch(false);
777
+ }
778
+ onLevel && onLevel(item, isSearch);
820
779
  };
821
780
  /**
822
781
  * 加载更多
823
782
  * @param isSearch {boolean} 是否搜索
824
783
  * */
825
- var onLoadCom = function onLoadCom(isSearch) {
826
- return function () {
827
- onLoad && onLoad(isSearch);
828
- };
784
+ const onLoadCom = isSearch => () => {
785
+ onLoad && onLoad(isSearch);
829
786
  };
830
787
  /** 渲染列表 */
831
- var handListDom = function handListDom() {
788
+ const handListDom = () => {
832
789
  return jsx(SelectorMainContent, {
833
790
  className: "selector-main-list-box",
834
791
  value: value,
@@ -857,7 +814,7 @@ var SelectorMain = function SelectorMain(props) {
857
814
  }, "list");
858
815
  };
859
816
  /** 渲染搜索列表 */
860
- var handSearchList = function handSearchList() {
817
+ const handSearchList = () => {
861
818
  if (!showSearch) return;
862
819
  return jsx(SelectorMainContent, {
863
820
  className: 'selector-main-search-content',
@@ -882,14 +839,14 @@ var SelectorMain = function SelectorMain(props) {
882
839
  }, "search");
883
840
  };
884
841
  /** 处理loading */
885
- var handLoading = function handLoading() {
842
+ const handLoading = () => {
886
843
  if (searchLoading || loading) {
887
844
  return jsx(Loading, {});
888
845
  }
889
846
  };
890
847
  // 处理class
891
- var handClass = function handClass() {
892
- var str = "".concat($prefixCls, "-selector-main");
848
+ const handClass = () => {
849
+ let str = "".concat($prefixCls, "-selector-main");
893
850
  if (className) str += " ".concat(className);
894
851
  if (selectMode === 'check') str += " ".concat($prefixCls, "-selector-main-select");
895
852
  if (showSearch) str += " ".concat($prefixCls, "-selector-main-show-search");
@@ -912,40 +869,38 @@ var SelectorMain = function SelectorMain(props) {
912
869
  var css_248z$1 = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-selector-data.paraui-v4-selector-data-node > .selector-data-node-box {\n padding: 10px 0 10px 0;\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-node > .selector-data-node-box > .title {\n font-size: 14px;\n color: rgb(29, 33, 38);\n padding: 0 10px;\n margin-bottom: 10px;\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-node > .selector-data-node-box > .title > .title-content {\n margin-left: 8px;\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-node > .selector-data-node-box > .content {\n overflow-y: auto;\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-tag > .selector-data-tag-box {\n padding-top: 10px;\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-tag > .selector-data-tag-box > .title {\n font-size: 14px;\n color: rgb(29, 33, 38);\n padding: 0 10px;\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-tag > .selector-data-tag-box > .content {\n padding: 0 10px 10px 10px;\n overflow: auto;\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-tag > .selector-data-tag-box > .content > .content-tag {\n display: inline-flex;\n height: 24px;\n align-items: center;\n padding: 0 10px;\n border-radius: 4px;\n background-color: rgb(234, 236, 241);\n margin-right: 4px;\n margin-top: 4px;\n max-width: calc(100% - 8px);\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-tag > .selector-data-tag-box > .content > .content-tag > span {\n font-size: 14px;\n color: rgb(29, 33, 38);\n overflow: hidden;\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-tag > .selector-data-tag-box > .content > .content-tag > svg {\n font-size: 16px;\n margin-left: 4px;\n color: rgb(29, 33, 38);\n cursor: pointer;\n}\n.paraui-v4-selector-data.paraui-v4-selector-data-tag > .selector-data-tag-box > .content > .content-tag > svg:hover {\n color: rgb(46, 101, 230);\n}";
913
870
  styleInject(css_248z$1);
914
871
 
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({
872
+ const SelectorData = props => {
873
+ const {
874
+ className,
875
+ layout = 'node',
876
+ style,
877
+ list,
878
+ groupType,
879
+ nodeMode,
880
+ backDataFieldConfig,
881
+ detail,
882
+ detailRender,
883
+ disabled,
884
+ handSelectorNodeInfo,
885
+ selectDataTitleRender,
886
+ selectRenderItem,
887
+ selectRender,
888
+ onClose
889
+ } = props;
890
+ const intl = useFormatMessage('Selector', localeJson);
891
+ const [listCom, setListCom] = useState({});
892
+ const constData = useRef({
938
893
  listTypeJson: {},
939
894
  backDataFieldConfig: {}
940
895
  });
941
896
  constData.current.listTypeJson = ArrayToObject('value', groupType);
942
897
  constData.current.backDataFieldConfig = backDataFieldConfig || {};
943
- useEffect(function () {
898
+ useEffect(() => {
944
899
  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 || ''];
900
+ const json = {};
901
+ for (let i = 0, l = list.length; i < l; i++) {
902
+ const item = list[i];
903
+ const type = item[constData.current.backDataFieldConfig.type || ''];
949
904
  if (!json[type]) json[type] = [];
950
905
  json[type].push(item);
951
906
  }
@@ -953,12 +908,12 @@ var SelectorData = function SelectorData(props) {
953
908
  }
954
909
  }, [list]);
955
910
  /** 处理禁用 */
956
- var handDisabled = function handDisabled(itemConfig) {
911
+ const handDisabled = itemConfig => {
957
912
  if (disabled) {
958
913
  if (disabled === true) return true;
959
914
  if (disabled instanceof Array) {
960
- var keyStr = (backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.key) || '';
961
- var val = itemConfig[keyStr];
915
+ const keyStr = (backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.key) || '';
916
+ const val = itemConfig[keyStr];
962
917
  if (disabled.indexOf(val) !== -1) {
963
918
  return true;
964
919
  }
@@ -967,56 +922,40 @@ var SelectorData = function SelectorData(props) {
967
922
  return false;
968
923
  };
969
924
  /** 处理每个节点的配置 */
970
- var handNodeConfig = function handNodeConfig(itemConfig, index) {
971
- var item = itemConfig;
925
+ const handNodeConfig = (itemConfig, index) => {
926
+ let item = itemConfig;
972
927
  if (handSelectorNodeInfo) item = handSelectorNodeInfo(itemConfig);
973
- var disabledItem = handDisabled(itemConfig);
974
- var json = {
928
+ const disabledItem = handDisabled(itemConfig);
929
+ const json = {
975
930
  useCase: 'edit',
976
931
  close: !disabledItem,
977
- detail: detail,
932
+ detail,
978
933
  data: item,
979
- nodeMode: nodeMode,
980
- onClose: function onClose() {
981
- return _onClose && _onClose(item, index);
982
- },
934
+ nodeMode,
935
+ onClose: () => onClose && onClose(item, index),
983
936
  disabled: handDisabled(itemConfig),
984
937
  tagStyle: item.tagStyle
985
938
  };
986
939
  if (selectRenderItem) {
987
- json.leftRender = function () {
940
+ json.leftRender = () => {
988
941
  return selectRenderItem(itemConfig);
989
942
  };
990
943
  }
991
944
  /** 节点类型 */
992
945
  if (item.leaf !== undefined) json.nodeMode = item.leaf ? 'leaf' : 'branch';
993
946
  /** 渲染字段 */
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] || '';
947
+ const arr = ['img', 'mainTitle', 'subTitle', 'tag'];
948
+ for (let i = 0, l = arr.length; i < l; i++) {
949
+ const key = arr[i] || '';
950
+ const backName = backDataFieldConfig && backDataFieldConfig[key] || '';
998
951
  json[key] = item[backName];
999
952
  }
1000
953
  /** 详情render */
1001
954
  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
- };
955
+ json.detailRender = () => __awaiter(void 0, void 0, void 0, function* () {
956
+ const Dom = yield detailRender(item, false);
957
+ return Dom;
958
+ });
1020
959
  }
1021
960
  if (item.detail !== undefined) json.detail = item.detail;
1022
961
  /** 是否具有删除 */
@@ -1024,23 +963,23 @@ var SelectorData = function SelectorData(props) {
1024
963
  return json;
1025
964
  };
1026
965
  /** 处理节点 */
1027
- var handNode = function handNode() {
966
+ const handNode = () => {
1028
967
  if (selectRender) {
1029
968
  return selectRender(list || []);
1030
969
  }
1031
- return list === null || list === void 0 ? void 0 : list.map(function (item, index) {
970
+ return list === null || list === void 0 ? void 0 : list.map((item, index) => {
1032
971
  return jsx(SelectorNode, Object.assign({}, handNodeConfig(item, index)), index);
1033
972
  });
1034
973
  };
1035
974
  /** 处理标题 */
1036
- var handTitle = function handTitle() {
1037
- var handTitleTag = function handTitleTag() {
975
+ const handTitle = () => {
976
+ const handTitleTag = () => {
1038
977
  if (selectDataTitleRender) return selectDataTitleRender(list);
1039
978
  if (groupType) {
1040
979
  return jsx(Fragment, {
1041
- children: groupType.map(function (item, index) {
1042
- var num = 0;
1043
- var val = item.value;
980
+ children: groupType.map((item, index) => {
981
+ let num = 0;
982
+ const val = item.value;
1044
983
  if (listCom[val]) num = listCom[val].length;
1045
984
  if (num === 0) return;
1046
985
  return jsxs("span", Object.assign({
@@ -1065,7 +1004,7 @@ var SelectorData = function SelectorData(props) {
1065
1004
  }));
1066
1005
  };
1067
1006
  // 处理节点内容
1068
- var handContentNode = function handContentNode() {
1007
+ const handContentNode = () => {
1069
1008
  return jsxs("div", Object.assign({
1070
1009
  className: "selector-data-node-box"
1071
1010
  }, {
@@ -1077,13 +1016,13 @@ var SelectorData = function SelectorData(props) {
1077
1016
  }));
1078
1017
  };
1079
1018
  // 处理内容
1080
- var handDetailTagContent = function handDetailTagContent() {
1019
+ const handDetailTagContent = () => {
1081
1020
  if (selectRender) {
1082
1021
  return selectRender(list || []);
1083
1022
  }
1084
1023
  return jsx(Fragment, {
1085
- children: list === null || list === void 0 ? void 0 : list.map(function (item, index) {
1086
- var disabledItem = handDisabled(item);
1024
+ children: list === null || list === void 0 ? void 0 : list.map((item, index) => {
1025
+ const disabledItem = handDisabled(item);
1087
1026
  return jsxs("span", Object.assign({
1088
1027
  className: "content-tag"
1089
1028
  }, {
@@ -1092,16 +1031,14 @@ var SelectorData = function SelectorData(props) {
1092
1031
  children: item[(backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.mainTitle) || ''] || item[(backDataFieldConfig === null || backDataFieldConfig === void 0 ? void 0 : backDataFieldConfig.key) || '']
1093
1032
  })
1094
1033
  }), !disabledItem && jsx(CloseIcon, {
1095
- onClick: function onClick() {
1096
- return _onClose && _onClose(item, index);
1097
- }
1034
+ onClick: () => onClose && onClose(item, index)
1098
1035
  })]
1099
1036
  }), index);
1100
1037
  })
1101
1038
  });
1102
1039
  };
1103
1040
  // 处理tag内容
1104
- var handContentTag = function handContentTag() {
1041
+ const handContentTag = () => {
1105
1042
  return jsxs("div", Object.assign({
1106
1043
  className: "selector-data-tag-box"
1107
1044
  }, {
@@ -1112,8 +1049,8 @@ var SelectorData = function SelectorData(props) {
1112
1049
  }))]
1113
1050
  }));
1114
1051
  };
1115
- var handClass = function handClass() {
1116
- var str = "".concat($prefixCls, "-selector-data");
1052
+ const handClass = () => {
1053
+ let str = "".concat($prefixCls, "-selector-data");
1117
1054
  if (layout) str += " ".concat($prefixCls, "-selector-data-").concat(layout);
1118
1055
  if (disabled === true) str += " ".concat($prefixCls, "-selector-data-disabled");
1119
1056
  if (className) str += " ".concat(className);
@@ -1131,9 +1068,11 @@ var SelectorData = function SelectorData(props) {
1131
1068
  * 发送请求
1132
1069
  * @param obj {ReqFuncProps} 请求信息
1133
1070
  */
1134
- var reqFunc = function reqFunc(obj) {
1135
- var method = obj.method,
1136
- data = obj.data,
1071
+ const reqFunc = obj => {
1072
+ const {
1073
+ method,
1074
+ data
1075
+ } = obj,
1137
1076
  otherProps = __rest(obj, ["method", "data"]);
1138
1077
  if (method === 'Get') {
1139
1078
  return Get(Object.assign({
@@ -1142,7 +1081,7 @@ var reqFunc = function reqFunc(obj) {
1142
1081
  }
1143
1082
  if (method === 'Post') {
1144
1083
  return Post(Object.assign({
1145
- data: data
1084
+ data
1146
1085
  }, otherProps));
1147
1086
  }
1148
1087
  };
@@ -1150,8 +1089,8 @@ var reqFunc = function reqFunc(obj) {
1150
1089
  var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-selector {\n border: 1px solid rgb(212, 218, 227);\n border-radius: 4px;\n display: flex;\n height: 100%;\n width: 100%;\n overflow: hidden;\n}\n.paraui-v4-selector svg {\n overflow: hidden;\n}\n.paraui-v4-selector.paraui-v4-selector-lr > .paraui-v4-selector-main {\n width: 50%;\n}\n.paraui-v4-selector.paraui-v4-selector-lr > .paraui-v4-selector-data {\n width: 50%;\n border-left: 1px solid rgb(234, 236, 241);\n}\n.paraui-v4-selector.paraui-v4-selector-tb {\n flex-direction: column;\n}\n.paraui-v4-selector.paraui-v4-selector-tb > .paraui-v4-selector-data {\n border-bottom: 1px solid rgb(212, 218, 227);\n max-height: 100px;\n}\n.paraui-v4-selector.paraui-v4-selector-tb > .paraui-v4-selector-main {\n overflow-y: auto;\n height: auto;\n flex: 1;\n}";
1151
1090
  styleInject(css_248z);
1152
1091
 
1153
- var handFieldConfig = function handFieldConfig(fieldConfig, rowKey) {
1154
- var json = Object.assign({
1092
+ const handFieldConfig = (fieldConfig, rowKey) => {
1093
+ const json = Object.assign({
1155
1094
  mainTitle: 'label',
1156
1095
  children: 'children',
1157
1096
  parentId: 'parentId',
@@ -1160,108 +1099,64 @@ var handFieldConfig = function handFieldConfig(fieldConfig, rowKey) {
1160
1099
  }, fieldConfig);
1161
1100
  return json;
1162
1101
  };
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({
1102
+ const Selector = props => {
1103
+ const {
1104
+ className,
1105
+ style,
1106
+ rowKey = 'key',
1107
+ layout = 'lr',
1108
+ nodeMode = 'branch',
1109
+ selectMode,
1110
+ refresh,
1111
+ ctx,
1112
+ url,
1113
+ method = 'Get',
1114
+ value,
1115
+ defaultValue,
1116
+ data,
1117
+ pagination = false,
1118
+ size = 10,
1119
+ isLazy = false,
1120
+ isAllCheck = true,
1121
+ disabled,
1122
+ disabledChild,
1123
+ detail,
1124
+ detailRender,
1125
+ backDataFieldConfig,
1126
+ search,
1127
+ searchPlaceholder,
1128
+ searchTrigger = 'onChange',
1129
+ breadcrumbs = true,
1130
+ breadcrumbsSeparator,
1131
+ breadcrumbsHead,
1132
+ showbreadcrumbsHead = true,
1133
+ groupType,
1134
+ groupRange = 'search',
1135
+ emptyProps,
1136
+ selectRenderItem,
1137
+ selectRender,
1138
+ onChange,
1139
+ onSelect,
1140
+ onSearch,
1141
+ onRefresh
1142
+ } = useGlobalProps(props, 'Selector');
1143
+ const intl = useFormatMessage('Selector', localeJson);
1144
+ const fieldConfigHand = handFieldConfig(props.fieldConfig, rowKey); // 字段配置,对应数据字段
1145
+ const selectorFieldConfigHand = Object.assign(Object.assign({}, fieldConfigHand), backDataFieldConfig); // 选中值字段配置,对应数据字段
1146
+ const [currentData, setCurrentData] = useState([]); // 当前展示的数据
1147
+ const [loadMore, setLoadMore] = useState(false); // 加载更多
1148
+ const [valueCom, setValueCom] = useState([]); // 绑定的值
1149
+ const [valueJsonCom, setValueJsonCom] = useState({}); // 绑定的值,json
1150
+ const [breadcrumbsList, setBreadcrumbsList] = useState([]); // 面包屑
1151
+ const [searchLoading, setSearchLoading] = useState(false); // 搜索loading
1152
+ const [searchVal, setSearchVal] = useState({
1153
+ val: ''
1154
+ }); // 搜索值
1155
+ const [searchList, setSearchList] = useState([]); // 搜索数据
1156
+ const [searchLoadMore, setSearchLoadMore] = useState(false); // 是否显示搜索的加载更多按钮
1157
+ const [loadingCom, setLoadingCom] = useState(true);
1158
+ const [refreshCom, setRefreshCom] = useState();
1159
+ const constData = useRef({
1265
1160
  /** 对象集合 所有的 */
1266
1161
  jsonData: {},
1267
1162
  /** 浅拷贝对象 所有的 */
@@ -1305,43 +1200,43 @@ var Selector = function Selector(props) {
1305
1200
  constData.current.reqParams.pagination = pagination;
1306
1201
  constData.current.reqParams.isLazy = isLazy;
1307
1202
  // 本地数据 有接口的全量数据 -> 走本地数据逻辑
1308
- var isReqLocalData = props.data || !constData.current.reqParams.isLazy && constData.current.noLazyReq;
1309
- useEffect(function () {
1203
+ const isReqLocalData = props.data || !constData.current.reqParams.isLazy && constData.current.noLazyReq;
1204
+ useEffect(() => {
1310
1205
  if (defaultValue !== undefined) handValue(defaultValue);
1311
- return function () {
1206
+ return () => {
1312
1207
  clearTimeout(constData.current.reqTimer);
1313
1208
  };
1314
1209
  }, []);
1315
- useEffect(function () {
1210
+ useEffect(() => {
1316
1211
  if (value !== undefined) handValue(value);
1317
1212
  }, [value]);
1318
1213
  // 处理源数据
1319
- useEffect(function () {
1214
+ useEffect(() => {
1320
1215
  if (data) {
1321
- var treeData = convertTree(data, false);
1216
+ const treeData = convertTree(data, false);
1322
1217
  constData.current.oneDataList = treeData;
1323
1218
  constData.current.currentSourceData = treeData;
1324
1219
  setBreadcrumbsList([]);
1325
1220
  handInitCurrent();
1326
1221
  }
1327
1222
  }, [data]);
1328
- useEffect(function () {
1223
+ useEffect(() => {
1329
1224
  if (url) {
1330
1225
  setBreadcrumbsList([]);
1331
1226
  handInitCurrent();
1332
1227
  }
1333
1228
  }, [url]);
1334
1229
  // 请求数据
1335
- useEffect(function () {
1230
+ useEffect(() => {
1336
1231
  clearTimeout(constData.current.reqTimer);
1337
1232
  if (props.url) Cancel(constData.current.reqId);
1338
- constData.current.reqTimer = setTimeout(function () {
1233
+ constData.current.reqTimer = setTimeout(() => {
1339
1234
  // 本地数据 不是懒加载的全量接口数据
1340
1235
  if (isReqLocalData) {
1341
- var currentSourceData = constData.current.currentSourceData;
1236
+ const currentSourceData = constData.current.currentSourceData;
1342
1237
  if (constData.current.reqParams.pagination) {
1343
1238
  // 分页
1344
- var sliceData = currentSourceData.slice(0, constData.current.page * constData.current.reqParams.size);
1239
+ const sliceData = currentSourceData.slice(0, constData.current.page * constData.current.reqParams.size);
1345
1240
  setCurrentData(sliceData);
1346
1241
  // 没有加载更多
1347
1242
  if (constData.current.page * constData.current.reqParams.size >= currentSourceData.length) {
@@ -1357,10 +1252,10 @@ var Selector = function Selector(props) {
1357
1252
  }
1358
1253
  // 远程数据
1359
1254
  if (props.url) {
1360
- var obj = {
1361
- method: method,
1255
+ const obj = {
1256
+ method,
1362
1257
  url: props.url,
1363
- ctx: ctx,
1258
+ ctx,
1364
1259
  uuid: constData.current.reqId,
1365
1260
  data: Object.assign({
1366
1261
  parentId: handParentId()
@@ -1381,11 +1276,11 @@ var Selector = function Selector(props) {
1381
1276
  }
1382
1277
  }, 50);
1383
1278
  }, [refreshCom]);
1384
- useEffect(function () {
1279
+ useEffect(() => {
1385
1280
  if (refresh) refreshFunc();
1386
1281
  }, [refresh]);
1387
1282
  /** 刷新 */
1388
- var refreshFunc = function refreshFunc() {
1283
+ const refreshFunc = () => {
1389
1284
  if (!isReqLocalData) {
1390
1285
  constData.current.currentSourceData = [];
1391
1286
  }
@@ -1396,8 +1291,8 @@ var Selector = function Selector(props) {
1396
1291
  * @param item 节点数据
1397
1292
  * @param bol 是否是搜索
1398
1293
  * */
1399
- var handNodeData = function handNodeData(item, bol) {
1400
- var itemData = {
1294
+ const handNodeData = (item, bol) => {
1295
+ let itemData = {
1401
1296
  key: item[rowKey],
1402
1297
  parentId: item[fieldConfigHand.parentId],
1403
1298
  type: item[fieldConfigHand.type],
@@ -1424,17 +1319,17 @@ var Selector = function Selector(props) {
1424
1319
  * @param notTree true不生成树
1425
1320
  * @param isSearch 是否搜索
1426
1321
  * */
1427
- var convertTree = function convertTree(arr, notTree, isSearch) {
1428
- var handArr = [];
1429
- var json = {};
1322
+ const convertTree = (arr, notTree, isSearch) => {
1323
+ const handArr = [];
1324
+ const json = {};
1430
1325
  // 生成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);
1326
+ const recurrence = list => {
1327
+ for (let i = 0, l = list.length; i < l; i++) {
1328
+ const item = list[i];
1329
+ const keyStr = item[rowKey];
1330
+ const itemData = handNodeData(item, !!isSearch);
1436
1331
  json[keyStr] = itemData;
1437
- var childrenName = fieldConfigHand.children;
1332
+ const childrenName = fieldConfigHand.children;
1438
1333
  constData.current.jsonDataCopy[keyStr] = item; // 原始数据
1439
1334
  constData.current.jsonData[keyStr] = itemData; // 处理过的数据
1440
1335
  if (item[childrenName]) {
@@ -1444,11 +1339,11 @@ var Selector = function Selector(props) {
1444
1339
  };
1445
1340
  recurrence(arr);
1446
1341
  // 生成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 || '';
1342
+ const arrKey = Object.keys(json);
1343
+ for (let i = 0, l = arrKey.length; i < l; i++) {
1344
+ const keyStr = arrKey[i];
1345
+ const item = json[keyStr];
1346
+ const parentId = item.parentId || '';
1452
1347
  if (notTree) {
1453
1348
  handArr.push(item);
1454
1349
  continue;
@@ -1463,12 +1358,12 @@ var Selector = function Selector(props) {
1463
1358
  return handArr;
1464
1359
  };
1465
1360
  /** 处理parentId */
1466
- var handParentId = function handParentId() {
1467
- var parentId;
1361
+ const handParentId = () => {
1362
+ let parentId;
1468
1363
  // 面包屑最后一项做parent
1469
1364
  if (constData.current.breadcrumbsList.length > 0) {
1470
1365
  // 包含了根,所以要多加1
1471
- var item = constData.current.breadcrumbsList[constData.current.breadcrumbsList.length - 1];
1366
+ const item = constData.current.breadcrumbsList[constData.current.breadcrumbsList.length - 1];
1472
1367
  parentId = item.value;
1473
1368
  } else {
1474
1369
  if (props.breadcrumbsHead) parentId = props.breadcrumbsHead.value; // 根
@@ -1478,67 +1373,47 @@ var Selector = function Selector(props) {
1478
1373
  parentId = undefined;
1479
1374
  if (props.breadcrumbsHead) parentId = props.breadcrumbsHead.value; // 根
1480
1375
  }
1481
-
1482
1376
  return parentId;
1483
1377
  };
1484
1378
  /** 请求 */
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();
1379
+ const handReq = obj => __awaiter(void 0, void 0, void 0, function* () {
1380
+ setLoadingCom(true);
1381
+ const {
1382
+ data,
1383
+ err
1384
+ } = yield reqFunc(obj);
1385
+ if (err) {
1386
+ setLoadingCom(false);
1387
+ if (constData.current.reqParams.isLazy) {
1388
+ // 懒加载
1389
+ if (constData.current.reqParams.pagination) {
1390
+ // 分页 第一页不处理
1391
+ if (constData.current.page !== 1) constData.current.page = constData.current.page - 1;
1527
1392
  }
1528
- }, _callee);
1529
- }));
1530
- };
1393
+ }
1394
+ return;
1395
+ }
1396
+ if (props.requestCallback) {
1397
+ props.requestCallback(data, handData => {
1398
+ setLoadingCom(false);
1399
+ handReqData(handData);
1400
+ });
1401
+ return;
1402
+ }
1403
+ setLoadingCom(false);
1404
+ handReqData(data);
1405
+ });
1531
1406
  /** 接口回来处理数据 */
1532
- var handReqData = function handReqData(resultData) {
1407
+ const handReqData = resultData => {
1533
1408
  if (constData.current.reqParams.isLazy) {
1534
1409
  // 懒加载
1535
1410
  if (constData.current.reqParams.pagination) {
1536
1411
  // 分页
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));
1412
+ const result = resultData.data || {};
1413
+ const arr = result.list || [];
1414
+ const total = result.total;
1415
+ const arrHand = convertTree(arr, true);
1416
+ const currentD = [...constData.current.currentSourceData, ...arrHand];
1542
1417
  constData.current.currentSourceData = currentD;
1543
1418
  setCurrentData(currentD);
1544
1419
  if (constData.current.page * constData.current.reqParams.size >= total) {
@@ -1548,45 +1423,45 @@ var Selector = function Selector(props) {
1548
1423
  }
1549
1424
  } else {
1550
1425
  // 不分页 必须返回平铺的数组
1551
- var _arr = resultData.data || [];
1552
- var treeData = convertTree(_arr, true);
1426
+ const arr = resultData.data || [];
1427
+ const treeData = convertTree(arr, true);
1553
1428
  constData.current.currentSourceData = treeData;
1554
1429
  setCurrentData(treeData);
1555
1430
  }
1556
1431
  } else {
1557
1432
  // 不是懒加载 只请求一次
1558
1433
  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;
1434
+ const arr = resultData.data || [];
1435
+ const treeData = convertTree(arr, false);
1436
+ constData.current.oneDataList = treeData; // 第一层数据
1437
+ constData.current.currentSourceData = treeData;
1563
1438
  handInitCurrent();
1564
1439
  }
1565
1440
  };
1566
1441
  /** 当前页初始更新 */
1567
- var handInitCurrent = function handInitCurrent() {
1442
+ const handInitCurrent = () => {
1568
1443
  constData.current.page = 1;
1569
1444
  setRefreshCom(Math.random());
1570
1445
  };
1571
1446
  /** 处理value */
1572
- var handValue = function handValue(val) {
1573
- var handVal = !val ? [] : [val];
1447
+ const handValue = val => {
1448
+ let handVal = !val ? [] : [val];
1574
1449
  if (val instanceof Array) {
1575
- handVal = _toConsumableArray(val);
1450
+ handVal = [...val];
1576
1451
  }
1577
- var json = ArrayToObject(selectorFieldConfigHand.key, handVal);
1452
+ const json = ArrayToObject(selectorFieldConfigHand.key, handVal);
1578
1453
  constData.current.selectValueJson = json;
1579
1454
  setValueJsonCom(json);
1580
- setValueCom(_toConsumableArray(handVal));
1455
+ setValueCom([...handVal]);
1581
1456
  };
1582
1457
  /** 点击下级,添加面包屑 */
1583
- var onLevelAddBreadcrumbs = function onLevelAddBreadcrumbs(item, isSearch) {
1584
- var arr = _toConsumableArray(breadcrumbsList);
1458
+ const onLevelAddBreadcrumbs = (item, isSearch) => {
1459
+ let arr = [...breadcrumbsList];
1585
1460
  if (isSearch) {
1586
1461
  arr = [];
1587
1462
  if (constData.current.beforeSearchBreadcrumbs === null) {
1588
1463
  // 记录搜索之前的面包屑
1589
- constData.current.beforeSearchBreadcrumbs = _toConsumableArray(breadcrumbsList);
1464
+ constData.current.beforeSearchBreadcrumbs = [...breadcrumbsList];
1590
1465
  }
1591
1466
  }
1592
1467
  arr.push({
@@ -1596,7 +1471,7 @@ var Selector = function Selector(props) {
1596
1471
  setBreadcrumbsList(arr);
1597
1472
  };
1598
1473
  /** 点击下级 */
1599
- var onLevelCom = function onLevelCom(item, isSearch) {
1474
+ const onLevelCom = (item, isSearch) => {
1600
1475
  onLevelAddBreadcrumbs(item, isSearch);
1601
1476
  if (isReqLocalData) {
1602
1477
  // 本地数据
@@ -1615,15 +1490,15 @@ var Selector = function Selector(props) {
1615
1490
  }
1616
1491
  };
1617
1492
  /** 处理抛出去的数据 */
1618
- var handEmitValue = function handEmitValue(item) {
1619
- var arr = ['key', 'img', 'mainTitle', 'subTitle', 'tag'];
1493
+ const handEmitValue = item => {
1494
+ const arr = ['key', 'img', 'mainTitle', 'subTitle', 'tag'];
1620
1495
  if (props.groupType && props.groupType.length > 0) {
1621
1496
  arr.push('type');
1622
1497
  }
1623
- var json = {};
1624
- for (var i = 0, l = arr.length; i < l; i++) {
1625
- var arrItem = arr[i];
1626
- var name = selectorFieldConfigHand[arrItem];
1498
+ const json = {};
1499
+ for (let i = 0, l = arr.length; i < l; i++) {
1500
+ const arrItem = arr[i];
1501
+ const name = selectorFieldConfigHand[arrItem];
1627
1502
  if (name) json[name] = item[arrItem];
1628
1503
  }
1629
1504
  return json;
@@ -1635,81 +1510,57 @@ var Selector = function Selector(props) {
1635
1510
  * @param node 处理过的节点数据
1636
1511
  * @param rowData 原始数据节点
1637
1512
  * */
1638
- var onChangeEmit = function onChangeEmit(val, valCom, node, rowData) {
1513
+ const onChangeEmit = (val, valCom, node, rowData) => {
1639
1514
  onChange && onChange(val, node, rowData);
1640
1515
  if (value == undefined) {
1641
1516
  handValue(!val ? [] : val);
1642
1517
  }
1643
1518
  };
1644
1519
  /** 选择数据 */
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();
1520
+ const onSelectCom = item => __awaiter(void 0, void 0, void 0, function* () {
1521
+ const keyStr = item.key || ''; // key
1522
+ // 单选且选中,点击不触发
1523
+ if (selectMode === 'radio' && valueJsonCom[keyStr]) return;
1524
+ const selectVal = constData.current.selectValueJson[keyStr]; // 存在选中值当中 -> 选中变不选中
1525
+ if (onSelect) {
1526
+ // 有外部选择事件, 且返回true,不触发onChange事件
1527
+ const bol = yield onSelect(item, selectMode === 'radio' ? true : !selectVal, false);
1528
+ if (bol) return;
1529
+ }
1530
+ // 单选
1531
+ if (selectMode === 'radio') {
1532
+ const json = handEmitValue(item);
1533
+ onChangeEmit(json, [json], constData.current.jsonData[keyStr], constData.current.jsonDataCopy[keyStr]);
1534
+ }
1535
+ // 多选
1536
+ if (selectMode === 'check') {
1537
+ const arr = [];
1538
+ const node = {}; // 处理过得数据
1539
+ const rowData = {}; // 原始数据
1540
+ // 把即将不选中的值,从valueCom里面拿掉
1541
+ for (let i = 0, l = valueCom.length; i < l; i++) {
1542
+ const valueComItem = valueCom[i];
1543
+ // 选中valueCom都保留
1544
+ // 不选中 保留valueCom里面的key不等于当前的key
1545
+ if (!selectVal || item.key !== valueComItem[selectorFieldConfigHand.key]) {
1546
+ const valueComItemId = valueComItem[selectorFieldConfigHand.key];
1547
+ node[valueComItemId] = constData.current.jsonData[valueComItemId];
1548
+ rowData[valueComItemId] = constData.current.jsonDataCopy[valueComItemId];
1549
+ arr.push(valueComItem);
1707
1550
  }
1708
- }, _callee2);
1709
- }));
1710
- };
1551
+ }
1552
+ // 不选中 -> 选中
1553
+ if (!selectVal) {
1554
+ const json = handEmitValue(item);
1555
+ node[keyStr] = constData.current.jsonData[keyStr];
1556
+ rowData[keyStr] = constData.current.jsonDataCopy[keyStr];
1557
+ arr.push(json);
1558
+ }
1559
+ onChangeEmit(arr, arr, node, rowData);
1560
+ }
1561
+ });
1711
1562
  /** 处理禁用状态 */
1712
- var handDisabled = function handDisabled(item) {
1563
+ const handDisabled = item => {
1713
1564
  if (disabled) {
1714
1565
  if (disabled === true) return true;
1715
1566
  if (disabled instanceof Array) {
@@ -1725,97 +1576,63 @@ var Selector = function Selector(props) {
1725
1576
  * 点击全选
1726
1577
  * @param bol true全选
1727
1578
  * */
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();
1579
+ const onAllCheckCom = bol => __awaiter(void 0, void 0, void 0, function* () {
1580
+ const arrList = [...currentData]; // 当前列的数据
1581
+ const arrVal = [...valueCom]; // 全选 绑定的值
1582
+ const arrval1 = []; // 全不选 绑定的值
1583
+ const node = {}; // 处理过得数据
1584
+ const rowData = {}; // 原始数据
1585
+ const selectArr = []; // 全不选 - 当前列选中值
1586
+ const selectEmitData = []; // 选择事件抛出去的值
1587
+ // 循环当前列数据
1588
+ for (let i = 0, l = arrList.length; i < l; i++) {
1589
+ const item = arrList[i];
1590
+ const keyStr = item.key || '';
1591
+ const disabledItem = handDisabled(item);
1592
+ if (disabledItem) continue;
1593
+ if (bol) {
1594
+ // 全选
1595
+ if (!constData.current.selectValueJson[keyStr]) {
1596
+ // 不存在选中值中
1597
+ arrVal.push(handEmitValue(item));
1598
+ selectEmitData.push(item);
1813
1599
  }
1814
- }, _callee3);
1815
- }));
1816
- };
1600
+ } else {
1601
+ // 全不选
1602
+ if (constData.current.selectValueJson[keyStr]) {
1603
+ // 存在选中值中,拿掉
1604
+ selectArr.push(keyStr);
1605
+ selectEmitData.push(item);
1606
+ }
1607
+ }
1608
+ }
1609
+ for (let i = 0, l = arrVal.length; i < l; i++) {
1610
+ const item = arrVal[i];
1611
+ const keyStr = item[selectorFieldConfigHand.key];
1612
+ if (bol) {
1613
+ // 全选
1614
+ node[keyStr] = constData.current.jsonData[keyStr];
1615
+ rowData[keyStr] = constData.current.jsonDataCopy[keyStr];
1616
+ } else {
1617
+ // 全不选
1618
+ if (selectArr.indexOf(keyStr) === -1) {
1619
+ // 不存在 全不选 - 当前列选中值
1620
+ node[keyStr] = constData.current.jsonData[keyStr];
1621
+ rowData[keyStr] = constData.current.jsonDataCopy[keyStr];
1622
+ arrval1.push(item);
1623
+ }
1624
+ }
1625
+ }
1626
+ const emitArr = bol ? arrVal : arrval1;
1627
+ if (onSelect) {
1628
+ // 有外部选择事件, 且返回true,不触发onChange事件
1629
+ const flag = yield onSelect(selectEmitData, !!bol, false);
1630
+ if (flag) return;
1631
+ }
1632
+ onChangeEmit(emitArr, emitArr, node, rowData);
1633
+ });
1817
1634
  /** 点击查看更多 */
1818
- var onLoadCom = function onLoadCom(isSearch) {
1635
+ const onLoadCom = isSearch => {
1819
1636
  if (isSearch) {
1820
1637
  // 搜索
1821
1638
  constData.current.searchConfig.page = constData.current.searchConfig.page + 1;
@@ -1826,10 +1643,10 @@ var Selector = function Selector(props) {
1826
1643
  setRefreshCom(Math.random());
1827
1644
  };
1828
1645
  /** 处理面包屑数组 */
1829
- var handBreadcrumbsList = function handBreadcrumbsList() {
1830
- var arr = _toConsumableArray(breadcrumbsList);
1646
+ const handBreadcrumbsList = () => {
1647
+ const arr = [...breadcrumbsList];
1831
1648
  // 根路径
1832
- var oneItem = breadcrumbsHead || {
1649
+ const oneItem = breadcrumbsHead || {
1833
1650
  label: intl({
1834
1651
  id: 'root'
1835
1652
  }),
@@ -1849,10 +1666,10 @@ var Selector = function Selector(props) {
1849
1666
  return arr;
1850
1667
  };
1851
1668
  /** 截取面包屑数据 */
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];
1669
+ const spliceBreadcrumbs = item => {
1670
+ const arr = [];
1671
+ for (let i = 0, l = breadcrumbsList.length; i < l; i++) {
1672
+ const itemB = breadcrumbsList[i];
1856
1673
  arr.push(itemB);
1857
1674
  if (itemB.value === item.value) {
1858
1675
  break;
@@ -1861,20 +1678,20 @@ var Selector = function Selector(props) {
1861
1678
  return arr;
1862
1679
  };
1863
1680
  /** 点击面包屑 */
1864
- var onClickBreadcrumbsCom = function onClickBreadcrumbsCom(item) {
1865
- var list = constData.current.breadcrumbsList;
1681
+ const onClickBreadcrumbsCom = item => {
1682
+ const list = constData.current.breadcrumbsList;
1866
1683
  // 点击最后一层,不触发数据变更
1867
1684
  if (list.length === 0 || item.value === list[list.length - 1].value) {
1868
1685
  return;
1869
1686
  }
1870
- var keyStr = item.value || '';
1871
- var oneValue = breadcrumbsHead ? breadcrumbsHead.value : '_paraui_first_floor';
1687
+ const keyStr = item.value || '';
1688
+ const oneValue = breadcrumbsHead ? breadcrumbsHead.value : '_paraui_first_floor';
1872
1689
  // 点击搜索结果,显示上一次的搜索
1873
1690
  if (item.value === '_paraui_search') {
1874
1691
  setSearchVal({
1875
1692
  val: constData.current.searchVal
1876
1693
  });
1877
- setBreadcrumbsList(_toConsumableArray(constData.current.beforeSearchBreadcrumbs || []));
1694
+ setBreadcrumbsList([...(constData.current.beforeSearchBreadcrumbs || [])]);
1878
1695
  return;
1879
1696
  }
1880
1697
  // 点击根路径且具有搜索面包屑
@@ -1898,10 +1715,10 @@ var Selector = function Selector(props) {
1898
1715
  if (isReqLocalData) {
1899
1716
  if (keyStr === oneValue) {
1900
1717
  // 第一层
1901
- constData.current.currentSourceData = _toConsumableArray(constData.current.oneDataList);
1718
+ constData.current.currentSourceData = [...constData.current.oneDataList];
1902
1719
  } else {
1903
1720
  // 除了第一级,最后一级
1904
- var itemData = constData.current.jsonData[keyStr];
1721
+ const itemData = constData.current.jsonData[keyStr];
1905
1722
  constData.current.currentSourceData = itemData[fieldConfigHand.children];
1906
1723
  }
1907
1724
  } else {
@@ -1917,15 +1734,15 @@ var Selector = function Selector(props) {
1917
1734
  handInitCurrent();
1918
1735
  };
1919
1736
  /** 处理搜索的请求 */
1920
- var handSearchData = function handSearchData(resultData) {
1921
- var isTree = resultData.isTree;
1737
+ const handSearchData = resultData => {
1738
+ const isTree = resultData.isTree;
1922
1739
  if (constData.current.reqParams.pagination) {
1923
1740
  // 分页
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));
1741
+ const result = resultData.data || {};
1742
+ const arr = result.list || [];
1743
+ const total = result.total;
1744
+ const arrHand = convertTree(arr, !isTree, true); // 搜索默认不生成树
1745
+ const currentD = [...constData.current.searchConfig.currentSourceData, ...arrHand];
1929
1746
  constData.current.searchConfig.currentSourceData = currentD;
1930
1747
  setSearchList(currentD);
1931
1748
  if (constData.current.searchConfig.page * constData.current.searchConfig.size >= total) {
@@ -1935,16 +1752,18 @@ var Selector = function Selector(props) {
1935
1752
  }
1936
1753
  } else {
1937
1754
  // 不分页 必须返回平铺的数组
1938
- var _arr3 = resultData.data || [];
1939
- var treeData = convertTree(_arr3, !isTree, true); // 搜索默认不生成树
1755
+ const arr = resultData.data || [];
1756
+ const treeData = convertTree(arr, !isTree, true); // 搜索默认不生成树
1940
1757
  constData.current.searchConfig.currentSourceData = treeData;
1941
1758
  setSearchList(treeData);
1942
1759
  }
1943
1760
  };
1944
1761
  /** 处理搜索接口 */
1945
- var handReqSearchResult = function handReqSearchResult(result) {
1946
- var data = result.data,
1947
- err = result.err;
1762
+ const handReqSearchResult = result => {
1763
+ const {
1764
+ data,
1765
+ err
1766
+ } = result;
1948
1767
  if (err) {
1949
1768
  setSearchLoading(false);
1950
1769
  if (constData.current.reqParams.pagination) {
@@ -1954,7 +1773,7 @@ var Selector = function Selector(props) {
1954
1773
  return;
1955
1774
  }
1956
1775
  if (props.requestCallback) {
1957
- props.requestCallback(data, function (handData) {
1776
+ props.requestCallback(data, handData => {
1958
1777
  setSearchLoading(false);
1959
1778
  handSearchData(handData);
1960
1779
  }, true);
@@ -1964,64 +1783,45 @@ var Selector = function Selector(props) {
1964
1783
  handSearchData(data);
1965
1784
  };
1966
1785
  /** 搜索请求 */
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
- };
1786
+ const reqSearch = () => __awaiter(void 0, void 0, void 0, function* () {
1787
+ var _a;
1788
+ if (onSearch) {
1789
+ const reqParams = {};
1790
+ if (constData.current.reqParams.pagination) {
1791
+ reqParams.size = constData.current.searchConfig.size;
1792
+ reqParams.page = constData.current.searchConfig.page;
1793
+ }
1794
+ const result = yield onSearch(constData.current.searchVal, reqParams);
1795
+ handReqSearchResult(result);
1796
+ return;
1797
+ }
1798
+ let obj = {
1799
+ method,
1800
+ url: props.url || '',
1801
+ ctx,
1802
+ uuid: constData.current.reqId,
1803
+ data: Object.assign({
1804
+ searchKey: (_a = constData.current.searchVal) === null || _a === void 0 ? void 0 : _a.trim()
1805
+ }, props.params)
1806
+ };
1807
+ if (constData.current.reqParams.pagination) {
1808
+ obj.data.size = constData.current.searchConfig.size;
1809
+ obj.data.page = constData.current.searchConfig.page;
1810
+ }
1811
+ obj = props.paramsCallback ? props.paramsCallback(obj, true) : obj;
1812
+ const result = yield reqFunc(obj);
1813
+ handReqSearchResult(result);
1814
+ });
2015
1815
  /**
2016
1816
  * 递归寻找子级
2017
1817
  * */
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 || [];
1818
+ const convertChild = (id, arr) => {
1819
+ let arrHnad = arr;
1820
+ const recurrence = arrItem => {
1821
+ for (let i = 0, l = arrItem.length; i < l; i++) {
1822
+ const item = arrItem[i];
1823
+ const rowId = item[rowKey];
1824
+ const arrChild = item.children || [];
2025
1825
  if (rowId === id) {
2026
1826
  arrHnad = arrChild;
2027
1827
  return;
@@ -2035,65 +1835,51 @@ var Selector = function Selector(props) {
2035
1835
  /** 搜索回调
2036
1836
  * @param bol 搜索框为空的情况下,触发搜索
2037
1837
  * */
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();
1838
+ const onSearchCom = (val, bol) => __awaiter(void 0, void 0, void 0, function* () {
1839
+ setSearchLoading(true);
1840
+ constData.current.searchVal = val;
1841
+ if (val === '') {
1842
+ setSearchList([]);
1843
+ setSearchLoading(false);
1844
+ if (constData.current.beforeSearchBreadcrumbs) {
1845
+ // 从搜索恢复到正常列表
1846
+ constData.current.breadcrumbsList = [...constData.current.beforeSearchBreadcrumbs];
1847
+ setBreadcrumbsList([...constData.current.beforeSearchBreadcrumbs]);
1848
+ constData.current.beforeSearchBreadcrumbs = null;
1849
+ if (isReqLocalData) {
1850
+ // 本地全量数据
1851
+ // 搜索点过下级,修改了当前显示的数据
1852
+ // 从搜索恢复到正常列表, 需要从原始数据,取出当前层级对应的数据
1853
+ const parentId = handParentId();
1854
+ const arr = convertChild(parentId, constData.current.oneDataList);
1855
+ constData.current.currentSourceData = arr;
2080
1856
  }
2081
- }, _callee5);
2082
- }));
2083
- };
1857
+ refreshFunc();
1858
+ }
1859
+ if (bol) {
1860
+ // 当前页刷新
1861
+ refreshFunc();
1862
+ onRefresh && onRefresh();
1863
+ }
1864
+ return;
1865
+ }
1866
+ constData.current.searchConfig.page = 1;
1867
+ constData.current.searchConfig.currentSourceData = [];
1868
+ reqSearch();
1869
+ });
2084
1870
  /** 删除数据 */
2085
- var onCloseCom = function onCloseCom(item, index) {
1871
+ const onCloseCom = (item, index) => {
2086
1872
  if (selectMode === 'radio') {
2087
1873
  onChangeEmit(null, [], {}, {});
2088
1874
  }
2089
1875
  if (selectMode === 'check') {
2090
- var arr = _toConsumableArray(valueCom);
1876
+ const arr = [...valueCom];
2091
1877
  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];
1878
+ const node = {}; // 处理过得数据
1879
+ const rowData = {}; // 原始数据
1880
+ for (let i = 0, l = arr.length; i < l; i++) {
1881
+ const item = arr[i];
1882
+ const keyStr = item[selectorFieldConfigHand.key];
2097
1883
  node[keyStr] = constData.current.jsonData[keyStr];
2098
1884
  rowData[keyStr] = constData.current.jsonDataCopy[keyStr];
2099
1885
  }
@@ -2101,7 +1887,7 @@ var Selector = function Selector(props) {
2101
1887
  }
2102
1888
  };
2103
1889
  /** 处理返回数据dom配置 */
2104
- var handSelectorData = function handSelectorData() {
1890
+ const handSelectorData = () => {
2105
1891
  return jsx(SelectorData, {
2106
1892
  layout: layout === 'tb' ? 'tag' : 'node',
2107
1893
  backDataFieldConfig: selectorFieldConfigHand,
@@ -2120,8 +1906,8 @@ var Selector = function Selector(props) {
2120
1906
  });
2121
1907
  };
2122
1908
  // 处理className
2123
- var handClass = function handClass() {
2124
- var str = "".concat($prefixCls, "-selector");
1909
+ const handClass = () => {
1910
+ let str = "".concat($prefixCls, "-selector");
2125
1911
  if (className) str += " ".concat(className);
2126
1912
  if (layout) str += " ".concat($prefixCls, "-selector-").concat(layout);
2127
1913
  if (selectMode) str += " ".concat($prefixCls, "-selector-").concat(selectMode);