iglooform 3.7.7 → 3.7.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/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 +2 -2
- 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/es/checkbox/index.d.ts +24 -0
- package/es/form/addable-section/index.d.ts +20 -0
- package/es/form/index.d.ts +4 -0
- package/es/free-form/addable-section/index.d.ts +19 -0
- package/es/free-form/index.d.ts +11 -0
- package/es/upload-photo/index.js +13 -2
- package/es/utils/option-utils.d.ts +29 -0
- package/lib/checkbox/index.d.ts +24 -0
- package/lib/form/addable-section/index.d.ts +20 -0
- package/lib/form/index.d.ts +4 -0
- package/lib/free-form/addable-section/index.d.ts +19 -0
- package/lib/free-form/index.d.ts +11 -0
- package/lib/upload-photo/index.js +13 -2
- package/lib/utils/option-utils.d.ts +29 -0
- package/package.json +1 -1
- package/.idea/codeStyles/Project.xml +0 -80
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/iglooformv3.iml +0 -12
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -6
- package/.idea/vcs.xml +0 -6
- package/es/form/element/index.d.ts +0 -12
- package/es/free-form/element/index.d.ts +0 -11
- package/es/types.d.ts +0 -189
- package/es/upload-preview/index.d.ts +0 -9
- package/es/utils/form-utils.d.ts +0 -79
- package/lib/form/element/index.d.ts +0 -12
- package/lib/free-form/element/index.d.ts +0 -11
- package/lib/types.d.ts +0 -189
- package/lib/upload-preview/index.d.ts +0 -9
- package/lib/utils/form-utils.d.ts +0 -79
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { FormItemProps } from 'antd/es/form';
|
|
3
|
+
import { FormItemConfig, FormItemName } from '../../types';
|
|
4
|
+
import './style';
|
|
5
|
+
export interface AddableSectionProps {
|
|
6
|
+
parentName?: FormItemName;
|
|
7
|
+
formItemProps?: FormItemProps;
|
|
8
|
+
config: FormItemConfig;
|
|
9
|
+
preview?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
setShowStepButton?: (showButton: boolean) => void;
|
|
12
|
+
max?: number;
|
|
13
|
+
min?: number;
|
|
14
|
+
initCount?: number;
|
|
15
|
+
addButtonText?: string;
|
|
16
|
+
addButtonIcon?: ReactNode;
|
|
17
|
+
description?: string | ReactNode;
|
|
18
|
+
}
|
|
19
|
+
declare const AddableSection: FC<AddableSectionProps>;
|
|
20
|
+
export default AddableSection;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { FormItemProps } from 'antd/es/form';
|
|
3
|
+
import { FormItemConfig, FormItemName } from '../../types';
|
|
4
|
+
import './style';
|
|
5
|
+
export interface AddableSectionProps extends FormItemConfig {
|
|
6
|
+
parentName?: FormItemName;
|
|
7
|
+
formItemProps?: FormItemProps;
|
|
8
|
+
preview?: boolean;
|
|
9
|
+
disabledFromParent?: boolean;
|
|
10
|
+
setShowStepButton?: (showButton: boolean) => void;
|
|
11
|
+
max?: number;
|
|
12
|
+
min?: number;
|
|
13
|
+
initCount?: number;
|
|
14
|
+
addButtonText?: string;
|
|
15
|
+
addButtonIcon?: ReactNode;
|
|
16
|
+
description?: string | ReactNode;
|
|
17
|
+
}
|
|
18
|
+
declare const AddableSection: FC<AddableSectionProps>;
|
|
19
|
+
export default AddableSection;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { Form } from 'antd';
|
|
3
|
+
import { FormBasicConfig } from '../types';
|
|
4
|
+
import './style';
|
|
5
|
+
interface FreeFormProps extends Omit<FormBasicConfig, 'config'> {
|
|
6
|
+
}
|
|
7
|
+
interface FreeFormType extends FC<PropsWithChildren<FreeFormProps>> {
|
|
8
|
+
useForm: typeof Form.useForm;
|
|
9
|
+
}
|
|
10
|
+
declare const FreeForm: FreeFormType;
|
|
11
|
+
export default FreeForm;
|
package/es/upload-photo/index.js
CHANGED
|
@@ -84,6 +84,8 @@ var UploadPhoto = function UploadPhoto(props) {
|
|
|
84
84
|
var limitNumError = useRef();
|
|
85
85
|
var DomRef = useRef();
|
|
86
86
|
var dataUrlRef = useRef([]);
|
|
87
|
+
var isValueSyncRef = useRef(false);
|
|
88
|
+
var isFirstRenderRef = useRef(true);
|
|
87
89
|
var _useContext = useContext(FormContext),
|
|
88
90
|
uploadApi = _useContext.uploadApi;
|
|
89
91
|
invariant(typeof props.handleUpload === 'function' || uploadApi, '"handleUpload" should be a function. Or uploadApi should be set at Form/FreeForm');
|
|
@@ -196,7 +198,8 @@ var UploadPhoto = function UploadPhoto(props) {
|
|
|
196
198
|
return _ref3.apply(this, arguments);
|
|
197
199
|
};
|
|
198
200
|
}())).then(function () {
|
|
199
|
-
|
|
201
|
+
isValueSyncRef.current = true;
|
|
202
|
+
setFiles(_files);
|
|
200
203
|
});
|
|
201
204
|
};
|
|
202
205
|
useEffect(function () {
|
|
@@ -212,13 +215,21 @@ var UploadPhoto = function UploadPhoto(props) {
|
|
|
212
215
|
mapFilesFromValue(newUrls);
|
|
213
216
|
}
|
|
214
217
|
} else if (!value && files.length > 0) {
|
|
215
|
-
|
|
218
|
+
isValueSyncRef.current = true;
|
|
216
219
|
setFiles([]);
|
|
217
220
|
setMasks([]);
|
|
218
221
|
}
|
|
219
222
|
}, [value]);
|
|
220
223
|
useEffect(function () {
|
|
221
224
|
if (!value && !files.length) return;
|
|
225
|
+
if (isFirstRenderRef.current) {
|
|
226
|
+
isFirstRenderRef.current = false;
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
if (isValueSyncRef.current) {
|
|
230
|
+
isValueSyncRef.current = false;
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
222
233
|
if (files.length) {
|
|
223
234
|
var hasProcessing = files.find(function (f) {
|
|
224
235
|
return f.status === 'progress';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { FC, IglooComponentProps } from '../types';
|
|
3
|
+
import { FormInstance } from 'antd/es/form';
|
|
4
|
+
import { NamePath } from 'antd/es/form/interface';
|
|
5
|
+
import { SelectProps, SelectValue } from 'antd/es/select';
|
|
6
|
+
export declare const compareOptions: (newOptions: any[], oldOptions?: any[]) => boolean;
|
|
7
|
+
export declare const compareSelected: (newValue: any | any[], oldValue: any | any[]) => boolean;
|
|
8
|
+
type Options = SelectProps<SelectValue>['options'];
|
|
9
|
+
export interface HOCProps extends IglooComponentProps {
|
|
10
|
+
options?: Options;
|
|
11
|
+
onSearch?: any;
|
|
12
|
+
getOptions?: (form: FormInstance) => any[];
|
|
13
|
+
optionGroups?: {
|
|
14
|
+
parentKey: string;
|
|
15
|
+
options: Options;
|
|
16
|
+
}[];
|
|
17
|
+
datasourceFilters?: string[];
|
|
18
|
+
datasourceKey?: string;
|
|
19
|
+
datasourceApi?: string;
|
|
20
|
+
dependField?: NamePath;
|
|
21
|
+
passCompareOptions?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface ComponentProps extends IglooComponentProps {
|
|
24
|
+
options?: Options;
|
|
25
|
+
clearWhenOptionsUpdated?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function optionsHOC<T>(Component: FC<T>): FC<PropsWithChildren<HOCProps & T>>;
|
|
28
|
+
export declare function previewSelectedOptions(options: Options, value: any): any;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CheckboxProps, CheckboxGroupProps } from 'antd/es/checkbox';
|
|
3
|
+
import { FC, IglooComponentProps } from '../types';
|
|
4
|
+
import { ComponentProps } from '../utils/option-utils';
|
|
5
|
+
import { DefaultOptionType } from 'rc-select/lib/Select';
|
|
6
|
+
import './style';
|
|
7
|
+
interface Props extends IglooComponentProps, CheckboxProps {
|
|
8
|
+
}
|
|
9
|
+
export interface Option extends DefaultOptionType {
|
|
10
|
+
extraInfo?: {
|
|
11
|
+
content: any;
|
|
12
|
+
shownTrigger: 'unchecked' | 'checked' | 'all';
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface IProps extends IglooComponentProps, Omit<CheckboxGroupProps, 'options'>, ComponentProps {
|
|
16
|
+
className?: string;
|
|
17
|
+
radioType?: string;
|
|
18
|
+
options: Option[];
|
|
19
|
+
preview?: boolean;
|
|
20
|
+
mutuallyExclusions?: Record<string, string[]>;
|
|
21
|
+
}
|
|
22
|
+
declare const IglooCheckbox: FC<Props>;
|
|
23
|
+
export default IglooCheckbox;
|
|
24
|
+
export declare const CheckboxGroup: FC<import("react").PropsWithChildren<import("../utils/option-utils").HOCProps & IProps>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { FormItemProps } from 'antd/es/form';
|
|
3
|
+
import { FormItemConfig, FormItemName } from '../../types';
|
|
4
|
+
import './style';
|
|
5
|
+
export interface AddableSectionProps {
|
|
6
|
+
parentName?: FormItemName;
|
|
7
|
+
formItemProps?: FormItemProps;
|
|
8
|
+
config: FormItemConfig;
|
|
9
|
+
preview?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
setShowStepButton?: (showButton: boolean) => void;
|
|
12
|
+
max?: number;
|
|
13
|
+
min?: number;
|
|
14
|
+
initCount?: number;
|
|
15
|
+
addButtonText?: string;
|
|
16
|
+
addButtonIcon?: ReactNode;
|
|
17
|
+
description?: string | ReactNode;
|
|
18
|
+
}
|
|
19
|
+
declare const AddableSection: FC<AddableSectionProps>;
|
|
20
|
+
export default AddableSection;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { FormItemProps } from 'antd/es/form';
|
|
3
|
+
import { FormItemConfig, FormItemName } from '../../types';
|
|
4
|
+
import './style';
|
|
5
|
+
export interface AddableSectionProps extends FormItemConfig {
|
|
6
|
+
parentName?: FormItemName;
|
|
7
|
+
formItemProps?: FormItemProps;
|
|
8
|
+
preview?: boolean;
|
|
9
|
+
disabledFromParent?: boolean;
|
|
10
|
+
setShowStepButton?: (showButton: boolean) => void;
|
|
11
|
+
max?: number;
|
|
12
|
+
min?: number;
|
|
13
|
+
initCount?: number;
|
|
14
|
+
addButtonText?: string;
|
|
15
|
+
addButtonIcon?: ReactNode;
|
|
16
|
+
description?: string | ReactNode;
|
|
17
|
+
}
|
|
18
|
+
declare const AddableSection: FC<AddableSectionProps>;
|
|
19
|
+
export default AddableSection;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { Form } from 'antd';
|
|
3
|
+
import { FormBasicConfig } from '../types';
|
|
4
|
+
import './style';
|
|
5
|
+
interface FreeFormProps extends Omit<FormBasicConfig, 'config'> {
|
|
6
|
+
}
|
|
7
|
+
interface FreeFormType extends FC<PropsWithChildren<FreeFormProps>> {
|
|
8
|
+
useForm: typeof Form.useForm;
|
|
9
|
+
}
|
|
10
|
+
declare const FreeForm: FreeFormType;
|
|
11
|
+
export default FreeForm;
|
|
@@ -88,6 +88,8 @@ var UploadPhoto = function UploadPhoto(props) {
|
|
|
88
88
|
var limitNumError = (0, _react.useRef)();
|
|
89
89
|
var DomRef = (0, _react.useRef)();
|
|
90
90
|
var dataUrlRef = (0, _react.useRef)([]);
|
|
91
|
+
var isValueSyncRef = (0, _react.useRef)(false);
|
|
92
|
+
var isFirstRenderRef = (0, _react.useRef)(true);
|
|
91
93
|
var _useContext = (0, _react.useContext)(_formContext.default),
|
|
92
94
|
uploadApi = _useContext.uploadApi;
|
|
93
95
|
(0, _invariant.default)(typeof props.handleUpload === 'function' || uploadApi, '"handleUpload" should be a function. Or uploadApi should be set at Form/FreeForm');
|
|
@@ -200,7 +202,8 @@ var UploadPhoto = function UploadPhoto(props) {
|
|
|
200
202
|
return _ref3.apply(this, arguments);
|
|
201
203
|
};
|
|
202
204
|
}())).then(function () {
|
|
203
|
-
|
|
205
|
+
isValueSyncRef.current = true;
|
|
206
|
+
setFiles(_files);
|
|
204
207
|
});
|
|
205
208
|
};
|
|
206
209
|
(0, _react.useEffect)(function () {
|
|
@@ -216,13 +219,21 @@ var UploadPhoto = function UploadPhoto(props) {
|
|
|
216
219
|
mapFilesFromValue(newUrls);
|
|
217
220
|
}
|
|
218
221
|
} else if (!value && files.length > 0) {
|
|
219
|
-
|
|
222
|
+
isValueSyncRef.current = true;
|
|
220
223
|
setFiles([]);
|
|
221
224
|
setMasks([]);
|
|
222
225
|
}
|
|
223
226
|
}, [value]);
|
|
224
227
|
(0, _react.useEffect)(function () {
|
|
225
228
|
if (!value && !files.length) return;
|
|
229
|
+
if (isFirstRenderRef.current) {
|
|
230
|
+
isFirstRenderRef.current = false;
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
if (isValueSyncRef.current) {
|
|
234
|
+
isValueSyncRef.current = false;
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
226
237
|
if (files.length) {
|
|
227
238
|
var hasProcessing = files.find(function (f) {
|
|
228
239
|
return f.status === 'progress';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { FC, IglooComponentProps } from '../types';
|
|
3
|
+
import { FormInstance } from 'antd/es/form';
|
|
4
|
+
import { NamePath } from 'antd/es/form/interface';
|
|
5
|
+
import { SelectProps, SelectValue } from 'antd/es/select';
|
|
6
|
+
export declare const compareOptions: (newOptions: any[], oldOptions?: any[]) => boolean;
|
|
7
|
+
export declare const compareSelected: (newValue: any | any[], oldValue: any | any[]) => boolean;
|
|
8
|
+
type Options = SelectProps<SelectValue>['options'];
|
|
9
|
+
export interface HOCProps extends IglooComponentProps {
|
|
10
|
+
options?: Options;
|
|
11
|
+
onSearch?: any;
|
|
12
|
+
getOptions?: (form: FormInstance) => any[];
|
|
13
|
+
optionGroups?: {
|
|
14
|
+
parentKey: string;
|
|
15
|
+
options: Options;
|
|
16
|
+
}[];
|
|
17
|
+
datasourceFilters?: string[];
|
|
18
|
+
datasourceKey?: string;
|
|
19
|
+
datasourceApi?: string;
|
|
20
|
+
dependField?: NamePath;
|
|
21
|
+
passCompareOptions?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface ComponentProps extends IglooComponentProps {
|
|
24
|
+
options?: Options;
|
|
25
|
+
clearWhenOptionsUpdated?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function optionsHOC<T>(Component: FC<T>): FC<PropsWithChildren<HOCProps & T>>;
|
|
28
|
+
export declare function previewSelectedOptions(options: Options, value: any): any;
|
|
29
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,80 +0,0 @@
|
|
|
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
|
-
<JetCodeStyleSettings>
|
|
16
|
-
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
|
17
|
-
</JetCodeStyleSettings>
|
|
18
|
-
<TypeScriptCodeStyleSettings version="0">
|
|
19
|
-
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
20
|
-
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
21
|
-
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
22
|
-
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
23
|
-
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
24
|
-
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
25
|
-
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
26
|
-
</TypeScriptCodeStyleSettings>
|
|
27
|
-
<VueCodeStyleSettings>
|
|
28
|
-
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
|
|
29
|
-
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
|
|
30
|
-
</VueCodeStyleSettings>
|
|
31
|
-
<codeStyleSettings language="HTML">
|
|
32
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
33
|
-
<indentOptions>
|
|
34
|
-
<option name="INDENT_SIZE" value="2" />
|
|
35
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
36
|
-
<option name="TAB_SIZE" value="2" />
|
|
37
|
-
</indentOptions>
|
|
38
|
-
</codeStyleSettings>
|
|
39
|
-
<codeStyleSettings language="JAVA">
|
|
40
|
-
<indentOptions>
|
|
41
|
-
<option name="INDENT_SIZE" value="2" />
|
|
42
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
43
|
-
<option name="TAB_SIZE" value="2" />
|
|
44
|
-
</indentOptions>
|
|
45
|
-
</codeStyleSettings>
|
|
46
|
-
<codeStyleSettings language="JavaScript">
|
|
47
|
-
<option name="SPACE_BEFORE_METHOD_PARENTHESES" value="true" />
|
|
48
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
49
|
-
<indentOptions>
|
|
50
|
-
<option name="INDENT_SIZE" value="2" />
|
|
51
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
52
|
-
<option name="TAB_SIZE" value="2" />
|
|
53
|
-
</indentOptions>
|
|
54
|
-
</codeStyleSettings>
|
|
55
|
-
<codeStyleSettings language="TypeScript">
|
|
56
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
57
|
-
<indentOptions>
|
|
58
|
-
<option name="INDENT_SIZE" value="2" />
|
|
59
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
60
|
-
<option name="TAB_SIZE" value="2" />
|
|
61
|
-
</indentOptions>
|
|
62
|
-
</codeStyleSettings>
|
|
63
|
-
<codeStyleSettings language="Vue">
|
|
64
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
65
|
-
<indentOptions>
|
|
66
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
67
|
-
</indentOptions>
|
|
68
|
-
</codeStyleSettings>
|
|
69
|
-
<codeStyleSettings language="XML">
|
|
70
|
-
<indentOptions>
|
|
71
|
-
<option name="INDENT_SIZE" value="2" />
|
|
72
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
73
|
-
<option name="TAB_SIZE" value="2" />
|
|
74
|
-
</indentOptions>
|
|
75
|
-
</codeStyleSettings>
|
|
76
|
-
<codeStyleSettings language="kotlin">
|
|
77
|
-
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
|
78
|
-
</codeStyleSettings>
|
|
79
|
-
</code_scheme>
|
|
80
|
-
</component>
|
package/.idea/iglooformv3.iml
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
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>
|
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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/iglooformv3.iml" filepath="$PROJECT_DIR$/.idea/iglooformv3.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
package/.idea/prettier.xml
DELETED
package/.idea/vcs.xml
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { FormItemConfig, FormItemName } from '../../types';
|
|
3
|
-
import './style';
|
|
4
|
-
interface ElementProps {
|
|
5
|
-
config: FormItemConfig;
|
|
6
|
-
parentName?: FormItemName;
|
|
7
|
-
preview?: boolean;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
setShowStepButton?: (showButton: boolean) => void;
|
|
10
|
-
}
|
|
11
|
-
declare const Element: FC<ElementProps>;
|
|
12
|
-
export default Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { FormItemConfig, FormItemName } from '../../types';
|
|
3
|
-
import './style';
|
|
4
|
-
interface ElementProps extends FormItemConfig {
|
|
5
|
-
parentName?: FormItemName;
|
|
6
|
-
preview?: boolean;
|
|
7
|
-
setShowStepButton?: (showButton: boolean) => void;
|
|
8
|
-
disabledFromParent?: boolean;
|
|
9
|
-
}
|
|
10
|
-
declare const Element: FC<ElementProps>;
|
|
11
|
-
export default Element;
|
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
|
-
}
|