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.
Files changed (253) 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/es/documents/index.js +27 -3
  49. package/es/form/hsteps/index.d.ts +21 -0
  50. package/es/form/step-items-selection/components/section-of-item-condition/hooks/useAdaptAssertConfig.d.ts +4 -0
  51. package/es/index.d.ts +49 -0
  52. package/es/media/index.d.ts +1 -0
  53. package/es/media/index.js +67 -36
  54. package/es/media/media.d.ts +4 -1
  55. package/es/media/media.js +75 -28
  56. package/es/types.d.ts +189 -0
  57. package/es/utils/form-utils.d.ts +79 -0
  58. package/lib/documents/index.js +27 -3
  59. package/lib/form/hsteps/index.d.ts +21 -0
  60. package/lib/form/step-items-selection/components/section-of-item-condition/hooks/useAdaptAssertConfig.d.ts +4 -0
  61. package/lib/index.d.ts +49 -0
  62. package/lib/media/index.d.ts +1 -0
  63. package/lib/media/index.js +66 -36
  64. package/lib/media/media.d.ts +4 -1
  65. package/lib/media/media.js +74 -28
  66. package/lib/types.d.ts +189 -0
  67. package/lib/utils/form-utils.d.ts +79 -0
  68. package/package.json +1 -1
  69. package/.idea/codeStyles/Project.xml +0 -59
  70. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  71. package/.idea/iglooform.iml +0 -12
  72. package/.idea/modules.xml +0 -8
  73. package/.idea/prettier.xml +0 -6
  74. package/.idea/vcs.xml +0 -6
  75. package/es/admin-amount/style/index.d.ts +0 -0
  76. package/es/babel-plugin-import-option.d.ts +0 -7
  77. package/es/back-top/index.d.ts +0 -5
  78. package/es/claim-list/style/index.d.ts +0 -1
  79. package/es/confirmation/style/index.d.ts +0 -1
  80. package/es/currency-context/index.d.ts +0 -8
  81. package/es/currency-context/style/index.d.ts +0 -0
  82. package/es/date-picker/style/index.d.ts +0 -1
  83. package/es/declaration/style/index.d.ts +0 -1
  84. package/es/detail-panel/style/index.d.ts +0 -1
  85. package/es/documents/style/index.d.ts +0 -1
  86. package/es/filter/style/index.d.ts +0 -1
  87. package/es/form/addable-section/style/index.d.ts +0 -1
  88. package/es/form/divider/style/index.d.ts +0 -1
  89. package/es/form/element/style/index.d.ts +0 -1
  90. package/es/form/hstep/style/index.d.ts +0 -1
  91. package/es/form/hsteps/style/index.d.ts +0 -1
  92. package/es/form/login/style/index.d.ts +0 -1
  93. package/es/form/messages.d.ts +0 -48
  94. package/es/form/page/style/index.d.ts +0 -1
  95. package/es/form/pages/style/index.d.ts +0 -1
  96. package/es/form/render/style/index.d.ts +0 -1
  97. package/es/form/section/style/index.d.ts +0 -1
  98. package/es/form/step/style/index.d.ts +0 -1
  99. package/es/form/steps/style/index.d.ts +0 -1
  100. package/es/form/style/index.d.ts +0 -1
  101. package/es/free-form/addable-section/style/index.d.ts +0 -1
  102. package/es/free-form/element/style/index.d.ts +0 -1
  103. package/es/free-form/messages.d.ts +0 -48
  104. package/es/free-form/page/style/index.d.ts +0 -1
  105. package/es/free-form/pages/style/index.d.ts +0 -1
  106. package/es/free-form/section/style/index.d.ts +0 -1
  107. package/es/free-form/step/style/index.d.ts +0 -1
  108. package/es/free-form/steps/style/index.d.ts +0 -1
  109. package/es/free-form/style/index.d.ts +0 -1
  110. package/es/home-menu/style/index.d.ts +0 -1
  111. package/es/input/style/amount/index.d.ts +0 -2
  112. package/es/input/style/index.d.ts +0 -2
  113. package/es/input/style/input-date/index.d.ts +0 -2
  114. package/es/input/style/otp/index.d.ts +0 -2
  115. package/es/input/style/phone-number/index.d.ts +0 -2
  116. package/es/input/style/text-area/index.d.ts +0 -2
  117. package/es/layout/defaultHeader.d.ts +0 -4
  118. package/es/layout/style/index.d.ts +0 -1
  119. package/es/locale/en-US.d.ts +0 -2
  120. package/es/locale/format-message.d.ts +0 -10
  121. package/es/locale/formatted-message.d.ts +0 -6
  122. package/es/locale/id-ID.d.ts +0 -2
  123. package/es/locale/index.d.ts +0 -4
  124. package/es/locale/locale-context.d.ts +0 -12
  125. package/es/locale/ms-MY.d.ts +0 -2
  126. package/es/locale/th-TH.d.ts +0 -2
  127. package/es/locale/vi-VN.d.ts +0 -2
  128. package/es/locale/zh-CN.d.ts +0 -2
  129. package/es/locale/zh-TW.d.ts +0 -2
  130. package/es/login-page/index.d.ts +0 -7
  131. package/es/login-page/style/index.d.ts +0 -1
  132. package/es/media/style/index.d.ts +0 -1
  133. package/es/message/style/index.d.ts +0 -1
  134. package/es/mobile-insurer-detail/style/index.d.ts +0 -1
  135. package/es/mobile-insurer-list/style/index.d.ts +0 -1
  136. package/es/modal/style/index.d.ts +0 -1
  137. package/es/ocr/micro-blink/style/index.d.ts +0 -1
  138. package/es/platform/index.d.ts +0 -2
  139. package/es/platform/platform-card/index.d.ts +0 -12
  140. package/es/platform/platform-card/style/index.d.ts +0 -1
  141. package/es/platform/switch-platform/index.d.ts +0 -12
  142. package/es/platform/switch-platform/style/index.d.ts +0 -1
  143. package/es/policy-list/style/index.d.ts +0 -1
  144. package/es/radio/style/index.d.ts +0 -1
  145. package/es/search-box/style/index.d.ts +0 -1
  146. package/es/select/style/index.d.ts +0 -1
  147. package/es/status-box/style/index.d.ts +0 -1
  148. package/es/table/style/index.d.ts +0 -1
  149. package/es/tabs/index.d.ts +0 -15
  150. package/es/tabs/style/index.d.ts +0 -1
  151. package/es/typography/style/index.d.ts +0 -1
  152. package/es/upload/style/index.d.ts +0 -1
  153. package/es/upload-photo/media.d.ts +0 -7
  154. package/es/upload-photo/style/index.d.ts +0 -1
  155. package/es/upload-preview/style/index.d.ts +0 -1
  156. package/es/utils/agent-detect.d.ts +0 -1
  157. package/es/utils/useAsyncEffect.d.ts +0 -3
  158. package/lib/admin-amount/style/index.d.ts +0 -0
  159. package/lib/admin-upload/style/index.d.ts +0 -1
  160. package/lib/alert-message/style/index.d.ts +0 -1
  161. package/lib/babel-plugin-import-option.d.ts +0 -7
  162. package/lib/back-top/index.d.ts +0 -5
  163. package/lib/back-top/style/index.d.ts +0 -1
  164. package/lib/button/style/index.d.ts +0 -1
  165. package/lib/card-detail/style/index.d.ts +0 -1
  166. package/lib/checkbox/style/index.d.ts +0 -1
  167. package/lib/claim-list/style/index.d.ts +0 -1
  168. package/lib/confirmation/style/index.d.ts +0 -1
  169. package/lib/currency-context/index.d.ts +0 -8
  170. package/lib/currency-context/style/index.d.ts +0 -0
  171. package/lib/date-picker/style/index.d.ts +0 -1
  172. package/lib/declaration/style/index.d.ts +0 -1
  173. package/lib/detail-panel/style/index.d.ts +0 -1
  174. package/lib/documents/style/index.d.ts +0 -1
  175. package/lib/filter/style/index.d.ts +0 -1
  176. package/lib/form/addable-section/style/index.d.ts +0 -1
  177. package/lib/form/divider/style/index.d.ts +0 -1
  178. package/lib/form/element/style/index.d.ts +0 -1
  179. package/lib/form/hstep/style/index.d.ts +0 -1
  180. package/lib/form/hsteps/style/index.d.ts +0 -1
  181. package/lib/form/login/style/index.d.ts +0 -1
  182. package/lib/form/messages.d.ts +0 -48
  183. package/lib/form/page/style/index.d.ts +0 -1
  184. package/lib/form/pages/style/index.d.ts +0 -1
  185. package/lib/form/render/style/index.d.ts +0 -1
  186. package/lib/form/section/style/index.d.ts +0 -1
  187. package/lib/form/step/style/index.d.ts +0 -1
  188. package/lib/form/steps/style/index.d.ts +0 -1
  189. package/lib/form/style/index.d.ts +0 -1
  190. package/lib/free-form/addable-section/style/index.d.ts +0 -1
  191. package/lib/free-form/element/style/index.d.ts +0 -1
  192. package/lib/free-form/messages.d.ts +0 -48
  193. package/lib/free-form/page/style/index.d.ts +0 -1
  194. package/lib/free-form/pages/style/index.d.ts +0 -1
  195. package/lib/free-form/section/style/index.d.ts +0 -1
  196. package/lib/free-form/step/style/index.d.ts +0 -1
  197. package/lib/free-form/steps/style/index.d.ts +0 -1
  198. package/lib/free-form/style/index.d.ts +0 -1
  199. package/lib/home-menu/style/index.d.ts +0 -1
  200. package/lib/input/style/amount/index.d.ts +0 -2
  201. package/lib/input/style/index.d.ts +0 -2
  202. package/lib/input/style/input-date/index.d.ts +0 -2
  203. package/lib/input/style/otp/index.d.ts +0 -2
  204. package/lib/input/style/phone-number/index.d.ts +0 -2
  205. package/lib/input/style/text-area/index.d.ts +0 -2
  206. package/lib/layout/defaultHeader.d.ts +0 -4
  207. package/lib/layout/style/index.d.ts +0 -1
  208. package/lib/locale/en-US.d.ts +0 -2
  209. package/lib/locale/format-message.d.ts +0 -10
  210. package/lib/locale/formatted-message.d.ts +0 -6
  211. package/lib/locale/id-ID.d.ts +0 -2
  212. package/lib/locale/index.d.ts +0 -4
  213. package/lib/locale/locale-context.d.ts +0 -12
  214. package/lib/locale/ms-MY.d.ts +0 -2
  215. package/lib/locale/th-TH.d.ts +0 -2
  216. package/lib/locale/vi-VN.d.ts +0 -2
  217. package/lib/locale/zh-CN.d.ts +0 -2
  218. package/lib/locale/zh-TW.d.ts +0 -2
  219. package/lib/login-page/index.d.ts +0 -7
  220. package/lib/login-page/style/index.d.ts +0 -1
  221. package/lib/media/style/index.d.ts +0 -1
  222. package/lib/message/style/index.d.ts +0 -1
  223. package/lib/mobile-insurer-detail/style/index.d.ts +0 -1
  224. package/lib/mobile-insurer-list/style/index.d.ts +0 -1
  225. package/lib/modal/style/index.d.ts +0 -1
  226. package/lib/ocr/micro-blink/style/index.d.ts +0 -1
  227. package/lib/platform/index.d.ts +0 -2
  228. package/lib/platform/platform-card/index.d.ts +0 -12
  229. package/lib/platform/platform-card/style/index.d.ts +0 -1
  230. package/lib/platform/switch-platform/index.d.ts +0 -12
  231. package/lib/platform/switch-platform/style/index.d.ts +0 -1
  232. package/lib/policy-list/style/index.d.ts +0 -1
  233. package/lib/radio/style/index.d.ts +0 -1
  234. package/lib/search-box/style/index.d.ts +0 -1
  235. package/lib/select/style/index.d.ts +0 -1
  236. package/lib/status-box/style/index.d.ts +0 -1
  237. package/lib/table/style/index.d.ts +0 -1
  238. package/lib/tabs/index.d.ts +0 -15
  239. package/lib/tabs/style/index.d.ts +0 -1
  240. package/lib/typography/style/index.d.ts +0 -1
  241. package/lib/upload/style/index.d.ts +0 -1
  242. package/lib/upload-photo/media.d.ts +0 -7
  243. package/lib/upload-photo/style/index.d.ts +0 -1
  244. package/lib/upload-preview/style/index.d.ts +0 -1
  245. package/lib/utils/agent-detect.d.ts +0 -1
  246. package/lib/utils/useAsyncEffect.d.ts +0 -3
  247. package/yarn-error.log +0 -16168
  248. /package/es/{admin-upload → form/step-items-selection/components/checkbox-group-items}/style/index.d.ts +0 -0
  249. /package/es/{alert-message → form/step-items-selection/components/item-info}/style/index.d.ts +0 -0
  250. /package/es/{back-top → form/step-items-selection/components/section-of-item-condition}/style/index.d.ts +0 -0
  251. /package/{es/button → lib/form/step-items-selection/components/checkbox-group-items}/style/index.d.ts +0 -0
  252. /package/{es/card-detail → lib/form/step-items-selection/components/item-info}/style/index.d.ts +0 -0
  253. /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,6 +1,6 @@
1
1
  {
2
2
  "name": "iglooform",
3
- "version": "3.3.8",
3
+ "version": "3.4.0",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "build-dev": "dumi build",
@@ -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>
@@ -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/iglooform.iml" filepath="$PROJECT_DIR$/.idea/iglooform.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="MANUAL" />
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>
File without changes
@@ -1,7 +0,0 @@
1
- declare const _default: {
2
- libraryName: string;
3
- libraryDirectory: string;
4
- style: boolean;
5
- customName: (name: string) => string;
6
- };
7
- export default _default;
@@ -1,5 +0,0 @@
1
- import { FC } from 'react';
2
- import './style';
3
- import { BackTopProps } from 'antd';
4
- declare const BackToTop: FC<BackTopProps>;
5
- export default BackToTop;
@@ -1 +0,0 @@
1
- import './index.less';
@@ -1 +0,0 @@
1
- import './index.less';
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- interface CurrencyMethod {
3
- exchange: (value: any) => any;
4
- exchangeBack: (value: any) => any;
5
- currentCurrency: string;
6
- }
7
- declare const _default: import("react").Context<CurrencyMethod>;
8
- export default _default;
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';
@@ -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';
@@ -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,2 +0,0 @@
1
- import '../index';
2
- import './index.less';
@@ -1,2 +0,0 @@
1
- import './default-input.less';
2
- import './common.less';
@@ -1,2 +0,0 @@
1
- import '../index';
2
- import './index.less';
@@ -1,2 +0,0 @@
1
- import '../index';
2
- import './index.less';
@@ -1,2 +0,0 @@
1
- import '../index';
2
- import './index.less';
@@ -1,2 +0,0 @@
1
- import '../index';
2
- import './index.less';
@@ -1,4 +0,0 @@
1
- import { FC } from 'react';
2
- import './style';
3
- declare const DefaultHeader: FC<any>;
4
- export default DefaultHeader;
@@ -1 +0,0 @@
1
- import './index.less';
@@ -1,2 +0,0 @@
1
- declare const messages: any;
2
- export default messages;