@rjsf/core 4.2.2 → 5.0.0-beta.2

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 (78) hide show
  1. package/README.md +2 -2
  2. package/dist/components/Form.d.ts +274 -45
  3. package/dist/components/fields/ArrayField.d.ts +6 -51
  4. package/dist/components/fields/BooleanField.d.ts +7 -44
  5. package/dist/components/fields/MultiSchemaField.d.ts +42 -38
  6. package/dist/components/fields/NullField.d.ts +7 -5
  7. package/dist/components/fields/NumberField.d.ts +3 -46
  8. package/dist/components/fields/ObjectField.d.ts +71 -20
  9. package/dist/components/fields/SchemaField.d.ts +9 -38
  10. package/dist/components/fields/StringField.d.ts +6 -44
  11. package/dist/components/fields/index.d.ts +3 -26
  12. package/dist/components/templates/ArrayFieldDescriptionTemplate.d.ts +7 -0
  13. package/dist/components/templates/ArrayFieldItemTemplate.d.ts +6 -0
  14. package/dist/components/templates/ArrayFieldTemplate.d.ts +6 -0
  15. package/dist/components/templates/ArrayFieldTitleTemplate.d.ts +7 -0
  16. package/dist/components/templates/BaseInputTemplate.d.ts +8 -0
  17. package/dist/components/templates/ButtonTemplates/AddButton.d.ts +4 -0
  18. package/dist/components/templates/ButtonTemplates/IconButton.d.ts +5 -0
  19. package/dist/components/templates/ButtonTemplates/SubmitButton.d.ts +4 -0
  20. package/dist/components/templates/ButtonTemplates/index.d.ts +3 -0
  21. package/dist/components/templates/DescriptionField.d.ts +6 -0
  22. package/dist/components/templates/ErrorList.d.ts +6 -0
  23. package/dist/components/templates/FieldTemplate/FieldTemplate.d.ts +7 -0
  24. package/dist/components/templates/FieldTemplate/Label.d.ts +13 -0
  25. package/dist/components/templates/FieldTemplate/WrapIfAdditional.d.ts +12 -0
  26. package/dist/components/templates/FieldTemplate/index.d.ts +2 -0
  27. package/dist/components/templates/ObjectFieldTemplate.d.ts +8 -0
  28. package/dist/components/templates/TitleField.d.ts +6 -0
  29. package/dist/components/templates/UnsupportedField.d.ts +8 -0
  30. package/dist/components/templates/index.d.ts +3 -0
  31. package/dist/components/widgets/AltDateTimeWidget.d.ts +7 -21
  32. package/dist/components/widgets/AltDateWidget.d.ts +5 -21
  33. package/dist/components/widgets/CheckboxWidget.d.ts +7 -17
  34. package/dist/components/widgets/CheckboxesWidget.d.ts +7 -25
  35. package/dist/components/widgets/ColorWidget.d.ts +7 -15
  36. package/dist/components/widgets/DateTimeWidget.d.ts +7 -8
  37. package/dist/components/widgets/DateWidget.d.ts +7 -8
  38. package/dist/components/widgets/EmailWidget.d.ts +6 -8
  39. package/dist/components/widgets/FileWidget.d.ts +6 -18
  40. package/dist/components/widgets/HiddenWidget.d.ts +7 -11
  41. package/dist/components/widgets/PasswordWidget.d.ts +6 -8
  42. package/dist/components/widgets/RadioWidget.d.ts +7 -21
  43. package/dist/components/widgets/RangeWidget.d.ts +7 -8
  44. package/dist/components/widgets/SelectWidget.d.ts +7 -23
  45. package/dist/components/widgets/TextWidget.d.ts +6 -9
  46. package/dist/components/widgets/TextareaWidget.d.ts +10 -22
  47. package/dist/components/widgets/URLWidget.d.ts +6 -8
  48. package/dist/components/widgets/UpDownWidget.d.ts +6 -8
  49. package/dist/components/widgets/index.d.ts +3 -43
  50. package/dist/core.cjs.development.js +2947 -4606
  51. package/dist/core.cjs.development.js.map +1 -1
  52. package/dist/core.cjs.production.min.js +1 -1
  53. package/dist/core.cjs.production.min.js.map +1 -1
  54. package/dist/core.esm.js +2897 -4566
  55. package/dist/core.esm.js.map +1 -1
  56. package/dist/core.umd.development.js +4049 -0
  57. package/dist/core.umd.development.js.map +1 -0
  58. package/dist/core.umd.production.min.js +2 -0
  59. package/dist/core.umd.production.min.js.map +1 -0
  60. package/dist/getDefaultRegistry.d.ts +6 -0
  61. package/dist/index.d.ts +5 -70
  62. package/dist/withTheme.d.ts +7 -9
  63. package/package.json +41 -68
  64. package/dist/components/AddButton.d.ts +0 -5
  65. package/dist/components/ErrorList.d.ts +0 -1
  66. package/dist/components/IconButton.d.ts +0 -1
  67. package/dist/components/fields/DescriptionField.d.ts +0 -9
  68. package/dist/components/fields/TitleField.d.ts +0 -10
  69. package/dist/components/fields/UnsupportedField.d.ts +0 -14
  70. package/dist/components/widgets/BaseInput.d.ts +0 -23
  71. package/dist/components/widgets/SubmitButton.d.ts +0 -3
  72. package/dist/defaultRegistry.d.ts +0 -41
  73. package/dist/react-jsonschema-form.js +0 -26
  74. package/dist/react-jsonschema-form.js.map +0 -1
  75. package/dist/types.d.ts +0 -50
  76. package/dist/utils.d.ts +0 -81
  77. package/dist/validate.d.ts +0 -21
  78. package/index.d.ts +0 -500
@@ -1,22 +1,73 @@
1
- export default ObjectField;
2
- declare class ObjectField extends React.Component<any, any, any> {
3
- static defaultProps: {
4
- uiSchema: {};
5
- formData: {};
6
- errorSchema: {};
7
- idSchema: {};
8
- required: boolean;
9
- disabled: boolean;
10
- readonly: boolean;
1
+ import { Component } from "react";
2
+ import { ErrorSchema, FieldProps, RJSFSchema } from "@rjsf/utils";
3
+ /** Type used for the state of the `ObjectField` component */
4
+ declare type ObjectFieldState = {
5
+ /** Flag indicating whether an additional property key was modified */
6
+ wasPropertyKeyModified: boolean;
7
+ /** The set of additional properties */
8
+ additionalProperties: object;
9
+ };
10
+ /** The `ObjectField` component is used to render a field in the schema that is of type `object`. It tracks whether an
11
+ * additional property key was modified and what it was modified to
12
+ *
13
+ * @param props - The `FieldProps` for this template
14
+ */
15
+ declare class ObjectField<T = any, F = any> extends Component<FieldProps<T, F>, ObjectFieldState> {
16
+ /** Set up the initial state */
17
+ state: {
18
+ wasPropertyKeyModified: boolean;
19
+ additionalProperties: {};
11
20
  };
12
- constructor(props: any);
13
- constructor(props: any, context: any);
14
- isRequired(name: any): boolean;
15
- onPropertyChange: (name: any, addedByAdditionalProperties?: boolean) => (value: any, errorSchema: any) => void;
16
- onDropPropertyClick: (key: any) => (event: any) => void;
17
- getAvailableKey: (preferredKey: any, formData: any) => any;
18
- onKeyChange: (oldValue: any) => (value: any, errorSchema: any) => void;
19
- getDefaultValue(type: any): {} | null;
20
- handleAddClick: (schema: any) => () => void;
21
+ /** Returns a flag indicating whether the `name` field is required in the object schema
22
+ *
23
+ * @param name - The name of the field to check for required-ness
24
+ * @returns - True if the field `name` is required, false otherwise
25
+ */
26
+ isRequired(name: string): boolean;
27
+ /** Returns the `onPropertyChange` handler for the `name` field. Handles the special case where a user is attempting
28
+ * to clear the data for a field added as an additional property. Calls the `onChange()` handler with the updated
29
+ * formData.
30
+ *
31
+ * @param name - The name of the property
32
+ * @param addedByAdditionalProperties - Flag indicating whether this property is an additional property
33
+ * @returns - The onPropertyChange callback for the `name` property
34
+ */
35
+ onPropertyChange: (name: string, addedByAdditionalProperties?: boolean) => (value: T, newErrorSchema?: ErrorSchema<T>) => void;
36
+ /** Returns a callback to handle the onDropPropertyClick event for the given `key` which removes the old `key` data
37
+ * and calls the `onChange` callback with it
38
+ *
39
+ * @param key - The key for which the drop callback is desired
40
+ * @returns - The drop property click callback
41
+ */
42
+ onDropPropertyClick: (key: string) => (event: DragEvent) => void;
43
+ /** Computes the next available key name from the `preferredKey`, indexing through the already existing keys until one
44
+ * that is already not assigned is found.
45
+ *
46
+ * @param preferredKey - The preferred name of a new key
47
+ * @param formData - The form data in which to check if the desired key already exists
48
+ * @returns - The name of the next available key from `preferredKey`
49
+ */
50
+ getAvailableKey: (preferredKey: string, formData: T) => string;
51
+ /** Returns a callback function that deals with the rename of a key for an additional property for a schema. That
52
+ * callback will attempt to rename the key and move the existing data to that key, calling `onChange` when it does.
53
+ *
54
+ * @param oldValue - The old value of a field
55
+ * @returns - The key change callback function
56
+ */
57
+ onKeyChange: (oldValue: any) => (value: any, newErrorSchema: ErrorSchema<T>) => void;
58
+ /** Returns a default value to be used for a new additional schema property of the given `type`
59
+ *
60
+ * @param type - The type of the new additional schema property
61
+ */
62
+ getDefaultValue(type?: RJSFSchema["type"]): {} | null;
63
+ /** Handles the adding of a new additional property on the given `schema`. Calls the `onChange` callback once the new
64
+ * default data for that field has been added to the formData.
65
+ *
66
+ * @param schema - The schema element to which the new property is being added
67
+ */
68
+ handleAddClick: (schema: RJSFSchema) => () => void;
69
+ /** Renders the `ObjectField` from the given props
70
+ */
71
+ render(): JSX.Element;
21
72
  }
22
- import React from "react";
73
+ export default ObjectField;
@@ -1,39 +1,10 @@
1
- export default SchemaField;
2
- declare class SchemaField extends React.Component<any, any, any> {
3
- constructor(props: any);
4
- constructor(props: any, context: any);
5
- }
6
- declare namespace SchemaField {
7
- export const defaultProps: {
8
- uiSchema: {};
9
- errorSchema: {};
10
- idSchema: {};
11
- disabled: boolean;
12
- readonly: boolean;
13
- autofocus: boolean;
14
- hideError: boolean;
15
- };
16
- export namespace propTypes {
17
- export const schema: PropTypes.Validator<object>;
18
- export const uiSchema: PropTypes.Requireable<object>;
19
- export const idSchema: PropTypes.Requireable<object>;
20
- export const formData: PropTypes.Requireable<any>;
21
- export const errorSchema: PropTypes.Requireable<object>;
22
- export const registry: PropTypes.Validator<PropTypes.InferProps<{
23
- ArrayFieldTemplate: PropTypes.Requireable<PropTypes.ReactComponentLike>;
24
- FieldTemplate: PropTypes.Requireable<PropTypes.ReactComponentLike>;
25
- ObjectFieldTemplate: PropTypes.Requireable<PropTypes.ReactComponentLike>;
26
- definitions: PropTypes.Validator<object>;
27
- rootSchema: PropTypes.Requireable<object>;
28
- fields: PropTypes.Validator<{
29
- [x: string]: string | ((props: any, context?: any) => any) | (new (props: any, context?: any) => any) | null | undefined;
30
- }>;
31
- formContext: PropTypes.Validator<object>;
32
- widgets: PropTypes.Validator<{
33
- [x: string]: object | null | undefined;
34
- }>;
35
- }>>;
36
- }
37
- }
38
1
  import React from "react";
39
- import PropTypes from "prop-types";
2
+ import { FieldProps } from "@rjsf/utils";
3
+ /** The `SchemaField` component determines whether it is necessary to rerender the component based on any props changes
4
+ * and if so, calls the `SchemaFieldRender` component with the props.
5
+ */
6
+ declare class SchemaField<T = any, F = any> extends React.Component<FieldProps<T, F>> {
7
+ shouldComponentUpdate(nextProps: Readonly<FieldProps<T, F>>): boolean;
8
+ render(): JSX.Element;
9
+ }
10
+ export default SchemaField;
@@ -1,45 +1,7 @@
1
+ import { FieldProps } from "@rjsf/utils";
2
+ /** The `StringField` component is used to render a schema field that represents a string type
3
+ *
4
+ * @param props - The `FieldProps` for this template
5
+ */
6
+ declare function StringField<T = any, F = any>(props: FieldProps<T, F>): JSX.Element;
1
7
  export default StringField;
2
- declare function StringField(props: any): JSX.Element;
3
- declare namespace StringField {
4
- export const propTypes: {
5
- autofocus: import("prop-types").Requireable<boolean>;
6
- disabled: import("prop-types").Requireable<boolean>;
7
- errorSchema: import("prop-types").Requireable<object>;
8
- formData: import("prop-types").Requireable<any>;
9
- idSchema: import("prop-types").Requireable<object>;
10
- onBlur: import("prop-types").Requireable<(...args: any[]) => any>;
11
- onChange: import("prop-types").Validator<(...args: any[]) => any>;
12
- onFocus: import("prop-types").Requireable<(...args: any[]) => any>;
13
- rawErrors: import("prop-types").Requireable<(string | null | undefined)[]>;
14
- readonly: import("prop-types").Requireable<boolean>;
15
- registry: import("prop-types").Validator<import("prop-types").InferProps<{
16
- ArrayFieldTemplate: import("prop-types").Requireable<import("prop-types").ReactComponentLike>;
17
- FieldTemplate: import("prop-types").Requireable<import("prop-types").ReactComponentLike>;
18
- ObjectFieldTemplate: import("prop-types").Requireable<import("prop-types").ReactComponentLike>;
19
- definitions: import("prop-types").Validator<object>;
20
- rootSchema: import("prop-types").Requireable<object>;
21
- fields: import("prop-types").Validator<{
22
- [x: string]: string | ((props: any, context?: any) => any) | (new (props: any, context?: any) => any) | null | undefined;
23
- }>;
24
- formContext: import("prop-types").Validator<object>;
25
- widgets: import("prop-types").Validator<{
26
- [x: string]: object | null | undefined;
27
- }>;
28
- }>>;
29
- required: import("prop-types").Requireable<boolean>;
30
- schema: import("prop-types").Validator<object>;
31
- uiSchema: import("prop-types").Requireable<import("prop-types").InferProps<{
32
- "ui:options": import("prop-types").Requireable<import("prop-types").InferProps<{
33
- addable: import("prop-types").Requireable<boolean>;
34
- orderable: import("prop-types").Requireable<boolean>;
35
- removable: import("prop-types").Requireable<boolean>;
36
- }>>;
37
- }>>;
38
- };
39
- export const defaultProps: {
40
- uiSchema: {};
41
- disabled: boolean;
42
- readonly: boolean;
43
- autofocus: boolean;
44
- };
45
- }
@@ -1,26 +1,3 @@
1
- declare namespace _default {
2
- export { MultiSchemaField as AnyOfField };
3
- export { ArrayField };
4
- export { BooleanField };
5
- export { DescriptionField };
6
- export { NumberField };
7
- export { ObjectField };
8
- export { MultiSchemaField as OneOfField };
9
- export { SchemaField };
10
- export { StringField };
11
- export { TitleField };
12
- export { NullField };
13
- export { UnsupportedField };
14
- }
15
- export default _default;
16
- import MultiSchemaField from "./MultiSchemaField";
17
- import ArrayField from "./ArrayField";
18
- import BooleanField from "./BooleanField";
19
- import DescriptionField from "./DescriptionField";
20
- import NumberField from "./NumberField";
21
- import ObjectField from "./ObjectField";
22
- import SchemaField from "./SchemaField";
23
- import StringField from "./StringField";
24
- import TitleField from "./TitleField";
25
- import NullField from "./NullField";
26
- import UnsupportedField from "./UnsupportedField";
1
+ import { RegistryFieldsType } from "@rjsf/utils";
2
+ declare const fields: RegistryFieldsType;
3
+ export default fields;
@@ -0,0 +1,7 @@
1
+ import { ArrayFieldDescriptionProps } from "@rjsf/utils";
2
+ /** The `ArrayFieldDescriptionTemplate` component renders a `DescriptionFieldTemplate` with an `id` derived from
3
+ * the `idSchema`.
4
+ *
5
+ * @param props - The `ArrayFieldDescriptionProps` for the component
6
+ */
7
+ export default function ArrayFieldDescriptionTemplate<T = any, F = any>(props: ArrayFieldDescriptionProps): JSX.Element | null;
@@ -0,0 +1,6 @@
1
+ import { ArrayFieldTemplateItemType } from "@rjsf/utils";
2
+ /** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
3
+ *
4
+ * @param props - The `ArrayFieldTemplateItemType` props for the component
5
+ */
6
+ export default function ArrayFieldItemTemplate<T = any, F = any>(props: ArrayFieldTemplateItemType<T, F>): JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { ArrayFieldTemplateProps } from "@rjsf/utils";
2
+ /** The `ArrayFieldTemplate` component is the template used to render all items in an array.
3
+ *
4
+ * @param props - The `ArrayFieldTemplateItemType` props for the component
5
+ */
6
+ export default function ArrayFieldTemplate<T = any, F = any>(props: ArrayFieldTemplateProps<T, F>): JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { ArrayFieldTitleProps } from "@rjsf/utils";
2
+ /** The `ArrayFieldTitleTemplate` component renders a `TitleFieldTemplate` with an `id` derived from
3
+ * the `idSchema`.
4
+ *
5
+ * @param props - The `ArrayFieldTitleProps` for the component
6
+ */
7
+ export default function ArrayFieldTitleTemplate<T = any, F = any>(props: ArrayFieldTitleProps): JSX.Element | null;
@@ -0,0 +1,8 @@
1
+ import { WidgetProps } from "@rjsf/utils";
2
+ /** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
3
+ * It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
4
+ * It can be customized/overridden for other themes or individual implementations as needed.
5
+ *
6
+ * @param props - The `WidgetProps` for this template
7
+ */
8
+ export default function BaseInputTemplate<T = any, F = any>(props: WidgetProps<T, F>): JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { IconButtonProps } from "@rjsf/utils";
2
+ /** The `AddButton` renders a button that represent the `Add` action on a form
3
+ */
4
+ export default function AddButton({ className, onClick, disabled, }: IconButtonProps): JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { IconButtonProps } from "@rjsf/utils";
2
+ export default function IconButton(props: IconButtonProps): JSX.Element;
3
+ export declare function MoveDownButton(props: IconButtonProps): JSX.Element;
4
+ export declare function MoveUpButton(props: IconButtonProps): JSX.Element;
5
+ export declare function RemoveButton(props: IconButtonProps): JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { SubmitButtonProps } from "@rjsf/utils";
2
+ /** The `SubmitButton` renders a button that represent the `Submit` action on a form
3
+ */
4
+ export default function SubmitButton<T, F>({ uiSchema, }: SubmitButtonProps<T, F>): JSX.Element | null;
@@ -0,0 +1,3 @@
1
+ import { TemplatesType } from "@rjsf/utils";
2
+ declare const buttonTemplates: TemplatesType["ButtonTemplates"];
3
+ export default buttonTemplates;
@@ -0,0 +1,6 @@
1
+ import { DescriptionFieldProps } from "@rjsf/utils";
2
+ /** The `DescriptionField` is the template to use to render the description of a field
3
+ *
4
+ * @param props - The `DescriptionFieldProps` for this component
5
+ */
6
+ export default function DescriptionField<T = any, F = any>(props: DescriptionFieldProps<T, F>): JSX.Element | null;
@@ -0,0 +1,6 @@
1
+ import { ErrorListProps } from "@rjsf/utils";
2
+ /** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
3
+ *
4
+ * @param props - The `ErrorListProps` for this component
5
+ */
6
+ export default function ErrorList<T = any>({ errors }: ErrorListProps<T>): JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { FieldTemplateProps } from "@rjsf/utils";
2
+ /** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field
3
+ * content, (label, description, children, errors and help) inside of a `WrapIfAdditional` component.
4
+ *
5
+ * @param props - The `FieldTemplateProps` for this component
6
+ */
7
+ export default function FieldTemplate<T = any, F = any>(props: FieldTemplateProps<T, F>): JSX.Element;
@@ -0,0 +1,13 @@
1
+ export declare type LabelProps = {
2
+ /** The label for the field */
3
+ label?: string;
4
+ /** A boolean value stating if the field is required */
5
+ required?: boolean;
6
+ /** The id of the input field being labeled */
7
+ id?: string;
8
+ };
9
+ /** Renders a label for a field
10
+ *
11
+ * @param props - The `LabelProps` for this component
12
+ */
13
+ export default function Label(props: LabelProps): JSX.Element | null;
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { FieldTemplateProps } from "@rjsf/utils";
3
+ /** The properties that are passed to a WrapIfAdditionalTemplate implementation */
4
+ export declare type WrapIfAdditionalProps<T = any, F = any> = {
5
+ children: React.ReactNode;
6
+ } & Pick<FieldTemplateProps<T, F>, "classNames" | "disabled" | "id" | "label" | "onDropPropertyClick" | "onKeyChange" | "readonly" | "required" | "schema" | "registry">;
7
+ /** The `WrapIfAdditional` component is used by the `FieldTemplate` to rename, or remove properties that are
8
+ * part of an `additionalProperties` part of a schema.
9
+ *
10
+ * @param props - The `WrapIfAdditionalProps` for this component
11
+ */
12
+ export default function WrapIfAdditional<T = any, F = any>(props: WrapIfAdditionalProps<T, F>): JSX.Element;
@@ -0,0 +1,2 @@
1
+ import FieldTemplate from "./FieldTemplate";
2
+ export default FieldTemplate;
@@ -0,0 +1,8 @@
1
+ import { ObjectFieldTemplateProps } from "@rjsf/utils";
2
+ /** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
3
+ * title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
4
+ * the properties.
5
+ *
6
+ * @param props - The `ObjectFieldTemplateProps` for this component
7
+ */
8
+ export default function ObjectFieldTemplate<T = any, F = any>(props: ObjectFieldTemplateProps<T, F>): JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { TitleFieldProps } from "@rjsf/utils";
2
+ /** The `TitleField` is the template to use to render the title of a field
3
+ *
4
+ * @param props - The `TitleFieldProps` for this component
5
+ */
6
+ export default function TitleField<T = any, F = any>(props: TitleFieldProps<T, F>): JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { UnsupportedFieldProps } from "@rjsf/utils";
2
+ /** The `UnsupportedField` component is used to render a field in the schema is one that is not supported by
3
+ * react-jsonschema-form.
4
+ *
5
+ * @param props - The `FieldProps` for this template
6
+ */
7
+ declare function UnsupportedField<T = any, F = any>(props: UnsupportedFieldProps<T, F>): JSX.Element;
8
+ export default UnsupportedField;
@@ -0,0 +1,3 @@
1
+ import { TemplatesType } from "@rjsf/utils";
2
+ declare const templates: TemplatesType;
3
+ export default templates;
@@ -1,22 +1,8 @@
1
+ import { WidgetProps } from "@rjsf/utils";
2
+ /** The `AltDateTimeWidget` is an alternative widget for rendering datetime properties.
3
+ * It uses the AltDateWidget for rendering, with the `time` prop set to true by default.
4
+ *
5
+ * @param props - The `WidgetProps` for this component
6
+ */
7
+ declare function AltDateTimeWidget<T = any, F = any>({ time, ...props }: WidgetProps<T, F>): JSX.Element;
1
8
  export default AltDateTimeWidget;
2
- declare function AltDateTimeWidget(props: any): JSX.Element;
3
- declare namespace AltDateTimeWidget {
4
- export namespace propTypes {
5
- export const schema: PropTypes.Validator<object>;
6
- export const id: PropTypes.Validator<string>;
7
- export const value: PropTypes.Requireable<string>;
8
- export const required: PropTypes.Requireable<boolean>;
9
- export const onChange: PropTypes.Requireable<(...args: any[]) => any>;
10
- export const options: PropTypes.Requireable<object>;
11
- }
12
- export const defaultProps: {
13
- time: boolean;
14
- disabled: boolean;
15
- readonly: boolean;
16
- autofocus: boolean;
17
- options: {
18
- yearsRange: number[];
19
- };
20
- };
21
- }
22
- import PropTypes from "prop-types";
@@ -1,22 +1,6 @@
1
+ import { WidgetProps } from "@rjsf/utils";
2
+ /** The `AltDateWidget` is an alternative widget for rendering date properties.
3
+ * @param props - The `WidgetProps` for this component
4
+ */
5
+ declare function AltDateWidget<T = any, F = any>({ time, disabled, readonly, autofocus, options, id, registry, onBlur, onFocus, onChange, value, }: WidgetProps<T, F>): JSX.Element;
1
6
  export default AltDateWidget;
2
- declare class AltDateWidget extends React.Component<any, any, any> {
3
- static defaultProps: {
4
- time: boolean;
5
- disabled: boolean;
6
- readonly: boolean;
7
- autofocus: boolean;
8
- options: {
9
- yearsRange: number[];
10
- };
11
- };
12
- constructor(props: any);
13
- onChange: (property: any, value: any) => void;
14
- setNow: (event: any) => void;
15
- clear: (event: any) => void;
16
- get dateElementProps(): {
17
- type: string;
18
- range: any;
19
- value: number;
20
- }[];
21
- }
22
- import React from "react";
@@ -1,18 +1,8 @@
1
+ import { WidgetProps } from "@rjsf/utils";
2
+ /** The `CheckBoxWidget` is a widget for rendering boolean properties.
3
+ * It is typically used to represent a boolean.
4
+ *
5
+ * @param props - The `WidgetProps` for this component
6
+ */
7
+ declare function CheckboxWidget<T = any, F = any>({ schema, options, id, value, disabled, readonly, label, autofocus, onBlur, onFocus, onChange, registry, }: WidgetProps<T, F>): JSX.Element;
1
8
  export default CheckboxWidget;
2
- declare function CheckboxWidget(props: any): JSX.Element;
3
- declare namespace CheckboxWidget {
4
- export namespace defaultProps {
5
- export const autofocus: boolean;
6
- }
7
- export const propTypes: {
8
- schema: PropTypes.Validator<object>;
9
- id: PropTypes.Validator<string>;
10
- value: PropTypes.Requireable<boolean>;
11
- required: PropTypes.Requireable<boolean>;
12
- disabled: PropTypes.Requireable<boolean>;
13
- readonly: PropTypes.Requireable<boolean>;
14
- autofocus: PropTypes.Requireable<boolean>;
15
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
16
- };
17
- }
18
- import PropTypes from "prop-types";
@@ -1,26 +1,8 @@
1
+ import { WidgetProps } from "@rjsf/utils";
2
+ /** The `CheckboxesWidget` is a widget for rendering checkbox groups.
3
+ * It is typically used to represent an array of enums.
4
+ *
5
+ * @param props - The `WidgetProps` for this component
6
+ */
7
+ declare function CheckboxesWidget<T = any, F = any>({ id, disabled, options: { inline, enumOptions, enumDisabled }, value, autofocus, readonly, onChange, }: WidgetProps<T, F>): JSX.Element;
1
8
  export default CheckboxesWidget;
2
- declare function CheckboxesWidget(props: any): JSX.Element;
3
- declare namespace CheckboxesWidget {
4
- export namespace defaultProps {
5
- export const autofocus: boolean;
6
- export namespace options {
7
- export const inline: boolean;
8
- }
9
- }
10
- export const propTypes: {
11
- schema: PropTypes.Validator<object>;
12
- id: PropTypes.Validator<string>;
13
- options: PropTypes.Validator<PropTypes.InferProps<{
14
- enumOptions: PropTypes.Requireable<any[]>;
15
- inline: PropTypes.Requireable<boolean>;
16
- }>>;
17
- value: PropTypes.Requireable<any>;
18
- required: PropTypes.Requireable<boolean>;
19
- readonly: PropTypes.Requireable<boolean>;
20
- disabled: PropTypes.Requireable<boolean>;
21
- multiple: PropTypes.Requireable<boolean>;
22
- autofocus: PropTypes.Requireable<boolean>;
23
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
24
- };
25
- }
26
- import PropTypes from "prop-types";
@@ -1,15 +1,7 @@
1
- export default ColorWidget;
2
- declare function ColorWidget(props: any): JSX.Element;
3
- declare namespace ColorWidget {
4
- export const propTypes: {
5
- schema: PropTypes.Validator<object>;
6
- id: PropTypes.Validator<string>;
7
- value: PropTypes.Requireable<string>;
8
- required: PropTypes.Requireable<boolean>;
9
- disabled: PropTypes.Requireable<boolean>;
10
- readonly: PropTypes.Requireable<boolean>;
11
- autofocus: PropTypes.Requireable<boolean>;
12
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
13
- };
14
- }
15
- import PropTypes from "prop-types";
1
+ import { WidgetProps } from "@rjsf/utils";
2
+ /** The `ColorWidget` component uses the `BaseInputTemplate` changing the type to `color` and disables it when it is
3
+ * either disabled or readonly.
4
+ *
5
+ * @param props - The `WidgetProps` for this component
6
+ */
7
+ export default function ColorWidget<T = any, F = any>(props: WidgetProps<T, F>): JSX.Element;
@@ -1,8 +1,7 @@
1
- export default DateTimeWidget;
2
- declare function DateTimeWidget(props: any): JSX.Element;
3
- declare namespace DateTimeWidget {
4
- export namespace propTypes {
5
- export const value: PropTypes.Requireable<string>;
6
- }
7
- }
8
- import PropTypes from "prop-types";
1
+ import { WidgetProps } from "@rjsf/utils";
2
+ /** The `DateTimeWidget` component uses the `BaseInputTemplate` changing the type to `datetime-local` and transforms
3
+ * the value to/from utc using the appropriate utility functions.
4
+ *
5
+ * @param props - The `WidgetProps` for this component
6
+ */
7
+ export default function DateTimeWidget<T = any, F = any>(props: WidgetProps<T, F>): JSX.Element;
@@ -1,8 +1,7 @@
1
- export default DateWidget;
2
- declare function DateWidget(props: any): JSX.Element;
3
- declare namespace DateWidget {
4
- export namespace propTypes {
5
- export const value: PropTypes.Requireable<string>;
6
- }
7
- }
8
- import PropTypes from "prop-types";
1
+ import { WidgetProps } from "@rjsf/utils";
2
+ /** The `DateWidget` component uses the `BaseInputTemplate` changing the type to `date` and transforms
3
+ * the value to undefined when it is falsy during the `onChange` handling.
4
+ *
5
+ * @param props - The `WidgetProps` for this component
6
+ */
7
+ export default function DateWidget<T = any, F = any>(props: WidgetProps<T, F>): JSX.Element;
@@ -1,8 +1,6 @@
1
- export default EmailWidget;
2
- declare function EmailWidget(props: any): JSX.Element;
3
- declare namespace EmailWidget {
4
- export namespace propTypes {
5
- export const value: PropTypes.Requireable<string>;
6
- }
7
- }
8
- import PropTypes from "prop-types";
1
+ import { WidgetProps } from "@rjsf/utils";
2
+ /** The `EmailWidget` component uses the `BaseInputTemplate` changing the type to `email`.
3
+ *
4
+ * @param props - The `WidgetProps` for this component
5
+ */
6
+ export default function EmailWidget<T = any, F = any>(props: WidgetProps<T, F>): JSX.Element;
@@ -1,19 +1,7 @@
1
+ import { WidgetProps } from "@rjsf/utils";
2
+ /**
3
+ * The `FileWidget` is a widget for rendering file upload fields.
4
+ * It is typically used with a string property with data-url format.
5
+ */
6
+ declare function FileWidget<T, F>({ multiple, id, readonly, disabled, onChange, value, autofocus, options, }: WidgetProps<T, F>): JSX.Element;
1
7
  export default FileWidget;
2
- declare class FileWidget extends React.Component<any, any, any> {
3
- constructor(props: any);
4
- onChange: (event: any) => void;
5
- inputRef: HTMLInputElement | null | undefined;
6
- }
7
- declare namespace FileWidget {
8
- export namespace defaultProps {
9
- export const autofocus: boolean;
10
- }
11
- export namespace propTypes {
12
- export const multiple: PropTypes.Requireable<boolean>;
13
- export const value: PropTypes.Requireable<string | (string | null | undefined)[]>;
14
- const autofocus_1: PropTypes.Requireable<boolean>;
15
- export { autofocus_1 as autofocus };
16
- }
17
- }
18
- import React from "react";
19
- import PropTypes from "prop-types";
@@ -1,12 +1,8 @@
1
+ import { WidgetProps } from "@rjsf/utils";
2
+ /** The `HiddenWidget` is a widget for rendering a hidden input field.
3
+ * It is typically used by setting type to "hidden".
4
+ *
5
+ * @param props - The `WidgetProps` for this component
6
+ */
7
+ declare function HiddenWidget<T = any, F = any>({ id, value }: WidgetProps<T, F>): JSX.Element;
1
8
  export default HiddenWidget;
2
- declare function HiddenWidget({ id, value }: {
3
- id: any;
4
- value: any;
5
- }): JSX.Element;
6
- declare namespace HiddenWidget {
7
- export namespace propTypes {
8
- export const id: PropTypes.Validator<string>;
9
- export const value: PropTypes.Requireable<string | number | boolean>;
10
- }
11
- }
12
- import PropTypes from "prop-types";