assui 3.1.71 → 3.1.72

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.
@@ -8,6 +8,8 @@ export interface ComplexValSelectOptionType extends Omit<BaseOptionType, 'value'
8
8
  children?: ComplexValSelectOptionType[];
9
9
  options?: Omit<ComplexValSelectOptionType, 'children' | 'options'>[];
10
10
  }
11
+ /** 判断optionsValue是否是引用类型 */
12
+ export declare const isReferenceTypeOption: (options?: ComplexValSelectOptionType[] | undefined) => boolean;
11
13
  export interface ComplexValSelectProps<T> extends Omit<SelectProps, 'value' | 'onChange' | 'options'> {
12
14
  value?: T;
13
15
  onChange?: (val: T, opt?: ComplexValSelectOptionType[]) => void;
@@ -59,6 +59,21 @@ var formatOptions = function formatOptions(dateSource) {
59
59
  }
60
60
  return dateSource;
61
61
  };
62
+ /** 判断optionsValue是否是引用类型 */
63
+ export var isReferenceTypeOption = function isReferenceTypeOption(options) {
64
+ var resultBoolean = some(options, function (item) {
65
+ if (item.value) {
66
+ return isArray(item.value) || isObject(item.value);
67
+ }
68
+ if (item.options) {
69
+ return some(item.options, function (i) {
70
+ return isArray(i.value) || isObject(i.value);
71
+ });
72
+ }
73
+ return false;
74
+ });
75
+ return resultBoolean;
76
+ };
62
77
  var ComplexValSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
63
78
  var _a = __read(useControllableValue(props), 2),
64
79
  value = _a[0],
@@ -71,17 +86,7 @@ var ComplexValSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
71
86
  return selectRef.current;
72
87
  });
73
88
  // 判断是否需要将optionValue转为JSON字符串
74
- var isReferenceTypeVal = some(options, function (item) {
75
- if (item.value) {
76
- return isArray(item.value) || isObject(item.value);
77
- }
78
- if (item.options) {
79
- return some(item.options, function (i) {
80
- return isArray(i.value) || isObject(i.value);
81
- });
82
- }
83
- return false;
84
- });
89
+ var isReferenceTypeVal = isReferenceTypeOption(options);
85
90
  var finalOptions = isReferenceTypeVal ? formatOptions(options) : options;
86
91
  var handleChange = function handleChange(val) {
87
92
  var nextVal = val && isReferenceTypeVal ? JSON.parse(val) : val;
@@ -50,16 +50,18 @@ import trimStart from 'lodash/trimStart';
50
50
  import useMount from "ahooks/es/useMount";
51
51
  import HighlighedContents from './HighlighedContents';
52
52
  var HighlightWithinTextarea = /*#__PURE__*/React.forwardRef(function (props, ref) {
53
- var prefixCls = props.prefixCls,
53
+ var _a = props.prefixCls,
54
+ prefixCls = _a === void 0 ? 'ant' : _a,
54
55
  value = props.value,
55
56
  onChange = props.onChange,
56
- highlight = props.highlight,
57
+ _b = props.highlight,
58
+ highlight = _b === void 0 ? '' : _b,
57
59
  className = props.className,
58
60
  textAreaClassName = props.textAreaClassName,
59
61
  textareaProps = __rest(props, ["prefixCls", "value", "onChange", "highlight", "className", "textAreaClassName"]);
60
- var _a = __read(React.useState(''), 2),
61
- textAreaValue = _a[0],
62
- setTextAreaValue = _a[1];
62
+ var _c = __read(React.useState(''), 2),
63
+ textAreaValue = _c[0],
64
+ setTextAreaValue = _c[1];
63
65
  var resultValue = value || textAreaValue;
64
66
  var containerRef = React.useRef();
65
67
  var backdropRef = React.useRef();
@@ -106,8 +108,4 @@ var HighlightWithinTextarea = /*#__PURE__*/React.forwardRef(function (props, ref
106
108
  ref: ref
107
109
  })));
108
110
  });
109
- HighlightWithinTextarea.defaultProps = {
110
- highlight: '',
111
- prefixCls: 'ant'
112
- };
113
111
  export default HighlightWithinTextarea;
@@ -36,18 +36,6 @@ export declare type Area = {
36
36
  };
37
37
  declare const ImgCrop: {
38
38
  (props: ImgCropProps): JSX.Element;
39
- defaultProps: {
40
- prefix: string;
41
- aspect: number;
42
- shape: string;
43
- grid: boolean;
44
- quality: number;
45
- zoom: boolean;
46
- rotate: boolean;
47
- minZoom: number;
48
- maxZoom: number;
49
- fillColor: string;
50
- };
51
39
  getCroppedImg: typeof getCroppedImg;
52
40
  };
53
41
  export default ImgCrop;
@@ -173,16 +173,26 @@ var MIN_ROTATE = 0;
173
173
  var MAX_ROTATE = 360;
174
174
  var ROTATE_STEP = 1;
175
175
  var ImgCrop = function ImgCrop(props) {
176
- var aspect = props.aspect,
177
- shape = props.shape,
178
- grid = props.grid,
179
- quality = props.quality,
180
- zoom = props.zoom,
181
- rotate = props.rotate,
182
- minZoom = props.minZoom,
183
- maxZoom = props.maxZoom,
184
- fillColor = props.fillColor,
185
- prefix = props.prefix,
176
+ var _a = props.aspect,
177
+ aspect = _a === void 0 ? 1 : _a,
178
+ _b = props.shape,
179
+ shape = _b === void 0 ? 'rect' : _b,
180
+ _c = props.grid,
181
+ grid = _c === void 0 ? false : _c,
182
+ _d = props.quality,
183
+ quality = _d === void 0 ? 0.4 : _d,
184
+ _e = props.zoom,
185
+ zoom = _e === void 0 ? true : _e,
186
+ _f = props.rotate,
187
+ rotate = _f === void 0 ? false : _f,
188
+ _g = props.minZoom,
189
+ minZoom = _g === void 0 ? 1 : _g,
190
+ _h = props.maxZoom,
191
+ maxZoom = _h === void 0 ? 3 : _h,
192
+ _j = props.fillColor,
193
+ fillColor = _j === void 0 ? 'rgba(0,0,0,0)' : _j,
194
+ _k = props.prefix,
195
+ prefix = _k === void 0 ? 'ant' : _k,
186
196
  modalTitle = props.modalTitle,
187
197
  modalWidth = props.modalWidth,
188
198
  modalOk = props.modalOk,
@@ -195,15 +205,15 @@ var ImgCrop = function ImgCrop(props) {
195
205
  var MEDIA_CLASS = "".concat(pkg, "-media");
196
206
  var hasZoom = zoom === true;
197
207
  var hasRotate = rotate === true;
198
- var _a = __read(React.useState(''), 2),
199
- src = _a[0],
200
- setSrc = _a[1];
201
- var _b = __read(React.useState(1), 2),
202
- zoomVal = _b[0],
203
- setZoomVal = _b[1];
204
- var _c = __read(React.useState(0), 2),
205
- rotateVal = _c[0],
206
- setRotateVal = _c[1];
208
+ var _l = __read(React.useState(''), 2),
209
+ src = _l[0],
210
+ setSrc = _l[1];
211
+ var _m = __read(React.useState(1), 2),
212
+ zoomVal = _m[0],
213
+ setZoomVal = _m[1];
214
+ var _o = __read(React.useState(0), 2),
215
+ rotateVal = _o[0],
216
+ setRotateVal = _o[1];
207
217
  var beforeUploadRef = React.useRef();
208
218
  var fileRef = React.useRef();
209
219
  var resolveRef = React.useRef(noop);
@@ -426,17 +436,5 @@ var ImgCrop = function ImgCrop(props) {
426
436
  };
427
437
  return renderComponent(modalTitle);
428
438
  };
429
- ImgCrop.defaultProps = {
430
- prefix: 'ant',
431
- aspect: 1,
432
- shape: 'rect',
433
- grid: false,
434
- quality: 0.4,
435
- zoom: true,
436
- rotate: false,
437
- minZoom: 1,
438
- maxZoom: 3,
439
- fillColor: 'rgba(0,0,0,0)'
440
- };
441
439
  ImgCrop.getCroppedImg = getCroppedImg;
442
440
  export default ImgCrop;
@@ -23,9 +23,6 @@ export interface SelfTabPaneProps extends TabPaneProps {
23
23
  }
24
24
  declare const KeepTab: {
25
25
  (props: KeepTabProps): JSX.Element;
26
- defaultProps: {
27
- saveActiveKeyName: string;
28
- };
29
26
  displayName: string;
30
27
  TabPane: React.FC<TabPaneProps>;
31
28
  };
@@ -58,21 +58,22 @@ var KeepTab = function KeepTab(props) {
58
58
  var _b = props.items,
59
59
  items = _b === void 0 ? [] : _b,
60
60
  defaultActiveKey = props.defaultActiveKey,
61
- saveActiveKeyName = props.saveActiveKeyName,
61
+ _c = props.saveActiveKeyName,
62
+ saveActiveKeyName = _c === void 0 ? 'active' : _c,
62
63
  onChange = props.onChange,
63
- _c = props.badgeProps,
64
- badgeProps = _c === void 0 ? defaultBadgeProps : _c,
64
+ _d = props.badgeProps,
65
+ badgeProps = _d === void 0 ? defaultBadgeProps : _d,
65
66
  restProps = __rest(props, ["items", "defaultActiveKey", "saveActiveKeyName", "onChange", "badgeProps"]);
66
67
  var defaultUrlParams = qsHelp.getQueryObject();
67
- var _d = __read(useUrlState((_a = {}, _a[saveActiveKeyName] = defaultUrlParams[saveActiveKeyName] || defaultActiveKey, _a)), 2),
68
- urlParams = _d[0],
69
- setUrlParams = _d[1];
70
- var _e = __read(useControllableValue(props, {
68
+ var _e = __read(useUrlState((_a = {}, _a[saveActiveKeyName] = defaultUrlParams[saveActiveKeyName] || defaultActiveKey, _a)), 2),
69
+ urlParams = _e[0],
70
+ setUrlParams = _e[1];
71
+ var _f = __read(useControllableValue(props, {
71
72
  valuePropName: 'activeKey',
72
73
  defaultValue: defaultUrlParams[saveActiveKeyName] || defaultActiveKey
73
74
  }), 2),
74
- tabActiveKey = _e[0],
75
- setTabActiveKey = _e[1];
75
+ tabActiveKey = _f[0],
76
+ setTabActiveKey = _f[1];
76
77
  React.useEffect(function () {
77
78
  var _a;
78
79
  if (!('activeKey' in props) && items) {
@@ -112,9 +113,6 @@ var KeepTab = function KeepTab(props) {
112
113
  items: resultItems
113
114
  }));
114
115
  };
115
- KeepTab.defaultProps = {
116
- saveActiveKeyName: 'active'
117
- };
118
116
  KeepTab.displayName = 'KeepTab';
119
117
  KeepTab.TabPane = TabPane;
120
118
  export default KeepTab;
@@ -65,7 +65,8 @@ var NumberInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
65
65
  precision = props.precision,
66
66
  formatter = props.formatter,
67
67
  parser = props.parser,
68
- enableMinus = props.enableMinus,
68
+ _d = props.enableMinus,
69
+ enableMinus = _d === void 0 ? false : _d,
69
70
  onBlur = props.onBlur,
70
71
  maxLength = props.maxLength,
71
72
  restProps = __rest(props, ["onChange", "numberType", "dataType", "precision", "formatter", "parser", "enableMinus", "onBlur", "maxLength"]);
@@ -117,8 +118,5 @@ var NumberInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
117
118
  maxLength: maxLength
118
119
  }, omit(restProps, ['value'])));
119
120
  });
120
- NumberInput.defaultProps = {
121
- enableMinus: false
122
- };
123
121
  export { numberTypeEnum, dataTypeEnum };
124
122
  export default NumberInput;
@@ -16,14 +16,5 @@ export interface RcEchartPropsType {
16
16
  onEvents?: Record<string, Function>;
17
17
  opts?: Opts;
18
18
  }
19
- declare const ReactEchartCore: {
20
- (props: RcEchartPropsType): JSX.Element;
21
- defaultProps: {
22
- notMerge: boolean;
23
- lazyUpdate: boolean;
24
- className: string;
25
- onEvents: {};
26
- opts: {};
27
- };
28
- };
19
+ declare const ReactEchartCore: (props: RcEchartPropsType) => JSX.Element;
29
20
  export default ReactEchartCore;
@@ -6,13 +6,18 @@ import useUpdateEffect from "ahooks/es/useUpdateEffect";
6
6
  import classNames from 'classnames';
7
7
  import ResizeObserver from 'resize-observer-polyfill';
8
8
  var ReactEchartCore = function ReactEchartCore(props) {
9
- var className = props.className,
9
+ var _a = props.className,
10
+ className = _a === void 0 ? '' : _a,
10
11
  option = props.option,
11
12
  echarts = props.echarts,
12
- notMerge = props.notMerge,
13
- lazyUpdate = props.lazyUpdate,
14
- onEvents = props.onEvents,
15
- opts = props.opts,
13
+ _b = props.notMerge,
14
+ notMerge = _b === void 0 ? false : _b,
15
+ _c = props.lazyUpdate,
16
+ lazyUpdate = _c === void 0 ? false : _c,
17
+ _d = props.onEvents,
18
+ onEvents = _d === void 0 ? {} : _d,
19
+ _e = props.opts,
20
+ opts = _e === void 0 ? {} : _e,
16
21
  theme = props.theme;
17
22
  var chartDomRef = useRef();
18
23
  var chartRef = useRef();
@@ -93,12 +98,4 @@ var ReactEchartCore = function ReactEchartCore(props) {
93
98
  className: classNames('react-echart', className)
94
99
  });
95
100
  };
96
- ReactEchartCore.defaultProps = {
97
- notMerge: false,
98
- lazyUpdate: false,
99
- // style: {},
100
- className: '',
101
- onEvents: {},
102
- opts: {}
103
- };
104
101
  export default ReactEchartCore;
@@ -11,10 +11,6 @@ export interface RcQrcodeProps {
11
11
  }
12
12
  declare const RcQrcode: {
13
13
  (props: RcQrcodeProps): JSX.Element;
14
- defaultProps: {
15
- value: string;
16
- options: {};
17
- };
18
14
  useQrcode: (value: string | QRCodeSegment[], options?: QRCode.QRCodeToDataURLOptions) => string;
19
15
  };
20
16
  export default RcQrcode;
@@ -15,8 +15,10 @@ import QRCode from 'qrcode';
15
15
  import useMount from "ahooks/es/useMount";
16
16
  import useQrcode from './useQrcode';
17
17
  var RcQrcode = function RcQrcode(props) {
18
- var value = props.value,
19
- options = props.options,
18
+ var _a = props.value,
19
+ value = _a === void 0 ? '' : _a,
20
+ _b = props.options,
21
+ options = _b === void 0 ? {} : _b,
20
22
  getCanvasInstance = props.getCanvasInstance;
21
23
  var domElRef = React.useRef(null);
22
24
  var defaultOptions = {
@@ -39,10 +41,6 @@ var RcQrcode = function RcQrcode(props) {
39
41
  ref: domElRef
40
42
  });
41
43
  };
42
- RcQrcode.defaultProps = {
43
- value: '',
44
- options: {}
45
- };
46
44
  RcQrcode.useQrcode = useQrcode;
47
45
  export default RcQrcode;
48
46
  export { useQrcode };
@@ -13,10 +13,5 @@ export interface SingleImgUploadProps extends UploadProps {
13
13
  /** 格式化接口返回数据 */
14
14
  onFormatResData?: (res: any) => string;
15
15
  }
16
- declare const SingleImgUpload: {
17
- (props: SingleImgUploadProps): JSX.Element;
18
- defaultProps: {
19
- beforeUpload(): boolean;
20
- };
21
- };
16
+ declare const SingleImgUpload: (props: SingleImgUploadProps) => JSX.Element;
22
17
  export default SingleImgUpload;
@@ -195,24 +195,27 @@ var SingleImgUpload = function SingleImgUpload(props) {
195
195
  onFormatResData = props.onFormatResData,
196
196
  onSuccess = props.onSuccess,
197
197
  onCancel = props.onCancel,
198
- beforeUpload = props.beforeUpload,
198
+ _a = props.beforeUpload,
199
+ beforeUpload = _a === void 0 ? function () {
200
+ return true;
201
+ } : _a,
199
202
  onError = props.onError,
200
203
  disabled = props.disabled,
201
204
  restProps = __rest(props, ["className", "wrapperClassName", "children", "value", "onStart", "onDeleteUpload", "onFormatResData", "onSuccess", "onCancel", "beforeUpload", "onError", "disabled"]);
202
205
  var uploadInstanceRef = React.useRef();
203
206
  var fileRef = React.useRef();
204
- var _a = __read(React.useState(value ? 'done' : 'init'), 2),
205
- uploadStatus = _a[0],
206
- setUploadStatus = _a[1];
207
- var _b = __read(React.useState(value), 2),
208
- fileUrl = _b[0],
209
- setFileUrl = _b[1];
210
- var _c = __read(React.useState(0), 2),
211
- uploadPercent = _c[0],
212
- setUploadPercent = _c[1];
213
- var _d = __read(React.useState(false), 2),
214
- imageLoading = _d[0],
215
- setImageLoading = _d[1];
207
+ var _b = __read(React.useState(value ? 'done' : 'init'), 2),
208
+ uploadStatus = _b[0],
209
+ setUploadStatus = _b[1];
210
+ var _c = __read(React.useState(value), 2),
211
+ fileUrl = _c[0],
212
+ setFileUrl = _c[1];
213
+ var _d = __read(React.useState(0), 2),
214
+ uploadPercent = _d[0],
215
+ setUploadPercent = _d[1];
216
+ var _e = __read(React.useState(false), 2),
217
+ imageLoading = _e[0],
218
+ setImageLoading = _e[1];
216
219
  React.useEffect(function () {
217
220
  setFileUrl(value);
218
221
  if (value) {
@@ -343,9 +346,4 @@ var SingleImgUpload = function SingleImgUpload(props) {
343
346
  })
344
347
  }, children)));
345
348
  };
346
- SingleImgUpload.defaultProps = {
347
- beforeUpload: function beforeUpload() {
348
- return true;
349
- }
350
- };
351
349
  export default SingleImgUpload;
@@ -32,13 +32,5 @@ export interface StepNumberInputProps {
32
32
  allowClear?: boolean;
33
33
  disabled?: boolean;
34
34
  }
35
- declare const StepNumberInput: {
36
- (props: StepNumberInputProps): JSX.Element;
37
- defaultProps: {
38
- numberType: string;
39
- precision: number;
40
- enableMinus: boolean;
41
- step: number;
42
- };
43
- };
35
+ declare const StepNumberInput: (props: StepNumberInputProps) => JSX.Element;
44
36
  export default StepNumberInput;
@@ -61,13 +61,18 @@ var StepNumberInput = function StepNumberInput(props) {
61
61
  setValue = _a[1];
62
62
  var onChange = props.onChange,
63
63
  onBlur = props.onBlur,
64
- numberType = props.numberType,
65
- precision = props.precision,
66
- step = props.step,
64
+ _b = props.numberType,
65
+ numberType = _b === void 0 ? INT : _b,
66
+ _c = props.precision,
67
+ precision = _c === void 0 ? 2 : _c,
68
+ _d = props.step,
69
+ step = _d === void 0 ? 1 : _d,
67
70
  max = props.max,
68
71
  min = props.min,
69
72
  customDisabled = props.disabled,
70
- restProps = __rest(props, ["onChange", "onBlur", "numberType", "precision", "step", "max", "min", "disabled"]);
73
+ _e = props.enableMinus,
74
+ enableMinus = _e === void 0 ? false : _e,
75
+ restProps = __rest(props, ["onChange", "onBlur", "numberType", "precision", "step", "max", "min", "disabled", "enableMinus"]);
71
76
  var isEmpty = isUndefined(value) || value === '';
72
77
  var plusNumber = new BigNumber(value).plus(step).toString();
73
78
  var minusNumber = new BigNumber(value).minus(step).toString();
@@ -129,13 +134,8 @@ var StepNumberInput = function StepNumberInput(props) {
129
134
  onBlur: onNumberBlur,
130
135
  numberType: numberType,
131
136
  precision: precision,
132
- disabled: mergedDisabled
137
+ disabled: mergedDisabled,
138
+ enableMinus: enableMinus
133
139
  }, restProps)));
134
140
  };
135
- StepNumberInput.defaultProps = {
136
- numberType: INT,
137
- precision: 2,
138
- enableMinus: false,
139
- step: 1
140
- };
141
141
  export default StepNumberInput;
@@ -8,6 +8,8 @@ export interface ComplexValSelectOptionType extends Omit<BaseOptionType, 'value'
8
8
  children?: ComplexValSelectOptionType[];
9
9
  options?: Omit<ComplexValSelectOptionType, 'children' | 'options'>[];
10
10
  }
11
+ /** 判断optionsValue是否是引用类型 */
12
+ export declare const isReferenceTypeOption: (options?: ComplexValSelectOptionType[] | undefined) => boolean;
11
13
  export interface ComplexValSelectProps<T> extends Omit<SelectProps, 'value' | 'onChange' | 'options'> {
12
14
  value?: T;
13
15
  onChange?: (val: T, opt?: ComplexValSelectOptionType[]) => void;
@@ -77,7 +77,7 @@ var __importDefault = this && this.__importDefault || function (mod) {
77
77
  Object.defineProperty(exports, "__esModule", {
78
78
  value: true
79
79
  });
80
- exports.Option = void 0;
80
+ exports.isReferenceTypeOption = exports.Option = void 0;
81
81
  var React = __importStar(require("react"));
82
82
  var omit_1 = __importDefault(require("lodash/omit"));
83
83
  var find_1 = __importDefault(require("lodash/find"));
@@ -103,6 +103,22 @@ var formatOptions = function formatOptions(dateSource) {
103
103
  }
104
104
  return dateSource;
105
105
  };
106
+ /** 判断optionsValue是否是引用类型 */
107
+ var isReferenceTypeOption = function isReferenceTypeOption(options) {
108
+ var resultBoolean = (0, some_1["default"])(options, function (item) {
109
+ if (item.value) {
110
+ return (0, isArray_1["default"])(item.value) || (0, isObject_1["default"])(item.value);
111
+ }
112
+ if (item.options) {
113
+ return (0, some_1["default"])(item.options, function (i) {
114
+ return (0, isArray_1["default"])(i.value) || (0, isObject_1["default"])(i.value);
115
+ });
116
+ }
117
+ return false;
118
+ });
119
+ return resultBoolean;
120
+ };
121
+ exports.isReferenceTypeOption = isReferenceTypeOption;
106
122
  var ComplexValSelect = React.forwardRef(function (props, ref) {
107
123
  var _a = __read((0, useControllableValue_1["default"])(props), 2),
108
124
  value = _a[0],
@@ -115,17 +131,7 @@ var ComplexValSelect = React.forwardRef(function (props, ref) {
115
131
  return selectRef.current;
116
132
  });
117
133
  // 判断是否需要将optionValue转为JSON字符串
118
- var isReferenceTypeVal = (0, some_1["default"])(options, function (item) {
119
- if (item.value) {
120
- return (0, isArray_1["default"])(item.value) || (0, isObject_1["default"])(item.value);
121
- }
122
- if (item.options) {
123
- return (0, some_1["default"])(item.options, function (i) {
124
- return (0, isArray_1["default"])(i.value) || (0, isObject_1["default"])(i.value);
125
- });
126
- }
127
- return false;
128
- });
134
+ var isReferenceTypeVal = (0, exports.isReferenceTypeOption)(options);
129
135
  var finalOptions = isReferenceTypeVal ? formatOptions(options) : options;
130
136
  var handleChange = function handleChange(val) {
131
137
  var nextVal = val && isReferenceTypeVal ? JSON.parse(val) : val;
@@ -93,16 +93,18 @@ var trimStart_1 = __importDefault(require("lodash/trimStart"));
93
93
  var useMount_1 = __importDefault(require("ahooks/lib/useMount"));
94
94
  var HighlighedContents_1 = __importDefault(require("./HighlighedContents"));
95
95
  var HighlightWithinTextarea = React.forwardRef(function (props, ref) {
96
- var prefixCls = props.prefixCls,
96
+ var _a = props.prefixCls,
97
+ prefixCls = _a === void 0 ? 'ant' : _a,
97
98
  value = props.value,
98
99
  onChange = props.onChange,
99
- highlight = props.highlight,
100
+ _b = props.highlight,
101
+ highlight = _b === void 0 ? '' : _b,
100
102
  className = props.className,
101
103
  textAreaClassName = props.textAreaClassName,
102
104
  textareaProps = __rest(props, ["prefixCls", "value", "onChange", "highlight", "className", "textAreaClassName"]);
103
- var _a = __read(React.useState(''), 2),
104
- textAreaValue = _a[0],
105
- setTextAreaValue = _a[1];
105
+ var _c = __read(React.useState(''), 2),
106
+ textAreaValue = _c[0],
107
+ setTextAreaValue = _c[1];
106
108
  var resultValue = value || textAreaValue;
107
109
  var containerRef = React.useRef();
108
110
  var backdropRef = React.useRef();
@@ -149,8 +151,4 @@ var HighlightWithinTextarea = React.forwardRef(function (props, ref) {
149
151
  ref: ref
150
152
  })));
151
153
  });
152
- HighlightWithinTextarea.defaultProps = {
153
- highlight: '',
154
- prefixCls: 'ant'
155
- };
156
154
  exports["default"] = HighlightWithinTextarea;
@@ -36,18 +36,6 @@ export declare type Area = {
36
36
  };
37
37
  declare const ImgCrop: {
38
38
  (props: ImgCropProps): JSX.Element;
39
- defaultProps: {
40
- prefix: string;
41
- aspect: number;
42
- shape: string;
43
- grid: boolean;
44
- quality: number;
45
- zoom: boolean;
46
- rotate: boolean;
47
- minZoom: number;
48
- maxZoom: number;
49
- fillColor: string;
50
- };
51
39
  getCroppedImg: typeof getCroppedImg;
52
40
  };
53
41
  export default ImgCrop;
@@ -216,16 +216,26 @@ var MIN_ROTATE = 0;
216
216
  var MAX_ROTATE = 360;
217
217
  var ROTATE_STEP = 1;
218
218
  var ImgCrop = function ImgCrop(props) {
219
- var aspect = props.aspect,
220
- shape = props.shape,
221
- grid = props.grid,
222
- quality = props.quality,
223
- zoom = props.zoom,
224
- rotate = props.rotate,
225
- minZoom = props.minZoom,
226
- maxZoom = props.maxZoom,
227
- fillColor = props.fillColor,
228
- prefix = props.prefix,
219
+ var _a = props.aspect,
220
+ aspect = _a === void 0 ? 1 : _a,
221
+ _b = props.shape,
222
+ shape = _b === void 0 ? 'rect' : _b,
223
+ _c = props.grid,
224
+ grid = _c === void 0 ? false : _c,
225
+ _d = props.quality,
226
+ quality = _d === void 0 ? 0.4 : _d,
227
+ _e = props.zoom,
228
+ zoom = _e === void 0 ? true : _e,
229
+ _f = props.rotate,
230
+ rotate = _f === void 0 ? false : _f,
231
+ _g = props.minZoom,
232
+ minZoom = _g === void 0 ? 1 : _g,
233
+ _h = props.maxZoom,
234
+ maxZoom = _h === void 0 ? 3 : _h,
235
+ _j = props.fillColor,
236
+ fillColor = _j === void 0 ? 'rgba(0,0,0,0)' : _j,
237
+ _k = props.prefix,
238
+ prefix = _k === void 0 ? 'ant' : _k,
229
239
  modalTitle = props.modalTitle,
230
240
  modalWidth = props.modalWidth,
231
241
  modalOk = props.modalOk,
@@ -238,15 +248,15 @@ var ImgCrop = function ImgCrop(props) {
238
248
  var MEDIA_CLASS = "".concat(pkg, "-media");
239
249
  var hasZoom = zoom === true;
240
250
  var hasRotate = rotate === true;
241
- var _a = __read(React.useState(''), 2),
242
- src = _a[0],
243
- setSrc = _a[1];
244
- var _b = __read(React.useState(1), 2),
245
- zoomVal = _b[0],
246
- setZoomVal = _b[1];
247
- var _c = __read(React.useState(0), 2),
248
- rotateVal = _c[0],
249
- setRotateVal = _c[1];
251
+ var _l = __read(React.useState(''), 2),
252
+ src = _l[0],
253
+ setSrc = _l[1];
254
+ var _m = __read(React.useState(1), 2),
255
+ zoomVal = _m[0],
256
+ setZoomVal = _m[1];
257
+ var _o = __read(React.useState(0), 2),
258
+ rotateVal = _o[0],
259
+ setRotateVal = _o[1];
250
260
  var beforeUploadRef = React.useRef();
251
261
  var fileRef = React.useRef();
252
262
  var resolveRef = React.useRef(noop);
@@ -469,17 +479,5 @@ var ImgCrop = function ImgCrop(props) {
469
479
  };
470
480
  return renderComponent(modalTitle);
471
481
  };
472
- ImgCrop.defaultProps = {
473
- prefix: 'ant',
474
- aspect: 1,
475
- shape: 'rect',
476
- grid: false,
477
- quality: 0.4,
478
- zoom: true,
479
- rotate: false,
480
- minZoom: 1,
481
- maxZoom: 3,
482
- fillColor: 'rgba(0,0,0,0)'
483
- };
484
482
  ImgCrop.getCroppedImg = getCroppedImg_1["default"];
485
483
  exports["default"] = ImgCrop;
@@ -23,9 +23,6 @@ export interface SelfTabPaneProps extends TabPaneProps {
23
23
  }
24
24
  declare const KeepTab: {
25
25
  (props: KeepTabProps): JSX.Element;
26
- defaultProps: {
27
- saveActiveKeyName: string;
28
- };
29
26
  displayName: string;
30
27
  TabPane: React.FC<TabPaneProps>;
31
28
  };
@@ -101,21 +101,22 @@ var KeepTab = function KeepTab(props) {
101
101
  var _b = props.items,
102
102
  items = _b === void 0 ? [] : _b,
103
103
  defaultActiveKey = props.defaultActiveKey,
104
- saveActiveKeyName = props.saveActiveKeyName,
104
+ _c = props.saveActiveKeyName,
105
+ saveActiveKeyName = _c === void 0 ? 'active' : _c,
105
106
  onChange = props.onChange,
106
- _c = props.badgeProps,
107
- badgeProps = _c === void 0 ? defaultBadgeProps : _c,
107
+ _d = props.badgeProps,
108
+ badgeProps = _d === void 0 ? defaultBadgeProps : _d,
108
109
  restProps = __rest(props, ["items", "defaultActiveKey", "saveActiveKeyName", "onChange", "badgeProps"]);
109
110
  var defaultUrlParams = qsHelp_1["default"].getQueryObject();
110
- var _d = __read((0, use_url_state_1["default"])((_a = {}, _a[saveActiveKeyName] = defaultUrlParams[saveActiveKeyName] || defaultActiveKey, _a)), 2),
111
- urlParams = _d[0],
112
- setUrlParams = _d[1];
113
- var _e = __read((0, useControllableValue_1["default"])(props, {
111
+ var _e = __read((0, use_url_state_1["default"])((_a = {}, _a[saveActiveKeyName] = defaultUrlParams[saveActiveKeyName] || defaultActiveKey, _a)), 2),
112
+ urlParams = _e[0],
113
+ setUrlParams = _e[1];
114
+ var _f = __read((0, useControllableValue_1["default"])(props, {
114
115
  valuePropName: 'activeKey',
115
116
  defaultValue: defaultUrlParams[saveActiveKeyName] || defaultActiveKey
116
117
  }), 2),
117
- tabActiveKey = _e[0],
118
- setTabActiveKey = _e[1];
118
+ tabActiveKey = _f[0],
119
+ setTabActiveKey = _f[1];
119
120
  React.useEffect(function () {
120
121
  var _a;
121
122
  if (!('activeKey' in props) && items) {
@@ -155,9 +156,6 @@ var KeepTab = function KeepTab(props) {
155
156
  items: resultItems
156
157
  }));
157
158
  };
158
- KeepTab.defaultProps = {
159
- saveActiveKeyName: 'active'
160
- };
161
159
  KeepTab.displayName = 'KeepTab';
162
160
  KeepTab.TabPane = TabPane;
163
161
  exports["default"] = KeepTab;
@@ -111,7 +111,8 @@ var NumberInput = React.forwardRef(function (props, ref) {
111
111
  precision = props.precision,
112
112
  formatter = props.formatter,
113
113
  parser = props.parser,
114
- enableMinus = props.enableMinus,
114
+ _d = props.enableMinus,
115
+ enableMinus = _d === void 0 ? false : _d,
115
116
  onBlur = props.onBlur,
116
117
  maxLength = props.maxLength,
117
118
  restProps = __rest(props, ["onChange", "numberType", "dataType", "precision", "formatter", "parser", "enableMinus", "onBlur", "maxLength"]);
@@ -163,7 +164,4 @@ var NumberInput = React.forwardRef(function (props, ref) {
163
164
  maxLength: maxLength
164
165
  }, (0, omit_1["default"])(restProps, ['value'])));
165
166
  });
166
- NumberInput.defaultProps = {
167
- enableMinus: false
168
- };
169
167
  exports["default"] = NumberInput;
@@ -16,14 +16,5 @@ export interface RcEchartPropsType {
16
16
  onEvents?: Record<string, Function>;
17
17
  opts?: Opts;
18
18
  }
19
- declare const ReactEchartCore: {
20
- (props: RcEchartPropsType): JSX.Element;
21
- defaultProps: {
22
- notMerge: boolean;
23
- lazyUpdate: boolean;
24
- className: string;
25
- onEvents: {};
26
- opts: {};
27
- };
28
- };
19
+ declare const ReactEchartCore: (props: RcEchartPropsType) => JSX.Element;
29
20
  export default ReactEchartCore;
@@ -49,13 +49,18 @@ var useUpdateEffect_1 = __importDefault(require("ahooks/lib/useUpdateEffect"));
49
49
  var classnames_1 = __importDefault(require("classnames"));
50
50
  var resize_observer_polyfill_1 = __importDefault(require("resize-observer-polyfill"));
51
51
  var ReactEchartCore = function ReactEchartCore(props) {
52
- var className = props.className,
52
+ var _a = props.className,
53
+ className = _a === void 0 ? '' : _a,
53
54
  option = props.option,
54
55
  echarts = props.echarts,
55
- notMerge = props.notMerge,
56
- lazyUpdate = props.lazyUpdate,
57
- onEvents = props.onEvents,
58
- opts = props.opts,
56
+ _b = props.notMerge,
57
+ notMerge = _b === void 0 ? false : _b,
58
+ _c = props.lazyUpdate,
59
+ lazyUpdate = _c === void 0 ? false : _c,
60
+ _d = props.onEvents,
61
+ onEvents = _d === void 0 ? {} : _d,
62
+ _e = props.opts,
63
+ opts = _e === void 0 ? {} : _e,
59
64
  theme = props.theme;
60
65
  var chartDomRef = (0, react_1.useRef)();
61
66
  var chartRef = (0, react_1.useRef)();
@@ -136,12 +141,4 @@ var ReactEchartCore = function ReactEchartCore(props) {
136
141
  className: (0, classnames_1["default"])('react-echart', className)
137
142
  });
138
143
  };
139
- ReactEchartCore.defaultProps = {
140
- notMerge: false,
141
- lazyUpdate: false,
142
- // style: {},
143
- className: '',
144
- onEvents: {},
145
- opts: {}
146
- };
147
144
  exports["default"] = ReactEchartCore;
@@ -11,10 +11,6 @@ export interface RcQrcodeProps {
11
11
  }
12
12
  declare const RcQrcode: {
13
13
  (props: RcQrcodeProps): JSX.Element;
14
- defaultProps: {
15
- value: string;
16
- options: {};
17
- };
18
14
  useQrcode: (value: string | QRCodeSegment[], options?: QRCode.QRCodeToDataURLOptions) => string;
19
15
  };
20
16
  export default RcQrcode;
@@ -60,8 +60,10 @@ var useMount_1 = __importDefault(require("ahooks/lib/useMount"));
60
60
  var useQrcode_1 = __importDefault(require("./useQrcode"));
61
61
  exports.useQrcode = useQrcode_1["default"];
62
62
  var RcQrcode = function RcQrcode(props) {
63
- var value = props.value,
64
- options = props.options,
63
+ var _a = props.value,
64
+ value = _a === void 0 ? '' : _a,
65
+ _b = props.options,
66
+ options = _b === void 0 ? {} : _b,
65
67
  getCanvasInstance = props.getCanvasInstance;
66
68
  var domElRef = React.useRef(null);
67
69
  var defaultOptions = {
@@ -84,9 +86,5 @@ var RcQrcode = function RcQrcode(props) {
84
86
  ref: domElRef
85
87
  });
86
88
  };
87
- RcQrcode.defaultProps = {
88
- value: '',
89
- options: {}
90
- };
91
89
  RcQrcode.useQrcode = useQrcode_1["default"];
92
90
  exports["default"] = RcQrcode;
@@ -13,10 +13,5 @@ export interface SingleImgUploadProps extends UploadProps {
13
13
  /** 格式化接口返回数据 */
14
14
  onFormatResData?: (res: any) => string;
15
15
  }
16
- declare const SingleImgUpload: {
17
- (props: SingleImgUploadProps): JSX.Element;
18
- defaultProps: {
19
- beforeUpload(): boolean;
20
- };
21
- };
16
+ declare const SingleImgUpload: (props: SingleImgUploadProps) => JSX.Element;
22
17
  export default SingleImgUpload;
@@ -238,24 +238,27 @@ var SingleImgUpload = function SingleImgUpload(props) {
238
238
  onFormatResData = props.onFormatResData,
239
239
  onSuccess = props.onSuccess,
240
240
  onCancel = props.onCancel,
241
- beforeUpload = props.beforeUpload,
241
+ _a = props.beforeUpload,
242
+ beforeUpload = _a === void 0 ? function () {
243
+ return true;
244
+ } : _a,
242
245
  onError = props.onError,
243
246
  disabled = props.disabled,
244
247
  restProps = __rest(props, ["className", "wrapperClassName", "children", "value", "onStart", "onDeleteUpload", "onFormatResData", "onSuccess", "onCancel", "beforeUpload", "onError", "disabled"]);
245
248
  var uploadInstanceRef = React.useRef();
246
249
  var fileRef = React.useRef();
247
- var _a = __read(React.useState(value ? 'done' : 'init'), 2),
248
- uploadStatus = _a[0],
249
- setUploadStatus = _a[1];
250
- var _b = __read(React.useState(value), 2),
251
- fileUrl = _b[0],
252
- setFileUrl = _b[1];
253
- var _c = __read(React.useState(0), 2),
254
- uploadPercent = _c[0],
255
- setUploadPercent = _c[1];
256
- var _d = __read(React.useState(false), 2),
257
- imageLoading = _d[0],
258
- setImageLoading = _d[1];
250
+ var _b = __read(React.useState(value ? 'done' : 'init'), 2),
251
+ uploadStatus = _b[0],
252
+ setUploadStatus = _b[1];
253
+ var _c = __read(React.useState(value), 2),
254
+ fileUrl = _c[0],
255
+ setFileUrl = _c[1];
256
+ var _d = __read(React.useState(0), 2),
257
+ uploadPercent = _d[0],
258
+ setUploadPercent = _d[1];
259
+ var _e = __read(React.useState(false), 2),
260
+ imageLoading = _e[0],
261
+ setImageLoading = _e[1];
259
262
  React.useEffect(function () {
260
263
  setFileUrl(value);
261
264
  if (value) {
@@ -386,9 +389,4 @@ var SingleImgUpload = function SingleImgUpload(props) {
386
389
  })
387
390
  }, children)));
388
391
  };
389
- SingleImgUpload.defaultProps = {
390
- beforeUpload: function beforeUpload() {
391
- return true;
392
- }
393
- };
394
392
  exports["default"] = SingleImgUpload;
@@ -32,13 +32,5 @@ export interface StepNumberInputProps {
32
32
  allowClear?: boolean;
33
33
  disabled?: boolean;
34
34
  }
35
- declare const StepNumberInput: {
36
- (props: StepNumberInputProps): JSX.Element;
37
- defaultProps: {
38
- numberType: string;
39
- precision: number;
40
- enableMinus: boolean;
41
- step: number;
42
- };
43
- };
35
+ declare const StepNumberInput: (props: StepNumberInputProps) => JSX.Element;
44
36
  export default StepNumberInput;
@@ -104,13 +104,18 @@ var StepNumberInput = function StepNumberInput(props) {
104
104
  setValue = _a[1];
105
105
  var onChange = props.onChange,
106
106
  onBlur = props.onBlur,
107
- numberType = props.numberType,
108
- precision = props.precision,
109
- step = props.step,
107
+ _b = props.numberType,
108
+ numberType = _b === void 0 ? numberType_1.INT : _b,
109
+ _c = props.precision,
110
+ precision = _c === void 0 ? 2 : _c,
111
+ _d = props.step,
112
+ step = _d === void 0 ? 1 : _d,
110
113
  max = props.max,
111
114
  min = props.min,
112
115
  customDisabled = props.disabled,
113
- restProps = __rest(props, ["onChange", "onBlur", "numberType", "precision", "step", "max", "min", "disabled"]);
116
+ _e = props.enableMinus,
117
+ enableMinus = _e === void 0 ? false : _e,
118
+ restProps = __rest(props, ["onChange", "onBlur", "numberType", "precision", "step", "max", "min", "disabled", "enableMinus"]);
114
119
  var isEmpty = (0, isUndefined_1["default"])(value) || value === '';
115
120
  var plusNumber = new bignumber_js_1["default"](value).plus(step).toString();
116
121
  var minusNumber = new bignumber_js_1["default"](value).minus(step).toString();
@@ -172,13 +177,8 @@ var StepNumberInput = function StepNumberInput(props) {
172
177
  onBlur: onNumberBlur,
173
178
  numberType: numberType,
174
179
  precision: precision,
175
- disabled: mergedDisabled
180
+ disabled: mergedDisabled,
181
+ enableMinus: enableMinus
176
182
  }, restProps)));
177
183
  };
178
- StepNumberInput.defaultProps = {
179
- numberType: numberType_1.INT,
180
- precision: 2,
181
- enableMinus: false,
182
- step: 1
183
- };
184
184
  exports["default"] = StepNumberInput;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assui",
3
- "version": "3.1.71",
3
+ "version": "3.1.72",
4
4
  "description": "react ui library",
5
5
  "author": "jason <usochen@gmail.com>",
6
6
  "main": "./lib/index.js",
@@ -80,5 +80,5 @@
80
80
  "node": ">=10.0.0"
81
81
  },
82
82
  "license": "MIT",
83
- "gitHead": "fc3a7c7f61f1fd586dfb7d28e0bf6b83f2f73610"
83
+ "gitHead": "f82c41ddf42a59ea1ce303251a84b89d36370468"
84
84
  }