@para-ui/core 3.0.1 → 3.0.3

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 (107) hide show
  1. package/AutoBox/index.js +180 -68
  2. package/AutoBox/protal.d.ts +17 -0
  3. package/AutoTips/index.js +4 -3
  4. package/Breadcrumbs/index.js +10 -7
  5. package/Button/index.js +15 -14
  6. package/ButtonGroup/index.js +3 -2
  7. package/Carousel/index.js +7 -5
  8. package/Cascader/index.d.ts +3 -1
  9. package/Cascader/index.js +13 -5
  10. package/Checkbox/index.js +27 -8
  11. package/CheckboxGroup/index.d.ts +2 -5
  12. package/CheckboxGroup/index.js +13 -10
  13. package/Collapse/index.js +11 -10
  14. package/CollapseBox/index.js +7 -6
  15. package/ComboSelect/index.js +161 -67
  16. package/ComboSelect/interface.d.ts +10 -9
  17. package/Container/index.js +24 -23
  18. package/DatePicker/index.js +12 -17
  19. package/DatePicker/util.d.ts +0 -1
  20. package/Desktop/index.js +6 -5
  21. package/Drawer/index.js +10 -9
  22. package/Dropdown/index.js +59 -6
  23. package/Empty/index.js +7 -6
  24. package/Form/index.js +6 -5
  25. package/FormItem/compoments/formFile/index.d.ts +16 -16
  26. package/FormItem/index.d.ts +19 -19
  27. package/FormItem/index.js +3 -2
  28. package/FunctionModal/index.js +3 -2
  29. package/GlobalContext/constant.d.ts +8 -0
  30. package/Help/index.js +3 -2
  31. package/HelperText/index.d.ts +9 -5
  32. package/HelperText/index.js +9 -4
  33. package/InputLang/index.d.ts +2 -5
  34. package/InputLang/index.js +13 -7
  35. package/InputNumber/index.d.ts +2 -5
  36. package/InputNumber/index.js +15 -12
  37. package/Label/index.d.ts +2 -0
  38. package/Label/index.js +12 -8
  39. package/Loading/index.js +5 -4
  40. package/Menu/index.js +18 -17
  41. package/Message/index.js +5 -4
  42. package/Modal/index.js +28 -26
  43. package/MultiBox/index.d.ts +2 -5
  44. package/MultiBox/index.js +13 -6
  45. package/Notification/index.js +3 -2
  46. package/OperateBtn/index.js +15 -12
  47. package/PageHeader/index.js +18 -18
  48. package/Pagination/index.js +10 -4
  49. package/ParauiProvider/index.js +1 -1
  50. package/PopConfirm/index.js +3 -2
  51. package/Popover/index.js +7 -4
  52. package/Progress/index.d.ts +2 -0
  53. package/Progress/index.js +13 -9
  54. package/Querying/index.js +6 -5
  55. package/README.md +30 -0
  56. package/Radio/index.js +22 -8
  57. package/RadioGroup/index.d.ts +2 -5
  58. package/RadioGroup/index.js +10 -7
  59. package/Search/index.js +13 -8
  60. package/Select/index.d.ts +2 -5
  61. package/Select/index.js +23 -20
  62. package/SelectInput/index.js +3 -2
  63. package/Selector/index.js +189 -81
  64. package/Selector/interface.d.ts +17 -7
  65. package/Selector/lang/en_US.d.ts +1 -0
  66. package/Selector/lang/zh_CN.d.ts +1 -0
  67. package/SelectorPicker/index.d.ts +2 -5
  68. package/SelectorPicker/index.js +20 -17
  69. package/SingleBox/index.d.ts +2 -5
  70. package/SingleBox/index.js +11 -6
  71. package/Slider/index.d.ts +4 -4
  72. package/Slider/index.js +9 -4
  73. package/Split/index.js +8 -7
  74. package/Stepper/index.js +7 -3
  75. package/Switch/index.js +10 -12
  76. package/Table/index.js +528 -300
  77. package/Table/interface.d.ts +45 -1
  78. package/Table/tableElement/index.d.ts +2 -2
  79. package/Table/util.d.ts +13 -1
  80. package/Tabs/index.js +7 -6
  81. package/Tag/index.js +12 -14
  82. package/TextField/index.d.ts +2 -5
  83. package/TextField/index.js +20 -18
  84. package/TimePicker/index.js +1 -0
  85. package/Timeline/index.js +13 -12
  86. package/Title/index.d.ts +30 -0
  87. package/Title/index.js +49 -0
  88. package/ToggleButton/index.js +13 -13
  89. package/Tooltip/index.js +59 -12
  90. package/Tooltip/interface.d.ts +2 -0
  91. package/Transfer/index.d.ts +6 -2
  92. package/Transfer/index.js +74 -37
  93. package/Transfer/lang/en_US.d.ts +2 -0
  94. package/Transfer/lang/zh_CN.d.ts +2 -0
  95. package/Tree/index.js +3 -2
  96. package/Tree/utils/tools.d.ts +0 -1
  97. package/Upload/ImgCrop/EasyCrop.d.ts +1 -1
  98. package/Upload/ImgCrop/constants.d.ts +1 -1
  99. package/Upload/ImgCrop/interface.d.ts +5 -0
  100. package/Upload/index.js +56 -45
  101. package/_verture/constant-bf34e6fa.js +11 -0
  102. package/_verture/{index-abfdd262.js → index-3136f653.js} +63 -31
  103. package/_verture/{index-5bb4b5d7.js → index-77832168.js} +30 -17
  104. package/_verture/{modalContext-59669f93.js → modalContext-f1a611ab.js} +0 -0
  105. package/index.d.ts +2 -0
  106. package/index.js +7 -5
  107. package/package.json +2 -1
package/Transfer/index.js CHANGED
@@ -2,12 +2,16 @@ import { _ as _toConsumableArray } from '../_verture/toConsumableArray-f8047a75.
2
2
  import { _ as _slicedToArray } from '../_verture/slicedToArray-d7722f4b.js';
3
3
  import { jsxs, jsx } from 'react/jsx-runtime';
4
4
  import { useState, useCallback, useEffect } from 'react';
5
+ import clsx from 'clsx';
5
6
  import { Checkbox } from '../Checkbox/index.js';
6
7
  import { Search } from '../Search/index.js';
8
+ import AutoTips from '../AutoTips/index.js';
9
+ import { Button } from '../Button/index.js';
7
10
  import SearchIcon from '@para-ui/icons/Search';
8
11
  import NavigateBefore from '@para-ui/icons/Left';
9
12
  import Right from '@para-ui/icons/Right';
10
13
  import { u as useFormatMessage } from '../_verture/useFormatMessage-ac9d6acf.js';
14
+ import { $ as $prefixCls } from '../_verture/constant-bf34e6fa.js';
11
15
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
12
16
  import '../Label/index.js';
13
17
  import '../Help/index.js';
@@ -15,7 +19,6 @@ import '../_verture/tslib.es6-55ed4bd2.js';
15
19
  import '../Tooltip/index.js';
16
20
  import 'rc-tooltip';
17
21
  import 'rc-tooltip/lib/placements';
18
- import 'clsx';
19
22
  import '@para-ui/icons/Help';
20
23
  import '../TextField/index.js';
21
24
  import '../_verture/typeof-498dd2b1.js';
@@ -23,7 +26,6 @@ import '@paraview/lib';
23
26
  import '@para-ui/icons/PreviewClose';
24
27
  import '@para-ui/icons/PreviewOpen';
25
28
  import '@para-ui/icons/CloseCircle';
26
- import '../AutoTips/index.js';
27
29
  import '../Loading/index.js';
28
30
  import '@para-ui/icons/LoadingF';
29
31
  import '../HelperText/index.js';
@@ -31,20 +33,23 @@ import '../_verture/useGlobalProps-af9a2af6.js';
31
33
  import '@para-ui/core/GlobalContext';
32
34
  import '../Dropdown/index.js';
33
35
  import 'rc-dropdown';
34
- import '../Button/index.js';
35
36
  import '@para-ui/icons/Forbid';
36
37
  import '@para-ui/icons/Down';
37
38
 
38
39
  var en = {
39
40
  left: 'Left',
40
41
  right: 'Right',
41
- 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'
42
45
  };
43
46
 
44
47
  var zh = {
45
48
  left: '左侧',
46
49
  right: '右侧',
47
- searchPlaceholder: '请输入搜索内容'
50
+ searchPlaceholder: '请输入搜索内容',
51
+ leftBtnTips: '请先勾选右侧内容',
52
+ rightBtnTips: '请先勾选左侧内容'
48
53
  };
49
54
 
50
55
  var localeJson = {
@@ -52,7 +57,7 @@ var localeJson = {
52
57
  en: en
53
58
  };
54
59
 
55
- var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.transfer {\n display: flex;\n font-size: 14px;\n}\n.transfer .box {\n width: 289px;\n border-radius: 4px;\n border: 1px solid rgba(171, 176, 185, 0.368627451);\n overflow: hidden;\n}\n.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.transfer .box .box-header .count {\n margin: 0 10px 0 0;\n color: #999;\n letter-spacing: 1px;\n}\n.transfer .box .context {\n height: 400px;\n overflow: auto;\n scrollbar-base-color: red;\n}\n.transfer .box .text-field-content {\n border: none;\n border-radius: 0;\n border-bottom: 1px solid #ddd;\n}\n.transfer ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background: #3666D6;\n}\n.transfer .moveBtn {\n display: flex;\n height: 414px;\n flex-direction: column;\n justify-content: center;\n}\n.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.transfer .moveBtn .btn svg {\n font-size: 18px;\n fill: #ABB0B9;\n}\n.transfer .moveBtn .on {\n cursor: pointer;\n border: 1px solid #3666D6;\n}\n.transfer .moveBtn .on svg {\n fill: #3666D6;\n}\n.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}";
56
61
  styleInject(css_248z);
57
62
 
58
63
  var Transfer = function Transfer(_ref) {
@@ -61,7 +66,9 @@ var Transfer = function Transfer(_ref) {
61
66
  _ref$value = _ref.value,
62
67
  value = _ref$value === void 0 ? [] : _ref$value,
63
68
  onChange = _ref.onChange,
64
- titles = _ref.titles;
69
+ titles = _ref.titles,
70
+ className = _ref.className,
71
+ style = _ref.style;
65
72
  var intl = useFormatMessage('Transfer', localeJson);
66
73
 
67
74
  var _useState = useState(data),
@@ -106,10 +113,10 @@ var Transfer = function Transfer(_ref) {
106
113
 
107
114
  var onchange = useCallback(function (e, bol, index, direction) {
108
115
  if (direction === 'left') {
109
- leftData[index].checked = e.target.checked;
116
+ leftData[index].checked = bol;
110
117
  setLeftData(_toConsumableArray(leftData));
111
118
  } else {
112
- rightData[index].checked = e.target.checked;
119
+ rightData[index].checked = bol;
113
120
  setRightData(_toConsumableArray(rightData));
114
121
  }
115
122
  }, [leftData, rightData]);
@@ -207,7 +214,8 @@ var Transfer = function Transfer(_ref) {
207
214
  }
208
215
  }, [leftData, rightData]);
209
216
  return jsxs("div", Object.assign({
210
- className: "transfer"
217
+ className: clsx("".concat($prefixCls, "-transfer"), className),
218
+ style: style
211
219
  }, {
212
220
  children: [jsxs("div", Object.assign({
213
221
  className: "box"
@@ -243,44 +251,67 @@ var Transfer = function Transfer(_ref) {
243
251
  var arr = (_a = e === null || e === void 0 ? void 0 : e.split('')) !== null && _a !== void 0 ? _a : [];
244
252
  onSearch(arr, 'left');
245
253
  },
246
- // onEnter={onEnter}
247
254
  allowClear: false
248
255
  }), jsx("div", Object.assign({
249
256
  className: "context"
250
257
  }, {
251
258
  children: leftData.map(function (item, index) {
252
- return jsx("div", Object.assign({
253
- className: "item"
259
+ return jsxs("div", Object.assign({
260
+ className: clsx('item', item.disabled && 'item-disabled'),
261
+ onClick: function onClick(e) {
262
+ if (item.disabled) return;
263
+ onchange(e, !item.checked, index, 'left');
264
+ }
254
265
  }, {
255
- children: jsx(Checkbox, {
256
- label: item.name,
266
+ children: [jsx(Checkbox, {
257
267
  size: "medium",
258
268
  checked: item.checked,
259
- disabled: item.disabled,
260
- onChange: function onChange(e, bol) {
261
- onchange(e, bol, index, 'left');
262
- }
263
- })
269
+ disabled: item.disabled
270
+ }), jsx("div", Object.assign({
271
+ className: "item-label"
272
+ }, {
273
+ children: jsx(AutoTips, {
274
+ children: item.name
275
+ })
276
+ }))]
264
277
  }), item.name);
265
278
  })
266
279
  }))]
267
280
  })), jsxs("div", Object.assign({
268
281
  className: "moveBtn"
269
282
  }, {
270
- children: [jsx("div", Object.assign({
271
- className: "btn " + actionLeftStyle,
283
+ children: [jsx(Button.IconButton, Object.assign({
284
+ className: 'btn btn-right',
285
+ variant: 'outlined',
286
+ disabled: actionRightStyle !== 'on',
287
+ toolTipTitle: actionRightStyle !== 'on' ? intl({
288
+ id: 'rightBtnTips'
289
+ }) : '',
290
+ TooltipProps: {
291
+ arrow: false,
292
+ placement: 'bottomRight'
293
+ },
272
294
  onClick: function onClick() {
273
- onMove('left');
295
+ onMove("right");
274
296
  }
275
297
  }, {
276
- children: jsx(NavigateBefore, {})
277
- })), jsx("div", Object.assign({
278
- className: "btn " + actionRightStyle,
298
+ children: jsx(Right, {})
299
+ })), jsx(Button.IconButton, Object.assign({
300
+ className: 'btn btn-left',
301
+ variant: 'outlined',
302
+ disabled: actionLeftStyle !== 'on',
303
+ toolTipTitle: actionLeftStyle !== 'on' ? intl({
304
+ id: 'leftBtnTips'
305
+ }) : '',
306
+ TooltipProps: {
307
+ arrow: false,
308
+ placement: 'bottomRight'
309
+ },
279
310
  onClick: function onClick() {
280
- onMove("right");
311
+ onMove('left');
281
312
  }
282
313
  }, {
283
- children: jsx(Right, {})
314
+ children: jsx(NavigateBefore, {})
284
315
  }))]
285
316
  })), jsxs("div", Object.assign({
286
317
  className: "box"
@@ -321,18 +352,24 @@ var Transfer = function Transfer(_ref) {
321
352
  className: "context"
322
353
  }, {
323
354
  children: rightData.map(function (item, index) {
324
- return jsx("div", Object.assign({
325
- className: "item"
355
+ return jsxs("div", Object.assign({
356
+ className: clsx('item', item.disabled && 'item-disabled'),
357
+ onClick: function onClick(e) {
358
+ if (item.disabled) return;
359
+ onchange(e, !item.checked, index, 'right');
360
+ }
326
361
  }, {
327
- children: jsx(Checkbox, {
328
- label: item.name,
362
+ children: [jsx(Checkbox, {
329
363
  size: "medium",
330
364
  checked: item.checked,
331
- disabled: item.disabled,
332
- onChange: function onChange(e, bol) {
333
- onchange(e, bol, index, 'right');
334
- }
335
- })
365
+ disabled: item.disabled
366
+ }), jsx("div", Object.assign({
367
+ className: "item-label"
368
+ }, {
369
+ children: jsx(AutoTips, {
370
+ children: item.name
371
+ })
372
+ }))]
336
373
  }), item.name);
337
374
  })
338
375
  }))]
@@ -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;
@@ -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-5bb4b5d7.js';
2
- export { T as default } from '../_verture/index-5bb4b5d7.js';
1
+ import { T as Tree } from '../_verture/index-77832168.js';
2
+ export { T as default } from '../_verture/index-77832168.js';
3
3
  import '../_verture/toConsumableArray-f8047a75.js';
4
4
  import '../_verture/slicedToArray-d7722f4b.js';
5
5
  import '../_verture/defineProperty-0590dc61.js';
@@ -19,6 +19,7 @@ import '../Help/index.js';
19
19
  import '../Tooltip/index.js';
20
20
  import 'rc-tooltip';
21
21
  import 'rc-tooltip/lib/placements';
22
+ import '../_verture/constant-bf34e6fa.js';
22
23
  import '../_verture/style-inject.es-300983ab.js';
23
24
  import '@para-ui/icons/Help';
24
25
  import 'react-dom';
@@ -3,7 +3,6 @@ interface RFiled {
3
3
  key: string;
4
4
  parentId: string;
5
5
  }
6
- export declare const getPrefixCls: (suffixCls?: string, customizePrefixCls?: string) => string;
7
6
  export declare const debounce: (func: Function, wait?: number, options?: any) => {
8
7
  (...args: any): any;
9
8
  cancel: () => void;
@@ -9,7 +9,7 @@ export declare type EasyCropHandle = {
9
9
  setRotateVal: Dispatch<SetStateAction<number>>;
10
10
  cropPixelsRef: MutableRefObject<Area>;
11
11
  };
12
- interface EasyCropProps extends Required<Pick<ImgCropProps, 'aspect' | 'shape' | 'grid' | 'zoom' | 'rotate' | 'minZoom' | 'maxZoom' | 'cropperProps'>> {
12
+ interface EasyCropProps extends Required<Pick<ImgCropProps, 'aspect' | 'shape' | 'grid' | 'zoom' | 'rotate' | 'minZoom' | 'maxZoom' | 'cropperProps' | 'fixedCropSize'>> {
13
13
  cropperRef: ForwardedRef<Cropper>;
14
14
  image: string;
15
15
  }
@@ -1,4 +1,4 @@
1
- export declare const PREFIX = "paraui-img-crop";
1
+ export declare const PREFIX: string;
2
2
  export declare const INIT_ZOOM = 1;
3
3
  export declare const ZOOM_STEP = 0.1;
4
4
  export declare const INIT_ROTATE = 0;
@@ -16,6 +16,11 @@ export interface ImgCropProps {
16
16
  zoom?: boolean;
17
17
  /** 是否支持旋转 */
18
18
  rotate?: boolean;
19
+ /** 固定裁剪大小 */
20
+ fixedCropSize?: {
21
+ width: number;
22
+ height: number;
23
+ };
19
24
  /** 最小缩放值 */
20
25
  minZoom?: number;
21
26
  /** 最大缩放值 */