iglooform 3.0.0-alpha.9 → 3.0.2
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/dumi/theme/ContextWrapper.tsx +2 -2
- package/es/form/element/index.js +1 -0
- package/es/form/hsteps/index.js +8 -11
- package/es/form/steps/index.js +8 -11
- package/es/free-form/steps/index.js +8 -11
- package/es/hooks/ocr/index.js +1 -3
- package/es/hooks/ocr/micro-blink.d.ts +8 -1
- package/es/hooks/ocr/micro-blink.js +52 -44
- package/es/input/phone-number.js +7 -4
- package/es/locale/en-US/messages.json +4 -0
- package/es/locale/id-ID/messages.json +4 -0
- package/es/locale/th-TH/messages.json +4 -0
- package/es/locale/vi-VN/messages.json +4 -0
- package/es/locale/zh-CN/messages.json +4 -0
- package/es/locale/zh-TW/messages.json +4 -0
- package/es/ocr/micro-blink/index.js +77 -61
- package/es/types.d.ts +5 -0
- package/lib/form/element/index.js +1 -0
- package/lib/form/hsteps/index.js +8 -11
- package/lib/form/steps/index.js +8 -11
- package/lib/free-form/steps/index.js +8 -11
- package/lib/hooks/ocr/index.js +1 -3
- package/lib/hooks/ocr/micro-blink.d.ts +8 -1
- package/lib/hooks/ocr/micro-blink.js +51 -43
- package/lib/input/phone-number.js +7 -4
- package/lib/locale/en-US/messages.json +4 -0
- package/lib/locale/id-ID/messages.json +4 -0
- package/lib/locale/th-TH/messages.json +4 -0
- package/lib/locale/vi-VN/messages.json +4 -0
- package/lib/locale/zh-CN/messages.json +4 -0
- package/lib/locale/zh-TW/messages.json +4 -0
- package/lib/ocr/micro-blink/index.js +77 -61
- package/lib/types.d.ts +5 -0
- package/package.json +1 -1
- package/es/admin-amount/style/index.d.ts +0 -0
- package/es/babel-plugin-import-option.d.ts +0 -7
- package/es/back-top/index.d.ts +0 -5
- package/es/input/style/amount/index.d.ts +0 -2
- package/es/input/style/index.d.ts +0 -2
- package/es/input/style/input-date/index.d.ts +0 -2
- package/es/input/style/otp/index.d.ts +0 -2
- package/es/input/style/phone-number/index.d.ts +0 -2
- package/es/input/style/text-area/index.d.ts +0 -2
- package/es/locale/locale-provider.d.ts +0 -11
- package/es/login-page/index.d.ts +0 -7
- package/es/message/style/index.d.ts +0 -1
- package/es/ocr/micro-blink/style/index.d.ts +0 -1
- package/es/platform/platform-card/index.d.ts +0 -12
- package/es/platform/switch-platform/index.d.ts +0 -12
- package/es/tabs/index.d.ts +0 -15
- package/es/utils/useAsyncEffect.d.ts +0 -3
- package/lib/admin-amount/style/index.d.ts +0 -0
- package/lib/babel-plugin-import-option.d.ts +0 -7
- package/lib/back-top/index.d.ts +0 -5
- package/lib/input/style/amount/index.d.ts +0 -2
- package/lib/input/style/index.d.ts +0 -2
- package/lib/input/style/input-date/index.d.ts +0 -2
- package/lib/input/style/otp/index.d.ts +0 -2
- package/lib/input/style/phone-number/index.d.ts +0 -2
- package/lib/input/style/text-area/index.d.ts +0 -2
- package/lib/locale/locale-provider.d.ts +0 -11
- package/lib/login-page/index.d.ts +0 -7
- package/lib/message/style/index.d.ts +0 -1
- package/lib/ocr/micro-blink/style/index.d.ts +0 -1
- package/lib/platform/platform-card/index.d.ts +0 -12
- package/lib/platform/switch-platform/index.d.ts +0 -12
- package/lib/tabs/index.d.ts +0 -15
- package/lib/utils/useAsyncEffect.d.ts +0 -3
|
@@ -27,6 +27,7 @@
|
|
|
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}": "",
|
|
30
31
|
"Failed to load PDF file.": "ไม่สามารถโหลดไฟล์ PDF",
|
|
31
32
|
"Filter": "กรอง",
|
|
32
33
|
"I agree to the Igloo": "ฉันเห็นด้วยกับกระท่อมน้ำแข็ง",
|
|
@@ -42,6 +43,7 @@
|
|
|
42
43
|
"Log in": "เข้าสู่ระบบ",
|
|
43
44
|
"Next": "ต่อไป",
|
|
44
45
|
"No preview for this file. Only support image, video or PDF file.": "ไม่มีการแสดงตัวอย่างสำหรับไฟล์นี้ รองรับเฉพาะรูปภาพ, วิดีโอ หรือ ไฟล์ PDF",
|
|
46
|
+
"Nothing has been recognized.": "",
|
|
45
47
|
"Numbers only, please omit \" \" or \"-\".": "ตัวเลขเท่านั้น โปรดเว้น \" \" หรือ \"-\"",
|
|
46
48
|
"OK": "ตกลง",
|
|
47
49
|
"Ok": "ตกลง",
|
|
@@ -62,6 +64,7 @@
|
|
|
62
64
|
"Processing": "กำลังประมวลผล",
|
|
63
65
|
"Processing progress cannot be updated at the moment. Don’t worry! All your file data are still in progress.": "ไม่สามารถอัปเดตการประมวลผลได้ในขณะนี้ ไม่ต้องกังวล! ไฟล์ของคุณทั้งหมดกำลังอยู่ระหว่างดำเนินการ",
|
|
64
66
|
"Quantity of files should be less than {limit}": "จำนวนไฟล์ควรน้อยกว่า {limit}",
|
|
67
|
+
"Recognition was not successful!": "",
|
|
65
68
|
"Reject": "ปฏิเสธ",
|
|
66
69
|
"Remove": "ลบ",
|
|
67
70
|
"Resend OTP": "ขอ OTP อีกครั้ง",
|
|
@@ -80,6 +83,7 @@
|
|
|
80
83
|
"The file type is not supported.": "ประเภทไฟล์ไม่รองรับ",
|
|
81
84
|
"There are no options available currently": "ไม่มีตัวเลือกในขณะนี้",
|
|
82
85
|
"This Month": "เดือนนี้",
|
|
86
|
+
"This browser is not supported by the SDK!": "",
|
|
83
87
|
"This is an encrypted file, click to enter password.": "นี่เป็นไฟล์ที่เข้ารหัส คลิกเพื่อป้อนรหัสผ่าน",
|
|
84
88
|
"Unselect All": "ไม่เลือกทั้งหมด",
|
|
85
89
|
"Uploading": "กำลังอัพโหลด",
|
|
@@ -27,6 +27,7 @@
|
|
|
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}": "",
|
|
30
31
|
"Failed to load PDF file.": "Không tải được tệp PDF.",
|
|
31
32
|
"Filter": "Lọc",
|
|
32
33
|
"I agree to the Igloo": "Tôi đồng ý với Igloo",
|
|
@@ -42,6 +43,7 @@
|
|
|
42
43
|
"Log in": "Đăng nhập",
|
|
43
44
|
"Next": "Tiếp theo",
|
|
44
45
|
"No preview for this file. Only support image, video or PDF file.": "Không có bản xem trước cho tệp này. Chỉ hỗ trợ hình ảnh, video hoặc tệp PDF.",
|
|
46
|
+
"Nothing has been recognized.": "",
|
|
45
47
|
"Numbers only, please omit \" \" or \"-\".": "Chỉ số, vui lòng bỏ qua \" \" hoặc \"-\".",
|
|
46
48
|
"OK": "Vâng",
|
|
47
49
|
"Ok": "Vâng",
|
|
@@ -62,6 +64,7 @@
|
|
|
62
64
|
"Processing": "Đang xử lý",
|
|
63
65
|
"Processing progress cannot be updated at the moment. Don’t worry! All your file data are still in progress.": "Dữ liệu chưa được cập nhật và đang trong quá trình xử lý.",
|
|
64
66
|
"Quantity of files should be less than {limit}": "Số lượng tệp tin không vượt quá {limit}",
|
|
67
|
+
"Recognition was not successful!": "",
|
|
65
68
|
"Reject": "Từ chối",
|
|
66
69
|
"Remove": "tẩy",
|
|
67
70
|
"Resend OTP": "Gửi lại OTP",
|
|
@@ -80,6 +83,7 @@
|
|
|
80
83
|
"The file type is not supported.": "Loại tệp không được hỗ trợ.",
|
|
81
84
|
"There are no options available currently": "Hiện tại không có tùy chọn nào",
|
|
82
85
|
"This Month": "Tháng này",
|
|
86
|
+
"This browser is not supported by the SDK!": "",
|
|
83
87
|
"This is an encrypted file, click to enter password.": "Đây là một tập tin được mã hóa, bấm vào để nhập mật khẩu.",
|
|
84
88
|
"Unselect All": "Hủy chọn tất cả",
|
|
85
89
|
"Uploading": "Đang tải lên",
|
|
@@ -27,6 +27,7 @@
|
|
|
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}": "",
|
|
30
31
|
"Failed to load PDF file.": "PDF文件加载失败",
|
|
31
32
|
"Filter": "过滤条件",
|
|
32
33
|
"I agree to the Igloo": "我同意Igloo",
|
|
@@ -42,6 +43,7 @@
|
|
|
42
43
|
"Log in": "登录",
|
|
43
44
|
"Next": "下一步",
|
|
44
45
|
"No preview for this file. Only support image, video or PDF file.": "此文件不支持预览。仅支持图片、视频和PDF。",
|
|
46
|
+
"Nothing has been recognized.": "",
|
|
45
47
|
"Numbers only, please omit \" \" or \"-\".": "仅数字,请省略“ ”或“-”。",
|
|
46
48
|
"OK": "确定",
|
|
47
49
|
"Ok": "确定",
|
|
@@ -62,6 +64,7 @@
|
|
|
62
64
|
"Processing": "解析中",
|
|
63
65
|
"Processing progress cannot be updated at the moment. Don’t worry! All your file data are still in progress.": "文件解析中,请耐心等待。",
|
|
64
66
|
"Quantity of files should be less than {limit}": "文件数量不能超过{limit}",
|
|
67
|
+
"Recognition was not successful!": "",
|
|
65
68
|
"Reject": "拒绝",
|
|
66
69
|
"Remove": "移除",
|
|
67
70
|
"Resend OTP": "重新发送OTP",
|
|
@@ -80,6 +83,7 @@
|
|
|
80
83
|
"The file type is not supported.": "不支持上传该类型的文件。",
|
|
81
84
|
"There are no options available currently": "当前没有可用的选项",
|
|
82
85
|
"This Month": "当月",
|
|
86
|
+
"This browser is not supported by the SDK!": "",
|
|
83
87
|
"This is an encrypted file, click to enter password.": "该文件已加密,请输入密码。",
|
|
84
88
|
"Unselect All": "反选",
|
|
85
89
|
"Uploading": "上传中",
|
|
@@ -27,6 +27,7 @@
|
|
|
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}": "",
|
|
30
31
|
"Failed to load PDF file.": "",
|
|
31
32
|
"Filter": "篩選",
|
|
32
33
|
"I agree to the Igloo": "",
|
|
@@ -42,6 +43,7 @@
|
|
|
42
43
|
"Log in": "登錄",
|
|
43
44
|
"Next": "下一個",
|
|
44
45
|
"No preview for this file. Only support image, video or PDF file.": "不支持預覽此文件。只支持圖像,視頻或PDF文件。",
|
|
46
|
+
"Nothing has been recognized.": "",
|
|
45
47
|
"Numbers only, please omit \" \" or \"-\".": "只有數字,請省略“”或“ - ”。",
|
|
46
48
|
"OK": "好",
|
|
47
49
|
"Ok": "",
|
|
@@ -62,6 +64,7 @@
|
|
|
62
64
|
"Processing": "處理中",
|
|
63
65
|
"Processing progress cannot be updated at the moment. Don’t worry! All your file data are still in progress.": "此刻無法更新處理進度。別擔心!您的所有文件數據仍在進行中。",
|
|
64
66
|
"Quantity of files should be less than {limit}": "文件的數量應小於{limit}",
|
|
67
|
+
"Recognition was not successful!": "",
|
|
65
68
|
"Reject": "拒絕",
|
|
66
69
|
"Remove": "消除",
|
|
67
70
|
"Resend OTP": "重新發送OTP.",
|
|
@@ -80,6 +83,7 @@
|
|
|
80
83
|
"The file type is not supported.": "不支持文件類型。",
|
|
81
84
|
"There are no options available currently": "當前沒有可用的選項",
|
|
82
85
|
"This Month": "本月",
|
|
86
|
+
"This browser is not supported by the SDK!": "",
|
|
83
87
|
"This is an encrypted file, click to enter password.": "",
|
|
84
88
|
"Unselect All": "全部取消選擇",
|
|
85
89
|
"Uploading": "上傳",
|
|
@@ -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,
|
|
@@ -47,8 +48,10 @@ var MicroBlink = function MicroBlink(props) {
|
|
|
47
48
|
var _ref = ocrHooks || {},
|
|
48
49
|
microBlink = _ref.microBlink;
|
|
49
50
|
var _ref2 = microBlink || {},
|
|
50
|
-
recognize = _ref2.recognize
|
|
51
|
-
|
|
51
|
+
recognize = _ref2.recognize,
|
|
52
|
+
loading = _ref2.loading,
|
|
53
|
+
initResult = _ref2.initResult;
|
|
54
|
+
(0, _invariant.default)(microBlink, 'Form Must Has MicroBlink Config');
|
|
52
55
|
var onUpload = /*#__PURE__*/function () {
|
|
53
56
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
|
|
54
57
|
var microBlinkResult, state, formSet;
|
|
@@ -64,23 +67,24 @@ var MicroBlink = function MicroBlink(props) {
|
|
|
64
67
|
case 3:
|
|
65
68
|
microBlinkResult = _context.sent;
|
|
66
69
|
if (microBlinkResult) {
|
|
67
|
-
_context.next =
|
|
70
|
+
_context.next = 7;
|
|
68
71
|
break;
|
|
69
72
|
}
|
|
73
|
+
_message.default.error(formatMessage({
|
|
74
|
+
id: 'Recognition was not successful!'
|
|
75
|
+
}));
|
|
70
76
|
return _context.abrupt("return");
|
|
71
|
-
case
|
|
77
|
+
case 7:
|
|
72
78
|
state = microBlinkResult.state;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
79
|
+
if (!(state === 0)) {
|
|
80
|
+
_context.next = 11;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
77
83
|
_message.default.error(formatMessage({
|
|
78
84
|
id: 'Nothing has been recognized.'
|
|
79
85
|
}));
|
|
80
86
|
return _context.abrupt("return");
|
|
81
|
-
case
|
|
82
|
-
return _context.abrupt("break", 13);
|
|
83
|
-
case 13:
|
|
87
|
+
case 11:
|
|
84
88
|
formSet = (outputMap || []).reduce(function (pre, cur) {
|
|
85
89
|
var field = cur.field,
|
|
86
90
|
source = cur.source,
|
|
@@ -97,7 +101,7 @@ var MicroBlink = function MicroBlink(props) {
|
|
|
97
101
|
default:
|
|
98
102
|
pre.push({
|
|
99
103
|
name: field,
|
|
100
|
-
value: lodash.get(microBlinkResult
|
|
104
|
+
value: lodash.get(microBlinkResult, source),
|
|
101
105
|
errors: []
|
|
102
106
|
});
|
|
103
107
|
break;
|
|
@@ -105,7 +109,11 @@ var MicroBlink = function MicroBlink(props) {
|
|
|
105
109
|
return pre;
|
|
106
110
|
}, []);
|
|
107
111
|
form === null || form === void 0 ? void 0 : form.setFields(formSet);
|
|
112
|
+
_context.next = 16;
|
|
113
|
+
break;
|
|
108
114
|
case 15:
|
|
115
|
+
_message.default.error(initResult === null || initResult === void 0 ? void 0 : initResult.error);
|
|
116
|
+
case 16:
|
|
109
117
|
case "end":
|
|
110
118
|
return _context.stop();
|
|
111
119
|
}
|
|
@@ -115,56 +123,64 @@ var MicroBlink = function MicroBlink(props) {
|
|
|
115
123
|
return _ref3.apply(this, arguments);
|
|
116
124
|
};
|
|
117
125
|
}();
|
|
118
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
119
|
-
|
|
120
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
return '';
|
|
126
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Spin, {
|
|
127
|
+
spinning: loading,
|
|
128
|
+
children: [label && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
129
|
+
style: {
|
|
130
|
+
marginBottom: 8
|
|
124
131
|
},
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
className: "igloo-upload-
|
|
142
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
143
|
-
level: "body1",
|
|
144
|
-
children: formatMessage({
|
|
145
|
-
id: 'Drag and drop a file here'
|
|
146
|
-
})
|
|
147
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
|
|
148
|
-
level: "body1",
|
|
149
|
-
style: {
|
|
150
|
-
marginLeft: 4
|
|
151
|
-
},
|
|
152
|
-
children: formatMessage({
|
|
153
|
-
id: 'or'
|
|
154
|
-
})
|
|
155
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
|
|
156
|
-
level: "body1",
|
|
132
|
+
children: label
|
|
133
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
134
|
+
className: 'igloo-micro-blink',
|
|
135
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Dragger, {
|
|
136
|
+
action: function action(file) {
|
|
137
|
+
onUpload(file);
|
|
138
|
+
return '';
|
|
139
|
+
},
|
|
140
|
+
showUploadList: false,
|
|
141
|
+
className: "igloo-upload-box",
|
|
142
|
+
customRequest: function customRequest() {}
|
|
143
|
+
// @ts-ignore
|
|
144
|
+
,
|
|
145
|
+
disabled: disabled || (initResult === null || initResult === void 0 ? void 0 : initResult.failed),
|
|
146
|
+
multiple: true,
|
|
147
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
148
|
+
className: "igloo-upload-box-center",
|
|
149
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_iglooicon.UploadOutlined, {
|
|
157
150
|
style: {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
151
|
+
marginRight: 16,
|
|
152
|
+
fontSize: 24,
|
|
153
|
+
color: '#666666'
|
|
154
|
+
}
|
|
155
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
156
|
+
className: "igloo-upload-placeholder",
|
|
157
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
|
|
158
|
+
level: "body1",
|
|
159
|
+
children: formatMessage({
|
|
160
|
+
id: 'Drag and drop a file here'
|
|
161
|
+
})
|
|
162
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
|
|
163
|
+
level: "body1",
|
|
164
|
+
style: {
|
|
165
|
+
marginLeft: 4
|
|
166
|
+
},
|
|
167
|
+
children: formatMessage({
|
|
168
|
+
id: 'or'
|
|
169
|
+
})
|
|
170
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
|
|
171
|
+
level: "body1",
|
|
172
|
+
style: {
|
|
173
|
+
color: _iglootheme.colors.purpleMain,
|
|
174
|
+
marginLeft: 4
|
|
175
|
+
},
|
|
176
|
+
children: formatMessage({
|
|
177
|
+
id: 'browse'
|
|
178
|
+
})
|
|
179
|
+
})]
|
|
164
180
|
})]
|
|
165
|
-
})
|
|
181
|
+
})
|
|
166
182
|
})
|
|
167
|
-
})
|
|
183
|
+
})]
|
|
168
184
|
});
|
|
169
185
|
};
|
|
170
186
|
var _default = MicroBlink;
|
package/lib/types.d.ts
CHANGED
|
@@ -8,7 +8,12 @@ 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;
|
|
16
|
+
loading?: boolean;
|
|
12
17
|
};
|
|
13
18
|
}
|
|
14
19
|
export interface OCRConfig {
|
package/package.json
CHANGED
|
File without changes
|
package/es/back-top/index.d.ts
DELETED
package/es/login-page/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1,12 +0,0 @@
|
|
|
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;
|
package/es/tabs/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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;
|
|
File without changes
|
package/lib/back-top/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1,12 +0,0 @@
|
|
|
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;
|
package/lib/tabs/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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;
|