iglooform 3.3.0 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +1 -1
- package/es/form/step-items-selection/components/section-of-item-condition/hooks/useElements.js +7 -7
- package/es/form/step-items-selection/index.d.ts +5 -2
- package/es/form/step-items-selection/types.d.ts +0 -4
- package/es/types.d.ts +188 -0
- package/lib/form/step-items-selection/components/section-of-item-condition/hooks/useElements.js +7 -7
- package/lib/form/step-items-selection/index.d.ts +5 -2
- package/lib/form/step-items-selection/types.d.ts +0 -4
- package/lib/types.d.ts +188 -0
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ export default function DumiContextWrapper() {
|
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
32
|
<SiteContext.Provider value={{
|
|
33
|
-
pkg: {"name":"iglooform","version":"3.
|
|
33
|
+
pkg: {"name":"iglooform","version":"3.3.1","license":"MIT"},
|
|
34
34
|
historyType: "browser",
|
|
35
35
|
entryExports,
|
|
36
36
|
demos,
|
package/es/form/step-items-selection/components/section-of-item-condition/hooks/useElements.js
CHANGED
|
@@ -38,11 +38,7 @@ export var useElements = function useElements(elements, itemData) {
|
|
|
38
38
|
// claim_quantity max rule的处理
|
|
39
39
|
if (element.name === KEY_FORM_QUANTITY) {
|
|
40
40
|
var itemQuantity = itemData[KEY_ITEM_QUANTITY];
|
|
41
|
-
var claimQuantityRules = typeof itemQuantity
|
|
42
|
-
type: 'number',
|
|
43
|
-
min: 1,
|
|
44
|
-
max: itemQuantity
|
|
45
|
-
}] : [{
|
|
41
|
+
var claimQuantityRules = typeof itemQuantity !== 'number' ? [{
|
|
46
42
|
validator: function () {
|
|
47
43
|
var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
48
44
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -62,9 +58,13 @@ export var useElements = function useElements(elements, itemData) {
|
|
|
62
58
|
}
|
|
63
59
|
return validator;
|
|
64
60
|
}()
|
|
65
|
-
}];
|
|
61
|
+
}] : void 0;
|
|
62
|
+
var max = typeof itemQuantity === 'number' ? itemQuantity : void 0;
|
|
66
63
|
return _objectSpread(_objectSpread({}, element), {}, {
|
|
67
|
-
rules: claimQuantityRules
|
|
64
|
+
rules: claimQuantityRules,
|
|
65
|
+
min: 1,
|
|
66
|
+
max: max,
|
|
67
|
+
initialValue: max
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
return element;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { StepItemsSelectionProps } from './types';
|
|
3
|
+
declare const StepItemsSelection: FC<StepItemsSelectionProps> & {
|
|
4
|
+
STEP_COUNT: number;
|
|
5
|
+
};
|
|
3
6
|
export default StepItemsSelection;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
1
|
import type { StepProps } from '../step';
|
|
3
2
|
import type { FormItemConfig } from '../../types';
|
|
4
3
|
export type ItemData = {
|
|
@@ -26,6 +25,3 @@ export interface StepItemsSelectionProps extends StepProps {
|
|
|
26
25
|
];
|
|
27
26
|
};
|
|
28
27
|
}
|
|
29
|
-
export type TStepItemsSelection = FC<StepItemsSelectionProps> & {
|
|
30
|
-
STEP_COUNT: number;
|
|
31
|
-
};
|
package/es/types.d.ts
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
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
|
+
elements?: FormItemConfig[];
|
|
74
|
+
required?: boolean;
|
|
75
|
+
requiredAsserts?: FormItemAssert[];
|
|
76
|
+
extraLabel?: any;
|
|
77
|
+
xl?: number;
|
|
78
|
+
md?: number;
|
|
79
|
+
xs?: number;
|
|
80
|
+
span?: number;
|
|
81
|
+
areaCode?: number | string | (number | string)[];
|
|
82
|
+
phoneNumber?: number | string;
|
|
83
|
+
mergeRules?: boolean;
|
|
84
|
+
dependencies?: NamePath[];
|
|
85
|
+
antdDependencies?: NamePath[];
|
|
86
|
+
asserts?: FormItemAssert[];
|
|
87
|
+
shouldRender?: (form?: FormInstance) => boolean;
|
|
88
|
+
ignore?: boolean;
|
|
89
|
+
copyValue?: FormItemCopyValue;
|
|
90
|
+
selectValue?: FormItemSelectValue[];
|
|
91
|
+
disabled?: boolean | FormItemAssert | FormItemAssert[];
|
|
92
|
+
halfRow?: boolean;
|
|
93
|
+
fullRow?: boolean;
|
|
94
|
+
limit?: number;
|
|
95
|
+
hideWhenPreview?: boolean;
|
|
96
|
+
hideWhenEdit?: boolean;
|
|
97
|
+
requiredMessage?: string | ReactNode;
|
|
98
|
+
showOptional?: boolean;
|
|
99
|
+
previewFormater?(value: any, form?: FormInstance): any;
|
|
100
|
+
handleNext?(values: any): any;
|
|
101
|
+
render?(preview: boolean, form?: FormInstance, value?: any, onChange?: (params: any) => any, setShowStepButton?: IglooComponentProps['setShowStepButton']): any;
|
|
102
|
+
locales?: {
|
|
103
|
+
[key: string]: string;
|
|
104
|
+
};
|
|
105
|
+
options?: (CheckboxOptionType & {
|
|
106
|
+
extraInfo?: {
|
|
107
|
+
content: any;
|
|
108
|
+
shownTrigger: 'unchecked' | 'checked' | 'all';
|
|
109
|
+
};
|
|
110
|
+
})[] | SelectProps['options'];
|
|
111
|
+
sendOtp?: (value: any) => any;
|
|
112
|
+
dependField?: FormItemName;
|
|
113
|
+
countDownSeconds?: number;
|
|
114
|
+
getButtonDisabledState?: (form: FormInstance) => boolean;
|
|
115
|
+
getPreviousDisabledState?: (form: FormInstance) => boolean;
|
|
116
|
+
handleUpload?(file: File): PromiseLike<string>;
|
|
117
|
+
withoutForm?: boolean;
|
|
118
|
+
disableEditButton?: boolean;
|
|
119
|
+
hidePreviewDivider?: boolean;
|
|
120
|
+
valueFormater?: (value: any) => any;
|
|
121
|
+
currentStep?: number;
|
|
122
|
+
subscribedFields?: FormItemName[];
|
|
123
|
+
description?: string | React.ReactNode;
|
|
124
|
+
dateLimitationType?: 'relative' | 'absolute';
|
|
125
|
+
absoluteRangeStart?: number;
|
|
126
|
+
absoluteRangeEnd?: number;
|
|
127
|
+
relativeRangeStart?: {
|
|
128
|
+
type: 'day' | 'month' | 'year';
|
|
129
|
+
quantity: number;
|
|
130
|
+
pattern?: string;
|
|
131
|
+
dependField?: NamePath;
|
|
132
|
+
};
|
|
133
|
+
relativeRangeEnd?: {
|
|
134
|
+
type: 'day' | 'month' | 'year';
|
|
135
|
+
quantity: number;
|
|
136
|
+
pattern?: string;
|
|
137
|
+
dependField?: NamePath;
|
|
138
|
+
};
|
|
139
|
+
validationCode?: {
|
|
140
|
+
code: string;
|
|
141
|
+
errorMessage: string;
|
|
142
|
+
warningOnly?: boolean;
|
|
143
|
+
}[];
|
|
144
|
+
length?: number;
|
|
145
|
+
minLength?: number;
|
|
146
|
+
maxLength?: number;
|
|
147
|
+
idType?: 'KTP' | 'NIK';
|
|
148
|
+
validationRule?: string;
|
|
149
|
+
shouldRenderCode?: string;
|
|
150
|
+
disabledCode?: string;
|
|
151
|
+
automaticCalcCode?: string;
|
|
152
|
+
enableAutomaticCalc?: boolean;
|
|
153
|
+
[key: string]: any;
|
|
154
|
+
}
|
|
155
|
+
export interface FormItemConfig extends FormItemExtraConfig {
|
|
156
|
+
type?: string;
|
|
157
|
+
name?: NamePath;
|
|
158
|
+
label?: string | React.ReactNode;
|
|
159
|
+
previewLabel?: string | React.ReactNode;
|
|
160
|
+
labelProps?: any;
|
|
161
|
+
contentProps?: any;
|
|
162
|
+
ocr?: {
|
|
163
|
+
vender: string;
|
|
164
|
+
outputMap: {
|
|
165
|
+
field: string[];
|
|
166
|
+
source: string[];
|
|
167
|
+
}[];
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
export type FormItemPropsHandler = (config: FormItemConfig) => FormItemConfig;
|
|
171
|
+
export interface FC<P = {}> extends React.FunctionComponent<P> {
|
|
172
|
+
formItemPropsHandler?: FormItemPropsHandler;
|
|
173
|
+
isPreviewSupport?: boolean;
|
|
174
|
+
}
|
|
175
|
+
export interface Form extends React.ForwardRefExoticComponent<FormBasicConfig & React.RefAttributes<any>> {
|
|
176
|
+
useForm: () => FormInstance;
|
|
177
|
+
}
|
|
178
|
+
export interface IglooComponentProps {
|
|
179
|
+
validateField?: (nameList?: NamePath[]) => Promise<any>;
|
|
180
|
+
containerRef?: React.RefObject<any>;
|
|
181
|
+
setFieldError?(errorMsg?: string): void;
|
|
182
|
+
setFieldValue?(value?: any): void;
|
|
183
|
+
setShowStepButton?: (showButton: boolean) => void;
|
|
184
|
+
getFormInstance?: () => FormInstance;
|
|
185
|
+
locales?: {
|
|
186
|
+
[key: string]: string;
|
|
187
|
+
};
|
|
188
|
+
}
|
package/lib/form/step-items-selection/components/section-of-item-condition/hooks/useElements.js
CHANGED
|
@@ -44,11 +44,7 @@ var useElements = function useElements(elements, itemData) {
|
|
|
44
44
|
// claim_quantity max rule的处理
|
|
45
45
|
if (element.name === _config.KEY_FORM_QUANTITY) {
|
|
46
46
|
var itemQuantity = itemData[_config.KEY_ITEM_QUANTITY];
|
|
47
|
-
var claimQuantityRules = typeof itemQuantity
|
|
48
|
-
type: 'number',
|
|
49
|
-
min: 1,
|
|
50
|
-
max: itemQuantity
|
|
51
|
-
}] : [{
|
|
47
|
+
var claimQuantityRules = typeof itemQuantity !== 'number' ? [{
|
|
52
48
|
validator: function () {
|
|
53
49
|
var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
54
50
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -68,9 +64,13 @@ var useElements = function useElements(elements, itemData) {
|
|
|
68
64
|
}
|
|
69
65
|
return validator;
|
|
70
66
|
}()
|
|
71
|
-
}];
|
|
67
|
+
}] : void 0;
|
|
68
|
+
var max = typeof itemQuantity === 'number' ? itemQuantity : void 0;
|
|
72
69
|
return _objectSpread(_objectSpread({}, element), {}, {
|
|
73
|
-
rules: claimQuantityRules
|
|
70
|
+
rules: claimQuantityRules,
|
|
71
|
+
min: 1,
|
|
72
|
+
max: max,
|
|
73
|
+
initialValue: max
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
return element;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { StepItemsSelectionProps } from './types';
|
|
3
|
+
declare const StepItemsSelection: FC<StepItemsSelectionProps> & {
|
|
4
|
+
STEP_COUNT: number;
|
|
5
|
+
};
|
|
3
6
|
export default StepItemsSelection;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
1
|
import type { StepProps } from '../step';
|
|
3
2
|
import type { FormItemConfig } from '../../types';
|
|
4
3
|
export type ItemData = {
|
|
@@ -26,6 +25,3 @@ export interface StepItemsSelectionProps extends StepProps {
|
|
|
26
25
|
];
|
|
27
26
|
};
|
|
28
27
|
}
|
|
29
|
-
export type TStepItemsSelection = FC<StepItemsSelectionProps> & {
|
|
30
|
-
STEP_COUNT: number;
|
|
31
|
-
};
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
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
|
+
elements?: FormItemConfig[];
|
|
74
|
+
required?: boolean;
|
|
75
|
+
requiredAsserts?: FormItemAssert[];
|
|
76
|
+
extraLabel?: any;
|
|
77
|
+
xl?: number;
|
|
78
|
+
md?: number;
|
|
79
|
+
xs?: number;
|
|
80
|
+
span?: number;
|
|
81
|
+
areaCode?: number | string | (number | string)[];
|
|
82
|
+
phoneNumber?: number | string;
|
|
83
|
+
mergeRules?: boolean;
|
|
84
|
+
dependencies?: NamePath[];
|
|
85
|
+
antdDependencies?: NamePath[];
|
|
86
|
+
asserts?: FormItemAssert[];
|
|
87
|
+
shouldRender?: (form?: FormInstance) => boolean;
|
|
88
|
+
ignore?: boolean;
|
|
89
|
+
copyValue?: FormItemCopyValue;
|
|
90
|
+
selectValue?: FormItemSelectValue[];
|
|
91
|
+
disabled?: boolean | FormItemAssert | FormItemAssert[];
|
|
92
|
+
halfRow?: boolean;
|
|
93
|
+
fullRow?: boolean;
|
|
94
|
+
limit?: number;
|
|
95
|
+
hideWhenPreview?: boolean;
|
|
96
|
+
hideWhenEdit?: boolean;
|
|
97
|
+
requiredMessage?: string | ReactNode;
|
|
98
|
+
showOptional?: boolean;
|
|
99
|
+
previewFormater?(value: any, form?: FormInstance): any;
|
|
100
|
+
handleNext?(values: any): any;
|
|
101
|
+
render?(preview: boolean, form?: FormInstance, value?: any, onChange?: (params: any) => any, setShowStepButton?: IglooComponentProps['setShowStepButton']): any;
|
|
102
|
+
locales?: {
|
|
103
|
+
[key: string]: string;
|
|
104
|
+
};
|
|
105
|
+
options?: (CheckboxOptionType & {
|
|
106
|
+
extraInfo?: {
|
|
107
|
+
content: any;
|
|
108
|
+
shownTrigger: 'unchecked' | 'checked' | 'all';
|
|
109
|
+
};
|
|
110
|
+
})[] | SelectProps['options'];
|
|
111
|
+
sendOtp?: (value: any) => any;
|
|
112
|
+
dependField?: FormItemName;
|
|
113
|
+
countDownSeconds?: number;
|
|
114
|
+
getButtonDisabledState?: (form: FormInstance) => boolean;
|
|
115
|
+
getPreviousDisabledState?: (form: FormInstance) => boolean;
|
|
116
|
+
handleUpload?(file: File): PromiseLike<string>;
|
|
117
|
+
withoutForm?: boolean;
|
|
118
|
+
disableEditButton?: boolean;
|
|
119
|
+
hidePreviewDivider?: boolean;
|
|
120
|
+
valueFormater?: (value: any) => any;
|
|
121
|
+
currentStep?: number;
|
|
122
|
+
subscribedFields?: FormItemName[];
|
|
123
|
+
description?: string | React.ReactNode;
|
|
124
|
+
dateLimitationType?: 'relative' | 'absolute';
|
|
125
|
+
absoluteRangeStart?: number;
|
|
126
|
+
absoluteRangeEnd?: number;
|
|
127
|
+
relativeRangeStart?: {
|
|
128
|
+
type: 'day' | 'month' | 'year';
|
|
129
|
+
quantity: number;
|
|
130
|
+
pattern?: string;
|
|
131
|
+
dependField?: NamePath;
|
|
132
|
+
};
|
|
133
|
+
relativeRangeEnd?: {
|
|
134
|
+
type: 'day' | 'month' | 'year';
|
|
135
|
+
quantity: number;
|
|
136
|
+
pattern?: string;
|
|
137
|
+
dependField?: NamePath;
|
|
138
|
+
};
|
|
139
|
+
validationCode?: {
|
|
140
|
+
code: string;
|
|
141
|
+
errorMessage: string;
|
|
142
|
+
warningOnly?: boolean;
|
|
143
|
+
}[];
|
|
144
|
+
length?: number;
|
|
145
|
+
minLength?: number;
|
|
146
|
+
maxLength?: number;
|
|
147
|
+
idType?: 'KTP' | 'NIK';
|
|
148
|
+
validationRule?: string;
|
|
149
|
+
shouldRenderCode?: string;
|
|
150
|
+
disabledCode?: string;
|
|
151
|
+
automaticCalcCode?: string;
|
|
152
|
+
enableAutomaticCalc?: boolean;
|
|
153
|
+
[key: string]: any;
|
|
154
|
+
}
|
|
155
|
+
export interface FormItemConfig extends FormItemExtraConfig {
|
|
156
|
+
type?: string;
|
|
157
|
+
name?: NamePath;
|
|
158
|
+
label?: string | React.ReactNode;
|
|
159
|
+
previewLabel?: string | React.ReactNode;
|
|
160
|
+
labelProps?: any;
|
|
161
|
+
contentProps?: any;
|
|
162
|
+
ocr?: {
|
|
163
|
+
vender: string;
|
|
164
|
+
outputMap: {
|
|
165
|
+
field: string[];
|
|
166
|
+
source: string[];
|
|
167
|
+
}[];
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
export type FormItemPropsHandler = (config: FormItemConfig) => FormItemConfig;
|
|
171
|
+
export interface FC<P = {}> extends React.FunctionComponent<P> {
|
|
172
|
+
formItemPropsHandler?: FormItemPropsHandler;
|
|
173
|
+
isPreviewSupport?: boolean;
|
|
174
|
+
}
|
|
175
|
+
export interface Form extends React.ForwardRefExoticComponent<FormBasicConfig & React.RefAttributes<any>> {
|
|
176
|
+
useForm: () => FormInstance;
|
|
177
|
+
}
|
|
178
|
+
export interface IglooComponentProps {
|
|
179
|
+
validateField?: (nameList?: NamePath[]) => Promise<any>;
|
|
180
|
+
containerRef?: React.RefObject<any>;
|
|
181
|
+
setFieldError?(errorMsg?: string): void;
|
|
182
|
+
setFieldValue?(value?: any): void;
|
|
183
|
+
setShowStepButton?: (showButton: boolean) => void;
|
|
184
|
+
getFormInstance?: () => FormInstance;
|
|
185
|
+
locales?: {
|
|
186
|
+
[key: string]: string;
|
|
187
|
+
};
|
|
188
|
+
}
|