@para-ui/core 4.0.30 → 4.0.32

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 (70) hide show
  1. package/AutoButton/index.d.ts +41 -0
  2. package/AutoButton/index.js +213 -0
  3. package/AutoButton/lang/en_US.d.ts +4 -0
  4. package/AutoButton/lang/index.d.ts +9 -0
  5. package/AutoButton/lang/zh_CN.d.ts +4 -0
  6. package/Badge/index.d.ts +3 -1
  7. package/Badge/index.js +15 -5
  8. package/Card/index.d.ts +53 -0
  9. package/Card/index.js +218 -0
  10. package/Card/lang/en_US.d.ts +5 -0
  11. package/Card/lang/index.d.ts +11 -0
  12. package/Card/lang/zh_CN.d.ts +5 -0
  13. package/Cascader/index.js +5 -6
  14. package/ComboSelect/index.js +4 -5
  15. package/DragVerify/index.js +7 -2
  16. package/DynamicMultiBox/index.js +4 -5
  17. package/Form/index.js +5 -6
  18. package/FormItem/index.js +5 -6
  19. package/FunctionModal/index.js +2 -2
  20. package/Image/index.js +3 -4
  21. package/InputCode/index.d.ts +82 -0
  22. package/InputCode/index.js +392 -0
  23. package/InputCode/inputCodeCard/index.d.ts +10 -0
  24. package/InputCode/inputCodeInput/index.d.ts +10 -0
  25. package/InputCode/lang/en_US.d.ts +7 -0
  26. package/InputCode/lang/index.d.ts +15 -0
  27. package/InputCode/lang/zh_CN.d.ts +7 -0
  28. package/PopMenu/index.js +16 -5
  29. package/README.md +15 -0
  30. package/RangeInput/index.d.ts +4 -0
  31. package/RangeInput/index.js +32 -8
  32. package/Selector/index.js +1 -2
  33. package/SelectorPicker/index.js +1 -2
  34. package/SortBox/index.d.ts +29 -0
  35. package/SortBox/index.js +84 -0
  36. package/Table/index.js +470 -409
  37. package/Timeline/index.js +13 -20
  38. package/Tooltip/index.js +26 -27
  39. package/Transfer/index.js +1 -2
  40. package/Tree/index.js +4 -5
  41. package/Upload/ImageUpload/index.d.ts +2 -7
  42. package/Upload/index.js +110 -34
  43. package/Upload/interface.d.ts +18 -0
  44. package/_verture/{Portal-5bf66fed.js → Portal-42560ff0.js} +2 -2
  45. package/_verture/{index-28edf318.js → index-44152845.js} +2 -2
  46. package/_verture/{index-8ec857b4.js → index-519d0a1f.js} +3 -4
  47. package/_verture/{index-33866394.js → index-b037486c.js} +1 -1
  48. package/_verture/{slicedToArray-a8206399.js → slicedToArray-75fa4188.js} +15 -2
  49. package/_verture/{toConsumableArray-8f4c9589.js → toConsumableArray-c7a8028f.js} +1 -1
  50. package/index.d.ts +8 -0
  51. package/index.js +14 -10
  52. package/locale/en-US.d.ts +13 -0
  53. package/locale/index.d.ts +26 -0
  54. package/locale/index.js +26 -0
  55. package/locale/zh-CN.d.ts +13 -0
  56. package/package.json +1 -1
  57. package/umd/AutoButton.js +43 -0
  58. package/umd/Badge.js +1 -1
  59. package/umd/Card.js +1 -0
  60. package/umd/DragVerify.js +1 -1
  61. package/umd/FunctionModal.js +3 -3
  62. package/umd/InputCode.js +43 -0
  63. package/umd/Modal.js +2 -2
  64. package/umd/PopMenu.js +2 -2
  65. package/umd/RangeInput.js +2 -2
  66. package/umd/SortBox.js +41 -0
  67. package/umd/Upload.js +4 -4
  68. package/umd/locale.js +1 -1
  69. package/_verture/unsupportedIterableToArray-cb478f24.js +0 -16
  70. /package/_verture/{modalContext-c57b51b7.js → modalContext-10f0c5aa.js} +0 -0
package/Timeline/index.js CHANGED
@@ -2,33 +2,26 @@ import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import React__default from 'react';
4
4
  import clsx from 'clsx';
5
+ import { a as _defineProperty } from '../_verture/defineProperty-f0e15205.js';
5
6
  import { a as $rcPrefixCls, $ as $prefixCls } from '../_verture/constant-5317fc89.js';
6
7
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
7
8
 
8
9
  //TimelineItem
9
- const TimelineItem = props => {
10
- const {
11
- className,
12
- color,
13
- dot,
14
- pending = false,
15
- position,
16
- label,
17
- children
18
- } = props,
10
+ var TimelineItem = function TimelineItem(props) {
11
+ var className = props.className,
12
+ color = props.color,
13
+ dot = props.dot,
14
+ _props$pending = props.pending,
15
+ pending = _props$pending === void 0 ? false : _props$pending;
16
+ props.position;
17
+ var label = props.label,
18
+ children = props.children,
19
19
  restProps = __rest(props, ["className", "color", "dot", "pending", "position", "label", "children"]);
20
- const prefixCls = "".concat($rcPrefixCls, "-timeline");
20
+ var prefixCls = "".concat($rcPrefixCls, "-timeline");
21
21
  //item cls
22
- const itemClassName = clsx({
23
- ["".concat(prefixCls, "-item")]: true,
24
- ["".concat(prefixCls, "-item-pending")]: pending
25
- }, className);
22
+ var itemClassName = clsx(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-item"), true), "".concat(prefixCls, "-item-pending"), pending), className);
26
23
  //dot cls
27
- const dotClassName = clsx({
28
- ["".concat(prefixCls, "-item-head")]: true,
29
- ["".concat(prefixCls, "-item-head-custom")]: !!dot,
30
- ["".concat(prefixCls, "-item-head-").concat(color)]: color
31
- });
24
+ var dotClassName = clsx(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-item-head"), true), "".concat(prefixCls, "-item-head-custom"), !!dot), "".concat(prefixCls, "-item-head-").concat(color), color));
32
25
  return jsxs("li", Object.assign({}, restProps, {
33
26
  className: itemClassName
34
27
  }, {
package/Tooltip/index.js CHANGED
@@ -9,12 +9,12 @@ import Forbid from '@para-ui/icons/Forbid';
9
9
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
10
10
 
11
11
  //自动调整位置
12
- const autoAdjustOverflowEnabled = {
12
+ var autoAdjustOverflowEnabled = {
13
13
  adjustX: 1,
14
14
  adjustY: 1
15
15
  };
16
16
  //非自动调整位置
17
- const autoAdjustOverflowDisabled = {
17
+ var autoAdjustOverflowDisabled = {
18
18
  adjustX: 0,
19
19
  adjustY: 0
20
20
  };
@@ -27,12 +27,12 @@ function getOverflowOptions(autoAdjustOverflow) {
27
27
  }
28
28
  //tooltip placement
29
29
  function getPlacements(config) {
30
- const {
31
- horizontalArrowShift = 16,
32
- verticalArrowShift = 8,
33
- autoAdjustOverflow
34
- } = config;
35
- const placementMap = {
30
+ var _config$horizontalArr = config.horizontalArrowShift,
31
+ horizontalArrowShift = _config$horizontalArr === void 0 ? 16 : _config$horizontalArr,
32
+ _config$verticalArrow = config.verticalArrowShift,
33
+ verticalArrowShift = _config$verticalArrow === void 0 ? 8 : _config$verticalArrow,
34
+ autoAdjustOverflow = config.autoAdjustOverflow;
35
+ var placementMap = {
36
36
  left: {
37
37
  points: ['cr', 'cl'],
38
38
  offset: [-8, 0]
@@ -82,7 +82,7 @@ function getPlacements(config) {
82
82
  offset: [-8, verticalArrowShift]
83
83
  }
84
84
  };
85
- Object.keys(placementMap).forEach(key => {
85
+ Object.keys(placementMap).forEach(function (key) {
86
86
  placementMap[key] = Object.assign(Object.assign({}, placements[key]), {
87
87
  offset: getAlignOffset(key).offset,
88
88
  overflow: getOverflowOptions(autoAdjustOverflow)
@@ -91,40 +91,39 @@ function getPlacements(config) {
91
91
  });
92
92
  return placementMap;
93
93
  }
94
- const splitObject = (obj, keys) => {
95
- const picked = {};
96
- const omitted = Object.assign({}, obj);
97
- keys.forEach(key => {
94
+ var splitObject = function splitObject(obj, keys) {
95
+ var picked = {};
96
+ var omitted = Object.assign({}, obj);
97
+ keys.forEach(function (key) {
98
98
  if (obj && key in obj) {
99
99
  picked[key] = obj[key];
100
100
  delete omitted[key];
101
101
  }
102
102
  });
103
103
  return {
104
- picked,
105
- omitted
104
+ picked: picked,
105
+ omitted: omitted
106
106
  };
107
107
  };
108
108
  //兼容禁用title
109
109
  function getDisabledCompatibleChildren(child) {
110
- const element = /*#__PURE__*/React__default.isValidElement(child) ? child : jsx("span", {
110
+ var element = /*#__PURE__*/React__default.isValidElement(child) ? child : jsx("span", {
111
111
  children: child
112
112
  });
113
113
  if (element.type === 'button' && element.props.disabled) {
114
- const {
115
- picked,
116
- omitted
117
- } = splitObject(element.props.style, ['position', 'left', 'right', 'top', 'bottom', 'float', 'display', 'zIndex']);
118
- const spanStyle = Object.assign(Object.assign({
114
+ var _splitObject = splitObject(element.props.style, ['position', 'left', 'right', 'top', 'bottom', 'float', 'display', 'zIndex']),
115
+ picked = _splitObject.picked,
116
+ omitted = _splitObject.omitted;
117
+ var spanStyle = Object.assign(Object.assign({
119
118
  display: 'inline-block'
120
119
  }, picked), {
121
120
  cursor: 'not-allowed',
122
121
  width: element.props.block ? '100%' : null
123
122
  });
124
- const buttonStyle = Object.assign(Object.assign({}, omitted), {
123
+ var buttonStyle = Object.assign(Object.assign({}, omitted), {
125
124
  pointerEvents: 'none'
126
125
  });
127
- const child = /*#__PURE__*/React__default.cloneElement(element, {
126
+ var _child = /*#__PURE__*/React__default.cloneElement(element, {
128
127
  style: buttonStyle,
129
128
  className: null
130
129
  });
@@ -132,14 +131,14 @@ function getDisabledCompatibleChildren(child) {
132
131
  style: spanStyle,
133
132
  className: clsx(element.props.className, "".concat($rcPrefixCls, "-tooltip-disabled-compatible-wrapper"))
134
133
  }, {
135
- children: child
134
+ children: _child
136
135
  }));
137
136
  }
138
137
  return element;
139
138
  }
140
139
  //映射placement
141
140
  function mapLegacyPlacement(place) {
142
- const legacyPlacement = {
141
+ var legacyPlacement = {
143
142
  'bottom-end': 'bottomRight',
144
143
  'bottom-start': 'bottomLeft',
145
144
  'left-end': 'leftBottom',
@@ -153,8 +152,8 @@ function mapLegacyPlacement(place) {
153
152
  }
154
153
  //浮层偏移量
155
154
  function getAlignOffset(place) {
156
- const mPlace = mapLegacyPlacement(place);
157
- const offsetMap = {
155
+ var mPlace = mapLegacyPlacement(place);
156
+ var offsetMap = {
158
157
  left: {
159
158
  offset: [-8, 0]
160
159
  },
package/Transfer/index.js CHANGED
@@ -8,7 +8,7 @@ import ExpandLess from '@para-ui/icons/Up';
8
8
  import Down from '@para-ui/icons/Down';
9
9
  import { u as useFormatMessage } from '../_verture/useFormatMessage-1fc7c957.js';
10
10
  import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
11
- import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
11
+ import { _ as _slicedToArray } from '../_verture/slicedToArray-75fa4188.js';
12
12
  import { Search } from '../Search/index.js';
13
13
  import SearchIcon from '@para-ui/icons/Search';
14
14
  import AutoTips from '../AutoTips/index.js';
@@ -28,7 +28,6 @@ import '../_verture/usePopupContainer-635f66f4.js';
28
28
  import 'dayjs';
29
29
  import '@paraview/lib';
30
30
  import '../_verture/index-ca413216.js';
31
- import '../_verture/unsupportedIterableToArray-cb478f24.js';
32
31
  import '../TextField/index.js';
33
32
  import '../Label/index.js';
34
33
  import '../Help/index.js';
package/Tree/index.js CHANGED
@@ -1,9 +1,8 @@
1
- import { T as Tree } from '../_verture/index-28edf318.js';
2
- export { T as default } from '../_verture/index-28edf318.js';
3
- import '../_verture/toConsumableArray-8f4c9589.js';
4
- import '../_verture/unsupportedIterableToArray-cb478f24.js';
1
+ import { T as Tree } from '../_verture/index-44152845.js';
2
+ export { T as default } from '../_verture/index-44152845.js';
3
+ import '../_verture/toConsumableArray-c7a8028f.js';
4
+ import '../_verture/slicedToArray-75fa4188.js';
5
5
  import '../_verture/defineProperty-f0e15205.js';
6
- import '../_verture/slicedToArray-a8206399.js';
7
6
  import '../_verture/index-8ac46bd9.js';
8
7
  import '../_verture/typeof-6ec38efd.js';
9
8
  import '../_verture/tslib.es6-55ed4bd2.js';
@@ -1,14 +1,9 @@
1
1
  import { FunctionComponent } from 'react';
2
- import { UploadProps } from '../interface';
2
+ import { UploadProps, DefaultImage } from '../interface';
3
3
  import './index.scss';
4
4
  export type ImageUploadProps = Omit<UploadProps, 'type'> & {
5
5
  /** 默认图片 showUploadList为false时有效 */
6
- defaultImage?: {
7
- /** 图片地址 */
8
- imageUrl: string;
9
- /** 图片名称 */
10
- imageName?: string;
11
- };
6
+ defaultImage?: DefaultImage;
12
7
  /** 用于控制这个组件只回显图片 不能上传和删除 */
13
8
  readonly?: boolean;
14
9
  };
package/Upload/index.js CHANGED
@@ -5,11 +5,12 @@ import RcUpload from 'rc-upload';
5
5
  import clsx from 'clsx';
6
6
  import UploadIcon from '@para-ui/icons/UploadFile';
7
7
  import LoadingIcon from '@para-ui/icons/Loading';
8
- import { _ as _toConsumableArray } from '../_verture/toConsumableArray-8f4c9589.js';
8
+ import { _ as _toConsumableArray } from '../_verture/toConsumableArray-c7a8028f.js';
9
9
  import { _ as _typeof } from '../_verture/defineProperty-f0e15205.js';
10
- import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
10
+ import { _ as _slicedToArray } from '../_verture/slicedToArray-75fa4188.js';
11
11
  import { r as regenerator } from '../_verture/index-8ac46bd9.js';
12
12
  import EditOutline from '@para-ui/icons/EditOutline';
13
+ import CloseIcon from '@para-ui/icons/Close';
13
14
  import Delete from '@para-ui/icons/Delete';
14
15
  import FileOutlined from '@para-ui/icons/Document';
15
16
  import PhotoIcon from '@para-ui/icons/Photo';
@@ -22,8 +23,8 @@ import OperateBtn from '../OperateBtn/index.js';
22
23
  import { $ as $prefixCls, a as $rcPrefixCls } from '../_verture/constant-5317fc89.js';
23
24
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
24
25
  import Forbid from '@para-ui/icons/Forbid';
25
- import { u as useFormatMessage } from '../_verture/useFormatMessage-1fc7c957.js';
26
26
  import { Button } from '../Button/index.js';
27
+ import { u as useFormatMessage } from '../_verture/useFormatMessage-1fc7c957.js';
27
28
  import Cropper from 'react-easy-crop';
28
29
  import PlusCircle from '@para-ui/icons/PlusCircle';
29
30
  import MinusCircle from '@para-ui/icons/MinusCircle';
@@ -31,12 +32,11 @@ import TurnRight from '@para-ui/icons/TurnRight';
31
32
  import TurnLeft from '@para-ui/icons/TurnLeft';
32
33
  import { Slider } from '../Slider/index.js';
33
34
  import { Modal } from '../Modal/index.js';
34
- import '../_verture/unsupportedIterableToArray-cb478f24.js';
35
35
  import '../_verture/typeof-6ec38efd.js';
36
36
  import 'rc-tooltip';
37
37
  import 'rc-tooltip/lib/placements';
38
38
  import '@paraview/lib';
39
- import '../_verture/Portal-5bf66fed.js';
39
+ import '../_verture/Portal-42560ff0.js';
40
40
  import 'react-dom';
41
41
  import 'rc-dialog';
42
42
  import 'rc-motion';
@@ -58,7 +58,6 @@ import 'rc-dropdown';
58
58
  import 'dayjs';
59
59
  import '../_verture/index-ca413216.js';
60
60
  import 'rc-slider';
61
- import '@para-ui/icons/Close';
62
61
 
63
62
  var extname = function extname() {
64
63
  var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
@@ -591,7 +590,7 @@ var localeJson = {
591
590
  en: en
592
591
  };
593
592
 
594
- var css_248z$2 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/11/11 下午7:31\n* @description\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-upload-image {\n display: inline-flex;\n align-items: center;\n}\n.paraui-v4-upload-image .upload-image-select {\n position: relative;\n width: 100px;\n height: 100px;\n cursor: pointer;\n background-color: rgb(247, 248, 250);\n border-radius: 4px;\n transition: 0.3s;\n}\n.paraui-v4-upload-image .upload-image-select-loading {\n pointer-events: none;\n}\n.paraui-v4-upload-image .upload-image-select .component-upload {\n display: inline-block;\n width: 100%;\n height: 100%;\n}\n.paraui-v4-upload-image .upload-image-select .component-upload-disabled {\n color: rgb(92, 101, 115);\n cursor: not-allowed;\n}\n.paraui-v4-upload-image .upload-image-select .component-upload-disabled svg {\n color: rgb(92, 101, 115);\n}\n.paraui-v4-upload-image .upload-image-select .component-upload-disabled .upload-image-picture-card {\n color: rgb(92, 101, 115);\n}\n.paraui-v4-upload-image .upload-image-select:hover .component-upload:not(.component-upload-disabled) .upload-image-picture-card {\n color: rgb(46, 101, 230);\n border-color: rgb(87, 131, 235);\n}\n.paraui-v4-upload-image .upload-image-select:hover .component-upload:not(.component-upload-disabled) .upload-image-picture-card .upload-image-text {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-upload-image .upload-image-picture-card {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n font-size: 14px;\n color: rgb(29, 33, 38);\n border: 1px dashed rgb(212, 218, 227);\n border-radius: 4px;\n}\n.paraui-v4-upload-image .upload-image-picture-card.is-avatar {\n border: none;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-image-select-tooltip-wrapper {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-img-wrapper {\n position: relative;\n width: 100%;\n height: 100%;\n cursor: default;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-img-wrapper img {\n width: 100%;\n height: 100%;\n border-radius: 4px;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-img-wrapper::before {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n content: \" \";\n background-color: rgb(29, 33, 38);\n border-radius: 4px;\n opacity: 0;\n transition: 0.3s;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-img-wrapper-name {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n padding: 0 10px;\n overflow: hidden;\n font-size: 12px;\n line-height: 24px;\n color: rgb(255, 255, 255);\n text-align: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n background-color: rgb(29, 33, 38);\n border-radius: 0 0 4px 4px;\n transition: 0.3s;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-img-wrapper-action {\n position: absolute;\n top: 50%;\n left: 50%;\n line-height: 0;\n cursor: pointer;\n opacity: 0;\n transition: 0.3s;\n transform: translate(-50%, -50%);\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-img-wrapper-action svg {\n color: rgb(255, 255, 255);\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-img-wrapper:hover::before {\n opacity: 1;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-img-wrapper:hover .upload-img-wrapper-name {\n opacity: 0;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-img-wrapper:hover .upload-img-wrapper-action {\n opacity: 1;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-image-icon {\n font-size: 30px;\n color: rgb(46, 101, 230);\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-image-loading {\n font-size: 30px;\n color: rgb(46, 101, 230);\n animation: imageLoadingCircle 1s infinite linear;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-image-text {\n margin-top: 6px;\n color: inherit;\n text-align: center;\n transition: 0.3s;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-image-text-loading {\n color: rgb(46, 101, 230);\n}\n@keyframes imageLoadingCircle {\n 100% {\n transform: rotate(360deg);\n }\n}";
593
+ var css_248z$2 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/11/11 下午7:31\n* @description\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-upload-image {\n display: inline-flex;\n align-items: center;\n}\n.paraui-v4-upload-image .upload-img-wrapper-container {\n position: relative;\n}\n.paraui-v4-upload-image .upload-img-wrapper-container__del-btn {\n display: none;\n position: absolute;\n top: 10px;\n right: 10px;\n margin: 0;\n width: 14px;\n height: 14px;\n text-align: center;\n border-radius: 50%;\n background: #fff;\n box-shadow: 0px 0px 4px 0px rgba(29, 33, 38, 0.4);\n z-index: 1;\n color: rgb(29, 33, 38);\n}\n.paraui-v4-upload-image .upload-img-wrapper-container__del-btn .svg-icon {\n margin-top: 1px;\n vertical-align: top;\n font-size: 12px;\n}\n.paraui-v4-upload-image .upload-img-wrapper-container__del-btn:hover .svg-icon {\n color: rgba(29, 33, 38, 0.4);\n}\n.paraui-v4-upload-image .upload-img-wrapper-container:hover .upload-img-wrapper-container__del-btn {\n display: block;\n}\n.paraui-v4-upload-image .upload-image-select {\n position: relative;\n width: 100px;\n height: 100px;\n cursor: pointer;\n background-color: rgb(247, 248, 250);\n border-radius: 4px;\n transition: 0.3s;\n}\n.paraui-v4-upload-image .upload-image-select-loading {\n pointer-events: none;\n}\n.paraui-v4-upload-image .upload-image-select .component-upload {\n display: inline-block;\n width: 100%;\n height: 100%;\n}\n.paraui-v4-upload-image .upload-image-select .component-upload-disabled {\n color: rgb(92, 101, 115);\n cursor: not-allowed;\n}\n.paraui-v4-upload-image .upload-image-select .component-upload-disabled svg {\n color: rgb(92, 101, 115);\n}\n.paraui-v4-upload-image .upload-image-select .component-upload-disabled .upload-image-picture-card {\n color: rgb(92, 101, 115);\n}\n.paraui-v4-upload-image .upload-image-select:hover .component-upload:not(.component-upload-disabled) .upload-image-picture-card {\n color: rgb(46, 101, 230);\n border-color: rgb(87, 131, 235);\n}\n.paraui-v4-upload-image .upload-image-select:hover .component-upload:not(.component-upload-disabled) .upload-image-picture-card .upload-image-text {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-upload-image .upload-image-picture-card {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n font-size: 14px;\n color: rgb(29, 33, 38);\n border: 1px dashed rgb(212, 218, 227);\n border-radius: 4px;\n}\n.paraui-v4-upload-image .upload-image-picture-card.is-avatar {\n border: none;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-image-select-tooltip-wrapper {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-img-wrapper {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden;\n cursor: default;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-img-wrapper img {\n width: 100%;\n height: 100%;\n border-radius: 4px;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-img-wrapper::before {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n content: \" \";\n background-color: rgb(29, 33, 38);\n border-radius: 4px;\n opacity: 0;\n transition: 0.3s;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-img-wrapper-name {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n padding: 0 10px;\n overflow: hidden;\n font-size: 12px;\n line-height: 24px;\n color: rgb(255, 255, 255);\n text-align: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n background-color: rgb(29, 33, 38);\n border-radius: 0 0 4px 4px;\n transition: 0.3s;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-img-wrapper-action {\n position: absolute;\n top: 50%;\n left: 50%;\n line-height: 0;\n cursor: pointer;\n opacity: 0;\n transition: 0.3s;\n transform: translate(-50%, -50%);\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-img-wrapper-action svg {\n color: rgb(255, 255, 255);\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-img-wrapper:hover::before {\n opacity: 1;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-img-wrapper:hover .upload-img-wrapper-name {\n opacity: 0;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-img-wrapper:hover .upload-img-wrapper-action {\n opacity: 1;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-image-icon {\n font-size: 30px;\n color: rgb(46, 101, 230);\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-image-loading {\n font-size: 30px;\n color: rgb(46, 101, 230);\n animation: imageLoadingCircle 1s infinite linear;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-image-text {\n margin-top: 6px;\n color: inherit;\n text-align: center;\n transition: 0.3s;\n}\n.paraui-v4-upload-image .upload-image-picture-card .upload-image-text-loading {\n color: rgb(46, 101, 230);\n}\n@keyframes imageLoadingCircle {\n 100% {\n transform: rotate(360deg);\n }\n}";
595
594
  styleInject(css_248z$2);
596
595
 
597
596
  //ImageUpload
@@ -631,7 +630,8 @@ var ImageUpload = function ImageUpload(props) {
631
630
  operateBtnProps = props.operateBtnProps,
632
631
  disabledTooltip = props.disabledTooltip,
633
632
  removeErrorTip = props.removeErrorTip,
634
- restProps = __rest(props, ["className", "style", "onStart", "onSuccess", "onError", "onProgress", "onRemove", "beforeUpload", "onChange", "defaultFileList", "fileList", "showUploadList", "maxCount", "children", "itemRender", "showUploadError", "stash", "uploading", "loading", "showLoading", "defaultImage", "readonly", "onPreview", "actionRender", "operateBtnProps", "disabledTooltip", "removeErrorTip"]);
633
+ avatarProps = props.avatarProps,
634
+ restProps = __rest(props, ["className", "style", "onStart", "onSuccess", "onError", "onProgress", "onRemove", "beforeUpload", "onChange", "defaultFileList", "fileList", "showUploadList", "maxCount", "children", "itemRender", "showUploadError", "stash", "uploading", "loading", "showLoading", "defaultImage", "readonly", "onPreview", "actionRender", "operateBtnProps", "disabledTooltip", "removeErrorTip", "avatarProps"]);
635
635
  var intl = useFormatMessage('Upload', localeJson);
636
636
  var _useState = useState(defaultFileList),
637
637
  _useState2 = _slicedToArray(_useState, 2),
@@ -639,18 +639,34 @@ var ImageUpload = function ImageUpload(props) {
639
639
  setUploadFileList = _useState2[1]; //文件列表
640
640
  var _useState3 = useState(false),
641
641
  _useState4 = _slicedToArray(_useState3, 2),
642
- showLoading = _useState4[0],
643
- setShowLoading = _useState4[1]; //upload loading
644
- var _useState5 = useState(false),
642
+ showResetBtn = _useState4[0],
643
+ setShowResetBtn = _useState4[1]; // 是否展示重置按钮-默认不展示
644
+ var _useState5 = useState(),
645
645
  _useState6 = _slicedToArray(_useState5, 2),
646
- errTip = _useState6[0],
647
- setErrTip = _useState6[1]; //upload error tip
648
- var _useState7 = useState({
646
+ borderRadius = _useState6[0],
647
+ setBorderRadius = _useState6[1]; // border-radius样式
648
+ var _useState7 = useState(false),
649
+ _useState8 = _slicedToArray(_useState7, 2),
650
+ isAvatar = _useState8[0],
651
+ setIsAvatar = _useState8[1]; // 是否为头像组件
652
+ var _useState9 = useState(true),
653
+ _useState10 = _slicedToArray(_useState9, 2),
654
+ showPicName = _useState10[0],
655
+ setShowPicName = _useState10[1]; // 是否展示图片名称
656
+ var _useState11 = useState(false),
657
+ _useState12 = _slicedToArray(_useState11, 2),
658
+ showLoading = _useState12[0],
659
+ setShowLoading = _useState12[1]; //upload loading
660
+ var _useState13 = useState(false),
661
+ _useState14 = _slicedToArray(_useState13, 2),
662
+ errTip = _useState14[0],
663
+ setErrTip = _useState14[1]; //upload error tip
664
+ var _useState15 = useState({
649
665
  imageUrl: ''
650
666
  }),
651
- _useState8 = _slicedToArray(_useState7, 2),
652
- avatar = _useState8[0],
653
- setAvatar = _useState8[1]; //不显示列表时上传头像
667
+ _useState16 = _slicedToArray(_useState15, 2),
668
+ avatar = _useState16[0],
669
+ setAvatar = _useState16[1]; //不显示列表时上传头像
654
670
  var _ref = typeof showUploadList === 'boolean' ? {} : showUploadList,
655
671
  showRemoveIcon = _ref.showRemoveIcon,
656
672
  removeIcon = _ref.removeIcon,
@@ -667,6 +683,39 @@ var ImageUpload = function ImageUpload(props) {
667
683
  var isAvatarMode = useMemo(function () {
668
684
  return !showUploadList && avatar.imageUrl && !showLoading;
669
685
  }, [showUploadList, avatar.imageUrl, showLoading]);
686
+ useEffect(function () {
687
+ if (avatarProps && Object.prototype.toString.call(avatarProps) === '[object Object]' && Object.keys(avatarProps).length > 0) {
688
+ var _ref3 = avatarProps || {},
689
+ _ref3$showReset = _ref3.showReset,
690
+ showReset = _ref3$showReset === void 0 ? false : _ref3$showReset,
691
+ _ref3$borderRadius = _ref3.borderRadius,
692
+ borderRadiusVal = _ref3$borderRadius === void 0 ? '50%' : _ref3$borderRadius,
693
+ avatarDefaultImage = _ref3.defaultImage,
694
+ _ref3$showName = _ref3.showName,
695
+ showName = _ref3$showName === void 0 ? false : _ref3$showName;
696
+ setShowResetBtn(showReset);
697
+ setBorderRadius(String(borderRadiusVal).includes('px') || String(borderRadiusVal).includes('%') ? String(borderRadiusVal) : "".concat(borderRadiusVal, "px"));
698
+ setIsAvatar(true);
699
+ setShowPicName(showName);
700
+ var nextAvatarDefaultImage = avatarDefaultImage || defaultImage || {
701
+ imageUrl: ''
702
+ };
703
+ setAvatar(Object.assign({}, nextAvatarDefaultImage));
704
+ } else if (typeof avatarProps === 'boolean' && avatarProps) {
705
+ setBorderRadius('50%');
706
+ setIsAvatar(true);
707
+ setShowPicName(false);
708
+ if (defaultImage) {
709
+ setAvatar(Object.assign({}, defaultImage));
710
+ }
711
+ } else {
712
+ setIsAvatar(false);
713
+ setShowPicName(true);
714
+ if (defaultImage) {
715
+ setAvatar(Object.assign({}, defaultImage));
716
+ }
717
+ }
718
+ }, [avatarProps, defaultImage]);
670
719
  useEffect(function () {
671
720
  setShowLoading(loading);
672
721
  }, [loading]);
@@ -768,13 +817,13 @@ var ImageUpload = function ImageUpload(props) {
768
817
  case 0:
769
818
  cloneList = _toConsumableArray(changedFileList);
770
819
  if (showUploadList) {
771
- _context2.next = 13;
820
+ _context2.next = 17;
772
821
  break;
773
822
  }
774
823
  //不显示上传列表
775
824
  file = cloneList.slice(-1)[0];
776
825
  if (!file) {
777
- _context2.next = 11;
826
+ _context2.next = 14;
778
827
  break;
779
828
  }
780
829
  _context2.next = 6;
@@ -785,10 +834,17 @@ var ImageUpload = function ImageUpload(props) {
785
834
  avatar.imageUrl = imageUrl;
786
835
  avatar.imageName = file.name;
787
836
  setAvatar(Object.assign({}, avatar));
788
- case 11:
789
837
  onChange === null || onChange === void 0 ? void 0 : onChange([file]);
838
+ _context2.next = 16;
839
+ break;
840
+ case 14:
841
+ setAvatar({
842
+ imageUrl: ''
843
+ });
844
+ onChange === null || onChange === void 0 ? void 0 : onChange([]);
845
+ case 16:
790
846
  return _context2.abrupt("return");
791
- case 13:
847
+ case 17:
792
848
  if (maxCount === 1) {
793
849
  cloneList = cloneList.slice(-1);
794
850
  } else if (maxCount) {
@@ -796,7 +852,7 @@ var ImageUpload = function ImageUpload(props) {
796
852
  }
797
853
  onChange === null || onChange === void 0 ? void 0 : onChange(cloneList);
798
854
  setUploadFileList(cloneList);
799
- case 16:
855
+ case 20:
800
856
  case "end":
801
857
  return _context2.stop();
802
858
  }
@@ -880,11 +936,6 @@ var ImageUpload = function ImageUpload(props) {
880
936
  setUploadFileList(_toConsumableArray(fileList));
881
937
  }
882
938
  }, [fileList]);
883
- useEffect(function () {
884
- if (defaultImage) {
885
- setAvatar(Object.assign({}, defaultImage));
886
- }
887
- }, [defaultImage]);
888
939
  //渲染上传列表
889
940
  var renderUploadList = function renderUploadList() {
890
941
  return showUploadList && jsx(UploadList, {
@@ -906,12 +957,18 @@ var ImageUpload = function ImageUpload(props) {
906
957
  var renderUploadContent = function renderUploadContent() {
907
958
  var _a;
908
959
  var avatarUploadNode = jsxs("div", Object.assign({
909
- className: 'upload-img-wrapper'
960
+ className: 'upload-img-wrapper',
961
+ style: borderRadius ? {
962
+ borderRadius: borderRadius
963
+ } : {}
910
964
  }, {
911
965
  children: [jsx("img", {
912
966
  src: avatar.imageUrl,
913
- alt: (_a = avatar.imageName) !== null && _a !== void 0 ? _a : ''
914
- }), avatar.imageName && jsx("span", Object.assign({
967
+ alt: (_a = avatar.imageName) !== null && _a !== void 0 ? _a : '',
968
+ style: borderRadius ? {
969
+ borderRadius: borderRadius
970
+ } : {}
971
+ }), avatar.imageName && showPicName && jsx("span", Object.assign({
915
972
  className: 'upload-img-wrapper-name'
916
973
  }, {
917
974
  children: avatar.imageName
@@ -954,15 +1011,20 @@ var ImageUpload = function ImageUpload(props) {
954
1011
  };
955
1012
  //渲染上传控件
956
1013
  var renderUploadSelector = function renderUploadSelector() {
957
- if (readonly) return null;
958
1014
  return jsxs("div", Object.assign({
959
- className: clsx('upload-image-select', showLoading && 'upload-image-select-loading')
1015
+ className: clsx('upload-image-select', showLoading && 'upload-image-select-loading', isAvatar && 'is-avatar'),
1016
+ style: borderRadius ? {
1017
+ borderRadius: borderRadius
1018
+ } : {}
960
1019
  }, {
961
1020
  children: [jsx(RcUpload, Object.assign({}, overrideProps, {
962
1021
  prefixCls: "".concat($rcPrefixCls, "-upload")
963
1022
  }, {
964
1023
  children: jsx("div", Object.assign({
965
- className: "".concat(isAvatarMode ? 'is-avatar ' : '', "upload-image-picture-card")
1024
+ className: "".concat(isAvatarMode ? 'is-avatar ' : '', "upload-image-picture-card"),
1025
+ style: borderRadius ? {
1026
+ borderRadius: borderRadius
1027
+ } : {}
966
1028
  }, {
967
1029
  children: renderUploadContent()
968
1030
  }))
@@ -972,11 +1034,25 @@ var ImageUpload = function ImageUpload(props) {
972
1034
  })]
973
1035
  }));
974
1036
  };
1037
+ var handleReset = function handleReset() {
1038
+ handleRemove(uploadFileList[0]);
1039
+ };
975
1040
  return jsxs("div", Object.assign({
976
1041
  className: clsx("".concat($prefixCls, "-upload-image"), className),
977
1042
  style: style
978
1043
  }, {
979
- children: [renderUploadList(), renderUploadSelector()]
1044
+ children: [renderUploadList(), !readonly ? showResetBtn && avatar.imageUrl ? jsxs("div", Object.assign({
1045
+ className: "upload-img-wrapper-container"
1046
+ }, {
1047
+ children: [jsx(Button.IconButton, Object.assign({
1048
+ className: "upload-img-wrapper-container__del-btn",
1049
+ variant: "text",
1050
+ size: "small",
1051
+ onClick: handleReset
1052
+ }, {
1053
+ children: jsx(CloseIcon, {})
1054
+ })), renderUploadSelector()]
1055
+ })) : renderUploadSelector() : jsx(Fragment, {})]
980
1056
  }));
981
1057
  };
982
1058
 
@@ -44,6 +44,22 @@ export interface IShowUploadList {
44
44
  previewIcon?: React.ReactNode;
45
45
  }
46
46
  type ItemRender<T = any> = (file: UploadFile, fileList?: Array<UploadFile<T>>) => React.ReactNode;
47
+ export interface DefaultImage {
48
+ /** 图片地址 */
49
+ imageUrl: string;
50
+ /** 图片名称 */
51
+ imageName?: string;
52
+ }
53
+ export interface AvatarProps {
54
+ /** 圆角 */
55
+ borderRadius?: string | number;
56
+ /** 是否展示重置按钮 */
57
+ showReset?: boolean;
58
+ /** 图片地址 */
59
+ defaultImage?: DefaultImage;
60
+ /** 是否展示图片名称 */
61
+ showName?: boolean;
62
+ }
47
63
  export interface UploadProps<T = any> {
48
64
  /**上传类型*/
49
65
  type?: UploadType;
@@ -73,6 +89,8 @@ export interface UploadProps<T = any> {
73
89
  accept?: string;
74
90
  /**是否支持多选文件,开启后按住 ctrl 可选择多个文件*/
75
91
  multiple?: boolean;
92
+ /** 头像 */
93
+ avatarProps?: boolean | AvatarProps;
76
94
  /**上传文件改变时的状态*/
77
95
  onChange?: (info: UploadFile[]) => void;
78
96
  /**上传开始*/
@@ -1,8 +1,8 @@
1
- import { _ as _slicedToArray } from './slicedToArray-a8206399.js';
1
+ import { _ as _slicedToArray } from './slicedToArray-75fa4188.js';
2
2
  import * as React from 'react';
3
3
  import { createPortal } from 'react-dom';
4
4
  import { a as _defineProperty, _ as _typeof } from './defineProperty-f0e15205.js';
5
- import { _ as _toConsumableArray } from './toConsumableArray-8f4c9589.js';
5
+ import { _ as _toConsumableArray } from './toConsumableArray-c7a8028f.js';
6
6
 
7
7
  function _extends() {
8
8
  _extends = Object.assign ? Object.assign.bind() : function (target) {
@@ -1,6 +1,6 @@
1
- import { _ as _toConsumableArray } from './toConsumableArray-8f4c9589.js';
1
+ import { _ as _toConsumableArray } from './toConsumableArray-c7a8028f.js';
2
2
  import { _ as _typeof, a as _defineProperty } from './defineProperty-f0e15205.js';
3
- import { _ as _slicedToArray } from './slicedToArray-a8206399.js';
3
+ import { _ as _slicedToArray } from './slicedToArray-75fa4188.js';
4
4
  import { r as regenerator } from './index-8ac46bd9.js';
5
5
  import { _ as __rest, a as __awaiter } from './tslib.es6-55ed4bd2.js';
6
6
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
@@ -1,14 +1,13 @@
1
1
  import { _ as __rest } from './tslib.es6-55ed4bd2.js';
2
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
- import { c as clsx, _ as _objectSpread2, r as reactIs, s as supportRef, u as useComposeRef, w as warning, a as _extends, b as _objectWithoutProperties, d as wrapperRaf, e as useEvent$2, f as useLayoutEffect$3, g as composeRef, K as KeyCode, h as fillRef, P as Portal, i as warningOnce, j as useMergedState$2, k as canUseDom$1, l as useMemo$1, n as noteOnce } from './Portal-5bf66fed.js';
4
- import { _ as _toConsumableArray, a as _iterableToArray } from './toConsumableArray-8f4c9589.js';
3
+ import { c as clsx, _ as _objectSpread2, r as reactIs, s as supportRef, u as useComposeRef, w as warning, a as _extends, b as _objectWithoutProperties, d as wrapperRaf, e as useEvent$2, f as useLayoutEffect$3, g as composeRef, K as KeyCode, h as fillRef, P as Portal, i as warningOnce, j as useMergedState$2, k as canUseDom$1, l as useMemo$1, n as noteOnce } from './Portal-42560ff0.js';
4
+ import { _ as _toConsumableArray, a as _iterableToArray } from './toConsumableArray-c7a8028f.js';
5
5
  import { _ as _typeof$1, t as toPropertyKey, a as _defineProperty } from './defineProperty-f0e15205.js';
6
- import { _ as _slicedToArray, a as _arrayWithHoles, b as _nonIterableRest } from './slicedToArray-a8206399.js';
6
+ import { _ as _slicedToArray, a as _arrayWithHoles, b as _unsupportedIterableToArray, c as _nonIterableRest } from './slicedToArray-75fa4188.js';
7
7
  import * as React$4 from 'react';
8
8
  import React__default, { useState as useState$1, useMemo, useCallback, useRef, useEffect } from 'react';
9
9
  import ReactDOM, { unstable_batchedUpdates, flushSync } from 'react-dom';
10
10
  import CSSMotion from 'rc-motion';
11
- import { _ as _unsupportedIterableToArray } from './unsupportedIterableToArray-cb478f24.js';
12
11
  import clsx$1 from 'clsx';
13
12
  import { _ as _typeof$2 } from './typeof-6ec38efd.js';
14
13
  import { conductCheck } from 'rc-tree/lib/utils/conductUtil';
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import React__default from 'react';
3
3
  import { TextField } from '../TextField/index.js';
4
- import { _ as _slicedToArray } from './slicedToArray-a8206399.js';
4
+ import { _ as _slicedToArray } from './slicedToArray-75fa4188.js';
5
5
  import { RadioGroup } from '../RadioGroup/index.js';
6
6
  import Select from '../Select/index.js';
7
7
  import { CheckboxGroup } from '../CheckboxGroup/index.js';
@@ -1,4 +1,17 @@
1
- import { _ as _unsupportedIterableToArray } from './unsupportedIterableToArray-cb478f24.js';
1
+ function _arrayLikeToArray(arr, len) {
2
+ if (len == null || len > arr.length) len = arr.length;
3
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
4
+ return arr2;
5
+ }
6
+
7
+ function _unsupportedIterableToArray(o, minLen) {
8
+ if (!o) return;
9
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
10
+ var n = Object.prototype.toString.call(o).slice(8, -1);
11
+ if (n === "Object" && o.constructor) n = o.constructor.name;
12
+ if (n === "Map" || n === "Set") return Array.from(o);
13
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
14
+ }
2
15
 
3
16
  function _arrayWithHoles(arr) {
4
17
  if (Array.isArray(arr)) return arr;
@@ -40,4 +53,4 @@ function _slicedToArray(arr, i) {
40
53
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
41
54
  }
42
55
 
43
- export { _slicedToArray as _, _arrayWithHoles as a, _nonIterableRest as b };
56
+ export { _slicedToArray as _, _arrayWithHoles as a, _unsupportedIterableToArray as b, _nonIterableRest as c, _arrayLikeToArray as d };
@@ -1,4 +1,4 @@
1
- import { a as _arrayLikeToArray, _ as _unsupportedIterableToArray } from './unsupportedIterableToArray-cb478f24.js';
1
+ import { d as _arrayLikeToArray, b as _unsupportedIterableToArray } from './slicedToArray-75fa4188.js';
2
2
 
3
3
  function _arrayWithoutHoles(arr) {
4
4
  if (Array.isArray(arr)) return _arrayLikeToArray(arr);