iglooform 2.5.54 → 2.5.56
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/EmptyRoute.tsx +9 -0
- package/.dumi/tmp/core/defineApp.ts +17 -0
- package/.dumi/tmp/core/exportStaticRuntimePlugin.ts +11 -0
- package/.dumi/tmp/core/helmet.ts +10 -0
- package/.dumi/tmp/core/helmetContext.ts +4 -0
- package/.dumi/tmp/core/history.ts +66 -0
- package/.dumi/tmp/core/historyIntelli.ts +132 -0
- package/.dumi/tmp/core/plugin.ts +60 -0
- package/.dumi/tmp/core/pluginConfig.ts +292 -0
- package/.dumi/tmp/core/pluginConfigJoi.d.ts +55 -0
- package/.dumi/tmp/core/polyfill.ts +201 -0
- package/.dumi/tmp/core/route.tsx +50 -0
- package/.dumi/tmp/core/terminal.ts +37 -0
- package/.dumi/tmp/dumi/exports.ts +5 -0
- package/.dumi/tmp/dumi/locales/config.ts +95 -0
- package/.dumi/tmp/dumi/locales/runtime.tsx +43 -0
- package/.dumi/tmp/dumi/meta/atoms.ts +4 -0
- package/.dumi/tmp/dumi/meta/index.ts +255 -0
- package/.dumi/tmp/dumi/meta/runtime.ts +31 -0
- package/.dumi/tmp/dumi/meta/tabs.ts +5 -0
- package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +48 -0
- package/.dumi/tmp/dumi/theme/builtins/API.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Badge.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Container.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Previewer.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/SourceCode.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Table.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Tree.ts +4 -0
- package/.dumi/tmp/dumi/theme/layouts/DocLayout.ts +4 -0
- package/.dumi/tmp/dumi/theme/loading.tsx +25 -0
- package/.dumi/tmp/dumi/theme/nprogress.css +59 -0
- package/.dumi/tmp/dumi/theme/slots/ColorSwitch.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Content.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/ContentFooter.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/ContentTabs.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Features.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Footer.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Header.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/HeaderExtra.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Hero.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/HeroTitle.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/LangSwitch.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Logo.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Navbar.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/NavbarExtra.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/NotFound.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/PreviewerActions.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/PreviewerActionsExtra.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/RtlSwitch.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/SearchBar.ts +5 -0
- package/.dumi/tmp/dumi/theme/slots/SearchResult.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Sidebar.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/SocialIcon.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Toc.ts +4 -0
- package/.dumi/tmp/exports.ts +18 -0
- package/.dumi/tmp/plugin-antd/runtime.tsx +65 -0
- package/.dumi/tmp/plugin-antd/runtimeConfig.d.ts +6 -0
- package/.dumi/tmp/plugin-antd/types.d.ts +14 -0
- package/.dumi/tmp/plugin-html2sketch/index.ts +35 -0
- package/.dumi/tmp/testBrowser.tsx +90 -0
- package/.dumi/tmp/umi.ts +108 -0
- package/es/form/elements.js +3 -1
- package/es/form/index.js +12 -2
- package/es/form-context.d.ts +2 -1
- package/es/form-context.js +2 -1
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.js +1 -0
- package/es/hooks/ocr/index.d.ts +3 -0
- package/es/hooks/ocr/index.js +25 -0
- package/es/hooks/ocr/micro-blink.d.ts +3 -0
- package/es/hooks/ocr/micro-blink.js +231 -0
- package/es/input/input-date.js +40 -28
- package/es/input/phone-number.d.ts +1 -1
- package/es/input/phone-number.js +38 -15
- package/es/locale/en-US/messages.json +3 -0
- package/es/locale/id-ID/messages.json +3 -0
- package/es/locale/th-TH/messages.json +3 -0
- package/es/locale/vi-VN/messages.json +3 -0
- package/es/locale/zh-CN/messages.json +3 -0
- package/es/locale/zh-TW/messages.json +3 -0
- package/es/ocr/index.d.ts +15 -0
- package/es/ocr/index.js +38 -0
- package/es/ocr/micro-blink/index.d.ts +8 -0
- package/es/ocr/micro-blink/index.js +189 -0
- package/es/ocr/micro-blink/style/index.d.ts +1 -0
- package/es/ocr/micro-blink/style/index.js +1 -0
- package/es/ocr/micro-blink/style/index.less +30 -0
- package/es/types.d.ts +12 -0
- package/es/upload/index.js +46 -22
- package/es/upload-photo/index.js +24 -4
- package/es/utils/form-utils.js +1 -1
- package/lib/form/elements.js +4 -1
- package/lib/form/index.js +13 -2
- package/lib/form-context.d.ts +2 -1
- package/lib/form-context.js +2 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/ocr/index.d.ts +3 -0
- package/lib/hooks/ocr/index.js +36 -0
- package/lib/hooks/ocr/micro-blink.d.ts +3 -0
- package/lib/hooks/ocr/micro-blink.js +251 -0
- package/lib/input/input-date.js +40 -28
- package/lib/input/phone-number.d.ts +1 -1
- package/lib/input/phone-number.js +42 -17
- package/lib/locale/en-US/messages.json +3 -0
- package/lib/locale/id-ID/messages.json +3 -0
- package/lib/locale/th-TH/messages.json +3 -0
- package/lib/locale/vi-VN/messages.json +3 -0
- package/lib/locale/zh-CN/messages.json +3 -0
- package/lib/locale/zh-TW/messages.json +3 -0
- package/lib/ocr/index.d.ts +15 -0
- package/lib/ocr/index.js +49 -0
- package/lib/ocr/micro-blink/index.d.ts +8 -0
- package/lib/ocr/micro-blink/index.js +218 -0
- package/lib/ocr/micro-blink/style/index.d.ts +1 -0
- package/lib/ocr/micro-blink/style/index.js +3 -0
- package/lib/ocr/micro-blink/style/index.less +30 -0
- package/lib/types.d.ts +12 -0
- package/lib/upload/index.js +45 -22
- package/lib/upload-photo/index.js +23 -4
- package/lib/utils/form-utils.js +1 -1
- package/package.json +2 -1
package/es/input/input-date.js
CHANGED
|
@@ -80,23 +80,29 @@ var IglooInputDate = function IglooInputDate(props) {
|
|
|
80
80
|
onChangeProps = props.onChange,
|
|
81
81
|
setFieldError = props.setFieldError,
|
|
82
82
|
disabled = props.disabled,
|
|
83
|
-
value = props.value;
|
|
84
|
-
|
|
85
|
-
var _useState = useState(false),
|
|
86
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
87
|
-
active = _useState2[0],
|
|
88
|
-
setActive = _useState2[1];
|
|
89
|
-
|
|
90
|
-
var inputValueRef = useRef([]); // 用来做 输入跳转
|
|
83
|
+
value = props.value; // 用来做 输入跳转
|
|
91
84
|
|
|
92
85
|
var firstInput = useRef(null);
|
|
93
86
|
var secondInput = useRef(null);
|
|
94
87
|
var thirdInput = useRef(null);
|
|
95
88
|
|
|
96
|
-
var
|
|
89
|
+
var _useState = useState(false),
|
|
90
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
91
|
+
used = _useState2[0],
|
|
92
|
+
setUsed = _useState2[1];
|
|
93
|
+
|
|
94
|
+
var _useState3 = useState(false),
|
|
97
95
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
active = _useState4[0],
|
|
97
|
+
setActive = _useState4[1];
|
|
98
|
+
|
|
99
|
+
var _useState5 = useState([]),
|
|
100
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
101
|
+
inputValue = _useState6[0],
|
|
102
|
+
setInput = _useState6[1];
|
|
103
|
+
|
|
104
|
+
var _useContext = useContext(LocaleContext),
|
|
105
|
+
formatMessage = _useContext.formatMessage;
|
|
100
106
|
|
|
101
107
|
var formatDeleteSpace = format.replace(/\s+/g, '');
|
|
102
108
|
|
|
@@ -105,18 +111,22 @@ var IglooInputDate = function IglooInputDate(props) {
|
|
|
105
111
|
timeInputArr = _dealFormat2[0],
|
|
106
112
|
delimiter = _dealFormat2[1];
|
|
107
113
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
114
|
+
useEffect(function () {
|
|
115
|
+
if (!value) {
|
|
116
|
+
setInput(Array(timeInputArr.length));
|
|
117
|
+
} else {
|
|
118
|
+
setUsed(true);
|
|
119
|
+
}
|
|
120
|
+
}, []);
|
|
111
121
|
useEffect(function () {
|
|
112
122
|
if (!value || value === 'error type') return;
|
|
113
123
|
var init = value.split(delimiter);
|
|
114
124
|
setInput(init);
|
|
115
|
-
inputValueRef.current = init;
|
|
116
125
|
}, [value]);
|
|
117
126
|
useEffect(function () {
|
|
127
|
+
if (!used) return;
|
|
118
128
|
if (!inputValue.length) return;
|
|
119
|
-
var currentInput =
|
|
129
|
+
var currentInput = inputValue.join(delimiter);
|
|
120
130
|
var available = moment(currentInput.replace(/\s+/g, ''), formatDeleteSpace, true).isValid();
|
|
121
131
|
var value = moment(currentInput, formatDeleteSpace).format(format);
|
|
122
132
|
|
|
@@ -130,7 +140,7 @@ var IglooInputDate = function IglooInputDate(props) {
|
|
|
130
140
|
}
|
|
131
141
|
}, [inputValue]);
|
|
132
142
|
|
|
133
|
-
function autoZero(str, refArr, index, inputFormat) {
|
|
143
|
+
var autoZero = function autoZero(str, refArr, index, inputFormat) {
|
|
134
144
|
var valueInput = str.replace(/[^0-9]/gi, '');
|
|
135
145
|
var firstWord = inputFormat[0];
|
|
136
146
|
|
|
@@ -140,9 +150,11 @@ var IglooInputDate = function IglooInputDate(props) {
|
|
|
140
150
|
valueInput = '0' + valueInput;
|
|
141
151
|
handleOnChange(valueInput, refArr, index, inputFormat);
|
|
142
152
|
}
|
|
143
|
-
}
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
var handleOnChange = function handleOnChange(str, currentInput, index, inputFormat) {
|
|
156
|
+
var copyInput = _toConsumableArray(currentInput);
|
|
144
157
|
|
|
145
|
-
function handleOnChange(str, refArr, index, inputFormat) {
|
|
146
158
|
var valueInput = str.replace(/[^0-9]/gi, '');
|
|
147
159
|
var firstWord = inputFormat[0];
|
|
148
160
|
|
|
@@ -168,12 +180,12 @@ var IglooInputDate = function IglooInputDate(props) {
|
|
|
168
180
|
if (thirdInput.current) thirdInput.current.focus();
|
|
169
181
|
break;
|
|
170
182
|
}
|
|
171
|
-
}
|
|
172
|
-
|
|
183
|
+
}
|
|
173
184
|
|
|
174
|
-
|
|
175
|
-
setInput(_toConsumableArray(
|
|
176
|
-
|
|
185
|
+
copyInput.splice(index, 1, valueInput.slice(0, inputFormat.length));
|
|
186
|
+
setInput(_toConsumableArray(copyInput));
|
|
187
|
+
setUsed(true);
|
|
188
|
+
};
|
|
177
189
|
|
|
178
190
|
return _jsx("div", {
|
|
179
191
|
className: classnames('igloo-input-date-picker', {
|
|
@@ -215,10 +227,10 @@ var IglooInputDate = function IglooInputDate(props) {
|
|
|
215
227
|
ref: ref,
|
|
216
228
|
value: (inputValue[index] || '').replace(/\s+/g, ''),
|
|
217
229
|
onBlur: function onBlur(e) {
|
|
218
|
-
return autoZero(e.target.value,
|
|
230
|
+
return autoZero(e.target.value, inputValue, index, item);
|
|
219
231
|
},
|
|
220
232
|
onChange: function onChange(e) {
|
|
221
|
-
return handleOnChange(e.target.value,
|
|
233
|
+
return handleOnChange(e.target.value, inputValue, index, item);
|
|
222
234
|
},
|
|
223
235
|
bordered: false,
|
|
224
236
|
maxLength: item.length,
|
|
@@ -240,10 +252,10 @@ var IglooInputDate = function IglooInputDate(props) {
|
|
|
240
252
|
maxLength: item.length,
|
|
241
253
|
value: (inputValue[index] || '').replace(/\s+/g, ''),
|
|
242
254
|
onBlur: function onBlur(e) {
|
|
243
|
-
return autoZero(e.target.value,
|
|
255
|
+
return autoZero(e.target.value, inputValue, index, item);
|
|
244
256
|
},
|
|
245
257
|
onChange: function onChange(e) {
|
|
246
|
-
return handleOnChange(e.target.value,
|
|
258
|
+
return handleOnChange(e.target.value, inputValue, index, item);
|
|
247
259
|
},
|
|
248
260
|
style: {
|
|
249
261
|
width: width
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import { FC, IglooComponentProps } from '../types';
|
|
3
|
-
import './style/index';
|
|
3
|
+
import './style/index.less';
|
|
4
4
|
export interface PhoneNumberProps extends IglooComponentProps {
|
|
5
5
|
areaCode?: string | string[];
|
|
6
6
|
phoneNumber?: number;
|
package/es/input/phone-number.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var _excluded = ["areaCode", "phoneNumber", "className", "disabled", "value", "onChange", "style"];
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
3
8
|
|
|
4
9
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
10
|
|
|
@@ -13,13 +18,20 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
13
18
|
|
|
14
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
20
|
|
|
21
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
22
|
+
|
|
23
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
24
|
+
|
|
16
25
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
26
|
import { useState, useEffect } from 'react';
|
|
18
27
|
import classnames from 'classnames';
|
|
19
28
|
import invariant from 'invariant';
|
|
29
|
+
import omit from 'omit.js';
|
|
20
30
|
import Select from '../select';
|
|
31
|
+
import formMethods from '../utils/form-methods';
|
|
32
|
+
import Input from './input';
|
|
21
33
|
import { staticFormatMessage as formatMessage } from '../locale';
|
|
22
|
-
import './style/index';
|
|
34
|
+
import './style/index.less';
|
|
23
35
|
|
|
24
36
|
var PhoneNumber = function PhoneNumber(_ref) {
|
|
25
37
|
var areaCode = _ref.areaCode,
|
|
@@ -28,28 +40,35 @@ var PhoneNumber = function PhoneNumber(_ref) {
|
|
|
28
40
|
disabled = _ref.disabled,
|
|
29
41
|
value = _ref.value,
|
|
30
42
|
formChangeProps = _ref.onChange,
|
|
31
|
-
style = _ref.style
|
|
43
|
+
style = _ref.style,
|
|
44
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
45
|
+
|
|
32
46
|
invariant(Array.isArray(areaCode) ? areaCode.length : true, 'areaCode cant be an empty array');
|
|
33
47
|
invariant(areaCode != undefined, 'areaCode must be set');
|
|
34
48
|
|
|
35
|
-
var _useState = useState(Array.isArray(areaCode) ? areaCode[0] : areaCode),
|
|
49
|
+
var _useState = useState((value === null || value === void 0 ? void 0 : value.areaCode) || (Array.isArray(areaCode) ? areaCode[0] : areaCode)),
|
|
36
50
|
_useState2 = _slicedToArray(_useState, 2),
|
|
37
51
|
selectedCode = _useState2[0],
|
|
38
52
|
changeCode = _useState2[1];
|
|
39
53
|
|
|
40
|
-
var _useState3 = useState(value ? value.phoneNumber
|
|
54
|
+
var _useState3 = useState(value === null || value === void 0 ? void 0 : value.phoneNumber),
|
|
41
55
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
42
56
|
number = _useState4[0],
|
|
43
57
|
setNumber = _useState4[1];
|
|
44
58
|
|
|
45
59
|
useEffect(function () {
|
|
46
|
-
|
|
60
|
+
if ((value === null || value === void 0 ? void 0 : value.areaCode) === selectedCode && (value === null || value === void 0 ? void 0 : value.phoneNumber) === number) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
setNumber(value === null || value === void 0 ? void 0 : value.phoneNumber);
|
|
65
|
+
changeCode(value === null || value === void 0 ? void 0 : value.areaCode);
|
|
47
66
|
}, [value]);
|
|
48
67
|
var leftPart = Array.isArray(areaCode) ? _jsx(Select, {
|
|
49
68
|
disabled: disabled,
|
|
50
69
|
onChange: function onChange(e) {
|
|
51
70
|
changeCode(e);
|
|
52
|
-
formChangeProps(number ? {
|
|
71
|
+
formChangeProps(number && e ? {
|
|
53
72
|
areaCode: e,
|
|
54
73
|
phoneNumber: number
|
|
55
74
|
} : undefined);
|
|
@@ -71,9 +90,10 @@ var PhoneNumber = function PhoneNumber(_ref) {
|
|
|
71
90
|
className: classnames('igloo-input-phone', {
|
|
72
91
|
'igloo-input-phone-disabled': disabled
|
|
73
92
|
}, className),
|
|
74
|
-
children: [leftPart, _jsx(
|
|
93
|
+
children: [leftPart, _jsx(Input, _objectSpread({
|
|
75
94
|
type: "tel",
|
|
76
95
|
value: number,
|
|
96
|
+
className: 'igloo-input',
|
|
77
97
|
onChange: function onChange(e) {
|
|
78
98
|
setNumber(e.target.value);
|
|
79
99
|
formChangeProps(e.target.value ? {
|
|
@@ -82,7 +102,7 @@ var PhoneNumber = function PhoneNumber(_ref) {
|
|
|
82
102
|
} : undefined);
|
|
83
103
|
},
|
|
84
104
|
disabled: disabled
|
|
85
|
-
})]
|
|
105
|
+
}, omit(rest, formMethods)))]
|
|
86
106
|
});
|
|
87
107
|
};
|
|
88
108
|
|
|
@@ -93,7 +113,8 @@ PhoneNumber.formItemPropsHandler = function (_ref2) {
|
|
|
93
113
|
maxLength = _ref2.maxLength,
|
|
94
114
|
minLength = _ref2.minLength,
|
|
95
115
|
label = _ref2.label,
|
|
96
|
-
pattern = _ref2.pattern
|
|
116
|
+
pattern = _ref2.pattern,
|
|
117
|
+
initialValue = _ref2.initialValue;
|
|
97
118
|
var rules = [{
|
|
98
119
|
validator: function validator(rule, value) {
|
|
99
120
|
if (!value) return Promise.resolve();
|
|
@@ -181,11 +202,13 @@ PhoneNumber.formItemPropsHandler = function (_ref2) {
|
|
|
181
202
|
});
|
|
182
203
|
}
|
|
183
204
|
|
|
205
|
+
var initialAreaCode = (initialValue === null || initialValue === void 0 ? void 0 : initialValue.areaCode) || (Array.isArray(areaCode) ? areaCode[0] : areaCode);
|
|
206
|
+
var initialPhoneNumber = (initialValue === null || initialValue === void 0 ? void 0 : initialValue.phoneNumber) || phoneNumber;
|
|
184
207
|
return {
|
|
185
|
-
initialValue:
|
|
186
|
-
areaCode:
|
|
187
|
-
phoneNumber:
|
|
188
|
-
}
|
|
208
|
+
initialValue: {
|
|
209
|
+
areaCode: initialAreaCode,
|
|
210
|
+
phoneNumber: initialPhoneNumber
|
|
211
|
+
},
|
|
189
212
|
rules: rules,
|
|
190
213
|
previewFormater: function previewFormater(_ref3) {
|
|
191
214
|
var areaCode = _ref3.areaCode,
|
|
@@ -28,6 +28,7 @@
|
|
|
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
30
|
"Failed to load PDF file.": "Failed to load PDF file.",
|
|
31
|
+
"File Uploading": "File Uploading",
|
|
31
32
|
"Filter": "Filter",
|
|
32
33
|
"I agree to the Igloo": "I agree to the Igloo",
|
|
33
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.",
|
|
@@ -42,6 +43,7 @@
|
|
|
42
43
|
"Log in": "Log in",
|
|
43
44
|
"Next": "Next",
|
|
44
45
|
"No preview for this file. Only support image, video or PDF file.": "No preview for this file. Only support image, video or PDF file.",
|
|
46
|
+
"Nothing has been recognized.": "Nothing has been recognized.",
|
|
45
47
|
"Numbers only, please omit \" \" or \"-\".": "Numbers only, please omit \" \" or \"-\".",
|
|
46
48
|
"OK": "OK",
|
|
47
49
|
"Ok": "Ok",
|
|
@@ -49,6 +51,7 @@
|
|
|
49
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.",
|
|
50
52
|
"Optional": "Optional",
|
|
51
53
|
"Other Reason": "Other Reason",
|
|
54
|
+
"Photo Uploading": "Photo Uploading",
|
|
52
55
|
"Please enter a valid date.": "Please enter a valid date.",
|
|
53
56
|
"Please enter a valid time.": "Please enter a valid time.",
|
|
54
57
|
"Please input a date after {date}": "Please input a date after {date}",
|
|
@@ -28,6 +28,7 @@
|
|
|
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
30
|
"Failed to load PDF file.": "Gagal memuat file PDF.",
|
|
31
|
+
"File Uploading": "Mengunggah Berkas",
|
|
31
32
|
"Filter": "Saring",
|
|
32
33
|
"I agree to the Igloo": "Saya setuju dengan Igloo",
|
|
33
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.",
|
|
@@ -42,6 +43,7 @@
|
|
|
42
43
|
"Log in": "Masuk",
|
|
43
44
|
"Next": "Selanjutnya",
|
|
44
45
|
"No preview for this file. Only support image, video or PDF file.": "Tidak ada pratinjau untuk file ini. Hanya mendukung file gambar, video atau PDF.",
|
|
46
|
+
"Nothing has been recognized.": "",
|
|
45
47
|
"Numbers only, please omit \" \" or \"-\".": "Angka saja, harap hilangkan \" \" atau \"-\".",
|
|
46
48
|
"OK": "oke",
|
|
47
49
|
"Ok": "oke",
|
|
@@ -49,6 +51,7 @@
|
|
|
49
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.",
|
|
50
52
|
"Optional": "Pilihan",
|
|
51
53
|
"Other Reason": "Alasan lain",
|
|
54
|
+
"Photo Uploading": "Mengunggah Foto",
|
|
52
55
|
"Please enter a valid date.": "Silakan tulis tanggal valid",
|
|
53
56
|
"Please enter a valid time.": "Harap masukkan waktu yang valid",
|
|
54
57
|
"Please input a date after {date}": "Harap masukkan tanggal setelah {date}",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"Enter the password to open this PDF file.": "ป้อนรหัสผ่านเพื่อเปิดไฟล์ PDF นี้",
|
|
29
29
|
"Error Report": "รายงานข้อผิดพลาด",
|
|
30
30
|
"Failed to load PDF file.": "ไม่สามารถโหลดไฟล์ PDF",
|
|
31
|
+
"File Uploading": "การอัพโหลดไฟล์",
|
|
31
32
|
"Filter": "กรอง",
|
|
32
33
|
"I agree to the Igloo": "ฉันเห็นด้วยกับกระท่อมน้ำแข็ง",
|
|
33
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.": "ข้าพเจ้ายืนยันว่าข้อความที่ข้าพเจ้าได้อธิบายข้างต้นนั้นเป็นความจริง และยืนยันว่าความเสียหายที่เกิดขึ้นนั้นเกิดจากอุบัติเหตุ ปราศจากการวางแผน หรือ การเห็นพ้องร่วมกันกับฝ่ายอื่น",
|
|
@@ -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": "ตกลง",
|
|
@@ -49,6 +51,7 @@
|
|
|
49
51
|
"Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.": "หากตรวจสอบแล้วและต้องการยืนยันข้อมูลข้างต้น กรุณากดดำเนินการต่อและยืนยันการเคลมของคุณ",
|
|
50
52
|
"Optional": "ไม่จำเป็น",
|
|
51
53
|
"Other Reason": "เหตุผลอื่น",
|
|
54
|
+
"Photo Uploading": "การอัพโหลดรูปภาพ",
|
|
52
55
|
"Please enter a valid date.": "กรุณากรอกวันที่ถูกต้อง",
|
|
53
56
|
"Please enter a valid time.": "กรุณากรอกเวลาที่ถูกต้อง",
|
|
54
57
|
"Please input a date after {date}": "กรุณาใส่วันที่หลัง {date}",
|
|
@@ -28,6 +28,7 @@
|
|
|
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
30
|
"Failed to load PDF file.": "Không tải được tệp PDF.",
|
|
31
|
+
"File Uploading": "Tải lên tệp",
|
|
31
32
|
"Filter": "Lọc",
|
|
32
33
|
"I agree to the Igloo": "Tôi đồng ý với Igloo",
|
|
33
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.",
|
|
@@ -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",
|
|
@@ -49,6 +51,7 @@
|
|
|
49
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.",
|
|
50
52
|
"Optional": "Không bắt buộc",
|
|
51
53
|
"Other Reason": "Lý do khác",
|
|
54
|
+
"Photo Uploading": "Tải ảnh lên",
|
|
52
55
|
"Please enter a valid date.": "Vui lòng nhập đúng ngày:",
|
|
53
56
|
"Please enter a valid time.": "Vui lòng nhập thời gian hợp lệ.",
|
|
54
57
|
"Please input a date after {date}": "Vui lòng nhập ngày sau {date}",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"Enter the password to open this PDF file.": "输入密码后预览该文件",
|
|
29
29
|
"Error Report": "错误报告",
|
|
30
30
|
"Failed to load PDF file.": "PDF文件加载失败",
|
|
31
|
+
"File Uploading": "文件上传中",
|
|
31
32
|
"Filter": "过滤条件",
|
|
32
33
|
"I agree to the Igloo": "我同意Igloo",
|
|
33
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.": "我承诺上述信息均真实有效,并且物品遗失纯属意外。",
|
|
@@ -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": "确定",
|
|
@@ -49,6 +51,7 @@
|
|
|
49
51
|
"Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.": "如您对上述填写内容满意,在勾选以下申明后,请继续提交您的理赔申请。",
|
|
50
52
|
"Optional": "可选",
|
|
51
53
|
"Other Reason": "其他原因",
|
|
54
|
+
"Photo Uploading": "图片上传中",
|
|
52
55
|
"Please enter a valid date.": "请输入一个有效的日期。",
|
|
53
56
|
"Please enter a valid time.": "请输入一个有效的时间。",
|
|
54
57
|
"Please input a date after {date}": "请输入一个{date}之后的日期",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"Enter the password to open this PDF file.": "",
|
|
29
29
|
"Error Report": "錯誤報告",
|
|
30
30
|
"Failed to load PDF file.": "",
|
|
31
|
+
"File Uploading": "文件上傳",
|
|
31
32
|
"Filter": "篩選",
|
|
32
33
|
"I agree to the Igloo": "",
|
|
33
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.": "我聲明我上面描述的陳述是真的。我進一步宣布發生損失是偶然的,沒有規劃或與其他方的共識。",
|
|
@@ -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": "",
|
|
@@ -49,6 +51,7 @@
|
|
|
49
51
|
"Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.": "一旦您對上述內容感到滿意,您已檢查聲明,請繼續並提交您的索賠。",
|
|
50
52
|
"Optional": "可選項",
|
|
51
53
|
"Other Reason": "其他原因",
|
|
54
|
+
"Photo Uploading": "照片上傳",
|
|
52
55
|
"Please enter a valid date.": "請輸入有效的日期。",
|
|
53
56
|
"Please enter a valid time.": "請輸入有效的時間。",
|
|
54
57
|
"Please input a date after {date}": "",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC, IglooComponentProps, FormItemExtraConfig } from '../types';
|
|
2
|
+
export interface OutputMap {
|
|
3
|
+
field: string[];
|
|
4
|
+
source: string[];
|
|
5
|
+
format?: string;
|
|
6
|
+
formatType?: string;
|
|
7
|
+
}
|
|
8
|
+
interface OCRProps extends IglooComponentProps, FormItemExtraConfig {
|
|
9
|
+
ocrConfig: {
|
|
10
|
+
vendor: string;
|
|
11
|
+
outputMap: OutputMap[];
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
declare const OCR: FC<OCRProps>;
|
|
15
|
+
export default OCR;
|
package/es/ocr/index.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var _excluded = ["ocrConfig"];
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
+
|
|
11
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
|
+
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import MicroBlink from './micro-blink';
|
|
15
|
+
|
|
16
|
+
var OCR = function OCR(props) {
|
|
17
|
+
var ocrConfig = props.ocrConfig,
|
|
18
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
19
|
+
|
|
20
|
+
var vendor = ocrConfig.vendor,
|
|
21
|
+
outputMap = ocrConfig.outputMap;
|
|
22
|
+
|
|
23
|
+
switch (vendor) {
|
|
24
|
+
case 'microBlink':
|
|
25
|
+
return _jsx(MicroBlink, _objectSpread({
|
|
26
|
+
outputMap: outputMap
|
|
27
|
+
}, rest));
|
|
28
|
+
|
|
29
|
+
default:
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
OCR.formItemPropsHandler = function (config) {
|
|
35
|
+
return {};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default OCR;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC, IglooComponentProps, FormItemExtraConfig } from '../../types';
|
|
2
|
+
import { OutputMap } from '../index';
|
|
3
|
+
import './style';
|
|
4
|
+
interface MicroBlinkProps extends IglooComponentProps, FormItemExtraConfig {
|
|
5
|
+
outputMap: OutputMap[];
|
|
6
|
+
}
|
|
7
|
+
declare const MicroBlink: FC<MicroBlinkProps>;
|
|
8
|
+
export default MicroBlink;
|