iglooform 3.3.8 → 3.4.0
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/documents/index.js +27 -3
- package/es/form/hsteps/index.d.ts +21 -0
- package/es/form/step-items-selection/components/section-of-item-condition/hooks/useAdaptAssertConfig.d.ts +4 -0
- package/es/index.d.ts +49 -0
- package/es/media/index.d.ts +1 -0
- package/es/media/index.js +67 -36
- package/es/media/media.d.ts +4 -1
- package/es/media/media.js +75 -28
- package/es/types.d.ts +189 -0
- package/es/utils/form-utils.d.ts +79 -0
- package/lib/documents/index.js +27 -3
- package/lib/form/hsteps/index.d.ts +21 -0
- package/lib/form/step-items-selection/components/section-of-item-condition/hooks/useAdaptAssertConfig.d.ts +4 -0
- package/lib/index.d.ts +49 -0
- package/lib/media/index.d.ts +1 -0
- package/lib/media/index.js +66 -36
- package/lib/media/media.d.ts +4 -1
- package/lib/media/media.js +74 -28
- package/lib/types.d.ts +189 -0
- package/lib/utils/form-utils.d.ts +79 -0
- package/package.json +1 -1
- package/.idea/codeStyles/Project.xml +0 -59
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/iglooform.iml +0 -12
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -6
- package/.idea/vcs.xml +0 -6
- package/es/admin-amount/style/index.d.ts +0 -0
- package/es/babel-plugin-import-option.d.ts +0 -7
- package/es/back-top/index.d.ts +0 -5
- package/es/claim-list/style/index.d.ts +0 -1
- package/es/confirmation/style/index.d.ts +0 -1
- package/es/currency-context/index.d.ts +0 -8
- package/es/currency-context/style/index.d.ts +0 -0
- package/es/date-picker/style/index.d.ts +0 -1
- package/es/declaration/style/index.d.ts +0 -1
- package/es/detail-panel/style/index.d.ts +0 -1
- package/es/documents/style/index.d.ts +0 -1
- package/es/filter/style/index.d.ts +0 -1
- package/es/form/addable-section/style/index.d.ts +0 -1
- package/es/form/divider/style/index.d.ts +0 -1
- package/es/form/element/style/index.d.ts +0 -1
- package/es/form/hstep/style/index.d.ts +0 -1
- package/es/form/hsteps/style/index.d.ts +0 -1
- package/es/form/login/style/index.d.ts +0 -1
- package/es/form/messages.d.ts +0 -48
- package/es/form/page/style/index.d.ts +0 -1
- package/es/form/pages/style/index.d.ts +0 -1
- package/es/form/render/style/index.d.ts +0 -1
- package/es/form/section/style/index.d.ts +0 -1
- package/es/form/step/style/index.d.ts +0 -1
- package/es/form/steps/style/index.d.ts +0 -1
- package/es/form/style/index.d.ts +0 -1
- package/es/free-form/addable-section/style/index.d.ts +0 -1
- package/es/free-form/element/style/index.d.ts +0 -1
- package/es/free-form/messages.d.ts +0 -48
- package/es/free-form/page/style/index.d.ts +0 -1
- package/es/free-form/pages/style/index.d.ts +0 -1
- package/es/free-form/section/style/index.d.ts +0 -1
- package/es/free-form/step/style/index.d.ts +0 -1
- package/es/free-form/steps/style/index.d.ts +0 -1
- package/es/free-form/style/index.d.ts +0 -1
- package/es/home-menu/style/index.d.ts +0 -1
- package/es/input/style/amount/index.d.ts +0 -2
- package/es/input/style/index.d.ts +0 -2
- package/es/input/style/input-date/index.d.ts +0 -2
- package/es/input/style/otp/index.d.ts +0 -2
- package/es/input/style/phone-number/index.d.ts +0 -2
- package/es/input/style/text-area/index.d.ts +0 -2
- package/es/layout/defaultHeader.d.ts +0 -4
- package/es/layout/style/index.d.ts +0 -1
- package/es/locale/en-US.d.ts +0 -2
- package/es/locale/format-message.d.ts +0 -10
- package/es/locale/formatted-message.d.ts +0 -6
- package/es/locale/id-ID.d.ts +0 -2
- package/es/locale/index.d.ts +0 -4
- package/es/locale/locale-context.d.ts +0 -12
- package/es/locale/ms-MY.d.ts +0 -2
- package/es/locale/th-TH.d.ts +0 -2
- package/es/locale/vi-VN.d.ts +0 -2
- package/es/locale/zh-CN.d.ts +0 -2
- package/es/locale/zh-TW.d.ts +0 -2
- package/es/login-page/index.d.ts +0 -7
- package/es/login-page/style/index.d.ts +0 -1
- package/es/media/style/index.d.ts +0 -1
- package/es/message/style/index.d.ts +0 -1
- package/es/mobile-insurer-detail/style/index.d.ts +0 -1
- package/es/mobile-insurer-list/style/index.d.ts +0 -1
- package/es/modal/style/index.d.ts +0 -1
- package/es/ocr/micro-blink/style/index.d.ts +0 -1
- package/es/platform/index.d.ts +0 -2
- package/es/platform/platform-card/index.d.ts +0 -12
- package/es/platform/platform-card/style/index.d.ts +0 -1
- package/es/platform/switch-platform/index.d.ts +0 -12
- package/es/platform/switch-platform/style/index.d.ts +0 -1
- package/es/policy-list/style/index.d.ts +0 -1
- package/es/radio/style/index.d.ts +0 -1
- package/es/search-box/style/index.d.ts +0 -1
- package/es/select/style/index.d.ts +0 -1
- package/es/status-box/style/index.d.ts +0 -1
- package/es/table/style/index.d.ts +0 -1
- package/es/tabs/index.d.ts +0 -15
- package/es/tabs/style/index.d.ts +0 -1
- package/es/typography/style/index.d.ts +0 -1
- package/es/upload/style/index.d.ts +0 -1
- package/es/upload-photo/media.d.ts +0 -7
- package/es/upload-photo/style/index.d.ts +0 -1
- package/es/upload-preview/style/index.d.ts +0 -1
- package/es/utils/agent-detect.d.ts +0 -1
- package/es/utils/useAsyncEffect.d.ts +0 -3
- package/lib/admin-amount/style/index.d.ts +0 -0
- package/lib/admin-upload/style/index.d.ts +0 -1
- package/lib/alert-message/style/index.d.ts +0 -1
- package/lib/babel-plugin-import-option.d.ts +0 -7
- package/lib/back-top/index.d.ts +0 -5
- package/lib/back-top/style/index.d.ts +0 -1
- package/lib/button/style/index.d.ts +0 -1
- package/lib/card-detail/style/index.d.ts +0 -1
- package/lib/checkbox/style/index.d.ts +0 -1
- package/lib/claim-list/style/index.d.ts +0 -1
- package/lib/confirmation/style/index.d.ts +0 -1
- package/lib/currency-context/index.d.ts +0 -8
- package/lib/currency-context/style/index.d.ts +0 -0
- package/lib/date-picker/style/index.d.ts +0 -1
- package/lib/declaration/style/index.d.ts +0 -1
- package/lib/detail-panel/style/index.d.ts +0 -1
- package/lib/documents/style/index.d.ts +0 -1
- package/lib/filter/style/index.d.ts +0 -1
- package/lib/form/addable-section/style/index.d.ts +0 -1
- package/lib/form/divider/style/index.d.ts +0 -1
- package/lib/form/element/style/index.d.ts +0 -1
- package/lib/form/hstep/style/index.d.ts +0 -1
- package/lib/form/hsteps/style/index.d.ts +0 -1
- package/lib/form/login/style/index.d.ts +0 -1
- package/lib/form/messages.d.ts +0 -48
- package/lib/form/page/style/index.d.ts +0 -1
- package/lib/form/pages/style/index.d.ts +0 -1
- package/lib/form/render/style/index.d.ts +0 -1
- package/lib/form/section/style/index.d.ts +0 -1
- package/lib/form/step/style/index.d.ts +0 -1
- package/lib/form/steps/style/index.d.ts +0 -1
- package/lib/form/style/index.d.ts +0 -1
- package/lib/free-form/addable-section/style/index.d.ts +0 -1
- package/lib/free-form/element/style/index.d.ts +0 -1
- package/lib/free-form/messages.d.ts +0 -48
- package/lib/free-form/page/style/index.d.ts +0 -1
- package/lib/free-form/pages/style/index.d.ts +0 -1
- package/lib/free-form/section/style/index.d.ts +0 -1
- package/lib/free-form/step/style/index.d.ts +0 -1
- package/lib/free-form/steps/style/index.d.ts +0 -1
- package/lib/free-form/style/index.d.ts +0 -1
- package/lib/home-menu/style/index.d.ts +0 -1
- package/lib/input/style/amount/index.d.ts +0 -2
- package/lib/input/style/index.d.ts +0 -2
- package/lib/input/style/input-date/index.d.ts +0 -2
- package/lib/input/style/otp/index.d.ts +0 -2
- package/lib/input/style/phone-number/index.d.ts +0 -2
- package/lib/input/style/text-area/index.d.ts +0 -2
- package/lib/layout/defaultHeader.d.ts +0 -4
- package/lib/layout/style/index.d.ts +0 -1
- package/lib/locale/en-US.d.ts +0 -2
- package/lib/locale/format-message.d.ts +0 -10
- package/lib/locale/formatted-message.d.ts +0 -6
- package/lib/locale/id-ID.d.ts +0 -2
- package/lib/locale/index.d.ts +0 -4
- package/lib/locale/locale-context.d.ts +0 -12
- package/lib/locale/ms-MY.d.ts +0 -2
- package/lib/locale/th-TH.d.ts +0 -2
- package/lib/locale/vi-VN.d.ts +0 -2
- package/lib/locale/zh-CN.d.ts +0 -2
- package/lib/locale/zh-TW.d.ts +0 -2
- package/lib/login-page/index.d.ts +0 -7
- package/lib/login-page/style/index.d.ts +0 -1
- package/lib/media/style/index.d.ts +0 -1
- package/lib/message/style/index.d.ts +0 -1
- package/lib/mobile-insurer-detail/style/index.d.ts +0 -1
- package/lib/mobile-insurer-list/style/index.d.ts +0 -1
- package/lib/modal/style/index.d.ts +0 -1
- package/lib/ocr/micro-blink/style/index.d.ts +0 -1
- package/lib/platform/index.d.ts +0 -2
- package/lib/platform/platform-card/index.d.ts +0 -12
- package/lib/platform/platform-card/style/index.d.ts +0 -1
- package/lib/platform/switch-platform/index.d.ts +0 -12
- package/lib/platform/switch-platform/style/index.d.ts +0 -1
- package/lib/policy-list/style/index.d.ts +0 -1
- package/lib/radio/style/index.d.ts +0 -1
- package/lib/search-box/style/index.d.ts +0 -1
- package/lib/select/style/index.d.ts +0 -1
- package/lib/status-box/style/index.d.ts +0 -1
- package/lib/table/style/index.d.ts +0 -1
- package/lib/tabs/index.d.ts +0 -15
- package/lib/tabs/style/index.d.ts +0 -1
- package/lib/typography/style/index.d.ts +0 -1
- package/lib/upload/style/index.d.ts +0 -1
- package/lib/upload-photo/media.d.ts +0 -7
- package/lib/upload-photo/style/index.d.ts +0 -1
- package/lib/upload-preview/style/index.d.ts +0 -1
- package/lib/utils/agent-detect.d.ts +0 -1
- package/lib/utils/useAsyncEffect.d.ts +0 -3
- package/yarn-error.log +0 -16168
- /package/es/{admin-upload → form/step-items-selection/components/checkbox-group-items}/style/index.d.ts +0 -0
- /package/es/{alert-message → form/step-items-selection/components/item-info}/style/index.d.ts +0 -0
- /package/es/{back-top → form/step-items-selection/components/section-of-item-condition}/style/index.d.ts +0 -0
- /package/{es/button → lib/form/step-items-selection/components/checkbox-group-items}/style/index.d.ts +0 -0
- /package/{es/card-detail → lib/form/step-items-selection/components/item-info}/style/index.d.ts +0 -0
- /package/{es/checkbox → lib/form/step-items-selection/components/section-of-item-condition}/style/index.d.ts +0 -0
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormInstance } from 'antd/es/form';
|
|
3
|
+
import { FormItemConfig, FormItemExtraConfig, FormItemName, FormItemCopyValue, FormItemSelectValue, FormItemAssert, Rule } from '../types';
|
|
4
|
+
import { NamePath } from 'antd/es/form/interface';
|
|
5
|
+
export declare const calcNamePath: (parentName: FormItemName | undefined, name: FormItemName | undefined) => any[];
|
|
6
|
+
export declare const testAssert: (form: FormInstance, assert: FormItemAssert) => boolean;
|
|
7
|
+
export declare const calcFormItemProps: (config: FormItemConfig, extraProps: FormItemExtraConfig, form?: FormInstance, parentName?: FormItemName, validationCodeExtraParams?: Record<string, any>) => {
|
|
8
|
+
colProps: {
|
|
9
|
+
span: number;
|
|
10
|
+
xs: number;
|
|
11
|
+
sm: number;
|
|
12
|
+
md: number;
|
|
13
|
+
halfRow: boolean | undefined;
|
|
14
|
+
};
|
|
15
|
+
formItemProps: {
|
|
16
|
+
name: any[];
|
|
17
|
+
className: string | undefined;
|
|
18
|
+
initialValue: any;
|
|
19
|
+
copiedValue: {
|
|
20
|
+
copied: boolean;
|
|
21
|
+
value?: undefined;
|
|
22
|
+
disabled?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
copied: boolean;
|
|
25
|
+
value: any;
|
|
26
|
+
disabled: boolean | undefined;
|
|
27
|
+
};
|
|
28
|
+
selectedValue: {
|
|
29
|
+
selected: boolean;
|
|
30
|
+
value?: undefined;
|
|
31
|
+
disabled?: undefined;
|
|
32
|
+
} | {
|
|
33
|
+
selected: boolean;
|
|
34
|
+
value: any;
|
|
35
|
+
disabled: boolean | undefined;
|
|
36
|
+
};
|
|
37
|
+
normalize: ((value: any, prevValue: any, allValues: import("rc-field-form/lib/interface").Store) => any) | undefined;
|
|
38
|
+
rules: Rule[];
|
|
39
|
+
validateTrigger: any[];
|
|
40
|
+
label: import("react/jsx-runtime").JSX.Element | null;
|
|
41
|
+
getValueFromEvent: ((...args: import("rc-field-form/lib/interface").EventArgs) => any) | undefined;
|
|
42
|
+
getValueProps: ((value: any) => Record<string, unknown>) | undefined;
|
|
43
|
+
extra: false | "" | 0 | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
44
|
+
help: React.ReactNode;
|
|
45
|
+
valuePropName: string | undefined;
|
|
46
|
+
messageVariables: {
|
|
47
|
+
label: string;
|
|
48
|
+
};
|
|
49
|
+
dependencies: any[] | undefined;
|
|
50
|
+
};
|
|
51
|
+
elementProps: {
|
|
52
|
+
[key: string]: any;
|
|
53
|
+
};
|
|
54
|
+
display: any;
|
|
55
|
+
previewFormater: ((value: any, form?: FormInstance<any> | undefined) => any) | undefined;
|
|
56
|
+
};
|
|
57
|
+
export declare const calcDisabled: (disabled?: boolean | FormItemAssert | FormItemAssert[], form?: FormInstance, disabledCode?: string, name?: FormItemName, parentName?: FormItemName) => any;
|
|
58
|
+
export declare const calcCopyValue: (copyValue?: FormItemCopyValue, form?: FormInstance) => {
|
|
59
|
+
copied: boolean;
|
|
60
|
+
value?: undefined;
|
|
61
|
+
disabled?: undefined;
|
|
62
|
+
} | {
|
|
63
|
+
copied: boolean;
|
|
64
|
+
value: any;
|
|
65
|
+
disabled: boolean | undefined;
|
|
66
|
+
};
|
|
67
|
+
export declare const calcSelectValue: (selectValue?: FormItemSelectValue[], form?: FormInstance) => {
|
|
68
|
+
selected: boolean;
|
|
69
|
+
value?: undefined;
|
|
70
|
+
disabled?: undefined;
|
|
71
|
+
} | {
|
|
72
|
+
selected: boolean;
|
|
73
|
+
value: any;
|
|
74
|
+
disabled: boolean | undefined;
|
|
75
|
+
};
|
|
76
|
+
export declare const calcShouldRender: (name: NamePath, parentName: NamePath, dependencies?: NamePath[], asserts?: FormItemAssert[], shouldRender?: ((form?: FormInstance) => boolean) | undefined, shouldRenderCode?: string, form?: FormInstance) => any;
|
|
77
|
+
export declare const automaticCalculate: (name: NamePath, parentName: NamePath, automaticCalcCode?: string, form?: FormInstance) => void;
|
|
78
|
+
export declare const getRuleValidation: (url: string, rule: string | string[], values?: any, lang?: string) => Promise<any>;
|
|
79
|
+
export declare const calcAddableSectionAssertField: (name: any[], field: FormItemAssert['field'], index: number, elements: FormItemConfig[] | React.ReactElement[]) => any;
|
package/package.json
CHANGED
|
@@ -1,59 +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
|
-
<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>
|
package/.idea/iglooform.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/iglooform.iml" filepath="$PROJECT_DIR$/.idea/iglooform.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
package/.idea/prettier.xml
DELETED
package/.idea/vcs.xml
DELETED
|
File without changes
|
package/es/back-top/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
package/es/form/messages.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
declare const messages: {
|
|
2
|
-
default: string;
|
|
3
|
-
required: string;
|
|
4
|
-
enum: string;
|
|
5
|
-
whitespace: string;
|
|
6
|
-
date: {
|
|
7
|
-
format: string;
|
|
8
|
-
parse: string;
|
|
9
|
-
invalid: string;
|
|
10
|
-
};
|
|
11
|
-
types: {
|
|
12
|
-
string: string;
|
|
13
|
-
method: string;
|
|
14
|
-
array: string;
|
|
15
|
-
object: string;
|
|
16
|
-
number: string;
|
|
17
|
-
date: string;
|
|
18
|
-
boolean: string;
|
|
19
|
-
integer: string;
|
|
20
|
-
float: string;
|
|
21
|
-
regexp: string;
|
|
22
|
-
email: string;
|
|
23
|
-
url: string;
|
|
24
|
-
hex: string;
|
|
25
|
-
};
|
|
26
|
-
string: {
|
|
27
|
-
len: string;
|
|
28
|
-
min: string;
|
|
29
|
-
max: string;
|
|
30
|
-
range: string;
|
|
31
|
-
};
|
|
32
|
-
number: {
|
|
33
|
-
len: string;
|
|
34
|
-
min: string;
|
|
35
|
-
max: string;
|
|
36
|
-
range: string;
|
|
37
|
-
};
|
|
38
|
-
array: {
|
|
39
|
-
len: string;
|
|
40
|
-
min: string;
|
|
41
|
-
max: string;
|
|
42
|
-
range: string;
|
|
43
|
-
};
|
|
44
|
-
pattern: {
|
|
45
|
-
mismatch: string;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
export default messages;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
package/es/form/style/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
declare const messages: {
|
|
2
|
-
default: string;
|
|
3
|
-
required: string;
|
|
4
|
-
enum: string;
|
|
5
|
-
whitespace: string;
|
|
6
|
-
date: {
|
|
7
|
-
format: string;
|
|
8
|
-
parse: string;
|
|
9
|
-
invalid: string;
|
|
10
|
-
};
|
|
11
|
-
types: {
|
|
12
|
-
string: string;
|
|
13
|
-
method: string;
|
|
14
|
-
array: string;
|
|
15
|
-
object: string;
|
|
16
|
-
number: string;
|
|
17
|
-
date: string;
|
|
18
|
-
boolean: string;
|
|
19
|
-
integer: string;
|
|
20
|
-
float: string;
|
|
21
|
-
regexp: string;
|
|
22
|
-
email: string;
|
|
23
|
-
url: string;
|
|
24
|
-
hex: string;
|
|
25
|
-
};
|
|
26
|
-
string: {
|
|
27
|
-
len: string;
|
|
28
|
-
min: string;
|
|
29
|
-
max: string;
|
|
30
|
-
range: string;
|
|
31
|
-
};
|
|
32
|
-
number: {
|
|
33
|
-
len: string;
|
|
34
|
-
min: string;
|
|
35
|
-
max: string;
|
|
36
|
-
range: string;
|
|
37
|
-
};
|
|
38
|
-
array: {
|
|
39
|
-
len: string;
|
|
40
|
-
min: string;
|
|
41
|
-
max: string;
|
|
42
|
-
range: string;
|
|
43
|
-
};
|
|
44
|
-
pattern: {
|
|
45
|
-
mismatch: string;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
export default messages;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
package/es/locale/en-US.d.ts
DELETED