iglooform 3.7.6 → 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.
Files changed (76) 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 +1 -1
  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/es/checkbox/index.d.ts +24 -0
  49. package/es/form/index.d.ts +4 -0
  50. package/es/free-form/index.d.ts +11 -0
  51. package/es/login-page/style/index.less +5 -1
  52. package/es/upload-photo/index.js +13 -2
  53. package/es/utils/option-utils.d.ts +29 -0
  54. package/lib/checkbox/index.d.ts +24 -0
  55. package/lib/form/index.d.ts +4 -0
  56. package/lib/free-form/index.d.ts +11 -0
  57. package/lib/login-page/style/index.less +5 -1
  58. package/lib/upload-photo/index.js +13 -2
  59. package/lib/utils/option-utils.d.ts +29 -0
  60. package/package.json +1 -1
  61. package/.idea/codeStyles/Project.xml +0 -80
  62. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  63. package/.idea/iglooformv3.iml +0 -12
  64. package/.idea/modules.xml +0 -8
  65. package/.idea/prettier.xml +0 -6
  66. package/.idea/vcs.xml +0 -6
  67. package/es/form/element/index.d.ts +0 -12
  68. package/es/free-form/element/index.d.ts +0 -11
  69. package/es/types.d.ts +0 -189
  70. package/es/upload-preview/index.d.ts +0 -9
  71. package/es/utils/form-utils.d.ts +0 -79
  72. package/lib/form/element/index.d.ts +0 -12
  73. package/lib/free-form/element/index.d.ts +0 -11
  74. package/lib/types.d.ts +0 -189
  75. package/lib/upload-preview/index.d.ts +0 -9
  76. package/lib/utils/form-utils.d.ts +0 -79
@@ -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;
@@ -6,7 +6,11 @@
6
6
  background-image: url(./bg.svg);
7
7
  background-repeat: no-repeat;
8
8
  background-position-x: 100%;
9
- background-size: contain;
9
+ background-size: auto 100%;
10
+
11
+ @media (max-aspect-ratio: 95/100) {
12
+ background-position-x: calc((0.95 - 1151 / 1080) * 100vh);
13
+ }
10
14
 
11
15
  .igloo-login-page-logo {
12
16
  position: absolute;
@@ -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
- return setFiles(_files);
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,4 @@
1
+ import { Form as FormType } from '../types';
2
+ import './style';
3
+ declare const ExportedForm: FormType;
4
+ export default ExportedForm;
@@ -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;
@@ -6,7 +6,11 @@
6
6
  background-image: url(./bg.svg);
7
7
  background-repeat: no-repeat;
8
8
  background-position-x: 100%;
9
- background-size: contain;
9
+ background-size: auto 100%;
10
+
11
+ @media (max-aspect-ratio: 95/100) {
12
+ background-position-x: calc((0.95 - 1151 / 1080) * 100vh);
13
+ }
10
14
 
11
15
  .igloo-login-page-logo {
12
16
  position: absolute;
@@ -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
- return setFiles(_files);
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,6 +1,6 @@
1
1
  {
2
2
  "name": "iglooform",
3
- "version": "3.7.6",
3
+ "version": "3.7.8",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "build-dev": "dumi build",
@@ -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>
@@ -1,5 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <state>
3
- <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
- </state>
5
- </component>
@@ -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>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="PrettierConfiguration">
4
- <option name="myConfigurationMode" value="AUTOMATIC" />
5
- </component>
6
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>
@@ -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
- }
@@ -1,9 +0,0 @@
1
- import { FC } from 'react';
2
- import './style';
3
- interface Props {
4
- files: string[];
5
- label?: any;
6
- description?: any;
7
- }
8
- declare const UploadPreview: FC<Props>;
9
- export default UploadPreview;
@@ -1,79 +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, 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;