iglooform 3.3.6 → 3.3.8
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 +1 -1
- package/es/button/style/index.less +24 -20
- package/es/utils/option-utils.js +19 -15
- package/lib/button/style/index.less +24 -20
- package/lib/utils/option-utils.js +19 -15
- package/package.json +1 -1
- package/es/form/hsteps/index.d.ts +0 -21
- package/es/form/step-items-selection/components/section-of-item-condition/hooks/useAdaptAssertConfig.d.ts +0 -4
- package/es/index.d.ts +0 -49
- package/es/types.d.ts +0 -189
- package/es/utils/form-utils.d.ts +0 -79
- package/lib/form/hsteps/index.d.ts +0 -21
- package/lib/form/step-items-selection/components/section-of-item-condition/hooks/useAdaptAssertConfig.d.ts +0 -4
- package/lib/index.d.ts +0 -49
- package/lib/types.d.ts +0 -189
- package/lib/utils/form-utils.d.ts +0 -79
|
@@ -30,7 +30,7 @@ export default function DumiContextWrapper() {
|
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
32
|
<SiteContext.Provider value={{
|
|
33
|
-
pkg: {"name":"iglooform","version":"3.3.
|
|
33
|
+
pkg: {"name":"iglooform","version":"3.3.6","license":"MIT"},
|
|
34
34
|
historyType: "browser",
|
|
35
35
|
entryExports,
|
|
36
36
|
demos,
|
|
@@ -68,16 +68,18 @@
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
&:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
71
|
+
&:not(:disabled):not(.ant-btn-disabled) {
|
|
72
|
+
&:hover {
|
|
73
|
+
color: @btn-default-hover-color;
|
|
74
|
+
border-color: @btn-default-hover-border-color;
|
|
75
|
+
background-color: @btn-default-hover-backgroud-color;
|
|
76
|
+
}
|
|
77
|
+
&:active,
|
|
78
|
+
&:focus {
|
|
79
|
+
color: @btn-default-focus-color;
|
|
80
|
+
border-color: @btn-default-focus-border-color;
|
|
81
|
+
background-color: @btn-default-focus-backgroud-color;
|
|
82
|
+
}
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
|
|
@@ -105,16 +107,18 @@
|
|
|
105
107
|
}
|
|
106
108
|
}
|
|
107
109
|
|
|
108
|
-
&:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
110
|
+
&:not(:disabled):not(.ant-btn-disabled) {
|
|
111
|
+
&:hover {
|
|
112
|
+
color: @btn-primary-hover-color;
|
|
113
|
+
border-color: @btn-primary-hover-border-color;
|
|
114
|
+
background-color: @btn-primary-hover-backgroud-color;
|
|
115
|
+
}
|
|
116
|
+
&:active,
|
|
117
|
+
&:focus {
|
|
118
|
+
color: @btn-primary-focus-color;
|
|
119
|
+
border-color: @btn-primary-focus-border-color;
|
|
120
|
+
background-color: @btn-primary-focus-backgroud-color;
|
|
121
|
+
}
|
|
118
122
|
}
|
|
119
123
|
}
|
|
120
124
|
|
package/es/utils/option-utils.js
CHANGED
|
@@ -22,6 +22,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
22
22
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
23
23
|
import { useEffect, useState, useContext, useRef } from 'react';
|
|
24
24
|
import FormContext from "../form-context";
|
|
25
|
+
import LocaleContext from "../locale/locale-context";
|
|
25
26
|
import invariant from 'invariant';
|
|
26
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
28
|
export var compareOptions = function compareOptions(newOptions, oldOptions) {
|
|
@@ -84,6 +85,8 @@ export function optionsHOC(Component) {
|
|
|
84
85
|
var optionsRef = useRef(_options);
|
|
85
86
|
var _useContext = useContext(FormContext),
|
|
86
87
|
selectDatasourceApi = _useContext.selectDatasourceApi;
|
|
88
|
+
var _useContext2 = useContext(LocaleContext),
|
|
89
|
+
currentLang = _useContext2.currentLang;
|
|
87
90
|
var getFormInstance = rest.getFormInstance;
|
|
88
91
|
var form = typeof getFormInstance === 'function' && getFormInstance();
|
|
89
92
|
var dependFieldValue = form && dependField && form.getFieldValue(dependField);
|
|
@@ -150,7 +153,7 @@ export function optionsHOC(Component) {
|
|
|
150
153
|
return _context.abrupt("return", _options2);
|
|
151
154
|
case 9:
|
|
152
155
|
if (!(selectDatasourceApi && datasourceKey)) {
|
|
153
|
-
_context.next =
|
|
156
|
+
_context.next = 31;
|
|
154
157
|
break;
|
|
155
158
|
}
|
|
156
159
|
if (!(dependField && dependFieldValue === undefined)) {
|
|
@@ -166,34 +169,35 @@ export function optionsHOC(Component) {
|
|
|
166
169
|
query += "&search_keyword=".concat(searchKey);
|
|
167
170
|
}
|
|
168
171
|
if (datasourceFilters) {
|
|
169
|
-
query =
|
|
172
|
+
query = query ? "".concat(query, "&") : query;
|
|
170
173
|
query += datasourceFilters.map(function (f) {
|
|
171
174
|
return "filter=".concat(f);
|
|
172
175
|
}).join('&');
|
|
173
176
|
}
|
|
174
177
|
api = "".concat(selectDatasourceApi, "/").concat(datasourceKey);
|
|
175
|
-
|
|
176
|
-
_context.
|
|
177
|
-
|
|
178
|
-
|
|
178
|
+
query = query ? "".concat(query, "&lang=").concat(currentLang) : "lang=".concat(currentLang);
|
|
179
|
+
_context.prev = 17;
|
|
180
|
+
_context.next = 20;
|
|
181
|
+
return fetch("".concat(api, "?").concat(query));
|
|
182
|
+
case 20:
|
|
179
183
|
rst = _context.sent;
|
|
180
|
-
_context.next =
|
|
184
|
+
_context.next = 23;
|
|
181
185
|
return rst.json();
|
|
182
|
-
case
|
|
186
|
+
case 23:
|
|
183
187
|
_yield$rst$json = _context.sent;
|
|
184
188
|
data = _yield$rst$json.data;
|
|
185
189
|
return _context.abrupt("return", data || []);
|
|
186
|
-
case
|
|
187
|
-
_context.prev =
|
|
188
|
-
_context.t0 = _context["catch"](
|
|
189
|
-
return _context.abrupt("return", []);
|
|
190
|
-
case 30:
|
|
190
|
+
case 28:
|
|
191
|
+
_context.prev = 28;
|
|
192
|
+
_context.t0 = _context["catch"](17);
|
|
191
193
|
return _context.abrupt("return", []);
|
|
192
194
|
case 31:
|
|
195
|
+
return _context.abrupt("return", []);
|
|
196
|
+
case 32:
|
|
193
197
|
case "end":
|
|
194
198
|
return _context.stop();
|
|
195
199
|
}
|
|
196
|
-
}, _callee, null, [[
|
|
200
|
+
}, _callee, null, [[17, 28]]);
|
|
197
201
|
}));
|
|
198
202
|
return function calcOptions() {
|
|
199
203
|
return _ref.apply(this, arguments);
|
|
@@ -206,7 +210,7 @@ export function optionsHOC(Component) {
|
|
|
206
210
|
}
|
|
207
211
|
setUpdating(false);
|
|
208
212
|
});
|
|
209
|
-
}, [options, optionsFromGetOptions, optionGroups, dependFieldValue, searchKey]);
|
|
213
|
+
}, [options, optionsFromGetOptions, optionGroups, dependFieldValue, searchKey, currentLang]);
|
|
210
214
|
return _options ? /*#__PURE__*/_jsx(Component, _objectSpread(_objectSpread({
|
|
211
215
|
options: _options
|
|
212
216
|
}, rest), {}, {
|
|
@@ -68,16 +68,18 @@
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
&:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
71
|
+
&:not(:disabled):not(.ant-btn-disabled) {
|
|
72
|
+
&:hover {
|
|
73
|
+
color: @btn-default-hover-color;
|
|
74
|
+
border-color: @btn-default-hover-border-color;
|
|
75
|
+
background-color: @btn-default-hover-backgroud-color;
|
|
76
|
+
}
|
|
77
|
+
&:active,
|
|
78
|
+
&:focus {
|
|
79
|
+
color: @btn-default-focus-color;
|
|
80
|
+
border-color: @btn-default-focus-border-color;
|
|
81
|
+
background-color: @btn-default-focus-backgroud-color;
|
|
82
|
+
}
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
|
|
@@ -105,16 +107,18 @@
|
|
|
105
107
|
}
|
|
106
108
|
}
|
|
107
109
|
|
|
108
|
-
&:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
110
|
+
&:not(:disabled):not(.ant-btn-disabled) {
|
|
111
|
+
&:hover {
|
|
112
|
+
color: @btn-primary-hover-color;
|
|
113
|
+
border-color: @btn-primary-hover-border-color;
|
|
114
|
+
background-color: @btn-primary-hover-backgroud-color;
|
|
115
|
+
}
|
|
116
|
+
&:active,
|
|
117
|
+
&:focus {
|
|
118
|
+
color: @btn-primary-focus-color;
|
|
119
|
+
border-color: @btn-primary-focus-border-color;
|
|
120
|
+
background-color: @btn-primary-focus-backgroud-color;
|
|
121
|
+
}
|
|
118
122
|
}
|
|
119
123
|
}
|
|
120
124
|
|
|
@@ -8,6 +8,7 @@ exports.optionsHOC = optionsHOC;
|
|
|
8
8
|
exports.previewSelectedOptions = previewSelectedOptions;
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _formContext = _interopRequireDefault(require("../form-context"));
|
|
11
|
+
var _localeContext = _interopRequireDefault(require("../locale/locale-context"));
|
|
11
12
|
var _invariant = _interopRequireDefault(require("invariant"));
|
|
12
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
var _excluded = ["options", "optionGroups", "getOptions", "datasourceFilters", "datasourceKey", "dependField", "children", "onSearch"];
|
|
@@ -95,6 +96,8 @@ function optionsHOC(Component) {
|
|
|
95
96
|
var optionsRef = (0, _react.useRef)(_options);
|
|
96
97
|
var _useContext = (0, _react.useContext)(_formContext.default),
|
|
97
98
|
selectDatasourceApi = _useContext.selectDatasourceApi;
|
|
99
|
+
var _useContext2 = (0, _react.useContext)(_localeContext.default),
|
|
100
|
+
currentLang = _useContext2.currentLang;
|
|
98
101
|
var getFormInstance = rest.getFormInstance;
|
|
99
102
|
var form = typeof getFormInstance === 'function' && getFormInstance();
|
|
100
103
|
var dependFieldValue = form && dependField && form.getFieldValue(dependField);
|
|
@@ -161,7 +164,7 @@ function optionsHOC(Component) {
|
|
|
161
164
|
return _context.abrupt("return", _options2);
|
|
162
165
|
case 9:
|
|
163
166
|
if (!(selectDatasourceApi && datasourceKey)) {
|
|
164
|
-
_context.next =
|
|
167
|
+
_context.next = 31;
|
|
165
168
|
break;
|
|
166
169
|
}
|
|
167
170
|
if (!(dependField && dependFieldValue === undefined)) {
|
|
@@ -177,34 +180,35 @@ function optionsHOC(Component) {
|
|
|
177
180
|
query += "&search_keyword=".concat(searchKey);
|
|
178
181
|
}
|
|
179
182
|
if (datasourceFilters) {
|
|
180
|
-
query =
|
|
183
|
+
query = query ? "".concat(query, "&") : query;
|
|
181
184
|
query += datasourceFilters.map(function (f) {
|
|
182
185
|
return "filter=".concat(f);
|
|
183
186
|
}).join('&');
|
|
184
187
|
}
|
|
185
188
|
api = "".concat(selectDatasourceApi, "/").concat(datasourceKey);
|
|
186
|
-
|
|
187
|
-
_context.
|
|
188
|
-
|
|
189
|
-
|
|
189
|
+
query = query ? "".concat(query, "&lang=").concat(currentLang) : "lang=".concat(currentLang);
|
|
190
|
+
_context.prev = 17;
|
|
191
|
+
_context.next = 20;
|
|
192
|
+
return fetch("".concat(api, "?").concat(query));
|
|
193
|
+
case 20:
|
|
190
194
|
rst = _context.sent;
|
|
191
|
-
_context.next =
|
|
195
|
+
_context.next = 23;
|
|
192
196
|
return rst.json();
|
|
193
|
-
case
|
|
197
|
+
case 23:
|
|
194
198
|
_yield$rst$json = _context.sent;
|
|
195
199
|
data = _yield$rst$json.data;
|
|
196
200
|
return _context.abrupt("return", data || []);
|
|
197
|
-
case
|
|
198
|
-
_context.prev =
|
|
199
|
-
_context.t0 = _context["catch"](
|
|
200
|
-
return _context.abrupt("return", []);
|
|
201
|
-
case 30:
|
|
201
|
+
case 28:
|
|
202
|
+
_context.prev = 28;
|
|
203
|
+
_context.t0 = _context["catch"](17);
|
|
202
204
|
return _context.abrupt("return", []);
|
|
203
205
|
case 31:
|
|
206
|
+
return _context.abrupt("return", []);
|
|
207
|
+
case 32:
|
|
204
208
|
case "end":
|
|
205
209
|
return _context.stop();
|
|
206
210
|
}
|
|
207
|
-
}, _callee, null, [[
|
|
211
|
+
}, _callee, null, [[17, 28]]);
|
|
208
212
|
}));
|
|
209
213
|
return function calcOptions() {
|
|
210
214
|
return _ref.apply(this, arguments);
|
|
@@ -217,7 +221,7 @@ function optionsHOC(Component) {
|
|
|
217
221
|
}
|
|
218
222
|
setUpdating(false);
|
|
219
223
|
});
|
|
220
|
-
}, [options, optionsFromGetOptions, optionGroups, dependFieldValue, searchKey]);
|
|
224
|
+
}, [options, optionsFromGetOptions, optionGroups, dependFieldValue, searchKey, currentLang]);
|
|
221
225
|
return _options ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, _objectSpread(_objectSpread({
|
|
222
226
|
options: _options
|
|
223
227
|
}, rest), {}, {
|
package/package.json
CHANGED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode } from 'react';
|
|
2
|
-
import { FormItemConfig, FormItemName } from '../../types';
|
|
3
|
-
import './style';
|
|
4
|
-
import { ConfirmationProps } from '../../confirmation';
|
|
5
|
-
export interface HStepsProps {
|
|
6
|
-
config: FormItemConfig & {
|
|
7
|
-
confirmations?: {
|
|
8
|
-
[key: string]: {
|
|
9
|
-
required: boolean;
|
|
10
|
-
confirmation?: ConfirmationProps;
|
|
11
|
-
requiredMessage?: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
withReview?: boolean;
|
|
15
|
-
description?: ReactNode;
|
|
16
|
-
};
|
|
17
|
-
parentName?: FormItemName;
|
|
18
|
-
name?: FormItemName;
|
|
19
|
-
}
|
|
20
|
-
declare const HSteps: FC<HStepsProps>;
|
|
21
|
-
export default HSteps;
|
package/es/index.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export { default as Form } from './form';
|
|
2
|
-
export { default as Button, GreenButton, YellowButton, RedButton, } from './button';
|
|
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, InputId, } from './input';
|
|
5
|
-
export { default as OCR } from './ocr';
|
|
6
|
-
export { default as Select, TimeSelect, AttachedSelect } from './select';
|
|
7
|
-
export { default as Radio, RadioGroup, RadioGroupWithOther } from './radio';
|
|
8
|
-
export { default as Upload } from './upload';
|
|
9
|
-
export { default as Checkbox, CheckboxGroup } from './checkbox';
|
|
10
|
-
export { default as Declaration } from './declaration';
|
|
11
|
-
export { Divider } from 'antd';
|
|
12
|
-
export { default as UploadPhoto } from './upload-photo';
|
|
13
|
-
export { default as AlertMessage } from './alert-message';
|
|
14
|
-
export { default as LoginPage } from './login-page';
|
|
15
|
-
export { default as UploadPreview } from './upload-preview';
|
|
16
|
-
export { default as Typography } from './typography';
|
|
17
|
-
export { default as PlatformCard } from './platform/platform-card';
|
|
18
|
-
export { default as SwitchPlatform } from './platform/switch-platform';
|
|
19
|
-
export { default as Table } from './table';
|
|
20
|
-
export { default as StatusBox } from './status-box';
|
|
21
|
-
export { CardPage, Card, CardGroup, CardItem } from './card-detail';
|
|
22
|
-
export { default as AdminMedia } from './media';
|
|
23
|
-
export { default as Documents } from './documents';
|
|
24
|
-
export { default as Filter } from './filter';
|
|
25
|
-
export { default as CurrencyContext } from './currency-context';
|
|
26
|
-
export { default as Tabs } from './tabs';
|
|
27
|
-
export { default as AdminAmount } from './admin-amount';
|
|
28
|
-
export { default as AdminUpload } from './admin-upload';
|
|
29
|
-
export { LocaleProvider } from './locale';
|
|
30
|
-
export { default as Modal } from './modal';
|
|
31
|
-
export { default as BackTop } from './back-top';
|
|
32
|
-
export { default as MediaPreview } from './upload-preview/media';
|
|
33
|
-
export { default as PolicyList } from './policy-list';
|
|
34
|
-
export { default as ClaimList } from './claim-list';
|
|
35
|
-
export { default as MobileInsurerDetail } from './mobile-insurer-detail';
|
|
36
|
-
export { default as Layout } from './layout';
|
|
37
|
-
export { default as DetailPanel } from './detail-panel';
|
|
38
|
-
export { default as message } from './message';
|
|
39
|
-
export { default as SearchBox } from './search-box';
|
|
40
|
-
export { default as FreeForm } from './free-form';
|
|
41
|
-
export { default as FormItem } from './free-form/element';
|
|
42
|
-
export { default as FormPages } from './free-form/pages';
|
|
43
|
-
export { default as FormPage } from './free-form/page';
|
|
44
|
-
export { default as FormSteps } from './free-form/steps';
|
|
45
|
-
export { default as FormStep } from './free-form/step';
|
|
46
|
-
export { default as FormSection } from './free-form/section';
|
|
47
|
-
export { default as FormAddableSection } from './free-form/addable-section';
|
|
48
|
-
export { default as App } from './app';
|
|
49
|
-
export { default as ConfigProvider } from './config-provider';
|
package/es/types.d.ts
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
/// <reference path="../typings.d.ts" />
|
|
2
|
-
import { BlinkIdSingleSideRecognizerResult } from '@microblink/blinkid-in-browser-sdk';
|
|
3
|
-
import { FormItemProps, FormInstance } from 'antd/es/form';
|
|
4
|
-
import { ReactNode } from 'react';
|
|
5
|
-
import { NamePath } from 'rc-field-form/lib/interface';
|
|
6
|
-
import { CheckboxOptionType } from 'antd/es/checkbox';
|
|
7
|
-
import { SelectProps } from 'antd/es/select';
|
|
8
|
-
export { Rule } from 'rc-field-form/lib/interface';
|
|
9
|
-
export interface OCRHooks {
|
|
10
|
-
microBlink?: {
|
|
11
|
-
initResult: {
|
|
12
|
-
error?: string;
|
|
13
|
-
failed: boolean;
|
|
14
|
-
};
|
|
15
|
-
recognize: ((file: File) => Promise<BlinkIdSingleSideRecognizerResult | null>) | null;
|
|
16
|
-
loading?: boolean;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export interface OCRConfig {
|
|
20
|
-
microBlink?: {
|
|
21
|
-
licenseKey: string;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export type FormItemName = NamePath;
|
|
25
|
-
export interface FormBasicConfig {
|
|
26
|
-
config: FormItemConfig;
|
|
27
|
-
className?: string;
|
|
28
|
-
style?: Object;
|
|
29
|
-
locales?: {
|
|
30
|
-
cancelText?: string;
|
|
31
|
-
submitText?: string;
|
|
32
|
-
previewText?: string;
|
|
33
|
-
nextText?: string;
|
|
34
|
-
continueText?: string;
|
|
35
|
-
validateMessages?: Object;
|
|
36
|
-
};
|
|
37
|
-
initialValues?: any;
|
|
38
|
-
form?: FormInstance;
|
|
39
|
-
onCancel?(): void;
|
|
40
|
-
onSubmit?(values: Object, allValues?: Object): any;
|
|
41
|
-
requiredMark?: boolean;
|
|
42
|
-
showSubmitButton?: boolean;
|
|
43
|
-
getScrollContainer?: () => HTMLElement | null;
|
|
44
|
-
onFirstModified?: () => any;
|
|
45
|
-
uploadApi?: string;
|
|
46
|
-
selectDatasourceApi?: string;
|
|
47
|
-
validationRule?: string;
|
|
48
|
-
getRuleValidationApi?: string;
|
|
49
|
-
stepDirection?: 'vertical' | 'horizontal';
|
|
50
|
-
customizeComponents?: {
|
|
51
|
-
[name: string]: FC;
|
|
52
|
-
};
|
|
53
|
-
ocr?: OCRConfig;
|
|
54
|
-
validationCodeExtraParams?: Record<string, any>;
|
|
55
|
-
onValuesChange?: (changedValues: any, values: any) => void;
|
|
56
|
-
}
|
|
57
|
-
export type FormItemAssert = {
|
|
58
|
-
field: NamePath;
|
|
59
|
-
value?: any;
|
|
60
|
-
operation?: 'eq' | 'ne' | 'in' | 'ni' | 'lt' | 'le' | 'gt' | 'ge' | 'co' | 'nc' | 'filled' | 'unfilled' | 'co-some' | 'co-every' | 'some-in' | 'every-in';
|
|
61
|
-
};
|
|
62
|
-
export type FormItemCopyValue = {
|
|
63
|
-
assert: FormItemAssert;
|
|
64
|
-
copyFrom: NamePath;
|
|
65
|
-
disabled?: boolean;
|
|
66
|
-
};
|
|
67
|
-
export type FormItemSelectValue = {
|
|
68
|
-
assert: FormItemAssert;
|
|
69
|
-
value: any;
|
|
70
|
-
disabled?: boolean;
|
|
71
|
-
};
|
|
72
|
-
export interface FormItemExtraConfig extends FormItemProps {
|
|
73
|
-
labelTooltip?: string;
|
|
74
|
-
elements?: FormItemConfig[];
|
|
75
|
-
required?: boolean;
|
|
76
|
-
requiredAsserts?: FormItemAssert[];
|
|
77
|
-
extraLabel?: any;
|
|
78
|
-
xl?: number;
|
|
79
|
-
md?: number;
|
|
80
|
-
xs?: number;
|
|
81
|
-
span?: number;
|
|
82
|
-
areaCode?: number | string | (number | string)[];
|
|
83
|
-
phoneNumber?: number | string;
|
|
84
|
-
mergeRules?: boolean;
|
|
85
|
-
dependencies?: NamePath[];
|
|
86
|
-
antdDependencies?: NamePath[];
|
|
87
|
-
asserts?: FormItemAssert[];
|
|
88
|
-
shouldRender?: (form?: FormInstance) => boolean;
|
|
89
|
-
ignore?: boolean;
|
|
90
|
-
copyValue?: FormItemCopyValue;
|
|
91
|
-
selectValue?: FormItemSelectValue[];
|
|
92
|
-
disabled?: boolean | FormItemAssert | FormItemAssert[];
|
|
93
|
-
halfRow?: boolean;
|
|
94
|
-
fullRow?: boolean;
|
|
95
|
-
limit?: number;
|
|
96
|
-
hideWhenPreview?: boolean;
|
|
97
|
-
hideWhenEdit?: boolean;
|
|
98
|
-
requiredMessage?: string | ReactNode;
|
|
99
|
-
showOptional?: boolean;
|
|
100
|
-
previewFormater?(value: any, form?: FormInstance): any;
|
|
101
|
-
handleNext?(values: any): any;
|
|
102
|
-
render?(preview: boolean, form?: FormInstance, value?: any, onChange?: (params: any) => any, setShowStepButton?: IglooComponentProps['setShowStepButton']): any;
|
|
103
|
-
locales?: {
|
|
104
|
-
[key: string]: string;
|
|
105
|
-
};
|
|
106
|
-
options?: (CheckboxOptionType & {
|
|
107
|
-
extraInfo?: {
|
|
108
|
-
content: any;
|
|
109
|
-
shownTrigger: 'unchecked' | 'checked' | 'all';
|
|
110
|
-
};
|
|
111
|
-
})[] | SelectProps['options'];
|
|
112
|
-
sendOtp?: (value: any) => any;
|
|
113
|
-
dependField?: FormItemName;
|
|
114
|
-
countDownSeconds?: number;
|
|
115
|
-
getButtonDisabledState?: (form: FormInstance) => boolean;
|
|
116
|
-
getPreviousDisabledState?: (form: FormInstance) => boolean;
|
|
117
|
-
handleUpload?(file: File): PromiseLike<string>;
|
|
118
|
-
withoutForm?: boolean;
|
|
119
|
-
disableEditButton?: boolean;
|
|
120
|
-
hidePreviewDivider?: boolean;
|
|
121
|
-
valueFormater?: (value: any) => any;
|
|
122
|
-
currentStep?: number;
|
|
123
|
-
subscribedFields?: FormItemName[];
|
|
124
|
-
description?: string | React.ReactNode;
|
|
125
|
-
dateLimitationType?: 'relative' | 'absolute';
|
|
126
|
-
absoluteRangeStart?: number;
|
|
127
|
-
absoluteRangeEnd?: number;
|
|
128
|
-
relativeRangeStart?: {
|
|
129
|
-
type: 'day' | 'month' | 'year';
|
|
130
|
-
quantity: number;
|
|
131
|
-
pattern?: string;
|
|
132
|
-
dependField?: NamePath;
|
|
133
|
-
};
|
|
134
|
-
relativeRangeEnd?: {
|
|
135
|
-
type: 'day' | 'month' | 'year';
|
|
136
|
-
quantity: number;
|
|
137
|
-
pattern?: string;
|
|
138
|
-
dependField?: NamePath;
|
|
139
|
-
};
|
|
140
|
-
validationCode?: {
|
|
141
|
-
code: string;
|
|
142
|
-
errorMessage: string;
|
|
143
|
-
warningOnly?: boolean;
|
|
144
|
-
}[];
|
|
145
|
-
length?: number;
|
|
146
|
-
minLength?: number;
|
|
147
|
-
maxLength?: number;
|
|
148
|
-
idType?: 'KTP' | 'NIK';
|
|
149
|
-
validationRule?: string;
|
|
150
|
-
shouldRenderCode?: string;
|
|
151
|
-
disabledCode?: string;
|
|
152
|
-
automaticCalcCode?: string;
|
|
153
|
-
enableAutomaticCalc?: boolean;
|
|
154
|
-
[key: string]: any;
|
|
155
|
-
}
|
|
156
|
-
export interface FormItemConfig extends FormItemExtraConfig {
|
|
157
|
-
type?: string;
|
|
158
|
-
name?: NamePath;
|
|
159
|
-
label?: string | React.ReactNode;
|
|
160
|
-
previewLabel?: string | React.ReactNode;
|
|
161
|
-
labelProps?: any;
|
|
162
|
-
contentProps?: any;
|
|
163
|
-
ocr?: {
|
|
164
|
-
vender: string;
|
|
165
|
-
outputMap: {
|
|
166
|
-
field: string[];
|
|
167
|
-
source: string[];
|
|
168
|
-
}[];
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
export type FormItemPropsHandler = (config: FormItemConfig) => FormItemConfig;
|
|
172
|
-
export interface FC<P = {}> extends React.FunctionComponent<P> {
|
|
173
|
-
formItemPropsHandler?: FormItemPropsHandler;
|
|
174
|
-
isPreviewSupport?: boolean;
|
|
175
|
-
}
|
|
176
|
-
export interface Form extends React.ForwardRefExoticComponent<FormBasicConfig & React.RefAttributes<any>> {
|
|
177
|
-
useForm: () => FormInstance;
|
|
178
|
-
}
|
|
179
|
-
export interface IglooComponentProps {
|
|
180
|
-
validateField?: (nameList?: NamePath[]) => Promise<any>;
|
|
181
|
-
containerRef?: React.RefObject<any>;
|
|
182
|
-
setFieldError?(errorMsg?: string): void;
|
|
183
|
-
setFieldValue?(value?: any): void;
|
|
184
|
-
setShowStepButton?: (showButton: boolean) => void;
|
|
185
|
-
getFormInstance?: () => FormInstance;
|
|
186
|
-
locales?: {
|
|
187
|
-
[key: string]: string;
|
|
188
|
-
};
|
|
189
|
-
}
|
package/es/utils/form-utils.d.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FormInstance } from 'antd/es/form';
|
|
3
|
-
import { FormItemConfig, FormItemExtraConfig, FormItemName, FormItemCopyValue, FormItemSelectValue, FormItemAssert, Rule } from '../types';
|
|
4
|
-
import { NamePath } from 'antd/es/form/interface';
|
|
5
|
-
export declare const calcNamePath: (parentName: FormItemName | undefined, name: FormItemName | undefined) => any[];
|
|
6
|
-
export declare const testAssert: (form: FormInstance, assert: FormItemAssert) => boolean;
|
|
7
|
-
export declare const calcFormItemProps: (config: FormItemConfig, extraProps: FormItemExtraConfig, form?: FormInstance, parentName?: FormItemName, validationCodeExtraParams?: Record<string, any>) => {
|
|
8
|
-
colProps: {
|
|
9
|
-
span: number;
|
|
10
|
-
xs: number;
|
|
11
|
-
sm: number;
|
|
12
|
-
md: number;
|
|
13
|
-
halfRow: boolean | undefined;
|
|
14
|
-
};
|
|
15
|
-
formItemProps: {
|
|
16
|
-
name: any[];
|
|
17
|
-
className: string | undefined;
|
|
18
|
-
initialValue: any;
|
|
19
|
-
copiedValue: {
|
|
20
|
-
copied: boolean;
|
|
21
|
-
value?: undefined;
|
|
22
|
-
disabled?: undefined;
|
|
23
|
-
} | {
|
|
24
|
-
copied: boolean;
|
|
25
|
-
value: any;
|
|
26
|
-
disabled: boolean | undefined;
|
|
27
|
-
};
|
|
28
|
-
selectedValue: {
|
|
29
|
-
selected: boolean;
|
|
30
|
-
value?: undefined;
|
|
31
|
-
disabled?: undefined;
|
|
32
|
-
} | {
|
|
33
|
-
selected: boolean;
|
|
34
|
-
value: any;
|
|
35
|
-
disabled: boolean | undefined;
|
|
36
|
-
};
|
|
37
|
-
normalize: ((value: any, prevValue: any, allValues: import("rc-field-form/lib/interface").Store) => any) | undefined;
|
|
38
|
-
rules: Rule[];
|
|
39
|
-
validateTrigger: any[];
|
|
40
|
-
label: import("react/jsx-runtime").JSX.Element | null;
|
|
41
|
-
getValueFromEvent: ((...args: import("rc-field-form/lib/interface").EventArgs) => any) | undefined;
|
|
42
|
-
getValueProps: ((value: any) => Record<string, unknown>) | undefined;
|
|
43
|
-
extra: false | "" | 0 | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
44
|
-
help: React.ReactNode;
|
|
45
|
-
valuePropName: string | undefined;
|
|
46
|
-
messageVariables: {
|
|
47
|
-
label: string;
|
|
48
|
-
};
|
|
49
|
-
dependencies: any[] | undefined;
|
|
50
|
-
};
|
|
51
|
-
elementProps: {
|
|
52
|
-
[key: string]: any;
|
|
53
|
-
};
|
|
54
|
-
display: any;
|
|
55
|
-
previewFormater: ((value: any, form?: FormInstance<any> | undefined) => any) | undefined;
|
|
56
|
-
};
|
|
57
|
-
export declare const calcDisabled: (disabled?: boolean | FormItemAssert | FormItemAssert[], form?: FormInstance, disabledCode?: string, name?: FormItemName, parentName?: FormItemName) => any;
|
|
58
|
-
export declare const calcCopyValue: (copyValue?: FormItemCopyValue, form?: FormInstance) => {
|
|
59
|
-
copied: boolean;
|
|
60
|
-
value?: undefined;
|
|
61
|
-
disabled?: undefined;
|
|
62
|
-
} | {
|
|
63
|
-
copied: boolean;
|
|
64
|
-
value: any;
|
|
65
|
-
disabled: boolean | undefined;
|
|
66
|
-
};
|
|
67
|
-
export declare const calcSelectValue: (selectValue?: FormItemSelectValue[], form?: FormInstance) => {
|
|
68
|
-
selected: boolean;
|
|
69
|
-
value?: undefined;
|
|
70
|
-
disabled?: undefined;
|
|
71
|
-
} | {
|
|
72
|
-
selected: boolean;
|
|
73
|
-
value: any;
|
|
74
|
-
disabled: boolean | undefined;
|
|
75
|
-
};
|
|
76
|
-
export declare const calcShouldRender: (name: NamePath, parentName: NamePath, dependencies?: NamePath[], asserts?: FormItemAssert[], shouldRender?: ((form?: FormInstance) => boolean) | undefined, shouldRenderCode?: string, form?: FormInstance) => any;
|
|
77
|
-
export declare const automaticCalculate: (name: NamePath, parentName: NamePath, automaticCalcCode?: string, form?: FormInstance) => void;
|
|
78
|
-
export declare const getRuleValidation: (url: string, rule: string | string[], values?: any, lang?: string) => Promise<any>;
|
|
79
|
-
export declare const calcAddableSectionAssertField: (name: any[], field: FormItemAssert['field'], index: number, elements: FormItemConfig[] | React.ReactElement[]) => any;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode } from 'react';
|
|
2
|
-
import { FormItemConfig, FormItemName } from '../../types';
|
|
3
|
-
import './style';
|
|
4
|
-
import { ConfirmationProps } from '../../confirmation';
|
|
5
|
-
export interface HStepsProps {
|
|
6
|
-
config: FormItemConfig & {
|
|
7
|
-
confirmations?: {
|
|
8
|
-
[key: string]: {
|
|
9
|
-
required: boolean;
|
|
10
|
-
confirmation?: ConfirmationProps;
|
|
11
|
-
requiredMessage?: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
withReview?: boolean;
|
|
15
|
-
description?: ReactNode;
|
|
16
|
-
};
|
|
17
|
-
parentName?: FormItemName;
|
|
18
|
-
name?: FormItemName;
|
|
19
|
-
}
|
|
20
|
-
declare const HSteps: FC<HStepsProps>;
|
|
21
|
-
export default HSteps;
|
package/lib/index.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export { default as Form } from './form';
|
|
2
|
-
export { default as Button, GreenButton, YellowButton, RedButton, } from './button';
|
|
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, InputId, } from './input';
|
|
5
|
-
export { default as OCR } from './ocr';
|
|
6
|
-
export { default as Select, TimeSelect, AttachedSelect } from './select';
|
|
7
|
-
export { default as Radio, RadioGroup, RadioGroupWithOther } from './radio';
|
|
8
|
-
export { default as Upload } from './upload';
|
|
9
|
-
export { default as Checkbox, CheckboxGroup } from './checkbox';
|
|
10
|
-
export { default as Declaration } from './declaration';
|
|
11
|
-
export { Divider } from 'antd';
|
|
12
|
-
export { default as UploadPhoto } from './upload-photo';
|
|
13
|
-
export { default as AlertMessage } from './alert-message';
|
|
14
|
-
export { default as LoginPage } from './login-page';
|
|
15
|
-
export { default as UploadPreview } from './upload-preview';
|
|
16
|
-
export { default as Typography } from './typography';
|
|
17
|
-
export { default as PlatformCard } from './platform/platform-card';
|
|
18
|
-
export { default as SwitchPlatform } from './platform/switch-platform';
|
|
19
|
-
export { default as Table } from './table';
|
|
20
|
-
export { default as StatusBox } from './status-box';
|
|
21
|
-
export { CardPage, Card, CardGroup, CardItem } from './card-detail';
|
|
22
|
-
export { default as AdminMedia } from './media';
|
|
23
|
-
export { default as Documents } from './documents';
|
|
24
|
-
export { default as Filter } from './filter';
|
|
25
|
-
export { default as CurrencyContext } from './currency-context';
|
|
26
|
-
export { default as Tabs } from './tabs';
|
|
27
|
-
export { default as AdminAmount } from './admin-amount';
|
|
28
|
-
export { default as AdminUpload } from './admin-upload';
|
|
29
|
-
export { LocaleProvider } from './locale';
|
|
30
|
-
export { default as Modal } from './modal';
|
|
31
|
-
export { default as BackTop } from './back-top';
|
|
32
|
-
export { default as MediaPreview } from './upload-preview/media';
|
|
33
|
-
export { default as PolicyList } from './policy-list';
|
|
34
|
-
export { default as ClaimList } from './claim-list';
|
|
35
|
-
export { default as MobileInsurerDetail } from './mobile-insurer-detail';
|
|
36
|
-
export { default as Layout } from './layout';
|
|
37
|
-
export { default as DetailPanel } from './detail-panel';
|
|
38
|
-
export { default as message } from './message';
|
|
39
|
-
export { default as SearchBox } from './search-box';
|
|
40
|
-
export { default as FreeForm } from './free-form';
|
|
41
|
-
export { default as FormItem } from './free-form/element';
|
|
42
|
-
export { default as FormPages } from './free-form/pages';
|
|
43
|
-
export { default as FormPage } from './free-form/page';
|
|
44
|
-
export { default as FormSteps } from './free-form/steps';
|
|
45
|
-
export { default as FormStep } from './free-form/step';
|
|
46
|
-
export { default as FormSection } from './free-form/section';
|
|
47
|
-
export { default as FormAddableSection } from './free-form/addable-section';
|
|
48
|
-
export { default as App } from './app';
|
|
49
|
-
export { default as ConfigProvider } from './config-provider';
|
package/lib/types.d.ts
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
/// <reference path="../typings.d.ts" />
|
|
2
|
-
import { BlinkIdSingleSideRecognizerResult } from '@microblink/blinkid-in-browser-sdk';
|
|
3
|
-
import { FormItemProps, FormInstance } from 'antd/es/form';
|
|
4
|
-
import { ReactNode } from 'react';
|
|
5
|
-
import { NamePath } from 'rc-field-form/lib/interface';
|
|
6
|
-
import { CheckboxOptionType } from 'antd/es/checkbox';
|
|
7
|
-
import { SelectProps } from 'antd/es/select';
|
|
8
|
-
export { Rule } from 'rc-field-form/lib/interface';
|
|
9
|
-
export interface OCRHooks {
|
|
10
|
-
microBlink?: {
|
|
11
|
-
initResult: {
|
|
12
|
-
error?: string;
|
|
13
|
-
failed: boolean;
|
|
14
|
-
};
|
|
15
|
-
recognize: ((file: File) => Promise<BlinkIdSingleSideRecognizerResult | null>) | null;
|
|
16
|
-
loading?: boolean;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export interface OCRConfig {
|
|
20
|
-
microBlink?: {
|
|
21
|
-
licenseKey: string;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export type FormItemName = NamePath;
|
|
25
|
-
export interface FormBasicConfig {
|
|
26
|
-
config: FormItemConfig;
|
|
27
|
-
className?: string;
|
|
28
|
-
style?: Object;
|
|
29
|
-
locales?: {
|
|
30
|
-
cancelText?: string;
|
|
31
|
-
submitText?: string;
|
|
32
|
-
previewText?: string;
|
|
33
|
-
nextText?: string;
|
|
34
|
-
continueText?: string;
|
|
35
|
-
validateMessages?: Object;
|
|
36
|
-
};
|
|
37
|
-
initialValues?: any;
|
|
38
|
-
form?: FormInstance;
|
|
39
|
-
onCancel?(): void;
|
|
40
|
-
onSubmit?(values: Object, allValues?: Object): any;
|
|
41
|
-
requiredMark?: boolean;
|
|
42
|
-
showSubmitButton?: boolean;
|
|
43
|
-
getScrollContainer?: () => HTMLElement | null;
|
|
44
|
-
onFirstModified?: () => any;
|
|
45
|
-
uploadApi?: string;
|
|
46
|
-
selectDatasourceApi?: string;
|
|
47
|
-
validationRule?: string;
|
|
48
|
-
getRuleValidationApi?: string;
|
|
49
|
-
stepDirection?: 'vertical' | 'horizontal';
|
|
50
|
-
customizeComponents?: {
|
|
51
|
-
[name: string]: FC;
|
|
52
|
-
};
|
|
53
|
-
ocr?: OCRConfig;
|
|
54
|
-
validationCodeExtraParams?: Record<string, any>;
|
|
55
|
-
onValuesChange?: (changedValues: any, values: any) => void;
|
|
56
|
-
}
|
|
57
|
-
export type FormItemAssert = {
|
|
58
|
-
field: NamePath;
|
|
59
|
-
value?: any;
|
|
60
|
-
operation?: 'eq' | 'ne' | 'in' | 'ni' | 'lt' | 'le' | 'gt' | 'ge' | 'co' | 'nc' | 'filled' | 'unfilled' | 'co-some' | 'co-every' | 'some-in' | 'every-in';
|
|
61
|
-
};
|
|
62
|
-
export type FormItemCopyValue = {
|
|
63
|
-
assert: FormItemAssert;
|
|
64
|
-
copyFrom: NamePath;
|
|
65
|
-
disabled?: boolean;
|
|
66
|
-
};
|
|
67
|
-
export type FormItemSelectValue = {
|
|
68
|
-
assert: FormItemAssert;
|
|
69
|
-
value: any;
|
|
70
|
-
disabled?: boolean;
|
|
71
|
-
};
|
|
72
|
-
export interface FormItemExtraConfig extends FormItemProps {
|
|
73
|
-
labelTooltip?: string;
|
|
74
|
-
elements?: FormItemConfig[];
|
|
75
|
-
required?: boolean;
|
|
76
|
-
requiredAsserts?: FormItemAssert[];
|
|
77
|
-
extraLabel?: any;
|
|
78
|
-
xl?: number;
|
|
79
|
-
md?: number;
|
|
80
|
-
xs?: number;
|
|
81
|
-
span?: number;
|
|
82
|
-
areaCode?: number | string | (number | string)[];
|
|
83
|
-
phoneNumber?: number | string;
|
|
84
|
-
mergeRules?: boolean;
|
|
85
|
-
dependencies?: NamePath[];
|
|
86
|
-
antdDependencies?: NamePath[];
|
|
87
|
-
asserts?: FormItemAssert[];
|
|
88
|
-
shouldRender?: (form?: FormInstance) => boolean;
|
|
89
|
-
ignore?: boolean;
|
|
90
|
-
copyValue?: FormItemCopyValue;
|
|
91
|
-
selectValue?: FormItemSelectValue[];
|
|
92
|
-
disabled?: boolean | FormItemAssert | FormItemAssert[];
|
|
93
|
-
halfRow?: boolean;
|
|
94
|
-
fullRow?: boolean;
|
|
95
|
-
limit?: number;
|
|
96
|
-
hideWhenPreview?: boolean;
|
|
97
|
-
hideWhenEdit?: boolean;
|
|
98
|
-
requiredMessage?: string | ReactNode;
|
|
99
|
-
showOptional?: boolean;
|
|
100
|
-
previewFormater?(value: any, form?: FormInstance): any;
|
|
101
|
-
handleNext?(values: any): any;
|
|
102
|
-
render?(preview: boolean, form?: FormInstance, value?: any, onChange?: (params: any) => any, setShowStepButton?: IglooComponentProps['setShowStepButton']): any;
|
|
103
|
-
locales?: {
|
|
104
|
-
[key: string]: string;
|
|
105
|
-
};
|
|
106
|
-
options?: (CheckboxOptionType & {
|
|
107
|
-
extraInfo?: {
|
|
108
|
-
content: any;
|
|
109
|
-
shownTrigger: 'unchecked' | 'checked' | 'all';
|
|
110
|
-
};
|
|
111
|
-
})[] | SelectProps['options'];
|
|
112
|
-
sendOtp?: (value: any) => any;
|
|
113
|
-
dependField?: FormItemName;
|
|
114
|
-
countDownSeconds?: number;
|
|
115
|
-
getButtonDisabledState?: (form: FormInstance) => boolean;
|
|
116
|
-
getPreviousDisabledState?: (form: FormInstance) => boolean;
|
|
117
|
-
handleUpload?(file: File): PromiseLike<string>;
|
|
118
|
-
withoutForm?: boolean;
|
|
119
|
-
disableEditButton?: boolean;
|
|
120
|
-
hidePreviewDivider?: boolean;
|
|
121
|
-
valueFormater?: (value: any) => any;
|
|
122
|
-
currentStep?: number;
|
|
123
|
-
subscribedFields?: FormItemName[];
|
|
124
|
-
description?: string | React.ReactNode;
|
|
125
|
-
dateLimitationType?: 'relative' | 'absolute';
|
|
126
|
-
absoluteRangeStart?: number;
|
|
127
|
-
absoluteRangeEnd?: number;
|
|
128
|
-
relativeRangeStart?: {
|
|
129
|
-
type: 'day' | 'month' | 'year';
|
|
130
|
-
quantity: number;
|
|
131
|
-
pattern?: string;
|
|
132
|
-
dependField?: NamePath;
|
|
133
|
-
};
|
|
134
|
-
relativeRangeEnd?: {
|
|
135
|
-
type: 'day' | 'month' | 'year';
|
|
136
|
-
quantity: number;
|
|
137
|
-
pattern?: string;
|
|
138
|
-
dependField?: NamePath;
|
|
139
|
-
};
|
|
140
|
-
validationCode?: {
|
|
141
|
-
code: string;
|
|
142
|
-
errorMessage: string;
|
|
143
|
-
warningOnly?: boolean;
|
|
144
|
-
}[];
|
|
145
|
-
length?: number;
|
|
146
|
-
minLength?: number;
|
|
147
|
-
maxLength?: number;
|
|
148
|
-
idType?: 'KTP' | 'NIK';
|
|
149
|
-
validationRule?: string;
|
|
150
|
-
shouldRenderCode?: string;
|
|
151
|
-
disabledCode?: string;
|
|
152
|
-
automaticCalcCode?: string;
|
|
153
|
-
enableAutomaticCalc?: boolean;
|
|
154
|
-
[key: string]: any;
|
|
155
|
-
}
|
|
156
|
-
export interface FormItemConfig extends FormItemExtraConfig {
|
|
157
|
-
type?: string;
|
|
158
|
-
name?: NamePath;
|
|
159
|
-
label?: string | React.ReactNode;
|
|
160
|
-
previewLabel?: string | React.ReactNode;
|
|
161
|
-
labelProps?: any;
|
|
162
|
-
contentProps?: any;
|
|
163
|
-
ocr?: {
|
|
164
|
-
vender: string;
|
|
165
|
-
outputMap: {
|
|
166
|
-
field: string[];
|
|
167
|
-
source: string[];
|
|
168
|
-
}[];
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
export type FormItemPropsHandler = (config: FormItemConfig) => FormItemConfig;
|
|
172
|
-
export interface FC<P = {}> extends React.FunctionComponent<P> {
|
|
173
|
-
formItemPropsHandler?: FormItemPropsHandler;
|
|
174
|
-
isPreviewSupport?: boolean;
|
|
175
|
-
}
|
|
176
|
-
export interface Form extends React.ForwardRefExoticComponent<FormBasicConfig & React.RefAttributes<any>> {
|
|
177
|
-
useForm: () => FormInstance;
|
|
178
|
-
}
|
|
179
|
-
export interface IglooComponentProps {
|
|
180
|
-
validateField?: (nameList?: NamePath[]) => Promise<any>;
|
|
181
|
-
containerRef?: React.RefObject<any>;
|
|
182
|
-
setFieldError?(errorMsg?: string): void;
|
|
183
|
-
setFieldValue?(value?: any): void;
|
|
184
|
-
setShowStepButton?: (showButton: boolean) => void;
|
|
185
|
-
getFormInstance?: () => FormInstance;
|
|
186
|
-
locales?: {
|
|
187
|
-
[key: string]: string;
|
|
188
|
-
};
|
|
189
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FormInstance } from 'antd/es/form';
|
|
3
|
-
import { FormItemConfig, FormItemExtraConfig, FormItemName, FormItemCopyValue, FormItemSelectValue, FormItemAssert, Rule } from '../types';
|
|
4
|
-
import { NamePath } from 'antd/es/form/interface';
|
|
5
|
-
export declare const calcNamePath: (parentName: FormItemName | undefined, name: FormItemName | undefined) => any[];
|
|
6
|
-
export declare const testAssert: (form: FormInstance, assert: FormItemAssert) => boolean;
|
|
7
|
-
export declare const calcFormItemProps: (config: FormItemConfig, extraProps: FormItemExtraConfig, form?: FormInstance, parentName?: FormItemName, validationCodeExtraParams?: Record<string, any>) => {
|
|
8
|
-
colProps: {
|
|
9
|
-
span: number;
|
|
10
|
-
xs: number;
|
|
11
|
-
sm: number;
|
|
12
|
-
md: number;
|
|
13
|
-
halfRow: boolean | undefined;
|
|
14
|
-
};
|
|
15
|
-
formItemProps: {
|
|
16
|
-
name: any[];
|
|
17
|
-
className: string | undefined;
|
|
18
|
-
initialValue: any;
|
|
19
|
-
copiedValue: {
|
|
20
|
-
copied: boolean;
|
|
21
|
-
value?: undefined;
|
|
22
|
-
disabled?: undefined;
|
|
23
|
-
} | {
|
|
24
|
-
copied: boolean;
|
|
25
|
-
value: any;
|
|
26
|
-
disabled: boolean | undefined;
|
|
27
|
-
};
|
|
28
|
-
selectedValue: {
|
|
29
|
-
selected: boolean;
|
|
30
|
-
value?: undefined;
|
|
31
|
-
disabled?: undefined;
|
|
32
|
-
} | {
|
|
33
|
-
selected: boolean;
|
|
34
|
-
value: any;
|
|
35
|
-
disabled: boolean | undefined;
|
|
36
|
-
};
|
|
37
|
-
normalize: ((value: any, prevValue: any, allValues: import("rc-field-form/lib/interface").Store) => any) | undefined;
|
|
38
|
-
rules: Rule[];
|
|
39
|
-
validateTrigger: any[];
|
|
40
|
-
label: import("react/jsx-runtime").JSX.Element | null;
|
|
41
|
-
getValueFromEvent: ((...args: import("rc-field-form/lib/interface").EventArgs) => any) | undefined;
|
|
42
|
-
getValueProps: ((value: any) => Record<string, unknown>) | undefined;
|
|
43
|
-
extra: false | "" | 0 | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
44
|
-
help: React.ReactNode;
|
|
45
|
-
valuePropName: string | undefined;
|
|
46
|
-
messageVariables: {
|
|
47
|
-
label: string;
|
|
48
|
-
};
|
|
49
|
-
dependencies: any[] | undefined;
|
|
50
|
-
};
|
|
51
|
-
elementProps: {
|
|
52
|
-
[key: string]: any;
|
|
53
|
-
};
|
|
54
|
-
display: any;
|
|
55
|
-
previewFormater: ((value: any, form?: FormInstance<any> | undefined) => any) | undefined;
|
|
56
|
-
};
|
|
57
|
-
export declare const calcDisabled: (disabled?: boolean | FormItemAssert | FormItemAssert[], form?: FormInstance, disabledCode?: string, name?: FormItemName, parentName?: FormItemName) => any;
|
|
58
|
-
export declare const calcCopyValue: (copyValue?: FormItemCopyValue, form?: FormInstance) => {
|
|
59
|
-
copied: boolean;
|
|
60
|
-
value?: undefined;
|
|
61
|
-
disabled?: undefined;
|
|
62
|
-
} | {
|
|
63
|
-
copied: boolean;
|
|
64
|
-
value: any;
|
|
65
|
-
disabled: boolean | undefined;
|
|
66
|
-
};
|
|
67
|
-
export declare const calcSelectValue: (selectValue?: FormItemSelectValue[], form?: FormInstance) => {
|
|
68
|
-
selected: boolean;
|
|
69
|
-
value?: undefined;
|
|
70
|
-
disabled?: undefined;
|
|
71
|
-
} | {
|
|
72
|
-
selected: boolean;
|
|
73
|
-
value: any;
|
|
74
|
-
disabled: boolean | undefined;
|
|
75
|
-
};
|
|
76
|
-
export declare const calcShouldRender: (name: NamePath, parentName: NamePath, dependencies?: NamePath[], asserts?: FormItemAssert[], shouldRender?: ((form?: FormInstance) => boolean) | undefined, shouldRenderCode?: string, form?: FormInstance) => any;
|
|
77
|
-
export declare const automaticCalculate: (name: NamePath, parentName: NamePath, automaticCalcCode?: string, form?: FormInstance) => void;
|
|
78
|
-
export declare const getRuleValidation: (url: string, rule: string | string[], values?: any, lang?: string) => Promise<any>;
|
|
79
|
-
export declare const calcAddableSectionAssertField: (name: any[], field: FormItemAssert['field'], index: number, elements: FormItemConfig[] | React.ReactElement[]) => any;
|