@rjsf/core 4.2.1 → 5.0.0-beta.1
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/README.md +2 -2
- package/dist/components/Form.d.ts +274 -45
- package/dist/components/fields/ArrayField.d.ts +6 -51
- package/dist/components/fields/BooleanField.d.ts +7 -44
- package/dist/components/fields/MultiSchemaField.d.ts +42 -38
- package/dist/components/fields/NullField.d.ts +7 -5
- package/dist/components/fields/NumberField.d.ts +3 -46
- package/dist/components/fields/ObjectField.d.ts +71 -20
- package/dist/components/fields/SchemaField.d.ts +9 -38
- package/dist/components/fields/StringField.d.ts +6 -44
- package/dist/components/fields/index.d.ts +3 -26
- package/dist/components/templates/ArrayFieldDescriptionTemplate.d.ts +7 -0
- package/dist/components/templates/ArrayFieldItemTemplate.d.ts +6 -0
- package/dist/components/templates/ArrayFieldTemplate.d.ts +6 -0
- package/dist/components/templates/ArrayFieldTitleTemplate.d.ts +7 -0
- package/dist/components/templates/BaseInputTemplate.d.ts +8 -0
- package/dist/components/templates/ButtonTemplates/AddButton.d.ts +4 -0
- package/dist/components/templates/ButtonTemplates/IconButton.d.ts +5 -0
- package/dist/components/templates/ButtonTemplates/SubmitButton.d.ts +4 -0
- package/dist/components/templates/ButtonTemplates/index.d.ts +3 -0
- package/dist/components/templates/DescriptionField.d.ts +6 -0
- package/dist/components/templates/ErrorList.d.ts +6 -0
- package/dist/components/templates/FieldTemplate/FieldTemplate.d.ts +7 -0
- package/dist/components/templates/FieldTemplate/Label.d.ts +13 -0
- package/dist/components/templates/FieldTemplate/WrapIfAdditional.d.ts +12 -0
- package/dist/components/templates/FieldTemplate/index.d.ts +2 -0
- package/dist/components/templates/ObjectFieldTemplate.d.ts +8 -0
- package/dist/components/templates/TitleField.d.ts +6 -0
- package/dist/components/templates/UnsupportedField.d.ts +8 -0
- package/dist/components/templates/index.d.ts +3 -0
- package/dist/components/widgets/AltDateTimeWidget.d.ts +7 -21
- package/dist/components/widgets/AltDateWidget.d.ts +5 -21
- package/dist/components/widgets/CheckboxWidget.d.ts +7 -17
- package/dist/components/widgets/CheckboxesWidget.d.ts +7 -25
- package/dist/components/widgets/ColorWidget.d.ts +7 -15
- package/dist/components/widgets/DateTimeWidget.d.ts +7 -8
- package/dist/components/widgets/DateWidget.d.ts +7 -8
- package/dist/components/widgets/EmailWidget.d.ts +6 -8
- package/dist/components/widgets/FileWidget.d.ts +6 -18
- package/dist/components/widgets/HiddenWidget.d.ts +7 -11
- package/dist/components/widgets/PasswordWidget.d.ts +6 -8
- package/dist/components/widgets/RadioWidget.d.ts +7 -21
- package/dist/components/widgets/RangeWidget.d.ts +7 -8
- package/dist/components/widgets/SelectWidget.d.ts +7 -23
- package/dist/components/widgets/TextWidget.d.ts +6 -9
- package/dist/components/widgets/TextareaWidget.d.ts +10 -22
- package/dist/components/widgets/URLWidget.d.ts +6 -8
- package/dist/components/widgets/UpDownWidget.d.ts +6 -8
- package/dist/components/widgets/index.d.ts +3 -43
- package/dist/core.cjs.development.js +2947 -4606
- package/dist/core.cjs.development.js.map +1 -1
- package/dist/core.cjs.production.min.js +1 -1
- package/dist/core.cjs.production.min.js.map +1 -1
- package/dist/core.esm.js +2897 -4566
- package/dist/core.esm.js.map +1 -1
- package/dist/core.umd.development.js +4049 -0
- package/dist/core.umd.development.js.map +1 -0
- package/dist/core.umd.production.min.js +2 -0
- package/dist/core.umd.production.min.js.map +1 -0
- package/dist/getDefaultRegistry.d.ts +6 -0
- package/dist/index.d.ts +5 -70
- package/dist/withTheme.d.ts +7 -9
- package/package.json +40 -69
- package/dist/components/AddButton.d.ts +0 -5
- package/dist/components/ErrorList.d.ts +0 -1
- package/dist/components/IconButton.d.ts +0 -1
- package/dist/components/fields/DescriptionField.d.ts +0 -9
- package/dist/components/fields/TitleField.d.ts +0 -10
- package/dist/components/fields/UnsupportedField.d.ts +0 -14
- package/dist/components/widgets/BaseInput.d.ts +0 -23
- package/dist/components/widgets/SubmitButton.d.ts +0 -3
- package/dist/defaultRegistry.d.ts +0 -41
- package/dist/types.d.ts +0 -50
- package/dist/utils.d.ts +0 -81
- package/dist/validate.d.ts +0 -21
- package/index.d.ts +0 -500
package/index.d.ts
DELETED
|
@@ -1,500 +0,0 @@
|
|
|
1
|
-
// Originally from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/@rjsf/core/index.d.ts
|
|
2
|
-
|
|
3
|
-
declare module '@rjsf/core' {
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { JSONSchema7, JSONSchema7Definition, JSONSchema7Type, JSONSchema7TypeName } from 'json-schema';
|
|
6
|
-
|
|
7
|
-
type ErrorSchema = {
|
|
8
|
-
[k: string]: ErrorSchema;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export interface FormProps<T> {
|
|
12
|
-
acceptcharset?: string;
|
|
13
|
-
action?: string;
|
|
14
|
-
additionalMetaSchemas?: ReadonlyArray<object>;
|
|
15
|
-
ArrayFieldTemplate?: React.FunctionComponent<ArrayFieldTemplateProps>;
|
|
16
|
-
autoComplete?: string;
|
|
17
|
-
autocomplete?: string; // deprecated
|
|
18
|
-
children?: React.ReactNode;
|
|
19
|
-
className?: string;
|
|
20
|
-
customFormats?: { [k: string]: string | RegExp | ((data: string) => boolean) };
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
readonly?: boolean;
|
|
23
|
-
hideError?: boolean;
|
|
24
|
-
enctype?: string;
|
|
25
|
-
extraErrors?: any;
|
|
26
|
-
ErrorList?: React.FunctionComponent<ErrorListProps>;
|
|
27
|
-
fields?: { [name: string]: Field };
|
|
28
|
-
FieldTemplate?: React.FunctionComponent<FieldTemplateProps>;
|
|
29
|
-
formContext?: any;
|
|
30
|
-
formData?: T;
|
|
31
|
-
id?: string;
|
|
32
|
-
idPrefix?: string;
|
|
33
|
-
idSeparator?: string;
|
|
34
|
-
liveOmit?: boolean;
|
|
35
|
-
liveValidate?: boolean;
|
|
36
|
-
method?: string;
|
|
37
|
-
name?: string;
|
|
38
|
-
noHtml5Validate?: boolean;
|
|
39
|
-
noValidate?: boolean;
|
|
40
|
-
ObjectFieldTemplate?: React.FunctionComponent<ObjectFieldTemplateProps>;
|
|
41
|
-
omitExtraData?: boolean;
|
|
42
|
-
onBlur?: (id: string, value: any) => void;
|
|
43
|
-
onChange?: (e: IChangeEvent<T>, es?: ErrorSchema) => any;
|
|
44
|
-
onError?: (e: any) => any;
|
|
45
|
-
onFocus?: (id: string, value: any) => void;
|
|
46
|
-
onSubmit?: (e: ISubmitEvent<T>, nativeEvent: React.FormEvent<HTMLFormElement>) => any;
|
|
47
|
-
schema: JSONSchema7;
|
|
48
|
-
showErrorList?: boolean;
|
|
49
|
-
tagName?: keyof JSX.IntrinsicElements | React.ComponentType;
|
|
50
|
-
target?: string;
|
|
51
|
-
transformErrors?: (errors: AjvError[]) => AjvError[];
|
|
52
|
-
uiSchema?: UiSchema;
|
|
53
|
-
validate?: (formData: T, errors: FormValidation) => FormValidation;
|
|
54
|
-
widgets?: { [name: string]: Widget };
|
|
55
|
-
/**
|
|
56
|
-
* WARNING: This exists for internal react-jsonschema-form purposes only. No guarantees of backwards
|
|
57
|
-
* compatibility. Use ONLY if you know what you are doing
|
|
58
|
-
*/
|
|
59
|
-
_internalFormWrapper?: React.ElementType;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export default class Form<T> extends React.Component<FormProps<T>> {
|
|
63
|
-
validate: (
|
|
64
|
-
formData: T,
|
|
65
|
-
schema?: FormProps<T>['schema'],
|
|
66
|
-
additionalMetaSchemas?: FormProps<T>['additionalMetaSchemas'],
|
|
67
|
-
customFormats?: FormProps<T>['customFormats'],
|
|
68
|
-
) => { errors: AjvError[]; errorSchema: ErrorSchema };
|
|
69
|
-
onChange: (formData: T, newErrorSchema: ErrorSchema) => void;
|
|
70
|
-
onBlur: (id: string, value: any) => void;
|
|
71
|
-
submit: () => void;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export type UISchemaSubmitButtonOptions = {
|
|
75
|
-
submitText?: string;
|
|
76
|
-
norender?: boolean;
|
|
77
|
-
props?: {
|
|
78
|
-
disabled?:boolean;
|
|
79
|
-
className?:string;
|
|
80
|
-
[name: string]: any;
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export type UiSchema = {
|
|
85
|
-
'ui:field'?: Field | string;
|
|
86
|
-
'ui:widget'?: Widget | string;
|
|
87
|
-
'ui:options'?: { [key: string]: boolean | number | string | object | any[] | null };
|
|
88
|
-
'ui:order'?: string[];
|
|
89
|
-
'ui:FieldTemplate'?: React.FunctionComponent<FieldTemplateProps>;
|
|
90
|
-
'ui:ArrayFieldTemplate'?: React.FunctionComponent<ArrayFieldTemplateProps>;
|
|
91
|
-
'ui:ObjectFieldTemplate'?: React.FunctionComponent<ObjectFieldTemplateProps>;
|
|
92
|
-
[name: string]: any;
|
|
93
|
-
'ui:submitButtonOptions'?: UISchemaSubmitButtonOptions;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export type FieldId = {
|
|
97
|
-
$id: string;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export type IdSchema<T = any> = {
|
|
101
|
-
[key in keyof T]: IdSchema<T[key]>;
|
|
102
|
-
} &
|
|
103
|
-
FieldId;
|
|
104
|
-
|
|
105
|
-
export type FieldPath = {
|
|
106
|
-
$name: string;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export type PathSchema<T = any> = {
|
|
110
|
-
[key in keyof T]: PathSchema<T[key]>;
|
|
111
|
-
} &
|
|
112
|
-
FieldPath;
|
|
113
|
-
|
|
114
|
-
export interface WidgetProps
|
|
115
|
-
extends Pick<
|
|
116
|
-
React.HTMLAttributes<HTMLElement>,
|
|
117
|
-
Exclude<keyof React.HTMLAttributes<HTMLElement>, 'onBlur' | 'onFocus'>
|
|
118
|
-
> {
|
|
119
|
-
id: string;
|
|
120
|
-
schema: JSONSchema7;
|
|
121
|
-
uiSchema: UiSchema;
|
|
122
|
-
value: any;
|
|
123
|
-
required: boolean;
|
|
124
|
-
disabled: boolean;
|
|
125
|
-
readonly: boolean;
|
|
126
|
-
autofocus: boolean;
|
|
127
|
-
placeholder: string;
|
|
128
|
-
onChange: (value: any) => void;
|
|
129
|
-
options: NonNullable<UiSchema['ui:options']>;
|
|
130
|
-
formContext: any;
|
|
131
|
-
onBlur: (id: string, value: any) => void;
|
|
132
|
-
onFocus: (id: string, value: any) => void;
|
|
133
|
-
label: string;
|
|
134
|
-
multiple: boolean;
|
|
135
|
-
rawErrors: string[];
|
|
136
|
-
registry: Registry;
|
|
137
|
-
[prop: string]: any; // Allow for other props
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export type Widget = React.FunctionComponent<WidgetProps> | React.ComponentClass<WidgetProps>;
|
|
141
|
-
|
|
142
|
-
export interface Registry {
|
|
143
|
-
fields: { [name: string]: Field };
|
|
144
|
-
widgets: { [name: string]: Widget };
|
|
145
|
-
definitions: { [name: string]: any };
|
|
146
|
-
formContext: any;
|
|
147
|
-
rootSchema: JSONSchema7;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export interface FieldProps<T = any>
|
|
151
|
-
extends Pick<React.HTMLAttributes<HTMLElement>, Exclude<keyof React.HTMLAttributes<HTMLElement>, 'onBlur' | 'onFocus'>> {
|
|
152
|
-
schema: JSONSchema7;
|
|
153
|
-
uiSchema: UiSchema;
|
|
154
|
-
idSchema: IdSchema;
|
|
155
|
-
formData: T;
|
|
156
|
-
errorSchema: ErrorSchema;
|
|
157
|
-
onChange: (e: IChangeEvent<T> | any, es?: ErrorSchema) => any;
|
|
158
|
-
onBlur: (id: string, value: any) => void;
|
|
159
|
-
onFocus: (id: string, value: any) => void;
|
|
160
|
-
registry: Registry;
|
|
161
|
-
formContext: any;
|
|
162
|
-
autofocus: boolean;
|
|
163
|
-
disabled: boolean;
|
|
164
|
-
readonly: boolean;
|
|
165
|
-
required: boolean;
|
|
166
|
-
name: string;
|
|
167
|
-
[prop: string]: any; // Allow for other props
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export type Field = React.FunctionComponent<FieldProps> | React.ComponentClass<FieldProps>;
|
|
171
|
-
|
|
172
|
-
export type FieldTemplateProps<T = any> = {
|
|
173
|
-
id: string;
|
|
174
|
-
classNames: string;
|
|
175
|
-
label: string;
|
|
176
|
-
description: React.ReactElement;
|
|
177
|
-
rawDescription: string;
|
|
178
|
-
children: React.ReactElement;
|
|
179
|
-
errors: React.ReactElement;
|
|
180
|
-
rawErrors: string[];
|
|
181
|
-
help: React.ReactElement;
|
|
182
|
-
rawHelp: string;
|
|
183
|
-
hidden: boolean;
|
|
184
|
-
required: boolean;
|
|
185
|
-
readonly: boolean;
|
|
186
|
-
disabled: boolean;
|
|
187
|
-
displayLabel: boolean;
|
|
188
|
-
fields: Field[];
|
|
189
|
-
schema: JSONSchema7;
|
|
190
|
-
uiSchema: UiSchema;
|
|
191
|
-
formContext: any;
|
|
192
|
-
formData: T;
|
|
193
|
-
onChange: (value: T) => void;
|
|
194
|
-
onKeyChange: (value: string) => () => void;
|
|
195
|
-
onDropPropertyClick: (value: string) => () => void;
|
|
196
|
-
registry: Registry;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
export type ArrayFieldTemplateProps<T = any> = {
|
|
200
|
-
DescriptionField: React.FunctionComponent<{ id: string; description: string | React.ReactElement }>;
|
|
201
|
-
TitleField: React.FunctionComponent<{ id: string; title: string; required: boolean }>;
|
|
202
|
-
canAdd: boolean;
|
|
203
|
-
className: string;
|
|
204
|
-
disabled: boolean;
|
|
205
|
-
idSchema: IdSchema;
|
|
206
|
-
items: {
|
|
207
|
-
children: React.ReactElement;
|
|
208
|
-
className: string;
|
|
209
|
-
disabled: boolean;
|
|
210
|
-
hasMoveDown: boolean;
|
|
211
|
-
hasMoveUp: boolean;
|
|
212
|
-
hasRemove: boolean;
|
|
213
|
-
hasToolbar: boolean;
|
|
214
|
-
index: number;
|
|
215
|
-
onAddIndexClick: (index: number) => (event?: any) => void;
|
|
216
|
-
onDropIndexClick: (index: number) => (event?: any) => void;
|
|
217
|
-
onReorderClick: (index: number, newIndex: number) => (event?: any) => void;
|
|
218
|
-
readonly: boolean;
|
|
219
|
-
key: string;
|
|
220
|
-
}[];
|
|
221
|
-
onAddClick: (event?: any) => void;
|
|
222
|
-
readonly: boolean;
|
|
223
|
-
required: boolean;
|
|
224
|
-
schema: JSONSchema7;
|
|
225
|
-
uiSchema: UiSchema;
|
|
226
|
-
title: string;
|
|
227
|
-
formContext: any;
|
|
228
|
-
formData: T;
|
|
229
|
-
registry: Registry;
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
export type ObjectFieldTemplateProps<T = any> = {
|
|
233
|
-
DescriptionField: React.FunctionComponent<{ id: string; description: string | React.ReactElement }>;
|
|
234
|
-
TitleField: React.FunctionComponent<{ id: string; title: string; required: boolean }>;
|
|
235
|
-
title: string;
|
|
236
|
-
description: string;
|
|
237
|
-
disabled: boolean;
|
|
238
|
-
properties: {
|
|
239
|
-
content: React.ReactElement;
|
|
240
|
-
name: string;
|
|
241
|
-
disabled: boolean;
|
|
242
|
-
readonly: boolean;
|
|
243
|
-
hidden: boolean;
|
|
244
|
-
}[];
|
|
245
|
-
onAddClick: (schema: JSONSchema7) => () => void;
|
|
246
|
-
readonly: boolean;
|
|
247
|
-
required: boolean;
|
|
248
|
-
schema: JSONSchema7;
|
|
249
|
-
uiSchema: UiSchema;
|
|
250
|
-
idSchema: IdSchema;
|
|
251
|
-
formData: T;
|
|
252
|
-
formContext: any;
|
|
253
|
-
registry: Registry;
|
|
254
|
-
};
|
|
255
|
-
|
|
256
|
-
export type AjvError = {
|
|
257
|
-
message: string;
|
|
258
|
-
name: string;
|
|
259
|
-
params: any;
|
|
260
|
-
property: string;
|
|
261
|
-
stack: string;
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
export type ErrorListProps = {
|
|
265
|
-
errorSchema: FormValidation;
|
|
266
|
-
errors: AjvError[];
|
|
267
|
-
formContext: any;
|
|
268
|
-
schema: JSONSchema7;
|
|
269
|
-
uiSchema: UiSchema;
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
export interface IChangeEvent<T = any> {
|
|
273
|
-
edit: boolean;
|
|
274
|
-
formData: T;
|
|
275
|
-
errors: AjvError[];
|
|
276
|
-
errorSchema: FormValidation;
|
|
277
|
-
idSchema: IdSchema;
|
|
278
|
-
schema: JSONSchema7;
|
|
279
|
-
uiSchema: UiSchema;
|
|
280
|
-
status?: string;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
export type ISubmitEvent<T> = IChangeEvent<T>;
|
|
284
|
-
|
|
285
|
-
export type FieldError = string;
|
|
286
|
-
|
|
287
|
-
type FieldValidation = {
|
|
288
|
-
__errors: FieldError[];
|
|
289
|
-
addError: (message: string) => void;
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
type FormValidation = FieldValidation & {
|
|
293
|
-
[fieldName: string]: FieldValidation;
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
type FormSubmit<T = any> = {
|
|
297
|
-
formData: T;
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
export type ThemeProps<T = any> = Omit<FormProps<T>, 'schema'>;
|
|
301
|
-
|
|
302
|
-
export function withTheme<T = any>(
|
|
303
|
-
themeProps: ThemeProps<T>,
|
|
304
|
-
): React.ComponentClass<FormProps<T>> | React.FunctionComponent<FormProps<T>>;
|
|
305
|
-
|
|
306
|
-
export type AddButtonProps = {
|
|
307
|
-
className: string;
|
|
308
|
-
onClick: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
309
|
-
disabled: boolean;
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
export module utils {
|
|
313
|
-
|
|
314
|
-
export const ADDITIONAL_PROPERTY_FLAG: string;
|
|
315
|
-
|
|
316
|
-
export function canExpand(schema: JSONSchema7, uiSchema: UiSchema, formData: any): boolean;
|
|
317
|
-
|
|
318
|
-
export function getDefaultRegistry(): Registry;
|
|
319
|
-
|
|
320
|
-
export function getSchemaType(schema: JSONSchema7): string;
|
|
321
|
-
|
|
322
|
-
export function getWidget(
|
|
323
|
-
schema: JSONSchema7,
|
|
324
|
-
widget: Widget | string,
|
|
325
|
-
registeredWidgets?: { [name: string]: Widget },
|
|
326
|
-
): Widget;
|
|
327
|
-
|
|
328
|
-
export function hasWidget(
|
|
329
|
-
schema: JSONSchema7,
|
|
330
|
-
widget: Widget | string,
|
|
331
|
-
registeredWidgets?: { [name: string]: Widget },
|
|
332
|
-
): boolean;
|
|
333
|
-
|
|
334
|
-
export function computeDefaults<T = any>(
|
|
335
|
-
schema: JSONSchema7,
|
|
336
|
-
parentDefaults: JSONSchema7['default'][],
|
|
337
|
-
definitions: Registry['definitions'],
|
|
338
|
-
rawFormData?: T,
|
|
339
|
-
includeUndefinedValues?: boolean,
|
|
340
|
-
): JSONSchema7['default'][];
|
|
341
|
-
|
|
342
|
-
export function getDefaultFormState<T = any>(
|
|
343
|
-
schema: JSONSchema7,
|
|
344
|
-
formData: T,
|
|
345
|
-
definitions?: Registry['definitions'],
|
|
346
|
-
includeUndefinedValues?: boolean,
|
|
347
|
-
): T | JSONSchema7['default'][];
|
|
348
|
-
|
|
349
|
-
export function getUiOptions(uiSchema: UiSchema): UiSchema['ui:options'];
|
|
350
|
-
|
|
351
|
-
export function getSubmitButtonOptions(uiSchema: UiSchema): UISchemaSubmitButtonOptions;
|
|
352
|
-
|
|
353
|
-
export function getDisplayLabel(schema: JSONSchema7, uiSchema: UiSchema, rootSchema?: JSONSchema7): boolean;
|
|
354
|
-
|
|
355
|
-
export function isObject(thing: any): boolean;
|
|
356
|
-
|
|
357
|
-
export function mergeObjects(obj1: object, obj2: object, concatArrays?: boolean): object;
|
|
358
|
-
|
|
359
|
-
export function asNumber(value: string | null): number | string | undefined | null;
|
|
360
|
-
|
|
361
|
-
export function orderProperties(properties: [], order: []): [];
|
|
362
|
-
|
|
363
|
-
export function isConstant(schema: JSONSchema7): boolean;
|
|
364
|
-
|
|
365
|
-
export function toConstant(schema: JSONSchema7): JSONSchema7Type | JSONSchema7['const'];
|
|
366
|
-
|
|
367
|
-
export function isSelect(_schema: JSONSchema7, definitions?: Registry['definitions']): boolean;
|
|
368
|
-
|
|
369
|
-
export function isMultiSelect(schema: JSONSchema7, definitions?: Registry['definitions']): boolean;
|
|
370
|
-
|
|
371
|
-
export function isFilesArray(
|
|
372
|
-
schema: JSONSchema7,
|
|
373
|
-
uiSchema: UiSchema,
|
|
374
|
-
definitions?: Registry['definitions'],
|
|
375
|
-
): boolean;
|
|
376
|
-
|
|
377
|
-
export function isFixedItems(schema: JSONSchema7): boolean;
|
|
378
|
-
|
|
379
|
-
export function allowAdditionalItems(schema: JSONSchema7): boolean;
|
|
380
|
-
|
|
381
|
-
export function optionsList(schema: JSONSchema7): {
|
|
382
|
-
schema?: JSONSchema7Definition;
|
|
383
|
-
label: string;
|
|
384
|
-
value: string;
|
|
385
|
-
}[];
|
|
386
|
-
|
|
387
|
-
export function guessType(value: any): JSONSchema7TypeName;
|
|
388
|
-
|
|
389
|
-
export function stubExistingAdditionalProperties<T = any>(
|
|
390
|
-
schema: JSONSchema7,
|
|
391
|
-
definitions?: Registry['definitions'],
|
|
392
|
-
formData?: T,
|
|
393
|
-
): JSONSchema7;
|
|
394
|
-
|
|
395
|
-
export function resolveSchema<T = any>(
|
|
396
|
-
schema: JSONSchema7Definition,
|
|
397
|
-
definitions?: Registry['definitions'],
|
|
398
|
-
formData?: T,
|
|
399
|
-
): JSONSchema7;
|
|
400
|
-
|
|
401
|
-
export function retrieveSchema<T = any>(
|
|
402
|
-
schema: JSONSchema7Definition,
|
|
403
|
-
definitions?: Registry['definitions'],
|
|
404
|
-
formData?: T,
|
|
405
|
-
): JSONSchema7;
|
|
406
|
-
|
|
407
|
-
export function deepEquals<T>(a: T, b: T): boolean;
|
|
408
|
-
|
|
409
|
-
export function shouldRender(comp: React.Component, nextProps: any, nextState: any): boolean;
|
|
410
|
-
|
|
411
|
-
export function toIdSchema<T = any>(
|
|
412
|
-
schema: JSONSchema7Definition,
|
|
413
|
-
id: string,
|
|
414
|
-
definitions: Registry['definitions'],
|
|
415
|
-
formData?: T,
|
|
416
|
-
idPrefix?: string,
|
|
417
|
-
idSeparator?: string,
|
|
418
|
-
): IdSchema | IdSchema[];
|
|
419
|
-
|
|
420
|
-
export function toPathSchema<T = any>(
|
|
421
|
-
schema: JSONSchema7Definition,
|
|
422
|
-
name: string | undefined,
|
|
423
|
-
definitions: Registry['definitions'],
|
|
424
|
-
formData?: T,
|
|
425
|
-
): PathSchema | PathSchema[];
|
|
426
|
-
|
|
427
|
-
export interface DateObject {
|
|
428
|
-
year: number;
|
|
429
|
-
month: number;
|
|
430
|
-
day: number;
|
|
431
|
-
hour: number;
|
|
432
|
-
minute: number;
|
|
433
|
-
second: number;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
export function parseDateString(dateString: string, includeTime?: boolean): DateObject;
|
|
437
|
-
|
|
438
|
-
export function toDateString(dateObject: DateObject, time?: boolean): string;
|
|
439
|
-
|
|
440
|
-
export function utcToLocal(jsonDate: string): string;
|
|
441
|
-
|
|
442
|
-
export function localToUTC(dateString: string): Date;
|
|
443
|
-
|
|
444
|
-
export function pad(num: number, size: number): string;
|
|
445
|
-
|
|
446
|
-
export function setState(instance: React.Component, state: any, callback: Function): void;
|
|
447
|
-
|
|
448
|
-
export function dataURItoBlob(dataURI: string): { name: string; blob: Blob };
|
|
449
|
-
|
|
450
|
-
export interface IRangeSpec {
|
|
451
|
-
min?: number;
|
|
452
|
-
max?: number;
|
|
453
|
-
step?: number;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
export function rangeSpec(schema: JSONSchema7): IRangeSpec;
|
|
457
|
-
|
|
458
|
-
export function getMatchingOption(
|
|
459
|
-
formData: any,
|
|
460
|
-
options: JSONSchema7[],
|
|
461
|
-
definitions: Registry['definitions'],
|
|
462
|
-
): number;
|
|
463
|
-
|
|
464
|
-
export function schemaRequiresTrueValue(schema: JSONSchema7): boolean;
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
declare module '@rjsf/core/lib/components/fields/SchemaField' {
|
|
469
|
-
import { JSONSchema7 } from 'json-schema';
|
|
470
|
-
import { FieldProps, UiSchema, IdSchema, FormValidation } from '@rjsf/core';
|
|
471
|
-
|
|
472
|
-
export type SchemaFieldProps<T = any> = Pick<
|
|
473
|
-
FieldProps<T>,
|
|
474
|
-
'schema' | 'uiSchema' | 'idSchema' | 'formData' | 'errorSchema' | 'registry' | 'formContext'
|
|
475
|
-
>;
|
|
476
|
-
|
|
477
|
-
export default class SchemaField extends React.Component<SchemaFieldProps> {}
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
declare module '@rjsf/core/lib/components/fields/ObjectField' {
|
|
481
|
-
import { FieldProps } from '@rjsf/core';
|
|
482
|
-
|
|
483
|
-
export type ObjectFieldProps<T = any> = FieldProps<T>;
|
|
484
|
-
|
|
485
|
-
export default class ObjectField extends React.Component<ObjectFieldProps> {}
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
declare module '@rjsf/core/lib/validate' {
|
|
489
|
-
import { JSONSchema7Definition } from 'json-schema';
|
|
490
|
-
import { AjvError, ErrorSchema, FormProps } from '@rjsf/core';
|
|
491
|
-
|
|
492
|
-
export default function validateFormData<T = any>(
|
|
493
|
-
formData: T,
|
|
494
|
-
schema: JSONSchema7Definition,
|
|
495
|
-
customValidate?: FormProps<T>['validate'],
|
|
496
|
-
transformErrors?: FormProps<T>['transformErrors'],
|
|
497
|
-
additionalMetaSchemas?: FormProps<T>['additionalMetaSchemas'],
|
|
498
|
-
customFormats?: FormProps<T>['customFormats'],
|
|
499
|
-
): { errors: AjvError[]; errorSchema: ErrorSchema };
|
|
500
|
-
}
|