iglooform 2.4.8 → 2.4.12
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.d.ts +2 -0
- package/es/admin-upload/index.js +43 -36
- package/es/admin-upload/job-list.js +85 -115
- 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 +23 -28
- package/es/button/style/index.less +23 -19
- package/es/card-detail/card-group.js +16 -22
- package/es/card-detail/card-item.js +16 -21
- package/es/card-detail/card-page.js +11 -15
- package/es/card-detail/card.js +24 -24
- package/es/card-detail/utils.js +6 -7
- package/es/checkbox/index.js +23 -22
- package/es/claim-list/index.js +53 -70
- package/es/confirmation/index.js +7 -9
- package/es/date-picker/buddhist.js +3 -3
- 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 +9 -11
- package/es/filter/checkBox.js +33 -45
- package/es/filter/customize.js +3 -4
- package/es/filter/index.d.ts +1 -0
- package/es/filter/index.js +88 -112
- package/es/filter/radioBox.js +23 -31
- package/es/filter/rangePicker.js +43 -59
- package/es/form/addable-section/index.d.ts +19 -0
- package/es/form/addable-section/index.js +211 -0
- package/es/form/addable-section/style/index.d.ts +1 -0
- package/es/form/addable-section/style/index.js +1 -0
- package/es/form/addable-section/style/index.less +22 -0
- package/es/form/divider/index.js +7 -1
- package/es/form/element/index.js +58 -47
- package/es/form/element/style/index.less +9 -0
- package/es/form/index.js +16 -17
- package/es/form/login/index.js +15 -20
- package/es/form/page/index.js +18 -24
- package/es/form/page/style/index.less +1 -1
- package/es/form/pages/index.js +23 -32
- package/es/form/pages/style/index.less +3 -1
- package/es/form/render/index.js +1 -1
- package/es/form/section/index.js +14 -17
- package/es/form/step/index.js +31 -42
- package/es/form/steps/index.js +8 -11
- package/es/{form/context.d.ts → form-context.d.ts} +1 -0
- package/es/{form/context.js → form-context.js} +0 -0
- package/es/free-form/addable-section/index.d.ts +18 -0
- package/es/free-form/addable-section/index.js +286 -0
- package/es/free-form/addable-section/style/index.d.ts +1 -0
- package/es/free-form/addable-section/style/index.js +1 -0
- package/es/free-form/addable-section/style/index.less +22 -0
- package/es/free-form/element/index.js +43 -41
- package/es/free-form/element/style/index.less +12 -2
- package/es/free-form/index.d.ts +5 -1
- package/es/free-form/index.js +17 -17
- package/es/free-form/page/index.js +36 -46
- package/es/free-form/page/style/index.less +3 -1
- package/es/free-form/pages/index.js +8 -10
- package/es/free-form/section/index.js +20 -22
- package/es/free-form/section/style/index.less +4 -0
- package/es/free-form/step/index.js +37 -47
- package/es/free-form/steps/index.js +8 -10
- package/es/global-message/index.js +1 -1
- package/es/home-menu/index.js +52 -71
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- 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 +14 -18
- 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/style/index.less +9 -1
- 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 +51 -60
- package/es/layout/index.js +16 -12
- package/es/locale/en-US/messages.json +2 -0
- package/es/locale/id-ID/messages.json +2 -0
- package/es/locale/locale-provider.js +8 -10
- package/es/locale/th-TH/messages.json +2 -0
- package/es/locale/vi-VN/messages.json +2 -0
- package/es/locale/zh-CN/messages.json +2 -0
- 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 +8 -10
- package/es/mobile-insurer-detail/index.js +74 -91
- package/es/mobile-insurer-list/index.js +34 -38
- package/es/modal/index.d.ts +4 -3
- package/es/modal/index.js +25 -27
- package/es/modal/style/index.less +24 -5
- package/es/platform/platform-card/index.js +9 -12
- package/es/platform/switch-platform/index.js +24 -32
- package/es/policy-list/index.js +11 -14
- 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/style/index.less +1 -1
- package/es/select/time-select.js +12 -16
- package/es/status-box/index.js +8 -10
- package/es/table/index.js +72 -96
- package/es/tabs/index.js +7 -1
- package/es/types.d.ts +4 -2
- package/es/typography/index.js +6 -8
- package/es/upload/index.d.ts +2 -1
- package/es/upload/index.js +169 -143
- package/es/upload-photo/index.d.ts +2 -1
- package/es/upload-photo/index.js +170 -142
- 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 +49 -36
- package/lib/admin-upload/float.js +25 -35
- package/lib/admin-upload/index.d.ts +2 -0
- package/lib/admin-upload/index.js +43 -36
- package/lib/admin-upload/job-list.js +85 -115
- 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 +24 -29
- package/lib/button/style/index.less +23 -19
- package/lib/card-detail/card-group.js +16 -22
- package/lib/card-detail/card-item.js +16 -21
- 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 +7 -8
- package/lib/checkbox/index.js +24 -23
- package/lib/claim-list/index.js +53 -70
- package/lib/confirmation/index.js +7 -9
- package/lib/date-picker/buddhist.js +3 -3
- 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 +10 -12
- package/lib/filter/checkBox.js +33 -45
- package/lib/filter/customize.js +3 -4
- package/lib/filter/index.d.ts +1 -0
- package/lib/filter/index.js +88 -112
- package/lib/filter/radioBox.js +23 -31
- package/lib/filter/rangePicker.js +43 -59
- package/lib/form/addable-section/index.d.ts +19 -0
- package/lib/form/addable-section/index.js +232 -0
- package/lib/form/addable-section/style/index.d.ts +1 -0
- package/lib/form/addable-section/style/index.js +3 -0
- package/lib/form/addable-section/style/index.less +22 -0
- package/lib/form/divider/index.js +7 -1
- package/lib/form/element/index.js +60 -48
- package/lib/form/element/style/index.less +9 -0
- package/lib/form/elements.js +1 -1
- package/lib/form/index.js +16 -17
- package/lib/form/login/index.js +16 -21
- package/lib/form/page/index.js +19 -25
- package/lib/form/page/style/index.less +1 -1
- package/lib/form/pages/index.js +24 -33
- package/lib/form/pages/style/index.less +3 -1
- package/lib/form/render/index.js +2 -2
- package/lib/form/section/index.js +15 -18
- package/lib/form/step/index.js +32 -43
- package/lib/form/steps/index.js +9 -12
- package/lib/{form/context.d.ts → form-context.d.ts} +1 -0
- package/lib/{form/context.js → form-context.js} +0 -0
- package/lib/free-form/addable-section/index.d.ts +18 -0
- package/lib/free-form/addable-section/index.js +306 -0
- package/lib/free-form/addable-section/style/index.d.ts +1 -0
- package/lib/free-form/addable-section/style/index.js +3 -0
- package/lib/free-form/addable-section/style/index.less +22 -0
- package/lib/free-form/element/index.js +44 -42
- package/lib/free-form/element/style/index.less +12 -2
- package/lib/free-form/index.d.ts +5 -1
- package/lib/free-form/index.js +17 -17
- package/lib/free-form/page/index.js +37 -47
- package/lib/free-form/page/style/index.less +3 -1
- package/lib/free-form/pages/index.js +8 -10
- package/lib/free-form/section/index.js +21 -23
- package/lib/free-form/section/style/index.less +4 -0
- package/lib/free-form/step/index.js +38 -48
- package/lib/free-form/steps/index.js +9 -11
- package/lib/global-message/index.js +1 -1
- package/lib/home-menu/index.js +52 -71
- package/lib/index.d.ts +1 -0
- package/lib/index.js +141 -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 +14 -18
- 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/style/index.less +9 -1
- 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 +51 -60
- package/lib/layout/index.js +15 -12
- package/lib/locale/en-US/messages.json +2 -0
- package/lib/locale/format-message.js +1 -1
- package/lib/locale/id-ID/messages.json +2 -0
- package/lib/locale/index.js +4 -4
- package/lib/locale/locale-provider.js +9 -11
- package/lib/locale/th-TH/messages.json +2 -0
- package/lib/locale/vi-VN/messages.json +2 -0
- package/lib/locale/zh-CN/messages.json +2 -0
- 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 +8 -10
- package/lib/mobile-insurer-detail/index.js +74 -91
- package/lib/mobile-insurer-list/index.js +34 -38
- package/lib/modal/index.d.ts +4 -3
- package/lib/modal/index.js +25 -27
- package/lib/modal/style/index.less +24 -5
- package/lib/platform/platform-card/index.js +9 -12
- package/lib/platform/switch-platform/index.js +24 -32
- package/lib/policy-list/index.js +11 -14
- 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/style/index.less +1 -1
- package/lib/select/time-select.js +12 -16
- package/lib/status-box/index.js +8 -10
- package/lib/table/index.js +72 -96
- package/lib/tabs/index.js +8 -2
- package/lib/types.d.ts +4 -2
- package/lib/typography/index.js +6 -8
- package/lib/upload/index.d.ts +2 -1
- package/lib/upload/index.js +170 -143
- package/lib/upload-photo/index.d.ts +2 -1
- package/lib/upload-photo/index.js +171 -142
- 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 +49 -37
- package/package.json +1 -1
- package/es/free-form/context.d.ts +0 -19
- package/es/free-form/context.js +0 -7
- package/lib/free-form/context.d.ts +0 -19
- package/lib/free-form/context.js +0 -19
|
@@ -53,13 +53,15 @@ var _tools = require("../utils/tools");
|
|
|
53
53
|
|
|
54
54
|
var _media2 = _interopRequireDefault(require("./media"));
|
|
55
55
|
|
|
56
|
+
var _formContext = _interopRequireDefault(require("../form-context"));
|
|
57
|
+
|
|
56
58
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
57
59
|
|
|
58
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
60
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
59
61
|
|
|
60
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
62
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
61
63
|
|
|
62
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
64
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
63
65
|
|
|
64
66
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
65
67
|
|
|
@@ -71,10 +73,6 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
|
|
|
71
73
|
|
|
72
74
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
73
75
|
|
|
74
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
75
|
-
|
|
76
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
77
|
-
|
|
78
76
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
79
77
|
|
|
80
78
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -89,31 +87,79 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
89
87
|
|
|
90
88
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
91
89
|
|
|
90
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
91
|
+
|
|
92
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
93
|
+
|
|
92
94
|
var useBreakpoint = _grid.default.useBreakpoint;
|
|
93
95
|
var prefix = 'igloo-upload-photo';
|
|
94
96
|
|
|
95
|
-
var UploadPhoto = function UploadPhoto(
|
|
97
|
+
var UploadPhoto = function UploadPhoto(props) {
|
|
96
98
|
var _classnames3, _classnames4;
|
|
97
99
|
|
|
98
|
-
var _ref$value = _ref.value,
|
|
99
|
-
value = _ref$value === void 0 ? [] : _ref$value,
|
|
100
|
-
limit = _ref.limit,
|
|
101
|
-
limitErrorMessage = _ref.limitErrorMessage,
|
|
102
|
-
descriptions = _ref.descriptions,
|
|
103
|
-
buttonText = _ref.buttonText,
|
|
104
|
-
_ref$samples = _ref.samples,
|
|
105
|
-
samples = _ref$samples === void 0 ? [] : _ref$samples,
|
|
106
|
-
onChange = _ref.onChange,
|
|
107
|
-
handleUpload = _ref.handleUpload,
|
|
108
|
-
setFieldError = _ref.setFieldError,
|
|
109
|
-
className = _ref.className,
|
|
110
|
-
id = _ref.id,
|
|
111
|
-
validateField = _ref.validateField;
|
|
112
100
|
var limitNumError = (0, _react.useRef)();
|
|
113
101
|
var DomRef = (0, _react.useRef)();
|
|
114
102
|
|
|
115
|
-
var _useContext = (0, _react.useContext)(
|
|
116
|
-
|
|
103
|
+
var _useContext = (0, _react.useContext)(_formContext.default),
|
|
104
|
+
uploadApi = _useContext.uploadApi;
|
|
105
|
+
|
|
106
|
+
(0, _invariant.default)(typeof props.handleUpload === 'function' || uploadApi, '"handleUpload" should be a function. Or uploadApi should be set at Form/FreeForm');
|
|
107
|
+
(0, _invariant.default)(!uploadApi || props.bizKey, '"bizKey" should be set if Upload is used with uploadApi');
|
|
108
|
+
var _props$value = props.value,
|
|
109
|
+
value = _props$value === void 0 ? [] : _props$value,
|
|
110
|
+
limit = props.limit,
|
|
111
|
+
limitErrorMessage = props.limitErrorMessage,
|
|
112
|
+
descriptions = props.descriptions,
|
|
113
|
+
buttonText = props.buttonText,
|
|
114
|
+
_props$samples = props.samples,
|
|
115
|
+
samples = _props$samples === void 0 ? [] : _props$samples,
|
|
116
|
+
onChange = props.onChange,
|
|
117
|
+
bizKey = props.bizKey,
|
|
118
|
+
_props$handleUpload = props.handleUpload,
|
|
119
|
+
handleUpload = _props$handleUpload === void 0 ? /*#__PURE__*/function () {
|
|
120
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(file) {
|
|
121
|
+
var formData, response, rst;
|
|
122
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
123
|
+
while (1) {
|
|
124
|
+
switch (_context.prev = _context.next) {
|
|
125
|
+
case 0:
|
|
126
|
+
formData = new FormData();
|
|
127
|
+
formData.append('file', file);
|
|
128
|
+
formData.append('biz_key', bizKey);
|
|
129
|
+
_context.next = 5;
|
|
130
|
+
return fetch(uploadApi, {
|
|
131
|
+
method: 'post',
|
|
132
|
+
body: formData
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
case 5:
|
|
136
|
+
response = _context.sent;
|
|
137
|
+
_context.next = 8;
|
|
138
|
+
return response.json();
|
|
139
|
+
|
|
140
|
+
case 8:
|
|
141
|
+
rst = _context.sent;
|
|
142
|
+
return _context.abrupt("return", rst.url);
|
|
143
|
+
|
|
144
|
+
case 10:
|
|
145
|
+
case "end":
|
|
146
|
+
return _context.stop();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}, _callee);
|
|
150
|
+
}));
|
|
151
|
+
|
|
152
|
+
return function (_x) {
|
|
153
|
+
return _ref.apply(this, arguments);
|
|
154
|
+
};
|
|
155
|
+
}() : _props$handleUpload,
|
|
156
|
+
setFieldError = props.setFieldError,
|
|
157
|
+
className = props.className,
|
|
158
|
+
id = props.id,
|
|
159
|
+
validateField = props.validateField;
|
|
160
|
+
|
|
161
|
+
var _useContext2 = (0, _react.useContext)(_locale.LocaleContext),
|
|
162
|
+
formatMessage = _useContext2.formatMessage;
|
|
117
163
|
|
|
118
164
|
var _useState = (0, _react.useState)((0, _agentDetect.isMobileAgent)()),
|
|
119
165
|
_useState2 = _slicedToArray(_useState, 1),
|
|
@@ -156,7 +202,7 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
156
202
|
}, []);
|
|
157
203
|
(0, _react.useEffect)(function () {
|
|
158
204
|
var removeLimitMsg = function removeLimitMsg(e) {
|
|
159
|
-
if (!DomRef.current.contains(e.target) && limitNumError.current) {
|
|
205
|
+
if (DomRef.current && !DomRef.current.contains(e.target) && limitNumError.current) {
|
|
160
206
|
limitNumError.current = undefined;
|
|
161
207
|
|
|
162
208
|
if (files && files.length) {
|
|
@@ -197,7 +243,6 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
197
243
|
sampleSpan = _useMemo.sampleSpan,
|
|
198
244
|
descriptionSpan = _useMemo.descriptionSpan;
|
|
199
245
|
|
|
200
|
-
(0, _invariant.default)(typeof handleUpload === 'function', '"handleUpload" should be a function.');
|
|
201
246
|
(0, _invariant.default)(limit === undefined || limit > 0, "\"limit\" should be a pasitive number.");
|
|
202
247
|
|
|
203
248
|
var onUpload = function onUpload(e) {
|
|
@@ -220,12 +265,12 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
220
265
|
};
|
|
221
266
|
|
|
222
267
|
var uploadFile = /*#__PURE__*/function () {
|
|
223
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
268
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(file, currentIndex) {
|
|
224
269
|
var uid, dataUrl, name, size, mimeType, type, errorMsg, _errorMsg;
|
|
225
270
|
|
|
226
|
-
return regeneratorRuntime.wrap(function
|
|
271
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
227
272
|
while (1) {
|
|
228
|
-
switch (
|
|
273
|
+
switch (_context2.prev = _context2.next) {
|
|
229
274
|
case 0:
|
|
230
275
|
uid = ++uploadIndex.current;
|
|
231
276
|
dataUrl = URL.createObjectURL(file);
|
|
@@ -233,7 +278,7 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
233
278
|
type = (0, _tools.classifyType)(mimeType);
|
|
234
279
|
|
|
235
280
|
if (!(type === 'unknown')) {
|
|
236
|
-
|
|
281
|
+
_context2.next = 9;
|
|
237
282
|
break;
|
|
238
283
|
}
|
|
239
284
|
|
|
@@ -242,11 +287,11 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
242
287
|
});
|
|
243
288
|
limitNumError.current = errorMsg;
|
|
244
289
|
setFieldError && setFieldError(errorMsg);
|
|
245
|
-
return
|
|
290
|
+
return _context2.abrupt("return", Promise.reject(errorMsg));
|
|
246
291
|
|
|
247
292
|
case 9:
|
|
248
293
|
if (!(limit && currentIndex > limit)) {
|
|
249
|
-
|
|
294
|
+
_context2.next = 14;
|
|
250
295
|
break;
|
|
251
296
|
}
|
|
252
297
|
|
|
@@ -258,7 +303,7 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
258
303
|
});
|
|
259
304
|
limitNumError.current = _errorMsg;
|
|
260
305
|
setFieldError && setFieldError(_errorMsg);
|
|
261
|
-
return
|
|
306
|
+
return _context2.abrupt("return", Promise.reject(_errorMsg));
|
|
262
307
|
|
|
263
308
|
case 14:
|
|
264
309
|
limitNumError.current = undefined;
|
|
@@ -273,7 +318,7 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
273
318
|
uid: uid
|
|
274
319
|
}]);
|
|
275
320
|
});
|
|
276
|
-
return
|
|
321
|
+
return _context2.abrupt("return", handleUploadPromise(file, function (url) {
|
|
277
322
|
var urls = [];
|
|
278
323
|
setFiles(function (files) {
|
|
279
324
|
return files.map(function (f) {
|
|
@@ -336,63 +381,63 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
336
381
|
|
|
337
382
|
case 17:
|
|
338
383
|
case "end":
|
|
339
|
-
return
|
|
384
|
+
return _context2.stop();
|
|
340
385
|
}
|
|
341
386
|
}
|
|
342
|
-
},
|
|
387
|
+
}, _callee2);
|
|
343
388
|
}));
|
|
344
389
|
|
|
345
|
-
return function uploadFile(
|
|
390
|
+
return function uploadFile(_x2, _x3) {
|
|
346
391
|
return _ref3.apply(this, arguments);
|
|
347
392
|
};
|
|
348
393
|
}();
|
|
349
394
|
|
|
350
395
|
var handleUploadPromise = /*#__PURE__*/function () {
|
|
351
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
396
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(file, onSuccess, onFailed) {
|
|
352
397
|
var rst, errorMsg;
|
|
353
|
-
return regeneratorRuntime.wrap(function
|
|
398
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
354
399
|
while (1) {
|
|
355
|
-
switch (
|
|
400
|
+
switch (_context3.prev = _context3.next) {
|
|
356
401
|
case 0:
|
|
357
|
-
|
|
358
|
-
|
|
402
|
+
_context3.prev = 0;
|
|
403
|
+
_context3.next = 3;
|
|
359
404
|
return handleUpload(file);
|
|
360
405
|
|
|
361
406
|
case 3:
|
|
362
|
-
rst =
|
|
407
|
+
rst = _context3.sent;
|
|
363
408
|
onSuccess(rst);
|
|
364
|
-
return
|
|
409
|
+
return _context3.abrupt("return", Promise.resolve(rst));
|
|
365
410
|
|
|
366
411
|
case 8:
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
errorMsg = _typeof(
|
|
412
|
+
_context3.prev = 8;
|
|
413
|
+
_context3.t0 = _context3["catch"](0);
|
|
414
|
+
errorMsg = _typeof(_context3.t0) === 'object' ? _context3.t0.message : _context3.t0;
|
|
370
415
|
onFailed(errorMsg);
|
|
371
|
-
return
|
|
416
|
+
return _context3.abrupt("return", Promise.reject(errorMsg));
|
|
372
417
|
|
|
373
418
|
case 13:
|
|
374
419
|
case "end":
|
|
375
|
-
return
|
|
420
|
+
return _context3.stop();
|
|
376
421
|
}
|
|
377
422
|
}
|
|
378
|
-
},
|
|
423
|
+
}, _callee3, null, [[0, 8]]);
|
|
379
424
|
}));
|
|
380
425
|
|
|
381
|
-
return function handleUploadPromise(
|
|
426
|
+
return function handleUploadPromise(_x4, _x5, _x6) {
|
|
382
427
|
return _ref4.apply(this, arguments);
|
|
383
428
|
};
|
|
384
429
|
}();
|
|
385
430
|
|
|
386
431
|
var handleDelete = /*#__PURE__*/function () {
|
|
387
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
432
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(index) {
|
|
388
433
|
var arr, hasError, rst;
|
|
389
|
-
return regeneratorRuntime.wrap(function
|
|
434
|
+
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
390
435
|
while (1) {
|
|
391
|
-
switch (
|
|
436
|
+
switch (_context4.prev = _context4.next) {
|
|
392
437
|
case 0:
|
|
393
438
|
limitNumError.current = null;
|
|
394
439
|
arr = files;
|
|
395
|
-
|
|
440
|
+
_context4.next = 4;
|
|
396
441
|
return setFiles(function (files) {
|
|
397
442
|
var newArr = files.filter(function (_, i) {
|
|
398
443
|
return i !== index;
|
|
@@ -402,7 +447,7 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
402
447
|
});
|
|
403
448
|
|
|
404
449
|
case 4:
|
|
405
|
-
|
|
450
|
+
_context4.next = 6;
|
|
406
451
|
return setMasks(function (masks) {
|
|
407
452
|
return masks.filter(function (_, i) {
|
|
408
453
|
return i !== index;
|
|
@@ -416,7 +461,7 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
416
461
|
});
|
|
417
462
|
|
|
418
463
|
if (!hasError) {
|
|
419
|
-
|
|
464
|
+
_context4.next = 10;
|
|
420
465
|
break;
|
|
421
466
|
}
|
|
422
467
|
|
|
@@ -429,7 +474,7 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
429
474
|
|
|
430
475
|
return f.url;
|
|
431
476
|
});
|
|
432
|
-
return
|
|
477
|
+
return _context4.abrupt("return", typeof onChange === 'function' && onChange(rst));
|
|
433
478
|
|
|
434
479
|
case 10:
|
|
435
480
|
typeof onChange === 'function' && onChange(arr.map(function (_ref6) {
|
|
@@ -439,36 +484,36 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
439
484
|
|
|
440
485
|
case 11:
|
|
441
486
|
case "end":
|
|
442
|
-
return
|
|
487
|
+
return _context4.stop();
|
|
443
488
|
}
|
|
444
489
|
}
|
|
445
|
-
},
|
|
490
|
+
}, _callee4);
|
|
446
491
|
}));
|
|
447
492
|
|
|
448
|
-
return function handleDelete(
|
|
493
|
+
return function handleDelete(_x7) {
|
|
449
494
|
return _ref5.apply(this, arguments);
|
|
450
495
|
};
|
|
451
496
|
}();
|
|
452
497
|
|
|
453
498
|
var handleReUpload = /*#__PURE__*/function () {
|
|
454
|
-
var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
499
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(index) {
|
|
455
500
|
var _files$index, originFile, reUpUid, rst, latestFiles, fileListWithError, newList, _rst;
|
|
456
501
|
|
|
457
|
-
return regeneratorRuntime.wrap(function
|
|
502
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
458
503
|
while (1) {
|
|
459
|
-
switch (
|
|
504
|
+
switch (_context5.prev = _context5.next) {
|
|
460
505
|
case 0:
|
|
461
506
|
_files$index = files[index], originFile = _files$index.originFile, reUpUid = _files$index.uid;
|
|
462
507
|
|
|
463
508
|
if (originFile) {
|
|
464
|
-
|
|
509
|
+
_context5.next = 3;
|
|
465
510
|
break;
|
|
466
511
|
}
|
|
467
512
|
|
|
468
|
-
return
|
|
513
|
+
return _context5.abrupt("return");
|
|
469
514
|
|
|
470
515
|
case 3:
|
|
471
|
-
|
|
516
|
+
_context5.next = 5;
|
|
472
517
|
return setFiles(function (files) {
|
|
473
518
|
var newFiles = _toConsumableArray(files);
|
|
474
519
|
|
|
@@ -477,14 +522,14 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
477
522
|
});
|
|
478
523
|
|
|
479
524
|
case 5:
|
|
480
|
-
|
|
481
|
-
|
|
525
|
+
_context5.prev = 5;
|
|
526
|
+
_context5.next = 8;
|
|
482
527
|
return handleUpload(originFile);
|
|
483
528
|
|
|
484
529
|
case 8:
|
|
485
|
-
rst =
|
|
530
|
+
rst = _context5.sent;
|
|
486
531
|
latestFiles = [];
|
|
487
|
-
|
|
532
|
+
_context5.next = 12;
|
|
488
533
|
return setFiles(function (files) {
|
|
489
534
|
var newFiles = _toConsumableArray(files);
|
|
490
535
|
|
|
@@ -512,19 +557,19 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
512
557
|
return url;
|
|
513
558
|
});
|
|
514
559
|
onChange && onChange(fileListWithError);
|
|
515
|
-
|
|
560
|
+
_context5.next = 23;
|
|
516
561
|
break;
|
|
517
562
|
|
|
518
563
|
case 16:
|
|
519
|
-
|
|
520
|
-
|
|
564
|
+
_context5.prev = 16;
|
|
565
|
+
_context5.t0 = _context5["catch"](5);
|
|
521
566
|
newList = [];
|
|
522
|
-
|
|
567
|
+
_context5.next = 21;
|
|
523
568
|
return setFiles(function (files) {
|
|
524
569
|
var newFiles = _toConsumableArray(files);
|
|
525
570
|
|
|
526
571
|
newFiles[index].status = 'failed';
|
|
527
|
-
newFiles[index].errorMsg =
|
|
572
|
+
newFiles[index].errorMsg = _context5.t0;
|
|
528
573
|
newList = newFiles;
|
|
529
574
|
return newFiles;
|
|
530
575
|
});
|
|
@@ -555,13 +600,13 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
555
600
|
|
|
556
601
|
case 24:
|
|
557
602
|
case "end":
|
|
558
|
-
return
|
|
603
|
+
return _context5.stop();
|
|
559
604
|
}
|
|
560
605
|
}
|
|
561
|
-
},
|
|
606
|
+
}, _callee5, null, [[5, 16]]);
|
|
562
607
|
}));
|
|
563
608
|
|
|
564
|
-
return function handleReUpload(
|
|
609
|
+
return function handleReUpload(_x8) {
|
|
565
610
|
return _ref7.apply(this, arguments);
|
|
566
611
|
};
|
|
567
612
|
}();
|
|
@@ -647,55 +692,47 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
647
692
|
}, void 0);
|
|
648
693
|
};
|
|
649
694
|
|
|
650
|
-
return (0, _jsxRuntime.jsxs)("div",
|
|
695
|
+
return (0, _jsxRuntime.jsxs)("div", {
|
|
651
696
|
className: (0, _classnames6.default)(prefix, className),
|
|
652
697
|
id: id,
|
|
653
|
-
ref: DomRef
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
}, {
|
|
658
|
-
children: (0, _jsxRuntime.jsxs)(_row.default, Object.assign({
|
|
698
|
+
ref: DomRef,
|
|
699
|
+
children: [Boolean(descriptions || samples.length) && (0, _jsxRuntime.jsx)("div", {
|
|
700
|
+
className: "".concat(prefix, "-sample"),
|
|
701
|
+
children: (0, _jsxRuntime.jsxs)(_row.default, {
|
|
659
702
|
gutter: [isMobile ? 16 : 32, 16],
|
|
660
|
-
wrap: true
|
|
661
|
-
}, {
|
|
703
|
+
wrap: true,
|
|
662
704
|
children: [Boolean(samples === null || samples === void 0 ? void 0 : samples.length) && samples.map(function (_ref8, index) {
|
|
663
705
|
var _classnames, _classnames2;
|
|
664
706
|
|
|
665
707
|
var src = _ref8.src,
|
|
666
708
|
label = _ref8.label,
|
|
667
709
|
type = _ref8.type;
|
|
668
|
-
return (0, _jsxRuntime.jsxs)(_col.default,
|
|
669
|
-
span: sampleSpan
|
|
670
|
-
}, {
|
|
710
|
+
return (0, _jsxRuntime.jsxs)(_col.default, {
|
|
711
|
+
span: sampleSpan,
|
|
671
712
|
children: [(0, _jsxRuntime.jsx)("img", {
|
|
672
713
|
src: src,
|
|
673
714
|
alt: "",
|
|
674
715
|
className: "".concat(prefix, "-sample-photos-photo")
|
|
675
716
|
}, void 0), (0, _jsxRuntime.jsx)("div", {
|
|
676
717
|
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
|
-
}, {
|
|
718
|
+
}, void 0), label && (0, _jsxRuntime.jsx)("div", {
|
|
719
|
+
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)),
|
|
720
|
+
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
721
|
+
level: "body2",
|
|
683
722
|
children: label
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
}), (0, _jsxRuntime.jsx)(_col.default,
|
|
723
|
+
}, void 0)
|
|
724
|
+
}, void 0)]
|
|
725
|
+
}, index);
|
|
726
|
+
}), (0, _jsxRuntime.jsx)(_col.default, {
|
|
688
727
|
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
|
-
}, {
|
|
728
|
+
span: descriptionSpan,
|
|
729
|
+
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
730
|
+
level: "caption2",
|
|
694
731
|
children: descriptions
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
}
|
|
732
|
+
}, void 0)
|
|
733
|
+
}, void 0)]
|
|
734
|
+
}, void 0)
|
|
735
|
+
}, void 0), (0, _jsxRuntime.jsx)("input", {
|
|
699
736
|
id: uploadId,
|
|
700
737
|
type: "file",
|
|
701
738
|
style: {
|
|
@@ -706,44 +743,39 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
706
743
|
value: [],
|
|
707
744
|
multiple: true,
|
|
708
745
|
capture: true
|
|
709
|
-
}, void 0), (0, _jsxRuntime.jsxs)(_space.default,
|
|
746
|
+
}, void 0), (0, _jsxRuntime.jsxs)(_space.default, {
|
|
710
747
|
className: "".concat(prefix, "-content"),
|
|
711
748
|
size: [16, 16],
|
|
712
|
-
wrap: true
|
|
713
|
-
|
|
714
|
-
children: [(0, _jsxRuntime.jsxs)("label", Object.assign({
|
|
749
|
+
wrap: true,
|
|
750
|
+
children: [(0, _jsxRuntime.jsxs)("label", {
|
|
715
751
|
htmlFor: uploadId,
|
|
716
752
|
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
753
|
return typeof file !== 'string' && file.status === 'failed';
|
|
718
|
-
})), _classnames4))
|
|
719
|
-
}, {
|
|
754
|
+
})), _classnames4)),
|
|
720
755
|
children: [(0, _jsxRuntime.jsx)(_iglooicon.UploadOutlined, {
|
|
721
756
|
style: {
|
|
722
757
|
fontSize: 24,
|
|
723
758
|
color: '#666666'
|
|
724
759
|
}
|
|
725
|
-
}, void 0), (0, _jsxRuntime.jsx)("span",
|
|
760
|
+
}, void 0), (0, _jsxRuntime.jsx)("span", {
|
|
726
761
|
style: {
|
|
727
762
|
marginTop: 6
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
level: "body1"
|
|
732
|
-
}, {
|
|
763
|
+
},
|
|
764
|
+
children: (0, _jsxRuntime.jsx)(_typography.default, {
|
|
765
|
+
level: "body1",
|
|
733
766
|
children: buttonText || 'Upload'
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
}
|
|
767
|
+
}, void 0)
|
|
768
|
+
}, void 0)]
|
|
769
|
+
}, void 0), files.map(function (_ref9, index) {
|
|
737
770
|
var _classnames5;
|
|
738
771
|
|
|
739
772
|
var dataUrl = _ref9.dataUrl,
|
|
740
773
|
status = _ref9.status,
|
|
741
774
|
type = _ref9.type,
|
|
742
775
|
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({
|
|
776
|
+
return (0, _jsxRuntime.jsx)(_badge.default, {
|
|
777
|
+
count: getBadge(status, index, limit),
|
|
778
|
+
children: (0, _jsxRuntime.jsxs)("div", {
|
|
747
779
|
className: (0, _classnames6.default)((_classnames5 = {}, _defineProperty(_classnames5, "".concat(prefix, "-content-container"), true), _defineProperty(_classnames5, "".concat(prefix, "-content-error"), status === 'failed'), _classnames5)),
|
|
748
780
|
onMouseEnter: function onMouseEnter() {
|
|
749
781
|
return handleMouseEnter(index);
|
|
@@ -754,44 +786,41 @@ var UploadPhoto = function UploadPhoto(_ref) {
|
|
|
754
786
|
onClick: function onClick(e) {
|
|
755
787
|
e.stopPropagation();
|
|
756
788
|
handleTouchEnd(index);
|
|
757
|
-
}
|
|
758
|
-
}, {
|
|
789
|
+
},
|
|
759
790
|
children: [(0, _jsxRuntime.jsx)(_media2.default, {
|
|
760
791
|
type: type,
|
|
761
792
|
src: dataUrl,
|
|
762
793
|
className: "".concat(prefix, "-content-preview")
|
|
763
794
|
}, void 0), (!limit || index < limit) && masks[index] && (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
764
|
-
children: [status === 'failed' && (0, _jsxRuntime.jsx)("div",
|
|
795
|
+
children: [status === 'failed' && (0, _jsxRuntime.jsx)("div", {
|
|
765
796
|
className: "".concat(prefix, "-content-mask"),
|
|
766
797
|
onClick: function onClick(e) {
|
|
767
798
|
e.stopPropagation();
|
|
768
799
|
handleReUpload(index);
|
|
769
|
-
}
|
|
770
|
-
}, {
|
|
800
|
+
},
|
|
771
801
|
children: (0, _jsxRuntime.jsx)(_iglooicon.RefreshOutlined, {
|
|
772
802
|
style: {
|
|
773
803
|
fontSize: 24
|
|
774
804
|
}
|
|
775
805
|
}, void 0)
|
|
776
|
-
}
|
|
806
|
+
}, void 0), status === 'success' && (0, _jsxRuntime.jsx)("div", {
|
|
777
807
|
className: "".concat(prefix, "-content-mask"),
|
|
778
808
|
onClick: function onClick(e) {
|
|
779
809
|
e.stopPropagation();
|
|
780
810
|
handlePreview(index);
|
|
781
|
-
}
|
|
782
|
-
}, {
|
|
811
|
+
},
|
|
783
812
|
children: (0, _jsxRuntime.jsx)(_iglooicon.ShowOutlined, {
|
|
784
813
|
style: {
|
|
785
814
|
fontSize: 24
|
|
786
815
|
}
|
|
787
816
|
}, void 0)
|
|
788
|
-
}
|
|
817
|
+
}, void 0)]
|
|
789
818
|
}, void 0)]
|
|
790
|
-
}
|
|
791
|
-
}
|
|
819
|
+
}, void 0)
|
|
820
|
+
}, uid);
|
|
792
821
|
})]
|
|
793
|
-
}
|
|
794
|
-
}
|
|
822
|
+
}, void 0)]
|
|
823
|
+
}, void 0);
|
|
795
824
|
};
|
|
796
825
|
|
|
797
826
|
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", {
|