extended-dynamic-forms 0.3.10 → 0.3.11
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/dist/WizardForm.d.ts +2 -1
- package/dist/events/FormEventContext.d.ts +4 -0
- package/dist/index.es.js +26537 -22547
- package/dist/index.umd.js +1614 -1593
- package/dist/types/index.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/templateEngine.d.ts +24 -0
- package/dist/widgets/base/types.d.ts +114 -39
- package/dist/widgets/base/utils.d.ts +44 -1
- package/dist/widgets/choice/ChoiceWidget.types.d.ts +32 -1
- package/dist/widgets/choice/hooks/useFormDataSource.d.ts +9 -0
- package/dist/widgets/choice/providers/ApiDataSource.d.ts +3 -0
- package/dist/widgets/choice/utils/responseMapper.d.ts +4 -0
- package/dist/widgets/display/DividerWidget.d.ts +6 -0
- package/dist/widgets/display/HtmlWidget.d.ts +6 -0
- package/dist/widgets/display/SpacerWidget.d.ts +6 -0
- package/dist/widgets/display/TitleWidget.d.ts +6 -0
- package/dist/widgets/display/index.d.ts +4 -0
- package/dist/widgets/index.d.ts +15 -1
- package/package.json +3 -2
package/dist/types/index.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export interface ExtendedFormProps extends Omit<FormProps, 'validator'>, FormEve
|
|
|
39
39
|
onWebhookStart?: (webhook: WebhookConfig, event: any) => void;
|
|
40
40
|
onWebhookComplete?: (webhook: WebhookConfig, event: any, response: any) => void;
|
|
41
41
|
onWebhookError?: (webhook: WebhookConfig, event: any, error: Error) => void;
|
|
42
|
+
enableDynamicBinding?: boolean;
|
|
42
43
|
}
|
|
43
44
|
export interface CustomWidgetProps {
|
|
44
45
|
label?: string;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { formDataUtils } from './formDataUtils';
|
|
|
2
2
|
export { schemaUtils } from './schemaUtils';
|
|
3
3
|
export { validationUtils } from './validationUtils';
|
|
4
4
|
export * from './pathHelpers';
|
|
5
|
+
export * from './templateEngine';
|
|
5
6
|
export declare function deepEquals(obj1: any, obj2: any): boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface TemplateError {
|
|
2
|
+
path: string;
|
|
3
|
+
template: string;
|
|
4
|
+
error: string;
|
|
5
|
+
availableBindings: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface ApplyTemplateBindingsOptions {
|
|
8
|
+
escape?: boolean;
|
|
9
|
+
isDev?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ApplyTemplateBindingsResult<T> {
|
|
12
|
+
result: T;
|
|
13
|
+
errors: TemplateError[];
|
|
14
|
+
}
|
|
15
|
+
interface TemplateStats {
|
|
16
|
+
cacheHits: number;
|
|
17
|
+
compiled: number;
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
var __EDF_TEMPLATE_STATS__: TemplateStats | undefined;
|
|
21
|
+
}
|
|
22
|
+
export declare function applyTemplateBindings<T>(value: T, bindings: Record<string, unknown>, options?: ApplyTemplateBindingsOptions): ApplyTemplateBindingsResult<T>;
|
|
23
|
+
export declare function clearTemplateCache(): void;
|
|
24
|
+
export {};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
1
2
|
import { WidgetProps } from '@rjsf/utils';
|
|
3
|
+
import { TitleProps } from 'antd/es/typography/Title';
|
|
4
|
+
import { TextProps } from 'antd/es/typography/Text';
|
|
5
|
+
import { ParagraphProps } from 'antd/es/typography/Paragraph';
|
|
6
|
+
import { DividerProps } from 'antd/es/divider';
|
|
2
7
|
|
|
8
|
+
type MarkdownToJSXOptions = import('markdown-to-jsx').MarkdownToJSX.Options;
|
|
3
9
|
/**
|
|
4
10
|
* Base interface for all enhanced widgets
|
|
5
11
|
*/
|
|
@@ -13,8 +19,8 @@ export interface AntInputOptions {
|
|
|
13
19
|
placeholder?: string;
|
|
14
20
|
autoFocus?: boolean;
|
|
15
21
|
autoComplete?: string;
|
|
16
|
-
prefix?:
|
|
17
|
-
suffix?:
|
|
22
|
+
prefix?: ReactNode;
|
|
23
|
+
suffix?: ReactNode;
|
|
18
24
|
prefixIconName?: string;
|
|
19
25
|
suffixIconName?: string;
|
|
20
26
|
allowClear?: boolean;
|
|
@@ -27,13 +33,13 @@ export interface AntInputOptions {
|
|
|
27
33
|
value: string;
|
|
28
34
|
count: number;
|
|
29
35
|
maxLength?: number;
|
|
30
|
-
}) =>
|
|
36
|
+
}) => ReactNode;
|
|
31
37
|
};
|
|
32
38
|
status?: 'error' | 'warning';
|
|
33
|
-
style?:
|
|
39
|
+
style?: CSSProperties;
|
|
34
40
|
className?: string;
|
|
35
|
-
addonBefore?:
|
|
36
|
-
addonAfter?:
|
|
41
|
+
addonBefore?: ReactNode;
|
|
42
|
+
addonAfter?: ReactNode;
|
|
37
43
|
addonBeforeIconName?: string;
|
|
38
44
|
addonAfterIconName?: string;
|
|
39
45
|
emptyValue?: any;
|
|
@@ -52,7 +58,7 @@ export interface AntTextAreaOptions extends AntInputOptions {
|
|
|
52
58
|
value: string;
|
|
53
59
|
count: number;
|
|
54
60
|
maxLength?: number;
|
|
55
|
-
}) =>
|
|
61
|
+
}) => ReactNode;
|
|
56
62
|
};
|
|
57
63
|
}
|
|
58
64
|
/**
|
|
@@ -74,9 +80,9 @@ export interface AntDatePickerOptions {
|
|
|
74
80
|
size?: 'large' | 'middle' | 'small';
|
|
75
81
|
bordered?: boolean;
|
|
76
82
|
variant?: 'outlined' | 'borderless' | 'filled';
|
|
77
|
-
suffixIcon?:
|
|
83
|
+
suffixIcon?: ReactNode;
|
|
78
84
|
suffixIconName?: string;
|
|
79
|
-
style?:
|
|
85
|
+
style?: CSSProperties;
|
|
80
86
|
className?: string;
|
|
81
87
|
status?: 'error' | 'warning';
|
|
82
88
|
emptyValue?: any;
|
|
@@ -88,7 +94,7 @@ export interface AntDatePickerOptions {
|
|
|
88
94
|
export interface AntInputNumberOptions {
|
|
89
95
|
size?: 'large' | 'middle' | 'small';
|
|
90
96
|
placeholder?: string;
|
|
91
|
-
prefix?:
|
|
97
|
+
prefix?: ReactNode;
|
|
92
98
|
prefixIconName?: string;
|
|
93
99
|
addonBeforeIconName?: string;
|
|
94
100
|
addonAfterIconName?: string;
|
|
@@ -104,16 +110,16 @@ export interface AntInputNumberOptions {
|
|
|
104
110
|
parser?: (value: string | undefined) => number;
|
|
105
111
|
keyboard?: boolean;
|
|
106
112
|
controls?: boolean | {
|
|
107
|
-
upIcon?:
|
|
108
|
-
downIcon?:
|
|
113
|
+
upIcon?: ReactNode;
|
|
114
|
+
downIcon?: ReactNode;
|
|
109
115
|
};
|
|
110
116
|
bordered?: boolean;
|
|
111
117
|
variant?: 'outlined' | 'borderless' | 'filled';
|
|
112
|
-
style?:
|
|
118
|
+
style?: CSSProperties;
|
|
113
119
|
className?: string;
|
|
114
120
|
status?: 'error' | 'warning';
|
|
115
|
-
addonBefore?:
|
|
116
|
-
addonAfter?:
|
|
121
|
+
addonBefore?: ReactNode;
|
|
122
|
+
addonAfter?: ReactNode;
|
|
117
123
|
emptyValue?: any;
|
|
118
124
|
}
|
|
119
125
|
/**
|
|
@@ -127,15 +133,15 @@ export interface AntSliderOptions {
|
|
|
127
133
|
draggableTrack?: boolean;
|
|
128
134
|
};
|
|
129
135
|
dots?: boolean;
|
|
130
|
-
marks?: Record<number,
|
|
136
|
+
marks?: Record<number, ReactNode> | boolean;
|
|
131
137
|
included?: boolean;
|
|
132
138
|
vertical?: boolean;
|
|
133
139
|
reverse?: boolean;
|
|
134
140
|
tooltip?: any;
|
|
135
|
-
trackStyle?:
|
|
136
|
-
handleStyle?:
|
|
137
|
-
railStyle?:
|
|
138
|
-
style?:
|
|
141
|
+
trackStyle?: CSSProperties | CSSProperties[];
|
|
142
|
+
handleStyle?: CSSProperties | CSSProperties[];
|
|
143
|
+
railStyle?: CSSProperties;
|
|
144
|
+
style?: CSSProperties;
|
|
139
145
|
className?: string;
|
|
140
146
|
keyboard?: boolean;
|
|
141
147
|
disabled?: boolean;
|
|
@@ -147,13 +153,13 @@ export interface AntRateOptions {
|
|
|
147
153
|
allowHalf?: boolean;
|
|
148
154
|
allowClear?: boolean;
|
|
149
155
|
autoFocus?: boolean;
|
|
150
|
-
character?:
|
|
156
|
+
character?: ReactNode | ((props: {
|
|
151
157
|
index: number;
|
|
152
|
-
}) =>
|
|
158
|
+
}) => ReactNode);
|
|
153
159
|
count?: number;
|
|
154
160
|
tooltips?: string[];
|
|
155
161
|
iconName?: string;
|
|
156
|
-
style?:
|
|
162
|
+
style?: CSSProperties;
|
|
157
163
|
className?: string;
|
|
158
164
|
}
|
|
159
165
|
/**
|
|
@@ -172,7 +178,7 @@ export interface AntTimePickerOptions {
|
|
|
172
178
|
variant?: 'outlined' | 'borderless' | 'filled';
|
|
173
179
|
status?: 'error' | 'warning';
|
|
174
180
|
suffixIconName?: string;
|
|
175
|
-
style?:
|
|
181
|
+
style?: CSSProperties;
|
|
176
182
|
className?: string;
|
|
177
183
|
[key: string]: any;
|
|
178
184
|
}
|
|
@@ -184,11 +190,11 @@ export interface AntColorPickerOptions {
|
|
|
184
190
|
onFormatChange?: (format: string) => void;
|
|
185
191
|
disabledAlpha?: boolean;
|
|
186
192
|
presets?: any[];
|
|
187
|
-
showText?: boolean | ((color: any) =>
|
|
193
|
+
showText?: boolean | ((color: any) => ReactNode);
|
|
188
194
|
placement?: 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight';
|
|
189
195
|
size?: 'large' | 'middle' | 'small';
|
|
190
196
|
allowClear?: boolean;
|
|
191
|
-
style?:
|
|
197
|
+
style?: CSSProperties;
|
|
192
198
|
className?: string;
|
|
193
199
|
[key: string]: any;
|
|
194
200
|
}
|
|
@@ -196,14 +202,14 @@ export interface AntColorPickerOptions {
|
|
|
196
202
|
* Ant Design Switch component options
|
|
197
203
|
*/
|
|
198
204
|
export interface AntSwitchOptions {
|
|
199
|
-
checkedChildren?:
|
|
200
|
-
unCheckedChildren?:
|
|
205
|
+
checkedChildren?: ReactNode;
|
|
206
|
+
unCheckedChildren?: ReactNode;
|
|
201
207
|
checkedIconName?: string;
|
|
202
208
|
unCheckedIconName?: string;
|
|
203
209
|
size?: 'small' | 'default';
|
|
204
210
|
loading?: boolean;
|
|
205
211
|
autoFocus?: boolean;
|
|
206
|
-
style?:
|
|
212
|
+
style?: CSSProperties;
|
|
207
213
|
className?: string;
|
|
208
214
|
[key: string]: any;
|
|
209
215
|
}
|
|
@@ -220,7 +226,7 @@ export interface AntImageOptions {
|
|
|
220
226
|
visible?: boolean;
|
|
221
227
|
onVisibleChange?: (visible: boolean) => void;
|
|
222
228
|
};
|
|
223
|
-
placeholder?:
|
|
229
|
+
placeholder?: ReactNode;
|
|
224
230
|
crossOrigin?: '' | 'anonymous' | 'use-credentials';
|
|
225
231
|
decoding?: 'async' | 'auto' | 'sync';
|
|
226
232
|
loading?: 'eager' | 'lazy';
|
|
@@ -228,14 +234,14 @@ export interface AntImageOptions {
|
|
|
228
234
|
sizes?: string;
|
|
229
235
|
srcSet?: string;
|
|
230
236
|
draggable?: boolean;
|
|
231
|
-
previewMask?:
|
|
237
|
+
previewMask?: ReactNode;
|
|
232
238
|
rootClassName?: string;
|
|
233
239
|
wrapperClassName?: string;
|
|
234
|
-
wrapperStyle?:
|
|
240
|
+
wrapperStyle?: CSSProperties;
|
|
235
241
|
onClick?: (e: any) => void;
|
|
236
242
|
onLoad?: () => void;
|
|
237
243
|
onError?: (e: any) => void;
|
|
238
|
-
style?:
|
|
244
|
+
style?: CSSProperties;
|
|
239
245
|
className?: string;
|
|
240
246
|
[key: string]: any;
|
|
241
247
|
}
|
|
@@ -243,21 +249,83 @@ export interface AntImageOptions {
|
|
|
243
249
|
* Ant Design Alert component options
|
|
244
250
|
*/
|
|
245
251
|
export interface AntAlertOptions {
|
|
246
|
-
message?:
|
|
247
|
-
description?:
|
|
252
|
+
message?: ReactNode;
|
|
253
|
+
description?: ReactNode;
|
|
248
254
|
type?: 'success' | 'info' | 'warning' | 'error';
|
|
249
255
|
showIcon?: boolean;
|
|
250
256
|
iconName?: string;
|
|
251
257
|
banner?: boolean;
|
|
252
258
|
closable?: boolean;
|
|
253
|
-
closeText?:
|
|
254
|
-
action?:
|
|
255
|
-
icon?:
|
|
256
|
-
style?:
|
|
259
|
+
closeText?: ReactNode;
|
|
260
|
+
action?: ReactNode;
|
|
261
|
+
icon?: ReactNode;
|
|
262
|
+
style?: CSSProperties;
|
|
257
263
|
className?: string;
|
|
258
264
|
afterClose?: () => void;
|
|
259
265
|
[key: string]: any;
|
|
260
266
|
}
|
|
267
|
+
/**
|
|
268
|
+
* Typography-based heading/title options
|
|
269
|
+
*/
|
|
270
|
+
export interface TitleWidgetOptions {
|
|
271
|
+
text?: string;
|
|
272
|
+
renderAs?: 'title' | 'text' | 'paragraph';
|
|
273
|
+
align?: 'left' | 'center' | 'right' | 'justify';
|
|
274
|
+
prefix?: ReactNode;
|
|
275
|
+
suffix?: ReactNode;
|
|
276
|
+
prefixIconName?: string;
|
|
277
|
+
suffixIconName?: string;
|
|
278
|
+
level?: TitleProps['level'];
|
|
279
|
+
type?: TextProps['type'];
|
|
280
|
+
mark?: TextProps['mark'];
|
|
281
|
+
code?: TextProps['code'];
|
|
282
|
+
keyboard?: TextProps['keyboard'];
|
|
283
|
+
underline?: TextProps['underline'];
|
|
284
|
+
delete?: TextProps['delete'];
|
|
285
|
+
strong?: TextProps['strong'];
|
|
286
|
+
italic?: TextProps['italic'];
|
|
287
|
+
disabled?: TextProps['disabled'];
|
|
288
|
+
copyable?: TextProps['copyable'];
|
|
289
|
+
editable?: TextProps['editable'];
|
|
290
|
+
ellipsis?: ParagraphProps['ellipsis'];
|
|
291
|
+
style?: CSSProperties;
|
|
292
|
+
className?: string;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Rich-content display options (HTML/Markdown)
|
|
296
|
+
*/
|
|
297
|
+
export interface HtmlWidgetOptions {
|
|
298
|
+
content?: string;
|
|
299
|
+
format?: 'html' | 'markdown' | 'text';
|
|
300
|
+
sanitizeHtml?: boolean;
|
|
301
|
+
markdownOptions?: MarkdownToJSXOptions;
|
|
302
|
+
renderAs?: 'paragraph' | 'text';
|
|
303
|
+
align?: 'left' | 'center' | 'right' | 'justify';
|
|
304
|
+
preserveWhitespace?: boolean;
|
|
305
|
+
style?: CSSProperties;
|
|
306
|
+
className?: string;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Spacer widget visual configuration
|
|
310
|
+
*/
|
|
311
|
+
export interface SpacerWidgetOptions {
|
|
312
|
+
size?: 'small' | 'middle' | 'large' | number;
|
|
313
|
+
direction?: 'vertical' | 'horizontal';
|
|
314
|
+
fullWidth?: boolean;
|
|
315
|
+
fullHeight?: boolean;
|
|
316
|
+
inline?: boolean;
|
|
317
|
+
className?: string;
|
|
318
|
+
style?: CSSProperties;
|
|
319
|
+
ariaLabel?: string;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Ant Design Divider options with icon support
|
|
323
|
+
*/
|
|
324
|
+
export interface AntDividerOptions extends Partial<DividerProps> {
|
|
325
|
+
text?: ReactNode;
|
|
326
|
+
iconName?: string;
|
|
327
|
+
icon?: ReactNode;
|
|
328
|
+
}
|
|
261
329
|
/**
|
|
262
330
|
* Type mapping for widget options
|
|
263
331
|
*/
|
|
@@ -278,6 +346,12 @@ export type WidgetOptionsMap = {
|
|
|
278
346
|
switch?: AntSwitchOptions;
|
|
279
347
|
image?: AntImageOptions;
|
|
280
348
|
alert?: AntAlertOptions;
|
|
349
|
+
title?: TitleWidgetOptions;
|
|
350
|
+
heading?: TitleWidgetOptions;
|
|
351
|
+
html?: HtmlWidgetOptions;
|
|
352
|
+
markdown?: HtmlWidgetOptions;
|
|
353
|
+
spacer?: SpacerWidgetOptions;
|
|
354
|
+
divider?: AntDividerOptions;
|
|
281
355
|
file: any;
|
|
282
356
|
};
|
|
283
357
|
/**
|
|
@@ -297,3 +371,4 @@ export interface CommonWidgetProps {
|
|
|
297
371
|
rawErrors?: string[];
|
|
298
372
|
schema: any;
|
|
299
373
|
}
|
|
374
|
+
export {};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { InputProps, TextAreaProps } from 'antd/es/input';
|
|
2
3
|
import { DatePickerProps } from 'antd/es/date-picker';
|
|
3
4
|
import { InputNumberProps } from 'antd/es/input-number';
|
|
4
|
-
import {
|
|
5
|
+
import { TitleProps } from 'antd/es/typography/Title';
|
|
6
|
+
import { TextProps } from 'antd/es/typography/Text';
|
|
7
|
+
import { ParagraphProps } from 'antd/es/typography/Paragraph';
|
|
8
|
+
import { DividerProps } from 'antd/es/divider';
|
|
9
|
+
import { AntInputOptions, AntTextAreaOptions, AntDatePickerOptions, AntInputNumberOptions, AntSliderOptions, AntRateOptions, AntTimePickerOptions, AntColorPickerOptions, AntSwitchOptions, AntImageOptions, AntAlertOptions, TitleWidgetOptions, HtmlWidgetOptions, SpacerWidgetOptions, AntDividerOptions } from './types';
|
|
5
10
|
import { SliderSingleProps } from 'antd/es/slider';
|
|
6
11
|
import { RateProps } from 'antd/es/rate';
|
|
7
12
|
import { TimePickerProps } from 'antd/es/time-picker';
|
|
@@ -54,6 +59,44 @@ export declare const getAntImageProps: (options?: AntImageOptions) => Partial<Im
|
|
|
54
59
|
* Extract Ant Design Alert props from uiSchema options
|
|
55
60
|
*/
|
|
56
61
|
export declare const getAntAlertProps: (options?: AntAlertOptions) => Partial<AlertProps>;
|
|
62
|
+
/**
|
|
63
|
+
* Extract typography display props for Title widget
|
|
64
|
+
*/
|
|
65
|
+
export declare const getTitleDisplayProps: (options?: TitleWidgetOptions) => {
|
|
66
|
+
text?: string;
|
|
67
|
+
renderAs: "title" | "text" | "paragraph";
|
|
68
|
+
align?: "left" | "center" | "right" | "justify";
|
|
69
|
+
prefixNode?: React.ReactNode;
|
|
70
|
+
suffixNode?: React.ReactNode;
|
|
71
|
+
typographyProps: Partial<TitleProps & TextProps & ParagraphProps>;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Extract rich content display props for HTML/Markdown widget
|
|
75
|
+
*/
|
|
76
|
+
export declare const getHtmlDisplayProps: (options?: HtmlWidgetOptions) => {
|
|
77
|
+
content?: string;
|
|
78
|
+
format: "html" | "markdown" | "text";
|
|
79
|
+
sanitizeHtml: boolean;
|
|
80
|
+
renderAs: "paragraph" | "text";
|
|
81
|
+
align?: "left" | "center" | "right" | "justify";
|
|
82
|
+
preserveWhitespace?: boolean;
|
|
83
|
+
markdownOptions?: HtmlWidgetOptions["markdownOptions"];
|
|
84
|
+
className?: string;
|
|
85
|
+
style?: React.CSSProperties;
|
|
86
|
+
};
|
|
87
|
+
export declare const getSpacerProps: (options?: SpacerWidgetOptions) => {
|
|
88
|
+
className?: string;
|
|
89
|
+
ariaLabel?: string;
|
|
90
|
+
style: React.CSSProperties;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Extract Ant Design Divider props with optional icon mapping
|
|
94
|
+
*/
|
|
95
|
+
export declare const getAntDividerProps: (options?: AntDividerOptions) => {
|
|
96
|
+
dividerProps: Partial<DividerProps>;
|
|
97
|
+
content?: React.ReactNode;
|
|
98
|
+
iconNode?: React.ReactNode;
|
|
99
|
+
};
|
|
57
100
|
/**
|
|
58
101
|
* Check if the widget has validation errors
|
|
59
102
|
*/
|
|
@@ -252,10 +252,40 @@ export interface WebSocketDataSourceConfig {
|
|
|
252
252
|
/** Cache configuration (for offline support) */
|
|
253
253
|
cache?: CacheConfig;
|
|
254
254
|
}
|
|
255
|
+
export interface FormDataFilterConfig {
|
|
256
|
+
/** Path within the resolved data item to evaluate */
|
|
257
|
+
path: string;
|
|
258
|
+
/** Value that must equal the resolved field */
|
|
259
|
+
equals?: unknown;
|
|
260
|
+
/** Value that must differ from the resolved field */
|
|
261
|
+
notEquals?: unknown;
|
|
262
|
+
/** Value that must be included within the resolved field (array/string) */
|
|
263
|
+
includes?: unknown;
|
|
264
|
+
}
|
|
265
|
+
export interface FormDataSortConfig {
|
|
266
|
+
/** Path within the resolved data item to sort by */
|
|
267
|
+
path: string;
|
|
268
|
+
/** Sort order */
|
|
269
|
+
order?: 'asc' | 'desc';
|
|
270
|
+
/** Treat values as numeric for comparison */
|
|
271
|
+
numeric?: boolean;
|
|
272
|
+
}
|
|
273
|
+
export interface FormDataDataSourceConfig {
|
|
274
|
+
/** Type identifier for formData data source */
|
|
275
|
+
type: 'formData';
|
|
276
|
+
/** Path (dot/bracket syntax) to the array within binding data */
|
|
277
|
+
path: string;
|
|
278
|
+
/** Mapper configuration reused from API data sources */
|
|
279
|
+
mapper?: ResponseMapperConfig;
|
|
280
|
+
/** Optional filter configuration */
|
|
281
|
+
filter?: FormDataFilterConfig;
|
|
282
|
+
/** Optional sort configuration */
|
|
283
|
+
sort?: FormDataSortConfig;
|
|
284
|
+
}
|
|
255
285
|
/**
|
|
256
286
|
* Union type for all data source configurations
|
|
257
287
|
*/
|
|
258
|
-
export type DataSourceConfig = StaticDataSourceConfig | ApiDataSourceConfig | WebSocketDataSourceConfig;
|
|
288
|
+
export type DataSourceConfig = StaticDataSourceConfig | ApiDataSourceConfig | WebSocketDataSourceConfig | FormDataDataSourceConfig;
|
|
259
289
|
/**
|
|
260
290
|
* Validation configuration for selected values
|
|
261
291
|
*/
|
|
@@ -498,6 +528,7 @@ export declare function isApiDataSource(dataSource: DataSourceConfig): dataSourc
|
|
|
498
528
|
* Type guard to check if a data source is WebSocket-based
|
|
499
529
|
*/
|
|
500
530
|
export declare function isWebSocketDataSource(dataSource: DataSourceConfig): dataSource is WebSocketDataSourceConfig;
|
|
531
|
+
export declare function isFormDataDataSource(dataSource: DataSourceConfig): dataSource is FormDataDataSourceConfig;
|
|
501
532
|
/**
|
|
502
533
|
* Type guard to check if widget supports multiple selections
|
|
503
534
|
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChoiceOption, ErrorState, FormDataDataSourceConfig, LoadingState } from '../ChoiceWidget.types';
|
|
2
|
+
import { DataSourceMetrics } from '../providers/DataSourceProvider';
|
|
3
|
+
|
|
4
|
+
export declare const useFormDataSource: (config: FormDataDataSourceConfig | undefined, bindingData: unknown) => {
|
|
5
|
+
options: ChoiceOption[];
|
|
6
|
+
loading: LoadingState;
|
|
7
|
+
error: ErrorState;
|
|
8
|
+
metrics: DataSourceMetrics;
|
|
9
|
+
};
|
package/dist/widgets/index.d.ts
CHANGED
|
@@ -11,10 +11,12 @@ import { PasswordWidget } from './text/PasswordWidget';
|
|
|
11
11
|
import { DateWidget, EnhancedDateWidget, DateTimeWidget } from './date';
|
|
12
12
|
import { FileWidget } from './file/FileWidget';
|
|
13
13
|
import { FileUploadWidget } from './file/FileUploadWidget';
|
|
14
|
+
import { TitleWidget, HtmlWidget, SpacerWidget, DividerWidget } from './display';
|
|
14
15
|
import { ChoiceWidget } from './choice';
|
|
15
16
|
|
|
16
17
|
export * from './choice';
|
|
17
18
|
export * from './text';
|
|
19
|
+
export * from './display';
|
|
18
20
|
export declare const customWidgets: {
|
|
19
21
|
choice: import('react').FC<import('./choice').ChoiceWidgetProps>;
|
|
20
22
|
color: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
@@ -45,6 +47,18 @@ export declare const customWidgets: {
|
|
|
45
47
|
ImageWidget: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
46
48
|
alert: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
47
49
|
AlertWidget: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
50
|
+
title: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
51
|
+
heading: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
52
|
+
TitleWidget: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
53
|
+
HeadingWidget: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
54
|
+
html: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
55
|
+
HtmlWidget: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
56
|
+
markdown: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
57
|
+
MarkdownWidget: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
58
|
+
spacer: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
59
|
+
SpacerWidget: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
60
|
+
divider: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
61
|
+
DividerWidget: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
48
62
|
date: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
49
63
|
DateWidget: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
50
64
|
'datetime-local': import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
@@ -56,4 +70,4 @@ export declare const customWidgets: {
|
|
|
56
70
|
fileUpload: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
57
71
|
FileUploadWidget: import('react').FC<import('@rjsf/utils').WidgetProps<any, import('@rjsf/utils').RJSFSchema, any>>;
|
|
58
72
|
};
|
|
59
|
-
export { ChoiceWidget, ColorWidget, RangeWidget, RatingWidget, TextWidget, TextareaWidget, PasswordWidget, NumberWidget, TelephoneWidget, EmailWidget, URLWidget, DateWidget, EnhancedDateWidget, DateTimeWidget, FileWidget, FileUploadWidget, };
|
|
73
|
+
export { ChoiceWidget, ColorWidget, RangeWidget, RatingWidget, TextWidget, TextareaWidget, PasswordWidget, NumberWidget, TelephoneWidget, EmailWidget, URLWidget, DateWidget, EnhancedDateWidget, DateTimeWidget, FileWidget, FileUploadWidget, TitleWidget, HtmlWidget, SpacerWidget, DividerWidget, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "extended-dynamic-forms",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"description": "Extended React JSON Schema Form (RJSF) v6 with custom components, widgets, templates, layouts, and form events",
|
|
5
5
|
"main": "dist/index.umd.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -104,7 +104,8 @@
|
|
|
104
104
|
"date-fns": "^4.1.0",
|
|
105
105
|
"json-logic-js": "^2.0.5",
|
|
106
106
|
"json-rules-engine-simplified": "^0.2.0",
|
|
107
|
-
"lucide-react": "^0.452.0"
|
|
107
|
+
"lucide-react": "^0.452.0",
|
|
108
|
+
"handlebars": "^4.7.8"
|
|
108
109
|
},
|
|
109
110
|
"type": "module"
|
|
110
111
|
}
|