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/lib/upload/index.js
CHANGED
|
@@ -490,65 +490,57 @@ var IglooUpload = function IglooUpload(_ref) {
|
|
|
490
490
|
});
|
|
491
491
|
};
|
|
492
492
|
|
|
493
|
-
return (0, _jsxRuntime.jsxs)("div",
|
|
493
|
+
return (0, _jsxRuntime.jsxs)("div", {
|
|
494
494
|
className: (0, _classnames.default)('igloo-upload', className),
|
|
495
495
|
id: rest.id,
|
|
496
|
-
ref: DomRef
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
className: "igloo-upload-descriptions"
|
|
500
|
-
}, {
|
|
496
|
+
ref: DomRef,
|
|
497
|
+
children: [descriptions && (0, _jsxRuntime.jsx)("div", {
|
|
498
|
+
className: "igloo-upload-descriptions",
|
|
501
499
|
children: descriptions
|
|
502
|
-
}
|
|
500
|
+
}, void 0), (0, _jsxRuntime.jsx)(Dragger, _objectSpread(_objectSpread({
|
|
503
501
|
action: onUpload
|
|
504
|
-
}, rest, {
|
|
502
|
+
}, rest), {}, {
|
|
505
503
|
showUploadList: false,
|
|
506
504
|
className: "igloo-upload-box",
|
|
507
505
|
customRequest: function customRequest() {},
|
|
508
|
-
multiple: true
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
className: "igloo-upload-box-center"
|
|
512
|
-
}, {
|
|
506
|
+
multiple: true,
|
|
507
|
+
children: (0, _jsxRuntime.jsxs)("div", {
|
|
508
|
+
className: "igloo-upload-box-center",
|
|
513
509
|
children: [(0, _jsxRuntime.jsx)(_iglooicon.UploadOutlined, {
|
|
514
510
|
style: {
|
|
515
511
|
marginRight: 16,
|
|
516
512
|
fontSize: 24,
|
|
517
513
|
color: '#666666'
|
|
518
514
|
}
|
|
519
|
-
}, void 0), (0, _jsxRuntime.jsx)("span",
|
|
520
|
-
className: "igloo-upload-placeholder"
|
|
521
|
-
}, {
|
|
515
|
+
}, void 0), (0, _jsxRuntime.jsx)("span", {
|
|
516
|
+
className: "igloo-upload-placeholder",
|
|
522
517
|
children: placeholder || (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
523
|
-
children: [(0, _jsxRuntime.jsx)(_typography.default,
|
|
524
|
-
level: "body1"
|
|
525
|
-
}, {
|
|
518
|
+
children: [(0, _jsxRuntime.jsx)(_typography.default, {
|
|
519
|
+
level: "body1",
|
|
526
520
|
children: formatMessage({
|
|
527
521
|
id: 'Drag and drop a file here'
|
|
528
522
|
})
|
|
529
|
-
}
|
|
523
|
+
}, void 0), (0, _jsxRuntime.jsx)(_typography.default, {
|
|
530
524
|
level: "body1",
|
|
531
525
|
style: {
|
|
532
526
|
marginLeft: 4
|
|
533
|
-
}
|
|
534
|
-
}, {
|
|
527
|
+
},
|
|
535
528
|
children: formatMessage({
|
|
536
529
|
id: 'or'
|
|
537
530
|
})
|
|
538
|
-
}
|
|
531
|
+
}, void 0), (0, _jsxRuntime.jsx)(_typography.default, {
|
|
539
532
|
level: "body1",
|
|
540
533
|
style: {
|
|
541
534
|
color: _iglootheme.colors.purpleMain,
|
|
542
535
|
marginLeft: 4
|
|
543
|
-
}
|
|
544
|
-
}, {
|
|
536
|
+
},
|
|
545
537
|
children: formatMessage({
|
|
546
538
|
id: 'browse'
|
|
547
539
|
})
|
|
548
|
-
}
|
|
540
|
+
}, void 0)]
|
|
549
541
|
}, void 0)
|
|
550
|
-
}
|
|
551
|
-
}
|
|
542
|
+
}, void 0)]
|
|
543
|
+
}, void 0)
|
|
552
544
|
}), void 0), !!files.length && (0, _jsxRuntime.jsx)(FileList, {
|
|
553
545
|
files: files,
|
|
554
546
|
limit: limit,
|
|
@@ -557,7 +549,7 @@ var IglooUpload = function IglooUpload(_ref) {
|
|
|
557
549
|
handleDelete: handleDelete,
|
|
558
550
|
containerRef: containerRef
|
|
559
551
|
}, void 0)]
|
|
560
|
-
}
|
|
552
|
+
}, void 0);
|
|
561
553
|
};
|
|
562
554
|
|
|
563
555
|
var FileList = function FileList(_ref7) {
|
|
@@ -577,22 +569,19 @@ var FileList = function FileList(_ref7) {
|
|
|
577
569
|
return setInitDone(true);
|
|
578
570
|
}, [containerRef.current]);
|
|
579
571
|
if (!initDone) return null;
|
|
580
|
-
var children = (0, _jsxRuntime.jsx)("div",
|
|
581
|
-
className: "igloo-upload-preview-list"
|
|
582
|
-
}, {
|
|
572
|
+
var children = (0, _jsxRuntime.jsx)("div", {
|
|
573
|
+
className: "igloo-upload-preview-list",
|
|
583
574
|
children: files.map(function (_ref8, index) {
|
|
584
575
|
var type = _ref8.type,
|
|
585
576
|
name = _ref8.name,
|
|
586
577
|
size = _ref8.size,
|
|
587
578
|
status = _ref8.status;
|
|
588
|
-
return (0, _jsxRuntime.jsxs)("div",
|
|
579
|
+
return (0, _jsxRuntime.jsxs)("div", {
|
|
589
580
|
className: (0, _classnames.default)('igloo-upload-preview-item', {
|
|
590
581
|
'igloo-upload-preview-item-failed': status === 'failed'
|
|
591
|
-
})
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
className: "igloo-upload-preview-item-info"
|
|
595
|
-
}, {
|
|
582
|
+
}),
|
|
583
|
+
children: [(0, _jsxRuntime.jsxs)("div", {
|
|
584
|
+
className: "igloo-upload-preview-item-info",
|
|
596
585
|
children: [status !== 'progress' && (0, _jsxRuntime.jsx)(_iglooicon.FileOutlined, {
|
|
597
586
|
style: {
|
|
598
587
|
marginRight: 8,
|
|
@@ -607,30 +596,24 @@ var FileList = function FileList(_ref7) {
|
|
|
607
596
|
fontSize: 24,
|
|
608
597
|
color: '#999999'
|
|
609
598
|
}
|
|
610
|
-
}, void 0), (0, _jsxRuntime.jsxs)("div",
|
|
611
|
-
className: "igloo-upload-preview-item-text"
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
children: (0, _jsxRuntime.jsx)(_typography.default, Object.assign({
|
|
617
|
-
level: "h4"
|
|
618
|
-
}, {
|
|
599
|
+
}, void 0), (0, _jsxRuntime.jsxs)("div", {
|
|
600
|
+
className: "igloo-upload-preview-item-text",
|
|
601
|
+
children: [(0, _jsxRuntime.jsx)("span", {
|
|
602
|
+
className: "igloo-upload-preview-item-name",
|
|
603
|
+
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
604
|
+
level: "h4",
|
|
619
605
|
children: name
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
className: "igloo-upload-preview-item-size"
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
level: "body1"
|
|
626
|
-
}, {
|
|
606
|
+
}, void 0)
|
|
607
|
+
}, void 0), Boolean(size) && (0, _jsxRuntime.jsx)("span", {
|
|
608
|
+
className: "igloo-upload-preview-item-size",
|
|
609
|
+
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
610
|
+
level: "body1",
|
|
627
611
|
children: (0, _tools.parseFileSize)(size)
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
className: "igloo-upload-preview-item-operation"
|
|
633
|
-
}, {
|
|
612
|
+
}, void 0)
|
|
613
|
+
}, void 0)]
|
|
614
|
+
}, void 0)]
|
|
615
|
+
}, void 0), status === 'success' && (0, _jsxRuntime.jsxs)("div", {
|
|
616
|
+
className: "igloo-upload-preview-item-operation",
|
|
634
617
|
children: [type && (0, _jsxRuntime.jsx)(_iglooicon.ShowOutlined, {
|
|
635
618
|
style: {
|
|
636
619
|
fontSize: 24,
|
|
@@ -651,9 +634,8 @@ var FileList = function FileList(_ref7) {
|
|
|
651
634
|
return handleDelete(index);
|
|
652
635
|
}
|
|
653
636
|
}, void 0)]
|
|
654
|
-
}
|
|
655
|
-
className: "igloo-upload-preview-item-operation"
|
|
656
|
-
}, {
|
|
637
|
+
}, void 0), status === 'failed' && (0, _jsxRuntime.jsxs)("div", {
|
|
638
|
+
className: "igloo-upload-preview-item-operation",
|
|
657
639
|
children: [(!limit || index < limit) && (0, _jsxRuntime.jsx)(_iglooicon.RefreshOutlined, {
|
|
658
640
|
style: {
|
|
659
641
|
fontSize: 24,
|
|
@@ -674,10 +656,10 @@ var FileList = function FileList(_ref7) {
|
|
|
674
656
|
return handleDelete(index);
|
|
675
657
|
}
|
|
676
658
|
}, void 0)]
|
|
677
|
-
}
|
|
678
|
-
}
|
|
659
|
+
}, void 0)]
|
|
660
|
+
}, index);
|
|
679
661
|
})
|
|
680
|
-
}
|
|
662
|
+
}, void 0);
|
|
681
663
|
return /*#__PURE__*/_reactDom.default.createPortal(children, containerRef.current);
|
|
682
664
|
};
|
|
683
665
|
|
|
@@ -647,55 +647,47 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
647
647
|
}, void 0);
|
|
648
648
|
};
|
|
649
649
|
|
|
650
|
-
return (0, _jsxRuntime.jsxs)("div",
|
|
650
|
+
return (0, _jsxRuntime.jsxs)("div", {
|
|
651
651
|
className: (0, _classnames6.default)(prefix, className),
|
|
652
652
|
id: id,
|
|
653
|
-
ref: DomRef
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
}, {
|
|
658
|
-
children: (0, _jsxRuntime.jsxs)(_row.default, Object.assign({
|
|
653
|
+
ref: DomRef,
|
|
654
|
+
children: [Boolean(descriptions || samples.length) && (0, _jsxRuntime.jsx)("div", {
|
|
655
|
+
className: "".concat(prefix, "-sample"),
|
|
656
|
+
children: (0, _jsxRuntime.jsxs)(_row.default, {
|
|
659
657
|
gutter: [isMobile ? 16 : 32, 16],
|
|
660
|
-
wrap: true
|
|
661
|
-
}, {
|
|
658
|
+
wrap: true,
|
|
662
659
|
children: [Boolean(samples === null || samples === void 0 ? void 0 : samples.length) && samples.map(function (_ref8, index) {
|
|
663
660
|
var _classnames, _classnames2;
|
|
664
661
|
|
|
665
662
|
var src = _ref8.src,
|
|
666
663
|
label = _ref8.label,
|
|
667
664
|
type = _ref8.type;
|
|
668
|
-
return (0, _jsxRuntime.jsxs)(_col.default,
|
|
669
|
-
span: sampleSpan
|
|
670
|
-
}, {
|
|
665
|
+
return (0, _jsxRuntime.jsxs)(_col.default, {
|
|
666
|
+
span: sampleSpan,
|
|
671
667
|
children: [(0, _jsxRuntime.jsx)("img", {
|
|
672
668
|
src: src,
|
|
673
669
|
alt: "",
|
|
674
670
|
className: "".concat(prefix, "-sample-photos-photo")
|
|
675
671
|
}, void 0), (0, _jsxRuntime.jsx)("div", {
|
|
676
672
|
className: (0, _classnames6.default)((_classnames = {}, _defineProperty(_classnames, "".concat(prefix, "-sample-photos-good"), type === 'good'), _defineProperty(_classnames, "".concat(prefix, "-sample-photos-bad"), type === 'bad'), _classnames))
|
|
677
|
-
}, void 0), label && (0, _jsxRuntime.jsx)("div",
|
|
678
|
-
className: (0, _classnames6.default)((_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))
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
level: "body2"
|
|
682
|
-
}, {
|
|
673
|
+
}, void 0), label && (0, _jsxRuntime.jsx)("div", {
|
|
674
|
+
className: (0, _classnames6.default)((_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)),
|
|
675
|
+
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
676
|
+
level: "body2",
|
|
683
677
|
children: label
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
}), (0, _jsxRuntime.jsx)(_col.default,
|
|
678
|
+
}, void 0)
|
|
679
|
+
}, void 0)]
|
|
680
|
+
}, index);
|
|
681
|
+
}), (0, _jsxRuntime.jsx)(_col.default, {
|
|
688
682
|
className: (0, _classnames6.default)((_classnames3 = {}, _defineProperty(_classnames3, "".concat(prefix, "-sample-descriptions"), true), _defineProperty(_classnames3, "".concat(prefix, "-sample-descriptions-center"), !!md), _classnames3)),
|
|
689
|
-
span: descriptionSpan
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
level: "caption2"
|
|
693
|
-
}, {
|
|
683
|
+
span: descriptionSpan,
|
|
684
|
+
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
685
|
+
level: "caption2",
|
|
694
686
|
children: descriptions
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
}
|
|
687
|
+
}, void 0)
|
|
688
|
+
}, void 0)]
|
|
689
|
+
}, void 0)
|
|
690
|
+
}, void 0), (0, _jsxRuntime.jsx)("input", {
|
|
699
691
|
id: uploadId,
|
|
700
692
|
type: "file",
|
|
701
693
|
style: {
|
|
@@ -706,44 +698,39 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
706
698
|
value: [],
|
|
707
699
|
multiple: true,
|
|
708
700
|
capture: true
|
|
709
|
-
}, void 0), (0, _jsxRuntime.jsxs)(_space.default,
|
|
701
|
+
}, void 0), (0, _jsxRuntime.jsxs)(_space.default, {
|
|
710
702
|
className: "".concat(prefix, "-content"),
|
|
711
703
|
size: [16, 16],
|
|
712
|
-
wrap: true
|
|
713
|
-
|
|
714
|
-
children: [(0, _jsxRuntime.jsxs)("label", Object.assign({
|
|
704
|
+
wrap: true,
|
|
705
|
+
children: [(0, _jsxRuntime.jsxs)("label", {
|
|
715
706
|
htmlFor: uploadId,
|
|
716
707
|
className: (0, _classnames6.default)((_classnames4 = {}, _defineProperty(_classnames4, "".concat(prefix, "-content-button"), true), _defineProperty(_classnames4, 'dont-show-error-status', Array.isArray(value) && value.some(function (file) {
|
|
717
708
|
return typeof file !== 'string' && file.status === 'failed';
|
|
718
|
-
})), _classnames4))
|
|
719
|
-
}, {
|
|
709
|
+
})), _classnames4)),
|
|
720
710
|
children: [(0, _jsxRuntime.jsx)(_iglooicon.UploadOutlined, {
|
|
721
711
|
style: {
|
|
722
712
|
fontSize: 24,
|
|
723
713
|
color: '#666666'
|
|
724
714
|
}
|
|
725
|
-
}, void 0), (0, _jsxRuntime.jsx)("span",
|
|
715
|
+
}, void 0), (0, _jsxRuntime.jsx)("span", {
|
|
726
716
|
style: {
|
|
727
717
|
marginTop: 6
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
level: "body1"
|
|
732
|
-
}, {
|
|
718
|
+
},
|
|
719
|
+
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
720
|
+
level: "body1",
|
|
733
721
|
children: buttonText || 'Upload'
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
}
|
|
722
|
+
}, void 0)
|
|
723
|
+
}, void 0)]
|
|
724
|
+
}, void 0), files.map(function (_ref9, index) {
|
|
737
725
|
var _classnames5;
|
|
738
726
|
|
|
739
727
|
var dataUrl = _ref9.dataUrl,
|
|
740
728
|
status = _ref9.status,
|
|
741
729
|
type = _ref9.type,
|
|
742
730
|
uid = _ref9.uid;
|
|
743
|
-
return (0, _jsxRuntime.jsx)(_badge.default,
|
|
744
|
-
count: getBadge(status, index, limit)
|
|
745
|
-
|
|
746
|
-
children: (0, _jsxRuntime.jsxs)("div", Object.assign({
|
|
731
|
+
return (0, _jsxRuntime.jsx)(_badge.default, {
|
|
732
|
+
count: getBadge(status, index, limit),
|
|
733
|
+
children: (0, _jsxRuntime.jsxs)("div", {
|
|
747
734
|
className: (0, _classnames6.default)((_classnames5 = {}, _defineProperty(_classnames5, "".concat(prefix, "-content-container"), true), _defineProperty(_classnames5, "".concat(prefix, "-content-error"), status === 'failed'), _classnames5)),
|
|
748
735
|
onMouseEnter: function onMouseEnter() {
|
|
749
736
|
return handleMouseEnter(index);
|
|
@@ -754,44 +741,41 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
754
741
|
onClick: function onClick(e) {
|
|
755
742
|
e.stopPropagation();
|
|
756
743
|
handleTouchEnd(index);
|
|
757
|
-
}
|
|
758
|
-
}, {
|
|
744
|
+
},
|
|
759
745
|
children: [(0, _jsxRuntime.jsx)(_media2.default, {
|
|
760
746
|
type: type,
|
|
761
747
|
src: dataUrl,
|
|
762
748
|
className: "".concat(prefix, "-content-preview")
|
|
763
749
|
}, void 0), (!limit || index < limit) && masks[index] && (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
764
|
-
children: [status === 'failed' && (0, _jsxRuntime.jsx)("div",
|
|
750
|
+
children: [status === 'failed' && (0, _jsxRuntime.jsx)("div", {
|
|
765
751
|
className: "".concat(prefix, "-content-mask"),
|
|
766
752
|
onClick: function onClick(e) {
|
|
767
753
|
e.stopPropagation();
|
|
768
754
|
handleReUpload(index);
|
|
769
|
-
}
|
|
770
|
-
}, {
|
|
755
|
+
},
|
|
771
756
|
children: (0, _jsxRuntime.jsx)(_iglooicon.RefreshOutlined, {
|
|
772
757
|
style: {
|
|
773
758
|
fontSize: 24
|
|
774
759
|
}
|
|
775
760
|
}, void 0)
|
|
776
|
-
}
|
|
761
|
+
}, void 0), status === 'success' && (0, _jsxRuntime.jsx)("div", {
|
|
777
762
|
className: "".concat(prefix, "-content-mask"),
|
|
778
763
|
onClick: function onClick(e) {
|
|
779
764
|
e.stopPropagation();
|
|
780
765
|
handlePreview(index);
|
|
781
|
-
}
|
|
782
|
-
}, {
|
|
766
|
+
},
|
|
783
767
|
children: (0, _jsxRuntime.jsx)(_iglooicon.ShowOutlined, {
|
|
784
768
|
style: {
|
|
785
769
|
fontSize: 24
|
|
786
770
|
}
|
|
787
771
|
}, void 0)
|
|
788
|
-
}
|
|
772
|
+
}, void 0)]
|
|
789
773
|
}, void 0)]
|
|
790
|
-
}
|
|
791
|
-
}
|
|
774
|
+
}, void 0)
|
|
775
|
+
}, uid);
|
|
792
776
|
})]
|
|
793
|
-
}
|
|
794
|
-
}
|
|
777
|
+
}, void 0)]
|
|
778
|
+
}, void 0);
|
|
795
779
|
};
|
|
796
780
|
|
|
797
781
|
function checkFileList(value) {
|
|
@@ -29,9 +29,8 @@ var MediaItem = function MediaItem(_ref) {
|
|
|
29
29
|
}, void 0);
|
|
30
30
|
|
|
31
31
|
case 'pdf':
|
|
32
|
-
return (0, _jsxRuntime.jsx)("div",
|
|
33
|
-
className: className
|
|
34
|
-
}, {
|
|
32
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
33
|
+
className: className,
|
|
35
34
|
children: (0, _jsxRuntime.jsx)(_reactPdf.default, {
|
|
36
35
|
file: src,
|
|
37
36
|
scale: 0.1,
|
|
@@ -40,7 +39,7 @@ var MediaItem = function MediaItem(_ref) {
|
|
|
40
39
|
maxHeight: 96
|
|
41
40
|
}
|
|
42
41
|
}, void 0)
|
|
43
|
-
}
|
|
42
|
+
}, void 0);
|
|
44
43
|
|
|
45
44
|
default:
|
|
46
45
|
return (0, _jsxRuntime.jsx)("img", {
|
|
@@ -134,9 +134,8 @@ var UploadPreview = function UploadPreview(_ref) {
|
|
|
134
134
|
if (!files || !files.length) return (0, _jsxRuntime.jsx)("div", {
|
|
135
135
|
children: "-"
|
|
136
136
|
}, void 0);
|
|
137
|
-
return (0, _jsxRuntime.jsxs)("div",
|
|
138
|
-
className: "igloo-upload-preview"
|
|
139
|
-
}, {
|
|
137
|
+
return (0, _jsxRuntime.jsxs)("div", {
|
|
138
|
+
className: "igloo-upload-preview",
|
|
140
139
|
children: [description || (files.length === 1 ? formatMessage({
|
|
141
140
|
id: '1 file attached.'
|
|
142
141
|
}) : formatMessage({
|
|
@@ -152,20 +151,18 @@ var UploadPreview = function UploadPreview(_ref) {
|
|
|
152
151
|
style: {
|
|
153
152
|
fontSize: 24
|
|
154
153
|
}
|
|
155
|
-
}, void 0), (0, _jsxRuntime.jsxs)(_modal.default,
|
|
154
|
+
}, void 0), (0, _jsxRuntime.jsxs)(_modal.default, {
|
|
156
155
|
visible: preview,
|
|
157
|
-
title: (0, _jsxRuntime.jsxs)(_typography.default,
|
|
158
|
-
level: "h4"
|
|
159
|
-
}, {
|
|
156
|
+
title: (0, _jsxRuntime.jsxs)(_typography.default, {
|
|
157
|
+
level: "h4",
|
|
160
158
|
children: [label, " (", current + 1, "/", files.length, ")"]
|
|
161
|
-
}
|
|
159
|
+
}, void 0),
|
|
162
160
|
className: "igloo-upload-preview-modal",
|
|
163
161
|
footer: null,
|
|
164
162
|
onCancel: function onCancel() {
|
|
165
163
|
return setPreview(false);
|
|
166
164
|
},
|
|
167
|
-
forceRender: false
|
|
168
|
-
}, {
|
|
165
|
+
forceRender: false,
|
|
169
166
|
children: [(0, _jsxRuntime.jsx)(_button.default, {
|
|
170
167
|
icon: (0, _jsxRuntime.jsx)(_iglooicon.ArrowLeftOutlined, {}, void 0),
|
|
171
168
|
className: (0, _classnames.default)('igloo-upload-preview-modal-button', 'igloo-upload-preview-modal-button-left'),
|
|
@@ -180,8 +177,8 @@ var UploadPreview = function UploadPreview(_ref) {
|
|
|
180
177
|
onClick: next,
|
|
181
178
|
disabled: current >= files.length - 1
|
|
182
179
|
}, void 0)]
|
|
183
|
-
}
|
|
184
|
-
}
|
|
180
|
+
}, void 0)]
|
|
181
|
+
}, void 0);
|
|
185
182
|
};
|
|
186
183
|
|
|
187
184
|
var _default = UploadPreview;
|
|
@@ -70,11 +70,10 @@ var PDF = function PDF(_ref) {
|
|
|
70
70
|
}, i));
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
return (0, _jsxRuntime.jsx)("div",
|
|
74
|
-
className: "igloo-upload-preview-pdf"
|
|
75
|
-
}, {
|
|
73
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
74
|
+
className: "igloo-upload-preview-pdf",
|
|
76
75
|
children: pages
|
|
77
|
-
}
|
|
76
|
+
}, void 0);
|
|
78
77
|
};
|
|
79
78
|
|
|
80
79
|
var Media = function Media(_ref3) {
|
|
@@ -85,20 +84,18 @@ var Media = function Media(_ref3) {
|
|
|
85
84
|
var _useContext = (0, _react.useContext)(_localeContext.default),
|
|
86
85
|
formatMessage = _useContext.formatMessage;
|
|
87
86
|
|
|
88
|
-
var children = (0, _jsxRuntime.jsxs)("div",
|
|
89
|
-
className: "igloo-upload-prevew-not-supported"
|
|
90
|
-
}, {
|
|
87
|
+
var children = (0, _jsxRuntime.jsxs)("div", {
|
|
88
|
+
className: "igloo-upload-prevew-not-supported",
|
|
91
89
|
children: [(0, _jsxRuntime.jsx)(_iglooicon.ErrorFilled, {
|
|
92
90
|
className: "igloo-upload-prevew-not-supported-icon"
|
|
93
|
-
}, void 0), (0, _jsxRuntime.jsx)(_typography.default,
|
|
91
|
+
}, void 0), (0, _jsxRuntime.jsx)(_typography.default, {
|
|
94
92
|
level: "body1",
|
|
95
|
-
className: "igloo-upload-prevew-not-supported-text"
|
|
96
|
-
}, {
|
|
93
|
+
className: "igloo-upload-prevew-not-supported-text",
|
|
97
94
|
children: formatMessage({
|
|
98
95
|
id: 'No preview for this file. Only support image, video or PDF file.'
|
|
99
96
|
})
|
|
100
|
-
}
|
|
101
|
-
}
|
|
97
|
+
}, void 0)]
|
|
98
|
+
}, void 0);
|
|
102
99
|
|
|
103
100
|
if (type === 'image') {
|
|
104
101
|
children = (0, _jsxRuntime.jsx)("img", {
|
|
@@ -122,11 +119,10 @@ var Media = function Media(_ref3) {
|
|
|
122
119
|
}, void 0);
|
|
123
120
|
}
|
|
124
121
|
|
|
125
|
-
return (0, _jsxRuntime.jsx)("div",
|
|
126
|
-
className: (0, _classnames.default)('igloo-upload-preview-container', className)
|
|
127
|
-
}, {
|
|
122
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
123
|
+
className: (0, _classnames.default)('igloo-upload-preview-container', className),
|
|
128
124
|
children: children
|
|
129
|
-
}
|
|
125
|
+
}, void 0);
|
|
130
126
|
};
|
|
131
127
|
|
|
132
128
|
var _default = Media;
|
package/lib/utils/form-utils.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.testAssert = exports.calcShouldRender = exports.calcSelectValue = exports.calcNamePath = exports.calcFormItemProps = exports.calcDisabled = exports.calcCopyValue = void 0;
|
|
7
7
|
|
|
8
8
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
9
|
|
|
@@ -225,40 +225,33 @@ var calcFormItemProps = function calcFormItemProps(config, extraProps, form, par
|
|
|
225
225
|
normalize: normalize || extraNormalize,
|
|
226
226
|
rules: rules,
|
|
227
227
|
validateTrigger: _toConsumableArray(new Set(validateTriggers)),
|
|
228
|
-
label: label ? (0, _jsxRuntime.jsxs)("div",
|
|
229
|
-
className: "igloo-form-label"
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
children: [(0, _jsxRuntime.jsx)(_typography.default, Object.assign({
|
|
235
|
-
level: "body1"
|
|
236
|
-
}, {
|
|
228
|
+
label: label ? (0, _jsxRuntime.jsxs)("div", {
|
|
229
|
+
className: "igloo-form-label",
|
|
230
|
+
children: [(0, _jsxRuntime.jsxs)("div", {
|
|
231
|
+
className: "igloo-form-label-text",
|
|
232
|
+
children: [(0, _jsxRuntime.jsx)(_typography.default, {
|
|
233
|
+
level: "body1",
|
|
237
234
|
children: label
|
|
238
|
-
}
|
|
239
|
-
className: "igloo-form-label-required"
|
|
240
|
-
}, {
|
|
235
|
+
}, void 0), isRequired && requiredMark && (0, _jsxRuntime.jsx)("span", {
|
|
236
|
+
className: "igloo-form-label-required",
|
|
241
237
|
children: "*"
|
|
242
|
-
}
|
|
243
|
-
className: "igloo-form-label-optional"
|
|
244
|
-
}, {
|
|
238
|
+
}, void 0), showOptional && (0, _jsxRuntime.jsxs)("span", {
|
|
239
|
+
className: "igloo-form-label-optional",
|
|
245
240
|
children: ["(", (0, _formattedMessage.default)({
|
|
246
241
|
id: 'Optional'
|
|
247
242
|
}), ")"]
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
className: "igloo-form-label-extra"
|
|
251
|
-
}, {
|
|
243
|
+
}, void 0)]
|
|
244
|
+
}, void 0), extraLabel && (0, _jsxRuntime.jsx)("div", {
|
|
245
|
+
className: "igloo-form-label-extra",
|
|
252
246
|
children: typeof extraLabel === 'function' ? extraLabel(form) : extraLabel
|
|
253
|
-
}
|
|
254
|
-
}
|
|
247
|
+
}, void 0)]
|
|
248
|
+
}, void 0) : null,
|
|
255
249
|
getValueFromEvent: getValueFromEvent || extraGetValueFromEvent,
|
|
256
250
|
getValueProps: getValueProps,
|
|
257
|
-
extra: (extra || extraExtra) && (0, _jsxRuntime.jsx)(_typography.default,
|
|
258
|
-
level: "caption2"
|
|
259
|
-
}, {
|
|
251
|
+
extra: (extra || extraExtra) && (0, _jsxRuntime.jsx)(_typography.default, {
|
|
252
|
+
level: "caption2",
|
|
260
253
|
children: extra || extraExtra
|
|
261
|
-
}
|
|
254
|
+
}, void 0),
|
|
262
255
|
help: help || extraHelp,
|
|
263
256
|
valuePropName: valuePropName || extraValuePropName,
|
|
264
257
|
messageVariables: _objectSpread({
|