iglooform 3.7.8 → 3.8.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 (80) 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/form/element/index.d.ts +12 -0
  49. package/es/form/element/index.js +6 -3
  50. package/es/form/element/style/index.less +4 -0
  51. package/es/free-form/element/index.d.ts +11 -0
  52. package/es/free-form/element/index.js +6 -3
  53. package/es/free-form/element/style/index.less +7 -3
  54. package/es/media/index.js +62 -30
  55. package/es/media/preview.d.ts +1 -0
  56. package/es/media/preview.js +118 -35
  57. package/es/media/style/index.less +6 -11
  58. package/es/types.d.ts +190 -0
  59. package/es/upload-preview/index.d.ts +9 -0
  60. package/es/utils/form-utils.d.ts +79 -0
  61. package/lib/form/element/index.d.ts +12 -0
  62. package/lib/form/element/index.js +6 -3
  63. package/lib/form/element/style/index.less +4 -0
  64. package/lib/free-form/element/index.d.ts +11 -0
  65. package/lib/free-form/element/index.js +6 -3
  66. package/lib/free-form/element/style/index.less +7 -3
  67. package/lib/media/index.js +61 -29
  68. package/lib/media/preview.d.ts +1 -0
  69. package/lib/media/preview.js +117 -34
  70. package/lib/media/style/index.less +6 -11
  71. package/lib/types.d.ts +190 -0
  72. package/lib/upload-preview/index.d.ts +9 -0
  73. package/lib/utils/form-utils.d.ts +79 -0
  74. package/package.json +1 -1
  75. package/es/currency-context/index.d.ts +0 -8
  76. package/es/media/index.d.ts +0 -30
  77. package/es/media/media.d.ts +0 -14
  78. package/lib/currency-context/index.d.ts +0 -8
  79. package/lib/media/index.d.ts +0 -30
  80. package/lib/media/media.d.ts +0 -14
@@ -213,10 +213,30 @@ var PdfViewer = function PdfViewer(_ref) {
213
213
  })]
214
214
  });
215
215
  };
216
+ var getImageLayoutSize = function getImageLayoutSize(imageSize, containerSize, rotation) {
217
+ var imageWidth = imageSize.width,
218
+ imageHeight = imageSize.height;
219
+ var containerWidth = containerSize.width,
220
+ containerHeight = containerSize.height;
221
+ if (!imageWidth || !imageHeight || !containerWidth || !containerHeight) {
222
+ return undefined;
223
+ }
224
+ var isQuarterTurn = Math.abs(rotation % 180) === 90;
225
+ var ratio = isQuarterTurn ? Math.min(containerWidth / imageHeight, containerHeight / imageWidth) : Math.min(containerWidth / imageWidth, containerHeight / imageHeight);
226
+ if (!isFinite(ratio) || ratio <= 0) {
227
+ return undefined;
228
+ }
229
+ return {
230
+ width: imageWidth * ratio,
231
+ height: imageHeight * ratio
232
+ };
233
+ };
216
234
  var MediaItem = function MediaItem(_ref3) {
217
235
  var type = _ref3.type,
218
236
  src = _ref3.src,
219
237
  scale = _ref3.scale,
238
+ rotation = _ref3.rotation,
239
+ containerSize = _ref3.containerSize,
220
240
  offset = _ref3.offset,
221
241
  isCurrent = _ref3.isCurrent,
222
242
  showAllPages = _ref3.showAllPages;
@@ -224,6 +244,14 @@ var MediaItem = function MediaItem(_ref3) {
224
244
  left = offset.left;
225
245
  var _useContext2 = (0, _react.useContext)(_locale.LocaleContext),
226
246
  formatMessage = _useContext2.formatMessage;
247
+ var _useState7 = (0, _react.useState)({
248
+ width: 0,
249
+ height: 0
250
+ }),
251
+ _useState8 = _slicedToArray(_useState7, 2),
252
+ imageSize = _useState8[0],
253
+ setImageSize = _useState8[1];
254
+ var imageLayoutSize = getImageLayoutSize(imageSize, containerSize, rotation);
227
255
  switch (type) {
228
256
  case 'video':
229
257
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("video", {
@@ -244,14 +272,32 @@ var MediaItem = function MediaItem(_ref3) {
244
272
  showAllPages: showAllPages
245
273
  });
246
274
  case 'image':
247
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
248
- src: src,
275
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
249
276
  style: {
250
- maxWidth: '100%',
251
- maxHeight: '100%',
252
- transform: "scale(".concat(scale, ") translate(").concat(left, "px, ").concat(top, "px)"),
253
- position: 'absolute'
254
- }
277
+ position: 'absolute',
278
+ inset: 0,
279
+ display: 'flex',
280
+ justifyContent: 'center',
281
+ alignItems: 'center',
282
+ transform: "translate(".concat(left, "px, ").concat(top, "px)")
283
+ },
284
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
285
+ src: src,
286
+ onLoad: function onLoad(_ref4) {
287
+ var currentTarget = _ref4.currentTarget;
288
+ return setImageSize({
289
+ width: currentTarget.naturalWidth,
290
+ height: currentTarget.naturalHeight
291
+ });
292
+ },
293
+ style: _objectSpread(_objectSpread({}, imageLayoutSize ? imageLayoutSize : {
294
+ maxWidth: '100%',
295
+ maxHeight: '100%'
296
+ }), {}, {
297
+ display: 'block',
298
+ transform: "scale(".concat(scale, ") rotate(").concat(rotation, "deg)")
299
+ })
300
+ })
255
301
  });
256
302
  default:
257
303
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -268,42 +314,76 @@ var MediaItem = function MediaItem(_ref3) {
268
314
  });
269
315
  }
270
316
  };
271
- var Media = function Media(_ref4) {
272
- var src = _ref4.src,
273
- className = _ref4.className,
274
- style = _ref4.style,
275
- _ref4$scale = _ref4.scale,
276
- scale = _ref4$scale === void 0 ? 1 : _ref4$scale,
277
- type = _ref4.type,
278
- _ref4$isCurrent = _ref4.isCurrent,
279
- isCurrent = _ref4$isCurrent === void 0 ? false : _ref4$isCurrent,
280
- _ref4$showAllPages = _ref4.showAllPages,
281
- showAllPages = _ref4$showAllPages === void 0 ? true : _ref4$showAllPages;
282
- var _useState7 = (0, _react.useState)(false),
283
- _useState8 = _slicedToArray(_useState7, 2),
284
- isDrag = _useState8[0],
285
- setIsDrag = _useState8[1];
286
- var _useState9 = (0, _react.useState)({
287
- startX: 0,
288
- startY: 0
289
- }),
317
+ var Media = function Media(_ref5) {
318
+ var src = _ref5.src,
319
+ className = _ref5.className,
320
+ style = _ref5.style,
321
+ _ref5$scale = _ref5.scale,
322
+ scale = _ref5$scale === void 0 ? 1 : _ref5$scale,
323
+ _ref5$rotation = _ref5.rotation,
324
+ rotation = _ref5$rotation === void 0 ? 0 : _ref5$rotation,
325
+ type = _ref5.type,
326
+ _ref5$isCurrent = _ref5.isCurrent,
327
+ isCurrent = _ref5$isCurrent === void 0 ? false : _ref5$isCurrent,
328
+ _ref5$showAllPages = _ref5.showAllPages,
329
+ showAllPages = _ref5$showAllPages === void 0 ? true : _ref5$showAllPages;
330
+ var _useState9 = (0, _react.useState)(false),
290
331
  _useState10 = _slicedToArray(_useState9, 2),
291
- startPos = _useState10[0],
292
- setStartPos = _useState10[1];
332
+ isDrag = _useState10[0],
333
+ setIsDrag = _useState10[1];
293
334
  var _useState11 = (0, _react.useState)({
294
- top: 0,
295
- left: 0
335
+ startX: 0,
336
+ startY: 0
296
337
  }),
297
338
  _useState12 = _slicedToArray(_useState11, 2),
298
- offset = _useState12[0],
299
- setOffset = _useState12[1];
339
+ startPos = _useState12[0],
340
+ setStartPos = _useState12[1];
300
341
  var _useState13 = (0, _react.useState)({
301
342
  top: 0,
302
343
  left: 0
303
344
  }),
304
345
  _useState14 = _slicedToArray(_useState13, 2),
305
- lastOffset = _useState14[0],
306
- setLastOffset = _useState14[1];
346
+ offset = _useState14[0],
347
+ setOffset = _useState14[1];
348
+ var _useState15 = (0, _react.useState)({
349
+ top: 0,
350
+ left: 0
351
+ }),
352
+ _useState16 = _slicedToArray(_useState15, 2),
353
+ lastOffset = _useState16[0],
354
+ setLastOffset = _useState16[1];
355
+ var containerRef = (0, _react.useRef)(null);
356
+ var _useState17 = (0, _react.useState)({
357
+ width: 0,
358
+ height: 0
359
+ }),
360
+ _useState18 = _slicedToArray(_useState17, 2),
361
+ containerSize = _useState18[0],
362
+ setContainerSize = _useState18[1];
363
+ (0, _react.useEffect)(function () {
364
+ var current = containerRef.current;
365
+ if (!current) {
366
+ return;
367
+ }
368
+ var updateContainerSize = function updateContainerSize() {
369
+ setContainerSize({
370
+ width: current.clientWidth,
371
+ height: current.clientHeight
372
+ });
373
+ };
374
+ updateContainerSize();
375
+ if (typeof ResizeObserver === 'undefined') {
376
+ window.addEventListener('resize', updateContainerSize);
377
+ return function () {
378
+ return window.removeEventListener('resize', updateContainerSize);
379
+ };
380
+ }
381
+ var observer = new ResizeObserver(updateContainerSize);
382
+ observer.observe(current);
383
+ return function () {
384
+ return observer.disconnect();
385
+ };
386
+ }, []);
307
387
  var handleMouseUp = function handleMouseUp(e) {
308
388
  e.preventDefault();
309
389
  var button = e.button;
@@ -346,6 +426,7 @@ var Media = function Media(_ref4) {
346
426
  });
347
427
  };
348
428
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
429
+ ref: containerRef,
349
430
  style: {
350
431
  position: 'relative',
351
432
  width: '100%',
@@ -362,6 +443,8 @@ var Media = function Media(_ref4) {
362
443
  type: type,
363
444
  src: src,
364
445
  scale: scale,
446
+ rotation: rotation,
447
+ containerSize: containerSize,
365
448
  offset: offset,
366
449
  isCurrent: isCurrent,
367
450
  showAllPages: showAllPages
@@ -108,21 +108,16 @@
108
108
  margin-top: 16px;
109
109
  }
110
110
 
111
- .igloo-preview-zoom-in {
111
+ .igloo-preview-actions {
112
+ position: fixed;
112
113
  right: 24px;
113
- }
114
-
115
- .igloo-preview-zoom-out {
116
- right: 80px;
117
- }
118
-
119
- .igloo-preview-download-btn {
120
- right: 136px;
114
+ bottom: 24px;
115
+ display: flex;
116
+ flex-direction: row-reverse;
117
+ gap: 16px;
121
118
  }
122
119
 
123
120
  .igloo-preview-action-btn {
124
- position: fixed;
125
- bottom: 24px;
126
121
  display: flex;
127
122
  justify-content: center;
128
123
  align-items: center;
package/lib/types.d.ts ADDED
@@ -0,0 +1,190 @@
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
+ showExtraWhenPreview?: boolean;
99
+ requiredMessage?: string | ReactNode;
100
+ showOptional?: boolean;
101
+ previewFormater?(value: any, form?: FormInstance): any;
102
+ handleNext?(values: any): any;
103
+ render?(preview: boolean, form?: FormInstance, value?: any, onChange?: (params: any) => any, setShowStepButton?: IglooComponentProps['setShowStepButton']): any;
104
+ locales?: {
105
+ [key: string]: string;
106
+ };
107
+ options?: (CheckboxOptionType & {
108
+ extraInfo?: {
109
+ content: any;
110
+ shownTrigger: 'unchecked' | 'checked' | 'all';
111
+ };
112
+ })[] | SelectProps['options'];
113
+ sendOtp?: (value: any) => any;
114
+ dependField?: FormItemName;
115
+ countDownSeconds?: number;
116
+ getButtonDisabledState?: (form: FormInstance) => boolean;
117
+ getPreviousDisabledState?: (form: FormInstance) => boolean;
118
+ handleUpload?(file: File): PromiseLike<string>;
119
+ withoutForm?: boolean;
120
+ disableEditButton?: boolean;
121
+ hidePreviewDivider?: boolean;
122
+ valueFormater?: (value: any) => any;
123
+ currentStep?: number;
124
+ subscribedFields?: FormItemName[];
125
+ description?: string | React.ReactNode;
126
+ dateLimitationType?: 'relative' | 'absolute';
127
+ absoluteRangeStart?: number;
128
+ absoluteRangeEnd?: number;
129
+ relativeRangeStart?: {
130
+ type: 'day' | 'month' | 'year';
131
+ quantity: number;
132
+ pattern?: string;
133
+ dependField?: NamePath;
134
+ };
135
+ relativeRangeEnd?: {
136
+ type: 'day' | 'month' | 'year';
137
+ quantity: number;
138
+ pattern?: string;
139
+ dependField?: NamePath;
140
+ };
141
+ validationCode?: {
142
+ code: string;
143
+ errorMessage: string;
144
+ warningOnly?: boolean;
145
+ }[];
146
+ length?: number;
147
+ minLength?: number;
148
+ maxLength?: number;
149
+ idType?: 'KTP' | 'NIK';
150
+ validationRule?: string;
151
+ shouldRenderCode?: string;
152
+ disabledCode?: string;
153
+ automaticCalcCode?: string;
154
+ enableAutomaticCalc?: boolean;
155
+ [key: string]: any;
156
+ }
157
+ export interface FormItemConfig extends FormItemExtraConfig {
158
+ type?: string;
159
+ name?: NamePath;
160
+ label?: string | React.ReactNode;
161
+ previewLabel?: string | React.ReactNode;
162
+ labelProps?: any;
163
+ contentProps?: any;
164
+ ocr?: {
165
+ vender: string;
166
+ outputMap: {
167
+ field: string[];
168
+ source: string[];
169
+ }[];
170
+ };
171
+ }
172
+ export type FormItemPropsHandler = (config: FormItemConfig) => FormItemConfig;
173
+ export interface FC<P = {}> extends React.FunctionComponent<P> {
174
+ formItemPropsHandler?: FormItemPropsHandler;
175
+ isPreviewSupport?: boolean;
176
+ }
177
+ export interface Form extends React.ForwardRefExoticComponent<FormBasicConfig & React.RefAttributes<any>> {
178
+ useForm: () => FormInstance;
179
+ }
180
+ export interface IglooComponentProps {
181
+ validateField?: (nameList?: NamePath[]) => Promise<any>;
182
+ containerRef?: React.RefObject<any>;
183
+ setFieldError?(errorMsg?: string): void;
184
+ setFieldValue?(value?: any): void;
185
+ setShowStepButton?: (showButton: boolean) => void;
186
+ getFormInstance?: () => FormInstance;
187
+ locales?: {
188
+ [key: string]: string;
189
+ };
190
+ }
@@ -0,0 +1,9 @@
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;
@@ -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.7.8",
3
+ "version": "3.8.0",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "build-dev": "dumi build",
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- export 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;
@@ -1,30 +0,0 @@
1
- import { FC, CSSProperties } from 'react';
2
- import './style';
3
- type Download = false | {
4
- actionType?: 'downloadBlob' | 'openUrl';
5
- };
6
- type GetNonCORSUrl = (originUrl: string) => Promise<string> | string;
7
- interface Props {
8
- src: string | {
9
- origin: string;
10
- nonCORS: string;
11
- };
12
- name?: string;
13
- type?: string;
14
- index?: number;
15
- list?: Array<{
16
- type: string;
17
- src: string;
18
- nonCORSSrc?: string;
19
- }>;
20
- docNames?: string[];
21
- className?: any;
22
- style?: CSSProperties;
23
- showAllPages?: boolean;
24
- destroyOnClose?: boolean;
25
- download?: Download;
26
- getNonCORSUrl?: GetNonCORSUrl;
27
- loading?: boolean;
28
- }
29
- declare const MediaWithPreview: FC<Props>;
30
- export default MediaWithPreview;
@@ -1,14 +0,0 @@
1
- import { FC, CSSProperties } from 'react';
2
- declare const Loading: () => import("react/jsx-runtime").JSX.Element;
3
- interface MediaProps {
4
- src: string;
5
- type: string;
6
- onClick: any;
7
- className?: any;
8
- style?: CSSProperties;
9
- name?: string;
10
- }
11
- declare const Media: FC<MediaProps> & {
12
- Loading: typeof Loading;
13
- };
14
- export default Media;
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- export 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;
@@ -1,30 +0,0 @@
1
- import { FC, CSSProperties } from 'react';
2
- import './style';
3
- type Download = false | {
4
- actionType?: 'downloadBlob' | 'openUrl';
5
- };
6
- type GetNonCORSUrl = (originUrl: string) => Promise<string> | string;
7
- interface Props {
8
- src: string | {
9
- origin: string;
10
- nonCORS: string;
11
- };
12
- name?: string;
13
- type?: string;
14
- index?: number;
15
- list?: Array<{
16
- type: string;
17
- src: string;
18
- nonCORSSrc?: string;
19
- }>;
20
- docNames?: string[];
21
- className?: any;
22
- style?: CSSProperties;
23
- showAllPages?: boolean;
24
- destroyOnClose?: boolean;
25
- download?: Download;
26
- getNonCORSUrl?: GetNonCORSUrl;
27
- loading?: boolean;
28
- }
29
- declare const MediaWithPreview: FC<Props>;
30
- export default MediaWithPreview;
@@ -1,14 +0,0 @@
1
- import { FC, CSSProperties } from 'react';
2
- declare const Loading: () => import("react/jsx-runtime").JSX.Element;
3
- interface MediaProps {
4
- src: string;
5
- type: string;
6
- onClick: any;
7
- className?: any;
8
- style?: CSSProperties;
9
- name?: string;
10
- }
11
- declare const Media: FC<MediaProps> & {
12
- Loading: typeof Loading;
13
- };
14
- export default Media;