iglooform 2.4.17 → 2.4.21

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.
@@ -307,7 +307,9 @@ var Element = function Element(_ref) {
307
307
  className: "igloo-element-preview-value",
308
308
  children: [error && !!error.length && _jsx(AlertFilled, {
309
309
  className: "igloo-element-preview-value-icon"
310
- }, void 0), previewFormater ? previewFormater(value, form) : value || '-']
310
+ }, void 0), _jsx("div", {
311
+ children: previewFormater ? previewFormater(value, form) : JSON.stringify(value)
312
+ }, void 0)]
311
313
  }, void 0)]
312
314
  }, void 0)
313
315
  }), void 0)
@@ -262,7 +262,9 @@ var Element = function Element(props) {
262
262
  className: "igloo-freeform-element-preview-value",
263
263
  children: [error && !!error.length && _jsx(AlertFilled, {
264
264
  className: "igloo-freeform-element-preview-value-icon"
265
- }, void 0), previewFormater ? previewFormater(value, form) : value || '-']
265
+ }, void 0), _jsx("div", {
266
+ children: previewFormater ? previewFormater(value, form) : JSON.stringify(value)
267
+ }, void 0)]
266
268
  }, void 0)]
267
269
  }, void 0)
268
270
  }), void 0)
@@ -214,7 +214,8 @@ function checkCard(value, cardRules) {
214
214
  }
215
215
 
216
216
  IglooCredit.formItemPropsHandler = function (config) {
217
- var cardConfig = config.cardConfig;
217
+ var _config$cardConfig = config.cardConfig,
218
+ cardConfig = _config$cardConfig === void 0 ? [] : _config$cardConfig;
218
219
  return {
219
220
  rules: [{
220
221
  validator: function validator(_, value) {
@@ -280,7 +280,12 @@ IglooExpiryDate.formItemPropsHandler = function (config) {
280
280
  validator: function validator(_, value) {
281
281
  return checkTime(value, check);
282
282
  }
283
- }]
283
+ }],
284
+ previewFormater: function previewFormater(_ref2) {
285
+ var year = _ref2.year,
286
+ month = _ref2.month;
287
+ return "".concat(month, "/").concat(year);
288
+ }
284
289
  };
285
290
  };
286
291
 
@@ -70,7 +70,7 @@
70
70
  "{canInputNum} characters left": "{canInputNum}剩餘字符",
71
71
  "{canInputNum} characters over": "{canInputNum}超出字符",
72
72
  "{count} files attached.": "{count}附加文件。",
73
- "{currentStep} of {allSteps}": "{allSteps}{currentStep}",
73
+ "{currentStep} of {allSteps}": "{currentStep} / {allSteps}",
74
74
  "{doneNumber} files imported.": "{doneNumber}導入的文件。",
75
75
  "{processingNumber} files in progress...": "{processingNumber}正在進行的文件。。。"
76
76
  }
@@ -16,6 +16,7 @@ export interface Props extends IglooComponentProps {
16
16
  className?: any;
17
17
  id?: string;
18
18
  bizKey?: string;
19
+ capture?: boolean;
19
20
  }
20
21
  export declare type Sample = {
21
22
  src: string;
@@ -61,6 +61,52 @@ import FormContext from '../form-context';
61
61
  var useBreakpoint = _Grid.useBreakpoint;
62
62
  var prefix = 'igloo-upload-photo';
63
63
 
64
+ function ClassifyType(type) {
65
+ if (type.includes('image')) {
66
+ return 'image';
67
+ }
68
+
69
+ if (type.includes('video')) {
70
+ return 'video';
71
+ }
72
+
73
+ if (type.includes('pdf')) {
74
+ return 'pdf';
75
+ }
76
+
77
+ return 'unknown';
78
+ }
79
+
80
+ var getFileType = /*#__PURE__*/function () {
81
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(src) {
82
+ var r, contentType;
83
+ return regeneratorRuntime.wrap(function _callee$(_context) {
84
+ while (1) {
85
+ switch (_context.prev = _context.next) {
86
+ case 0:
87
+ _context.next = 2;
88
+ return fetch(src, {
89
+ cache: 'force-cache'
90
+ });
91
+
92
+ case 2:
93
+ r = _context.sent;
94
+ contentType = r.headers.get('content-type');
95
+ return _context.abrupt("return", ClassifyType(contentType));
96
+
97
+ case 5:
98
+ case "end":
99
+ return _context.stop();
100
+ }
101
+ }
102
+ }, _callee);
103
+ }));
104
+
105
+ return function getFileType(_x) {
106
+ return _ref.apply(this, arguments);
107
+ };
108
+ }();
109
+
64
110
  var UploadPhoto = function UploadPhoto(props) {
65
111
  var _classnames3, _classnames4;
66
112
 
@@ -84,46 +130,48 @@ var UploadPhoto = function UploadPhoto(props) {
84
130
  bizKey = props.bizKey,
85
131
  _props$handleUpload = props.handleUpload,
86
132
  handleUpload = _props$handleUpload === void 0 ? /*#__PURE__*/function () {
87
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(file) {
133
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(file) {
88
134
  var formData, response, rst;
89
- return regeneratorRuntime.wrap(function _callee$(_context) {
135
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
90
136
  while (1) {
91
- switch (_context.prev = _context.next) {
137
+ switch (_context2.prev = _context2.next) {
92
138
  case 0:
93
139
  formData = new FormData();
94
140
  formData.append('file', file);
95
141
  formData.append('biz_key', bizKey);
96
- _context.next = 5;
142
+ _context2.next = 5;
97
143
  return fetch(uploadApi, {
98
144
  method: 'post',
99
145
  body: formData
100
146
  });
101
147
 
102
148
  case 5:
103
- response = _context.sent;
104
- _context.next = 8;
149
+ response = _context2.sent;
150
+ _context2.next = 8;
105
151
  return response.json();
106
152
 
107
153
  case 8:
108
- rst = _context.sent;
109
- return _context.abrupt("return", rst.url);
154
+ rst = _context2.sent;
155
+ return _context2.abrupt("return", rst.url);
110
156
 
111
157
  case 10:
112
158
  case "end":
113
- return _context.stop();
159
+ return _context2.stop();
114
160
  }
115
161
  }
116
- }, _callee);
162
+ }, _callee2);
117
163
  }));
118
164
 
119
- return function (_x) {
120
- return _ref.apply(this, arguments);
165
+ return function (_x2) {
166
+ return _ref2.apply(this, arguments);
121
167
  };
122
168
  }() : _props$handleUpload,
123
169
  setFieldError = props.setFieldError,
124
170
  className = props.className,
125
171
  id = props.id,
126
- validateField = props.validateField;
172
+ validateField = props.validateField,
173
+ _props$capture = props.capture,
174
+ capture = _props$capture === void 0 ? false : _props$capture;
127
175
 
128
176
  var _useContext2 = useContext(LocaleContext),
129
177
  formatMessage = _useContext2.formatMessage;
@@ -132,17 +180,7 @@ var UploadPhoto = function UploadPhoto(props) {
132
180
  _useState2 = _slicedToArray(_useState, 1),
133
181
  isMobile = _useState2[0];
134
182
 
135
- var _useState3 = useState(value.map(function (url, index) {
136
- return {
137
- url: url,
138
- dataUrl: url,
139
- status: 'success',
140
- type: '',
141
- name: "File".concat(index + 1),
142
- size: 0,
143
- uid: index
144
- };
145
- })),
183
+ var _useState3 = useState([]),
146
184
  _useState4 = _slicedToArray(_useState3, 2),
147
185
  files = _useState4[0],
148
186
  setFiles = _useState4[1];
@@ -155,14 +193,64 @@ var UploadPhoto = function UploadPhoto(props) {
155
193
  var _useBreakpoint = useBreakpoint(),
156
194
  md = _useBreakpoint.md;
157
195
 
196
+ var mapFilesFromValue = function mapFilesFromValue(urls) {
197
+ var _files = [];
198
+ Promise.all(urls.map( /*#__PURE__*/function () {
199
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(url, index) {
200
+ var type;
201
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
202
+ while (1) {
203
+ switch (_context3.prev = _context3.next) {
204
+ case 0:
205
+ _context3.next = 2;
206
+ return getFileType(url);
207
+
208
+ case 2:
209
+ type = _context3.sent;
210
+
211
+ _files.push({
212
+ url: url,
213
+ dataUrl: url,
214
+ status: 'success',
215
+ type: type,
216
+ name: "File".concat(index + 1),
217
+ size: 0,
218
+ uid: index
219
+ });
220
+
221
+ case 4:
222
+ case "end":
223
+ return _context3.stop();
224
+ }
225
+ }
226
+ }, _callee3);
227
+ }));
228
+
229
+ return function (_x3, _x4) {
230
+ return _ref3.apply(this, arguments);
231
+ };
232
+ }())).then(function () {
233
+ return setFiles(_files);
234
+ });
235
+ };
236
+
237
+ useEffect(function () {
238
+ if (Array.isArray(value) && value.some(function (url) {
239
+ return typeof url === 'string' && !files.find(function (file) {
240
+ return file.url === url;
241
+ });
242
+ })) {
243
+ mapFilesFromValue(value);
244
+ }
245
+ }, [value, files]);
158
246
  var uploadId = useMemo(function () {
159
247
  return "igloo-upload-photo-input-".concat(Math.random());
160
248
  }, []);
161
249
  var uploadIndex = useRef((value === null || value === void 0 ? void 0 : value.length) ? value.length : 0);
162
250
  useEffect(function () {
163
251
  return function () {
164
- files.forEach(function (_ref2) {
165
- var dataUrl = _ref2.dataUrl;
252
+ files.forEach(function (_ref4) {
253
+ var dataUrl = _ref4.dataUrl;
166
254
  URL.revokeObjectURL(dataUrl);
167
255
  });
168
256
  };
@@ -232,12 +320,12 @@ var UploadPhoto = function UploadPhoto(props) {
232
320
  };
233
321
 
234
322
  var uploadFile = /*#__PURE__*/function () {
235
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(file, currentIndex) {
323
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(file, currentIndex) {
236
324
  var uid, dataUrl, name, size, mimeType, type, errorMsg, _errorMsg;
237
325
 
238
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
326
+ return regeneratorRuntime.wrap(function _callee4$(_context4) {
239
327
  while (1) {
240
- switch (_context2.prev = _context2.next) {
328
+ switch (_context4.prev = _context4.next) {
241
329
  case 0:
242
330
  uid = ++uploadIndex.current;
243
331
  dataUrl = URL.createObjectURL(file);
@@ -245,7 +333,7 @@ var UploadPhoto = function UploadPhoto(props) {
245
333
  type = classifyType(mimeType);
246
334
 
247
335
  if (!(type === 'unknown')) {
248
- _context2.next = 9;
336
+ _context4.next = 9;
249
337
  break;
250
338
  }
251
339
 
@@ -254,11 +342,11 @@ var UploadPhoto = function UploadPhoto(props) {
254
342
  });
255
343
  limitNumError.current = errorMsg;
256
344
  setFieldError && setFieldError(errorMsg);
257
- return _context2.abrupt("return", Promise.reject(errorMsg));
345
+ return _context4.abrupt("return", Promise.reject(errorMsg));
258
346
 
259
347
  case 9:
260
348
  if (!(limit && currentIndex > limit)) {
261
- _context2.next = 14;
349
+ _context4.next = 14;
262
350
  break;
263
351
  }
264
352
 
@@ -270,7 +358,7 @@ var UploadPhoto = function UploadPhoto(props) {
270
358
  });
271
359
  limitNumError.current = _errorMsg;
272
360
  setFieldError && setFieldError(_errorMsg);
273
- return _context2.abrupt("return", Promise.reject(_errorMsg));
361
+ return _context4.abrupt("return", Promise.reject(_errorMsg));
274
362
 
275
363
  case 14:
276
364
  limitNumError.current = undefined;
@@ -285,7 +373,7 @@ var UploadPhoto = function UploadPhoto(props) {
285
373
  uid: uid
286
374
  }]);
287
375
  });
288
- return _context2.abrupt("return", handleUploadPromise(file, function (url) {
376
+ return _context4.abrupt("return", handleUploadPromise(file, function (url) {
289
377
  var urls = [];
290
378
  setFiles(function (files) {
291
379
  return files.map(function (f) {
@@ -348,63 +436,63 @@ var UploadPhoto = function UploadPhoto(props) {
348
436
 
349
437
  case 17:
350
438
  case "end":
351
- return _context2.stop();
439
+ return _context4.stop();
352
440
  }
353
441
  }
354
- }, _callee2);
442
+ }, _callee4);
355
443
  }));
356
444
 
357
- return function uploadFile(_x2, _x3) {
358
- return _ref3.apply(this, arguments);
445
+ return function uploadFile(_x5, _x6) {
446
+ return _ref5.apply(this, arguments);
359
447
  };
360
448
  }();
361
449
 
362
450
  var handleUploadPromise = /*#__PURE__*/function () {
363
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(file, onSuccess, onFailed) {
451
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(file, onSuccess, onFailed) {
364
452
  var rst, errorMsg;
365
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
453
+ return regeneratorRuntime.wrap(function _callee5$(_context5) {
366
454
  while (1) {
367
- switch (_context3.prev = _context3.next) {
455
+ switch (_context5.prev = _context5.next) {
368
456
  case 0:
369
- _context3.prev = 0;
370
- _context3.next = 3;
457
+ _context5.prev = 0;
458
+ _context5.next = 3;
371
459
  return handleUpload(file);
372
460
 
373
461
  case 3:
374
- rst = _context3.sent;
462
+ rst = _context5.sent;
375
463
  onSuccess(rst);
376
- return _context3.abrupt("return", Promise.resolve(rst));
464
+ return _context5.abrupt("return", Promise.resolve(rst));
377
465
 
378
466
  case 8:
379
- _context3.prev = 8;
380
- _context3.t0 = _context3["catch"](0);
381
- errorMsg = _typeof(_context3.t0) === 'object' ? _context3.t0.message : _context3.t0;
467
+ _context5.prev = 8;
468
+ _context5.t0 = _context5["catch"](0);
469
+ errorMsg = _typeof(_context5.t0) === 'object' ? _context5.t0.message : _context5.t0;
382
470
  onFailed(errorMsg);
383
- return _context3.abrupt("return", Promise.reject(errorMsg));
471
+ return _context5.abrupt("return", Promise.reject(errorMsg));
384
472
 
385
473
  case 13:
386
474
  case "end":
387
- return _context3.stop();
475
+ return _context5.stop();
388
476
  }
389
477
  }
390
- }, _callee3, null, [[0, 8]]);
478
+ }, _callee5, null, [[0, 8]]);
391
479
  }));
392
480
 
393
- return function handleUploadPromise(_x4, _x5, _x6) {
394
- return _ref4.apply(this, arguments);
481
+ return function handleUploadPromise(_x7, _x8, _x9) {
482
+ return _ref6.apply(this, arguments);
395
483
  };
396
484
  }();
397
485
 
398
486
  var handleDelete = /*#__PURE__*/function () {
399
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(index) {
487
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(index) {
400
488
  var arr, hasError, rst;
401
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
489
+ return regeneratorRuntime.wrap(function _callee6$(_context6) {
402
490
  while (1) {
403
- switch (_context4.prev = _context4.next) {
491
+ switch (_context6.prev = _context6.next) {
404
492
  case 0:
405
493
  limitNumError.current = null;
406
494
  arr = files;
407
- _context4.next = 4;
495
+ _context6.next = 4;
408
496
  return setFiles(function (files) {
409
497
  var newArr = files.filter(function (_, i) {
410
498
  return i !== index;
@@ -414,7 +502,7 @@ var UploadPhoto = function UploadPhoto(props) {
414
502
  });
415
503
 
416
504
  case 4:
417
- _context4.next = 6;
505
+ _context6.next = 6;
418
506
  return setMasks(function (masks) {
419
507
  return masks.filter(function (_, i) {
420
508
  return i !== index;
@@ -428,7 +516,7 @@ var UploadPhoto = function UploadPhoto(props) {
428
516
  });
429
517
 
430
518
  if (!hasError) {
431
- _context4.next = 10;
519
+ _context6.next = 10;
432
520
  break;
433
521
  }
434
522
 
@@ -441,46 +529,46 @@ var UploadPhoto = function UploadPhoto(props) {
441
529
 
442
530
  return f.url;
443
531
  });
444
- return _context4.abrupt("return", typeof onChange === 'function' && onChange(rst));
532
+ return _context6.abrupt("return", typeof onChange === 'function' && onChange(rst));
445
533
 
446
534
  case 10:
447
- typeof onChange === 'function' && onChange(arr.map(function (_ref6) {
448
- var url = _ref6.url;
535
+ typeof onChange === 'function' && onChange(arr.map(function (_ref8) {
536
+ var url = _ref8.url;
449
537
  return url;
450
538
  }));
451
539
 
452
540
  case 11:
453
541
  case "end":
454
- return _context4.stop();
542
+ return _context6.stop();
455
543
  }
456
544
  }
457
- }, _callee4);
545
+ }, _callee6);
458
546
  }));
459
547
 
460
- return function handleDelete(_x7) {
461
- return _ref5.apply(this, arguments);
548
+ return function handleDelete(_x10) {
549
+ return _ref7.apply(this, arguments);
462
550
  };
463
551
  }();
464
552
 
465
553
  var handleReUpload = /*#__PURE__*/function () {
466
- var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(index) {
554
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(index) {
467
555
  var _files$index, originFile, reUpUid, rst, latestFiles, fileListWithError, newList, _rst;
468
556
 
469
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
557
+ return regeneratorRuntime.wrap(function _callee7$(_context7) {
470
558
  while (1) {
471
- switch (_context5.prev = _context5.next) {
559
+ switch (_context7.prev = _context7.next) {
472
560
  case 0:
473
561
  _files$index = files[index], originFile = _files$index.originFile, reUpUid = _files$index.uid;
474
562
 
475
563
  if (originFile) {
476
- _context5.next = 3;
564
+ _context7.next = 3;
477
565
  break;
478
566
  }
479
567
 
480
- return _context5.abrupt("return");
568
+ return _context7.abrupt("return");
481
569
 
482
570
  case 3:
483
- _context5.next = 5;
571
+ _context7.next = 5;
484
572
  return setFiles(function (files) {
485
573
  var newFiles = _toConsumableArray(files);
486
574
 
@@ -489,14 +577,14 @@ var UploadPhoto = function UploadPhoto(props) {
489
577
  });
490
578
 
491
579
  case 5:
492
- _context5.prev = 5;
493
- _context5.next = 8;
580
+ _context7.prev = 5;
581
+ _context7.next = 8;
494
582
  return handleUpload(originFile);
495
583
 
496
584
  case 8:
497
- rst = _context5.sent;
585
+ rst = _context7.sent;
498
586
  latestFiles = [];
499
- _context5.next = 12;
587
+ _context7.next = 12;
500
588
  return setFiles(function (files) {
501
589
  var newFiles = _toConsumableArray(files);
502
590
 
@@ -524,19 +612,19 @@ var UploadPhoto = function UploadPhoto(props) {
524
612
  return url;
525
613
  });
526
614
  onChange && onChange(fileListWithError);
527
- _context5.next = 23;
615
+ _context7.next = 23;
528
616
  break;
529
617
 
530
618
  case 16:
531
- _context5.prev = 16;
532
- _context5.t0 = _context5["catch"](5);
619
+ _context7.prev = 16;
620
+ _context7.t0 = _context7["catch"](5);
533
621
  newList = [];
534
- _context5.next = 21;
622
+ _context7.next = 21;
535
623
  return setFiles(function (files) {
536
624
  var newFiles = _toConsumableArray(files);
537
625
 
538
626
  newFiles[index].status = 'failed';
539
- newFiles[index].errorMsg = _context5.t0;
627
+ newFiles[index].errorMsg = _context7.t0;
540
628
  newList = newFiles;
541
629
  return newFiles;
542
630
  });
@@ -567,14 +655,14 @@ var UploadPhoto = function UploadPhoto(props) {
567
655
 
568
656
  case 24:
569
657
  case "end":
570
- return _context5.stop();
658
+ return _context7.stop();
571
659
  }
572
660
  }
573
- }, _callee5, null, [[5, 16]]);
661
+ }, _callee7, null, [[5, 16]]);
574
662
  }));
575
663
 
576
- return function handleReUpload(_x8) {
577
- return _ref7.apply(this, arguments);
664
+ return function handleReUpload(_x11) {
665
+ return _ref9.apply(this, arguments);
578
666
  };
579
667
  }();
580
668
 
@@ -667,12 +755,12 @@ var UploadPhoto = function UploadPhoto(props) {
667
755
  children: _jsxs(_Row, {
668
756
  gutter: [isMobile ? 16 : 32, 16],
669
757
  wrap: true,
670
- children: [Boolean(samples === null || samples === void 0 ? void 0 : samples.length) && samples.map(function (_ref8, index) {
758
+ children: [Boolean(samples === null || samples === void 0 ? void 0 : samples.length) && samples.map(function (_ref10, index) {
671
759
  var _classnames, _classnames2;
672
760
 
673
- var src = _ref8.src,
674
- label = _ref8.label,
675
- type = _ref8.type;
761
+ var src = _ref10.src,
762
+ label = _ref10.label,
763
+ type = _ref10.type;
676
764
  return _jsxs(_Col, {
677
765
  span: sampleSpan,
678
766
  children: [_jsx("img", {
@@ -708,7 +796,7 @@ var UploadPhoto = function UploadPhoto(props) {
708
796
  accept: "image/*,video/*,application/pdf",
709
797
  value: [],
710
798
  multiple: true,
711
- capture: true
799
+ capture: capture
712
800
  }, void 0), _jsxs(_Space, {
713
801
  className: "".concat(prefix, "-content"),
714
802
  size: [16, 16],
@@ -732,13 +820,13 @@ var UploadPhoto = function UploadPhoto(props) {
732
820
  children: buttonText || 'Upload'
733
821
  }, void 0)
734
822
  }, void 0)]
735
- }, void 0), files.map(function (_ref9, index) {
823
+ }, void 0), files.map(function (_ref11, index) {
736
824
  var _classnames5;
737
825
 
738
- var dataUrl = _ref9.dataUrl,
739
- status = _ref9.status,
740
- type = _ref9.type,
741
- uid = _ref9.uid;
826
+ var dataUrl = _ref11.dataUrl,
827
+ status = _ref11.status,
828
+ type = _ref11.type,
829
+ uid = _ref11.uid;
742
830
  return _jsx(_Badge, {
743
831
  count: getBadge(status, index, limit),
744
832
  children: _jsxs("div", {
@@ -806,10 +894,10 @@ function checkFileList(value) {
806
894
  return Promise.resolve();
807
895
  }
808
896
 
809
- UploadPhoto.formItemPropsHandler = function (_ref10) {
810
- var limit = _ref10.limit,
811
- previewFormater = _ref10.previewFormater,
812
- label = _ref10.label;
897
+ UploadPhoto.formItemPropsHandler = function (_ref12) {
898
+ var limit = _ref12.limit,
899
+ previewFormater = _ref12.previewFormater,
900
+ label = _ref12.label;
813
901
  return {
814
902
  previewFormater: previewFormater || function (value) {
815
903
  return _jsx(UploadPreview, {
@@ -336,7 +336,9 @@ var Element = function Element(_ref) {
336
336
  className: "igloo-element-preview-value",
337
337
  children: [error && !!error.length && (0, _jsxRuntime.jsx)(_iglooicon.AlertFilled, {
338
338
  className: "igloo-element-preview-value-icon"
339
- }, void 0), previewFormater ? previewFormater(value, form) : value || '-']
339
+ }, void 0), (0, _jsxRuntime.jsx)("div", {
340
+ children: previewFormater ? previewFormater(value, form) : JSON.stringify(value)
341
+ }, void 0)]
340
342
  }, void 0)]
341
343
  }, void 0)
342
344
  }), void 0)
@@ -288,7 +288,9 @@ var Element = function Element(props) {
288
288
  className: "igloo-freeform-element-preview-value",
289
289
  children: [error && !!error.length && (0, _jsxRuntime.jsx)(_iglooicon.AlertFilled, {
290
290
  className: "igloo-freeform-element-preview-value-icon"
291
- }, void 0), previewFormater ? previewFormater(value, form) : value || '-']
291
+ }, void 0), (0, _jsxRuntime.jsx)("div", {
292
+ children: previewFormater ? previewFormater(value, form) : JSON.stringify(value)
293
+ }, void 0)]
292
294
  }, void 0)]
293
295
  }, void 0)
294
296
  }), void 0)
@@ -229,7 +229,8 @@ function checkCard(value, cardRules) {
229
229
  }
230
230
 
231
231
  IglooCredit.formItemPropsHandler = function (config) {
232
- var cardConfig = config.cardConfig;
232
+ var _config$cardConfig = config.cardConfig,
233
+ cardConfig = _config$cardConfig === void 0 ? [] : _config$cardConfig;
233
234
  return {
234
235
  rules: [{
235
236
  validator: function validator(_, value) {
@@ -296,7 +296,12 @@ IglooExpiryDate.formItemPropsHandler = function (config) {
296
296
  validator: function validator(_, value) {
297
297
  return checkTime(value, check);
298
298
  }
299
- }]
299
+ }],
300
+ previewFormater: function previewFormater(_ref2) {
301
+ var year = _ref2.year,
302
+ month = _ref2.month;
303
+ return "".concat(month, "/").concat(year);
304
+ }
300
305
  };
301
306
  };
302
307
 
@@ -70,7 +70,7 @@
70
70
  "{canInputNum} characters left": "{canInputNum}剩餘字符",
71
71
  "{canInputNum} characters over": "{canInputNum}超出字符",
72
72
  "{count} files attached.": "{count}附加文件。",
73
- "{currentStep} of {allSteps}": "{allSteps}{currentStep}",
73
+ "{currentStep} of {allSteps}": "{currentStep} / {allSteps}",
74
74
  "{doneNumber} files imported.": "{doneNumber}導入的文件。",
75
75
  "{processingNumber} files in progress...": "{processingNumber}正在進行的文件。。。"
76
76
  }
@@ -16,6 +16,7 @@ export interface Props extends IglooComponentProps {
16
16
  className?: any;
17
17
  id?: string;
18
18
  bizKey?: string;
19
+ capture?: boolean;
19
20
  }
20
21
  export declare type Sample = {
21
22
  src: string;
@@ -94,6 +94,52 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
94
94
  var useBreakpoint = _grid.default.useBreakpoint;
95
95
  var prefix = 'igloo-upload-photo';
96
96
 
97
+ function ClassifyType(type) {
98
+ if (type.includes('image')) {
99
+ return 'image';
100
+ }
101
+
102
+ if (type.includes('video')) {
103
+ return 'video';
104
+ }
105
+
106
+ if (type.includes('pdf')) {
107
+ return 'pdf';
108
+ }
109
+
110
+ return 'unknown';
111
+ }
112
+
113
+ var getFileType = /*#__PURE__*/function () {
114
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(src) {
115
+ var r, contentType;
116
+ return regeneratorRuntime.wrap(function _callee$(_context) {
117
+ while (1) {
118
+ switch (_context.prev = _context.next) {
119
+ case 0:
120
+ _context.next = 2;
121
+ return fetch(src, {
122
+ cache: 'force-cache'
123
+ });
124
+
125
+ case 2:
126
+ r = _context.sent;
127
+ contentType = r.headers.get('content-type');
128
+ return _context.abrupt("return", ClassifyType(contentType));
129
+
130
+ case 5:
131
+ case "end":
132
+ return _context.stop();
133
+ }
134
+ }
135
+ }, _callee);
136
+ }));
137
+
138
+ return function getFileType(_x) {
139
+ return _ref.apply(this, arguments);
140
+ };
141
+ }();
142
+
97
143
  var UploadPhoto = function UploadPhoto(props) {
98
144
  var _classnames3, _classnames4;
99
145
 
@@ -117,46 +163,48 @@ var UploadPhoto = function UploadPhoto(props) {
117
163
  bizKey = props.bizKey,
118
164
  _props$handleUpload = props.handleUpload,
119
165
  handleUpload = _props$handleUpload === void 0 ? /*#__PURE__*/function () {
120
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(file) {
166
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(file) {
121
167
  var formData, response, rst;
122
- return regeneratorRuntime.wrap(function _callee$(_context) {
168
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
123
169
  while (1) {
124
- switch (_context.prev = _context.next) {
170
+ switch (_context2.prev = _context2.next) {
125
171
  case 0:
126
172
  formData = new FormData();
127
173
  formData.append('file', file);
128
174
  formData.append('biz_key', bizKey);
129
- _context.next = 5;
175
+ _context2.next = 5;
130
176
  return fetch(uploadApi, {
131
177
  method: 'post',
132
178
  body: formData
133
179
  });
134
180
 
135
181
  case 5:
136
- response = _context.sent;
137
- _context.next = 8;
182
+ response = _context2.sent;
183
+ _context2.next = 8;
138
184
  return response.json();
139
185
 
140
186
  case 8:
141
- rst = _context.sent;
142
- return _context.abrupt("return", rst.url);
187
+ rst = _context2.sent;
188
+ return _context2.abrupt("return", rst.url);
143
189
 
144
190
  case 10:
145
191
  case "end":
146
- return _context.stop();
192
+ return _context2.stop();
147
193
  }
148
194
  }
149
- }, _callee);
195
+ }, _callee2);
150
196
  }));
151
197
 
152
- return function (_x) {
153
- return _ref.apply(this, arguments);
198
+ return function (_x2) {
199
+ return _ref2.apply(this, arguments);
154
200
  };
155
201
  }() : _props$handleUpload,
156
202
  setFieldError = props.setFieldError,
157
203
  className = props.className,
158
204
  id = props.id,
159
- validateField = props.validateField;
205
+ validateField = props.validateField,
206
+ _props$capture = props.capture,
207
+ capture = _props$capture === void 0 ? false : _props$capture;
160
208
 
161
209
  var _useContext2 = (0, _react.useContext)(_locale.LocaleContext),
162
210
  formatMessage = _useContext2.formatMessage;
@@ -165,17 +213,7 @@ var UploadPhoto = function UploadPhoto(props) {
165
213
  _useState2 = _slicedToArray(_useState, 1),
166
214
  isMobile = _useState2[0];
167
215
 
168
- var _useState3 = (0, _react.useState)(value.map(function (url, index) {
169
- return {
170
- url: url,
171
- dataUrl: url,
172
- status: 'success',
173
- type: '',
174
- name: "File".concat(index + 1),
175
- size: 0,
176
- uid: index
177
- };
178
- })),
216
+ var _useState3 = (0, _react.useState)([]),
179
217
  _useState4 = _slicedToArray(_useState3, 2),
180
218
  files = _useState4[0],
181
219
  setFiles = _useState4[1];
@@ -188,14 +226,64 @@ var UploadPhoto = function UploadPhoto(props) {
188
226
  var _useBreakpoint = useBreakpoint(),
189
227
  md = _useBreakpoint.md;
190
228
 
229
+ var mapFilesFromValue = function mapFilesFromValue(urls) {
230
+ var _files = [];
231
+ Promise.all(urls.map( /*#__PURE__*/function () {
232
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(url, index) {
233
+ var type;
234
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
235
+ while (1) {
236
+ switch (_context3.prev = _context3.next) {
237
+ case 0:
238
+ _context3.next = 2;
239
+ return getFileType(url);
240
+
241
+ case 2:
242
+ type = _context3.sent;
243
+
244
+ _files.push({
245
+ url: url,
246
+ dataUrl: url,
247
+ status: 'success',
248
+ type: type,
249
+ name: "File".concat(index + 1),
250
+ size: 0,
251
+ uid: index
252
+ });
253
+
254
+ case 4:
255
+ case "end":
256
+ return _context3.stop();
257
+ }
258
+ }
259
+ }, _callee3);
260
+ }));
261
+
262
+ return function (_x3, _x4) {
263
+ return _ref3.apply(this, arguments);
264
+ };
265
+ }())).then(function () {
266
+ return setFiles(_files);
267
+ });
268
+ };
269
+
270
+ (0, _react.useEffect)(function () {
271
+ if (Array.isArray(value) && value.some(function (url) {
272
+ return typeof url === 'string' && !files.find(function (file) {
273
+ return file.url === url;
274
+ });
275
+ })) {
276
+ mapFilesFromValue(value);
277
+ }
278
+ }, [value, files]);
191
279
  var uploadId = (0, _react.useMemo)(function () {
192
280
  return "igloo-upload-photo-input-".concat(Math.random());
193
281
  }, []);
194
282
  var uploadIndex = (0, _react.useRef)((value === null || value === void 0 ? void 0 : value.length) ? value.length : 0);
195
283
  (0, _react.useEffect)(function () {
196
284
  return function () {
197
- files.forEach(function (_ref2) {
198
- var dataUrl = _ref2.dataUrl;
285
+ files.forEach(function (_ref4) {
286
+ var dataUrl = _ref4.dataUrl;
199
287
  URL.revokeObjectURL(dataUrl);
200
288
  });
201
289
  };
@@ -265,12 +353,12 @@ var UploadPhoto = function UploadPhoto(props) {
265
353
  };
266
354
 
267
355
  var uploadFile = /*#__PURE__*/function () {
268
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(file, currentIndex) {
356
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(file, currentIndex) {
269
357
  var uid, dataUrl, name, size, mimeType, type, errorMsg, _errorMsg;
270
358
 
271
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
359
+ return regeneratorRuntime.wrap(function _callee4$(_context4) {
272
360
  while (1) {
273
- switch (_context2.prev = _context2.next) {
361
+ switch (_context4.prev = _context4.next) {
274
362
  case 0:
275
363
  uid = ++uploadIndex.current;
276
364
  dataUrl = URL.createObjectURL(file);
@@ -278,7 +366,7 @@ var UploadPhoto = function UploadPhoto(props) {
278
366
  type = (0, _tools.classifyType)(mimeType);
279
367
 
280
368
  if (!(type === 'unknown')) {
281
- _context2.next = 9;
369
+ _context4.next = 9;
282
370
  break;
283
371
  }
284
372
 
@@ -287,11 +375,11 @@ var UploadPhoto = function UploadPhoto(props) {
287
375
  });
288
376
  limitNumError.current = errorMsg;
289
377
  setFieldError && setFieldError(errorMsg);
290
- return _context2.abrupt("return", Promise.reject(errorMsg));
378
+ return _context4.abrupt("return", Promise.reject(errorMsg));
291
379
 
292
380
  case 9:
293
381
  if (!(limit && currentIndex > limit)) {
294
- _context2.next = 14;
382
+ _context4.next = 14;
295
383
  break;
296
384
  }
297
385
 
@@ -303,7 +391,7 @@ var UploadPhoto = function UploadPhoto(props) {
303
391
  });
304
392
  limitNumError.current = _errorMsg;
305
393
  setFieldError && setFieldError(_errorMsg);
306
- return _context2.abrupt("return", Promise.reject(_errorMsg));
394
+ return _context4.abrupt("return", Promise.reject(_errorMsg));
307
395
 
308
396
  case 14:
309
397
  limitNumError.current = undefined;
@@ -318,7 +406,7 @@ var UploadPhoto = function UploadPhoto(props) {
318
406
  uid: uid
319
407
  }]);
320
408
  });
321
- return _context2.abrupt("return", handleUploadPromise(file, function (url) {
409
+ return _context4.abrupt("return", handleUploadPromise(file, function (url) {
322
410
  var urls = [];
323
411
  setFiles(function (files) {
324
412
  return files.map(function (f) {
@@ -381,63 +469,63 @@ var UploadPhoto = function UploadPhoto(props) {
381
469
 
382
470
  case 17:
383
471
  case "end":
384
- return _context2.stop();
472
+ return _context4.stop();
385
473
  }
386
474
  }
387
- }, _callee2);
475
+ }, _callee4);
388
476
  }));
389
477
 
390
- return function uploadFile(_x2, _x3) {
391
- return _ref3.apply(this, arguments);
478
+ return function uploadFile(_x5, _x6) {
479
+ return _ref5.apply(this, arguments);
392
480
  };
393
481
  }();
394
482
 
395
483
  var handleUploadPromise = /*#__PURE__*/function () {
396
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(file, onSuccess, onFailed) {
484
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(file, onSuccess, onFailed) {
397
485
  var rst, errorMsg;
398
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
486
+ return regeneratorRuntime.wrap(function _callee5$(_context5) {
399
487
  while (1) {
400
- switch (_context3.prev = _context3.next) {
488
+ switch (_context5.prev = _context5.next) {
401
489
  case 0:
402
- _context3.prev = 0;
403
- _context3.next = 3;
490
+ _context5.prev = 0;
491
+ _context5.next = 3;
404
492
  return handleUpload(file);
405
493
 
406
494
  case 3:
407
- rst = _context3.sent;
495
+ rst = _context5.sent;
408
496
  onSuccess(rst);
409
- return _context3.abrupt("return", Promise.resolve(rst));
497
+ return _context5.abrupt("return", Promise.resolve(rst));
410
498
 
411
499
  case 8:
412
- _context3.prev = 8;
413
- _context3.t0 = _context3["catch"](0);
414
- errorMsg = _typeof(_context3.t0) === 'object' ? _context3.t0.message : _context3.t0;
500
+ _context5.prev = 8;
501
+ _context5.t0 = _context5["catch"](0);
502
+ errorMsg = _typeof(_context5.t0) === 'object' ? _context5.t0.message : _context5.t0;
415
503
  onFailed(errorMsg);
416
- return _context3.abrupt("return", Promise.reject(errorMsg));
504
+ return _context5.abrupt("return", Promise.reject(errorMsg));
417
505
 
418
506
  case 13:
419
507
  case "end":
420
- return _context3.stop();
508
+ return _context5.stop();
421
509
  }
422
510
  }
423
- }, _callee3, null, [[0, 8]]);
511
+ }, _callee5, null, [[0, 8]]);
424
512
  }));
425
513
 
426
- return function handleUploadPromise(_x4, _x5, _x6) {
427
- return _ref4.apply(this, arguments);
514
+ return function handleUploadPromise(_x7, _x8, _x9) {
515
+ return _ref6.apply(this, arguments);
428
516
  };
429
517
  }();
430
518
 
431
519
  var handleDelete = /*#__PURE__*/function () {
432
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(index) {
520
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(index) {
433
521
  var arr, hasError, rst;
434
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
522
+ return regeneratorRuntime.wrap(function _callee6$(_context6) {
435
523
  while (1) {
436
- switch (_context4.prev = _context4.next) {
524
+ switch (_context6.prev = _context6.next) {
437
525
  case 0:
438
526
  limitNumError.current = null;
439
527
  arr = files;
440
- _context4.next = 4;
528
+ _context6.next = 4;
441
529
  return setFiles(function (files) {
442
530
  var newArr = files.filter(function (_, i) {
443
531
  return i !== index;
@@ -447,7 +535,7 @@ var UploadPhoto = function UploadPhoto(props) {
447
535
  });
448
536
 
449
537
  case 4:
450
- _context4.next = 6;
538
+ _context6.next = 6;
451
539
  return setMasks(function (masks) {
452
540
  return masks.filter(function (_, i) {
453
541
  return i !== index;
@@ -461,7 +549,7 @@ var UploadPhoto = function UploadPhoto(props) {
461
549
  });
462
550
 
463
551
  if (!hasError) {
464
- _context4.next = 10;
552
+ _context6.next = 10;
465
553
  break;
466
554
  }
467
555
 
@@ -474,46 +562,46 @@ var UploadPhoto = function UploadPhoto(props) {
474
562
 
475
563
  return f.url;
476
564
  });
477
- return _context4.abrupt("return", typeof onChange === 'function' && onChange(rst));
565
+ return _context6.abrupt("return", typeof onChange === 'function' && onChange(rst));
478
566
 
479
567
  case 10:
480
- typeof onChange === 'function' && onChange(arr.map(function (_ref6) {
481
- var url = _ref6.url;
568
+ typeof onChange === 'function' && onChange(arr.map(function (_ref8) {
569
+ var url = _ref8.url;
482
570
  return url;
483
571
  }));
484
572
 
485
573
  case 11:
486
574
  case "end":
487
- return _context4.stop();
575
+ return _context6.stop();
488
576
  }
489
577
  }
490
- }, _callee4);
578
+ }, _callee6);
491
579
  }));
492
580
 
493
- return function handleDelete(_x7) {
494
- return _ref5.apply(this, arguments);
581
+ return function handleDelete(_x10) {
582
+ return _ref7.apply(this, arguments);
495
583
  };
496
584
  }();
497
585
 
498
586
  var handleReUpload = /*#__PURE__*/function () {
499
- var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(index) {
587
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(index) {
500
588
  var _files$index, originFile, reUpUid, rst, latestFiles, fileListWithError, newList, _rst;
501
589
 
502
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
590
+ return regeneratorRuntime.wrap(function _callee7$(_context7) {
503
591
  while (1) {
504
- switch (_context5.prev = _context5.next) {
592
+ switch (_context7.prev = _context7.next) {
505
593
  case 0:
506
594
  _files$index = files[index], originFile = _files$index.originFile, reUpUid = _files$index.uid;
507
595
 
508
596
  if (originFile) {
509
- _context5.next = 3;
597
+ _context7.next = 3;
510
598
  break;
511
599
  }
512
600
 
513
- return _context5.abrupt("return");
601
+ return _context7.abrupt("return");
514
602
 
515
603
  case 3:
516
- _context5.next = 5;
604
+ _context7.next = 5;
517
605
  return setFiles(function (files) {
518
606
  var newFiles = _toConsumableArray(files);
519
607
 
@@ -522,14 +610,14 @@ var UploadPhoto = function UploadPhoto(props) {
522
610
  });
523
611
 
524
612
  case 5:
525
- _context5.prev = 5;
526
- _context5.next = 8;
613
+ _context7.prev = 5;
614
+ _context7.next = 8;
527
615
  return handleUpload(originFile);
528
616
 
529
617
  case 8:
530
- rst = _context5.sent;
618
+ rst = _context7.sent;
531
619
  latestFiles = [];
532
- _context5.next = 12;
620
+ _context7.next = 12;
533
621
  return setFiles(function (files) {
534
622
  var newFiles = _toConsumableArray(files);
535
623
 
@@ -557,19 +645,19 @@ var UploadPhoto = function UploadPhoto(props) {
557
645
  return url;
558
646
  });
559
647
  onChange && onChange(fileListWithError);
560
- _context5.next = 23;
648
+ _context7.next = 23;
561
649
  break;
562
650
 
563
651
  case 16:
564
- _context5.prev = 16;
565
- _context5.t0 = _context5["catch"](5);
652
+ _context7.prev = 16;
653
+ _context7.t0 = _context7["catch"](5);
566
654
  newList = [];
567
- _context5.next = 21;
655
+ _context7.next = 21;
568
656
  return setFiles(function (files) {
569
657
  var newFiles = _toConsumableArray(files);
570
658
 
571
659
  newFiles[index].status = 'failed';
572
- newFiles[index].errorMsg = _context5.t0;
660
+ newFiles[index].errorMsg = _context7.t0;
573
661
  newList = newFiles;
574
662
  return newFiles;
575
663
  });
@@ -600,14 +688,14 @@ var UploadPhoto = function UploadPhoto(props) {
600
688
 
601
689
  case 24:
602
690
  case "end":
603
- return _context5.stop();
691
+ return _context7.stop();
604
692
  }
605
693
  }
606
- }, _callee5, null, [[5, 16]]);
694
+ }, _callee7, null, [[5, 16]]);
607
695
  }));
608
696
 
609
- return function handleReUpload(_x8) {
610
- return _ref7.apply(this, arguments);
697
+ return function handleReUpload(_x11) {
698
+ return _ref9.apply(this, arguments);
611
699
  };
612
700
  }();
613
701
 
@@ -701,12 +789,12 @@ var UploadPhoto = function UploadPhoto(props) {
701
789
  children: (0, _jsxRuntime.jsxs)(_row.default, {
702
790
  gutter: [isMobile ? 16 : 32, 16],
703
791
  wrap: true,
704
- children: [Boolean(samples === null || samples === void 0 ? void 0 : samples.length) && samples.map(function (_ref8, index) {
792
+ children: [Boolean(samples === null || samples === void 0 ? void 0 : samples.length) && samples.map(function (_ref10, index) {
705
793
  var _classnames, _classnames2;
706
794
 
707
- var src = _ref8.src,
708
- label = _ref8.label,
709
- type = _ref8.type;
795
+ var src = _ref10.src,
796
+ label = _ref10.label,
797
+ type = _ref10.type;
710
798
  return (0, _jsxRuntime.jsxs)(_col.default, {
711
799
  span: sampleSpan,
712
800
  children: [(0, _jsxRuntime.jsx)("img", {
@@ -742,7 +830,7 @@ var UploadPhoto = function UploadPhoto(props) {
742
830
  accept: "image/*,video/*,application/pdf",
743
831
  value: [],
744
832
  multiple: true,
745
- capture: true
833
+ capture: capture
746
834
  }, void 0), (0, _jsxRuntime.jsxs)(_space.default, {
747
835
  className: "".concat(prefix, "-content"),
748
836
  size: [16, 16],
@@ -766,13 +854,13 @@ var UploadPhoto = function UploadPhoto(props) {
766
854
  children: buttonText || 'Upload'
767
855
  }, void 0)
768
856
  }, void 0)]
769
- }, void 0), files.map(function (_ref9, index) {
857
+ }, void 0), files.map(function (_ref11, index) {
770
858
  var _classnames5;
771
859
 
772
- var dataUrl = _ref9.dataUrl,
773
- status = _ref9.status,
774
- type = _ref9.type,
775
- uid = _ref9.uid;
860
+ var dataUrl = _ref11.dataUrl,
861
+ status = _ref11.status,
862
+ type = _ref11.type,
863
+ uid = _ref11.uid;
776
864
  return (0, _jsxRuntime.jsx)(_badge.default, {
777
865
  count: getBadge(status, index, limit),
778
866
  children: (0, _jsxRuntime.jsxs)("div", {
@@ -840,10 +928,10 @@ function checkFileList(value) {
840
928
  return Promise.resolve();
841
929
  }
842
930
 
843
- UploadPhoto.formItemPropsHandler = function (_ref10) {
844
- var limit = _ref10.limit,
845
- previewFormater = _ref10.previewFormater,
846
- label = _ref10.label;
931
+ UploadPhoto.formItemPropsHandler = function (_ref12) {
932
+ var limit = _ref12.limit,
933
+ previewFormater = _ref12.previewFormater,
934
+ label = _ref12.label;
847
935
  return {
848
936
  previewFormater: previewFormater || function (value) {
849
937
  return (0, _jsxRuntime.jsx)(_uploadPreview.default, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iglooform",
3
- "version": "2.4.17",
3
+ "version": "2.4.21",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "build-dev": "dumi build",