iglooform 2.4.8 → 2.4.9
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.
- package/es/admin-upload/float.js +25 -35
- package/es/admin-upload/index.js +18 -25
- package/es/admin-upload/job-list.js +83 -113
- package/es/admin-upload/modal.js +19 -26
- package/es/alert-message/index.js +11 -9
- package/es/amount/index.js +10 -5
- package/es/back-top/index.js +14 -10
- package/es/button/index.js +21 -26
- package/es/card-detail/card-group.js +16 -22
- package/es/card-detail/card-item.js +15 -20
- package/es/card-detail/card-page.js +11 -15
- package/es/card-detail/card.js +24 -24
- package/es/card-detail/utils.js +3 -4
- package/es/checkbox/index.js +23 -22
- package/es/claim-list/index.js +51 -68
- package/es/confirmation/index.js +5 -7
- package/es/date-picker/buddhist.js +1 -1
- package/es/date-picker/index.js +10 -4
- package/es/declaration/index.js +16 -13
- package/es/detail-panel/index.js +67 -83
- package/es/documents/index.js +6 -8
- package/es/example/index.js +3 -4
- package/es/filter/checkBox.js +33 -45
- package/es/filter/customize.js +3 -4
- package/es/filter/index.js +79 -107
- package/es/filter/radioBox.js +23 -31
- package/es/filter/rangePicker.js +43 -59
- package/es/form/divider/index.js +7 -1
- package/es/form/element/index.js +28 -36
- package/es/form/element/style/index.less +4 -0
- package/es/form/index.js +9 -12
- package/es/form/login/index.js +14 -19
- package/es/form/page/index.js +17 -23
- package/es/form/pages/index.js +22 -30
- package/es/form/section/index.js +11 -14
- package/es/form/step/index.js +30 -41
- package/es/form/steps/index.js +6 -8
- package/es/free-form/element/index.js +21 -27
- package/es/free-form/element/style/index.less +4 -0
- package/es/free-form/index.js +9 -12
- package/es/free-form/page/index.js +28 -39
- package/es/free-form/pages/index.js +6 -8
- package/es/free-form/section/index.js +11 -14
- package/es/free-form/step/index.js +30 -41
- package/es/free-form/steps/index.js +6 -8
- package/es/home-menu/index.js +52 -71
- package/es/input/amount.js +10 -5
- package/es/input/credit-card.js +7 -1
- package/es/input/email.js +8 -1
- package/es/input/expiry-date.js +12 -16
- package/es/input/input-date.js +12 -16
- package/es/input/input-number.js +9 -2
- package/es/input/input.js +9 -2
- package/es/input/otp.js +17 -15
- package/es/input/password.js +12 -6
- package/es/input/phone-number.js +6 -8
- package/es/input/text-area.js +14 -10
- package/es/layout/defaultFooter.js +60 -82
- package/es/layout/defaultHeader.js +11 -15
- package/es/layout/footer.js +108 -148
- package/es/layout/header.js +50 -59
- package/es/layout/index.js +16 -12
- package/es/locale/locale-provider.js +6 -8
- package/es/login-page/index.js +30 -42
- package/es/media/index.js +20 -27
- package/es/media/media.js +9 -12
- package/es/media/preview.js +6 -8
- package/es/mobile-insurer-detail/index.js +74 -91
- package/es/mobile-insurer-list/index.js +34 -38
- package/es/modal/index.js +20 -25
- package/es/platform/platform-card/index.js +9 -12
- package/es/platform/switch-platform/index.js +24 -32
- package/es/policy-list/index.js +9 -12
- package/es/policy-list/policy-card.js +119 -153
- package/es/radio/index.js +33 -35
- package/es/select/attached-select.js +31 -34
- package/es/select/select.js +12 -8
- package/es/select/time-select.js +12 -16
- package/es/status-box/index.js +6 -8
- package/es/table/index.js +69 -93
- package/es/tabs/index.js +7 -1
- package/es/typography/index.js +6 -8
- package/es/upload/index.js +48 -66
- package/es/upload-photo/index.js +47 -63
- package/es/upload-photo/media.js +3 -4
- package/es/upload-preview/index.js +9 -12
- package/es/upload-preview/media.js +12 -16
- package/es/utils/form-utils.js +18 -25
- package/lib/admin-upload/float.js +25 -35
- package/lib/admin-upload/index.js +18 -25
- package/lib/admin-upload/job-list.js +83 -113
- package/lib/admin-upload/modal.js +19 -26
- package/lib/alert-message/index.js +11 -9
- package/lib/amount/index.js +10 -5
- package/lib/back-top/index.js +14 -10
- package/lib/button/index.js +22 -27
- package/lib/card-detail/card-group.js +16 -22
- package/lib/card-detail/card-item.js +15 -20
- package/lib/card-detail/card-page.js +11 -15
- package/lib/card-detail/card.js +24 -24
- package/lib/card-detail/index.js +6 -6
- package/lib/card-detail/utils.js +4 -5
- package/lib/checkbox/index.js +24 -23
- package/lib/claim-list/index.js +51 -68
- package/lib/confirmation/index.js +5 -7
- package/lib/date-picker/buddhist.js +1 -1
- package/lib/date-picker/index.js +11 -5
- package/lib/declaration/index.js +16 -13
- package/lib/detail-panel/index.js +67 -83
- package/lib/documents/index.js +6 -8
- package/lib/example/index.js +3 -4
- package/lib/filter/checkBox.js +33 -45
- package/lib/filter/customize.js +3 -4
- package/lib/filter/index.js +79 -107
- package/lib/filter/radioBox.js +23 -31
- package/lib/filter/rangePicker.js +43 -59
- package/lib/form/divider/index.js +7 -1
- package/lib/form/element/index.js +28 -36
- package/lib/form/element/style/index.less +4 -0
- package/lib/form/index.js +9 -12
- package/lib/form/login/index.js +14 -19
- package/lib/form/page/index.js +17 -23
- package/lib/form/pages/index.js +22 -30
- package/lib/form/section/index.js +11 -14
- package/lib/form/step/index.js +30 -41
- package/lib/form/steps/index.js +6 -8
- package/lib/free-form/element/index.js +21 -27
- package/lib/free-form/element/style/index.less +4 -0
- package/lib/free-form/index.js +9 -12
- package/lib/free-form/page/index.js +28 -39
- package/lib/free-form/pages/index.js +6 -8
- package/lib/free-form/section/index.js +11 -14
- package/lib/free-form/step/index.js +30 -41
- package/lib/free-form/steps/index.js +6 -8
- package/lib/home-menu/index.js +52 -71
- package/lib/index.js +132 -132
- package/lib/input/amount.js +10 -5
- package/lib/input/credit-card.js +7 -1
- package/lib/input/email.js +7 -1
- package/lib/input/expiry-date.js +12 -16
- package/lib/input/index.js +18 -18
- package/lib/input/input-date.js +12 -16
- package/lib/input/input-number.js +8 -2
- package/lib/input/input.js +8 -2
- package/lib/input/otp.js +17 -15
- package/lib/input/password.js +11 -6
- package/lib/input/phone-number.js +6 -8
- package/lib/input/text-area.js +14 -10
- package/lib/layout/defaultFooter.js +60 -82
- package/lib/layout/defaultHeader.js +11 -15
- package/lib/layout/footer.js +108 -148
- package/lib/layout/header.js +50 -59
- package/lib/layout/index.js +15 -12
- package/lib/locale/format-message.js +1 -1
- package/lib/locale/index.js +4 -4
- package/lib/locale/locale-provider.js +7 -9
- package/lib/login-page/index.js +30 -42
- package/lib/media/index.js +20 -27
- package/lib/media/media.js +9 -12
- package/lib/media/preview.js +6 -8
- package/lib/mobile-insurer-detail/index.js +74 -91
- package/lib/mobile-insurer-list/index.js +34 -38
- package/lib/modal/index.js +20 -25
- package/lib/platform/platform-card/index.js +9 -12
- package/lib/platform/switch-platform/index.js +24 -32
- package/lib/policy-list/index.js +9 -12
- package/lib/policy-list/policy-card.js +119 -153
- package/lib/radio/index.js +33 -35
- package/lib/select/attached-select.js +32 -35
- package/lib/select/select.js +13 -9
- package/lib/select/time-select.js +12 -16
- package/lib/status-box/index.js +6 -8
- package/lib/table/index.js +69 -93
- package/lib/tabs/index.js +8 -2
- package/lib/typography/index.js +6 -8
- package/lib/upload/index.js +48 -66
- package/lib/upload-photo/index.js +47 -63
- package/lib/upload-photo/media.js +3 -4
- package/lib/upload-preview/index.js +9 -12
- package/lib/upload-preview/media.js +12 -16
- package/lib/utils/form-utils.js +19 -26
- package/package.json +1 -1
package/es/upload/index.js
CHANGED
|
@@ -465,65 +465,57 @@ var IglooUpload = function IglooUpload(_ref) {
|
|
|
465
465
|
});
|
|
466
466
|
};
|
|
467
467
|
|
|
468
|
-
return _jsxs("div",
|
|
468
|
+
return _jsxs("div", {
|
|
469
469
|
className: classnames('igloo-upload', className),
|
|
470
470
|
id: rest.id,
|
|
471
|
-
ref: DomRef
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
className: "igloo-upload-descriptions"
|
|
475
|
-
}, {
|
|
471
|
+
ref: DomRef,
|
|
472
|
+
children: [descriptions && _jsx("div", {
|
|
473
|
+
className: "igloo-upload-descriptions",
|
|
476
474
|
children: descriptions
|
|
477
|
-
}
|
|
475
|
+
}, void 0), _jsx(Dragger, _objectSpread(_objectSpread({
|
|
478
476
|
action: onUpload
|
|
479
|
-
}, rest, {
|
|
477
|
+
}, rest), {}, {
|
|
480
478
|
showUploadList: false,
|
|
481
479
|
className: "igloo-upload-box",
|
|
482
480
|
customRequest: function customRequest() {},
|
|
483
|
-
multiple: true
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
className: "igloo-upload-box-center"
|
|
487
|
-
}, {
|
|
481
|
+
multiple: true,
|
|
482
|
+
children: _jsxs("div", {
|
|
483
|
+
className: "igloo-upload-box-center",
|
|
488
484
|
children: [_jsx(UploadOutlined, {
|
|
489
485
|
style: {
|
|
490
486
|
marginRight: 16,
|
|
491
487
|
fontSize: 24,
|
|
492
488
|
color: '#666666'
|
|
493
489
|
}
|
|
494
|
-
}, void 0), _jsx("span",
|
|
495
|
-
className: "igloo-upload-placeholder"
|
|
496
|
-
}, {
|
|
490
|
+
}, void 0), _jsx("span", {
|
|
491
|
+
className: "igloo-upload-placeholder",
|
|
497
492
|
children: placeholder || _jsxs(_Fragment, {
|
|
498
|
-
children: [_jsx(Typography,
|
|
499
|
-
level: "body1"
|
|
500
|
-
}, {
|
|
493
|
+
children: [_jsx(Typography, {
|
|
494
|
+
level: "body1",
|
|
501
495
|
children: formatMessage({
|
|
502
496
|
id: 'Drag and drop a file here'
|
|
503
497
|
})
|
|
504
|
-
}
|
|
498
|
+
}, void 0), _jsx(Typography, {
|
|
505
499
|
level: "body1",
|
|
506
500
|
style: {
|
|
507
501
|
marginLeft: 4
|
|
508
|
-
}
|
|
509
|
-
}, {
|
|
502
|
+
},
|
|
510
503
|
children: formatMessage({
|
|
511
504
|
id: 'or'
|
|
512
505
|
})
|
|
513
|
-
}
|
|
506
|
+
}, void 0), _jsx(Typography, {
|
|
514
507
|
level: "body1",
|
|
515
508
|
style: {
|
|
516
509
|
color: colors.purpleMain,
|
|
517
510
|
marginLeft: 4
|
|
518
|
-
}
|
|
519
|
-
}, {
|
|
511
|
+
},
|
|
520
512
|
children: formatMessage({
|
|
521
513
|
id: 'browse'
|
|
522
514
|
})
|
|
523
|
-
}
|
|
515
|
+
}, void 0)]
|
|
524
516
|
}, void 0)
|
|
525
|
-
}
|
|
526
|
-
}
|
|
517
|
+
}, void 0)]
|
|
518
|
+
}, void 0)
|
|
527
519
|
}), void 0), !!files.length && _jsx(FileList, {
|
|
528
520
|
files: files,
|
|
529
521
|
limit: limit,
|
|
@@ -532,7 +524,7 @@ var IglooUpload = function IglooUpload(_ref) {
|
|
|
532
524
|
handleDelete: handleDelete,
|
|
533
525
|
containerRef: containerRef
|
|
534
526
|
}, void 0)]
|
|
535
|
-
}
|
|
527
|
+
}, void 0);
|
|
536
528
|
};
|
|
537
529
|
|
|
538
530
|
var FileList = function FileList(_ref7) {
|
|
@@ -553,22 +545,19 @@ var FileList = function FileList(_ref7) {
|
|
|
553
545
|
}, [containerRef.current]);
|
|
554
546
|
if (!initDone) return null;
|
|
555
547
|
|
|
556
|
-
var children = _jsx("div",
|
|
557
|
-
className: "igloo-upload-preview-list"
|
|
558
|
-
}, {
|
|
548
|
+
var children = _jsx("div", {
|
|
549
|
+
className: "igloo-upload-preview-list",
|
|
559
550
|
children: files.map(function (_ref8, index) {
|
|
560
551
|
var type = _ref8.type,
|
|
561
552
|
name = _ref8.name,
|
|
562
553
|
size = _ref8.size,
|
|
563
554
|
status = _ref8.status;
|
|
564
|
-
return _jsxs("div",
|
|
555
|
+
return _jsxs("div", {
|
|
565
556
|
className: classnames('igloo-upload-preview-item', {
|
|
566
557
|
'igloo-upload-preview-item-failed': status === 'failed'
|
|
567
|
-
})
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
className: "igloo-upload-preview-item-info"
|
|
571
|
-
}, {
|
|
558
|
+
}),
|
|
559
|
+
children: [_jsxs("div", {
|
|
560
|
+
className: "igloo-upload-preview-item-info",
|
|
572
561
|
children: [status !== 'progress' && _jsx(FileOutlined, {
|
|
573
562
|
style: {
|
|
574
563
|
marginRight: 8,
|
|
@@ -583,30 +572,24 @@ var FileList = function FileList(_ref7) {
|
|
|
583
572
|
fontSize: 24,
|
|
584
573
|
color: '#999999'
|
|
585
574
|
}
|
|
586
|
-
}, void 0), _jsxs("div",
|
|
587
|
-
className: "igloo-upload-preview-item-text"
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
children: _jsx(Typography, Object.assign({
|
|
593
|
-
level: "h4"
|
|
594
|
-
}, {
|
|
575
|
+
}, void 0), _jsxs("div", {
|
|
576
|
+
className: "igloo-upload-preview-item-text",
|
|
577
|
+
children: [_jsx("span", {
|
|
578
|
+
className: "igloo-upload-preview-item-name",
|
|
579
|
+
children: _jsx(Typography, {
|
|
580
|
+
level: "h4",
|
|
595
581
|
children: name
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
className: "igloo-upload-preview-item-size"
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
level: "body1"
|
|
602
|
-
}, {
|
|
582
|
+
}, void 0)
|
|
583
|
+
}, void 0), Boolean(size) && _jsx("span", {
|
|
584
|
+
className: "igloo-upload-preview-item-size",
|
|
585
|
+
children: _jsx(Typography, {
|
|
586
|
+
level: "body1",
|
|
603
587
|
children: parseFileSize(size)
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
className: "igloo-upload-preview-item-operation"
|
|
609
|
-
}, {
|
|
588
|
+
}, void 0)
|
|
589
|
+
}, void 0)]
|
|
590
|
+
}, void 0)]
|
|
591
|
+
}, void 0), status === 'success' && _jsxs("div", {
|
|
592
|
+
className: "igloo-upload-preview-item-operation",
|
|
610
593
|
children: [type && _jsx(ShowOutlined, {
|
|
611
594
|
style: {
|
|
612
595
|
fontSize: 24,
|
|
@@ -627,9 +610,8 @@ var FileList = function FileList(_ref7) {
|
|
|
627
610
|
return handleDelete(index);
|
|
628
611
|
}
|
|
629
612
|
}, void 0)]
|
|
630
|
-
}
|
|
631
|
-
className: "igloo-upload-preview-item-operation"
|
|
632
|
-
}, {
|
|
613
|
+
}, void 0), status === 'failed' && _jsxs("div", {
|
|
614
|
+
className: "igloo-upload-preview-item-operation",
|
|
633
615
|
children: [(!limit || index < limit) && _jsx(RefreshOutlined, {
|
|
634
616
|
style: {
|
|
635
617
|
fontSize: 24,
|
|
@@ -650,10 +632,10 @@ var FileList = function FileList(_ref7) {
|
|
|
650
632
|
return handleDelete(index);
|
|
651
633
|
}
|
|
652
634
|
}, void 0)]
|
|
653
|
-
}
|
|
654
|
-
}
|
|
635
|
+
}, void 0)]
|
|
636
|
+
}, index);
|
|
655
637
|
})
|
|
656
|
-
}
|
|
638
|
+
}, void 0);
|
|
657
639
|
|
|
658
640
|
return /*#__PURE__*/ReactDOM.createPortal(children, containerRef.current);
|
|
659
641
|
};
|
package/es/upload-photo/index.js
CHANGED
|
@@ -614,55 +614,47 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
614
614
|
}, void 0);
|
|
615
615
|
};
|
|
616
616
|
|
|
617
|
-
return _jsxs("div",
|
|
617
|
+
return _jsxs("div", {
|
|
618
618
|
className: classnames(prefix, className),
|
|
619
619
|
id: id,
|
|
620
|
-
ref: DomRef
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
}, {
|
|
625
|
-
children: _jsxs(_Row, Object.assign({
|
|
620
|
+
ref: DomRef,
|
|
621
|
+
children: [Boolean(descriptions || samples.length) && _jsx("div", {
|
|
622
|
+
className: "".concat(prefix, "-sample"),
|
|
623
|
+
children: _jsxs(_Row, {
|
|
626
624
|
gutter: [isMobile ? 16 : 32, 16],
|
|
627
|
-
wrap: true
|
|
628
|
-
}, {
|
|
625
|
+
wrap: true,
|
|
629
626
|
children: [Boolean(samples === null || samples === void 0 ? void 0 : samples.length) && samples.map(function (_ref8, index) {
|
|
630
627
|
var _classnames, _classnames2;
|
|
631
628
|
|
|
632
629
|
var src = _ref8.src,
|
|
633
630
|
label = _ref8.label,
|
|
634
631
|
type = _ref8.type;
|
|
635
|
-
return _jsxs(_Col,
|
|
636
|
-
span: sampleSpan
|
|
637
|
-
}, {
|
|
632
|
+
return _jsxs(_Col, {
|
|
633
|
+
span: sampleSpan,
|
|
638
634
|
children: [_jsx("img", {
|
|
639
635
|
src: src,
|
|
640
636
|
alt: "",
|
|
641
637
|
className: "".concat(prefix, "-sample-photos-photo")
|
|
642
638
|
}, void 0), _jsx("div", {
|
|
643
639
|
className: classnames((_classnames = {}, _defineProperty(_classnames, "".concat(prefix, "-sample-photos-good"), type === 'good'), _defineProperty(_classnames, "".concat(prefix, "-sample-photos-bad"), type === 'bad'), _classnames))
|
|
644
|
-
}, void 0), label && _jsx("div",
|
|
645
|
-
className: classnames((_classnames2 = {}, _defineProperty(_classnames2, "".concat(prefix, "-sample-photos-label"), true), _defineProperty(_classnames2, "".concat(prefix, "-sample-photos-label-good"), type === 'good'), _defineProperty(_classnames2, "".concat(prefix, "-sample-photos-label-bad"), type === 'bad'), _classnames2))
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
level: "body2"
|
|
649
|
-
}, {
|
|
640
|
+
}, void 0), label && _jsx("div", {
|
|
641
|
+
className: classnames((_classnames2 = {}, _defineProperty(_classnames2, "".concat(prefix, "-sample-photos-label"), true), _defineProperty(_classnames2, "".concat(prefix, "-sample-photos-label-good"), type === 'good'), _defineProperty(_classnames2, "".concat(prefix, "-sample-photos-label-bad"), type === 'bad'), _classnames2)),
|
|
642
|
+
children: _jsx(IglooTypography, {
|
|
643
|
+
level: "body2",
|
|
650
644
|
children: label
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
}), _jsx(_Col,
|
|
645
|
+
}, void 0)
|
|
646
|
+
}, void 0)]
|
|
647
|
+
}, index);
|
|
648
|
+
}), _jsx(_Col, {
|
|
655
649
|
className: classnames((_classnames3 = {}, _defineProperty(_classnames3, "".concat(prefix, "-sample-descriptions"), true), _defineProperty(_classnames3, "".concat(prefix, "-sample-descriptions-center"), !!md), _classnames3)),
|
|
656
|
-
span: descriptionSpan
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
level: "caption2"
|
|
660
|
-
}, {
|
|
650
|
+
span: descriptionSpan,
|
|
651
|
+
children: _jsx(IglooTypography, {
|
|
652
|
+
level: "caption2",
|
|
661
653
|
children: descriptions
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
}
|
|
654
|
+
}, void 0)
|
|
655
|
+
}, void 0)]
|
|
656
|
+
}, void 0)
|
|
657
|
+
}, void 0), _jsx("input", {
|
|
666
658
|
id: uploadId,
|
|
667
659
|
type: "file",
|
|
668
660
|
style: {
|
|
@@ -673,44 +665,39 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
673
665
|
value: [],
|
|
674
666
|
multiple: true,
|
|
675
667
|
capture: true
|
|
676
|
-
}, void 0), _jsxs(_Space,
|
|
668
|
+
}, void 0), _jsxs(_Space, {
|
|
677
669
|
className: "".concat(prefix, "-content"),
|
|
678
670
|
size: [16, 16],
|
|
679
|
-
wrap: true
|
|
680
|
-
|
|
681
|
-
children: [_jsxs("label", Object.assign({
|
|
671
|
+
wrap: true,
|
|
672
|
+
children: [_jsxs("label", {
|
|
682
673
|
htmlFor: uploadId,
|
|
683
674
|
className: classnames((_classnames4 = {}, _defineProperty(_classnames4, "".concat(prefix, "-content-button"), true), _defineProperty(_classnames4, 'dont-show-error-status', Array.isArray(value) && value.some(function (file) {
|
|
684
675
|
return typeof file !== 'string' && file.status === 'failed';
|
|
685
|
-
})), _classnames4))
|
|
686
|
-
}, {
|
|
676
|
+
})), _classnames4)),
|
|
687
677
|
children: [_jsx(UploadOutlined, {
|
|
688
678
|
style: {
|
|
689
679
|
fontSize: 24,
|
|
690
680
|
color: '#666666'
|
|
691
681
|
}
|
|
692
|
-
}, void 0), _jsx("span",
|
|
682
|
+
}, void 0), _jsx("span", {
|
|
693
683
|
style: {
|
|
694
684
|
marginTop: 6
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
level: "body1"
|
|
699
|
-
}, {
|
|
685
|
+
},
|
|
686
|
+
children: _jsx(IglooTypography, {
|
|
687
|
+
level: "body1",
|
|
700
688
|
children: buttonText || 'Upload'
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
}
|
|
689
|
+
}, void 0)
|
|
690
|
+
}, void 0)]
|
|
691
|
+
}, void 0), files.map(function (_ref9, index) {
|
|
704
692
|
var _classnames5;
|
|
705
693
|
|
|
706
694
|
var dataUrl = _ref9.dataUrl,
|
|
707
695
|
status = _ref9.status,
|
|
708
696
|
type = _ref9.type,
|
|
709
697
|
uid = _ref9.uid;
|
|
710
|
-
return _jsx(_Badge,
|
|
711
|
-
count: getBadge(status, index, limit)
|
|
712
|
-
|
|
713
|
-
children: _jsxs("div", Object.assign({
|
|
698
|
+
return _jsx(_Badge, {
|
|
699
|
+
count: getBadge(status, index, limit),
|
|
700
|
+
children: _jsxs("div", {
|
|
714
701
|
className: classnames((_classnames5 = {}, _defineProperty(_classnames5, "".concat(prefix, "-content-container"), true), _defineProperty(_classnames5, "".concat(prefix, "-content-error"), status === 'failed'), _classnames5)),
|
|
715
702
|
onMouseEnter: function onMouseEnter() {
|
|
716
703
|
return handleMouseEnter(index);
|
|
@@ -721,44 +708,41 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
721
708
|
onClick: function onClick(e) {
|
|
722
709
|
e.stopPropagation();
|
|
723
710
|
handleTouchEnd(index);
|
|
724
|
-
}
|
|
725
|
-
}, {
|
|
711
|
+
},
|
|
726
712
|
children: [_jsx(MediaItem, {
|
|
727
713
|
type: type,
|
|
728
714
|
src: dataUrl,
|
|
729
715
|
className: "".concat(prefix, "-content-preview")
|
|
730
716
|
}, void 0), (!limit || index < limit) && masks[index] && _jsxs(_Fragment, {
|
|
731
|
-
children: [status === 'failed' && _jsx("div",
|
|
717
|
+
children: [status === 'failed' && _jsx("div", {
|
|
732
718
|
className: "".concat(prefix, "-content-mask"),
|
|
733
719
|
onClick: function onClick(e) {
|
|
734
720
|
e.stopPropagation();
|
|
735
721
|
handleReUpload(index);
|
|
736
|
-
}
|
|
737
|
-
}, {
|
|
722
|
+
},
|
|
738
723
|
children: _jsx(RefreshOutlined, {
|
|
739
724
|
style: {
|
|
740
725
|
fontSize: 24
|
|
741
726
|
}
|
|
742
727
|
}, void 0)
|
|
743
|
-
}
|
|
728
|
+
}, void 0), status === 'success' && _jsx("div", {
|
|
744
729
|
className: "".concat(prefix, "-content-mask"),
|
|
745
730
|
onClick: function onClick(e) {
|
|
746
731
|
e.stopPropagation();
|
|
747
732
|
handlePreview(index);
|
|
748
|
-
}
|
|
749
|
-
}, {
|
|
733
|
+
},
|
|
750
734
|
children: _jsx(ShowOutlined, {
|
|
751
735
|
style: {
|
|
752
736
|
fontSize: 24
|
|
753
737
|
}
|
|
754
738
|
}, void 0)
|
|
755
|
-
}
|
|
739
|
+
}, void 0)]
|
|
756
740
|
}, void 0)]
|
|
757
|
-
}
|
|
758
|
-
}
|
|
741
|
+
}, void 0)
|
|
742
|
+
}, uid);
|
|
759
743
|
})]
|
|
760
|
-
}
|
|
761
|
-
}
|
|
744
|
+
}, void 0)]
|
|
745
|
+
}, void 0);
|
|
762
746
|
};
|
|
763
747
|
|
|
764
748
|
function checkFileList(value) {
|
package/es/upload-photo/media.js
CHANGED
|
@@ -19,9 +19,8 @@ var MediaItem = function MediaItem(_ref) {
|
|
|
19
19
|
}, void 0);
|
|
20
20
|
|
|
21
21
|
case 'pdf':
|
|
22
|
-
return _jsx("div",
|
|
23
|
-
className: className
|
|
24
|
-
}, {
|
|
22
|
+
return _jsx("div", {
|
|
23
|
+
className: className,
|
|
25
24
|
children: _jsx(PDF, {
|
|
26
25
|
file: src,
|
|
27
26
|
scale: 0.1,
|
|
@@ -30,7 +29,7 @@ var MediaItem = function MediaItem(_ref) {
|
|
|
30
29
|
maxHeight: 96
|
|
31
30
|
}
|
|
32
31
|
}, void 0)
|
|
33
|
-
}
|
|
32
|
+
}, void 0);
|
|
34
33
|
|
|
35
34
|
default:
|
|
36
35
|
return _jsx("img", {
|
|
@@ -115,9 +115,8 @@ var UploadPreview = function UploadPreview(_ref) {
|
|
|
115
115
|
if (!files || !files.length) return _jsx("div", {
|
|
116
116
|
children: "-"
|
|
117
117
|
}, void 0);
|
|
118
|
-
return _jsxs("div",
|
|
119
|
-
className: "igloo-upload-preview"
|
|
120
|
-
}, {
|
|
118
|
+
return _jsxs("div", {
|
|
119
|
+
className: "igloo-upload-preview",
|
|
121
120
|
children: [description || (files.length === 1 ? formatMessage({
|
|
122
121
|
id: '1 file attached.'
|
|
123
122
|
}) : formatMessage({
|
|
@@ -133,20 +132,18 @@ var UploadPreview = function UploadPreview(_ref) {
|
|
|
133
132
|
style: {
|
|
134
133
|
fontSize: 24
|
|
135
134
|
}
|
|
136
|
-
}, void 0), _jsxs(Modal,
|
|
135
|
+
}, void 0), _jsxs(Modal, {
|
|
137
136
|
visible: preview,
|
|
138
|
-
title: _jsxs(Typography,
|
|
139
|
-
level: "h4"
|
|
140
|
-
}, {
|
|
137
|
+
title: _jsxs(Typography, {
|
|
138
|
+
level: "h4",
|
|
141
139
|
children: [label, " (", current + 1, "/", files.length, ")"]
|
|
142
|
-
}
|
|
140
|
+
}, void 0),
|
|
143
141
|
className: "igloo-upload-preview-modal",
|
|
144
142
|
footer: null,
|
|
145
143
|
onCancel: function onCancel() {
|
|
146
144
|
return setPreview(false);
|
|
147
145
|
},
|
|
148
|
-
forceRender: false
|
|
149
|
-
}, {
|
|
146
|
+
forceRender: false,
|
|
150
147
|
children: [_jsx(Button, {
|
|
151
148
|
icon: _jsx(ArrowLeftOutlined, {}, void 0),
|
|
152
149
|
className: classnames('igloo-upload-preview-modal-button', 'igloo-upload-preview-modal-button-left'),
|
|
@@ -161,8 +158,8 @@ var UploadPreview = function UploadPreview(_ref) {
|
|
|
161
158
|
onClick: next,
|
|
162
159
|
disabled: current >= files.length - 1
|
|
163
160
|
}, void 0)]
|
|
164
|
-
}
|
|
165
|
-
}
|
|
161
|
+
}, void 0)]
|
|
162
|
+
}, void 0);
|
|
166
163
|
};
|
|
167
164
|
|
|
168
165
|
export default UploadPreview;
|
|
@@ -53,11 +53,10 @@ var PDF = function PDF(_ref) {
|
|
|
53
53
|
}, i));
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
return _jsx("div",
|
|
57
|
-
className: "igloo-upload-preview-pdf"
|
|
58
|
-
}, {
|
|
56
|
+
return _jsx("div", {
|
|
57
|
+
className: "igloo-upload-preview-pdf",
|
|
59
58
|
children: pages
|
|
60
|
-
}
|
|
59
|
+
}, void 0);
|
|
61
60
|
};
|
|
62
61
|
|
|
63
62
|
var Media = function Media(_ref3) {
|
|
@@ -68,20 +67,18 @@ var Media = function Media(_ref3) {
|
|
|
68
67
|
var _useContext = useContext(LocaleContext),
|
|
69
68
|
formatMessage = _useContext.formatMessage;
|
|
70
69
|
|
|
71
|
-
var children = _jsxs("div",
|
|
72
|
-
className: "igloo-upload-prevew-not-supported"
|
|
73
|
-
}, {
|
|
70
|
+
var children = _jsxs("div", {
|
|
71
|
+
className: "igloo-upload-prevew-not-supported",
|
|
74
72
|
children: [_jsx(ErrorFilled, {
|
|
75
73
|
className: "igloo-upload-prevew-not-supported-icon"
|
|
76
|
-
}, void 0), _jsx(Typography,
|
|
74
|
+
}, void 0), _jsx(Typography, {
|
|
77
75
|
level: "body1",
|
|
78
|
-
className: "igloo-upload-prevew-not-supported-text"
|
|
79
|
-
}, {
|
|
76
|
+
className: "igloo-upload-prevew-not-supported-text",
|
|
80
77
|
children: formatMessage({
|
|
81
78
|
id: 'No preview for this file. Only support image, video or PDF file.'
|
|
82
79
|
})
|
|
83
|
-
}
|
|
84
|
-
}
|
|
80
|
+
}, void 0)]
|
|
81
|
+
}, void 0);
|
|
85
82
|
|
|
86
83
|
if (type === 'image') {
|
|
87
84
|
children = _jsx("img", {
|
|
@@ -105,11 +102,10 @@ var Media = function Media(_ref3) {
|
|
|
105
102
|
}, void 0);
|
|
106
103
|
}
|
|
107
104
|
|
|
108
|
-
return _jsx("div",
|
|
109
|
-
className: classNames('igloo-upload-preview-container', className)
|
|
110
|
-
}, {
|
|
105
|
+
return _jsx("div", {
|
|
106
|
+
className: classNames('igloo-upload-preview-container', className),
|
|
111
107
|
children: children
|
|
112
|
-
}
|
|
108
|
+
}, void 0);
|
|
113
109
|
};
|
|
114
110
|
|
|
115
111
|
export default Media;
|
package/es/utils/form-utils.js
CHANGED
|
@@ -206,40 +206,33 @@ export var calcFormItemProps = function calcFormItemProps(config, extraProps, fo
|
|
|
206
206
|
normalize: normalize || extraNormalize,
|
|
207
207
|
rules: rules,
|
|
208
208
|
validateTrigger: _toConsumableArray(new Set(validateTriggers)),
|
|
209
|
-
label: label ? _jsxs("div",
|
|
210
|
-
className: "igloo-form-label"
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
children: [_jsx(Typography, Object.assign({
|
|
216
|
-
level: "body1"
|
|
217
|
-
}, {
|
|
209
|
+
label: label ? _jsxs("div", {
|
|
210
|
+
className: "igloo-form-label",
|
|
211
|
+
children: [_jsxs("div", {
|
|
212
|
+
className: "igloo-form-label-text",
|
|
213
|
+
children: [_jsx(Typography, {
|
|
214
|
+
level: "body1",
|
|
218
215
|
children: label
|
|
219
|
-
}
|
|
220
|
-
className: "igloo-form-label-required"
|
|
221
|
-
}, {
|
|
216
|
+
}, void 0), isRequired && requiredMark && _jsx("span", {
|
|
217
|
+
className: "igloo-form-label-required",
|
|
222
218
|
children: "*"
|
|
223
|
-
}
|
|
224
|
-
className: "igloo-form-label-optional"
|
|
225
|
-
}, {
|
|
219
|
+
}, void 0), showOptional && _jsxs("span", {
|
|
220
|
+
className: "igloo-form-label-optional",
|
|
226
221
|
children: ["(", formatMessage({
|
|
227
222
|
id: 'Optional'
|
|
228
223
|
}), ")"]
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
className: "igloo-form-label-extra"
|
|
232
|
-
}, {
|
|
224
|
+
}, void 0)]
|
|
225
|
+
}, void 0), extraLabel && _jsx("div", {
|
|
226
|
+
className: "igloo-form-label-extra",
|
|
233
227
|
children: typeof extraLabel === 'function' ? extraLabel(form) : extraLabel
|
|
234
|
-
}
|
|
235
|
-
}
|
|
228
|
+
}, void 0)]
|
|
229
|
+
}, void 0) : null,
|
|
236
230
|
getValueFromEvent: getValueFromEvent || extraGetValueFromEvent,
|
|
237
231
|
getValueProps: getValueProps,
|
|
238
|
-
extra: (extra || extraExtra) && _jsx(Typography,
|
|
239
|
-
level: "caption2"
|
|
240
|
-
}, {
|
|
232
|
+
extra: (extra || extraExtra) && _jsx(Typography, {
|
|
233
|
+
level: "caption2",
|
|
241
234
|
children: extra || extraExtra
|
|
242
|
-
}
|
|
235
|
+
}, void 0),
|
|
243
236
|
help: help || extraHelp,
|
|
244
237
|
valuePropName: valuePropName || extraValuePropName,
|
|
245
238
|
messageVariables: _objectSpread({
|