@para-ui/core 4.0.0-rc.3 → 4.0.0-rc.5

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 (180) hide show
  1. package/AutoBox/index.js +72 -85
  2. package/AutoTips/index.js +72 -95
  3. package/Badge/index.js +18 -17
  4. package/Breadcrumbs/index.js +57 -73
  5. package/Button/index.js +89 -117
  6. package/ButtonGroup/index.js +30 -33
  7. package/Carousel/index.js +29 -33
  8. package/Cascader/index.js +7 -9
  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 +242 -330
  16. package/ComboSelect/utils.d.ts +0 -5
  17. package/Container/index.js +17 -21
  18. package/CopyText/index.js +50 -83
  19. package/DatePicker/index.js +22 -27
  20. package/Descriptions/index.js +50 -59
  21. package/Desktop/index.js +161 -180
  22. package/DragVerify/index.js +77 -113
  23. package/Drawer/index.js +82 -97
  24. package/Dropdown/index.js +3 -3
  25. package/DynamicMultiBox/index.js +219 -224
  26. package/DynamicMultiBox/interface.d.ts +7 -0
  27. package/Empty/index.js +26 -28
  28. package/Form/index.js +66 -74
  29. package/FormItem/index.js +14 -15
  30. package/FunctionModal/index.js +7 -14
  31. package/GlobalContext/index.js +17 -20
  32. package/Help/index.js +9 -12
  33. package/HelperText/index.js +11 -11
  34. package/InputLang/index.js +104 -124
  35. package/InputNumber/index.js +62 -81
  36. package/Label/index.js +19 -21
  37. package/Loading/index.js +11 -10
  38. package/Menu/index.js +302 -371
  39. package/Message/index.js +105 -114
  40. package/Modal/index.js +122 -148
  41. package/MultiBox/index.d.ts +5 -0
  42. package/MultiBox/index.js +111 -115
  43. package/Notification/index.js +105 -103
  44. package/OperateBtn/index.d.ts +3 -0
  45. package/OperateBtn/index.js +77 -107
  46. package/PageHeader/index.js +327 -406
  47. package/Pagination/index.js +107 -137
  48. package/ParauiProvider/index.js +20 -22
  49. package/PasswordRules/index.js +36 -40
  50. package/PopConfirm/index.js +62 -79
  51. package/Popover/index.js +12 -12
  52. package/Progress/index.js +72 -74
  53. package/Querying/index.js +52 -59
  54. package/README.md +2 -0
  55. package/Radio/index.js +27 -34
  56. package/RadioGroup/index.js +38 -52
  57. package/Search/index.js +35 -44
  58. package/Select/index.js +323 -364
  59. package/SelectInput/index.js +8 -13
  60. package/Selector/index.js +905 -796
  61. package/SelectorPicker/index.js +111 -133
  62. package/SingleBox/index.d.ts +5 -0
  63. package/SingleBox/index.js +92 -88
  64. package/Slider/index.js +46 -57
  65. package/Status/index.js +14 -13
  66. package/Stepper/index.js +25 -26
  67. package/Styles/theme.scss +9 -9
  68. package/Switch/index.js +32 -35
  69. package/Table/index.js +767 -963
  70. package/Tabs/index.js +102 -102
  71. package/Tag/index.js +115 -162
  72. package/TextEditor/index.js +81 -103
  73. package/TextField/index.js +142 -183
  74. package/TimePicker/index.js +27 -28
  75. package/Timeline/index.js +67 -58
  76. package/Title/index.js +32 -34
  77. package/ToggleButton/index.js +53 -52
  78. package/Tooltip/index.js +79 -82
  79. package/Transfer/index.js +160 -203
  80. package/Tree/index.js +7 -12
  81. package/Upload/index.js +527 -759
  82. package/Upload/interface.d.ts +5 -0
  83. package/_verture/{constant-0d9802f7.js → constant-5317fc89.js} +2 -2
  84. package/_verture/{index-f48d5ce6.js → index-0ced30f7.js} +1128 -1080
  85. package/_verture/{index-024bbc9b.js → index-775ad32d.js} +29 -25
  86. package/_verture/{index-05f7bf11.js → index-c568f272.js} +2 -2
  87. package/_verture/index-da9097d3.js +239 -0
  88. package/_verture/{index-56601c94.js → index-ef1235fb.js} +125 -134
  89. package/_verture/{index-de8f4428.js → index-f186b5e8.js} +315 -399
  90. package/_verture/intl-f2f27722.js +69 -0
  91. package/_verture/{modalContext-736ff215.js → modalContext-5df08980.js} +36 -64
  92. package/_verture/{slicedToArray-a8206399.js → slicedToArray-8223a2ef.js} +15 -2
  93. package/_verture/{useFormatMessage-703f8b20.js → useFormatMessage-eb13cf56.js} +5 -4
  94. package/_verture/{useGlobalProps-1b846a65.js → useGlobalProps-1e416658.js} +4 -3
  95. package/_verture/{usePopupContainer-87febeb9.js → usePopupContainer-635f66f4.js} +16 -15
  96. package/_verture/{util-7e1fb1e2.js → util-82646c4f.js} +5 -4
  97. package/_verture/{utils-06d86594.js → utils-46e99c9a.js} +34 -26
  98. package/index.js +21 -22
  99. package/locale/index.js +10 -10
  100. package/package.json +1 -1
  101. package/umd/AutoBox.js +9 -8
  102. package/umd/AutoTips.js +9 -8
  103. package/umd/Badge.js +1 -1
  104. package/umd/Breadcrumbs.js +9 -8
  105. package/umd/Button.js +9 -8
  106. package/umd/ButtonGroup.js +9 -8
  107. package/umd/Carousel.js +5 -5
  108. package/umd/Cascader.js +9 -8
  109. package/umd/Checkbox.js +9 -8
  110. package/umd/CheckboxGroup.js +9 -8
  111. package/umd/Collapse.js +8 -7
  112. package/umd/CollapseBox.js +1 -1
  113. package/umd/CollapseLayout.js +4 -4
  114. package/umd/ColorPicker.js +1 -1
  115. package/umd/ComboSelect.js +9 -8
  116. package/umd/Container.js +1 -1
  117. package/umd/CopyText.js +9 -8
  118. package/umd/DatePicker.js +9 -8
  119. package/umd/Descriptions.js +9 -8
  120. package/umd/Desktop.js +9 -8
  121. package/umd/DragVerify.js +4 -4
  122. package/umd/Drawer.js +9 -8
  123. package/umd/Dropdown.js +6 -5
  124. package/umd/DynamicMultiBox.js +11 -10
  125. package/umd/Empty.js +1 -1
  126. package/umd/Form.js +9 -8
  127. package/umd/FormItem.js +9 -8
  128. package/umd/FunctionModal.js +9 -8
  129. package/umd/GlobalContext.js +1 -1
  130. package/umd/Help.js +9 -8
  131. package/umd/HelperText.js +1 -1
  132. package/umd/InputLang.js +9 -8
  133. package/umd/InputNumber.js +9 -8
  134. package/umd/Label.js +9 -8
  135. package/umd/Loading.js +4 -4
  136. package/umd/Menu.js +4 -4
  137. package/umd/Message.js +4 -4
  138. package/umd/Modal.js +9 -8
  139. package/umd/MultiBox.js +9 -8
  140. package/umd/Notification.js +8 -7
  141. package/umd/OperateBtn.js +9 -8
  142. package/umd/PageHeader.js +9 -8
  143. package/umd/Pagination.js +9 -8
  144. package/umd/ParauiProvider.js +1 -1
  145. package/umd/PasswordRules.js +4 -4
  146. package/umd/PopConfirm.js +9 -8
  147. package/umd/Popover.js +9 -8
  148. package/umd/Progress.js +5 -5
  149. package/umd/Querying.js +1 -1
  150. package/umd/Radio.js +9 -8
  151. package/umd/RadioGroup.js +9 -8
  152. package/umd/Search.js +9 -8
  153. package/umd/Select.js +9 -8
  154. package/umd/SelectInput.js +9 -8
  155. package/umd/Selector.js +9 -8
  156. package/umd/SelectorPicker.js +9 -8
  157. package/umd/SingleBox.js +9 -8
  158. package/umd/Slider.js +6 -5
  159. package/umd/Status.js +4 -4
  160. package/umd/Stepper.js +9 -8
  161. package/umd/Switch.js +9 -8
  162. package/umd/Table.js +9 -8
  163. package/umd/Tabs.js +9 -8
  164. package/umd/Tag.js +9 -8
  165. package/umd/TextEditor.js +22 -21
  166. package/umd/TextField.js +9 -8
  167. package/umd/TimePicker.js +9 -8
  168. package/umd/Timeline.js +1 -1
  169. package/umd/Title.js +9 -8
  170. package/umd/ToggleButton.js +9 -8
  171. package/umd/Tooltip.js +9 -8
  172. package/umd/Transfer.js +10 -9
  173. package/umd/Tree.js +9 -8
  174. package/umd/Upload.js +10 -9
  175. package/umd/locale.js +1 -1
  176. package/_verture/index-232d890b.js +0 -327
  177. package/_verture/index-e9007d6a.js +0 -236
  178. package/_verture/intl-5c1ec055.js +0 -81
  179. package/_verture/toConsumableArray-8f4c9589.js +0 -19
  180. package/_verture/unsupportedIterableToArray-cb478f24.js +0 -16
package/Select/index.js CHANGED
@@ -1,12 +1,8 @@
1
- import { _ as _defineProperty } from '../_verture/defineProperty-1d116156.js';
2
- import { _ as _typeof } from '../_verture/typeof-adeedc13.js';
3
- import { _ as _toConsumableArray } from '../_verture/toConsumableArray-8f4c9589.js';
4
- import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
5
1
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
6
2
  import React__default, { useRef, useState, useEffect, useMemo } from 'react';
7
3
  import Empty from '../Empty/index.js';
8
4
  import Label from '../Label/index.js';
9
- import { D as Dropdown } from '../_verture/index-e9007d6a.js';
5
+ import { D as Dropdown } from '../_verture/index-da9097d3.js';
10
6
  import { UUID, DeepClone } from '@paraview/lib';
11
7
  import GlobalContext from '@para-ui/core/GlobalContext';
12
8
  import CloseIcon from '@para-ui/icons/Close';
@@ -14,16 +10,15 @@ import CloseCircleF from '@para-ui/icons/CloseCircleF';
14
10
  import Down from '@para-ui/icons/Down';
15
11
  import Check from '@para-ui/icons/Check';
16
12
  import SearchIcon from '@para-ui/icons/Search';
17
- import { u as useFormatMessage } from '../_verture/useFormatMessage-703f8b20.js';
13
+ import { u as useFormatMessage } from '../_verture/useFormatMessage-eb13cf56.js';
18
14
  import AutoTips from '../AutoTips/index.js';
19
15
  import { Loading } from '../Loading/index.js';
20
16
  import { Popover } from '../Popover/index.js';
21
17
  import { Tooltip } from '../Tooltip/index.js';
22
18
  import HelperText from '../HelperText/index.js';
23
- import { u as useGlobalProps } from '../_verture/useGlobalProps-1b846a65.js';
24
- import { $ as $prefixCls } from '../_verture/constant-0d9802f7.js';
19
+ import { u as useGlobalProps } from '../_verture/useGlobalProps-1e416658.js';
20
+ import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
25
21
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
26
- import '../_verture/unsupportedIterableToArray-cb478f24.js';
27
22
  import 'clsx';
28
23
  import '../_verture/tslib.es6-55ed4bd2.js';
29
24
  import '../Help/index.js';
@@ -32,7 +27,7 @@ import 'rc-tooltip';
32
27
  import 'rc-tooltip/lib/placements';
33
28
  import '@para-ui/icons/Forbid';
34
29
  import 'rc-dropdown';
35
- import '../_verture/usePopupContainer-87febeb9.js';
30
+ import '../_verture/usePopupContainer-635f66f4.js';
36
31
  import 'dayjs';
37
32
  import '@para-ui/icons/LoadingF';
38
33
 
@@ -47,8 +42,8 @@ var zh = {
47
42
  };
48
43
 
49
44
  var localeJson = {
50
- zh: zh,
51
- en: en
45
+ zh,
46
+ en
52
47
  };
53
48
 
54
49
  var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-select {\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n display: inline-block;\n vertical-align: top;\n width: 100%;\n}\n.paraui-v4-select > .select-content {\n line-height: 0;\n border: 1px solid;\n border-radius: 4px;\n border-color: rgb(212, 218, 227);\n padding-right: 10px;\n position: relative;\n cursor: pointer;\n background-color: rgb(255, 255, 255);\n}\n.paraui-v4-select > .select-content:hover {\n border-color: rgb(87, 131, 235);\n}\n.paraui-v4-select > .select-content:hover > .select-svg > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-select > .select-content > .select-label-placeholder {\n width: 100%;\n height: 100%;\n padding: 0 10px;\n color: rgb(161, 168, 179);\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n position: absolute;\n left: 0;\n top: 0;\n z-index: 1;\n}\n.paraui-v4-select > .select-content > .select-label-placeholder > .select-required {\n margin-left: 2px;\n color: rgb(244, 66, 66);\n}\n.paraui-v4-select > .select-content > .select-svg {\n position: absolute;\n right: 10px;\n top: 0;\n z-index: 2;\n}\n.paraui-v4-select > .select-content > .select-svg > svg {\n font-size: 18px;\n transition: all 0.3s;\n color: rgb(92, 101, 115);\n opacity: 0;\n}\n.paraui-v4-select > .select-content > .select-svg > .clean-up-icon {\n position: absolute;\n left: 0;\n top: 0;\n height: 100%;\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n}\n.paraui-v4-select > .select-content > .select-svg > .clean-up-icon > svg {\n font-size: 16px;\n transition: all 0.3s;\n color: rgb(161, 168, 179);\n}\n.paraui-v4-select > .select-content > .select-svg > .clean-up-icon:hover > svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-select > .select-content > .radio-select-content {\n padding-left: 10px;\n font-size: 14px;\n line-height: 1.43;\n color: rgb(29, 33, 38);\n word-break: break-all;\n}\n.paraui-v4-select > .select-content > .radio-search-outside {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n line-height: 1.43;\n padding: 0 30px 0 10px;\n font-size: 14px;\n cursor: pointer;\n color: rgb(29, 33, 38);\n border: 0;\n border-radius: 4px;\n background: transparent;\n}\n.paraui-v4-select > .select-content > .check-select-content {\n padding-left: 10px;\n overflow: hidden;\n}\n.paraui-v4-select > .select-content > .check-select-content > .check-select-content-item {\n display: inline-block;\n background-color: rgb(234, 236, 241);\n border-radius: 4px;\n padding: 0 10px;\n color: rgb(29, 33, 38);\n margin-right: 4px;\n vertical-align: top;\n max-width: 100%;\n white-space: nowrap;\n}\n.paraui-v4-select > .select-content > .check-select-content > .check-select-content-item.check-select-content-item-more {\n cursor: pointer;\n color: rgb(29, 33, 38);\n}\n.paraui-v4-select > .select-content > .check-select-content > .check-select-content-item.check-select-content-item-more > span {\n max-width: none;\n}\n.paraui-v4-select > .select-content > .check-select-content > .check-select-content-item.check-select-content-item-more:hover {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-select > .select-content > .check-select-content > .check-select-content-item > span {\n display: inline-block;\n height: 100%;\n vertical-align: top;\n max-width: calc(100% - 20px);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.paraui-v4-select > .select-content > .check-select-content > .check-select-content-item > svg {\n cursor: pointer;\n margin-left: 4px;\n color: rgb(29, 33, 38);\n font-size: 16px;\n position: relative;\n z-index: 10;\n}\n.paraui-v4-select > .select-content > .check-select-content > .check-select-content-item > svg:hover {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-select > .select-content > .check-select-content > .check-select-content-item.check-select-content-item-noclose > span {\n max-width: none;\n}\n.paraui-v4-select > .select-content > .check-select-content > .check-search-outside {\n width: 10px;\n max-width: 100% !important;\n display: none;\n border: 0;\n color: rgb(29, 33, 38);\n font-size: 14px;\n cursor: pointer;\n}\n.paraui-v4-select.paraui-v4-select-allow-clear > .select-content {\n padding-right: 38px;\n}\n.paraui-v4-select.paraui-v4-select-allow-clear > .select-content .select-label-placeholder {\n padding-right: 38px;\n}\n.paraui-v4-select.paraui-v4-select-allow-clear.paraui-v4-select-value > .select-content:hover > .select-svg > svg {\n opacity: 0;\n transition: all 0s;\n}\n.paraui-v4-select.paraui-v4-select-allow-clear.paraui-v4-select-value > .select-content:hover > .select-svg > .clean-up-icon {\n opacity: 1;\n transition: all 0.3s;\n}\n.paraui-v4-select.paraui-v4-select-allow-clear.paraui-v4-select-value.paraui-v4-select-disabled > .select-content:hover > .select-svg > svg {\n opacity: 1;\n}\n.paraui-v4-select.paraui-v4-select-over-line.paraui-v4-select-small > .select-content {\n height: inherit;\n min-height: 28px;\n}\n.paraui-v4-select.paraui-v4-select-over-line.paraui-v4-select-small > .select-content > .check-select-content {\n height: 100%;\n}\n.paraui-v4-select.paraui-v4-select-over-line.paraui-v4-select-medium > .select-content {\n height: inherit;\n min-height: 28px;\n}\n.paraui-v4-select.paraui-v4-select-over-line.paraui-v4-select-medium > .select-content > .check-select-content {\n height: 100%;\n}\n.paraui-v4-select.paraui-v4-select-over-line.paraui-v4-select-large > .select-content {\n height: inherit;\n min-height: 32px;\n}\n.paraui-v4-select.paraui-v4-select-over-line.paraui-v4-select-large > .select-content > .check-select-content {\n height: 100%;\n}\n.paraui-v4-select.paraui-v4-select-show-select > .select-content {\n padding-right: 38px;\n}\n.paraui-v4-select.paraui-v4-select-show-select > .select-content .select-label-placeholder {\n padding-right: 38px;\n}\n.paraui-v4-select.paraui-v4-select-show-select > .select-content > .select-svg > svg {\n opacity: 1;\n}\n.paraui-v4-select.paraui-v4-select-disabled > .select-content {\n background-color: rgb(247, 248, 250);\n cursor: not-allowed;\n}\n.paraui-v4-select.paraui-v4-select-disabled > .select-content:hover {\n border-color: rgb(212, 218, 227);\n}\n.paraui-v4-select.paraui-v4-select-disabled > .select-content:hover > .select-svg > svg {\n color: rgb(92, 101, 115);\n}\n.paraui-v4-select.paraui-v4-select-disabled > .select-content > .radio-select-content {\n color: rgb(92, 101, 115);\n}\n.paraui-v4-select.paraui-v4-select-disabled > .select-content > .check-select-content > .check-select-content-item > span {\n max-width: 100%;\n}\n.paraui-v4-select.paraui-v4-select-error > .select-content {\n border-color: rgb(244, 66, 66) !important;\n}\n.paraui-v4-select.paraui-v4-select-open > .select-content {\n border-color: rgb(46, 101, 230);\n}\n.paraui-v4-select.paraui-v4-select-open > .select-content > .select-svg > svg {\n transform: rotate(180deg);\n color: rgb(46, 101, 230);\n}\n.paraui-v4-select.paraui-v4-select-open > .select-content > .check-select-content > .check-search-outside {\n display: inline-block;\n}\n.paraui-v4-select.paraui-v4-select-small > .select-content {\n height: 28px;\n}\n.paraui-v4-select.paraui-v4-select-small > .select-content > .select-label-placeholder {\n line-height: 26px;\n}\n.paraui-v4-select.paraui-v4-select-small > .select-content > .select-svg {\n top: 4px;\n}\n.paraui-v4-select.paraui-v4-select-small > .select-content > .radio-select-content {\n padding-bottom: 3px;\n padding-top: 3px;\n}\n.paraui-v4-select.paraui-v4-select-small > .select-content > .check-select-content {\n padding-bottom: 3px;\n height: 26px;\n}\n.paraui-v4-select.paraui-v4-select-small > .select-content > .check-select-content > .check-select-content-item {\n margin-top: 3px;\n height: 20px;\n line-height: 20px;\n}\n.paraui-v4-select.paraui-v4-select-small > .select-content > .check-select-content > .check-select-content-item > svg {\n top: 2px;\n}\n.paraui-v4-select.paraui-v4-select-small > .select-content > .check-select-content > .check-search-outside {\n margin-top: 3px;\n height: 20px;\n}\n.paraui-v4-select.paraui-v4-select-medium > .select-content {\n height: 28px;\n}\n.paraui-v4-select.paraui-v4-select-medium > .select-content > .select-label-placeholder {\n line-height: 26px;\n}\n.paraui-v4-select.paraui-v4-select-medium > .select-content > .select-svg {\n top: 4px;\n}\n.paraui-v4-select.paraui-v4-select-medium > .select-content > .radio-select-content {\n padding-bottom: 3px;\n padding-top: 3px;\n}\n.paraui-v4-select.paraui-v4-select-medium > .select-content > .check-select-content {\n padding-bottom: 3px;\n height: 26px;\n}\n.paraui-v4-select.paraui-v4-select-medium > .select-content > .check-select-content > .check-select-content-item {\n margin-top: 3px;\n height: 20px;\n line-height: 20px;\n}\n.paraui-v4-select.paraui-v4-select-medium > .select-content > .check-select-content > .check-select-content-item > svg {\n top: 2px;\n}\n.paraui-v4-select.paraui-v4-select-medium > .select-content > .check-select-content > .check-search-outside {\n margin-top: 3px;\n height: 20px;\n}\n.paraui-v4-select.paraui-v4-select-large > .select-content {\n height: 32px;\n}\n.paraui-v4-select.paraui-v4-select-large > .select-content > .select-label-placeholder {\n line-height: 30px;\n}\n.paraui-v4-select.paraui-v4-select-large > .select-content > .select-svg {\n top: 6px;\n}\n.paraui-v4-select.paraui-v4-select-large > .select-content > .radio-select-content {\n padding-bottom: 5px;\n padding-top: 5px;\n}\n.paraui-v4-select.paraui-v4-select-large > .select-content > .check-select-content {\n padding-bottom: 3px;\n height: 30px;\n}\n.paraui-v4-select.paraui-v4-select-large > .select-content > .check-select-content > .check-select-content-item {\n margin-top: 3px;\n height: 24px;\n line-height: 24px;\n}\n.paraui-v4-select.paraui-v4-select-large > .select-content > .check-select-content > .check-select-content-item > svg {\n top: 3px;\n}\n.paraui-v4-select.paraui-v4-select-large > .select-content > .check-select-content > .check-search-outside {\n margin-top: 4px;\n height: 22px;\n}\n\n.paraui-v4-select-popover.component-dropdown {\n /*&.paraui-v4-select-popover-small {\n & > .select-popover-content {\n & > .select-popover-search {\n height: 30px;\n }\n\n & > .select-popover-list {\n & .select-popover-list-item {\n height: 30px;\n line-height: 30px;\n }\n\n & > .select-popover-list-group {\n & .select-popover-list-group-label {\n height: 30px;\n line-height: 30px;\n }\n }\n }\n }\n }\n\n // 中\n &.paraui-v4-select-popover-medium {\n & > .select-popover-content {\n & > .select-popover-search {\n height: 30px;\n }\n\n & > .select-popover-list {\n & .select-popover-list-item {\n height: 30px;\n line-height: 30px;\n }\n\n & > .select-popover-list-group {\n & .select-popover-list-group-label {\n height: 30px;\n line-height: 30px;\n }\n }\n }\n }\n }\n\n // 大\n &.paraui-v4-select-popover-large {\n & > .select-popover-content {\n & > .select-popover-search {\n height: 30px;\n }\n\n & > .select-popover-list {\n & .select-popover-list-item {\n height: 30px;\n line-height: 30px;\n }\n\n & > .select-popover-list-group {\n & .select-popover-list-group-label {\n height: 30px;\n line-height: 30px;\n }\n }\n }\n }\n }*/\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content {\n padding: 4px 0;\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content.select-popover-content-search > .select-popover-list {\n padding-top: 0px;\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content.select-popover-content-search > .select-popover-list > .select-nodata {\n margin-top: 20px;\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-search {\n display: flex;\n align-items: center;\n padding: 0 10px;\n border-bottom: 1px solid;\n border-color: rgb(234, 236, 241);\n height: 30px;\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-search > input {\n border: 0;\n outline: none;\n font-size: 14px;\n color: rgb(29, 33, 38);\n width: 100%;\n height: 100%;\n line-height: 1.43;\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-search > input::placeholder {\n font-size: 14px;\n opacity: 1;\n color: rgb(161, 168, 179);\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-search > input::-ms-clear {\n display: none;\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-search > input::-ms-reveal {\n display: none;\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-search > input:-moz-placeholder {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-search > input::-moz-placeholder {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-search > input:-ms-input-placeholder { /* Internet Explorer 10-11 */\n color: rgb(161, 168, 179);\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-search > input::-ms-input-placeholder { /* Microsoft Edge */\n color: rgb(161, 168, 179);\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-search > svg {\n color: rgb(92, 101, 115);\n font-size: 18px;\n cursor: pointer;\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-list {\n max-height: 320px;\n overflow: auto;\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-list.select-popover-list-loading {\n height: 100px;\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-list .select-popover-list-item {\n display: flex;\n cursor: pointer;\n padding: 0 10px;\n align-items: center;\n height: 30px;\n line-height: 30px;\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-list .select-popover-list-item > .select-popover-list-item-label {\n flex: 1;\n overflow: hidden;\n color: rgb(29, 33, 38);\n font-size: 14px;\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-list .select-popover-list-item > .select-popover-list-item-svg {\n line-height: 0;\n display: none;\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-list .select-popover-list-item > .select-popover-list-item-svg > svg {\n font-size: 18px;\n color: rgb(46, 101, 230);\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-list .select-popover-list-item.select-popover-list-item-select > .select-popover-list-item-label {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-list .select-popover-list-item.select-popover-list-item-select > .select-popover-list-item-svg {\n display: inline-block;\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-list .select-popover-list-item.select-popover-list-item-hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-list .select-popover-list-item.select-popover-list-item-keydown {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-list .select-popover-list-item.select-popover-list-item-disabled {\n cursor: not-allowed;\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-list .select-popover-list-item.select-popover-list-item-disabled > .select-popover-list-item-label {\n color: rgb(161, 168, 179) !important;\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-list > .select-popover-list-group .select-popover-list-group-label {\n display: inline-block;\n width: 100%;\n padding: 0 10px;\n color: rgb(161, 168, 179);\n font-size: 12px;\n height: 30px;\n line-height: 30px;\n}\n.paraui-v4-select-popover.component-dropdown .select-popover-content > .select-popover-list > .select-nodata {\n text-align: center;\n font-size: 14px;\n color: rgb(29, 33, 38);\n margin-top: 16px;\n margin-bottom: 29px;\n}\n.paraui-v4-select-more-popover {\n /*// 小\n &.paraui-v4-select-more-popover-small {\n & .select-more {\n & > .select-more-title {\n line-height: 28px;\n }\n\n & > .select-more-content {\n & > .select-more-content-item {\n line-height: 28px;\n }\n }\n }\n }\n\n // 中\n &.paraui-v4-select-more-popover-medium {\n & .select-more {\n & > .select-more-title {\n line-height: 32px;\n }\n\n & > .select-more-content {\n & > .select-more-content-item {\n line-height: 32px;\n }\n }\n }\n }\n\n // 大\n &.paraui-v4-select-more-popover-large {\n & .select-more {\n & > .select-more-title {\n line-height: 36px;\n }\n\n & > .select-more-content {\n & > .select-more-content-item {\n line-height: 36px;\n }\n }\n }\n }*/\n}\n.paraui-v4-select-more-popover .select-more {\n width: 290px;\n padding: 4px 0;\n}\n.paraui-v4-select-more-popover .select-more > .select-more-title {\n font-size: 12px;\n padding: 0 10px;\n color: rgb(161, 168, 179);\n line-height: 30px;\n}\n.paraui-v4-select-more-popover .select-more > .select-more-content {\n max-height: 320px;\n overflow: auto;\n}\n.paraui-v4-select-more-popover .select-more > .select-more-content > .select-more-content-item {\n padding: 0 10px;\n display: flex;\n justify-content: space-around;\n align-items: center;\n line-height: 30px;\n}\n.paraui-v4-select-more-popover .select-more > .select-more-content > .select-more-content-item:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-select-more-popover .select-more > .select-more-content > .select-more-content-item > span {\n flex: 1;\n overflow: hidden;\n display: inline-block;\n font-size: 14px;\n}\n.paraui-v4-select-more-popover .select-more > .select-more-content > .select-more-content-item > svg {\n font-size: 18px;\n position: relative;\n cursor: pointer;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-select-more-popover .select-more > .select-more-content > .select-more-content-item > svg:hover {\n color: rgb(46, 101, 230);\n border-radius: 2px;\n}";
@@ -60,17 +55,17 @@ styleInject(css_248z);
60
55
  * @param fontFamily 字体类型
61
56
  * @param text 文本
62
57
  */
63
- var textSize = function textSize(fontSize, fontFamily, text) {
64
- var span = document.createElement('span');
58
+ const textSize = (fontSize, fontFamily, text) => {
59
+ const span = document.createElement('span');
65
60
  span.id = 'referenceSpan';
66
- var result = {};
61
+ const result = {};
67
62
  result.width = span.offsetWidth;
68
63
  result.height = span.offsetHeight;
69
64
  span.style.visibility = 'hidden';
70
65
  span.style.fontSize = fontSize;
71
66
  span.style.fontFamily = fontFamily;
72
67
  span.style.display = 'inline-block';
73
- var isExists = document.getElementById('referenceSpan');
68
+ const isExists = document.getElementById('referenceSpan');
74
69
  if (isExists) {
75
70
  document.body.removeChild(isExists);
76
71
  }
@@ -85,147 +80,149 @@ var textSize = function textSize(fontSize, fontFamily, text) {
85
80
  document.body.removeChild(span);
86
81
  return result;
87
82
  };
88
- var Select = function Select(props) {
89
- var _useGlobalProps = useGlobalProps(props, 'Select'),
90
- className = _useGlobalProps.className,
91
- style = _useGlobalProps.style,
92
- _useGlobalProps$showS = _useGlobalProps.showSelect,
93
- showSelect = _useGlobalProps$showS === void 0 ? true : _useGlobalProps$showS,
94
- _useGlobalProps$allow = _useGlobalProps.allowClear,
95
- allowClear = _useGlobalProps$allow === void 0 ? false : _useGlobalProps$allow,
96
- emptyProps = _useGlobalProps.emptyProps,
97
- _useGlobalProps$size = _useGlobalProps.size,
98
- size = _useGlobalProps$size === void 0 ? 'large' : _useGlobalProps$size,
99
- _useGlobalProps$label = _useGlobalProps.labelMode,
100
- labelMode = _useGlobalProps$label === void 0 ? 'outside' : _useGlobalProps$label,
101
- labelTooltip = _useGlobalProps.labelTooltip,
102
- _useGlobalProps$place = _useGlobalProps.placeholder,
103
- placeholder = _useGlobalProps$place === void 0 ? '' : _useGlobalProps$place,
104
- searchPlaceholder = _useGlobalProps.searchPlaceholder,
105
- _useGlobalProps$label2 = _useGlobalProps.label,
106
- label = _useGlobalProps$label2 === void 0 ? '' : _useGlobalProps$label2,
107
- _useGlobalProps$input = _useGlobalProps.input,
108
- input = _useGlobalProps$input === void 0 ? false : _useGlobalProps$input,
109
- _useGlobalProps$disab = _useGlobalProps.disabled,
110
- disabled = _useGlobalProps$disab === void 0 ? false : _useGlobalProps$disab,
111
- disabledTooltip = _useGlobalProps.disabledTooltip,
112
- _useGlobalProps$multi = _useGlobalProps.multiple,
113
- multiple = _useGlobalProps$multi === void 0 ? false : _useGlobalProps$multi,
114
- _useGlobalProps$requi = _useGlobalProps.required,
115
- required = _useGlobalProps$requi === void 0 ? false : _useGlobalProps$requi,
116
- labelSign = _useGlobalProps.labelSign,
117
- _useGlobalProps$error = _useGlobalProps.error,
118
- error = _useGlobalProps$error === void 0 ? false : _useGlobalProps$error,
119
- hideErrorDom = _useGlobalProps.hideErrorDom,
120
- _useGlobalProps$helpe = _useGlobalProps.helperText,
121
- helperText = _useGlobalProps$helpe === void 0 ? '' : _useGlobalProps$helpe,
122
- list = _useGlobalProps.list,
123
- _useGlobalProps$showN = _useGlobalProps.showName,
124
- showName = _useGlobalProps$showN === void 0 ? 'label' : _useGlobalProps$showN,
125
- _useGlobalProps$showV = _useGlobalProps.showValue,
126
- showValue = _useGlobalProps$showV === void 0 ? 'value' : _useGlobalProps$showV,
127
- _useGlobalProps$child = _useGlobalProps.childrenName,
128
- childrenName = _useGlobalProps$child === void 0 ? 'children' : _useGlobalProps$child,
129
- value = _useGlobalProps.value,
130
- onChange = _useGlobalProps.onChange,
131
- _useGlobalProps$overL = _useGlobalProps.overLine,
132
- overLine = _useGlobalProps$overL === void 0 ? false : _useGlobalProps$overL,
133
- _useGlobalProps$searc = _useGlobalProps.search,
134
- search = _useGlobalProps$searc === void 0 ? false : _useGlobalProps$searc,
135
- _useGlobalProps$searc2 = _useGlobalProps.searchModel,
136
- searchModel = _useGlobalProps$searc2 === void 0 ? 'inside' : _useGlobalProps$searc2,
137
- selectPopoverClassName = _useGlobalProps.selectPopoverClassName,
138
- morePopoverClassName = _useGlobalProps.morePopoverClassName;
139
- _useGlobalProps.fetchSuggestions;
140
- var searchInputProps = _useGlobalProps.searchInputProps,
141
- onEnter = _useGlobalProps.onEnter,
142
- onEnterInput = _useGlobalProps.onEnterInput,
143
- onClear = _useGlobalProps.onClear,
144
- getPopupContainer = _useGlobalProps.getPopupContainer,
145
- renderContent = _useGlobalProps.renderContent,
146
- _useGlobalProps$selec = _useGlobalProps.selectCheckIcon,
147
- selectCheckIcon = _useGlobalProps$selec === void 0 ? true : _useGlobalProps$selec;
148
- var posDom = useRef(null);
149
- var _useState = useState("".concat($prefixCls, "-select-").concat(UUID())),
150
- _useState2 = _slicedToArray(_useState, 1),
151
- classOne = _useState2[0]; // 唯一class
152
- var _useState3 = useState("select-popover-".concat(UUID())),
153
- _useState4 = _slicedToArray(_useState3, 1),
154
- classOneSelect = _useState4[0]; // 唯一class
155
- var _useState5 = useState(false),
156
- _useState6 = _slicedToArray(_useState5, 2),
157
- open = _useState6[0],
158
- setOpen = _useState6[1]; // 是否打开下拉框
159
- var _useState7 = useState(false),
160
- _useState8 = _slicedToArray(_useState7, 2),
161
- showText = _useState8[0],
162
- setShowText = _useState8[1]; // 是否显示lable,placeholder, true不显示
163
- var _useState9 = useState([]),
164
- _useState10 = _slicedToArray(_useState9, 2),
165
- valueCom = _useState10[0],
166
- setValueCom = _useState10[1]; // 值
167
- var _useState11 = useState([]),
168
- _useState12 = _slicedToArray(_useState11, 2),
169
- listCom = _useState12[0],
170
- setListCom = _useState12[1]; // 下拉框渲染
171
- var _useState13 = useState({}),
172
- _useState14 = _slicedToArray(_useState13, 2),
173
- listJson = _useState14[0],
174
- setListJson = _useState14[1]; // 下拉选项对象
175
- var _useState15 = useState(null),
176
- _useState16 = _slicedToArray(_useState15, 2),
177
- morePos = _useState16[0],
178
- setMorePos = _useState16[1]; // 超出在原始位置
179
- var _useState17 = useState(false),
180
- _useState18 = _slicedToArray(_useState17, 2),
181
- openMore = _useState18[0],
182
- setOpenMore = _useState18[1]; // 显示更多
183
- var _useState19 = useState(''),
184
- _useState20 = _slicedToArray(_useState19, 2),
185
- searchValue = _useState20[0],
186
- setSearchValue = _useState20[1]; // 搜索值
187
- var _useState21 = useState(false),
188
- _useState22 = _slicedToArray(_useState21, 2),
189
- overLineCom = _useState22[0],
190
- setOverLineCom = _useState22[1]; // 超出是否换行
191
- var _useState23 = useState(false),
192
- _useState24 = _slicedToArray(_useState23, 2),
193
- loading = _useState24[0],
194
- setLoading = _useState24[1]; // 下拉加载loading
195
- var _useState25 = useState(false),
196
- _useState26 = _slicedToArray(_useState25, 2),
197
- emptyBol = _useState26[0],
198
- setEmptyBol = _useState26[1]; // 延迟显示空状态
199
- var textDom = useRef(null);
200
- var _useState27 = useState({}),
201
- _useState28 = _slicedToArray(_useState27, 1),
202
- constData = _useState28[0]; // 不变的常量 多行 不换行定时器 搜索定时器
203
- var _React$useContext = React__default.useContext(GlobalContext),
204
- language = _React$useContext.language,
205
- locale = _React$useContext.locale;
206
- var intl = useFormatMessage('Select', localeJson);
207
- constData.valueCom = _toConsumableArray(valueCom);
208
- constData.listCom = listCom;
209
- constData.searchModel = searchModel;
210
- constData.openMore = openMore;
211
- useEffect(function () {
83
+ const useDidMountEffect = (func, deps) => {
84
+ const didMount = React__default.useRef(false);
85
+ React__default.useEffect(() => {
86
+ if (didMount.current) func();else didMount.current = true;
87
+ // eslint-disable-next-line
88
+ }, deps);
89
+ };
90
+ const Select = props => {
91
+ const {
92
+ className,
93
+ style,
94
+ showSelect = true,
95
+ allowClear = false,
96
+ emptyProps,
97
+ size = 'large',
98
+ labelMode = 'outside',
99
+ labelTooltip,
100
+ placeholder = '',
101
+ searchPlaceholder,
102
+ label = '',
103
+ input = false,
104
+ disabled = false,
105
+ disabledTooltip,
106
+ multiple = false,
107
+ required = false,
108
+ labelSign,
109
+ error = false,
110
+ hideErrorDom,
111
+ helperText = '',
112
+ list,
113
+ showName = 'label',
114
+ showValue = 'value',
115
+ childrenName = 'children',
116
+ value,
117
+ onChange,
118
+ overLine = false,
119
+ search = false,
120
+ searchModel = 'inside',
121
+ selectPopoverClassName,
122
+ morePopoverClassName,
123
+ fetchSuggestions,
124
+ searchInputProps,
125
+ onEnter,
126
+ onEnterInput,
127
+ onClear,
128
+ getPopupContainer,
129
+ renderContent,
130
+ selectCheckIcon = true
131
+ } = useGlobalProps(props, 'Select');
132
+ /**
133
+ * 处理初始化数据,让list支持传入字符串
134
+ * 把数组转换成,组件能接收的格式
135
+ * */
136
+ const handList = arr => {
137
+ const handArr = [];
138
+ for (let i = 0, l = arr.length; i < l; i++) {
139
+ const item = arr[i];
140
+ if (typeof item === 'object' && item !== null) {
141
+ handArr.push(item);
142
+ } else {
143
+ const obj = {};
144
+ obj[showName] = item;
145
+ obj[showValue] = item;
146
+ handArr.push(obj);
147
+ }
148
+ }
149
+ return handArr;
150
+ };
151
+ const handleInitValue = () => {
152
+ let valArr = [];
212
153
  if (props.defaultValue !== undefined) {
213
154
  if (props.multiple) {
214
155
  // 多选
215
- setValueCom(DeepClone(props.defaultValue || []));
156
+ valArr = DeepClone(props.defaultValue || []);
216
157
  } else {
217
158
  // 单选
218
- setValueCom(props.defaultValue === '' ? [] : [props.defaultValue]);
159
+ valArr = props.defaultValue === '' ? [] : [props.defaultValue];
219
160
  }
220
161
  }
221
- return function () {
162
+ if (value !== undefined) {
163
+ if (multiple) {
164
+ // 多选
165
+ valArr = DeepClone(value || []);
166
+ } else {
167
+ // 单选
168
+ valArr = value === '' ? [] : [value];
169
+ }
170
+ }
171
+ return valArr;
172
+ };
173
+ const handleIntlList = () => {
174
+ const listHand = handList(list);
175
+ const json = {};
176
+ for (let i = 0, l = listHand.length; i < l; i++) {
177
+ const item = listHand[i];
178
+ if (item[childrenName] && item[childrenName].length > 0) {
179
+ const childArr = item[childrenName];
180
+ for (let j = 0, k = childArr.length; j < k; j++) {
181
+ const childItem = childArr[j];
182
+ const key = childItem[showValue];
183
+ json[key] = childItem;
184
+ }
185
+ } else {
186
+ const key = item[showValue];
187
+ json[key] = item;
188
+ }
189
+ }
190
+ return json;
191
+ };
192
+ const posDom = useRef(null);
193
+ const [classOne] = useState("".concat($prefixCls, "-select-").concat(UUID())); // 唯一class
194
+ const [classOneSelect] = useState("select-popover-".concat(UUID())); // 唯一class
195
+ const [open, setOpen] = useState(false); // 是否打开下拉框
196
+ const [showText, setShowText] = useState(false); // 是否显示lable,placeholder, true不显示
197
+ const [valueCom, setValueCom] = useState(handleInitValue()); // 值
198
+ const [listCom, setListCom] = useState([]); // 下拉框渲染
199
+ const [listJson, setListJson] = useState(handleIntlList()); // 下拉选项对象
200
+ const [morePos, setMorePos] = useState(null); // 超出在原始位置
201
+ const [openMore, setOpenMore] = useState(false); // 显示更多
202
+ const [searchValue, setSearchValue] = useState(''); // 搜索值
203
+ const [overLineCom, setOverLineCom] = useState(false); // 超出是否换行
204
+ const [loading, setLoading] = useState(false); // 下拉加载loading
205
+ const [emptyBol, setEmptyBol] = useState(false); // 延迟显示空状态
206
+ const textDom = useRef(null);
207
+ const [constData] = useState({}); // 不变的常量 多行 不换行定时器 搜索定时器
208
+ const {
209
+ language,
210
+ locale
211
+ } = React__default.useContext(GlobalContext);
212
+ const intl = useFormatMessage('Select', localeJson);
213
+ constData.valueCom = [...valueCom];
214
+ constData.listCom = listCom;
215
+ constData.searchModel = searchModel;
216
+ constData.openMore = openMore;
217
+ useEffect(() => {
218
+ return () => {
222
219
  clearTimeout(constData.searchTimer);
223
220
  clearTimeout(constData.timer);
224
221
  clearTimeout(constData.scrollTimer);
225
222
  };
226
223
  }, []);
227
224
  // 赋值value
228
- useEffect(function () {
225
+ useDidMountEffect(() => {
229
226
  if (value !== undefined) {
230
227
  if (multiple) {
231
228
  // 多选
@@ -236,40 +233,23 @@ var Select = function Select(props) {
236
233
  }
237
234
  }
238
235
  }, [value, multiple]);
239
- useEffect(function () {
236
+ useEffect(() => {
240
237
  changeSize();
241
238
  }, [valueCom, value]);
242
239
  // 判断组件超出是换行,还是不换行
243
- useEffect(function () {
240
+ useEffect(() => {
244
241
  if (searchModel === 'outside') {
245
242
  if (multiple) return setOverLineCom(true); // 多选,输入框在框里面,超出必须换行
246
243
  //return setOverLineCom(false); // 单选不换行
247
244
  }
248
-
249
245
  setOverLineCom(overLine);
250
246
  }, [overLine, searchModel, multiple, input]);
251
247
  // 计算下拉选项,处理下拉选项json
252
- useEffect(function () {
253
- var listHand = handList(list);
254
- var json = {};
255
- for (var i = 0, l = listHand.length; i < l; i++) {
256
- var item = listHand[i];
257
- if (item[childrenName] && item[childrenName].length > 0) {
258
- var childArr = item[childrenName];
259
- for (var j = 0, k = childArr.length; j < k; j++) {
260
- var childItem = childArr[j];
261
- var key = childItem[showValue];
262
- json[key] = childItem;
263
- }
264
- } else {
265
- var _key = item[showValue];
266
- json[_key] = item;
267
- }
268
- }
269
- setListJson(json);
248
+ useDidMountEffect(() => {
249
+ setListJson(handleIntlList());
270
250
  }, [list]);
271
251
  // 多行,不换行计算
272
- useEffect(function () {
252
+ useEffect(() => {
273
253
  // 多行不换行计算
274
254
  if (!overLineCom && multiple) {
275
255
  window.addEventListener('resize', changeSize);
@@ -277,12 +257,12 @@ var Select = function Select(props) {
277
257
  //setMorePos(constData.valueCom.length)
278
258
  window.removeEventListener('resize', changeSize);
279
259
  }
280
- return function () {
260
+ return () => {
281
261
  window.removeEventListener('resize', changeSize);
282
262
  };
283
263
  }, [overLineCom, multiple]);
284
264
  // 计算是否显示label,placehold
285
- useEffect(function () {
265
+ useEffect(() => {
286
266
  if (valueCom && valueCom.length > 0) {
287
267
  setShowText(true); // 有值不显示label,placehold
288
268
  } else {
@@ -293,25 +273,25 @@ var Select = function Select(props) {
293
273
  }
294
274
  }, [search, searchValue, searchModel, valueCom, input]);
295
275
  // 筛选下拉框数据
296
- useEffect(function () {
276
+ useEffect(() => {
297
277
  if (!open) return;
298
278
  setLoading(true);
299
279
  if (props.fetchSuggestions) {
300
- props.fetchSuggestions(searchValue, function (data) {
301
- var listHand = handList(data);
280
+ props.fetchSuggestions(searchValue, data => {
281
+ const listHand = handList(data);
302
282
  handSelectList(listHand, true);
303
283
  setLoading(false);
304
284
  });
305
285
  } else {
306
- var listHand = handList(list);
286
+ const listHand = handList(list);
307
287
  handSelectList(listHand);
308
288
  setLoading(false);
309
289
  }
310
290
  }, [search, searchValue, list, open]);
311
- useEffect(function () {
291
+ useEffect(() => {
312
292
  if (open) {
313
293
  clearTimeout(constData.openTimer);
314
- constData.openTimer = setTimeout(function () {
294
+ constData.openTimer = setTimeout(() => {
315
295
  inputFocus();
316
296
  //window.addEventListener('click', clickCom);
317
297
  window.addEventListener('keydown', keydownCom);
@@ -321,14 +301,14 @@ var Select = function Select(props) {
321
301
  //window.removeEventListener('click', clickCom);
322
302
  window.removeEventListener('keydown', keydownCom);
323
303
  }
324
- return function () {
304
+ return () => {
325
305
  clearTimeout(constData.openTimer);
326
306
  //window.removeEventListener('click', clickCom);
327
307
  window.removeEventListener('keydown', keydownCom);
328
308
  };
329
309
  }, [open]);
330
310
  // 是否计算搜索框长度
331
- useEffect(function () {
311
+ useEffect(() => {
332
312
  if (disabled === true) return;
333
313
  if (multiple && searchModel === 'outside') handInputLength(searchValue);
334
314
  }, [searchValue, multiple, disabled, searchModel, input]);
@@ -336,13 +316,13 @@ var Select = function Select(props) {
336
316
  * 多选 不换行 计算
337
317
  * @param index 数组下标
338
318
  */
339
- var handMultiline = function handMultiline(index) {
319
+ const handMultiline = index => {
340
320
  if (index === null || index === 0) return;
341
321
  if (index === undefined) index = constData.valueCom.length;
342
- var boxDom = document.querySelector(".".concat(classOne, " > .select-content > .check-select-content"));
322
+ const boxDom = document.querySelector(".".concat(classOne, " > .select-content > .check-select-content"));
343
323
  if (!boxDom) return;
344
324
  if (boxDom.scrollHeight > boxDom.clientHeight) {
345
- var num = Number(index) - 1;
325
+ const num = Number(index) - 1;
346
326
  // 超出
347
327
  setMorePos(num);
348
328
  handMultiline(num);
@@ -352,52 +332,33 @@ var Select = function Select(props) {
352
332
  }
353
333
  };
354
334
  // 多选 不换行
355
- var changeSize = function changeSize() {
335
+ const changeSize = () => {
356
336
  if (constData.valueCom.length === 0) return setMorePos(null);
357
337
  clearTimeout(constData.timer);
358
- constData.timer = setTimeout(function () {
338
+ constData.timer = setTimeout(() => {
359
339
  setMorePos(constData.valueCom.length);
360
340
  handMultiline();
361
341
  }, 50);
362
342
  };
363
- /**
364
- * 处理初始化数据,让list支持传入字符串
365
- * 把数组转换成,组件能接收的格式
366
- * */
367
- var handList = function handList(arr) {
368
- var handArr = [];
369
- for (var i = 0, l = arr.length; i < l; i++) {
370
- var item = arr[i];
371
- if (_typeof(item) === 'object' && item !== null) {
372
- handArr.push(item);
373
- } else {
374
- var obj = {};
375
- obj[showName] = item;
376
- obj[showValue] = item;
377
- handArr.push(obj);
378
- }
379
- }
380
- return handArr;
381
- };
382
343
  /**
383
344
  * 处理下拉内容
384
345
  * @param listData 数据源
385
346
  * @param customSearch 是否自定义搜索
386
347
  * */
387
- var handSelectList = function handSelectList(listData, customSearch) {
388
- var arr = [];
389
- var listDeep = _toConsumableArray(listData);
390
- for (var i = 0, l = listDeep.length; i < l; i++) {
391
- var item = listDeep[i];
348
+ const handSelectList = (listData, customSearch) => {
349
+ const arr = [];
350
+ const listDeep = [...listData];
351
+ for (let i = 0, l = listDeep.length; i < l; i++) {
352
+ const item = listDeep[i];
392
353
  if (item[childrenName] && item[childrenName].length > 0) {
393
- var childArr = item[childrenName];
394
- var handChildArr = [];
395
- for (var j = 0, k = childArr.length; j < k; j++) {
396
- var childItem = childArr[j];
354
+ const childArr = item[childrenName];
355
+ const handChildArr = [];
356
+ for (let j = 0, k = childArr.length; j < k; j++) {
357
+ const childItem = childArr[j];
397
358
  if (customSearch) {
398
359
  handChildArr.push(childItem);
399
360
  } else {
400
- var bol = handShowItem(childItem);
361
+ const bol = handShowItem(childItem);
401
362
  if (bol) handChildArr.push(childItem);
402
363
  }
403
364
  }
@@ -410,8 +371,8 @@ var Select = function Select(props) {
410
371
  if (customSearch) {
411
372
  arr.push(item);
412
373
  } else {
413
- var _bol = handShowItem(item);
414
- if (_bol) arr.push(item);
374
+ const bol = handShowItem(item);
375
+ if (bol) arr.push(item);
415
376
  }
416
377
  }
417
378
  }
@@ -420,8 +381,8 @@ var Select = function Select(props) {
420
381
  setEmptyBol(arr.length === 0);
421
382
  };
422
383
  // 输入框的到焦点
423
- var inputFocus = function inputFocus() {
424
- var inputDom = textDom && textDom.current;
384
+ const inputFocus = () => {
385
+ const inputDom = textDom && textDom.current;
425
386
  if (constData.searchModel === 'inside') return;
426
387
  inputDom && inputDom.focus({
427
388
  preventScroll: true
@@ -432,8 +393,8 @@ var Select = function Select(props) {
432
393
  * @param el 当前元素
433
394
  * @param selector 查找元素class
434
395
  */
435
- var closest = function closest(el, selector) {
436
- var matchesSelector = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
396
+ const closest = (el, selector) => {
397
+ const matchesSelector = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
437
398
  while (el) {
438
399
  if (matchesSelector.call(el, selector)) {
439
400
  break;
@@ -447,11 +408,11 @@ var Select = function Select(props) {
447
408
  * @param item 详细信息
448
409
  * @return boolean
449
410
  */
450
- var handShowItem = function handShowItem(item) {
451
- var bol = true;
411
+ const handShowItem = item => {
412
+ let bol = true;
452
413
  if (searchValue.trim() === '') return bol;
453
414
  // 按显示名来
454
- var name = item[showName];
415
+ let name = item[showName];
455
416
  if (name && (typeof name === 'number' || typeof name === 'string')) {
456
417
  name = name.toString();
457
418
  if (name.toLowerCase().indexOf(searchValue.trim().toLowerCase()) === -1) {
@@ -463,25 +424,25 @@ var Select = function Select(props) {
463
424
  return bol;
464
425
  };
465
426
  // 显示下拉框
466
- var clickSelect = function clickSelect() {
427
+ const clickSelect = () => {
467
428
  if (disabled === true) return;
468
429
  setOpen(true);
469
430
  };
470
431
  // 关闭下拉框
471
- var handleClose = function handleClose() {
432
+ const handleClose = () => {
472
433
  setOpen(false);
473
434
  };
474
435
  /**
475
436
  * 点击显示更多
476
437
  * @param e 点击元素
477
438
  */
478
- var clickMore = function clickMore(e) {
439
+ const clickMore = e => {
479
440
  setOpenMore(true);
480
441
  setOpen(false);
481
442
  e.stopPropagation();
482
443
  };
483
444
  // 关闭显示更多
484
- var handleCloseMore = function handleCloseMore() {
445
+ const handleCloseMore = () => {
485
446
  if (constData.openMore) setOpenMore(false);
486
447
  };
487
448
  /**
@@ -490,32 +451,30 @@ var Select = function Select(props) {
490
451
  * @param enter 是否回车
491
452
  * @param e 元素
492
453
  */
493
- var clickItem = function clickItem(item, enter) {
494
- return function (e) {
495
- var val = item[showValue];
496
- if (_typeof(disabled) === 'object' && disabled.indexOf(val) !== -1) return;
497
- if (multiple) {
498
- // 多选
499
- var index = constData.valueCom.indexOf(val);
500
- if (index !== -1) {
501
- // 存在 去除
502
- constData.valueCom.splice(index, 1);
503
- } else {
504
- constData.valueCom.push(val);
505
- }
506
- if (props.value === undefined) setValueCom(_toConsumableArray(constData.valueCom));
507
- onChange && onChange(_toConsumableArray(constData.valueCom), e);
508
- if (enter) onEnter && onEnter(_toConsumableArray(constData.valueCom));
509
- inputFocus();
454
+ const clickItem = (item, enter) => e => {
455
+ const val = item[showValue];
456
+ if (typeof disabled === 'object' && disabled.indexOf(val) !== -1) return;
457
+ if (multiple) {
458
+ // 多选
459
+ const index = constData.valueCom.indexOf(val);
460
+ if (index !== -1) {
461
+ // 存在 去除
462
+ constData.valueCom.splice(index, 1);
510
463
  } else {
511
- // 单选
512
- if (props.value === undefined) setValueCom([val]);
513
- onChange && onChange(val, e);
514
- if (enter) onEnter && onEnter(val);
515
- handleClose();
516
- setSearchValue('');
464
+ constData.valueCom.push(val);
517
465
  }
518
- };
466
+ if (props.value === undefined) setValueCom([...constData.valueCom]);
467
+ onChange && onChange([...constData.valueCom], e);
468
+ if (enter) onEnter && onEnter([...constData.valueCom]);
469
+ inputFocus();
470
+ } else {
471
+ // 单选
472
+ if (props.value === undefined) setValueCom([val]);
473
+ onChange && onChange(val, e);
474
+ if (enter) onEnter && onEnter(val);
475
+ handleClose();
476
+ setSearchValue('');
477
+ }
519
478
  };
520
479
  /**
521
480
  * 多选删除index
@@ -523,16 +482,16 @@ var Select = function Select(props) {
523
482
  * @param val 值
524
483
  * @param e 元素
525
484
  */
526
- var delItem = function delItem(item, val) {
527
- return function (e) {
528
- if (!item) item = _defineProperty({}, showValue, val);
529
- clickItem(item)(e);
530
- e.stopPropagation();
485
+ const delItem = (item, val) => e => {
486
+ if (!item) item = {
487
+ [showValue]: val
531
488
  };
489
+ clickItem(item)(e);
490
+ e.stopPropagation();
532
491
  };
533
492
  // 处理下拉框class
534
- var handClass = function handClass() {
535
- var str = "".concat($prefixCls, "-select");
493
+ const handClass = () => {
494
+ let str = "".concat($prefixCls, "-select");
536
495
  if (multiple && !overLineCom) str += " ".concat(classOne); // 多选 超出不换行
537
496
  if (className) str += " ".concat(className);
538
497
  if (size) str += " ".concat($prefixCls, "-select-").concat(size);
@@ -547,8 +506,8 @@ var Select = function Select(props) {
547
506
  return str;
548
507
  };
549
508
  // 处理下拉弹框class
550
- var handleClassPopover = function handleClassPopover() {
551
- var str = "".concat($prefixCls, "-select-popover ").concat($prefixCls, "-scrollbar-small");
509
+ const handleClassPopover = () => {
510
+ let str = "".concat($prefixCls, "-select-popover ").concat($prefixCls, "-scrollbar-small");
552
511
  if (size) str += " ".concat($prefixCls, "-select-popover-").concat(size);
553
512
  if (multiple) {
554
513
  str += " ".concat($prefixCls, "-select-popover-multiple");
@@ -559,8 +518,8 @@ var Select = function Select(props) {
559
518
  return str;
560
519
  };
561
520
  // 处理下拉框更多class
562
- var handleClassMorePopover = function handleClassMorePopover() {
563
- var str = "".concat($prefixCls, "-select-more-popover ").concat($prefixCls, "-scrollbar-small");
521
+ const handleClassMorePopover = () => {
522
+ let str = "".concat($prefixCls, "-select-more-popover ").concat($prefixCls, "-scrollbar-small");
564
523
  if (size) str += " ".concat($prefixCls, "-select-more-popover-").concat(size);
565
524
  if (morePopoverClassName) str += " ".concat(morePopoverClassName);
566
525
  return str;
@@ -569,7 +528,7 @@ var Select = function Select(props) {
569
528
  * 改变搜索输入框
570
529
  * @param e 搜索框元素
571
530
  */
572
- var changeSearch = function changeSearch(e) {
531
+ const changeSearch = e => {
573
532
  setSearchValue(e.target.value);
574
533
  searchInputProps && searchInputProps.onChange && searchInputProps.onChange(e);
575
534
  };
@@ -577,20 +536,20 @@ var Select = function Select(props) {
577
536
  * 回车搜索输入框
578
537
  * @param e 搜索框元素
579
538
  */
580
- var onKeyDownSearch = function onKeyDownSearch(e) {
539
+ const onKeyDownSearch = e => {
581
540
  if (e.keyCode === 13) {
582
541
  onEnterInput && onEnterInput(searchValue);
583
- var selectDom = document.querySelector(".".concat(classOneSelect, " .select-popover-list"));
542
+ const selectDom = document.querySelector(".".concat(classOneSelect, " .select-popover-list"));
584
543
  if (selectDom) {
585
- var hoverDom = selectDom.querySelector('.select-popover-list-item-hover');
586
- var keydownDom = selectDom.querySelector('.select-popover-list-item-keydown');
587
- var operateDom = keydownDom || hoverDom;
544
+ const hoverDom = selectDom.querySelector('.select-popover-list-item-hover');
545
+ const keydownDom = selectDom.querySelector('.select-popover-list-item-keydown');
546
+ const operateDom = keydownDom || hoverDom;
588
547
  if (operateDom) return;
589
548
  }
590
549
  if (props.input && searchValue.trim() !== '') {
591
- var arr = '';
550
+ let arr = '';
592
551
  if (multiple) {
593
- arr = [].concat(_toConsumableArray(valueCom), [searchValue]);
552
+ arr = [...valueCom, searchValue];
594
553
  } else {
595
554
  arr = searchValue;
596
555
  }
@@ -605,14 +564,14 @@ var Select = function Select(props) {
605
564
  * 多选框设置input框长度
606
565
  * @param text 文本
607
566
  */
608
- var handInputLength = function handInputLength(text) {
609
- var inputDom = textDom && textDom.current;
567
+ const handInputLength = text => {
568
+ const inputDom = textDom && textDom.current;
610
569
  if (!inputDom) return null;
611
- var style = window.getComputedStyle(inputDom);
612
- var fontFamily = style.fontFamily;
613
- var fontSize = style.fontSize;
614
- var results = textSize(fontSize, fontFamily, text);
615
- var width = results.width;
570
+ const style = window.getComputedStyle(inputDom);
571
+ const fontFamily = style.fontFamily;
572
+ const fontSize = style.fontSize;
573
+ const results = textSize(fontSize, fontFamily, text);
574
+ let width = results.width;
616
575
  if (width < 10) width = 10;
617
576
  inputDom.style.width = "".concat(width, "px");
618
577
  };
@@ -626,14 +585,16 @@ var Select = function Select(props) {
626
585
  * currentDom: 当前元素
627
586
  * }
628
587
  */
629
- var handKeydown = function handKeydown(config) {
630
- var selectDom = config.selectDom,
631
- keyCode = config.keyCode,
632
- currentKeydownDom = config.currentKeydownDom;
633
- var brotherDom = null;
634
- var type = 'nextSibling';
635
- var classSelectStr = '.select-popover-list > div';
636
- var classGroupStr = '.select-popover-list-item';
588
+ const handKeydown = config => {
589
+ const {
590
+ selectDom,
591
+ keyCode,
592
+ currentKeydownDom
593
+ } = config;
594
+ let brotherDom = null;
595
+ let type = 'nextSibling';
596
+ let classSelectStr = '.select-popover-list > div';
597
+ let classGroupStr = '.select-popover-list-item';
637
598
  if (keyCode === 38) {
638
599
  // 上
639
600
  type = 'previousSibling';
@@ -652,7 +613,7 @@ var Select = function Select(props) {
652
613
  if (!brotherDom) brotherDom = selectDom.querySelector(classSelectStr);
653
614
  }
654
615
  } else {
655
- var parentNode = currentKeydownDom.parentNode;
616
+ const parentNode = currentKeydownDom.parentNode;
656
617
  if (parentNode && parentNode.className && parentNode.className.indexOf('select-popover-list-group') !== -1) {
657
618
  // 组元素最后元素, 设置父级兄弟节点, 没有父级,设置最后或者第一节点
658
619
  brotherDom = currentKeydownDom.parentNode; // 组元素
@@ -667,7 +628,7 @@ var Select = function Select(props) {
667
628
  if (brotherDom) {
668
629
  // 兄弟是组列表
669
630
  if (brotherDom.className.indexOf('select-popover-list-group') !== -1) {
670
- var currentDom = brotherDom.querySelector(classGroupStr);
631
+ const currentDom = brotherDom.querySelector(classGroupStr);
671
632
  if (currentDom) {
672
633
  currentDom.classList.add('select-popover-list-item-keydown');
673
634
  domClientTop(currentDom, selectDom);
@@ -683,11 +644,11 @@ var Select = function Select(props) {
683
644
  * @param currentDom 当前元素
684
645
  * @param selectDom 可见页面
685
646
  */
686
- var domClientTop = function domClientTop(currentDom, selectDom) {
647
+ const domClientTop = (currentDom, selectDom) => {
687
648
  clearTimeout(constData.scrollTimer);
688
- var clientHeight = selectDom.clientHeight; // 可见区域的高度
689
- var top = currentDom.offsetTop + currentDom.clientHeight;
690
- var difference = top - clientHeight;
649
+ const clientHeight = selectDom.clientHeight; // 可见区域的高度
650
+ const top = currentDom.offsetTop + currentDom.clientHeight;
651
+ const difference = top - clientHeight;
691
652
  constData.scroll = true;
692
653
  if (difference > 0) {
693
654
  selectDom.scrollTop = difference;
@@ -695,7 +656,7 @@ var Select = function Select(props) {
695
656
  selectDom.scrollTop = 0;
696
657
  }
697
658
  // 防止滚动触发hover效果
698
- constData.scrollTimer = setTimeout(function () {
659
+ constData.scrollTimer = setTimeout(() => {
699
660
  constData.scroll = false;
700
661
  }, 100);
701
662
  };
@@ -703,19 +664,19 @@ var Select = function Select(props) {
703
664
  * 键盘事件
704
665
  * @param e 键盘信息
705
666
  */
706
- var keydownCom = function keydownCom(e) {
707
- var selectDom = document.querySelector(".".concat(classOneSelect, " .select-popover-list"));
667
+ const keydownCom = e => {
668
+ const selectDom = document.querySelector(".".concat(classOneSelect, " .select-popover-list"));
708
669
  if (!selectDom) return;
709
- var selectItemDom = selectDom.querySelector('.select-popover-list-item-select');
710
- var hoverDom = selectDom.querySelector('.select-popover-list-item-hover');
711
- var keydownDom = selectDom.querySelector('.select-popover-list-item-keydown');
712
- var currentKeydownDom = selectItemDom; // 选中,hover,keydown元素
670
+ const selectItemDom = selectDom.querySelector('.select-popover-list-item-select');
671
+ const hoverDom = selectDom.querySelector('.select-popover-list-item-hover');
672
+ const keydownDom = selectDom.querySelector('.select-popover-list-item-keydown');
673
+ let currentKeydownDom = selectItemDom; // 选中,hover,keydown元素
713
674
  if (hoverDom) currentKeydownDom = hoverDom;
714
675
  // 回车
715
676
  if (e.keyCode === 13) {
716
- var operateDom = keydownDom || hoverDom;
677
+ const operateDom = keydownDom || hoverDom;
717
678
  if (operateDom) {
718
- var val = operateDom.dataset.val;
679
+ const val = operateDom.dataset.val;
719
680
  clickItem(listJson[val], true)({
720
681
  target: keydownDom
721
682
  });
@@ -730,17 +691,17 @@ var Select = function Select(props) {
730
691
  // 下
731
692
  if (e.keyCode === 40) {
732
693
  handKeydown({
733
- selectDom: selectDom,
694
+ selectDom,
734
695
  keyCode: e.keyCode,
735
- currentKeydownDom: currentKeydownDom
696
+ currentKeydownDom
736
697
  });
737
698
  }
738
699
  // 上
739
700
  if (e.keyCode === 38) {
740
701
  handKeydown({
741
- selectDom: selectDom,
702
+ selectDom,
742
703
  keyCode: e.keyCode,
743
- currentKeydownDom: currentKeydownDom
704
+ currentKeydownDom
744
705
  });
745
706
  }
746
707
  };
@@ -748,30 +709,30 @@ var Select = function Select(props) {
748
709
  * 鼠标移入
749
710
  * @param e 移入元素
750
711
  */
751
- var mouseEnter = function mouseEnter(e) {
712
+ const mouseEnter = e => {
752
713
  if (constData.scroll) return;
753
- var target = closest(e.target, '.select-popover-list-item');
714
+ const target = closest(e.target, '.select-popover-list-item');
754
715
  if (!target) return;
755
716
  target.classList.add('select-popover-list-item-hover');
756
717
  // 鼠标移入清除所有keydown
757
- var selectDom = document.querySelector(".".concat(classOneSelect));
758
- var keydownDom = selectDom.querySelector('.select-popover-list-item-keydown');
718
+ const selectDom = document.querySelector(".".concat(classOneSelect));
719
+ const keydownDom = selectDom.querySelector('.select-popover-list-item-keydown');
759
720
  if (keydownDom) keydownDom.classList.remove('select-popover-list-item-keydown');
760
721
  };
761
722
  /**
762
723
  * 鼠标移出
763
724
  * @param e 移出元素
764
725
  */
765
- var mouseLeave = function mouseLeave(e) {
766
- var target = closest(e.target, '.select-popover-list-item');
726
+ const mouseLeave = e => {
727
+ const target = closest(e.target, '.select-popover-list-item');
767
728
  if (!target) return;
768
729
  target.classList.remove('select-popover-list-item-hover');
769
730
  };
770
731
  // 外标题memo
771
- var OutLabelMemo = useMemo(function () {
772
- var bol = Boolean(label || required || labelSign);
773
- var handLabelClass = function handLabelClass() {
774
- var str = 'select-label';
732
+ const OutLabelMemo = useMemo(() => {
733
+ const bol = Boolean(label || required || labelSign);
734
+ const handLabelClass = () => {
735
+ let str = 'select-label';
775
736
  if (labelTooltip && labelTooltip.className) {
776
737
  str += " ".concat(labelTooltip.className);
777
738
  }
@@ -788,8 +749,8 @@ var Select = function Select(props) {
788
749
  });
789
750
  }, [labelMode, label, labelSign, required, labelTooltip]);
790
751
  // 内标题memo
791
- var InsideMemo = useMemo(function () {
792
- var handInsideContent = function handInsideContent() {
752
+ const InsideMemo = useMemo(() => {
753
+ const handInsideContent = () => {
793
754
  if (labelMode === 'outside') return placeholder;
794
755
  return jsxs(Fragment, {
795
756
  children: [label || placeholder, required && jsx("span", Object.assign({
@@ -812,9 +773,9 @@ var Select = function Select(props) {
812
773
  /**
813
774
  * 处理搜索框
814
775
  * */
815
- var handInput = function handInput(type) {
776
+ const handInput = type => {
816
777
  if (disabled === true) return null;
817
- var str = "".concat(type, "-search-outside");
778
+ const str = "".concat(type, "-search-outside");
818
779
  if (searchModel === 'outside') {
819
780
  return jsx("input", Object.assign({}, searchInputProps, {
820
781
  className: str,
@@ -827,12 +788,12 @@ var Select = function Select(props) {
827
788
  return null;
828
789
  };
829
790
  // 单选内容
830
- var RadioMemo = useMemo(function () {
831
- var handContent = function handContent() {
791
+ const RadioMemo = useMemo(() => {
792
+ const handContent = () => {
832
793
  // 有搜索值且(输入框在内容里面或者有输入赋值)
833
794
  if (searchValue !== '' && (searchModel === 'outside' || input)) return null;
834
- var val = listJson[valueCom[0]] && listJson[valueCom[0]][showName] || valueCom[0];
835
- var renderContentVal = renderContent && renderContent(listJson[valueCom[0]], false);
795
+ const val = listJson[valueCom[0]] && listJson[valueCom[0]][showName] || valueCom[0];
796
+ const renderContentVal = renderContent && renderContent(listJson[valueCom[0]], false);
836
797
  if (overLineCom) return renderContentVal || val;
837
798
  return jsx(AutoTips, Object.assign({
838
799
  placement: 'top-start'
@@ -851,24 +812,23 @@ var Select = function Select(props) {
851
812
  });
852
813
  }, [multiple, showText, overLineCom, listJson, valueCom, showName, search, searchModel, searchValue, disabled, input, searchInputProps, renderContent]);
853
814
  // 多选内容
854
- var CheckMemo = useMemo(function () {
855
- var handContent = function handContent(index) {
856
- var val = listJson[valueCom[index]] && listJson[valueCom[index]][showName] || valueCom[index];
857
- var renderContentVal = renderContent && renderContent(listJson[valueCom[index]], false);
815
+ const CheckMemo = useMemo(() => {
816
+ const handContent = index => {
817
+ const val = listJson[valueCom[index]] && listJson[valueCom[index]][showName] || valueCom[index];
818
+ const renderContentVal = renderContent && renderContent(listJson[valueCom[index]], false);
858
819
  return renderContentVal || val;
859
820
  };
860
821
  return jsx(Fragment, {
861
822
  children: multiple && jsxs("div", Object.assign({
862
823
  className: "check-select-content"
863
824
  }, {
864
- children: [valueCom && valueCom.map(function (item, index) {
825
+ children: [valueCom && valueCom.map((item, index) => {
865
826
  if (morePos !== null && morePos <= index) return null;
866
- var isClose = true;
867
- if (disabled === true || _typeof(disabled) === 'object' && disabled.indexOf(valueCom[index]) !== -1) {
827
+ let isClose = true;
828
+ if (disabled === true || typeof disabled === 'object' && disabled.indexOf(valueCom[index]) !== -1) {
868
829
  isClose = false; // 禁用不显示×
869
830
  }
870
-
871
- var str = 'check-select-content-item check-select-content-item-select';
831
+ let str = 'check-select-content-item check-select-content-item-select';
872
832
  if (!isClose) str += ' check-select-content-item-noclose';
873
833
  return jsxs("div", Object.assign({
874
834
  className: str
@@ -883,7 +843,7 @@ var Select = function Select(props) {
883
843
  onClick: delItem(listJson[valueCom[index]], valueCom[index])
884
844
  })]
885
845
  }), index);
886
- }), function () {
846
+ }), (() => {
887
847
  if (morePos !== null && valueCom.length > morePos) {
888
848
  return jsx("div", Object.assign({
889
849
  className: "check-select-content-item check-select-content-item-more",
@@ -894,20 +854,20 @@ var Select = function Select(props) {
894
854
  })
895
855
  }));
896
856
  }
897
- }(), handInput('check')]
857
+ })(), handInput('check')]
898
858
  }))
899
859
  });
900
860
  }, [multiple, showText, valueCom, morePos, listJson, disabled, onChange, searchValue, search, searchModel, input, searchInputProps, renderContent]);
901
- var clickClean = function clickClean(e) {
861
+ const clickClean = e => {
902
862
  e.stopPropagation();
903
- var val = '';
904
- var valCom = [];
863
+ let val = '';
864
+ const valCom = [];
905
865
  if (multiple) {
906
866
  val = [];
907
867
  // 判断多选的时候,有部分数据被禁用,禁用的数据不可删除
908
868
  if (disabled instanceof Array) {
909
- for (var i = 0, l = valueCom.length; i < l; i++) {
910
- var valueComItem = valueCom[i];
869
+ for (let i = 0, l = valueCom.length; i < l; i++) {
870
+ const valueComItem = valueCom[i];
911
871
  if (disabled.indexOf(valueComItem) !== -1) {
912
872
  val.push(valueComItem);
913
873
  valCom.push(valueComItem);
@@ -923,7 +883,7 @@ var Select = function Select(props) {
923
883
  onClear && onClear();
924
884
  };
925
885
  // 清空内容
926
- var clearRender = function clearRender() {
886
+ const clearRender = () => {
927
887
  if (valueCom.length > 0 && disabled !== true && allowClear) {
928
888
  return jsx("span", Object.assign({
929
889
  className: "clean-up-icon",
@@ -933,10 +893,10 @@ var Select = function Select(props) {
933
893
  }));
934
894
  }
935
895
  };
936
- var morePopoverContent = function morePopoverContent() {
937
- var handContent = function handContent(index) {
938
- var val = listJson[valueCom[index]] && listJson[valueCom[index]][showName] || valueCom[index];
939
- var renderContentVal = renderContent && renderContent(listJson[valueCom[index]], 'more');
896
+ const morePopoverContent = () => {
897
+ const handContent = index => {
898
+ const val = listJson[valueCom[index]] && listJson[valueCom[index]][showName] || valueCom[index];
899
+ const renderContentVal = renderContent && renderContent(listJson[valueCom[index]], 'more');
940
900
  return renderContentVal || val;
941
901
  };
942
902
  return jsxs("div", Object.assign({
@@ -953,13 +913,12 @@ var Select = function Select(props) {
953
913
  })), jsx("div", Object.assign({
954
914
  className: "select-more-content"
955
915
  }, {
956
- children: valueCom && valueCom.map(function (item, index) {
916
+ children: valueCom && valueCom.map((item, index) => {
957
917
  if (morePos !== null && morePos > index) return null;
958
- var isClose = true;
959
- if (disabled === true || _typeof(disabled) === 'object' && disabled.indexOf(valueCom[index]) !== -1) {
918
+ let isClose = true;
919
+ if (disabled === true || typeof disabled === 'object' && disabled.indexOf(valueCom[index]) !== -1) {
960
920
  isClose = false; // 禁用不显示×
961
921
  }
962
-
963
922
  return jsxs("div", Object.assign({
964
923
  className: "select-more-content-item"
965
924
  }, {
@@ -978,7 +937,7 @@ var Select = function Select(props) {
978
937
  }));
979
938
  };
980
939
  // 主体内容
981
- var ContentMemo = useMemo(function () {
940
+ const ContentMemo = useMemo(() => {
982
941
  return jsx(Popover, Object.assign({
983
942
  placement: "rightTop",
984
943
  visible: openMore,
@@ -1000,15 +959,15 @@ var Select = function Select(props) {
1000
959
  }));
1001
960
  }, [posDom, showText, labelMode, placeholder, label, labelSign, required, overLineCom, listJson, valueCom, showName, multiple, morePos, disabled, onChange, searchValue, searchModel, input, showSelect, searchInputProps, allowClear, onClear, openMore, renderContent]);
1002
961
  // 下拉框popover 列表
1003
- var SelectPopoverListMemo = useMemo(function () {
1004
- var handClass = function handClass() {
1005
- var str = 'select-popover-list';
962
+ const SelectPopoverListMemo = useMemo(() => {
963
+ const handClass = () => {
964
+ let str = 'select-popover-list';
1006
965
  if (loading) str += ' select-popover-list-loading';
1007
966
  return str;
1008
967
  };
1009
- var handContent = function handContent(item) {
1010
- var val = item[showName] || item[showValue];
1011
- var renderContentVal = renderContent && renderContent(item, true);
968
+ const handContent = item => {
969
+ const val = item[showName] || item[showValue];
970
+ const renderContentVal = renderContent && renderContent(item, true);
1012
971
  return jsxs(Fragment, {
1013
972
  children: [jsx("span", Object.assign({
1014
973
  className: "select-popover-list-item-label"
@@ -1032,9 +991,9 @@ var Select = function Select(props) {
1032
991
  }
1033
992
  }, {
1034
993
  children: [listCom && listCom.length > 0 ? jsx(Fragment, {
1035
- children: listCom.map(function (item, index) {
994
+ children: listCom.map((item, index) => {
1036
995
  if (item[childrenName] && item[childrenName].length > 0) {
1037
- var childrenList = item[childrenName];
996
+ const childrenList = item[childrenName];
1038
997
  return jsxs("div", Object.assign({
1039
998
  className: "select-popover-list-group"
1040
999
  }, {
@@ -1042,11 +1001,11 @@ var Select = function Select(props) {
1042
1001
  className: "select-popover-list-group-label"
1043
1002
  }, {
1044
1003
  children: item[showName] || item[showValue]
1045
- })), childrenList.map(function (childItem, childIndex) {
1046
- var val = childItem[showValue];
1047
- var classStrItem = 'select-popover-list-item';
1004
+ })), childrenList.map((childItem, childIndex) => {
1005
+ const val = childItem[showValue];
1006
+ let classStrItem = 'select-popover-list-item';
1048
1007
  if (valueCom.indexOf(val) !== -1) classStrItem += ' select-popover-list-item-select'; // 选中的样式
1049
- if (_typeof(disabled) === 'object' && disabled.indexOf(val) !== -1) {
1008
+ if (typeof disabled === 'object' && disabled.indexOf(val) !== -1) {
1050
1009
  // 禁用
1051
1010
  classStrItem += ' select-popover-list-item-disabled';
1052
1011
  }
@@ -1062,10 +1021,10 @@ var Select = function Select(props) {
1062
1021
  })]
1063
1022
  }), index);
1064
1023
  }
1065
- var val = item[showValue];
1066
- var classStrItem = 'select-popover-list-item';
1024
+ const val = item[showValue];
1025
+ let classStrItem = 'select-popover-list-item';
1067
1026
  if (valueCom.indexOf(val) !== -1) classStrItem += ' select-popover-list-item-select'; // 选中的样式
1068
- if (_typeof(disabled) === 'object' && disabled.indexOf(val) !== -1) {
1027
+ if (typeof disabled === 'object' && disabled.indexOf(val) !== -1) {
1069
1028
  // 禁用
1070
1029
  classStrItem += ' select-popover-list-item-disabled';
1071
1030
  }
@@ -1089,10 +1048,10 @@ var Select = function Select(props) {
1089
1048
  }));
1090
1049
  }, [listCom, showName, showValue, valueCom, onChange, multiple, loading, language, locale, emptyProps, emptyBol, renderContent, selectCheckIcon]);
1091
1050
  // 下拉框popover memo
1092
- var SelectPopoverMemo = useMemo(function () {
1051
+ const SelectPopoverMemo = useMemo(() => {
1093
1052
  if (!showSelect) return '';
1094
- var handSelectPopoverMemoClass = function handSelectPopoverMemoClass() {
1095
- var classStr = "select-popover-content ".concat(classOneSelect);
1053
+ const handSelectPopoverMemoClass = () => {
1054
+ let classStr = "select-popover-content ".concat(classOneSelect);
1096
1055
  if (search && searchModel === 'inside') classStr += ' select-popover-content-search';
1097
1056
  return classStr;
1098
1057
  };
@@ -1118,7 +1077,7 @@ var Select = function Select(props) {
1118
1077
  }));
1119
1078
  }, [open, posDom, listCom, childrenName, showValue, showName, valueCom, searchValue, search, classOneSelect, searchModel, multiple, searchPlaceholder, showSelect, loading, searchInputProps, language, locale, emptyProps, emptyBol, renderContent, selectCheckIcon]);
1120
1079
  /** 处理下拉内容 */
1121
- var handDropdown = function handDropdown() {
1080
+ const handDropdown = () => {
1122
1081
  return jsx(Dropdown, Object.assign({
1123
1082
  visible: open,
1124
1083
  placement: 'bottomLeft',
@@ -1128,7 +1087,7 @@ var Select = function Select(props) {
1128
1087
  }),
1129
1088
  overlayClassName: handleClassPopover(),
1130
1089
  getPopupContainer: getPopupContainer,
1131
- onVisibleChange: function onVisibleChange(bol) {
1090
+ onVisibleChange: bol => {
1132
1091
  if (!bol) setOpen(false);
1133
1092
  }
1134
1093
  }, {