iglooform 3.0.9 → 3.0.10

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.
Files changed (87) hide show
  1. package/.dumi/tmp/core/defineApp.ts +1 -1
  2. package/.dumi/tmp/core/helmet.ts +1 -1
  3. package/.dumi/tmp/core/history.ts +1 -1
  4. package/.dumi/tmp/core/historyIntelli.ts +1 -1
  5. package/.dumi/tmp/core/plugin.ts +2 -2
  6. package/.dumi/tmp/core/polyfill.ts +197 -197
  7. package/.dumi/tmp/core/route.tsx +33 -33
  8. package/.dumi/tmp/dumi/exports.ts +1 -1
  9. package/.dumi/tmp/dumi/locales/runtime.tsx +2 -2
  10. package/.dumi/tmp/dumi/meta/index.ts +33 -33
  11. package/.dumi/tmp/dumi/meta/runtime.ts +1 -1
  12. package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +2 -2
  13. package/.dumi/tmp/dumi/theme/builtins/API.ts +1 -1
  14. package/.dumi/tmp/dumi/theme/builtins/Badge.ts +1 -1
  15. package/.dumi/tmp/dumi/theme/builtins/Container.ts +1 -1
  16. package/.dumi/tmp/dumi/theme/builtins/Previewer.ts +1 -1
  17. package/.dumi/tmp/dumi/theme/builtins/SourceCode.ts +1 -1
  18. package/.dumi/tmp/dumi/theme/builtins/Table.ts +1 -1
  19. package/.dumi/tmp/dumi/theme/builtins/Tree.ts +1 -1
  20. package/.dumi/tmp/dumi/theme/layouts/DocLayout.ts +1 -1
  21. package/.dumi/tmp/dumi/theme/loading.tsx +1 -1
  22. package/.dumi/tmp/dumi/theme/slots/ColorSwitch.ts +1 -1
  23. package/.dumi/tmp/dumi/theme/slots/Content.ts +1 -1
  24. package/.dumi/tmp/dumi/theme/slots/ContentFooter.ts +1 -1
  25. package/.dumi/tmp/dumi/theme/slots/ContentTabs.ts +1 -1
  26. package/.dumi/tmp/dumi/theme/slots/Features.ts +1 -1
  27. package/.dumi/tmp/dumi/theme/slots/Footer.ts +1 -1
  28. package/.dumi/tmp/dumi/theme/slots/Header.ts +1 -1
  29. package/.dumi/tmp/dumi/theme/slots/HeaderExtra.ts +1 -1
  30. package/.dumi/tmp/dumi/theme/slots/Hero.ts +1 -1
  31. package/.dumi/tmp/dumi/theme/slots/HeroTitle.ts +1 -1
  32. package/.dumi/tmp/dumi/theme/slots/LangSwitch.ts +1 -1
  33. package/.dumi/tmp/dumi/theme/slots/Logo.ts +1 -1
  34. package/.dumi/tmp/dumi/theme/slots/Navbar.ts +1 -1
  35. package/.dumi/tmp/dumi/theme/slots/NavbarExtra.ts +1 -1
  36. package/.dumi/tmp/dumi/theme/slots/NotFound.ts +1 -1
  37. package/.dumi/tmp/dumi/theme/slots/PreviewerActions.ts +1 -1
  38. package/.dumi/tmp/dumi/theme/slots/PreviewerActionsExtra.ts +1 -1
  39. package/.dumi/tmp/dumi/theme/slots/RtlSwitch.ts +1 -1
  40. package/.dumi/tmp/dumi/theme/slots/SearchBar.ts +2 -2
  41. package/.dumi/tmp/dumi/theme/slots/SearchResult.ts +1 -1
  42. package/.dumi/tmp/dumi/theme/slots/Sidebar.ts +1 -1
  43. package/.dumi/tmp/dumi/theme/slots/SocialIcon.ts +1 -1
  44. package/.dumi/tmp/dumi/theme/slots/Toc.ts +1 -1
  45. package/.dumi/tmp/exports.ts +5 -5
  46. package/.dumi/tmp/testBrowser.tsx +3 -3
  47. package/.dumi/tmp/umi.ts +4 -4
  48. package/.idea/codeStyles/Project.xml +59 -0
  49. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  50. package/.idea/iglooform.iml +7 -4
  51. package/.idea/prettier.xml +6 -0
  52. package/es/admin-upload/index.d.ts +1 -0
  53. package/es/admin-upload/index.js +3 -2
  54. package/es/select/style/index.less +10 -10
  55. package/es/upload/index.js +14 -4
  56. package/es/upload-photo/index.js +14 -4
  57. package/lib/admin-upload/index.d.ts +1 -0
  58. package/lib/admin-upload/index.js +3 -2
  59. package/lib/select/style/index.less +10 -10
  60. package/lib/upload/index.js +14 -4
  61. package/lib/upload-photo/index.js +14 -4
  62. package/package.json +1 -1
  63. package/.idea/misc.xml +0 -5
  64. package/es/form/addable-section/index.d.ts +0 -20
  65. package/es/form/element/index.d.ts +0 -12
  66. package/es/form/index.d.ts +0 -4
  67. package/es/form/section/index.d.ts +0 -16
  68. package/es/form-context.d.ts +0 -28
  69. package/es/free-form/addable-section/index.d.ts +0 -19
  70. package/es/free-form/element/index.d.ts +0 -11
  71. package/es/free-form/index.d.ts +0 -11
  72. package/es/free-form/section/index.d.ts +0 -13
  73. package/es/modal/index.d.ts +0 -31
  74. package/es/types.d.ts +0 -183
  75. package/es/utils/form-utils.d.ts +0 -77
  76. package/lib/form/addable-section/index.d.ts +0 -20
  77. package/lib/form/element/index.d.ts +0 -12
  78. package/lib/form/index.d.ts +0 -4
  79. package/lib/form/section/index.d.ts +0 -16
  80. package/lib/form-context.d.ts +0 -28
  81. package/lib/free-form/addable-section/index.d.ts +0 -19
  82. package/lib/free-form/element/index.d.ts +0 -11
  83. package/lib/free-form/index.d.ts +0 -11
  84. package/lib/free-form/section/index.d.ts +0 -13
  85. package/lib/modal/index.d.ts +0 -31
  86. package/lib/types.d.ts +0 -183
  87. package/lib/utils/form-utils.d.ts +0 -77
package/es/types.d.ts DELETED
@@ -1,183 +0,0 @@
1
- /// <reference path="../typings.d.ts" />
2
- import { FormItemProps, FormInstance } from 'antd/es/form';
3
- import { ReactNode } from 'react';
4
- import { NamePath } from 'rc-field-form/lib/interface';
5
- import { CheckboxOptionType } from 'antd/es/checkbox';
6
- import { SelectProps } from 'antd/es/select';
7
- import { BlinkIdSingleSideRecognizerResult } from '@microblink/blinkid-in-browser-sdk';
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
- }[];
142
- length?: number;
143
- minLength?: number;
144
- maxLength?: number;
145
- idType?: 'KTP' | 'NIK';
146
- validationRule?: string;
147
- shouldRenderCode?: string;
148
- [key: string]: any;
149
- }
150
- export interface FormItemConfig extends FormItemExtraConfig {
151
- type?: string;
152
- name?: NamePath;
153
- label?: string | React.ReactNode;
154
- previewLabel?: string | React.ReactNode;
155
- labelProps?: any;
156
- contentProps?: any;
157
- ocr?: {
158
- vender: string;
159
- outputMap: {
160
- field: string[];
161
- source: string[];
162
- }[];
163
- };
164
- }
165
- export type FormItemPropsHandler = (config: FormItemConfig) => FormItemConfig;
166
- export interface FC<P = {}> extends React.FunctionComponent<P> {
167
- formItemPropsHandler?: FormItemPropsHandler;
168
- isPreviewSupport?: boolean;
169
- }
170
- export interface Form extends React.ForwardRefExoticComponent<FormBasicConfig & React.RefAttributes<any>> {
171
- useForm: () => FormInstance;
172
- }
173
- export interface IglooComponentProps {
174
- validateField?: (nameList?: NamePath[]) => Promise<any>;
175
- containerRef?: React.RefObject<any>;
176
- setFieldError?(errorMsg?: string): void;
177
- setFieldValue?(value?: any): void;
178
- setShowStepButton?: (showButton: boolean) => void;
179
- getFormInstance?: () => FormInstance;
180
- locales?: {
181
- [key: string]: string;
182
- };
183
- }
@@ -1,77 +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) => boolean;
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, dependencies?: NamePath[], asserts?: FormItemAssert[], shouldRender?: ((form?: FormInstance) => boolean) | undefined, shouldRenderCode?: string, form?: FormInstance) => any;
77
- export declare const getRuleValidation: (url: string, rule: string | string[], values?: any, lang?: string) => Promise<any>;
@@ -1,20 +0,0 @@
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;
@@ -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,4 +0,0 @@
1
- import { Form as FormType } from '../types';
2
- import './style';
3
- declare const ExportedForm: FormType;
4
- export default ExportedForm;
@@ -1,16 +0,0 @@
1
- import { FC } from 'react';
2
- import { FormItemProps } from 'antd/es/form';
3
- import { FormItemConfig, FormItemName } from '../../types';
4
- import './style';
5
- export interface SectionProps {
6
- parentName?: FormItemName;
7
- formItemProps?: FormItemProps;
8
- config: FormItemConfig;
9
- preview?: boolean;
10
- disabled?: boolean;
11
- collapsable?: boolean;
12
- defaultCollapsed?: boolean;
13
- setShowStepButton?: (showButton: boolean) => void;
14
- }
15
- declare const Section: FC<SectionProps>;
16
- export default Section;
@@ -1,28 +0,0 @@
1
- import React from 'react';
2
- import { FormInstance } from 'antd/es/form';
3
- import { FC, FormItemName, OCRHooks } from './types';
4
- declare const _default: React.Context<{
5
- form?: FormInstance<any> | undefined;
6
- onCancel?(): void;
7
- cancelText?: string | undefined;
8
- submitText?: string | undefined;
9
- previewText?: string | undefined;
10
- nextText?: string | undefined;
11
- continueText?: string | undefined;
12
- validateMessages?: Object | undefined;
13
- submitting?: boolean | undefined;
14
- requiredMark?: boolean | undefined;
15
- showSubmitButton?: boolean | undefined;
16
- getScrollContainer: () => HTMLElement | Window | null;
17
- registerDependencies: (name: FormItemName | FormItemName[], updater: Function) => void;
18
- handleValuesChange(changedFields: any): any;
19
- uploadApi?: string | undefined;
20
- selectDatasourceApi?: string | undefined;
21
- getRuleValidationApi?: string | undefined;
22
- customizeComponents?: {
23
- [name: string]: FC<{}>;
24
- } | undefined;
25
- ocrHooks?: OCRHooks | undefined;
26
- validationCodeExtraParams?: Record<string, any> | undefined;
27
- }>;
28
- export default _default;
@@ -1,19 +0,0 @@
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;
@@ -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;
@@ -1,11 +0,0 @@
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;
@@ -1,13 +0,0 @@
1
- import { FC } from 'react';
2
- import { FormItemProps } from 'antd/es/form';
3
- import { FormItemConfig, FormItemName } from '../../types';
4
- import './style';
5
- export interface SectionProps extends FormItemConfig {
6
- parentName?: FormItemName;
7
- formItemProps?: FormItemProps;
8
- preview?: boolean;
9
- disabledFromParent?: boolean;
10
- setShowStepButton?: (showButton: boolean) => void;
11
- }
12
- declare const Section: FC<SectionProps>;
13
- export default Section;
@@ -1,31 +0,0 @@
1
- import { FC } from 'react';
2
- import { ModalFuncProps, ModalProps } from 'antd/lib/modal';
3
- import { FormBasicConfig, FormItemConfig } from '../types';
4
- import './style';
5
- interface FormModalProps {
6
- mode?: 'form' | 'normal';
7
- formConfig?: FormItemConfig;
8
- formProps?: {
9
- locales?: FormBasicConfig['locales'];
10
- initialValues?: FormBasicConfig['initialValues'];
11
- validationCodeExtraParams?: Record<string, any>;
12
- };
13
- onOk?: (values: any, fullValue: any) => any;
14
- limitHeight?: boolean;
15
- }
16
- interface ModalFuncReturn {
17
- destroy: Function;
18
- update: (props: ModalProps & ModalFuncProps & FormModalProps) => any;
19
- }
20
- type ModalFunction = (props: ModalProps & ModalFuncProps & FormModalProps) => ModalFuncReturn;
21
- interface ModalType extends FC<ModalProps & ModalFuncProps & FormModalProps> {
22
- confirm: ModalFunction;
23
- info: ModalFunction;
24
- warning: ModalFunction;
25
- error: ModalFunction;
26
- success: ModalFunction;
27
- noFooter: ModalFunction;
28
- destroyAll: Function;
29
- }
30
- declare const IglooModal: ModalType;
31
- export default IglooModal;
package/lib/types.d.ts DELETED
@@ -1,183 +0,0 @@
1
- /// <reference path="../typings.d.ts" />
2
- import { FormItemProps, FormInstance } from 'antd/es/form';
3
- import { ReactNode } from 'react';
4
- import { NamePath } from 'rc-field-form/lib/interface';
5
- import { CheckboxOptionType } from 'antd/es/checkbox';
6
- import { SelectProps } from 'antd/es/select';
7
- import { BlinkIdSingleSideRecognizerResult } from '@microblink/blinkid-in-browser-sdk';
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
- }[];
142
- length?: number;
143
- minLength?: number;
144
- maxLength?: number;
145
- idType?: 'KTP' | 'NIK';
146
- validationRule?: string;
147
- shouldRenderCode?: string;
148
- [key: string]: any;
149
- }
150
- export interface FormItemConfig extends FormItemExtraConfig {
151
- type?: string;
152
- name?: NamePath;
153
- label?: string | React.ReactNode;
154
- previewLabel?: string | React.ReactNode;
155
- labelProps?: any;
156
- contentProps?: any;
157
- ocr?: {
158
- vender: string;
159
- outputMap: {
160
- field: string[];
161
- source: string[];
162
- }[];
163
- };
164
- }
165
- export type FormItemPropsHandler = (config: FormItemConfig) => FormItemConfig;
166
- export interface FC<P = {}> extends React.FunctionComponent<P> {
167
- formItemPropsHandler?: FormItemPropsHandler;
168
- isPreviewSupport?: boolean;
169
- }
170
- export interface Form extends React.ForwardRefExoticComponent<FormBasicConfig & React.RefAttributes<any>> {
171
- useForm: () => FormInstance;
172
- }
173
- export interface IglooComponentProps {
174
- validateField?: (nameList?: NamePath[]) => Promise<any>;
175
- containerRef?: React.RefObject<any>;
176
- setFieldError?(errorMsg?: string): void;
177
- setFieldValue?(value?: any): void;
178
- setShowStepButton?: (showButton: boolean) => void;
179
- getFormInstance?: () => FormInstance;
180
- locales?: {
181
- [key: string]: string;
182
- };
183
- }