acud 0.0.70 → 0.0.71

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.
@@ -78,7 +78,8 @@ var flattenTree = function flattenTree(options, props) {
78
78
  return flattenOptions;
79
79
  };
80
80
 
81
- var defaultDisplayRender = function defaultDisplayRender(label) {
81
+ var defaultDisplayRender = function defaultDisplayRender() {
82
+ var label = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
82
83
  return label.join('>');
83
84
  };
84
85
 
@@ -135,7 +136,7 @@ var Cascader = function Cascader(props, ref) {
135
136
  var pickerLabelRef = useRef();
136
137
  var tagsRef = useRef();
137
138
 
138
- var _useState = useState(props.value || props.defaultValue || []),
139
+ var _useState = useState(props.value || props.defaultValue),
139
140
  _useState2 = _slicedToArray(_useState, 2),
140
141
  value = _useState2[0],
141
142
  setValue = _useState2[1];
@@ -311,7 +312,7 @@ var Cascader = function Cascader(props, ref) {
311
312
  var selectedOptionFirst = isMulti ? {} : selectedOptions[0];
312
313
 
313
314
  if (selectedOptionFirst === null || selectedOptionFirst === void 0 ? void 0 : selectedOptionFirst.__IS_FILTERED_OPTION) {
314
- var unwrappedValue = selectedOptionFirst[keepFilteredValueField] === undefined ? value[0] : selectedOptionFirst[keepFilteredValueField];
315
+ var unwrappedValue = selectedOptionFirst[keepFilteredValueField] === undefined ? first(value) : selectedOptionFirst[keepFilteredValueField];
315
316
  var unwrappedSelectedOptions = selectedOptionFirst.path;
316
317
  updateValue(unwrappedValue, unwrappedSelectedOptions);
317
318
  return;
@@ -418,9 +419,9 @@ var Cascader = function Cascader(props, ref) {
418
419
  });
419
420
  }
420
421
 
421
- var unwrappedValue = Array.isArray(value[0]) ? value[0] : value;
422
+ var unwrappedValue = Array.isArray(first(value)) ? first(value) : value;
422
423
  var selectedOptions = arrayTreeFilter(options, function (o, level) {
423
- return o[names.value] === unwrappedValue[level];
424
+ return o[names.value] === get(unwrappedValue, level);
424
425
  }, {
425
426
  childrenKeyName: names.children
426
427
  });
@@ -495,7 +496,7 @@ var Cascader = function Cascader(props, ref) {
495
496
  }, /*#__PURE__*/React.createElement(OutlinedLoading, {
496
497
  animation: "spin"
497
498
  }));
498
- var clearIcon = allowClear && !disabled && value.length > 0 || inputValue ? /*#__PURE__*/React.createElement(Clear, {
499
+ var clearIcon = allowClear && !disabled && get(value, 'length') > 0 || inputValue ? /*#__PURE__*/React.createElement(Clear, {
499
500
  className: "".concat(prefixCls, "-picker-clear"),
500
501
  onClick: handleSelectionClear
501
502
  }) : null;
@@ -862,6 +862,9 @@
862
862
  top: 2px;
863
863
  right: 12px;
864
864
  cursor: pointer;
865
+ display: flex;
866
+ align-items: center;
867
+ bottom: 2px;
865
868
  }
866
869
  .acud-input-password-outer-icon .acuicon svg {
867
870
  fill: #84868C;
@@ -337,6 +337,9 @@
337
337
  top: 2px;
338
338
  right: @padding-m;
339
339
  cursor: pointer;
340
+ display: flex;
341
+ align-items: center;
342
+ bottom: 2px;
340
343
  .acuicon{
341
344
  svg{
342
345
  fill:@G5;
@@ -77,6 +77,7 @@ var InternalUpload = function InternalUpload(props, ref) {
77
77
  type = props.type,
78
78
  children = props.children,
79
79
  style = props.style,
80
+ motionDeadline = props.motionDeadline,
80
81
  itemRender = props.itemRender,
81
82
  maxCount = props.maxCount,
82
83
  description = props.description,
@@ -421,6 +422,7 @@ var InternalUpload = function InternalUpload(props, ref) {
421
422
  return /*#__PURE__*/React.createElement(UploadList, {
422
423
  listType: listType,
423
424
  items: mergedFileList,
425
+ motionDeadline: motionDeadline,
424
426
  previewFile: previewFile,
425
427
  onPreview: onPreview,
426
428
  onDownload: onDownload,
@@ -3,6 +3,7 @@ import { ItemRender, UploadFile, UploadListProgressProps, UploadListType, Upload
3
3
  export interface ListItemProps {
4
4
  prefixCls: string;
5
5
  className?: string;
6
+ motionDeadline?: number;
6
7
  style?: React.CSSProperties;
7
8
  locale: UploadLocale;
8
9
  file: UploadFile;
@@ -32,6 +32,8 @@ var ListItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
32
32
  actionIconRender = _ref.actionIconRender,
33
33
  itemRender = _ref.itemRender,
34
34
  isImgUrl = _ref.isImgUrl,
35
+ _ref$motionDeadline = _ref.motionDeadline,
36
+ motionDeadline = _ref$motionDeadline === void 0 ? 2000 : _ref$motionDeadline,
35
37
  showPreviewIcon = _ref.showPreviewIcon,
36
38
  showRemoveIcon = _ref.showRemoveIcon,
37
39
  showDownloadIcon = _ref.showDownloadIcon,
@@ -186,7 +188,7 @@ var ListItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
186
188
  }, iconAndPreview), actions, showProgress && /*#__PURE__*/React.createElement(CSSMotion, {
187
189
  motionName: "".concat(rootPrefixCls, "-fade"),
188
190
  visible: file.status === 'uploading',
189
- motionDeadline: 2000
191
+ motionDeadline: motionDeadline
190
192
  }, function (_ref2) {
191
193
  var motionClassName = _ref2.className;
192
194
  // show loading icon if upload progress listener is disabled
@@ -85,6 +85,8 @@ var InternalUploadList = function InternalUploadList(_ref, ref) {
85
85
  downloadIcon = _ref.downloadIcon,
86
86
  uploadIcon = _ref.uploadIcon,
87
87
  progress = _ref.progress,
88
+ _ref$motionDeadline = _ref.motionDeadline,
89
+ motionDeadline = _ref$motionDeadline === void 0 ? 2000 : _ref$motionDeadline,
88
90
  appendAction = _ref.appendAction,
89
91
  itemRender = _ref.itemRender;
90
92
  var forceUpdate = useForceUpdate();
@@ -221,7 +223,7 @@ var InternalUploadList = function InternalUploadList(_ref, ref) {
221
223
  var animationDirection = listType === 'picture-card' ? 'animate-inline' : 'animate'; // const transitionName = list.length === 0 ? '' : `${prefixCls}-${animationDirection}`;
222
224
 
223
225
  var motionConfig = {
224
- motionDeadline: 2000,
226
+ motionDeadline: motionDeadline,
225
227
  motionName: "".concat(prefixCls, "-").concat(animationDirection),
226
228
  keys: motionKeyList,
227
229
  motionAppear: motionAppear
@@ -274,7 +276,8 @@ var InternalUploadList = function InternalUploadList(_ref, ref) {
274
276
  onPreview: onInternalPreview,
275
277
  onDownload: onInternalDownload,
276
278
  onClose: onInternalClose,
277
- onUpload: onInternalUpload
279
+ onUpload: onInternalUpload,
280
+ motionDeadline: motionDeadline
278
281
  });
279
282
  }));
280
283
  };
@@ -287,6 +290,7 @@ UploadList.defaultProps = {
287
290
  // showInfo: false
288
291
  },
289
292
  showUploadIcon: true,
293
+ motionDeadline: 2000,
290
294
  showRemoveIcon: true,
291
295
  showDownloadIcon: false,
292
296
  showPreviewIcon: true,
@@ -69,6 +69,7 @@ declare type BeforeUploadValueType = void | boolean | string | Blob | File;
69
69
  export interface UploadProps<T = any> {
70
70
  type?: UploadType;
71
71
  name?: string;
72
+ motionDeadline?: number;
72
73
  defaultFileList?: Array<UploadFile<T>>;
73
74
  fileList?: Array<UploadFile<T>>;
74
75
  action?: string | ((file: RcFile) => string) | ((file: RcFile) => PromiseLike<string>);
@@ -122,6 +123,7 @@ export interface UploadListProps<T = any> {
122
123
  items?: Array<UploadFile<T>>;
123
124
  progress?: UploadListProgressProps;
124
125
  prefixCls?: string;
126
+ motionDeadline?: number;
125
127
  showRemoveIcon?: boolean;
126
128
  showDownloadIcon?: boolean;
127
129
  showPreviewIcon?: boolean;
@@ -355,7 +355,7 @@
355
355
  position: relative;
356
356
  height: 66px;
357
357
  padding: 0;
358
- border: 1px 1px #d9d9d9;
358
+ border: 1px solid #d9d9d9;
359
359
  border-radius: 0px;
360
360
  }
361
361
  .acud-upload-list-picture .acud-upload-list-item:hover,
@@ -321,7 +321,7 @@
321
321
  position: relative;
322
322
  height: 66px;
323
323
  padding: 0;
324
- border: @border-width-base @upload-picture-card-border-style @border-color-base;
324
+ border: @border-width-base solid @border-color-base;
325
325
  border-radius: @border-radius-base;
326
326
 
327
327
  &:hover {
@@ -122,7 +122,8 @@ var flattenTree = function flattenTree(options, props) {
122
122
  return flattenOptions;
123
123
  };
124
124
 
125
- var defaultDisplayRender = function defaultDisplayRender(label) {
125
+ var defaultDisplayRender = function defaultDisplayRender() {
126
+ var label = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
126
127
  return label.join('>');
127
128
  };
128
129
 
@@ -179,7 +180,7 @@ var Cascader = function Cascader(props, ref) {
179
180
  var pickerLabelRef = (0, _react.useRef)();
180
181
  var tagsRef = (0, _react.useRef)();
181
182
 
182
- var _useState = (0, _react.useState)(props.value || props.defaultValue || []),
183
+ var _useState = (0, _react.useState)(props.value || props.defaultValue),
183
184
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
184
185
  value = _useState2[0],
185
186
  setValue = _useState2[1];
@@ -355,7 +356,7 @@ var Cascader = function Cascader(props, ref) {
355
356
  var selectedOptionFirst = isMulti ? {} : selectedOptions[0];
356
357
 
357
358
  if (selectedOptionFirst === null || selectedOptionFirst === void 0 ? void 0 : selectedOptionFirst.__IS_FILTERED_OPTION) {
358
- var unwrappedValue = selectedOptionFirst[keepFilteredValueField] === undefined ? value[0] : selectedOptionFirst[keepFilteredValueField];
359
+ var unwrappedValue = selectedOptionFirst[keepFilteredValueField] === undefined ? (0, _first["default"])(value) : selectedOptionFirst[keepFilteredValueField];
359
360
  var unwrappedSelectedOptions = selectedOptionFirst.path;
360
361
  updateValue(unwrappedValue, unwrappedSelectedOptions);
361
362
  return;
@@ -462,9 +463,9 @@ var Cascader = function Cascader(props, ref) {
462
463
  });
463
464
  }
464
465
 
465
- var unwrappedValue = Array.isArray(value[0]) ? value[0] : value;
466
+ var unwrappedValue = Array.isArray((0, _first["default"])(value)) ? (0, _first["default"])(value) : value;
466
467
  var selectedOptions = (0, _arrayTreeFilter["default"])(options, function (o, level) {
467
- return o[names.value] === unwrappedValue[level];
468
+ return o[names.value] === (0, _get["default"])(unwrappedValue, level);
468
469
  }, {
469
470
  childrenKeyName: names.children
470
471
  });
@@ -541,7 +542,7 @@ var Cascader = function Cascader(props, ref) {
541
542
  animation: "spin"
542
543
  }));
543
544
 
544
- var clearIcon = allowClear && !disabled && value.length > 0 || inputValue ? /*#__PURE__*/_react["default"].createElement(_clear["default"], {
545
+ var clearIcon = allowClear && !disabled && (0, _get["default"])(value, 'length') > 0 || inputValue ? /*#__PURE__*/_react["default"].createElement(_clear["default"], {
545
546
  className: "".concat(prefixCls, "-picker-clear"),
546
547
  onClick: handleSelectionClear
547
548
  }) : null;
@@ -862,6 +862,9 @@
862
862
  top: 2px;
863
863
  right: 12px;
864
864
  cursor: pointer;
865
+ display: flex;
866
+ align-items: center;
867
+ bottom: 2px;
865
868
  }
866
869
  .acud-input-password-outer-icon .acuicon svg {
867
870
  fill: #84868C;
@@ -337,6 +337,9 @@
337
337
  top: 2px;
338
338
  right: @padding-m;
339
339
  cursor: pointer;
340
+ display: flex;
341
+ align-items: center;
342
+ bottom: 2px;
340
343
  .acuicon{
341
344
  svg{
342
345
  fill:@G5;
@@ -107,6 +107,7 @@ var InternalUpload = function InternalUpload(props, ref) {
107
107
  type = props.type,
108
108
  children = props.children,
109
109
  style = props.style,
110
+ motionDeadline = props.motionDeadline,
110
111
  itemRender = props.itemRender,
111
112
  maxCount = props.maxCount,
112
113
  description = props.description,
@@ -447,6 +448,7 @@ var InternalUpload = function InternalUpload(props, ref) {
447
448
  return /*#__PURE__*/React.createElement(_UploadList["default"], {
448
449
  listType: listType,
449
450
  items: mergedFileList,
451
+ motionDeadline: motionDeadline,
450
452
  previewFile: previewFile,
451
453
  onPreview: onPreview,
452
454
  onDownload: onDownload,
@@ -3,6 +3,7 @@ import { ItemRender, UploadFile, UploadListProgressProps, UploadListType, Upload
3
3
  export interface ListItemProps {
4
4
  prefixCls: string;
5
5
  className?: string;
6
+ motionDeadline?: number;
6
7
  style?: React.CSSProperties;
7
8
  locale: UploadLocale;
8
9
  file: UploadFile;
@@ -60,6 +60,8 @@ var ListItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
60
60
  actionIconRender = _ref.actionIconRender,
61
61
  itemRender = _ref.itemRender,
62
62
  isImgUrl = _ref.isImgUrl,
63
+ _ref$motionDeadline = _ref.motionDeadline,
64
+ motionDeadline = _ref$motionDeadline === void 0 ? 2000 : _ref$motionDeadline,
63
65
  showPreviewIcon = _ref.showPreviewIcon,
64
66
  showRemoveIcon = _ref.showRemoveIcon,
65
67
  showDownloadIcon = _ref.showDownloadIcon,
@@ -214,7 +216,7 @@ var ListItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
214
216
  }, iconAndPreview), actions, showProgress && /*#__PURE__*/React.createElement(_rcMotion["default"], {
215
217
  motionName: "".concat(rootPrefixCls, "-fade"),
216
218
  visible: file.status === 'uploading',
217
- motionDeadline: 2000
219
+ motionDeadline: motionDeadline
218
220
  }, function (_ref2) {
219
221
  var motionClassName = _ref2.className;
220
222
  // show loading icon if upload progress listener is disabled
@@ -119,6 +119,8 @@ var InternalUploadList = function InternalUploadList(_ref, ref) {
119
119
  downloadIcon = _ref.downloadIcon,
120
120
  uploadIcon = _ref.uploadIcon,
121
121
  progress = _ref.progress,
122
+ _ref$motionDeadline = _ref.motionDeadline,
123
+ motionDeadline = _ref$motionDeadline === void 0 ? 2000 : _ref$motionDeadline,
122
124
  appendAction = _ref.appendAction,
123
125
  itemRender = _ref.itemRender;
124
126
  var forceUpdate = (0, _useForceUpdate["default"])();
@@ -254,7 +256,7 @@ var InternalUploadList = function InternalUploadList(_ref, ref) {
254
256
  var animationDirection = listType === 'picture-card' ? 'animate-inline' : 'animate'; // const transitionName = list.length === 0 ? '' : `${prefixCls}-${animationDirection}`;
255
257
 
256
258
  var motionConfig = {
257
- motionDeadline: 2000,
259
+ motionDeadline: motionDeadline,
258
260
  motionName: "".concat(prefixCls, "-").concat(animationDirection),
259
261
  keys: motionKeyList,
260
262
  motionAppear: motionAppear
@@ -307,7 +309,8 @@ var InternalUploadList = function InternalUploadList(_ref, ref) {
307
309
  onPreview: onInternalPreview,
308
310
  onDownload: onInternalDownload,
309
311
  onClose: onInternalClose,
310
- onUpload: onInternalUpload
312
+ onUpload: onInternalUpload,
313
+ motionDeadline: motionDeadline
311
314
  });
312
315
  }));
313
316
  };
@@ -320,6 +323,7 @@ UploadList.defaultProps = {
320
323
  // showInfo: false
321
324
  },
322
325
  showUploadIcon: true,
326
+ motionDeadline: 2000,
323
327
  showRemoveIcon: true,
324
328
  showDownloadIcon: false,
325
329
  showPreviewIcon: true,
@@ -69,6 +69,7 @@ declare type BeforeUploadValueType = void | boolean | string | Blob | File;
69
69
  export interface UploadProps<T = any> {
70
70
  type?: UploadType;
71
71
  name?: string;
72
+ motionDeadline?: number;
72
73
  defaultFileList?: Array<UploadFile<T>>;
73
74
  fileList?: Array<UploadFile<T>>;
74
75
  action?: string | ((file: RcFile) => string) | ((file: RcFile) => PromiseLike<string>);
@@ -122,6 +123,7 @@ export interface UploadListProps<T = any> {
122
123
  items?: Array<UploadFile<T>>;
123
124
  progress?: UploadListProgressProps;
124
125
  prefixCls?: string;
126
+ motionDeadline?: number;
125
127
  showRemoveIcon?: boolean;
126
128
  showDownloadIcon?: boolean;
127
129
  showPreviewIcon?: boolean;
@@ -355,7 +355,7 @@
355
355
  position: relative;
356
356
  height: 66px;
357
357
  padding: 0;
358
- border: 1px 1px #d9d9d9;
358
+ border: 1px solid #d9d9d9;
359
359
  border-radius: 0px;
360
360
  }
361
361
  .acud-upload-list-picture .acud-upload-list-item:hover,
@@ -321,7 +321,7 @@
321
321
  position: relative;
322
322
  height: 66px;
323
323
  padding: 0;
324
- border: @border-width-base @upload-picture-card-border-style @border-color-base;
324
+ border: @border-width-base solid @border-color-base;
325
325
  border-radius: @border-radius-base;
326
326
 
327
327
  &:hover {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acud",
3
- "version": "0.0.70",
3
+ "version": "0.0.71",
4
4
  "description": "acg react 组件库",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",