@para-ui/core 4.0.0-rc.4 → 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 (179) 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 +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/Container/index.js +17 -21
  17. package/CopyText/index.js +50 -83
  18. package/DatePicker/index.js +22 -27
  19. package/Descriptions/index.js +50 -59
  20. package/Desktop/index.js +161 -180
  21. package/DragVerify/index.js +77 -113
  22. package/Drawer/index.js +80 -95
  23. package/Dropdown/index.js +3 -3
  24. package/DynamicMultiBox/index.js +219 -224
  25. package/DynamicMultiBox/interface.d.ts +7 -0
  26. package/Empty/index.js +26 -28
  27. package/Form/index.js +66 -74
  28. package/FormItem/index.js +14 -15
  29. package/FunctionModal/index.js +7 -14
  30. package/GlobalContext/index.js +17 -20
  31. package/Help/index.js +9 -12
  32. package/HelperText/index.js +11 -11
  33. package/InputLang/index.js +104 -124
  34. package/InputNumber/index.js +62 -81
  35. package/Label/index.js +19 -21
  36. package/Loading/index.js +11 -10
  37. package/Menu/index.js +302 -371
  38. package/Message/index.js +104 -113
  39. package/Modal/index.js +122 -148
  40. package/MultiBox/index.d.ts +5 -0
  41. package/MultiBox/index.js +111 -115
  42. package/Notification/index.js +105 -103
  43. package/OperateBtn/index.d.ts +3 -0
  44. package/OperateBtn/index.js +77 -107
  45. package/PageHeader/index.js +327 -406
  46. package/Pagination/index.js +107 -137
  47. package/ParauiProvider/index.js +20 -22
  48. package/PasswordRules/index.js +36 -40
  49. package/PopConfirm/index.js +60 -77
  50. package/Popover/index.js +12 -12
  51. package/Progress/index.js +72 -74
  52. package/Querying/index.js +22 -23
  53. package/README.md +2 -0
  54. package/Radio/index.js +27 -34
  55. package/RadioGroup/index.js +38 -52
  56. package/Search/index.js +34 -43
  57. package/Select/index.js +281 -345
  58. package/SelectInput/index.js +8 -13
  59. package/Selector/index.js +905 -796
  60. package/SelectorPicker/index.js +111 -133
  61. package/SingleBox/index.d.ts +5 -0
  62. package/SingleBox/index.js +92 -88
  63. package/Slider/index.js +46 -57
  64. package/Status/index.js +14 -13
  65. package/Stepper/index.js +25 -26
  66. package/Styles/theme.scss +9 -9
  67. package/Switch/index.js +32 -35
  68. package/Table/index.js +767 -963
  69. package/Tabs/index.js +102 -102
  70. package/Tag/index.js +115 -162
  71. package/TextEditor/index.js +81 -103
  72. package/TextField/index.js +142 -183
  73. package/TimePicker/index.js +27 -28
  74. package/Timeline/index.js +67 -58
  75. package/Title/index.js +32 -34
  76. package/ToggleButton/index.js +53 -52
  77. package/Tooltip/index.js +79 -82
  78. package/Transfer/index.js +159 -201
  79. package/Tree/index.js +7 -12
  80. package/Upload/index.js +523 -758
  81. package/Upload/interface.d.ts +2 -0
  82. package/_verture/{constant-0d9802f7.js → constant-5317fc89.js} +2 -2
  83. package/_verture/{index-5a7e2438.js → index-0ced30f7.js} +1127 -1079
  84. package/_verture/{index-024bbc9b.js → index-775ad32d.js} +29 -25
  85. package/_verture/{index-05f7bf11.js → index-c568f272.js} +2 -2
  86. package/_verture/index-da9097d3.js +239 -0
  87. package/_verture/{index-9331b116.js → index-ef1235fb.js} +125 -134
  88. package/_verture/{index-b1f80962.js → index-f186b5e8.js} +314 -398
  89. package/_verture/intl-f2f27722.js +69 -0
  90. package/_verture/{modalContext-736ff215.js → modalContext-5df08980.js} +36 -64
  91. package/_verture/{slicedToArray-a8206399.js → slicedToArray-8223a2ef.js} +15 -2
  92. package/_verture/{useFormatMessage-703f8b20.js → useFormatMessage-eb13cf56.js} +5 -4
  93. package/_verture/{useGlobalProps-1b846a65.js → useGlobalProps-1e416658.js} +4 -3
  94. package/_verture/{usePopupContainer-87febeb9.js → usePopupContainer-635f66f4.js} +16 -15
  95. package/_verture/{util-7e1fb1e2.js → util-82646c4f.js} +5 -4
  96. package/_verture/{utils-418da0a4.js → utils-46e99c9a.js} +34 -25
  97. package/index.js +21 -22
  98. package/locale/index.js +6 -6
  99. package/package.json +1 -1
  100. package/umd/AutoBox.js +9 -8
  101. package/umd/AutoTips.js +9 -8
  102. package/umd/Badge.js +1 -1
  103. package/umd/Breadcrumbs.js +9 -8
  104. package/umd/Button.js +9 -8
  105. package/umd/ButtonGroup.js +9 -8
  106. package/umd/Carousel.js +5 -5
  107. package/umd/Cascader.js +9 -8
  108. package/umd/Checkbox.js +9 -8
  109. package/umd/CheckboxGroup.js +9 -8
  110. package/umd/Collapse.js +8 -7
  111. package/umd/CollapseBox.js +1 -1
  112. package/umd/CollapseLayout.js +4 -4
  113. package/umd/ColorPicker.js +1 -1
  114. package/umd/ComboSelect.js +9 -8
  115. package/umd/Container.js +1 -1
  116. package/umd/CopyText.js +9 -8
  117. package/umd/DatePicker.js +9 -8
  118. package/umd/Descriptions.js +9 -8
  119. package/umd/Desktop.js +9 -8
  120. package/umd/DragVerify.js +4 -4
  121. package/umd/Drawer.js +9 -8
  122. package/umd/Dropdown.js +6 -5
  123. package/umd/DynamicMultiBox.js +11 -10
  124. package/umd/Empty.js +1 -1
  125. package/umd/Form.js +9 -8
  126. package/umd/FormItem.js +9 -8
  127. package/umd/FunctionModal.js +9 -8
  128. package/umd/GlobalContext.js +1 -1
  129. package/umd/Help.js +9 -8
  130. package/umd/HelperText.js +1 -1
  131. package/umd/InputLang.js +9 -8
  132. package/umd/InputNumber.js +9 -8
  133. package/umd/Label.js +9 -8
  134. package/umd/Loading.js +4 -4
  135. package/umd/Menu.js +4 -4
  136. package/umd/Message.js +4 -4
  137. package/umd/Modal.js +9 -8
  138. package/umd/MultiBox.js +9 -8
  139. package/umd/Notification.js +8 -7
  140. package/umd/OperateBtn.js +9 -8
  141. package/umd/PageHeader.js +9 -8
  142. package/umd/Pagination.js +9 -8
  143. package/umd/ParauiProvider.js +1 -1
  144. package/umd/PasswordRules.js +4 -4
  145. package/umd/PopConfirm.js +9 -8
  146. package/umd/Popover.js +9 -8
  147. package/umd/Progress.js +5 -5
  148. package/umd/Querying.js +1 -1
  149. package/umd/Radio.js +9 -8
  150. package/umd/RadioGroup.js +9 -8
  151. package/umd/Search.js +9 -8
  152. package/umd/Select.js +9 -8
  153. package/umd/SelectInput.js +9 -8
  154. package/umd/Selector.js +9 -8
  155. package/umd/SelectorPicker.js +9 -8
  156. package/umd/SingleBox.js +9 -8
  157. package/umd/Slider.js +6 -5
  158. package/umd/Status.js +4 -4
  159. package/umd/Stepper.js +9 -8
  160. package/umd/Switch.js +9 -8
  161. package/umd/Table.js +9 -8
  162. package/umd/Tabs.js +9 -8
  163. package/umd/Tag.js +9 -8
  164. package/umd/TextEditor.js +22 -21
  165. package/umd/TextField.js +9 -8
  166. package/umd/TimePicker.js +9 -8
  167. package/umd/Timeline.js +1 -1
  168. package/umd/Title.js +9 -8
  169. package/umd/ToggleButton.js +9 -8
  170. package/umd/Tooltip.js +9 -8
  171. package/umd/Transfer.js +10 -9
  172. package/umd/Tree.js +9 -8
  173. package/umd/Upload.js +10 -9
  174. package/umd/locale.js +1 -1
  175. package/_verture/index-232d890b.js +0 -327
  176. package/_verture/index-e9007d6a.js +0 -236
  177. package/_verture/intl-5c1ec055.js +0 -81
  178. package/_verture/toConsumableArray-8f4c9589.js +0 -19
  179. package/_verture/unsupportedIterableToArray-cb478f24.js +0 -16
package/MultiBox/index.js CHANGED
@@ -1,6 +1,3 @@
1
- import { _ as _typeof } from '../_verture/typeof-adeedc13.js';
2
- import { _ as _toConsumableArray } from '../_verture/toConsumableArray-8f4c9589.js';
3
- import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
4
1
  import { jsxs, jsx } from 'react/jsx-runtime';
5
2
  import { useState, useEffect } from 'react';
6
3
  import { TextField } from '../TextField/index.js';
@@ -8,28 +5,27 @@ import Label from '../Label/index.js';
8
5
  import HelperText from '../HelperText/index.js';
9
6
  import Delete from '@para-ui/icons/Delete';
10
7
  import PlusCircleF from '@para-ui/icons/PlusCircleF';
11
- import { $ as $prefixCls } from '../_verture/constant-0d9802f7.js';
12
- import { u as useFormatMessage } from '../_verture/useFormatMessage-703f8b20.js';
8
+ import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
9
+ import { u as useFormatMessage } from '../_verture/useFormatMessage-eb13cf56.js';
10
+ import { Tooltip } from '../Tooltip/index.js';
13
11
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
14
- import '../_verture/unsupportedIterableToArray-cb478f24.js';
15
12
  import '../_verture/tslib.es6-55ed4bd2.js';
16
13
  import '@paraview/lib';
17
14
  import '@para-ui/icons/PreviewClose';
18
15
  import '@para-ui/icons/PreviewOpen';
19
16
  import '@para-ui/icons/CloseCircleF';
20
17
  import '../AutoTips/index.js';
21
- import '../Tooltip/index.js';
22
18
  import 'rc-tooltip';
23
19
  import 'rc-tooltip/lib/placements';
24
20
  import 'clsx';
25
21
  import '@para-ui/icons/Forbid';
26
22
  import '../Loading/index.js';
27
23
  import '@para-ui/icons/LoadingF';
28
- import '../_verture/useGlobalProps-1b846a65.js';
24
+ import '../_verture/useGlobalProps-1e416658.js';
29
25
  import '@para-ui/core/GlobalContext';
30
- import '../_verture/index-e9007d6a.js';
26
+ import '../_verture/index-da9097d3.js';
31
27
  import 'rc-dropdown';
32
- import '../_verture/usePopupContainer-87febeb9.js';
28
+ import '../_verture/usePopupContainer-635f66f4.js';
33
29
  import 'dayjs';
34
30
  import '../Help/index.js';
35
31
  import '@para-ui/icons/Help';
@@ -43,78 +39,66 @@ var zh = {
43
39
  };
44
40
 
45
41
  var localeJson = {
46
- zh: zh,
47
- en: en
42
+ zh,
43
+ en
48
44
  };
49
45
 
50
46
  var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-multi-box {\n width: 100%;\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}\n.paraui-v4-multi-box > .multi-box-content > .multi-box-content-item {\n display: flex;\n}\n.paraui-v4-multi-box > .multi-box-content > .multi-box-content-item > .multi-box-content-item-input {\n flex: 1;\n display: flex;\n align-items: center;\n align-items: flex-start;\n}\n.paraui-v4-multi-box > .multi-box-content > .multi-box-content-item > .multi-box-content-item-input.multi-box-content-item-input-error > .multi-box-separator {\n padding-bottom: 20px;\n}\n.paraui-v4-multi-box > .multi-box-content > .multi-box-content-item > .multi-box-content-item-input > .multi-box-text-field:first-child {\n margin-right: 10px;\n}\n.paraui-v4-multi-box > .multi-box-content > .multi-box-content-item > .multi-box-content-item-input > .multi-box-text-field {\n flex: 1;\n}\n.paraui-v4-multi-box > .multi-box-content > .multi-box-content-item > .multi-box-content-item-input > .multi-box-text-field .paraui-v4-helper-text {\n min-height: 10px;\n}\n.paraui-v4-multi-box > .multi-box-content > .multi-box-content-item > .multi-box-content-item-input > .multi-box-separator {\n padding-bottom: 10px;\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n margin: 0 10px;\n line-height: 1;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-multi-box > .multi-box-content > .multi-box-content-item > .opera-box {\n display: flex;\n align-items: center;\n margin-left: 10px;\n}\n.paraui-v4-multi-box > .multi-box-content > .multi-box-content-item > .opera-box > .del-box {\n cursor: pointer;\n border-radius: 4px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.paraui-v4-multi-box > .multi-box-content > .multi-box-content-item > .opera-box > .del-box:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-multi-box > .multi-box-content > .multi-box-content-item > .opera-box > .del-box:hover svg {\n color: rgb(87, 131, 235);\n}\n.paraui-v4-multi-box > .multi-box-content > .multi-box-content-item > .opera-box > .del-box svg {\n font-size: 20px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-multi-box > .multi-box-add {\n text-align: center;\n border: 1px dashed;\n border-color: rgb(212, 218, 227);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n cursor: pointer;\n background-color: rgb(247, 248, 250);\n color: rgb(46, 101, 230);\n font-size: 14px;\n}\n.paraui-v4-multi-box > .multi-box-add > svg {\n font-size: 16px;\n color: rgb(46, 101, 230);\n margin-right: 4px;\n}\n.paraui-v4-multi-box > .multi-box-add:hover {\n border-color: rgb(87, 131, 235);\n background-color: rgb(240, 245, 255);\n}\n.paraui-v4-multi-box.paraui-v4-multi-box-separator > .multi-box-content > .multi-box-content-item > .multi-box-content-item-input > .multi-box-text-field:first-child {\n margin-right: 0;\n}\n.paraui-v4-multi-box.paraui-v4-multi-box-disabled > .multi-box-content > .multi-box-content-item > .opera-box > .del-box {\n cursor: not-allowed;\n}\n.paraui-v4-multi-box.paraui-v4-multi-box-disabled > .multi-box-content > .multi-box-content-item > .opera-box > .del-box:hover {\n background-color: transparent;\n}\n.paraui-v4-multi-box.paraui-v4-multi-box-disabled > .multi-box-content > .multi-box-content-item > .opera-box > .del-box:hover svg {\n color: rgb(92, 101, 115);\n}\n.paraui-v4-multi-box.paraui-v4-multi-box-disabled > .multi-box-content > .multi-box-content-item > .opera-box > .del-box svg {\n color: rgb(92, 101, 115);\n}\n.paraui-v4-multi-box.paraui-v4-multi-box-disabled > .multi-box-add {\n border-color: rgb(212, 218, 227);\n cursor: not-allowed;\n background-color: rgb(247, 248, 250);\n color: rgb(161, 168, 179);\n}\n.paraui-v4-multi-box.paraui-v4-multi-box-disabled > .multi-box-add > svg {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-multi-box.paraui-v4-multi-box-disabled > .multi-box-add:hover {\n border-color: rgb(212, 218, 227);\n color: rgb(161, 168, 179);\n}\n.paraui-v4-multi-box.paraui-v4-multi-box-small > .multi-box-add {\n height: 28px;\n}\n.paraui-v4-multi-box.paraui-v4-multi-box-small > .multi-box-content > .multi-box-content-item > .opera-box {\n height: 28px;\n}\n.paraui-v4-multi-box.paraui-v4-multi-box-small > .multi-box-content > .multi-box-content-item > .opera-box > .del-box {\n width: 28px;\n height: 28px;\n}\n.paraui-v4-multi-box.paraui-v4-multi-box-medium > .multi-box-add {\n height: 32px;\n}\n.paraui-v4-multi-box.paraui-v4-multi-box-medium > .multi-box-content > .multi-box-content-item > .opera-box {\n height: 32px;\n}\n.paraui-v4-multi-box.paraui-v4-multi-box-medium > .multi-box-content > .multi-box-content-item > .opera-box > .del-box {\n width: 32px;\n height: 32px;\n}\n.paraui-v4-multi-box.paraui-v4-multi-box-large > .multi-box-add {\n height: 32px;\n}\n.paraui-v4-multi-box.paraui-v4-multi-box-large > .multi-box-content > .multi-box-content-item > .opera-box {\n height: 32px;\n}\n.paraui-v4-multi-box.paraui-v4-multi-box-large > .multi-box-content > .multi-box-content-item > .opera-box > .del-box {\n width: 32px;\n height: 32px;\n}";
51
47
  styleInject(css_248z);
52
48
 
53
- var MultiBox = function MultiBox(props) {
54
- var className = props.className,
55
- style = props.style,
56
- _props$size = props.size,
57
- size = _props$size === void 0 ? 'large' : _props$size,
58
- _props$placeholderKey = props.placeholderKey,
59
- placeholderKey = _props$placeholderKey === void 0 ? '' : _props$placeholderKey,
60
- _props$placeholderVal = props.placeholderValue,
61
- placeholderValue = _props$placeholderVal === void 0 ? '' : _props$placeholderVal,
62
- _props$label = props.label,
63
- label = _props$label === void 0 ? '' : _props$label,
64
- labelTooltip = props.labelTooltip,
65
- labelSign = props.labelSign,
66
- _props$disabled = props.disabled,
67
- disabled = _props$disabled === void 0 ? false : _props$disabled,
68
- _props$required = props.required,
69
- required = _props$required === void 0 ? false : _props$required,
70
- _props$error = props.error,
71
- error = _props$error === void 0 ? false : _props$error,
72
- hideErrorDom = props.hideErrorDom,
73
- _props$separator = props.separator,
74
- separator = _props$separator === void 0 ? ':' : _props$separator,
75
- _props$helperText = props.helperText,
76
- helperText = _props$helperText === void 0 ? '' : _props$helperText,
77
- value = props.value,
78
- replaceFields = props.replaceFields,
79
- onChange = props.onChange,
80
- fetchSuggestionsKey = props.fetchSuggestionsKey,
81
- fetchSuggestionsValue = props.fetchSuggestionsValue,
82
- keyOtherProps = props.keyOtherProps,
83
- valueOtherProps = props.valueOtherProps;
84
- var isError = helperText && typeof helperText === 'string' ? true : false;
85
- var isErrorArr = helperText instanceof Array;
86
- var intl = useFormatMessage('MultiBox', localeJson);
87
- var _useState = useState([]),
88
- _useState2 = _slicedToArray(_useState, 2),
89
- valueCom = _useState2[0],
90
- setValueCom = _useState2[1];
91
- var _useState3 = useState({
92
- key: 'label',
93
- value: 'value'
94
- }),
95
- _useState4 = _slicedToArray(_useState3, 2),
96
- replaceFieldsCom = _useState4[0],
97
- setReplaceFieldsCom = _useState4[1];
98
- useEffect(function () {
99
- if (props.defaultValue !== undefined) setValueCom(_toConsumableArray(props.defaultValue));
49
+ const MultiBox = props => {
50
+ const {
51
+ className,
52
+ style,
53
+ size = 'large',
54
+ placeholderKey = '',
55
+ placeholderValue = '',
56
+ label = '',
57
+ labelTooltip,
58
+ labelSign,
59
+ disabled = false,
60
+ disabledTooltip,
61
+ required = false,
62
+ error = false,
63
+ hideErrorDom,
64
+ separator = ':',
65
+ helperText = '',
66
+ value,
67
+ replaceFields,
68
+ onChange,
69
+ fetchSuggestionsKey,
70
+ fetchSuggestionsValue,
71
+ keyOtherProps,
72
+ valueOtherProps
73
+ } = props;
74
+ const isError = helperText && typeof helperText === 'string' ? true : false;
75
+ const isErrorArr = helperText instanceof Array;
76
+ const intl = useFormatMessage('MultiBox', localeJson);
77
+ const [valueCom, setValueCom] = useState([]);
78
+ const [replaceFieldsCom, setReplaceFieldsCom] = useState({
79
+ key: 'label',
80
+ value: 'value'
81
+ });
82
+ useEffect(() => {
83
+ if (props.defaultValue !== undefined) setValueCom([...props.defaultValue]);
100
84
  }, []);
101
- useEffect(function () {
102
- if (value !== undefined) setValueCom(_toConsumableArray(value));
85
+ useEffect(() => {
86
+ if (value !== undefined) setValueCom([...value]);
103
87
  }, [value]);
104
- useEffect(function () {
88
+ useEffect(() => {
105
89
  if (replaceFields) {
106
- var json = Object.assign(Object.assign({}, replaceFieldsCom), replaceFields);
90
+ const json = Object.assign(Object.assign({}, replaceFieldsCom), replaceFields);
107
91
  setReplaceFieldsCom(json);
108
92
  }
109
93
  }, [replaceFields]);
110
94
  /** 处理错误 */
111
- var handError = function handError(index, name) {
112
- var obj = {
95
+ const handError = (index, name) => {
96
+ let obj = {
113
97
  error: false,
114
98
  helperText: ''
115
99
  };
116
100
  if (isErrorArr) {
117
- var errorItem = helperText[index];
101
+ const errorItem = helperText[index];
118
102
  if (errorItem && errorItem[name]) {
119
103
  obj = {
120
104
  error: true,
@@ -125,36 +109,32 @@ var MultiBox = function MultiBox(props) {
125
109
  return obj;
126
110
  };
127
111
  /** 增加 */
128
- var add = function add() {
112
+ const add = () => {
129
113
  if (disabled === true) return;
130
114
  valueCom.push({});
131
- if (props.value === undefined) setValueCom(_toConsumableArray(valueCom));
115
+ if (props.value === undefined) setValueCom([...valueCom]);
132
116
  onChange && onChange(valueCom);
133
117
  };
134
118
  /** 删除 */
135
- var del = function del(index) {
136
- return function () {
137
- if (disabled === true) return;
138
- valueCom.splice(index, 1);
139
- if (props.value === undefined) setValueCom(_toConsumableArray(valueCom));
140
- onChange && onChange(valueCom);
141
- };
119
+ const del = index => () => {
120
+ if (disabled === true) return;
121
+ valueCom.splice(index, 1);
122
+ if (props.value === undefined) setValueCom([...valueCom]);
123
+ onChange && onChange(valueCom);
142
124
  };
143
125
  /** 改变值 */
144
- var changeValue = function changeValue(key, index) {
145
- return function (event) {
146
- valueCom[index][key] = event.target.value;
147
- if (props.value === undefined) setValueCom(_toConsumableArray(valueCom));
148
- onChange && onChange(valueCom);
149
- };
126
+ const changeValue = (key, index) => event => {
127
+ valueCom[index][key] = event.target.value;
128
+ if (props.value === undefined) setValueCom([...valueCom]);
129
+ onChange && onChange(valueCom);
150
130
  };
151
131
  /**
152
132
  * 处理label
153
133
  * */
154
- var handLabel = function handLabel() {
134
+ const handLabel = () => {
155
135
  if (!label && !labelSign) return null;
156
- var handLabelClass = function handLabelClass() {
157
- var str = 'multi-box-label';
136
+ const handLabelClass = () => {
137
+ let str = 'multi-box-label';
158
138
  if (labelTooltip && labelTooltip.className) {
159
139
  str += " ".concat(labelTooltip.className);
160
140
  }
@@ -169,15 +149,15 @@ var MultiBox = function MultiBox(props) {
169
149
  }));
170
150
  };
171
151
  /** 处理内容每一项 */
172
- var handContentItem = function handContentItem(item, index) {
152
+ const handContentItem = (item, index) => {
173
153
  var _a, _b;
174
- var keyValue = item[replaceFieldsCom.key || ''] || '';
175
- var valValue = item[replaceFieldsCom.value || ''] || '';
176
- var disabledKey = disabled instanceof Array ? (_a = disabled[index]) === null || _a === void 0 ? void 0 : _a[keyValue] : disabled;
177
- var disabledVal = disabled instanceof Array ? (_b = disabled[index]) === null || _b === void 0 ? void 0 : _b[valValue] : disabled;
178
- var errorKeyObj = handError(index, replaceFieldsCom.key || '');
179
- var errorValueObj = handError(index, replaceFieldsCom.value || '');
180
- var str = 'multi-box-content-item-input';
154
+ const keyValue = item[replaceFieldsCom.key || ''] || '';
155
+ const valValue = item[replaceFieldsCom.value || ''] || '';
156
+ const disabledKey = disabled instanceof Array ? (_a = disabled[index]) === null || _a === void 0 ? void 0 : _a[keyValue] : disabled;
157
+ const disabledVal = disabled instanceof Array ? (_b = disabled[index]) === null || _b === void 0 ? void 0 : _b[valValue] : disabled;
158
+ const errorKeyObj = handError(index, replaceFieldsCom.key || '');
159
+ const errorValueObj = handError(index, replaceFieldsCom.value || '');
160
+ let str = 'multi-box-content-item-input';
181
161
  if (errorKeyObj.error || errorValueObj.error) str += ' multi-box-content-item-input-error';
182
162
  return jsxs("div", Object.assign({
183
163
  className: str
@@ -210,11 +190,11 @@ var MultiBox = function MultiBox(props) {
210
190
  }));
211
191
  };
212
192
  /** 处理内容 */
213
- var handContent = function handContent() {
193
+ const handContent = () => {
214
194
  return jsx("div", Object.assign({
215
195
  className: "multi-box-content"
216
196
  }, {
217
- children: valueCom.map(function (item, index) {
197
+ children: valueCom.map((item, index) => {
218
198
  return jsxs("div", Object.assign({
219
199
  className: "multi-box-content-item"
220
200
  }, {
@@ -233,25 +213,21 @@ var MultiBox = function MultiBox(props) {
233
213
  }));
234
214
  };
235
215
  /** 模糊匹配 */
236
- var fetchSuggestions = function fetchSuggestions(key) {
237
- return function (val, cb) {
238
- if (key === 'key') fetchSuggestionsKey && fetchSuggestionsKey(val, cb);else fetchSuggestionsValue && fetchSuggestionsValue(val, cb);
239
- };
216
+ const fetchSuggestions = key => (val, cb) => {
217
+ if (key === 'key') fetchSuggestionsKey && fetchSuggestionsKey(val, cb);else fetchSuggestionsValue && fetchSuggestionsValue(val, cb);
240
218
  };
241
219
  /** 选择值 */
242
- var selectValue = function selectValue(key, index) {
243
- return function (item) {
244
- valueCom[index][key] = item;
245
- if (_typeof(item) === 'object' && item !== null) {
246
- valueCom[index][key] = item.value;
247
- }
248
- if (props.value === undefined) setValueCom(_toConsumableArray(valueCom));
249
- onChange && onChange(valueCom);
250
- };
220
+ const selectValue = (key, index) => item => {
221
+ valueCom[index][key] = item;
222
+ if (typeof item === 'object' && item !== null) {
223
+ valueCom[index][key] = item.value;
224
+ }
225
+ if (props.value === undefined) setValueCom([...valueCom]);
226
+ onChange && onChange(valueCom);
251
227
  };
252
228
  /** 处理class */
253
- var handClass = function handClass() {
254
- var str = "".concat($prefixCls, "-multi-box multi-box");
229
+ const handClass = () => {
230
+ let str = "".concat($prefixCls, "-multi-box multi-box");
255
231
  if (className) str += " ".concat(className);
256
232
  if (size) str += " ".concat($prefixCls, "-multi-box-").concat(size);
257
233
  if (error) str += " ".concat($prefixCls, "-multi-box-error");
@@ -259,11 +235,11 @@ var MultiBox = function MultiBox(props) {
259
235
  if (separator) str += " ".concat($prefixCls, "-multi-box-separator");
260
236
  return str;
261
237
  };
262
- return jsxs("div", Object.assign({
263
- className: handClass(),
264
- style: style
265
- }, {
266
- children: [handLabel(), handContent(), jsxs("div", Object.assign({
238
+ /**
239
+ * 处理添加按钮
240
+ * */
241
+ const handleAddBtn = () => {
242
+ return jsxs("div", Object.assign({
267
243
  className: "multi-box-add",
268
244
  onClick: add
269
245
  }, {
@@ -272,7 +248,27 @@ var MultiBox = function MultiBox(props) {
272
248
  id: 'add'
273
249
  })
274
250
  })]
275
- })), jsx(HelperText, {
251
+ }));
252
+ };
253
+ /**
254
+ * 处理添加按钮是否带提示
255
+ * */
256
+ const handleAddBtnTooltip = () => {
257
+ if (disabledTooltip) {
258
+ return jsx(Tooltip, Object.assign({
259
+ disabled: true,
260
+ placement: disabledTooltip.placement || 'top'
261
+ }, disabledTooltip, {
262
+ children: handleAddBtn()
263
+ }));
264
+ }
265
+ return handleAddBtn();
266
+ };
267
+ return jsxs("div", Object.assign({
268
+ className: handClass(),
269
+ style: style
270
+ }, {
271
+ children: [handLabel(), handContent(), handleAddBtnTooltip(), jsx(HelperText, {
276
272
  className: "multi-box-error-text",
277
273
  error: isError,
278
274
  helperText: isError ? helperText : undefined,