iglooform 2.5.10 → 2.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/form/elements.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/input/index.d.ts +1 -0
- package/es/input/index.js +1 -0
- package/es/input/input-id.d.ts +6 -0
- package/es/input/input-id.js +112 -0
- package/es/input/input-number.js +0 -14
- package/es/locale/en-US/messages.json +1 -0
- package/es/locale/id-ID/messages.json +1 -0
- package/es/locale/th-TH/messages.json +1 -0
- package/es/locale/vi-VN/messages.json +1 -0
- package/es/locale/zh-CN/messages.json +1 -0
- package/es/locale/zh-TW/messages.json +1 -0
- package/lib/form/elements.js +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +7 -0
- package/lib/input/index.d.ts +1 -0
- package/lib/input/index.js +8 -0
- package/lib/input/input-id.d.ts +6 -0
- package/lib/input/input-id.js +127 -0
- package/lib/input/input-number.js +0 -14
- package/lib/locale/en-US/messages.json +1 -0
- package/lib/locale/id-ID/messages.json +1 -0
- package/lib/locale/th-TH/messages.json +1 -0
- package/lib/locale/vi-VN/messages.json +1 -0
- package/lib/locale/zh-CN/messages.json +1 -0
- package/lib/locale/zh-TW/messages.json +1 -0
- package/package.json +1 -1
package/es/form/elements.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import Button from '../button';
|
|
3
3
|
import Radio, { RadioGroup, RadioGroupWithOther } from '../radio';
|
|
4
|
-
import Input, { PhoneNumber, Amount, Email, Password, InputNumber, TextArea, InputDate, CreditCard, Otp, ExpiryDate } from '../input';
|
|
4
|
+
import Input, { PhoneNumber, Amount, Email, Password, InputNumber, TextArea, InputDate, CreditCard, Otp, ExpiryDate, InputId } from '../input';
|
|
5
5
|
import DatePicker, { IglooBuddhistDatePicker as BuddhistDatePicker, IglooRangePicker as RangePicker, IglooWeekPicker as WeekPicker, IglooMonthPicker as MonthPicker } from '../date-picker';
|
|
6
6
|
import Confirmation from '../confirmation';
|
|
7
7
|
import { AttachedSelect as Select, TimeSelect } from '../select';
|
|
@@ -18,6 +18,7 @@ var elementMap = {
|
|
|
18
18
|
PhoneNumber: PhoneNumber,
|
|
19
19
|
Amount: Amount,
|
|
20
20
|
InputNumber: InputNumber,
|
|
21
|
+
InputId: InputId,
|
|
21
22
|
TextArea: TextArea,
|
|
22
23
|
DatePicker: DatePicker,
|
|
23
24
|
CreditCard: CreditCard,
|
package/es/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as Form } from './form';
|
|
2
2
|
export { default as Button, GreenButton, YellowButton, RedButton, } from './button';
|
|
3
3
|
export { default as DatePicker, IglooBuddhistDatePicker as BuddhistDatePicker, IglooRangePicker as RangePicker, IglooWeekPicker as WeekPicker, IglooMonthPicker as MonthPicker, } from './date-picker';
|
|
4
|
-
export { default as Input, PhoneNumber, Amount, Password, Email, InputNumber, TextArea, InputDate, CreditCard, ExpiryDate, } from './input';
|
|
4
|
+
export { default as Input, PhoneNumber, Amount, Password, Email, InputNumber, TextArea, InputDate, CreditCard, ExpiryDate, InputId, } from './input';
|
|
5
5
|
export { default as Select, TimeSelect, AttachedSelect } from './select';
|
|
6
6
|
export { default as Radio, RadioGroup, RadioGroupWithOther } from './radio';
|
|
7
7
|
export { default as Example } from './example';
|
package/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as Form } from './form';
|
|
2
2
|
export { default as Button, GreenButton, YellowButton, RedButton } from './button';
|
|
3
3
|
export { default as DatePicker, IglooBuddhistDatePicker as BuddhistDatePicker, IglooRangePicker as RangePicker, IglooWeekPicker as WeekPicker, IglooMonthPicker as MonthPicker } from './date-picker';
|
|
4
|
-
export { default as Input, PhoneNumber, Amount, Password, Email, InputNumber, TextArea, InputDate, CreditCard, ExpiryDate } from './input';
|
|
4
|
+
export { default as Input, PhoneNumber, Amount, Password, Email, InputNumber, TextArea, InputDate, CreditCard, ExpiryDate, InputId } from './input';
|
|
5
5
|
export { default as Select, TimeSelect, AttachedSelect } from './select';
|
|
6
6
|
export { default as Radio, RadioGroup, RadioGroupWithOther } from './radio';
|
|
7
7
|
export { default as Example } from './example';
|
package/es/input/index.d.ts
CHANGED
|
@@ -8,5 +8,6 @@ export { default as InputDate } from './input-date';
|
|
|
8
8
|
export { default as CreditCard } from './credit-card';
|
|
9
9
|
export { default as Otp } from './otp';
|
|
10
10
|
export { default as ExpiryDate } from './expiry-date';
|
|
11
|
+
export { default as InputId } from './input-id';
|
|
11
12
|
import IglooInput from './input';
|
|
12
13
|
export default IglooInput;
|
package/es/input/index.js
CHANGED
|
@@ -8,5 +8,6 @@ export { default as InputDate } from './input-date';
|
|
|
8
8
|
export { default as CreditCard } from './credit-card';
|
|
9
9
|
export { default as Otp } from './otp';
|
|
10
10
|
export { default as ExpiryDate } from './expiry-date';
|
|
11
|
+
export { default as InputId } from './input-id';
|
|
11
12
|
import IglooInput from './input';
|
|
12
13
|
export default IglooInput;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import "antd/es/input/style";
|
|
2
|
+
import _Input from "antd/es/input";
|
|
3
|
+
|
|
4
|
+
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; }
|
|
5
|
+
|
|
6
|
+
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; }
|
|
7
|
+
|
|
8
|
+
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; }
|
|
9
|
+
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import omit from 'omit.js';
|
|
12
|
+
import formMethods from '../utils/form-methods';
|
|
13
|
+
import { staticFormatMessage as formatMessage } from '../locale';
|
|
14
|
+
import './style/index.less';
|
|
15
|
+
|
|
16
|
+
var InputId = function InputId(props) {
|
|
17
|
+
return _jsx(_Input, _objectSpread(_objectSpread({
|
|
18
|
+
className: "igloo-input"
|
|
19
|
+
}, omit(props, formMethods)), {}, {
|
|
20
|
+
type: "number"
|
|
21
|
+
}));
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
InputId.formItemPropsHandler = function (config) {
|
|
25
|
+
var length = config.length,
|
|
26
|
+
maxLength = config.maxLength,
|
|
27
|
+
minLength = config.minLength,
|
|
28
|
+
label = config.label,
|
|
29
|
+
idType = config.idType;
|
|
30
|
+
var rules = [];
|
|
31
|
+
|
|
32
|
+
if (length !== undefined) {
|
|
33
|
+
rules.push({
|
|
34
|
+
validator: function validator(_, value) {
|
|
35
|
+
if (value === undefined || value === null || String(value).length === length) return Promise.resolve();
|
|
36
|
+
return Promise.reject(formatMessage({
|
|
37
|
+
id: '{label} must be {length} digits.',
|
|
38
|
+
values: {
|
|
39
|
+
length: length,
|
|
40
|
+
label: label
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (maxLength !== undefined && minLength !== undefined) {
|
|
48
|
+
rules.push({
|
|
49
|
+
validator: function validator(_, value) {
|
|
50
|
+
if (value === undefined || value === null || String(value).length >= minLength && String(value).length <= maxLength) return Promise.resolve();
|
|
51
|
+
return Promise.reject(formatMessage({
|
|
52
|
+
id: '{label} must be {minLength} - {maxLength} digits.',
|
|
53
|
+
values: {
|
|
54
|
+
maxLength: maxLength,
|
|
55
|
+
minLength: minLength,
|
|
56
|
+
label: label
|
|
57
|
+
}
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (maxLength !== undefined && minLength === undefined) {
|
|
64
|
+
rules.push({
|
|
65
|
+
validator: function validator(_, value) {
|
|
66
|
+
if (value === undefined || value === null || String(value).length <= maxLength) return Promise.resolve();
|
|
67
|
+
return Promise.reject(formatMessage({
|
|
68
|
+
id: '{label} must be less than {maxLength} digits.',
|
|
69
|
+
values: {
|
|
70
|
+
maxLength: maxLength,
|
|
71
|
+
label: label
|
|
72
|
+
}
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (maxLength === undefined && minLength !== undefined) {
|
|
79
|
+
rules.push({
|
|
80
|
+
validator: function validator(_, value) {
|
|
81
|
+
if (value === undefined || value === null || String(value).length >= minLength) return Promise.resolve();
|
|
82
|
+
return Promise.reject(formatMessage({
|
|
83
|
+
id: '{label} must be at least {minLength} digits.',
|
|
84
|
+
values: {
|
|
85
|
+
minLength: minLength,
|
|
86
|
+
label: label
|
|
87
|
+
}
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (idType === 'KTP') {
|
|
94
|
+
rules.push({
|
|
95
|
+
validator: function validator(rule, value) {
|
|
96
|
+
if (!/^((1[1-9])|(21)|([37][1-6])|(5[1-4])|(6[1-5])|([8-9][1-2]))[0-9]{4}(([0-6][0-9])|(7[0-1]))((0[1-9])|(1[0-2]))[0-9]{6}$/.test(value)) {
|
|
97
|
+
return Promise.reject(formatMessage({
|
|
98
|
+
id: 'Invalid KTP Number.'
|
|
99
|
+
}));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return Promise.resolve();
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return {
|
|
108
|
+
rules: rules
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export default InputId;
|
package/es/input/input-number.js
CHANGED
|
@@ -108,20 +108,6 @@ IglooInputNumber.formItemPropsHandler = function (config) {
|
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
if (idType === 'KTP') {
|
|
112
|
-
rules.push({
|
|
113
|
-
validator: function validator(rule, value) {
|
|
114
|
-
if (!/^((1[1-9])|(21)|([37][1-6])|(5[1-4])|(6[1-5])|([8-9][1-2]))[0-9]{4}(([0-6][0-9])|(7[0-1]))((0[1-9])|(1[0-2]))[0-9]{6}$/.test(value)) {
|
|
115
|
-
return Promise.reject(staticFormatMessage({
|
|
116
|
-
id: 'Invalid KTP Number.'
|
|
117
|
-
}));
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return Promise.resolve();
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
|
|
125
111
|
return {
|
|
126
112
|
getValueFromEvent: function getValueFromEvent(e) {
|
|
127
113
|
var value = e.target.value;
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"I agree to the Igloo": "I agree to the Igloo",
|
|
30
30
|
"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.",
|
|
31
31
|
"Import": "Import",
|
|
32
|
+
"Invalid KTP Number.": "Invalid KTP Number.",
|
|
32
33
|
"It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.",
|
|
33
34
|
"Last 7 Days": "Last 7 Days",
|
|
34
35
|
"Last Day": "Last Day",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"I agree to the Igloo": "Saya setuju dengan Igloo",
|
|
30
30
|
"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.",
|
|
31
31
|
"Import": "Impor",
|
|
32
|
+
"Invalid KTP Number.": "Số KTP không hợp lệ.",
|
|
32
33
|
"It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "Direkomendasikan untuk memilih tidak lebih dari {colMax} metrik untuk memastikan sudut pandang default dari setiap isi kolom.",
|
|
33
34
|
"Last 7 Days": "7 hari terakhir",
|
|
34
35
|
"Last Day": "hari terakhir",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"I agree to the Igloo": "ฉันเห็นด้วยกับกระท่อมน้ำแข็ง",
|
|
30
30
|
"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.": "ข้าพเจ้ายืนยันว่าข้อความที่ข้าพเจ้าได้อธิบายข้างต้นนั้นเป็นความจริง และยืนยันว่าความเสียหายที่เกิดขึ้นนั้นเกิดจากอุบัติเหตุ ปราศจากการวางแผน หรือ การเห็นพ้องร่วมกันกับฝ่ายอื่น",
|
|
31
31
|
"Import": "นำเข้า",
|
|
32
|
+
"Invalid KTP Number.": "",
|
|
32
33
|
"It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "แนะนำให้เลือกจำนวนไม่เกิน {colMax} เพื่อให้แน่ใจว่ามองเห็นค่าเริ่มต้นของข้อมูลแต่ละคอลัมน์",
|
|
33
34
|
"Last 7 Days": "เมื่อ 7 วันที่แล้ว",
|
|
34
35
|
"Last Day": "วันสุดท้าย",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"I agree to the Igloo": "Tôi đồng ý với Igloo",
|
|
30
30
|
"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.",
|
|
31
31
|
"Import": "Nhập",
|
|
32
|
+
"Invalid KTP Number.": "",
|
|
32
33
|
"It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "Vui lòng chọn không quá {colMax} cột.",
|
|
33
34
|
"Last 7 Days": "7 ngày gần nhất",
|
|
34
35
|
"Last Day": "ngày cuối",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"I agree to the Igloo": "我同意Igloo",
|
|
30
30
|
"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.": "我承诺上述信息均真实有效,并且物品遗失纯属意外。",
|
|
31
31
|
"Import": "导入",
|
|
32
|
+
"Invalid KTP Number.": "",
|
|
32
33
|
"It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "建议不要选择超过{colMax}个字段,以确保最佳展示效果。",
|
|
33
34
|
"Last 7 Days": "过去7天",
|
|
34
35
|
"Last Day": "昨天",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"I agree to the Igloo": "",
|
|
30
30
|
"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.": "我聲明我上面描述的陳述是真的。我進一步宣布發生損失是偶然的,沒有規劃或與其他方的共識。",
|
|
31
31
|
"Import": "導入",
|
|
32
|
+
"Invalid KTP Number.": "",
|
|
32
33
|
"It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "建議選擇不超過{colMax}指標以確保每個列輸入的默認可見性。",
|
|
33
34
|
"Last 7 Days": "過去7天",
|
|
34
35
|
"Last Day": "過去1天",
|
package/lib/form/elements.js
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as Form } from './form';
|
|
2
2
|
export { default as Button, GreenButton, YellowButton, RedButton, } from './button';
|
|
3
3
|
export { default as DatePicker, IglooBuddhistDatePicker as BuddhistDatePicker, IglooRangePicker as RangePicker, IglooWeekPicker as WeekPicker, IglooMonthPicker as MonthPicker, } from './date-picker';
|
|
4
|
-
export { default as Input, PhoneNumber, Amount, Password, Email, InputNumber, TextArea, InputDate, CreditCard, ExpiryDate, } from './input';
|
|
4
|
+
export { default as Input, PhoneNumber, Amount, Password, Email, InputNumber, TextArea, InputDate, CreditCard, ExpiryDate, InputId, } from './input';
|
|
5
5
|
export { default as Select, TimeSelect, AttachedSelect } from './select';
|
|
6
6
|
export { default as Radio, RadioGroup, RadioGroupWithOther } from './radio';
|
|
7
7
|
export { default as Example } from './example';
|
package/lib/index.js
CHANGED
|
@@ -26,6 +26,7 @@ var _exportNames = {
|
|
|
26
26
|
InputDate: true,
|
|
27
27
|
CreditCard: true,
|
|
28
28
|
ExpiryDate: true,
|
|
29
|
+
InputId: true,
|
|
29
30
|
Select: true,
|
|
30
31
|
TimeSelect: true,
|
|
31
32
|
AttachedSelect: true,
|
|
@@ -310,6 +311,12 @@ Object.defineProperty(exports, "InputDate", {
|
|
|
310
311
|
return _input.InputDate;
|
|
311
312
|
}
|
|
312
313
|
});
|
|
314
|
+
Object.defineProperty(exports, "InputId", {
|
|
315
|
+
enumerable: true,
|
|
316
|
+
get: function get() {
|
|
317
|
+
return _input.InputId;
|
|
318
|
+
}
|
|
319
|
+
});
|
|
313
320
|
Object.defineProperty(exports, "InputNumber", {
|
|
314
321
|
enumerable: true,
|
|
315
322
|
get: function get() {
|
package/lib/input/index.d.ts
CHANGED
|
@@ -8,5 +8,6 @@ export { default as InputDate } from './input-date';
|
|
|
8
8
|
export { default as CreditCard } from './credit-card';
|
|
9
9
|
export { default as Otp } from './otp';
|
|
10
10
|
export { default as ExpiryDate } from './expiry-date';
|
|
11
|
+
export { default as InputId } from './input-id';
|
|
11
12
|
import IglooInput from './input';
|
|
12
13
|
export default IglooInput;
|
package/lib/input/index.js
CHANGED
|
@@ -33,6 +33,12 @@ Object.defineProperty(exports, "InputDate", {
|
|
|
33
33
|
return _inputDate.default;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
+
Object.defineProperty(exports, "InputId", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function get() {
|
|
39
|
+
return _inputId.default;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
36
42
|
Object.defineProperty(exports, "InputNumber", {
|
|
37
43
|
enumerable: true,
|
|
38
44
|
get: function get() {
|
|
@@ -85,6 +91,8 @@ var _otp = _interopRequireDefault(require("./otp"));
|
|
|
85
91
|
|
|
86
92
|
var _expiryDate = _interopRequireDefault(require("./expiry-date"));
|
|
87
93
|
|
|
94
|
+
var _inputId = _interopRequireDefault(require("./input-id"));
|
|
95
|
+
|
|
88
96
|
var _input = _interopRequireDefault(require("./input"));
|
|
89
97
|
|
|
90
98
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
require("antd/es/input/style");
|
|
9
|
+
|
|
10
|
+
var _input = _interopRequireDefault(require("antd/es/input"));
|
|
11
|
+
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
|
|
14
|
+
var _omit = _interopRequireDefault(require("omit.js"));
|
|
15
|
+
|
|
16
|
+
var _formMethods = _interopRequireDefault(require("../utils/form-methods"));
|
|
17
|
+
|
|
18
|
+
var _locale = require("../locale");
|
|
19
|
+
|
|
20
|
+
require("./style/index.less");
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
var InputId = function InputId(props) {
|
|
31
|
+
return (0, _jsxRuntime.jsx)(_input.default, _objectSpread(_objectSpread({
|
|
32
|
+
className: "igloo-input"
|
|
33
|
+
}, (0, _omit.default)(props, _formMethods.default)), {}, {
|
|
34
|
+
type: "number"
|
|
35
|
+
}));
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
InputId.formItemPropsHandler = function (config) {
|
|
39
|
+
var length = config.length,
|
|
40
|
+
maxLength = config.maxLength,
|
|
41
|
+
minLength = config.minLength,
|
|
42
|
+
label = config.label,
|
|
43
|
+
idType = config.idType;
|
|
44
|
+
var rules = [];
|
|
45
|
+
|
|
46
|
+
if (length !== undefined) {
|
|
47
|
+
rules.push({
|
|
48
|
+
validator: function validator(_, value) {
|
|
49
|
+
if (value === undefined || value === null || String(value).length === length) return Promise.resolve();
|
|
50
|
+
return Promise.reject((0, _locale.staticFormatMessage)({
|
|
51
|
+
id: '{label} must be {length} digits.',
|
|
52
|
+
values: {
|
|
53
|
+
length: length,
|
|
54
|
+
label: label
|
|
55
|
+
}
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (maxLength !== undefined && minLength !== undefined) {
|
|
62
|
+
rules.push({
|
|
63
|
+
validator: function validator(_, value) {
|
|
64
|
+
if (value === undefined || value === null || String(value).length >= minLength && String(value).length <= maxLength) return Promise.resolve();
|
|
65
|
+
return Promise.reject((0, _locale.staticFormatMessage)({
|
|
66
|
+
id: '{label} must be {minLength} - {maxLength} digits.',
|
|
67
|
+
values: {
|
|
68
|
+
maxLength: maxLength,
|
|
69
|
+
minLength: minLength,
|
|
70
|
+
label: label
|
|
71
|
+
}
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (maxLength !== undefined && minLength === undefined) {
|
|
78
|
+
rules.push({
|
|
79
|
+
validator: function validator(_, value) {
|
|
80
|
+
if (value === undefined || value === null || String(value).length <= maxLength) return Promise.resolve();
|
|
81
|
+
return Promise.reject((0, _locale.staticFormatMessage)({
|
|
82
|
+
id: '{label} must be less than {maxLength} digits.',
|
|
83
|
+
values: {
|
|
84
|
+
maxLength: maxLength,
|
|
85
|
+
label: label
|
|
86
|
+
}
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (maxLength === undefined && minLength !== undefined) {
|
|
93
|
+
rules.push({
|
|
94
|
+
validator: function validator(_, value) {
|
|
95
|
+
if (value === undefined || value === null || String(value).length >= minLength) return Promise.resolve();
|
|
96
|
+
return Promise.reject((0, _locale.staticFormatMessage)({
|
|
97
|
+
id: '{label} must be at least {minLength} digits.',
|
|
98
|
+
values: {
|
|
99
|
+
minLength: minLength,
|
|
100
|
+
label: label
|
|
101
|
+
}
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (idType === 'KTP') {
|
|
108
|
+
rules.push({
|
|
109
|
+
validator: function validator(rule, value) {
|
|
110
|
+
if (!/^((1[1-9])|(21)|([37][1-6])|(5[1-4])|(6[1-5])|([8-9][1-2]))[0-9]{4}(([0-6][0-9])|(7[0-1]))((0[1-9])|(1[0-2]))[0-9]{6}$/.test(value)) {
|
|
111
|
+
return Promise.reject((0, _locale.staticFormatMessage)({
|
|
112
|
+
id: 'Invalid KTP Number.'
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return Promise.resolve();
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return {
|
|
122
|
+
rules: rules
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
var _default = InputId;
|
|
127
|
+
exports.default = _default;
|
|
@@ -122,20 +122,6 @@ IglooInputNumber.formItemPropsHandler = function (config) {
|
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
if (idType === 'KTP') {
|
|
126
|
-
rules.push({
|
|
127
|
-
validator: function validator(rule, value) {
|
|
128
|
-
if (!/^((1[1-9])|(21)|([37][1-6])|(5[1-4])|(6[1-5])|([8-9][1-2]))[0-9]{4}(([0-6][0-9])|(7[0-1]))((0[1-9])|(1[0-2]))[0-9]{6}$/.test(value)) {
|
|
129
|
-
return Promise.reject((0, _locale.staticFormatMessage)({
|
|
130
|
-
id: 'Invalid KTP Number.'
|
|
131
|
-
}));
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return Promise.resolve();
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
|
|
139
125
|
return {
|
|
140
126
|
getValueFromEvent: function getValueFromEvent(e) {
|
|
141
127
|
var value = e.target.value;
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"I agree to the Igloo": "I agree to the Igloo",
|
|
30
30
|
"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.",
|
|
31
31
|
"Import": "Import",
|
|
32
|
+
"Invalid KTP Number.": "Invalid KTP Number.",
|
|
32
33
|
"It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.",
|
|
33
34
|
"Last 7 Days": "Last 7 Days",
|
|
34
35
|
"Last Day": "Last Day",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"I agree to the Igloo": "Saya setuju dengan Igloo",
|
|
30
30
|
"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.",
|
|
31
31
|
"Import": "Impor",
|
|
32
|
+
"Invalid KTP Number.": "Số KTP không hợp lệ.",
|
|
32
33
|
"It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "Direkomendasikan untuk memilih tidak lebih dari {colMax} metrik untuk memastikan sudut pandang default dari setiap isi kolom.",
|
|
33
34
|
"Last 7 Days": "7 hari terakhir",
|
|
34
35
|
"Last Day": "hari terakhir",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"I agree to the Igloo": "ฉันเห็นด้วยกับกระท่อมน้ำแข็ง",
|
|
30
30
|
"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.": "ข้าพเจ้ายืนยันว่าข้อความที่ข้าพเจ้าได้อธิบายข้างต้นนั้นเป็นความจริง และยืนยันว่าความเสียหายที่เกิดขึ้นนั้นเกิดจากอุบัติเหตุ ปราศจากการวางแผน หรือ การเห็นพ้องร่วมกันกับฝ่ายอื่น",
|
|
31
31
|
"Import": "นำเข้า",
|
|
32
|
+
"Invalid KTP Number.": "",
|
|
32
33
|
"It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "แนะนำให้เลือกจำนวนไม่เกิน {colMax} เพื่อให้แน่ใจว่ามองเห็นค่าเริ่มต้นของข้อมูลแต่ละคอลัมน์",
|
|
33
34
|
"Last 7 Days": "เมื่อ 7 วันที่แล้ว",
|
|
34
35
|
"Last Day": "วันสุดท้าย",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"I agree to the Igloo": "Tôi đồng ý với Igloo",
|
|
30
30
|
"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.",
|
|
31
31
|
"Import": "Nhập",
|
|
32
|
+
"Invalid KTP Number.": "",
|
|
32
33
|
"It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "Vui lòng chọn không quá {colMax} cột.",
|
|
33
34
|
"Last 7 Days": "7 ngày gần nhất",
|
|
34
35
|
"Last Day": "ngày cuối",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"I agree to the Igloo": "我同意Igloo",
|
|
30
30
|
"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.": "我承诺上述信息均真实有效,并且物品遗失纯属意外。",
|
|
31
31
|
"Import": "导入",
|
|
32
|
+
"Invalid KTP Number.": "",
|
|
32
33
|
"It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "建议不要选择超过{colMax}个字段,以确保最佳展示效果。",
|
|
33
34
|
"Last 7 Days": "过去7天",
|
|
34
35
|
"Last Day": "昨天",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"I agree to the Igloo": "",
|
|
30
30
|
"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.": "我聲明我上面描述的陳述是真的。我進一步宣布發生損失是偶然的,沒有規劃或與其他方的共識。",
|
|
31
31
|
"Import": "導入",
|
|
32
|
+
"Invalid KTP Number.": "",
|
|
32
33
|
"It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "建議選擇不超過{colMax}指標以確保每個列輸入的默認可見性。",
|
|
33
34
|
"Last 7 Days": "過去7天",
|
|
34
35
|
"Last Day": "過去1天",
|