@para-ui/core 3.0.2 → 3.0.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 (58) hide show
  1. package/Breadcrumbs/index.d.ts +14 -0
  2. package/Breadcrumbs/index.js +209 -156
  3. package/Breadcrumbs/lang/en_US.d.ts +4 -0
  4. package/Breadcrumbs/lang/index.d.ts +9 -0
  5. package/Breadcrumbs/lang/zh_CN.d.ts +4 -0
  6. package/Button/index.js +9 -3
  7. package/ButtonGroup/index.js +1 -1
  8. package/Cascader/index.js +1 -1
  9. package/Checkbox/index.js +1 -1
  10. package/CollapseBox/index.js +1 -18
  11. package/CollapseLayout/index.d.ts +51 -0
  12. package/CollapseLayout/index.js +190 -0
  13. package/ComboSelect/index.js +16 -10
  14. package/DatePicker/generatePicker/index.d.ts +11 -2
  15. package/DatePicker/index.js +46 -34
  16. package/Desktop/index.js +1 -1
  17. package/Drawer/index.js +1 -1
  18. package/Empty/index.js +1 -1
  19. package/Form/index.js +3 -3
  20. package/FormItem/index.js +3 -3
  21. package/FunctionModal/index.js +3 -3
  22. package/Menu/index.js +1 -0
  23. package/Modal/index.js +1 -1
  24. package/OperateBtn/index.js +1 -1
  25. package/PageHeader/index.js +1 -1
  26. package/Pagination/index.js +5 -5
  27. package/PopConfirm/index.js +1 -1
  28. package/Popover/index.js +2 -16
  29. package/Querying/index.js +1 -1
  30. package/README.md +25 -0
  31. package/Search/index.js +1 -1
  32. package/Select/index.js +1 -1
  33. package/SelectInput/index.js +1 -1
  34. package/Selector/index.js +2 -1
  35. package/Selector/lang/index.d.ts +2 -0
  36. package/SelectorPicker/index.js +2 -1
  37. package/Table/index.js +11 -9
  38. package/Table/interface.d.ts +2 -0
  39. package/Tabs/index.js +1 -1
  40. package/TimePicker/index.js +1 -1
  41. package/Title/index.js +6 -6
  42. package/ToggleButton/index.js +1 -1
  43. package/Tooltip/index.js +12 -6
  44. package/Transfer/index.d.ts +19 -4
  45. package/Transfer/index.js +183 -102
  46. package/Transfer/lang/en_US.d.ts +2 -0
  47. package/Transfer/lang/index.d.ts +4 -0
  48. package/Transfer/lang/zh_CN.d.ts +2 -0
  49. package/Tree/index.js +3 -3
  50. package/Upload/index.js +1 -1
  51. package/_verture/{index-cc4c83b8.js → index-9d9fefc1.js} +0 -0
  52. package/_verture/{index-cf5bf211.js → index-e0508c99.js} +1 -1
  53. package/_verture/{modalContext-95c3fc87.js → modalContext-4bce2dae.js} +0 -0
  54. package/_verture/{useFormatMessage-ac9d6acf.js → useFormatMessage-f4452258.js} +6 -4
  55. package/_verture/util-a77b261e.js +19 -0
  56. package/index.d.ts +2 -0
  57. package/index.js +10 -7
  58. package/package.json +1 -1
package/Transfer/index.js CHANGED
@@ -1,15 +1,18 @@
1
1
  import { _ as _toConsumableArray } from '../_verture/toConsumableArray-f8047a75.js';
2
2
  import { _ as _slicedToArray } from '../_verture/slicedToArray-d7722f4b.js';
3
3
  import { jsxs, jsx } from 'react/jsx-runtime';
4
- import { useState, useCallback, useEffect } from 'react';
4
+ import { useState, useEffect, useCallback } from 'react';
5
5
  import clsx from 'clsx';
6
6
  import { Checkbox } from '../Checkbox/index.js';
7
7
  import { Search } from '../Search/index.js';
8
+ import AutoTips from '../AutoTips/index.js';
9
+ import { Button } from '../Button/index.js';
8
10
  import SearchIcon from '@para-ui/icons/Search';
9
11
  import NavigateBefore from '@para-ui/icons/Left';
10
12
  import Right from '@para-ui/icons/Right';
11
- import { u as useFormatMessage } from '../_verture/useFormatMessage-ac9d6acf.js';
13
+ import { u as useFormatMessage } from '../_verture/useFormatMessage-f4452258.js';
12
14
  import { $ as $prefixCls } from '../_verture/constant-bf34e6fa.js';
15
+ import { ArrayToObject } from '@paraview/lib';
13
16
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
14
17
  import '../Label/index.js';
15
18
  import '../Help/index.js';
@@ -20,11 +23,9 @@ import 'rc-tooltip/lib/placements';
20
23
  import '@para-ui/icons/Help';
21
24
  import '../TextField/index.js';
22
25
  import '../_verture/typeof-498dd2b1.js';
23
- import '@paraview/lib';
24
26
  import '@para-ui/icons/PreviewClose';
25
27
  import '@para-ui/icons/PreviewOpen';
26
28
  import '@para-ui/icons/CloseCircle';
27
- import '../AutoTips/index.js';
28
29
  import '../Loading/index.js';
29
30
  import '@para-ui/icons/LoadingF';
30
31
  import '../HelperText/index.js';
@@ -32,20 +33,23 @@ import '../_verture/useGlobalProps-af9a2af6.js';
32
33
  import '@para-ui/core/GlobalContext';
33
34
  import '../Dropdown/index.js';
34
35
  import 'rc-dropdown';
35
- import '../Button/index.js';
36
36
  import '@para-ui/icons/Forbid';
37
37
  import '@para-ui/icons/Down';
38
38
 
39
39
  var en = {
40
40
  left: 'Left',
41
41
  right: 'Right',
42
- searchPlaceholder: 'Please enter the search content'
42
+ searchPlaceholder: 'Please enter the search content',
43
+ leftBtnTips: 'Please check the content on the right first',
44
+ rightBtnTips: 'Please check the content on the left first'
43
45
  };
44
46
 
45
47
  var zh = {
46
48
  left: '左侧',
47
49
  right: '右侧',
48
- searchPlaceholder: '请输入搜索内容'
50
+ searchPlaceholder: '请输入搜索内容',
51
+ leftBtnTips: '请先勾选右侧内容',
52
+ rightBtnTips: '请先勾选左侧内容'
49
53
  };
50
54
 
51
55
  var localeJson = {
@@ -53,18 +57,17 @@ var localeJson = {
53
57
  en: en
54
58
  };
55
59
 
56
- var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n/**\n* @author linhd\n* @date 2022/8/12 5:28 PM\n* @description 全局css前缀\n*/\n.paraui-v3-transfer {\n display: flex;\n font-size: 14px;\n}\n.paraui-v3-transfer .box {\n width: 289px;\n border-radius: 4px;\n border: 1px solid rgba(171, 176, 185, 0.368627451);\n overflow: hidden;\n}\n.paraui-v3-transfer .box .box-header {\n background: rgba(171, 176, 185, 0.2745098039);\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-left: 10px;\n height: 44px;\n}\n.paraui-v3-transfer .box .box-header .count {\n margin: 0 10px 0 0;\n color: #999;\n letter-spacing: 1px;\n}\n.paraui-v3-transfer .box .context {\n height: 400px;\n overflow: auto;\n scrollbar-base-color: red;\n}\n.paraui-v3-transfer .box .text-field-content {\n border: none;\n border-radius: 0;\n border-bottom: 1px solid #ddd;\n}\n.paraui-v3-transfer ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background: #3666D6;\n}\n.paraui-v3-transfer .moveBtn {\n display: flex;\n height: 414px;\n flex-direction: column;\n justify-content: center;\n}\n.paraui-v3-transfer .moveBtn .btn {\n cursor: not-allowed;\n width: 36px;\n height: 36px;\n border: 1px solid #ABB0B9;\n border-radius: 8px;\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px 20px;\n}\n.paraui-v3-transfer .moveBtn .btn svg {\n font-size: 18px;\n fill: #ABB0B9;\n}\n.paraui-v3-transfer .moveBtn .on {\n cursor: pointer;\n border: 1px solid #3666D6;\n}\n.paraui-v3-transfer .moveBtn .on svg {\n fill: #3666D6;\n}\n.paraui-v3-transfer .context .item {\n margin: 0px 12px;\n line-height: 0;\n height: 36px;\n display: flex;\n align-items: center;\n}";
60
+ var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n/**\n* @author linhd\n* @date 2022/8/12 5:28 PM\n* @description 全局css前缀\n*/\n.paraui-v3-transfer {\n display: flex;\n font-size: 14px;\n}\n.paraui-v3-transfer .box {\n width: 289px;\n border-radius: 4px;\n border: 1px solid rgba(171, 176, 185, 0.368627451);\n overflow: hidden;\n}\n.paraui-v3-transfer .box .box-header {\n background: rgba(171, 176, 185, 0.2745098039);\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-left: 10px;\n height: 44px;\n}\n.paraui-v3-transfer .box .box-header .count {\n margin: 0 10px 0 0;\n color: #999;\n letter-spacing: 1px;\n}\n.paraui-v3-transfer .box .context {\n height: 400px;\n overflow: auto;\n scrollbar-base-color: red;\n}\n.paraui-v3-transfer .box .text-field-content {\n border: none;\n border-radius: 0;\n border-bottom: 1px solid #ddd;\n}\n.paraui-v3-transfer ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background: #3666D6;\n}\n.paraui-v3-transfer .moveBtn {\n display: flex;\n height: 414px;\n flex-direction: column;\n justify-content: center;\n margin: 0 24px;\n}\n.paraui-v3-transfer .moveBtn .btn-left {\n margin-top: 20px;\n}\n.paraui-v3-transfer .context .item {\n padding: 0px 12px;\n height: 36px;\n display: flex;\n align-items: center;\n cursor: pointer;\n}\n.paraui-v3-transfer .context .item > .item-label {\n margin-left: 8px;\n flex: 1;\n overflow: hidden;\n color: rgb(46, 55, 67);\n}\n.paraui-v3-transfer .context .item:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-transfer .context .item:hover > .item-label {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-transfer .context .item.item-disabled:hover {\n background: inherit;\n}\n.paraui-v3-transfer .context .item.item-disabled > .item-label {\n color: rgba(46, 55, 67, 0.4);\n}";
57
61
  styleInject(css_248z);
58
62
 
59
- var Transfer = function Transfer(_ref) {
60
- var _ref$data = _ref.data,
61
- data = _ref$data === void 0 ? [] : _ref$data,
62
- _ref$value = _ref.value,
63
- value = _ref$value === void 0 ? [] : _ref$value,
64
- onChange = _ref.onChange,
65
- titles = _ref.titles,
66
- className = _ref.className,
67
- style = _ref.style;
63
+ var Transfer = function Transfer(props) {
64
+ var _props$data = props.data,
65
+ data = _props$data === void 0 ? [] : _props$data,
66
+ value = props.value,
67
+ onChange = props.onChange,
68
+ titles = props.titles,
69
+ className = props.className,
70
+ style = props.style;
68
71
  var intl = useFormatMessage('Transfer', localeJson);
69
72
 
70
73
  var _useState = useState(data),
@@ -72,7 +75,7 @@ var Transfer = function Transfer(_ref) {
72
75
  leftData = _useState2[0],
73
76
  setLeftData = _useState2[1];
74
77
 
75
- var _useState3 = useState(value),
78
+ var _useState3 = useState([]),
76
79
  _useState4 = _slicedToArray(_useState3, 2),
77
80
  rightData = _useState4[0],
78
81
  setRightData = _useState4[1];
@@ -107,24 +110,51 @@ var Transfer = function Transfer(_ref) {
107
110
  actionRightStyle = _useState16[0],
108
111
  setActionRightStyle = _useState16[1];
109
112
 
113
+ useEffect(function () {
114
+ if (value) {
115
+ setRightData(_toConsumableArray(value));
116
+ filterLeftData(_toConsumableArray(value));
117
+ }
118
+ }, [value]);
119
+ /**
120
+ * @description 过滤左边数据
121
+ * @param arr {ItemDataProps} 右边数据源
122
+ * */
123
+
124
+ var filterLeftData = function filterLeftData(arr) {
125
+ var keyJson = ArrayToObject('key', arr);
126
+ var nameJson = ArrayToObject('name', arr);
127
+ var handArr = [];
128
+ var leftArr = props.data || [];
129
+
130
+ for (var i = 0, l = leftArr.length; i < l; i++) {
131
+ var item = leftArr[i];
132
+ var key = item.key || item.name || '';
133
+ if (key && (keyJson[key] || nameJson[key])) continue;
134
+ handArr.push(item);
135
+ }
136
+
137
+ setLeftData(handArr);
138
+ };
139
+
110
140
  var onchange = useCallback(function (e, bol, index, direction) {
111
141
  if (direction === 'left') {
112
- leftData[index].checked = e.target.checked;
142
+ leftData[index].checked = bol;
113
143
  setLeftData(_toConsumableArray(leftData));
114
144
  } else {
115
- rightData[index].checked = e.target.checked;
145
+ rightData[index].checked = bol;
116
146
  setRightData(_toConsumableArray(rightData));
117
147
  }
118
148
  }, [leftData, rightData]);
119
149
  var queryAll = useCallback(function (e, direction) {
120
150
  if (direction === 'left') {
121
151
  leftData.forEach(function (item) {
122
- item.checked = e.target.checked;
152
+ if (!item.disabled && !item.hide) item.checked = e.target.checked;
123
153
  });
124
154
  setLeftData(_toConsumableArray(leftData));
125
155
  } else {
126
156
  rightData.forEach(function (item) {
127
- item.checked = e.target.checked;
157
+ if (!item.disabled && !item.hide) item.checked = e.target.checked;
128
158
  });
129
159
  setRightData(_toConsumableArray(rightData));
130
160
  } //console.log(e.target.checked)
@@ -132,13 +162,14 @@ var Transfer = function Transfer(_ref) {
132
162
 
133
163
  setleftChecked(e.target.checked);
134
164
  }, [leftData, rightData]);
135
- var onMove = useCallback(function (direction) {
165
+
166
+ var onMove = function onMove(direction) {
136
167
  var newData = [];
137
168
 
138
169
  if (direction === 'left') {
139
170
  newData = _toConsumableArray(rightData);
140
171
  newData.forEach(function (item) {
141
- if (item.checked) {
172
+ if (item.checked && !item.hide) {
142
173
  item.checked = false;
143
174
  leftData.push(item);
144
175
  rightData.splice(rightData.indexOf(item), 1);
@@ -147,7 +178,7 @@ var Transfer = function Transfer(_ref) {
147
178
  } else {
148
179
  newData = _toConsumableArray(leftData);
149
180
  newData.forEach(function (item) {
150
- if (item.checked) {
181
+ if (item.checked && !item.hide) {
151
182
  item.checked = false;
152
183
  rightData.push(item);
153
184
  leftData.splice(leftData.indexOf(item), 1);
@@ -158,56 +189,81 @@ var Transfer = function Transfer(_ref) {
158
189
  setLeftData(_toConsumableArray(leftData));
159
190
  setRightData(_toConsumableArray(rightData));
160
191
  onChange && onChange(rightData);
161
- }, []);
162
- var onSearch = useCallback(function (e, direction) {
163
- var str = [''].concat(_toConsumableArray(e), ['']).join('.*');
164
- var reg = new RegExp(str);
165
- var result = [];
192
+ };
193
+
194
+ var onSearch = function onSearch(e, direction) {
195
+ var str = e.toUpperCase();
166
196
 
167
197
  if (direction === 'left') {
168
- result = leftData.filter(function (item) {
169
- return reg.test(item.name) || reg.test(item.description);
198
+ leftData.forEach(function (item) {
199
+ item.hide = false;
200
+ var name = (item.name || '').toUpperCase();
201
+ var description = (item.description || '').toUpperCase();
202
+
203
+ if (!(name.indexOf(str) !== -1 || description.indexOf(str) !== -1)) {
204
+ item.hide = true;
205
+ }
170
206
  });
171
- setLeftData(result);
207
+ setLeftData(_toConsumableArray(leftData));
172
208
  } else {
173
- result = rightData.filter(function (item) {
174
- return reg.test(item.name) || reg.test(item.description);
209
+ rightData.filter(function (item) {
210
+ item.hide = false;
211
+ var name = (item.name || '').toUpperCase();
212
+ var description = (item.description || '').toUpperCase();
213
+
214
+ if (!(name.indexOf(str) !== -1 || description.indexOf(str) !== -1)) {
215
+ item.hide = true;
216
+ }
175
217
  });
176
- setRightData(result);
218
+ setRightData(_toConsumableArray(rightData));
177
219
  }
178
- }, []);
220
+ };
221
+ /**
222
+ * 计算全选,半选
223
+ * @return {'' | 'checked' | 'indeterminate'} 全不选 / 全选 / 半选
224
+ * */
225
+
226
+
227
+ var calculationStatus = function calculationStatus(arr) {
228
+ if (arr.length === 0) return ''; // 全不选
229
+
230
+ var checked = false;
231
+ var noChecked = false;
232
+
233
+ for (var i = 0, l = arr.length; i < l; i++) {
234
+ if (checked && noChecked) break;
235
+ var item = arr[i];
236
+ if (item.disabled || item.hide) continue;
237
+
238
+ if (item.checked) {
239
+ checked = true;
240
+ } else {
241
+ noChecked = true;
242
+ }
243
+ }
244
+
245
+ if (checked && !noChecked) return 'checked'; // 全选
246
+
247
+ if (checked && noChecked) return 'indeterminate'; // 半选
248
+
249
+ return '';
250
+ };
251
+
179
252
  useEffect(function () {
180
253
  var arr = leftData.filter(function (item) {
181
- return item.checked;
254
+ return item.checked && !item.hide;
182
255
  });
183
256
  setLeftCount(arr.length);
184
-
185
- if (arr.length && arr.length !== leftData.length) {
186
- setleftChecked('indeterminate');
187
- setActionRightStyle('on');
188
- } else if (arr.length && arr.length === leftData.length) {
189
- setleftChecked('checked');
190
- setActionRightStyle('on');
191
- } else {
192
- setleftChecked('');
193
- setActionRightStyle('');
194
- }
195
-
257
+ var leftType = calculationStatus(leftData);
258
+ setleftChecked(leftType);
259
+ setActionRightStyle(leftType === 'indeterminate' || leftType === 'checked' ? 'on' : '');
196
260
  var rArr = rightData.filter(function (item) {
197
- return item.checked;
261
+ return item.checked && !item.hide;
198
262
  });
199
263
  setRightCount(rArr.length);
200
-
201
- if (rArr.length && rArr.length !== rightData.length) {
202
- setrightChecked('indeterminate');
203
- setActionLeftStyle('on');
204
- } else if (rArr.length && rArr.length === rightData.length) {
205
- setrightChecked('checked');
206
- setActionLeftStyle('on');
207
- } else {
208
- setrightChecked('');
209
- setActionLeftStyle('');
210
- }
264
+ var rightType = calculationStatus(rightData);
265
+ setrightChecked(rightType);
266
+ setActionLeftStyle(rightType === 'indeterminate' || rightType === 'checked' ? 'on' : '');
211
267
  }, [leftData, rightData]);
212
268
  return jsxs("div", Object.assign({
213
269
  className: clsx("".concat($prefixCls, "-transfer"), className),
@@ -229,7 +285,7 @@ var Transfer = function Transfer(_ref) {
229
285
  onChange: function onChange(e) {
230
286
  queryAll(e, 'left');
231
287
  }
232
- }, 1), jsxs("div", Object.assign({
288
+ }), jsxs("div", Object.assign({
233
289
  className: "count"
234
290
  }, {
235
291
  children: [leftCount, "/", leftData.length]
@@ -241,50 +297,71 @@ var Transfer = function Transfer(_ref) {
241
297
  }),
242
298
  showBtn: false,
243
299
  rightIcon: jsx(SearchIcon, {}),
244
- onChange: function onChange(e) {
245
- var _a;
246
-
247
- var arr = (_a = e === null || e === void 0 ? void 0 : e.split('')) !== null && _a !== void 0 ? _a : [];
248
- onSearch(arr, 'left');
300
+ onChange: function onChange(val) {
301
+ onSearch(val, 'left');
249
302
  },
250
- // onEnter={onEnter}
251
303
  allowClear: false
252
304
  }), jsx("div", Object.assign({
253
305
  className: "context"
254
306
  }, {
255
307
  children: leftData.map(function (item, index) {
256
- return jsx("div", Object.assign({
257
- className: "item"
308
+ if (item.hide) return null;
309
+ return jsxs("div", Object.assign({
310
+ className: clsx('item', item.disabled && 'item-disabled'),
311
+ onClick: function onClick(e) {
312
+ if (item.disabled) return;
313
+ onchange(e, !item.checked, index, 'left');
314
+ }
258
315
  }, {
259
- children: jsx(Checkbox, {
260
- label: item.name,
316
+ children: [jsx(Checkbox, {
261
317
  size: "medium",
262
318
  checked: item.checked,
263
- disabled: item.disabled,
264
- onChange: function onChange(e, bol) {
265
- onchange(e, bol, index, 'left');
266
- }
267
- })
268
- }), item.name);
319
+ disabled: item.disabled
320
+ }), jsx("div", Object.assign({
321
+ className: "item-label"
322
+ }, {
323
+ children: jsx(AutoTips, {
324
+ children: item.name || item.key
325
+ })
326
+ }))]
327
+ }), item.key || item.name);
269
328
  })
270
329
  }))]
271
330
  })), jsxs("div", Object.assign({
272
331
  className: "moveBtn"
273
332
  }, {
274
- children: [jsx("div", Object.assign({
275
- className: "btn " + actionLeftStyle,
333
+ children: [jsx(Button.IconButton, Object.assign({
334
+ className: 'btn btn-right',
335
+ variant: 'outlined',
336
+ disabled: actionRightStyle !== 'on',
337
+ toolTipTitle: actionRightStyle !== 'on' ? intl({
338
+ id: 'rightBtnTips'
339
+ }) : '',
340
+ TooltipProps: {
341
+ arrow: false,
342
+ placement: 'bottomRight'
343
+ },
276
344
  onClick: function onClick() {
277
- onMove('left');
345
+ onMove("right");
278
346
  }
279
347
  }, {
280
- children: jsx(NavigateBefore, {})
281
- })), jsx("div", Object.assign({
282
- className: "btn " + actionRightStyle,
348
+ children: jsx(Right, {})
349
+ })), jsx(Button.IconButton, Object.assign({
350
+ className: 'btn btn-left',
351
+ variant: 'outlined',
352
+ disabled: actionLeftStyle !== 'on',
353
+ toolTipTitle: actionLeftStyle !== 'on' ? intl({
354
+ id: 'leftBtnTips'
355
+ }) : '',
356
+ TooltipProps: {
357
+ arrow: false,
358
+ placement: 'bottomRight'
359
+ },
283
360
  onClick: function onClick() {
284
- onMove("right");
361
+ onMove('left');
285
362
  }
286
363
  }, {
287
- children: jsx(Right, {})
364
+ children: jsx(NavigateBefore, {})
288
365
  }))]
289
366
  })), jsxs("div", Object.assign({
290
367
  className: "box"
@@ -314,30 +391,34 @@ var Transfer = function Transfer(_ref) {
314
391
  }),
315
392
  showBtn: false,
316
393
  rightIcon: jsx(SearchIcon, {}),
317
- onChange: function onChange(e) {
318
- var _a;
319
-
320
- var arr = (_a = e === null || e === void 0 ? void 0 : e.split('')) !== null && _a !== void 0 ? _a : [];
321
- onSearch(arr, 'right');
394
+ onChange: function onChange(val) {
395
+ onSearch(val, 'right');
322
396
  },
323
397
  allowClear: false
324
398
  }), jsx("div", Object.assign({
325
399
  className: "context"
326
400
  }, {
327
401
  children: rightData.map(function (item, index) {
328
- return jsx("div", Object.assign({
329
- className: "item"
402
+ if (item.hide) return null;
403
+ return jsxs("div", Object.assign({
404
+ className: clsx('item', item.disabled && 'item-disabled'),
405
+ onClick: function onClick(e) {
406
+ if (item.disabled) return;
407
+ onchange(e, !item.checked, index, 'right');
408
+ }
330
409
  }, {
331
- children: jsx(Checkbox, {
332
- label: item.name,
410
+ children: [jsx(Checkbox, {
333
411
  size: "medium",
334
412
  checked: item.checked,
335
- disabled: item.disabled,
336
- onChange: function onChange(e, bol) {
337
- onchange(e, bol, index, 'right');
338
- }
339
- })
340
- }), item.name);
413
+ disabled: item.disabled
414
+ }), jsx("div", Object.assign({
415
+ className: "item-label"
416
+ }, {
417
+ children: jsx(AutoTips, {
418
+ children: item.name || item.key
419
+ })
420
+ }))]
421
+ }), item.key || item.name);
341
422
  })
342
423
  }))]
343
424
  }))]
@@ -2,5 +2,7 @@ declare const _default: {
2
2
  left: string;
3
3
  right: string;
4
4
  searchPlaceholder: string;
5
+ leftBtnTips: string;
6
+ rightBtnTips: string;
5
7
  };
6
8
  export default _default;
@@ -3,11 +3,15 @@ declare const _default: {
3
3
  left: string;
4
4
  right: string;
5
5
  searchPlaceholder: string;
6
+ leftBtnTips: string;
7
+ rightBtnTips: string;
6
8
  };
7
9
  en: {
8
10
  left: string;
9
11
  right: string;
10
12
  searchPlaceholder: string;
13
+ leftBtnTips: string;
14
+ rightBtnTips: string;
11
15
  };
12
16
  };
13
17
  export default _default;
@@ -2,5 +2,7 @@ declare const _default: {
2
2
  left: string;
3
3
  right: string;
4
4
  searchPlaceholder: string;
5
+ leftBtnTips: string;
6
+ rightBtnTips: string;
5
7
  };
6
8
  export default _default;
package/Tree/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { T as Tree } from '../_verture/index-cf5bf211.js';
2
- export { T as default } from '../_verture/index-cf5bf211.js';
1
+ import { T as Tree } from '../_verture/index-e0508c99.js';
2
+ export { T as default } from '../_verture/index-e0508c99.js';
3
3
  import '../_verture/toConsumableArray-f8047a75.js';
4
4
  import '../_verture/slicedToArray-d7722f4b.js';
5
5
  import '../_verture/defineProperty-0590dc61.js';
@@ -28,7 +28,7 @@ import '@para-ui/icons/PlusCircle';
28
28
  import '@para-ui/icons/Delete';
29
29
  import '@para-ui/icons/Forbid';
30
30
  import '@paraview/lib';
31
- import '../_verture/useFormatMessage-ac9d6acf.js';
31
+ import '../_verture/useFormatMessage-f4452258.js';
32
32
  import '@para-ui/core/GlobalContext';
33
33
  import '@para-ui/icons/MoreCircle';
34
34
  import '../Empty/index.js';
package/Upload/index.js CHANGED
@@ -16,7 +16,7 @@ import clsx from 'clsx';
16
16
  import { $ as $prefixCls, a as $rcPrefixCls } from '../_verture/constant-bf34e6fa.js';
17
17
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
18
18
  import Forbid from '@para-ui/icons/Forbid';
19
- import { u as useFormatMessage } from '../_verture/useFormatMessage-ac9d6acf.js';
19
+ import { u as useFormatMessage } from '../_verture/useFormatMessage-f4452258.js';
20
20
  import EditOutline from '@para-ui/icons/EditOutline';
21
21
  import { Button } from '../Button/index.js';
22
22
  import { Slider } from '../Slider/index.js';
@@ -20,7 +20,7 @@ import Delete from '@para-ui/icons/Delete';
20
20
  import Forbid from '@para-ui/icons/Forbid';
21
21
  import { Tooltip } from '../Tooltip/index.js';
22
22
  import { UUID, Request } from '@paraview/lib';
23
- import { u as useFormatMessage } from './useFormatMessage-ac9d6acf.js';
23
+ import { u as useFormatMessage } from './useFormatMessage-f4452258.js';
24
24
  import { s as styleInject } from './style-inject.es-300983ab.js';
25
25
  import MoreOutlinedIcon from '@para-ui/icons/MoreCircle';
26
26
  import Empty from '../Empty/index.js';
@@ -2,17 +2,19 @@ import React__default from 'react';
2
2
  import GlobalContext from '@para-ui/core/GlobalContext';
3
3
 
4
4
  /**
5
- * @author linhd
6
- * @date 2022/3/15 4:03 PM
7
- * @description 国际化钩子
8
- */
5
+ * @author linhd
6
+ * @date 2022/3/15 4:03 PM
7
+ * @description 国际化钩子
8
+ */
9
9
 
10
10
  var useFormatMessage = function useFormatMessage(comName, defI18nData) {
11
11
  var _React$useContext = React__default.useContext(GlobalContext),
12
12
  intlFormat = _React$useContext.intlFormat;
13
13
 
14
14
  defI18nData.zh_CN = defI18nData.zh;
15
+ defI18nData['zh-CN'] = defI18nData.zh;
15
16
  defI18nData.en_US = defI18nData.en;
17
+ defI18nData['en-US'] = defI18nData.en;
16
18
  var intl = intlFormat && intlFormat(comName, defI18nData);
17
19
  return intl;
18
20
  };
@@ -0,0 +1,19 @@
1
+ function getTransitionProps(props, options) {
2
+ var timeout = props.timeout,
3
+ _props$style = props.style,
4
+ style = _props$style === void 0 ? {} : _props$style;
5
+ return {
6
+ duration: style.transitionDuration || typeof timeout === 'number' ? timeout : timeout[options.mode] || 0,
7
+ delay: style.transitionDelay
8
+ };
9
+ }
10
+ function getAutoHeightDuration(height) {
11
+ if (!height) {
12
+ return 0;
13
+ }
14
+
15
+ var constant = height / 36;
16
+ return Math.round((4 + 15 * Math.pow(constant, 0.25) + constant / 5) * 10);
17
+ }
18
+
19
+ export { getAutoHeightDuration as a, getTransitionProps as g };
package/index.d.ts CHANGED
@@ -20,6 +20,8 @@ export { default as Collapse } from './Collapse';
20
20
  export * from './Collapse';
21
21
  export { default as CollapseBox } from './CollapseBox';
22
22
  export * from './CollapseBox';
23
+ export { default as CollapseLayout } from './CollapseLayout';
24
+ export * from './CollapseLayout';
23
25
  export { default as ColorPicker } from './ColorPicker';
24
26
  export * from './ColorPicker';
25
27
  export { default as ComboSelect } from './ComboSelect';
package/index.js CHANGED
@@ -9,6 +9,7 @@ export { Checkbox } from './Checkbox/index.js';
9
9
  export { CheckboxGroup } from './CheckboxGroup/index.js';
10
10
  export { Collapse } from './Collapse/index.js';
11
11
  export { default as CollapseBox } from './CollapseBox/index.js';
12
+ export { default as CollapseLayout } from './CollapseLayout/index.js';
12
13
  export { ChromePicker, SketchPicker as ColorPicker, CompactPicker, SwatchesPicker } from 'react-color';
13
14
  import './_verture/index-a369ca3f.js';
14
15
  export { ComboSelect } from './ComboSelect/index.js';
@@ -19,8 +20,8 @@ export { Drawer } from './Drawer/index.js';
19
20
  export { Dropdown } from './Dropdown/index.js';
20
21
  export { default as Empty } from './Empty/index.js';
21
22
  export { default as Form } from './Form/index.js';
22
- export { F as FormItem } from './_verture/index-cc4c83b8.js';
23
- export { u as FunctionModal, F as FunctionModalProvider, a as useClose } from './_verture/modalContext-95c3fc87.js';
23
+ export { F as FormItem } from './_verture/index-9d9fefc1.js';
24
+ export { u as FunctionModal, F as FunctionModalProvider, a as useClose } from './_verture/modalContext-4bce2dae.js';
24
25
  export { default as GlobalContext, changeConfirmLocale, getConfirmLocale } from './GlobalContext/index.js';
25
26
  export { default as Help } from './Help/index.js';
26
27
  export { default as HelperText } from './HelperText/index.js';
@@ -64,7 +65,7 @@ export { Title } from './Title/index.js';
64
65
  export { ToggleButton, ToggleButtonGroup } from './ToggleButton/index.js';
65
66
  export { Tooltip } from './Tooltip/index.js';
66
67
  export { Transfer } from './Transfer/index.js';
67
- export { T as Tree } from './_verture/index-cf5bf211.js';
68
+ export { T as Tree } from './_verture/index-e0508c99.js';
68
69
  export { default as Upload } from './Upload/index.js';
69
70
  import './_verture/slicedToArray-d7722f4b.js';
70
71
  import 'react/jsx-runtime';
@@ -75,14 +76,15 @@ import './_verture/constant-bf34e6fa.js';
75
76
  import '@para-ui/icons/More';
76
77
  import './_verture/style-inject.es-300983ab.js';
77
78
  import './_verture/toConsumableArray-f8047a75.js';
79
+ import '@para-ui/icons/Return';
80
+ import './_verture/useFormatMessage-f4452258.js';
81
+ import '@para-ui/core/GlobalContext';
78
82
  import './_verture/typeof-498dd2b1.js';
79
83
  import './_verture/tslib.es6-55ed4bd2.js';
80
84
  import 'clsx';
81
85
  import '@para-ui/icons/LoadingF';
82
86
  import '@para-ui/icons/Forbid';
83
87
  import '@para-ui/icons/Down';
84
- import './_verture/useFormatMessage-ac9d6acf.js';
85
- import '@para-ui/core/GlobalContext';
86
88
  import './_verture/defineProperty-0590dc61.js';
87
89
  import 'react-slick';
88
90
  import './_verture/index-342379c6.js';
@@ -91,6 +93,9 @@ import '@para-ui/icons/Right';
91
93
  import '@para-ui/icons/Loading';
92
94
  import 'rc-collapse';
93
95
  import 'react-transition-group';
96
+ import './_verture/util-a77b261e.js';
97
+ import '@para-ui/icons/DoubleLeft';
98
+ import '@para-ui/icons/DoubleRight';
94
99
  import '@para-ui/icons/Search';
95
100
  import '@para-ui/icons/Close';
96
101
  import '@para-ui/icons/CloseCircle';
@@ -125,8 +130,6 @@ import 'rc-dialog';
125
130
  import '@para-ui/icons/WarningCircle';
126
131
  import 'rc-notification';
127
132
  import 'rc-pagination';
128
- import '@para-ui/icons/DoubleLeft';
129
- import '@para-ui/icons/DoubleRight';
130
133
  import '@para-ui/icons/Left';
131
134
  import 'rc-progress';
132
135
  import '@para-ui/icons/Check';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@para-ui/core",
3
3
  "private": false,
4
- "version": "3.0.2",
4
+ "version": "3.0.5",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",
7
7
  "description": "Powered by Para FED",