iglooform 3.2.5 → 3.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dumi/tmp/core/defineApp.ts +1 -1
- package/.dumi/tmp/core/helmet.ts +1 -1
- package/.dumi/tmp/core/history.ts +1 -1
- package/.dumi/tmp/core/historyIntelli.ts +1 -1
- package/.dumi/tmp/core/plugin.ts +2 -2
- package/.dumi/tmp/core/polyfill.ts +197 -197
- package/.dumi/tmp/core/route.tsx +33 -33
- package/.dumi/tmp/dumi/exports.ts +1 -1
- package/.dumi/tmp/dumi/locales/runtime.tsx +2 -2
- package/.dumi/tmp/dumi/meta/index.ts +33 -33
- package/.dumi/tmp/dumi/meta/runtime.ts +1 -1
- package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +3 -3
- package/.dumi/tmp/dumi/theme/builtins/API.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Badge.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Container.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Previewer.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/SourceCode.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Table.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Tree.ts +1 -1
- package/.dumi/tmp/dumi/theme/layouts/DocLayout.ts +1 -1
- package/.dumi/tmp/dumi/theme/loading.tsx +1 -1
- package/.dumi/tmp/dumi/theme/slots/ColorSwitch.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Content.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/ContentFooter.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/ContentTabs.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Features.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Footer.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Header.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/HeaderExtra.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Hero.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/HeroTitle.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/LangSwitch.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Logo.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Navbar.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/NavbarExtra.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/NotFound.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/PreviewerActions.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/PreviewerActionsExtra.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/RtlSwitch.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/SearchBar.ts +2 -2
- package/.dumi/tmp/dumi/theme/slots/SearchResult.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Sidebar.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/SocialIcon.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Toc.ts +1 -1
- package/.dumi/tmp/exports.ts +5 -5
- package/.dumi/tmp/testBrowser.tsx +3 -3
- package/.dumi/tmp/umi.ts +4 -4
- package/.idea/codeStyles/Project.xml +59 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/iglooform.iml +12 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/es/confirmation/style/index.d.ts +1 -0
- package/es/form/addable-section/index.js +3 -4
- package/es/form/section/index.js +5 -3
- package/es/types.d.ts +187 -0
- package/es/utils/form-methods.d.ts +3 -0
- package/lib/confirmation/style/index.d.ts +1 -0
- package/lib/form/addable-section/index.js +3 -4
- package/lib/form/section/index.js +5 -3
- package/lib/types.d.ts +187 -0
- package/lib/utils/form-methods.d.ts +3 -0
- package/package.json +1 -1
- package/yarn-error.log +16168 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<component name="ProjectCodeStyleConfiguration">
|
|
2
|
+
<code_scheme name="Project" version="173">
|
|
3
|
+
<HTMLCodeStyleSettings>
|
|
4
|
+
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
|
|
5
|
+
</HTMLCodeStyleSettings>
|
|
6
|
+
<JSCodeStyleSettings version="0">
|
|
7
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
8
|
+
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
9
|
+
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
10
|
+
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
11
|
+
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
12
|
+
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
13
|
+
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
14
|
+
</JSCodeStyleSettings>
|
|
15
|
+
<TypeScriptCodeStyleSettings version="0">
|
|
16
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
17
|
+
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
18
|
+
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
19
|
+
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
20
|
+
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
21
|
+
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
22
|
+
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
23
|
+
</TypeScriptCodeStyleSettings>
|
|
24
|
+
<VueCodeStyleSettings>
|
|
25
|
+
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
|
|
26
|
+
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
|
|
27
|
+
</VueCodeStyleSettings>
|
|
28
|
+
<codeStyleSettings language="HTML">
|
|
29
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
30
|
+
<indentOptions>
|
|
31
|
+
<option name="INDENT_SIZE" value="2" />
|
|
32
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
33
|
+
<option name="TAB_SIZE" value="2" />
|
|
34
|
+
</indentOptions>
|
|
35
|
+
</codeStyleSettings>
|
|
36
|
+
<codeStyleSettings language="JavaScript">
|
|
37
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
38
|
+
<indentOptions>
|
|
39
|
+
<option name="INDENT_SIZE" value="2" />
|
|
40
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
41
|
+
<option name="TAB_SIZE" value="2" />
|
|
42
|
+
</indentOptions>
|
|
43
|
+
</codeStyleSettings>
|
|
44
|
+
<codeStyleSettings language="TypeScript">
|
|
45
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
46
|
+
<indentOptions>
|
|
47
|
+
<option name="INDENT_SIZE" value="2" />
|
|
48
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
49
|
+
<option name="TAB_SIZE" value="2" />
|
|
50
|
+
</indentOptions>
|
|
51
|
+
</codeStyleSettings>
|
|
52
|
+
<codeStyleSettings language="Vue">
|
|
53
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
54
|
+
<indentOptions>
|
|
55
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
56
|
+
</indentOptions>
|
|
57
|
+
</codeStyleSettings>
|
|
58
|
+
</code_scheme>
|
|
59
|
+
</component>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$">
|
|
5
|
+
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
7
|
+
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
+
</content>
|
|
9
|
+
<orderEntry type="inheritedJdk" />
|
|
10
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
11
|
+
</component>
|
|
12
|
+
</module>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/iglooform.iml" filepath="$PROJECT_DIR$/.idea/iglooform.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
package/.idea/vcs.xml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -113,9 +113,6 @@ var AddableSection = function AddableSection(_ref) {
|
|
|
113
113
|
errors: []
|
|
114
114
|
}]);
|
|
115
115
|
}
|
|
116
|
-
if (!display) {
|
|
117
|
-
return null;
|
|
118
|
-
}
|
|
119
116
|
var groups = groupKeys.map(function (key, index) {
|
|
120
117
|
var parentName = calcNamePath(namePath, index);
|
|
121
118
|
return /*#__PURE__*/_jsxs(Col, {
|
|
@@ -199,8 +196,10 @@ var AddableSection = function AddableSection(_ref) {
|
|
|
199
196
|
});
|
|
200
197
|
return /*#__PURE__*/_jsxs("div", {
|
|
201
198
|
className: "igloo-form-addable-section-container",
|
|
202
|
-
style: {
|
|
199
|
+
style: display ? {
|
|
203
200
|
width: '100%'
|
|
201
|
+
} : {
|
|
202
|
+
display: 'none'
|
|
204
203
|
},
|
|
205
204
|
children: [groups, groupKeys.length < max && !preview && /*#__PURE__*/_jsxs(Col, {
|
|
206
205
|
span: 24,
|
package/es/form/section/index.js
CHANGED
|
@@ -81,10 +81,12 @@ var Section = function Section(_ref) {
|
|
|
81
81
|
errors: []
|
|
82
82
|
}]);
|
|
83
83
|
}
|
|
84
|
-
return
|
|
84
|
+
return /*#__PURE__*/_jsxs(Col, {
|
|
85
85
|
span: 24,
|
|
86
86
|
className: classnames('igloo-section', className),
|
|
87
|
-
style: style
|
|
87
|
+
style: display ? style : {
|
|
88
|
+
display: 'none'
|
|
89
|
+
},
|
|
88
90
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
89
91
|
className: 'igloo-section-label',
|
|
90
92
|
onClick: function onClick() {
|
|
@@ -132,6 +134,6 @@ var Section = function Section(_ref) {
|
|
|
132
134
|
})
|
|
133
135
|
})
|
|
134
136
|
}))]
|
|
135
|
-
})
|
|
137
|
+
});
|
|
136
138
|
};
|
|
137
139
|
export default Section;
|
package/es/types.d.ts
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
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
|
+
}
|
|
56
|
+
export type FormItemAssert = {
|
|
57
|
+
field: NamePath;
|
|
58
|
+
value?: any;
|
|
59
|
+
operation?: 'eq' | 'ne' | 'in' | 'ni' | 'lt' | 'le' | 'gt' | 'ge' | 'co' | 'nc' | 'filled' | 'unfilled' | 'co-some' | 'co-every' | 'some-in' | 'every-in';
|
|
60
|
+
};
|
|
61
|
+
export type FormItemCopyValue = {
|
|
62
|
+
assert: FormItemAssert;
|
|
63
|
+
copyFrom: NamePath;
|
|
64
|
+
disabled?: boolean;
|
|
65
|
+
};
|
|
66
|
+
export type FormItemSelectValue = {
|
|
67
|
+
assert: FormItemAssert;
|
|
68
|
+
value: any;
|
|
69
|
+
disabled?: boolean;
|
|
70
|
+
};
|
|
71
|
+
export interface FormItemExtraConfig extends FormItemProps {
|
|
72
|
+
elements?: FormItemConfig[];
|
|
73
|
+
required?: boolean;
|
|
74
|
+
requiredAsserts?: FormItemAssert[];
|
|
75
|
+
extraLabel?: any;
|
|
76
|
+
xl?: number;
|
|
77
|
+
md?: number;
|
|
78
|
+
xs?: number;
|
|
79
|
+
span?: number;
|
|
80
|
+
areaCode?: number | string | (number | string)[];
|
|
81
|
+
phoneNumber?: number | string;
|
|
82
|
+
mergeRules?: boolean;
|
|
83
|
+
dependencies?: NamePath[];
|
|
84
|
+
antdDependencies?: NamePath[];
|
|
85
|
+
asserts?: FormItemAssert[];
|
|
86
|
+
shouldRender?: (form?: FormInstance) => boolean;
|
|
87
|
+
ignore?: boolean;
|
|
88
|
+
copyValue?: FormItemCopyValue;
|
|
89
|
+
selectValue?: FormItemSelectValue[];
|
|
90
|
+
disabled?: boolean | FormItemAssert | FormItemAssert[];
|
|
91
|
+
halfRow?: boolean;
|
|
92
|
+
fullRow?: boolean;
|
|
93
|
+
limit?: number;
|
|
94
|
+
hideWhenPreview?: boolean;
|
|
95
|
+
hideWhenEdit?: boolean;
|
|
96
|
+
requiredMessage?: string | ReactNode;
|
|
97
|
+
showOptional?: boolean;
|
|
98
|
+
previewFormater?(value: any, form?: FormInstance): any;
|
|
99
|
+
handleNext?(values: any): any;
|
|
100
|
+
render?(preview: boolean, form?: FormInstance, value?: any, onChange?: (params: any) => any, setShowStepButton?: IglooComponentProps['setShowStepButton']): any;
|
|
101
|
+
locales?: {
|
|
102
|
+
[key: string]: string;
|
|
103
|
+
};
|
|
104
|
+
options?: (CheckboxOptionType & {
|
|
105
|
+
extraInfo?: {
|
|
106
|
+
content: any;
|
|
107
|
+
shownTrigger: 'unchecked' | 'checked' | 'all';
|
|
108
|
+
};
|
|
109
|
+
})[] | SelectProps['options'];
|
|
110
|
+
sendOtp?: (value: any) => any;
|
|
111
|
+
dependField?: FormItemName;
|
|
112
|
+
countDownSeconds?: number;
|
|
113
|
+
getButtonDisabledState?: (form: FormInstance) => boolean;
|
|
114
|
+
getPreviousDisabledState?: (form: FormInstance) => boolean;
|
|
115
|
+
handleUpload?(file: File): PromiseLike<string>;
|
|
116
|
+
withoutForm?: boolean;
|
|
117
|
+
disableEditButton?: boolean;
|
|
118
|
+
hidePreviewDivider?: boolean;
|
|
119
|
+
valueFormater?: (value: any) => any;
|
|
120
|
+
currentStep?: number;
|
|
121
|
+
subscribedFields?: FormItemName[];
|
|
122
|
+
description?: string | React.ReactNode;
|
|
123
|
+
dateLimitationType?: 'relative' | 'absolute';
|
|
124
|
+
absoluteRangeStart?: number;
|
|
125
|
+
absoluteRangeEnd?: number;
|
|
126
|
+
relativeRangeStart?: {
|
|
127
|
+
type: 'day' | 'month' | 'year';
|
|
128
|
+
quantity: number;
|
|
129
|
+
pattern?: string;
|
|
130
|
+
dependField?: NamePath;
|
|
131
|
+
};
|
|
132
|
+
relativeRangeEnd?: {
|
|
133
|
+
type: 'day' | 'month' | 'year';
|
|
134
|
+
quantity: number;
|
|
135
|
+
pattern?: string;
|
|
136
|
+
dependField?: NamePath;
|
|
137
|
+
};
|
|
138
|
+
validationCode?: {
|
|
139
|
+
code: string;
|
|
140
|
+
errorMessage: string;
|
|
141
|
+
warningOnly?: boolean;
|
|
142
|
+
}[];
|
|
143
|
+
length?: number;
|
|
144
|
+
minLength?: number;
|
|
145
|
+
maxLength?: number;
|
|
146
|
+
idType?: 'KTP' | 'NIK';
|
|
147
|
+
validationRule?: string;
|
|
148
|
+
shouldRenderCode?: string;
|
|
149
|
+
disabledCode?: string;
|
|
150
|
+
automaticCalcCode?: string;
|
|
151
|
+
enableAutomaticCalc?: boolean;
|
|
152
|
+
[key: string]: any;
|
|
153
|
+
}
|
|
154
|
+
export interface FormItemConfig extends FormItemExtraConfig {
|
|
155
|
+
type?: string;
|
|
156
|
+
name?: NamePath;
|
|
157
|
+
label?: string | React.ReactNode;
|
|
158
|
+
previewLabel?: string | React.ReactNode;
|
|
159
|
+
labelProps?: any;
|
|
160
|
+
contentProps?: any;
|
|
161
|
+
ocr?: {
|
|
162
|
+
vender: string;
|
|
163
|
+
outputMap: {
|
|
164
|
+
field: string[];
|
|
165
|
+
source: string[];
|
|
166
|
+
}[];
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
export type FormItemPropsHandler = (config: FormItemConfig) => FormItemConfig;
|
|
170
|
+
export interface FC<P = {}> extends React.FunctionComponent<P> {
|
|
171
|
+
formItemPropsHandler?: FormItemPropsHandler;
|
|
172
|
+
isPreviewSupport?: boolean;
|
|
173
|
+
}
|
|
174
|
+
export interface Form extends React.ForwardRefExoticComponent<FormBasicConfig & React.RefAttributes<any>> {
|
|
175
|
+
useForm: () => FormInstance;
|
|
176
|
+
}
|
|
177
|
+
export interface IglooComponentProps {
|
|
178
|
+
validateField?: (nameList?: NamePath[]) => Promise<any>;
|
|
179
|
+
containerRef?: React.RefObject<any>;
|
|
180
|
+
setFieldError?(errorMsg?: string): void;
|
|
181
|
+
setFieldValue?(value?: any): void;
|
|
182
|
+
setShowStepButton?: (showButton: boolean) => void;
|
|
183
|
+
getFormInstance?: () => FormInstance;
|
|
184
|
+
locales?: {
|
|
185
|
+
[key: string]: string;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -121,9 +121,6 @@ var AddableSection = function AddableSection(_ref) {
|
|
|
121
121
|
errors: []
|
|
122
122
|
}]);
|
|
123
123
|
}
|
|
124
|
-
if (!display) {
|
|
125
|
-
return null;
|
|
126
|
-
}
|
|
127
124
|
var groups = groupKeys.map(function (key, index) {
|
|
128
125
|
var parentName = (0, _formUtils.calcNamePath)(namePath, index);
|
|
129
126
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Col, {
|
|
@@ -207,8 +204,10 @@ var AddableSection = function AddableSection(_ref) {
|
|
|
207
204
|
});
|
|
208
205
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
209
206
|
className: "igloo-form-addable-section-container",
|
|
210
|
-
style: {
|
|
207
|
+
style: display ? {
|
|
211
208
|
width: '100%'
|
|
209
|
+
} : {
|
|
210
|
+
display: 'none'
|
|
212
211
|
},
|
|
213
212
|
children: [groups, groupKeys.length < max && !preview && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Col, {
|
|
214
213
|
span: 24,
|
|
@@ -88,10 +88,12 @@ var Section = function Section(_ref) {
|
|
|
88
88
|
errors: []
|
|
89
89
|
}]);
|
|
90
90
|
}
|
|
91
|
-
return
|
|
91
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Col, {
|
|
92
92
|
span: 24,
|
|
93
93
|
className: (0, _classnames.default)('igloo-section', className),
|
|
94
|
-
style: style
|
|
94
|
+
style: display ? style : {
|
|
95
|
+
display: 'none'
|
|
96
|
+
},
|
|
95
97
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
96
98
|
className: 'igloo-section-label',
|
|
97
99
|
onClick: function onClick() {
|
|
@@ -139,7 +141,7 @@ var Section = function Section(_ref) {
|
|
|
139
141
|
})
|
|
140
142
|
})
|
|
141
143
|
}))]
|
|
142
|
-
})
|
|
144
|
+
});
|
|
143
145
|
};
|
|
144
146
|
var _default = Section;
|
|
145
147
|
exports.default = _default;
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
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
|
+
}
|
|
56
|
+
export type FormItemAssert = {
|
|
57
|
+
field: NamePath;
|
|
58
|
+
value?: any;
|
|
59
|
+
operation?: 'eq' | 'ne' | 'in' | 'ni' | 'lt' | 'le' | 'gt' | 'ge' | 'co' | 'nc' | 'filled' | 'unfilled' | 'co-some' | 'co-every' | 'some-in' | 'every-in';
|
|
60
|
+
};
|
|
61
|
+
export type FormItemCopyValue = {
|
|
62
|
+
assert: FormItemAssert;
|
|
63
|
+
copyFrom: NamePath;
|
|
64
|
+
disabled?: boolean;
|
|
65
|
+
};
|
|
66
|
+
export type FormItemSelectValue = {
|
|
67
|
+
assert: FormItemAssert;
|
|
68
|
+
value: any;
|
|
69
|
+
disabled?: boolean;
|
|
70
|
+
};
|
|
71
|
+
export interface FormItemExtraConfig extends FormItemProps {
|
|
72
|
+
elements?: FormItemConfig[];
|
|
73
|
+
required?: boolean;
|
|
74
|
+
requiredAsserts?: FormItemAssert[];
|
|
75
|
+
extraLabel?: any;
|
|
76
|
+
xl?: number;
|
|
77
|
+
md?: number;
|
|
78
|
+
xs?: number;
|
|
79
|
+
span?: number;
|
|
80
|
+
areaCode?: number | string | (number | string)[];
|
|
81
|
+
phoneNumber?: number | string;
|
|
82
|
+
mergeRules?: boolean;
|
|
83
|
+
dependencies?: NamePath[];
|
|
84
|
+
antdDependencies?: NamePath[];
|
|
85
|
+
asserts?: FormItemAssert[];
|
|
86
|
+
shouldRender?: (form?: FormInstance) => boolean;
|
|
87
|
+
ignore?: boolean;
|
|
88
|
+
copyValue?: FormItemCopyValue;
|
|
89
|
+
selectValue?: FormItemSelectValue[];
|
|
90
|
+
disabled?: boolean | FormItemAssert | FormItemAssert[];
|
|
91
|
+
halfRow?: boolean;
|
|
92
|
+
fullRow?: boolean;
|
|
93
|
+
limit?: number;
|
|
94
|
+
hideWhenPreview?: boolean;
|
|
95
|
+
hideWhenEdit?: boolean;
|
|
96
|
+
requiredMessage?: string | ReactNode;
|
|
97
|
+
showOptional?: boolean;
|
|
98
|
+
previewFormater?(value: any, form?: FormInstance): any;
|
|
99
|
+
handleNext?(values: any): any;
|
|
100
|
+
render?(preview: boolean, form?: FormInstance, value?: any, onChange?: (params: any) => any, setShowStepButton?: IglooComponentProps['setShowStepButton']): any;
|
|
101
|
+
locales?: {
|
|
102
|
+
[key: string]: string;
|
|
103
|
+
};
|
|
104
|
+
options?: (CheckboxOptionType & {
|
|
105
|
+
extraInfo?: {
|
|
106
|
+
content: any;
|
|
107
|
+
shownTrigger: 'unchecked' | 'checked' | 'all';
|
|
108
|
+
};
|
|
109
|
+
})[] | SelectProps['options'];
|
|
110
|
+
sendOtp?: (value: any) => any;
|
|
111
|
+
dependField?: FormItemName;
|
|
112
|
+
countDownSeconds?: number;
|
|
113
|
+
getButtonDisabledState?: (form: FormInstance) => boolean;
|
|
114
|
+
getPreviousDisabledState?: (form: FormInstance) => boolean;
|
|
115
|
+
handleUpload?(file: File): PromiseLike<string>;
|
|
116
|
+
withoutForm?: boolean;
|
|
117
|
+
disableEditButton?: boolean;
|
|
118
|
+
hidePreviewDivider?: boolean;
|
|
119
|
+
valueFormater?: (value: any) => any;
|
|
120
|
+
currentStep?: number;
|
|
121
|
+
subscribedFields?: FormItemName[];
|
|
122
|
+
description?: string | React.ReactNode;
|
|
123
|
+
dateLimitationType?: 'relative' | 'absolute';
|
|
124
|
+
absoluteRangeStart?: number;
|
|
125
|
+
absoluteRangeEnd?: number;
|
|
126
|
+
relativeRangeStart?: {
|
|
127
|
+
type: 'day' | 'month' | 'year';
|
|
128
|
+
quantity: number;
|
|
129
|
+
pattern?: string;
|
|
130
|
+
dependField?: NamePath;
|
|
131
|
+
};
|
|
132
|
+
relativeRangeEnd?: {
|
|
133
|
+
type: 'day' | 'month' | 'year';
|
|
134
|
+
quantity: number;
|
|
135
|
+
pattern?: string;
|
|
136
|
+
dependField?: NamePath;
|
|
137
|
+
};
|
|
138
|
+
validationCode?: {
|
|
139
|
+
code: string;
|
|
140
|
+
errorMessage: string;
|
|
141
|
+
warningOnly?: boolean;
|
|
142
|
+
}[];
|
|
143
|
+
length?: number;
|
|
144
|
+
minLength?: number;
|
|
145
|
+
maxLength?: number;
|
|
146
|
+
idType?: 'KTP' | 'NIK';
|
|
147
|
+
validationRule?: string;
|
|
148
|
+
shouldRenderCode?: string;
|
|
149
|
+
disabledCode?: string;
|
|
150
|
+
automaticCalcCode?: string;
|
|
151
|
+
enableAutomaticCalc?: boolean;
|
|
152
|
+
[key: string]: any;
|
|
153
|
+
}
|
|
154
|
+
export interface FormItemConfig extends FormItemExtraConfig {
|
|
155
|
+
type?: string;
|
|
156
|
+
name?: NamePath;
|
|
157
|
+
label?: string | React.ReactNode;
|
|
158
|
+
previewLabel?: string | React.ReactNode;
|
|
159
|
+
labelProps?: any;
|
|
160
|
+
contentProps?: any;
|
|
161
|
+
ocr?: {
|
|
162
|
+
vender: string;
|
|
163
|
+
outputMap: {
|
|
164
|
+
field: string[];
|
|
165
|
+
source: string[];
|
|
166
|
+
}[];
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
export type FormItemPropsHandler = (config: FormItemConfig) => FormItemConfig;
|
|
170
|
+
export interface FC<P = {}> extends React.FunctionComponent<P> {
|
|
171
|
+
formItemPropsHandler?: FormItemPropsHandler;
|
|
172
|
+
isPreviewSupport?: boolean;
|
|
173
|
+
}
|
|
174
|
+
export interface Form extends React.ForwardRefExoticComponent<FormBasicConfig & React.RefAttributes<any>> {
|
|
175
|
+
useForm: () => FormInstance;
|
|
176
|
+
}
|
|
177
|
+
export interface IglooComponentProps {
|
|
178
|
+
validateField?: (nameList?: NamePath[]) => Promise<any>;
|
|
179
|
+
containerRef?: React.RefObject<any>;
|
|
180
|
+
setFieldError?(errorMsg?: string): void;
|
|
181
|
+
setFieldValue?(value?: any): void;
|
|
182
|
+
setShowStepButton?: (showButton: boolean) => void;
|
|
183
|
+
getFormInstance?: () => FormInstance;
|
|
184
|
+
locales?: {
|
|
185
|
+
[key: string]: string;
|
|
186
|
+
};
|
|
187
|
+
}
|