@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/Tooltip/index.js CHANGED
@@ -1,14 +1,12 @@
1
- import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
2
1
  import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
3
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
3
  import React__default from 'react';
5
4
  import RcTooltip from 'rc-tooltip';
6
5
  import { placements } from 'rc-tooltip/lib/placements';
7
6
  import clsx from 'clsx';
8
- import { a as $rcPrefixCls, $ as $prefixCls } from '../_verture/constant-0d9802f7.js';
7
+ import { a as $rcPrefixCls, $ as $prefixCls } from '../_verture/constant-5317fc89.js';
9
8
  import Forbid from '@para-ui/icons/Forbid';
10
9
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
11
- import '../_verture/unsupportedIterableToArray-cb478f24.js';
12
10
 
13
11
  //自动调整位置
14
12
  var autoAdjustOverflowEnabled = {
@@ -200,31 +198,27 @@ var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/5/25 下
200
198
  styleInject(css_248z);
201
199
 
202
200
  //tooltip
203
- var Tooltip = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
201
+ const Tooltip = /*#__PURE__*/React__default.forwardRef((props, ref) => {
204
202
  var _a;
205
- var _React$useState = React__default.useState(props.defaultVisible),
206
- _React$useState2 = _slicedToArray(_React$useState, 2),
207
- visible = _React$useState2[0],
208
- setVisible = _React$useState2[1]; //是否显示
209
- var wrapRef = React__default.useRef(); //锚点
210
- var tRef = React__default.useRef(); //实例
211
- var _React$useState3 = React__default.useState([0, 0]),
212
- _React$useState4 = _slicedToArray(_React$useState3, 2),
213
- targetOffset = _React$useState4[0],
214
- setTargetOffset = _React$useState4[1];
215
- React__default.useEffect(function () {
203
+ const [visible, setVisible] = React__default.useState(props.defaultVisible); //是否显示
204
+ const wrapRef = React__default.useRef(); //锚点
205
+ const tRef = React__default.useRef(); //实例
206
+ const [targetOffset, setTargetOffset] = React__default.useState([0, 0]);
207
+ React__default.useEffect(() => {
216
208
  var _a;
217
209
  if ('visible' in props || 'open' in props) {
218
210
  setVisible(!!((_a = props.visible) !== null && _a !== void 0 ? _a : props.open));
219
211
  }
220
212
  }, [(_a = props.visible) !== null && _a !== void 0 ? _a : props.open]);
221
213
  //no title
222
- var isUntitled = function isUntitled() {
223
- var title = props.title;
214
+ const isUntitled = () => {
215
+ const {
216
+ title
217
+ } = props;
224
218
  return !title && title !== 0;
225
219
  };
226
220
  //浮层切换时回调
227
- var onVisibleChange = function onVisibleChange(vis) {
221
+ const onVisibleChange = vis => {
228
222
  var _a;
229
223
  if (!('visible' in props || 'open' in props)) {
230
224
  setVisible(isUntitled() ? false : vis);
@@ -234,26 +228,26 @@ var Tooltip = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
234
228
  }
235
229
  };
236
230
  //tooltip 弹出位置
237
- var getTooltipPlacements = function getTooltipPlacements() {
238
- var builtinPlacements = props.builtinPlacements,
239
- autoAdjustOverflow = props.autoAdjustOverflow;
231
+ const getTooltipPlacements = () => {
232
+ const {
233
+ builtinPlacements,
234
+ autoAdjustOverflow
235
+ } = props;
240
236
  return builtinPlacements || getPlacements({
241
- autoAdjustOverflow: autoAdjustOverflow
237
+ autoAdjustOverflow
242
238
  });
243
239
  };
244
240
  // 动态设置动画点
245
- var onPopupAlign = function onPopupAlign(domNode, align) {
246
- var placements = getTooltipPlacements();
241
+ const onPopupAlign = (domNode, align) => {
242
+ const placements = getTooltipPlacements();
247
243
  // 当前返回的位置
248
- var placement = Object.keys(placements).find(function (key) {
249
- return placements[key].points[0] === align.points[0] && placements[key].points[1] === align.points[1];
250
- });
244
+ const placement = Object.keys(placements).find(key => placements[key].points[0] === align.points[0] && placements[key].points[1] === align.points[1]);
251
245
  if (!placement) {
252
246
  return;
253
247
  }
254
248
  // 根据当前坐标设置动画点
255
- var rect = domNode.getBoundingClientRect();
256
- var transformOrigin = {
249
+ const rect = domNode.getBoundingClientRect();
250
+ const transformOrigin = {
257
251
  top: '50%',
258
252
  left: '50%'
259
253
  };
@@ -270,44 +264,46 @@ var Tooltip = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
270
264
  domNode.style.transformOrigin = "".concat(transformOrigin.left, " ").concat(transformOrigin.top);
271
265
  };
272
266
  //跟随光标
273
- var handleMouseMove = function handleMouseMove(e) {
267
+ const handleMouseMove = e => {
274
268
  var _a, _b, _c, _d;
275
269
  if (wrapRef.current) {
276
- var popupHeight = ((_d = (_c = (_b = (_a = tRef.current) === null || _a === void 0 ? void 0 : _a.popupRef) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.getElement()) === null || _d === void 0 ? void 0 : _d.offsetHeight) || 0;
277
- var cursorSpace = popupHeight === 0 ? 60 : 30;
278
- var _wrapRef$current$getB = wrapRef.current.getBoundingClientRect(),
279
- x = _wrapRef$current$getB.x,
280
- y = _wrapRef$current$getB.y,
281
- width = _wrapRef$current$getB.width;
282
- var newX = e.clientX - (x + width / 2);
283
- var newY = e.clientY - y + popupHeight + cursorSpace;
284
- setTimeout(function () {
270
+ const popupHeight = ((_d = (_c = (_b = (_a = tRef.current) === null || _a === void 0 ? void 0 : _a.popupRef) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.getElement()) === null || _d === void 0 ? void 0 : _d.offsetHeight) || 0;
271
+ const cursorSpace = popupHeight === 0 ? 60 : 30;
272
+ const {
273
+ x,
274
+ y,
275
+ width
276
+ } = wrapRef.current.getBoundingClientRect();
277
+ const newX = e.clientX - (x + width / 2);
278
+ const newY = e.clientY - y + popupHeight + cursorSpace;
279
+ setTimeout(() => {
285
280
  setTargetOffset([-newX, -newY]);
286
281
  });
287
282
  }
288
283
  };
289
- var _props$prefixCls = props.prefixCls,
290
- prefixCls = _props$prefixCls === void 0 ? "".concat($rcPrefixCls, "-tooltip") : _props$prefixCls,
291
- getPopupContainer = props.getPopupContainer,
292
- overlayClassName = props.overlayClassName,
293
- overlayInnerStyle = props.overlayInnerStyle,
294
- overlayStyle = props.overlayStyle,
295
- children = props.children,
296
- title = props.title,
297
- placement = props.placement,
298
- isPopover = props.isPopover,
299
- followCursor = props.followCursor,
300
- maxWidth = props.maxWidth,
301
- disabled = props.disabled,
284
+ const {
285
+ prefixCls = "".concat($rcPrefixCls, "-tooltip"),
286
+ getPopupContainer,
287
+ overlayClassName,
288
+ overlayInnerStyle,
289
+ overlayStyle,
290
+ children,
291
+ title,
292
+ placement,
293
+ isPopover,
294
+ followCursor,
295
+ maxWidth,
296
+ disabled
297
+ } = props,
302
298
  restProps = __rest(props, ["prefixCls", "getPopupContainer", "overlayClassName", "overlayInnerStyle", "overlayStyle", "children", "title", "placement", "isPopover", "followCursor", "maxWidth", "disabled"]);
303
- var tempVisible = visible;
299
+ let tempVisible = visible;
304
300
  if (!('visible' in props || 'open' in props) && isUntitled()) {
305
301
  //没有title必然不可见
306
302
  tempVisible = false;
307
303
  }
308
304
  //overlayCls
309
- var overlayCls = clsx(!isPopover && "".concat($prefixCls, "-tooltip"), overlayClassName);
310
- var mergeOverlayStyle = Object.assign({}, overlayStyle);
305
+ const overlayCls = clsx(!isPopover && "".concat($prefixCls, "-tooltip"), overlayClassName);
306
+ const mergeOverlayStyle = Object.assign({}, overlayStyle);
311
307
  if (maxWidth) {
312
308
  mergeOverlayStyle.maxWidth = maxWidth;
313
309
  }
@@ -325,7 +321,7 @@ var Tooltip = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
325
321
  }),
326
322
  visible: tempVisible,
327
323
  align: {
328
- targetOffset: targetOffset
324
+ targetOffset
329
325
  },
330
326
  onVisibleChange: onVisibleChange,
331
327
  onPopupAlign: onPopupAlign,
package/Transfer/index.js CHANGED
@@ -1,5 +1,3 @@
1
- import { _ as _toConsumableArray } from '../_verture/toConsumableArray-8f4c9589.js';
2
- import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
3
1
  import { jsxs, jsx } from 'react/jsx-runtime';
4
2
  import { useRef, useState, useEffect, useCallback } from 'react';
5
3
  import clsx from 'clsx';
@@ -8,26 +6,25 @@ import NavigateBefore from '@para-ui/icons/Left';
8
6
  import Right from '@para-ui/icons/Right';
9
7
  import ExpandLess from '@para-ui/icons/Up';
10
8
  import Down from '@para-ui/icons/Down';
11
- import { u as useFormatMessage } from '../_verture/useFormatMessage-703f8b20.js';
12
- import { $ as $prefixCls } from '../_verture/constant-0d9802f7.js';
9
+ import { u as useFormatMessage } from '../_verture/useFormatMessage-eb13cf56.js';
10
+ import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
11
+ import { _ as _slicedToArray } from '../_verture/slicedToArray-75fa4188.js';
13
12
  import { Search } from '../Search/index.js';
14
13
  import SearchIcon from '@para-ui/icons/Search';
15
14
  import AutoTips from '../AutoTips/index.js';
16
15
  import Drag from '@para-ui/icons/Drag';
17
16
  import { S as Sortable } from '../_verture/sortable.esm-49896035.js';
18
- import { d as debounce } from '../_verture/utils-418da0a4.js';
17
+ import { d as debounce } from '../_verture/utils-c17b5265.js';
19
18
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
20
- import '../_verture/unsupportedIterableToArray-cb478f24.js';
21
- import '../_verture/typeof-adeedc13.js';
22
19
  import '../_verture/tslib.es6-55ed4bd2.js';
23
20
  import '@para-ui/icons/LoadingF';
24
21
  import '../Tooltip/index.js';
25
22
  import 'rc-tooltip';
26
23
  import 'rc-tooltip/lib/placements';
27
24
  import '@para-ui/icons/Forbid';
28
- import '../_verture/index-e9007d6a.js';
25
+ import '../_verture/index-da9097d3.js';
29
26
  import 'rc-dropdown';
30
- import '../_verture/usePopupContainer-87febeb9.js';
27
+ import '../_verture/usePopupContainer-635f66f4.js';
31
28
  import 'dayjs';
32
29
  import '@paraview/lib';
33
30
  import '@para-ui/core/GlobalContext';
@@ -40,8 +37,7 @@ import '@para-ui/icons/PreviewOpen';
40
37
  import '@para-ui/icons/CloseCircleF';
41
38
  import '../Loading/index.js';
42
39
  import '../HelperText/index.js';
43
- import '../_verture/useGlobalProps-1b846a65.js';
44
- import '../_verture/defineProperty-1d116156.js';
40
+ import '../_verture/useGlobalProps-1e416658.js';
45
41
 
46
42
  var en = {
47
43
  left: 'Left',
@@ -264,112 +260,80 @@ var Sortablejs = Sortable;
264
260
  var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-transfer {\n display: flex;\n font-size: 14px;\n user-select: none;\n}\n.paraui-v4-transfer .blue-background-class {\n background-color: rgb(240, 245, 255);\n}\n.paraui-v4-transfer .drag-item {\n background: rgb(255, 255, 255) !important;\n box-shadow: rgba(212, 218, 227, 0.4);\n}\n.paraui-v4-transfer .box {\n border-radius: 4px;\n border: 1px solid rgb(212, 218, 227);\n overflow: hidden;\n}\n.paraui-v4-transfer .box .box-header {\n background: rgb(247, 248, 250);\n color: rgb(29, 33, 38);\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-left: 10px;\n height: 36px;\n border-bottom: 1px solid rgb(212, 218, 227);\n}\n.paraui-v4-transfer .box .count {\n color: rgb(29, 33, 38);\n letter-spacing: 1px;\n}\n.paraui-v4-transfer .box .context {\n height: 400px;\n overflow: auto;\n scrollbar-base-color: red;\n margin-top: 4px;\n}\n.paraui-v4-transfer .box .context .item-fluctuation {\n animation: flucturation 0.4s forwards;\n}\n.paraui-v4-transfer .box .context .item-fluctuationOrther {\n animation: flucturationOrther 0.5s forwards;\n}\n.paraui-v4-transfer .box .context .item {\n padding: 0px 10px;\n height: 30px;\n display: flex;\n align-items: center;\n cursor: pointer;\n}\n.paraui-v4-transfer .box .context .item.item-checked:hover {\n background-color: rgb(247, 248, 250) !important;\n}\n.paraui-v4-transfer .box .context .item.item-checked > .item-label {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-transfer .box .context .item > .item-label {\n flex: 1;\n overflow: hidden;\n color: rgb(29, 33, 38);\n}\n.paraui-v4-transfer .box .context .item:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-transfer .box .context .item.item-disabled:hover {\n background: inherit;\n cursor: no-drop;\n}\n.paraui-v4-transfer .box .context .item.item-disabled > .item-label {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-transfer .box .context .item .handle {\n margin-left: 8px;\n display: flex;\n align-content: center;\n}\n.paraui-v4-transfer .box .context .item .handle .handle-line {\n height: 12px;\n border-left: 1px solid rgb(212, 218, 227);\n margin: auto 10px auto 0;\n}\n.paraui-v4-transfer .box .context .item .handle svg {\n color: rgb(92, 101, 115);\n}\n.paraui-v4-transfer .box .context .item .handle:hover svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-transfer .box .context .item-border {\n padding-left: 6px;\n}\n.paraui-v4-transfer .box .text-field-content {\n border: none;\n border-radius: 0;\n border-bottom: 1px solid rgb(212, 218, 227);\n}\n.paraui-v4-transfer .box .footer {\n display: flex;\n align-items: center;\n border-top: 1px solid rgb(212, 218, 227);\n height: 36px;\n justify-content: space-between;\n padding: 0 10px;\n}\n.paraui-v4-transfer .box .footer > div:nth-child(1) button {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-transfer .box .footer > div:nth-child(1) button:hover {\n color: rgb(87, 131, 235);\n}\n.paraui-v4-transfer .box .footer > div:nth-child(1) .btn-off {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-transfer .box .footer > div:nth-child(1) .btn-off:hover {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-transfer .box .footer > div:nth-child(1) > button {\n padding: 0;\n}\n.paraui-v4-transfer .box .footer > div:nth-child(1) > button:nth-child(2) {\n margin-left: 16px;\n}\n.paraui-v4-transfer ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background: rgba(255, 255, 255, 0.5);\n}\n.paraui-v4-transfer .moveBtn {\n display: flex;\n height: 500px;\n flex-direction: column;\n justify-content: center;\n margin: 0 20px;\n}\n.paraui-v4-transfer .moveBtn > button {\n background-color: rgb(46, 101, 230);\n color: rgb(255, 255, 255);\n}\n.paraui-v4-transfer .moveBtn .btn-left {\n margin-top: 16px;\n}\n\n@keyframes flucturation {\n 0% {\n transform: translateY(0);\n }\n 100% {\n transform: translateY(36px);\n }\n}\n@keyframes flucturationOrther {\n 0% {\n transform: translateY(0);\n }\n 100% {\n transform: translateY(-36px);\n }\n}";
265
261
  styleInject(css_248z);
266
262
 
267
- var Transfer = function Transfer(props) {
263
+ const Transfer = props => {
268
264
  var _a, _b, _c, _d;
269
- var intl = useFormatMessage('Transfer', localeJson);
270
- var _props$data = props.data,
271
- data = _props$data === void 0 ? [] : _props$data,
272
- value = props.value,
273
- _props$customKey = props.customKey,
274
- customKey = _props$customKey === void 0 ? 'key' : _props$customKey,
275
- onChange = props.onChange,
276
- _props$titles = props.titles,
277
- titles = _props$titles === void 0 ? [intl({
265
+ const intl = useFormatMessage('Transfer', localeJson);
266
+ const {
267
+ data = [],
268
+ value,
269
+ customKey = 'key',
270
+ onChange,
271
+ titles = [intl({
278
272
  id: 'left'
279
273
  }), intl({
280
274
  id: 'right'
281
- })] : _props$titles,
282
- className = props.className,
283
- _props$style = props.style,
284
- style = _props$style === void 0 ? {
275
+ })],
276
+ // ['左侧', '右侧']
277
+ className,
278
+ style = {
285
279
  width: '298px'
286
- } : _props$style,
287
- onSort = props.onSort,
288
- _props$trim = props.trim,
289
- trim = _props$trim === void 0 ? false : _props$trim,
290
- _props$multiple = props.multiple,
291
- multiple = _props$multiple === void 0 ? true : _props$multiple,
292
- rightIcon = props.rightIcon,
293
- _props$render = props.render,
294
- render = _props$render === void 0 ? function (item) {} : _props$render;
295
- var _useState = useState({}),
296
- _useState2 = _slicedToArray(_useState, 2),
297
- transData = _useState2[0],
298
- setTransData = _useState2[1];
299
- var _useState3 = useState([]),
300
- _useState4 = _slicedToArray(_useState3, 2),
301
- leftData = _useState4[0],
302
- setLeftData = _useState4[1];
303
- var _useState5 = useState([]),
304
- _useState6 = _slicedToArray(_useState5, 2),
305
- rightData = _useState6[0],
306
- setRightData = _useState6[1];
307
- var _useState7 = useState([]),
308
- _useState8 = _slicedToArray(_useState7, 2),
309
- leftCount = _useState8[0],
310
- setLeftCount = _useState8[1];
311
- var _useState9 = useState([]),
312
- _useState10 = _slicedToArray(_useState9, 2),
313
- rightCount = _useState10[0],
314
- setRightCount = _useState10[1];
315
- var _useState11 = useState(),
316
- _useState12 = _slicedToArray(_useState11, 2),
317
- fluctuationPosition = _useState12[0];
318
- _useState12[1];
319
- var _useState13 = useState(),
320
- _useState14 = _slicedToArray(_useState13, 2),
321
- fluctuationOrther = _useState14[0];
322
- _useState14[1];
323
- var _useState15 = useState(false),
324
- _useState16 = _slicedToArray(_useState15, 2),
325
- animationsLock = _useState16[0],
326
- setAnimationLock = _useState16[1];
327
- var onchange = useCallback(function (e, bol, index, direction, multiple) {
280
+ },
281
+ onSort,
282
+ trim = false,
283
+ multiple = true,
284
+ rightIcon,
285
+ render = item => {}
286
+ } = props;
287
+ const [transData, setTransData] = useState({});
288
+ const [leftData, setLeftData] = useState([]);
289
+ const [rightData, setRightData] = useState([]);
290
+ const [leftCount, setLeftCount] = useState([]);
291
+ const [rightCount, setRightCount] = useState([]);
292
+ const [fluctuationPosition, setFluctuationPosition] = useState();
293
+ const [fluctuationOrther, setFluctuationOrther] = useState();
294
+ const [animationsLock, setAnimationLock] = useState(false);
295
+ const onchange = useCallback((e, bol, index, direction, multiple) => {
328
296
  if (direction === 'left') {
329
- !multiple && leftData.forEach(function (item) {
330
- return item.checked = false;
331
- });
297
+ !multiple && leftData.forEach(item => item.checked = false);
332
298
  leftData[index].checked = bol;
333
- setLeftData(_toConsumableArray(leftData));
299
+ setLeftData([...leftData]);
334
300
  } else {
335
- !multiple && rightData.forEach(function (item) {
336
- return item.checked = false;
337
- });
301
+ !multiple && rightData.forEach(item => item.checked = false);
338
302
  rightData[index].checked = bol;
339
- setRightData(_toConsumableArray(rightData));
303
+ setRightData([...rightData]);
340
304
  }
341
305
  }, [leftData, rightData]);
342
- var queryAll = useCallback(function (checked, direction) {
306
+ const queryAll = useCallback((checked, direction) => {
343
307
  if (direction === 'left') {
344
- leftData.forEach(function (item) {
308
+ leftData.forEach(item => {
345
309
  if (!item.disabled && !item.hide) item.checked = checked;
346
310
  });
347
- setLeftData(_toConsumableArray(leftData));
311
+ setLeftData([...leftData]);
348
312
  } else {
349
- rightData.forEach(function (item) {
313
+ rightData.forEach(item => {
350
314
  if (!item.disabled && !item.hide) item.checked = checked;
351
315
  });
352
- setRightData(_toConsumableArray(rightData));
316
+ setRightData([...rightData]);
353
317
  }
354
318
  }, [leftData, rightData]);
355
- var inverse = useCallback(function (direction) {
319
+ const inverse = useCallback(direction => {
356
320
  if (direction === 'left') {
357
- leftData.forEach(function (item) {
321
+ leftData.forEach(item => {
358
322
  if (!item.disabled && !item.hide) item.checked = !item.checked;
359
323
  });
360
- setLeftData(_toConsumableArray(leftData));
324
+ setLeftData([...leftData]);
361
325
  } else {
362
- rightData.forEach(function (item) {
326
+ rightData.forEach(item => {
363
327
  if (!item.disabled && !item.hide) item.checked = !item.checked;
364
328
  });
365
- setRightData(_toConsumableArray(rightData));
329
+ setRightData([...rightData]);
366
330
  }
367
331
  }, [leftData, rightData]);
368
- var onMove = function onMove(direction) {
369
- var newData = [];
332
+ const onMove = direction => {
333
+ let newData = [];
370
334
  if (direction === 'left') {
371
- newData = _toConsumableArray(rightData);
372
- newData.forEach(function (item) {
335
+ newData = [...rightData];
336
+ newData.forEach(item => {
373
337
  if ((item === null || item === void 0 ? void 0 : item.checked) && !(item === null || item === void 0 ? void 0 : item.hide)) {
374
338
  item.checked = false;
375
339
  leftData.push(item);
@@ -377,8 +341,8 @@ var Transfer = function Transfer(props) {
377
341
  }
378
342
  });
379
343
  } else {
380
- newData = _toConsumableArray(leftData);
381
- newData.forEach(function (item) {
344
+ newData = [...leftData];
345
+ newData.forEach(item => {
382
346
  if ((item === null || item === void 0 ? void 0 : item.checked) && !(item === null || item === void 0 ? void 0 : item.hide)) {
383
347
  item.checked = false;
384
348
  rightData.push(item);
@@ -386,132 +350,131 @@ var Transfer = function Transfer(props) {
386
350
  }
387
351
  });
388
352
  }
389
- setLeftData(_toConsumableArray(leftData));
390
- setRightData(_toConsumableArray(rightData));
391
- var rArr = [];
392
- rightData.forEach(function (item) {
353
+ setLeftData([...leftData]);
354
+ setRightData([...rightData]);
355
+ const rArr = [];
356
+ rightData.forEach(item => {
393
357
  rArr.push(item[customKey]);
394
358
  });
395
359
  onChange === null || onChange === void 0 ? void 0 : onChange(rArr);
396
360
  };
397
361
  // 上下移动
398
- var fluctuation = function fluctuation(direction) {
362
+ const fluctuation = direction => {
399
363
  setAnimationLock(true);
400
364
  if (direction == 'up') {
401
365
  // setFluctuationPosition(rightCount[0] - 1)
402
366
  // setFluctuationOrther(rightCount[0])
403
367
  // setTimeout(() => {
404
- setRightData(function (pre) {
368
+ setRightData(pre => {
405
369
  // setFluctuationPosition(undefined)
406
370
  // setFluctuationOrther(undefined)
407
- rightCount.forEach(function (item) {
408
- pre.splice.apply(pre, [item - 1, 0].concat(_toConsumableArray(pre.splice(item, 1))));
371
+ rightCount.forEach(item => {
372
+ pre.splice(item - 1, 0, ...pre.splice(item, 1));
409
373
  });
410
374
  setAnimationLock(false);
411
- var rArr = [];
412
- pre.forEach(function (item) {
375
+ const rArr = [];
376
+ pre.forEach(item => {
413
377
  rArr.push(item[customKey]);
414
378
  });
415
- onSort === null || onSort === void 0 ? void 0 : onSort([].concat(rArr));
416
- onChange === null || onChange === void 0 ? void 0 : onChange([].concat(rArr));
417
- return _toConsumableArray(pre);
379
+ onSort === null || onSort === void 0 ? void 0 : onSort([...rArr]);
380
+ onChange === null || onChange === void 0 ? void 0 : onChange([...rArr]);
381
+ return [...pre];
418
382
  });
419
383
  // }, 400)
420
384
  } else {
421
385
  // setFluctuationPosition(rightCount[0])
422
386
  // setFluctuationOrther(rightCount[0] + 1)
423
387
  // setTimeout(() => {
424
- setRightData(function (pre) {
388
+ setRightData(pre => {
425
389
  // setFluctuationPosition(undefined)
426
390
  // setFluctuationOrther(undefined)
427
- rightCount.reverse().forEach(function (item) {
428
- pre.splice.apply(pre, [item + 1, 0].concat(_toConsumableArray(pre.splice(item, 1))));
391
+ rightCount.reverse().forEach(item => {
392
+ pre.splice(item + 1, 0, ...pre.splice(item, 1));
429
393
  });
430
394
  setAnimationLock(false);
431
- var rArr = [];
432
- pre.forEach(function (item) {
395
+ const rArr = [];
396
+ pre.forEach(item => {
433
397
  rArr.push(item[customKey]);
434
398
  });
435
- onSort === null || onSort === void 0 ? void 0 : onSort([].concat(rArr));
436
- onChange === null || onChange === void 0 ? void 0 : onChange([].concat(rArr));
437
- return _toConsumableArray(pre);
399
+ onSort === null || onSort === void 0 ? void 0 : onSort([...rArr]);
400
+ onChange === null || onChange === void 0 ? void 0 : onChange([...rArr]);
401
+ return [...pre];
438
402
  });
439
403
  // }, 400)
440
404
  }
441
405
  };
442
-
443
- var onSearch = debounce(function (e, direction) {
444
- var str = trim ? e.toUpperCase().trim() : e.toUpperCase();
406
+ const onSearch = debounce((e, direction) => {
407
+ const str = trim ? e.toUpperCase().trim() : e.toUpperCase();
445
408
  if (direction === 'left') {
446
- leftData.forEach(function (item) {
409
+ leftData.forEach(item => {
447
410
  item.hide = false;
448
- var name = (item.name || '').toUpperCase();
449
- var description = (item.description || '').toUpperCase();
411
+ const name = (item.name || '').toUpperCase();
412
+ const description = (item.description || '').toUpperCase();
450
413
  if (!(name.indexOf(str) !== -1 || description.indexOf(str) !== -1)) {
451
414
  item.hide = true;
452
415
  }
453
416
  });
454
- setLeftData(_toConsumableArray(leftData));
417
+ setLeftData([...leftData]);
455
418
  } else {
456
- rightData.filter(function (item) {
419
+ rightData.filter(item => {
457
420
  item.hide = false;
458
- var name = (item.name || '').toUpperCase();
459
- var description = (item.description || '').toUpperCase();
421
+ const name = (item.name || '').toUpperCase();
422
+ const description = (item.description || '').toUpperCase();
460
423
  if (!(name.indexOf(str) !== -1 || description.indexOf(str) !== -1)) {
461
424
  item.hide = true;
462
425
  }
463
426
  });
464
- setRightData(_toConsumableArray(rightData));
427
+ setRightData([...rightData]);
465
428
  }
466
429
  }, 500);
467
- var onEndSort = useCallback(function (oldIndex, newIndex) {
468
- setRightData(function (pre) {
469
- pre.splice.apply(pre, [newIndex, 0].concat(_toConsumableArray(pre.splice(oldIndex, 1))));
470
- var rArr = [];
471
- pre.forEach(function (item) {
430
+ const onEndSort = useCallback((oldIndex, newIndex) => {
431
+ setRightData(pre => {
432
+ pre.splice(newIndex, 0, ...pre.splice(oldIndex, 1));
433
+ const rArr = [];
434
+ pre.forEach(item => {
472
435
  rArr.push(item[customKey]);
473
436
  });
474
- onSort === null || onSort === void 0 ? void 0 : onSort([].concat(rArr));
475
- onChange === null || onChange === void 0 ? void 0 : onChange([].concat(rArr));
476
- return _toConsumableArray(pre);
437
+ onSort === null || onSort === void 0 ? void 0 : onSort([...rArr]);
438
+ onChange === null || onChange === void 0 ? void 0 : onChange([...rArr]);
439
+ return [...pre];
477
440
  });
478
441
  }, []);
479
- useEffect(function () {
442
+ useEffect(() => {
480
443
  if (data.length) {
481
- var _leftData = {};
482
- data.forEach(function (item) {
483
- var key = item[customKey];
444
+ const leftData = {};
445
+ data.forEach(item => {
446
+ const key = item[customKey];
484
447
  render(item);
485
- _leftData[key] = item;
448
+ leftData[key] = item;
486
449
  });
487
- setTransData(Object.assign({}, _leftData));
450
+ setTransData(Object.assign({}, leftData));
488
451
  }
489
452
  }, [data]);
490
- useEffect(function () {
491
- var rData = [];
492
- var lData = [];
493
- value === null || value === void 0 ? void 0 : value.forEach(function (item) {
453
+ useEffect(() => {
454
+ const rData = [];
455
+ const lData = [];
456
+ value === null || value === void 0 ? void 0 : value.forEach(item => {
494
457
  if (transData[item]) {
495
458
  rData.push(transData[item]);
496
459
  delete transData[item];
497
460
  }
498
461
  });
499
- for (var key in transData) {
462
+ for (const key in transData) {
500
463
  lData.push(transData[key]);
501
464
  }
502
- setRightData([].concat(rData));
503
- setLeftData([].concat(lData));
465
+ setRightData([...rData]);
466
+ setLeftData([...lData]);
504
467
  }, [value, transData]);
505
- useEffect(function () {
506
- var arr = [];
507
- leftData.forEach(function (item, index) {
468
+ useEffect(() => {
469
+ const arr = [];
470
+ leftData.forEach((item, index) => {
508
471
  if (item.checked && !item.hide) {
509
472
  arr.push(index);
510
473
  }
511
474
  });
512
475
  setLeftCount(arr);
513
- var rArr = [];
514
- rightData.forEach(function (item, index) {
476
+ const rArr = [];
477
+ rightData.forEach((item, index) => {
515
478
  if (item.checked && !item.hide) {
516
479
  rArr.push(index);
517
480
  }
@@ -547,7 +510,7 @@ var Transfer = function Transfer(props) {
547
510
  arrow: false,
548
511
  placement: 'bottomLeft'
549
512
  },
550
- onClick: function onClick() {
513
+ onClick: () => {
551
514
  onMove('right');
552
515
  }
553
516
  }, {
@@ -562,7 +525,7 @@ var Transfer = function Transfer(props) {
562
525
  arrow: false,
563
526
  placement: 'bottomLeft'
564
527
  },
565
- onClick: function onClick() {
528
+ onClick: () => {
566
529
  fluctuation('up');
567
530
  }
568
531
  }, {
@@ -577,7 +540,7 @@ var Transfer = function Transfer(props) {
577
540
  arrow: false,
578
541
  placement: 'bottomLeft'
579
542
  },
580
- onClick: function onClick() {
543
+ onClick: () => {
581
544
  fluctuation('down');
582
545
  }
583
546
  }, {
@@ -592,7 +555,7 @@ var Transfer = function Transfer(props) {
592
555
  arrow: false,
593
556
  placement: 'bottomLeft'
594
557
  },
595
- onClick: function onClick() {
558
+ onClick: () => {
596
559
  onMove('left');
597
560
  }
598
561
  }, {
@@ -617,6 +580,6 @@ var Transfer = function Transfer(props) {
617
580
  })]
618
581
  }));
619
582
  };
620
- var SSortablejs = Sortablejs;
583
+ const SSortablejs = Sortablejs;
621
584
 
622
585
  export { SSortablejs, Transfer, Transfer as default };