iglooform 3.0.1 → 3.0.3
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/.dumi/tmp/core/defineApp.ts +1 -1
- package/.dumi/tmp/core/helmet.ts +1 -1
- package/.dumi/tmp/core/history.ts +1 -1
- package/.dumi/tmp/core/historyIntelli.ts +1 -1
- package/.dumi/tmp/core/plugin.ts +2 -2
- package/.dumi/tmp/core/polyfill.ts +197 -197
- package/.dumi/tmp/core/route.tsx +33 -33
- package/.dumi/tmp/dumi/exports.ts +1 -1
- package/.dumi/tmp/dumi/locales/runtime.tsx +2 -2
- package/.dumi/tmp/dumi/meta/index.ts +33 -33
- package/.dumi/tmp/dumi/meta/runtime.ts +1 -1
- package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +2 -2
- package/.dumi/tmp/dumi/theme/builtins/API.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Badge.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Container.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Previewer.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/SourceCode.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Table.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Tree.ts +1 -1
- package/.dumi/tmp/dumi/theme/layouts/DocLayout.ts +1 -1
- package/.dumi/tmp/dumi/theme/loading.tsx +1 -1
- package/.dumi/tmp/dumi/theme/slots/ColorSwitch.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Content.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/ContentFooter.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/ContentTabs.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Features.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Footer.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Header.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/HeaderExtra.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Hero.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/HeroTitle.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/LangSwitch.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Logo.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Navbar.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/NavbarExtra.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/NotFound.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/PreviewerActions.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/PreviewerActionsExtra.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/RtlSwitch.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/SearchBar.ts +2 -2
- package/.dumi/tmp/dumi/theme/slots/SearchResult.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Sidebar.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/SocialIcon.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Toc.ts +1 -1
- package/.dumi/tmp/exports.ts +5 -5
- package/.dumi/tmp/testBrowser.tsx +3 -3
- package/.dumi/tmp/umi.ts +4 -4
- package/es/admin-amount/style/index.d.ts +0 -0
- package/es/babel-plugin-import-option.d.ts +7 -0
- package/es/back-top/index.d.ts +5 -0
- package/es/form/element/index.js +1 -0
- package/es/hooks/ocr/micro-blink.d.ts +5 -1
- package/es/hooks/ocr/micro-blink.js +29 -43
- package/es/input/phone-number.js +7 -4
- package/es/input/style/amount/index.d.ts +2 -0
- package/es/input/style/index.d.ts +2 -0
- package/es/input/style/input-date/index.d.ts +2 -0
- package/es/input/style/otp/index.d.ts +2 -0
- package/es/input/style/phone-number/index.d.ts +2 -0
- package/es/input/style/text-area/index.d.ts +2 -0
- package/es/locale/en-US/messages.json +2 -1
- package/es/locale/id-ID/messages.json +2 -1
- package/es/locale/locale-provider.d.ts +11 -0
- package/es/locale/th-TH/messages.json +2 -1
- package/es/locale/vi-VN/messages.json +2 -1
- package/es/locale/zh-CN/messages.json +2 -1
- package/es/locale/zh-TW/messages.json +2 -1
- package/es/login-page/index.d.ts +7 -0
- package/es/message/style/index.d.ts +1 -0
- package/es/ocr/micro-blink/index.js +30 -18
- package/es/ocr/micro-blink/style/index.d.ts +1 -0
- package/es/platform/platform-card/index.d.ts +12 -0
- package/es/platform/switch-platform/index.d.ts +12 -0
- package/es/tabs/index.d.ts +15 -0
- package/es/types.d.ts +4 -0
- package/es/upload/index.js +43 -20
- package/es/upload-photo/index.js +20 -4
- package/es/utils/useAsyncEffect.d.ts +3 -0
- package/lib/admin-amount/style/index.d.ts +0 -0
- package/lib/babel-plugin-import-option.d.ts +7 -0
- package/lib/back-top/index.d.ts +5 -0
- package/lib/form/element/index.js +1 -0
- package/lib/hooks/ocr/micro-blink.d.ts +5 -1
- package/lib/hooks/ocr/micro-blink.js +29 -43
- package/lib/input/phone-number.js +7 -4
- package/lib/input/style/amount/index.d.ts +2 -0
- package/lib/input/style/index.d.ts +2 -0
- package/lib/input/style/input-date/index.d.ts +2 -0
- package/lib/input/style/otp/index.d.ts +2 -0
- package/lib/input/style/phone-number/index.d.ts +2 -0
- package/lib/input/style/text-area/index.d.ts +2 -0
- package/lib/locale/en-US/messages.json +2 -1
- package/lib/locale/id-ID/messages.json +2 -1
- package/lib/locale/locale-provider.d.ts +11 -0
- package/lib/locale/th-TH/messages.json +2 -1
- package/lib/locale/vi-VN/messages.json +2 -1
- package/lib/locale/zh-CN/messages.json +2 -1
- package/lib/locale/zh-TW/messages.json +2 -1
- package/lib/login-page/index.d.ts +7 -0
- package/lib/message/style/index.d.ts +1 -0
- package/lib/ocr/micro-blink/index.js +31 -19
- package/lib/ocr/micro-blink/style/index.d.ts +1 -0
- package/lib/platform/platform-card/index.d.ts +12 -0
- package/lib/platform/switch-platform/index.d.ts +12 -0
- package/lib/tabs/index.d.ts +15 -0
- package/lib/types.d.ts +4 -0
- package/lib/upload/index.js +42 -20
- package/lib/upload-photo/index.js +19 -4
- package/lib/utils/useAsyncEffect.d.ts +3 -0
- package/package.json +1 -1
package/es/upload-photo/index.js
CHANGED
|
@@ -33,6 +33,7 @@ import Preview from "../upload-preview/media";
|
|
|
33
33
|
import { classifyType } from "../utils/tools";
|
|
34
34
|
import MediaItem from "./media";
|
|
35
35
|
import FormContext from "../form-context";
|
|
36
|
+
import { staticFormatMessage } from "../locale";
|
|
36
37
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
37
38
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
38
39
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -150,6 +151,9 @@ var UploadPhoto = function UploadPhoto(props) {
|
|
|
150
151
|
setMasks = _useState6[1];
|
|
151
152
|
var _useBreakpoint = useBreakpoint(),
|
|
152
153
|
md = _useBreakpoint.md;
|
|
154
|
+
var staticMessage = formatMessage({
|
|
155
|
+
id: 'Photo Uploading'
|
|
156
|
+
});
|
|
153
157
|
var mapFilesFromValue = function mapFilesFromValue(urls) {
|
|
154
158
|
var _files = [];
|
|
155
159
|
Promise.all(urls.map( /*#__PURE__*/function () {
|
|
@@ -194,6 +198,15 @@ var UploadPhoto = function UploadPhoto(props) {
|
|
|
194
198
|
useEffect(function () {
|
|
195
199
|
if (!value && !files.length) return;
|
|
196
200
|
if (files.length) {
|
|
201
|
+
var hasProcessing = files.find(function (f) {
|
|
202
|
+
return f.status === 'progress';
|
|
203
|
+
});
|
|
204
|
+
if (hasProcessing) {
|
|
205
|
+
onChange && onChange({
|
|
206
|
+
status: 'processing'
|
|
207
|
+
});
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
197
210
|
var urls = files.map(function (f) {
|
|
198
211
|
var status = f.status,
|
|
199
212
|
name = f.name,
|
|
@@ -204,13 +217,11 @@ var UploadPhoto = function UploadPhoto(props) {
|
|
|
204
217
|
errorMsg: errorMsg
|
|
205
218
|
};
|
|
206
219
|
}
|
|
207
|
-
|
|
208
|
-
return f.url || f.dataUrl;
|
|
209
|
-
}
|
|
220
|
+
return f.url;
|
|
210
221
|
});
|
|
211
222
|
onChange && onChange(urls);
|
|
212
223
|
} else {
|
|
213
|
-
onChange && onChange(
|
|
224
|
+
onChange && onChange(undefined);
|
|
214
225
|
}
|
|
215
226
|
}, [files]);
|
|
216
227
|
var uploadId = useMemo(function () {
|
|
@@ -682,6 +693,11 @@ var UploadPhoto = function UploadPhoto(props) {
|
|
|
682
693
|
});
|
|
683
694
|
};
|
|
684
695
|
function checkFileList(value) {
|
|
696
|
+
if ((value === null || value === void 0 ? void 0 : value.status) === 'processing') {
|
|
697
|
+
return Promise.reject(staticFormatMessage({
|
|
698
|
+
id: 'Photo Uploading'
|
|
699
|
+
}));
|
|
700
|
+
}
|
|
685
701
|
if (!value) {
|
|
686
702
|
return Promise.resolve();
|
|
687
703
|
}
|
|
File without changes
|
|
@@ -237,6 +237,7 @@ var Element = function Element(_ref) {
|
|
|
237
237
|
},
|
|
238
238
|
ref: ref,
|
|
239
239
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, _objectSpread(_objectSpread({}, otherElementProps), {}, {
|
|
240
|
+
label: formItemProps.label,
|
|
240
241
|
disabled: elementProps.disabled || disabled,
|
|
241
242
|
containerRef: ref,
|
|
242
243
|
setFieldError: setFieldError,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as BlinkIDSDK from '@microblink/blinkid-in-browser-sdk';
|
|
2
2
|
declare const useMicroBlink: () => (licenseKey: string) => {
|
|
3
|
-
|
|
3
|
+
initResult: {
|
|
4
|
+
error: undefined;
|
|
5
|
+
failed: boolean;
|
|
6
|
+
};
|
|
7
|
+
recognize: ((file: File) => Promise<BlinkIDSDK.BlinkIdSingleSideRecognizerResult | null>) | null;
|
|
4
8
|
loading: boolean;
|
|
5
9
|
};
|
|
6
10
|
export default useMicroBlink;
|
|
@@ -26,11 +26,11 @@ function getWorkerLocation(_x) {
|
|
|
26
26
|
return _getWorkerLocation.apply(this, arguments);
|
|
27
27
|
}
|
|
28
28
|
function _getWorkerLocation() {
|
|
29
|
-
_getWorkerLocation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
30
|
-
return _regeneratorRuntime().wrap(function
|
|
31
|
-
while (1) switch (
|
|
29
|
+
_getWorkerLocation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(path) {
|
|
30
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
31
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
32
32
|
case 0:
|
|
33
|
-
return
|
|
33
|
+
return _context4.abrupt("return", new Promise(function (resolve) {
|
|
34
34
|
window.fetch(path).then(function (response) {
|
|
35
35
|
return response.text();
|
|
36
36
|
}).then(function (data) {
|
|
@@ -43,31 +43,36 @@ function _getWorkerLocation() {
|
|
|
43
43
|
}));
|
|
44
44
|
case 1:
|
|
45
45
|
case "end":
|
|
46
|
-
return
|
|
46
|
+
return _context4.stop();
|
|
47
47
|
}
|
|
48
|
-
},
|
|
48
|
+
}, _callee4);
|
|
49
49
|
}));
|
|
50
50
|
return _getWorkerLocation.apply(this, arguments);
|
|
51
51
|
}
|
|
52
52
|
var useMicroBlink = function useMicroBlink() {
|
|
53
53
|
var _useContext = (0, _react.useContext)(_locale.LocaleContext),
|
|
54
54
|
formatMessage = _useContext.formatMessage;
|
|
55
|
-
|
|
55
|
+
// 对于init的错误不直接展示message.error,等用户实际使用的时候才提示
|
|
56
|
+
var _useState = (0, _react.useState)(undefined),
|
|
56
57
|
_useState2 = _slicedToArray(_useState, 2),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var _useState3 = (0, _react.useState)(
|
|
58
|
+
initError = _useState2[0],
|
|
59
|
+
setInitError = _useState2[1];
|
|
60
|
+
var _useState3 = (0, _react.useState)(false),
|
|
60
61
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
var _useState5 = (0, _react.useState)(
|
|
62
|
+
initLoading = _useState4[0],
|
|
63
|
+
setInitLoading = _useState4[1];
|
|
64
|
+
var _useState5 = (0, _react.useState)(''),
|
|
64
65
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
currentKey = _useState6[0],
|
|
67
|
+
setCurrentKey = _useState6[1];
|
|
67
68
|
var _useState7 = (0, _react.useState)(null),
|
|
68
69
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
recognizer = _useState8[0],
|
|
71
|
+
setRecognizer = _useState8[1];
|
|
72
|
+
var _useState9 = (0, _react.useState)(null),
|
|
73
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
74
|
+
recognizerRunner = _useState10[0],
|
|
75
|
+
setRecognizerRunner = _useState10[1];
|
|
71
76
|
var initSdk = /*#__PURE__*/function () {
|
|
72
77
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(licenseKey) {
|
|
73
78
|
var loadSettings;
|
|
@@ -113,12 +118,7 @@ var useMicroBlink = function useMicroBlink() {
|
|
|
113
118
|
};
|
|
114
119
|
}(), function (error) {
|
|
115
120
|
setInitLoading(false);
|
|
116
|
-
|
|
117
|
-
id: 'Error during the initialization of the SDK! {error}',
|
|
118
|
-
values: {
|
|
119
|
-
error: error.message || error
|
|
120
|
-
}
|
|
121
|
-
}));
|
|
121
|
+
setInitError(error.message || error);
|
|
122
122
|
});
|
|
123
123
|
_context2.next = 11;
|
|
124
124
|
break;
|
|
@@ -164,11 +164,8 @@ var useMicroBlink = function useMicroBlink() {
|
|
|
164
164
|
recognitionResult = _context3.sent;
|
|
165
165
|
return _context3.abrupt("return", recognitionResult);
|
|
166
166
|
case 15:
|
|
167
|
-
_message.default.error(formatMessage({
|
|
168
|
-
id: 'Recognition was not successful!'
|
|
169
|
-
}));
|
|
170
167
|
return _context3.abrupt("return", null);
|
|
171
|
-
case
|
|
168
|
+
case 16:
|
|
172
169
|
case "end":
|
|
173
170
|
return _context3.stop();
|
|
174
171
|
}
|
|
@@ -179,22 +176,7 @@ var useMicroBlink = function useMicroBlink() {
|
|
|
179
176
|
};
|
|
180
177
|
}();
|
|
181
178
|
} else {
|
|
182
|
-
return
|
|
183
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(file) {
|
|
184
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
185
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
186
|
-
case 0:
|
|
187
|
-
return _context4.abrupt("return", null);
|
|
188
|
-
case 1:
|
|
189
|
-
case "end":
|
|
190
|
-
return _context4.stop();
|
|
191
|
-
}
|
|
192
|
-
}, _callee4);
|
|
193
|
-
}));
|
|
194
|
-
return function (_x5) {
|
|
195
|
-
return _ref4.apply(this, arguments);
|
|
196
|
-
};
|
|
197
|
-
}();
|
|
179
|
+
return null;
|
|
198
180
|
}
|
|
199
181
|
}, [recognizer, recognizerRunner]);
|
|
200
182
|
var dealRepeatSendRequest = function dealRepeatSendRequest(licenseKey) {
|
|
@@ -208,6 +190,10 @@ var useMicroBlink = function useMicroBlink() {
|
|
|
208
190
|
return function (licenseKey) {
|
|
209
191
|
dealRepeatSendRequest(licenseKey);
|
|
210
192
|
return {
|
|
193
|
+
initResult: {
|
|
194
|
+
error: initError,
|
|
195
|
+
failed: !!initError
|
|
196
|
+
},
|
|
211
197
|
recognize: recognize(),
|
|
212
198
|
loading: initLoading
|
|
213
199
|
};
|
|
@@ -50,6 +50,7 @@ var PhoneNumber = function PhoneNumber(_ref) {
|
|
|
50
50
|
number = _useState4[0],
|
|
51
51
|
setNumber = _useState4[1];
|
|
52
52
|
(0, _react.useEffect)(function () {
|
|
53
|
+
if (!value) return;
|
|
53
54
|
if ((value === null || value === void 0 ? void 0 : value.areaCode) === selectedCode && (value === null || value === void 0 ? void 0 : value.phoneNumber) === number) {
|
|
54
55
|
return;
|
|
55
56
|
}
|
|
@@ -60,10 +61,12 @@ var PhoneNumber = function PhoneNumber(_ref) {
|
|
|
60
61
|
disabled: disabled,
|
|
61
62
|
onChange: function onChange(e) {
|
|
62
63
|
changeCode(e);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
if (number) {
|
|
65
|
+
formChangeProps({
|
|
66
|
+
areaCode: e,
|
|
67
|
+
phoneNumber: number
|
|
68
|
+
});
|
|
69
|
+
}
|
|
67
70
|
},
|
|
68
71
|
className: (0, _classnames.default)('igloo-phone-number-select'),
|
|
69
72
|
defaultValue: selectedCode,
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"Encrypted PDF": "Encrypted PDF",
|
|
28
28
|
"Enter the password to open this PDF file.": "Enter the password to open this PDF file.",
|
|
29
29
|
"Error Report": "Error Report",
|
|
30
|
-
"Error during the initialization of the SDK! {error}": "Error during the initialization of the SDK! {error}",
|
|
31
30
|
"Failed to load PDF file.": "Failed to load PDF file.",
|
|
31
|
+
"File Uploading": "File Uploading",
|
|
32
32
|
"Filter": "Filter",
|
|
33
33
|
"I agree to the Igloo": "I agree to the Igloo",
|
|
34
34
|
"I declare that the statements I have described above are true. I further declare that the loss occured was accidental, without planning or consensus with other parties.": "I declare that the statements I have described above are true. I further declare that the loss occured was accidental, without planning or consensus with other parties.",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.": "Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.",
|
|
52
52
|
"Optional": "Optional",
|
|
53
53
|
"Other Reason": "Other Reason",
|
|
54
|
+
"Photo Uploading": "Photo Uploading",
|
|
54
55
|
"Please enter a valid date.": "Please enter a valid date.",
|
|
55
56
|
"Please enter a valid time.": "Please enter a valid time.",
|
|
56
57
|
"Please input a date after {date}": "Please input a date after {date}",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"Encrypted PDF": "PDF terenkripsi",
|
|
28
28
|
"Enter the password to open this PDF file.": "Masukkan kata sandi untuk membuka file PDF ini.",
|
|
29
29
|
"Error Report": "Laporan Kesalahan",
|
|
30
|
-
"Error during the initialization of the SDK! {error}": "",
|
|
31
30
|
"Failed to load PDF file.": "Gagal memuat file PDF.",
|
|
31
|
+
"File Uploading": "Mengunggah Berkas",
|
|
32
32
|
"Filter": "Saring",
|
|
33
33
|
"I agree to the Igloo": "Saya setuju dengan Igloo",
|
|
34
34
|
"I declare that the statements I have described above are true. I further declare that the loss occured was accidental, without planning or consensus with other parties.": "Saya menyatakan bahwa pernyataan yang saya jelaskan di atas adalah benar. Selanjutnya saya nyatakan bahwa kerugian yang terjadi merupakan ketidaksengajaan, dan terjadi tanpa perencanaan atau hasil musyawarah dengan pihak lain.",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.": "Jika Anda puas dengan apa yang telah disampaikan, dan Anda telah memeriksa deklarasi tersebut, silakan lanjutkan dan ajukan klaim Anda.",
|
|
52
52
|
"Optional": "Pilihan",
|
|
53
53
|
"Other Reason": "Alasan lain",
|
|
54
|
+
"Photo Uploading": "Mengunggah Foto",
|
|
54
55
|
"Please enter a valid date.": "Silakan tulis tanggal valid",
|
|
55
56
|
"Please enter a valid time.": "Harap masukkan waktu yang valid",
|
|
56
57
|
"Please input a date after {date}": "Harap masukkan tanggal setelah {date}",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"Encrypted PDF": "PDF ที่เข้ารหัส",
|
|
28
28
|
"Enter the password to open this PDF file.": "ป้อนรหัสผ่านเพื่อเปิดไฟล์ PDF นี้",
|
|
29
29
|
"Error Report": "รายงานข้อผิดพลาด",
|
|
30
|
-
"Error during the initialization of the SDK! {error}": "",
|
|
31
30
|
"Failed to load PDF file.": "ไม่สามารถโหลดไฟล์ PDF",
|
|
31
|
+
"File Uploading": "การอัพโหลดไฟล์",
|
|
32
32
|
"Filter": "กรอง",
|
|
33
33
|
"I agree to the Igloo": "ฉันเห็นด้วยกับกระท่อมน้ำแข็ง",
|
|
34
34
|
"I declare that the statements I have described above are true. I further declare that the loss occured was accidental, without planning or consensus with other parties.": "ข้าพเจ้ายืนยันว่าข้อความที่ข้าพเจ้าได้อธิบายข้างต้นนั้นเป็นความจริง และยืนยันว่าความเสียหายที่เกิดขึ้นนั้นเกิดจากอุบัติเหตุ ปราศจากการวางแผน หรือ การเห็นพ้องร่วมกันกับฝ่ายอื่น",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.": "หากตรวจสอบแล้วและต้องการยืนยันข้อมูลข้างต้น กรุณากดดำเนินการต่อและยืนยันการเคลมของคุณ",
|
|
52
52
|
"Optional": "ไม่จำเป็น",
|
|
53
53
|
"Other Reason": "เหตุผลอื่น",
|
|
54
|
+
"Photo Uploading": "การอัพโหลดรูปภาพ",
|
|
54
55
|
"Please enter a valid date.": "กรุณากรอกวันที่ถูกต้อง",
|
|
55
56
|
"Please enter a valid time.": "กรุณากรอกเวลาที่ถูกต้อง",
|
|
56
57
|
"Please input a date after {date}": "กรุณาใส่วันที่หลัง {date}",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"Encrypted PDF": "PDF được mã hóa",
|
|
28
28
|
"Enter the password to open this PDF file.": "Nhập mật khẩu để mở tệp PDF này.",
|
|
29
29
|
"Error Report": "Báo cáo lỗi",
|
|
30
|
-
"Error during the initialization of the SDK! {error}": "",
|
|
31
30
|
"Failed to load PDF file.": "Không tải được tệp PDF.",
|
|
31
|
+
"File Uploading": "Tải lên tệp",
|
|
32
32
|
"Filter": "Lọc",
|
|
33
33
|
"I agree to the Igloo": "Tôi đồng ý với Igloo",
|
|
34
34
|
"I declare that the statements I have described above are true. I further declare that the loss occured was accidental, without planning or consensus with other parties.": "Tôi tuyên bố rằng những điều tôi đã mô tả ở trên là đúng sự thật. Tôi tuyên bố thêm rằng tổn thất xảy ra là do ngẫu nhiên, không có kế hoạch hoặc sự đồng thuận với các bên khác.",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.": "Vui lòng xác nhận và gửi yêu cầu bồi thường.",
|
|
52
52
|
"Optional": "Không bắt buộc",
|
|
53
53
|
"Other Reason": "Lý do khác",
|
|
54
|
+
"Photo Uploading": "Tải ảnh lên",
|
|
54
55
|
"Please enter a valid date.": "Vui lòng nhập đúng ngày:",
|
|
55
56
|
"Please enter a valid time.": "Vui lòng nhập thời gian hợp lệ.",
|
|
56
57
|
"Please input a date after {date}": "Vui lòng nhập ngày sau {date}",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"Encrypted PDF": "加密的PDF文件",
|
|
28
28
|
"Enter the password to open this PDF file.": "输入密码后预览该文件",
|
|
29
29
|
"Error Report": "错误报告",
|
|
30
|
-
"Error during the initialization of the SDK! {error}": "",
|
|
31
30
|
"Failed to load PDF file.": "PDF文件加载失败",
|
|
31
|
+
"File Uploading": "文件上传中",
|
|
32
32
|
"Filter": "过滤条件",
|
|
33
33
|
"I agree to the Igloo": "我同意Igloo",
|
|
34
34
|
"I declare that the statements I have described above are true. I further declare that the loss occured was accidental, without planning or consensus with other parties.": "我承诺上述信息均真实有效,并且物品遗失纯属意外。",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.": "如您对上述填写内容满意,在勾选以下申明后,请继续提交您的理赔申请。",
|
|
52
52
|
"Optional": "可选",
|
|
53
53
|
"Other Reason": "其他原因",
|
|
54
|
+
"Photo Uploading": "图片上传中",
|
|
54
55
|
"Please enter a valid date.": "请输入一个有效的日期。",
|
|
55
56
|
"Please enter a valid time.": "请输入一个有效的时间。",
|
|
56
57
|
"Please input a date after {date}": "请输入一个{date}之后的日期",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"Encrypted PDF": "",
|
|
28
28
|
"Enter the password to open this PDF file.": "",
|
|
29
29
|
"Error Report": "錯誤報告",
|
|
30
|
-
"Error during the initialization of the SDK! {error}": "",
|
|
31
30
|
"Failed to load PDF file.": "",
|
|
31
|
+
"File Uploading": "",
|
|
32
32
|
"Filter": "篩選",
|
|
33
33
|
"I agree to the Igloo": "",
|
|
34
34
|
"I declare that the statements I have described above are true. I further declare that the loss occured was accidental, without planning or consensus with other parties.": "我聲明我上面描述的陳述是真的。我進一步宣布發生損失是偶然的,沒有規劃或與其他方的共識。",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.": "一旦您對上述內容感到滿意,您已檢查聲明,請繼續並提交您的索賠。",
|
|
52
52
|
"Optional": "可選項",
|
|
53
53
|
"Other Reason": "其他原因",
|
|
54
|
+
"Photo Uploading": "",
|
|
54
55
|
"Please enter a valid date.": "請輸入有效的日期。",
|
|
55
56
|
"Please enter a valid time.": "請輸入有效的時間。",
|
|
56
57
|
"Please input a date after {date}": "",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -9,18 +9,18 @@ var _react = require("react");
|
|
|
9
9
|
var _iglooicon = require("iglooicon");
|
|
10
10
|
var _iglootheme = require("iglootheme");
|
|
11
11
|
var _antd = require("antd");
|
|
12
|
-
var _invariant = _interopRequireDefault(require("invariant"));
|
|
13
12
|
var lodash = _interopRequireWildcard(require("lodash"));
|
|
14
13
|
var _moment = _interopRequireDefault(require("moment"));
|
|
14
|
+
var _invariant = _interopRequireDefault(require("invariant"));
|
|
15
15
|
var _formContext = _interopRequireDefault(require("../../form-context"));
|
|
16
16
|
var _typography = _interopRequireDefault(require("../../typography"));
|
|
17
17
|
var _locale = require("../../locale");
|
|
18
18
|
var _message = _interopRequireDefault(require("../../message"));
|
|
19
19
|
require("./style");
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
23
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
24
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
25
25
|
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); } }
|
|
26
26
|
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); }); }; }
|
|
@@ -37,7 +37,8 @@ function getOcrDate(result, format) {
|
|
|
37
37
|
}
|
|
38
38
|
var MicroBlink = function MicroBlink(props) {
|
|
39
39
|
var outputMap = props.outputMap,
|
|
40
|
-
disabled = props.disabled
|
|
40
|
+
disabled = props.disabled,
|
|
41
|
+
label = props.label;
|
|
41
42
|
var Dragger = _antd.Upload.Dragger;
|
|
42
43
|
var _useContext = (0, _react.useContext)(_formContext.default),
|
|
43
44
|
ocrHooks = _useContext.ocrHooks,
|
|
@@ -48,8 +49,9 @@ var MicroBlink = function MicroBlink(props) {
|
|
|
48
49
|
microBlink = _ref.microBlink;
|
|
49
50
|
var _ref2 = microBlink || {},
|
|
50
51
|
recognize = _ref2.recognize,
|
|
51
|
-
loading = _ref2.loading
|
|
52
|
-
|
|
52
|
+
loading = _ref2.loading,
|
|
53
|
+
initResult = _ref2.initResult;
|
|
54
|
+
(0, _invariant.default)(microBlink, 'Form Must Has MicroBlink Config');
|
|
53
55
|
var onUpload = /*#__PURE__*/function () {
|
|
54
56
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
|
|
55
57
|
var microBlinkResult, state, formSet;
|
|
@@ -65,23 +67,24 @@ var MicroBlink = function MicroBlink(props) {
|
|
|
65
67
|
case 3:
|
|
66
68
|
microBlinkResult = _context.sent;
|
|
67
69
|
if (microBlinkResult) {
|
|
68
|
-
_context.next =
|
|
70
|
+
_context.next = 7;
|
|
69
71
|
break;
|
|
70
72
|
}
|
|
73
|
+
_message.default.error(formatMessage({
|
|
74
|
+
id: 'Recognition was not successful!'
|
|
75
|
+
}));
|
|
71
76
|
return _context.abrupt("return");
|
|
72
|
-
case
|
|
77
|
+
case 7:
|
|
73
78
|
state = microBlinkResult.state;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
if (!(state === 0)) {
|
|
80
|
+
_context.next = 11;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
78
83
|
_message.default.error(formatMessage({
|
|
79
84
|
id: 'Nothing has been recognized.'
|
|
80
85
|
}));
|
|
81
86
|
return _context.abrupt("return");
|
|
82
|
-
case
|
|
83
|
-
return _context.abrupt("break", 13);
|
|
84
|
-
case 13:
|
|
87
|
+
case 11:
|
|
85
88
|
formSet = (outputMap || []).reduce(function (pre, cur) {
|
|
86
89
|
var field = cur.field,
|
|
87
90
|
source = cur.source,
|
|
@@ -98,7 +101,7 @@ var MicroBlink = function MicroBlink(props) {
|
|
|
98
101
|
default:
|
|
99
102
|
pre.push({
|
|
100
103
|
name: field,
|
|
101
|
-
value: lodash.get(microBlinkResult
|
|
104
|
+
value: lodash.get(microBlinkResult, source),
|
|
102
105
|
errors: []
|
|
103
106
|
});
|
|
104
107
|
break;
|
|
@@ -106,7 +109,11 @@ var MicroBlink = function MicroBlink(props) {
|
|
|
106
109
|
return pre;
|
|
107
110
|
}, []);
|
|
108
111
|
form === null || form === void 0 ? void 0 : form.setFields(formSet);
|
|
112
|
+
_context.next = 16;
|
|
113
|
+
break;
|
|
109
114
|
case 15:
|
|
115
|
+
_message.default.error(initResult === null || initResult === void 0 ? void 0 : initResult.error);
|
|
116
|
+
case 16:
|
|
110
117
|
case "end":
|
|
111
118
|
return _context.stop();
|
|
112
119
|
}
|
|
@@ -116,9 +123,14 @@ var MicroBlink = function MicroBlink(props) {
|
|
|
116
123
|
return _ref3.apply(this, arguments);
|
|
117
124
|
};
|
|
118
125
|
}();
|
|
119
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
126
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Spin, {
|
|
120
127
|
spinning: loading,
|
|
121
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
128
|
+
children: [label && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
129
|
+
style: {
|
|
130
|
+
marginBottom: 8
|
|
131
|
+
},
|
|
132
|
+
children: label
|
|
133
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
122
134
|
className: 'igloo-micro-blink',
|
|
123
135
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Dragger, {
|
|
124
136
|
action: function action(file) {
|
|
@@ -130,7 +142,7 @@ var MicroBlink = function MicroBlink(props) {
|
|
|
130
142
|
customRequest: function customRequest() {}
|
|
131
143
|
// @ts-ignore
|
|
132
144
|
,
|
|
133
|
-
disabled: disabled,
|
|
145
|
+
disabled: disabled || (initResult === null || initResult === void 0 ? void 0 : initResult.failed),
|
|
134
146
|
multiple: true,
|
|
135
147
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
136
148
|
className: "igloo-upload-box-center",
|
|
@@ -168,7 +180,7 @@ var MicroBlink = function MicroBlink(props) {
|
|
|
168
180
|
})]
|
|
169
181
|
})
|
|
170
182
|
})
|
|
171
|
-
})
|
|
183
|
+
})]
|
|
172
184
|
});
|
|
173
185
|
};
|
|
174
186
|
var _default = MicroBlink;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import './style';
|
|
3
|
+
interface Props {
|
|
4
|
+
platforms: (string | {
|
|
5
|
+
name: string;
|
|
6
|
+
key: string;
|
|
7
|
+
})[];
|
|
8
|
+
currentPlatform: string;
|
|
9
|
+
onChange: (platform: string) => any;
|
|
10
|
+
}
|
|
11
|
+
declare const SwitchPlatform: FC<Props>;
|
|
12
|
+
export default SwitchPlatform;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TabsProps } from 'antd';
|
|
3
|
+
import './style';
|
|
4
|
+
interface IglooTabsProps extends TabsProps {
|
|
5
|
+
}
|
|
6
|
+
export declare const TabPane: React.FC<import("antd").TabPaneProps>;
|
|
7
|
+
/**
|
|
8
|
+
* Tab
|
|
9
|
+
* @param {*} 所有antd的tabs
|
|
10
|
+
*/
|
|
11
|
+
declare function Tabs(props: IglooTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare namespace Tabs {
|
|
13
|
+
var TabPane: React.FC<import("antd").TabPaneProps>;
|
|
14
|
+
}
|
|
15
|
+
export default Tabs;
|
package/lib/types.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ import { BlinkIdSingleSideRecognizerResult } from '@microblink/blinkid-in-browse
|
|
|
8
8
|
export { Rule } from 'rc-field-form/lib/interface';
|
|
9
9
|
export interface OCRHooks {
|
|
10
10
|
microBlink?: {
|
|
11
|
+
initResult: {
|
|
12
|
+
error?: string;
|
|
13
|
+
failed: boolean;
|
|
14
|
+
};
|
|
11
15
|
recognize: ((file: File) => Promise<BlinkIdSingleSideRecognizerResult | null>) | null;
|
|
12
16
|
loading?: boolean;
|
|
13
17
|
};
|