@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.
Files changed (76) 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 +40 -69
  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/types.d.ts +0 -50
  74. package/dist/utils.d.ts +0 -81
  75. package/dist/validate.d.ts +0 -21
  76. package/index.d.ts +0 -500
package/dist/index.d.ts CHANGED
@@ -1,71 +1,6 @@
1
+ import Form, { FormProps, FormState, IChangeEvent } from "./components/Form";
2
+ import withTheme, { WithThemeProps } from "./withTheme";
3
+ import getDefaultRegistry from "./getDefaultRegistry";
4
+ export type { FormProps, FormState, IChangeEvent, WithThemeProps };
5
+ export { withTheme, getDefaultRegistry };
1
6
  export default Form;
2
- import withTheme from "./withTheme";
3
- export const utils: {
4
- getDefaultRegistry: typeof getDefaultRegistry;
5
- canExpand(schema: any, uiSchema: any, formData: any): any;
6
- getSchemaType(schema: any): any;
7
- getWidget(schema: any, widget: any, registeredWidgets?: {}): any;
8
- hasWidget(schema: any, widget: any, registeredWidgets?: {}): boolean;
9
- getDefaultFormState(_schema: any, formData: any, rootSchema?: {}, includeUndefinedValues?: boolean): any;
10
- mergeDefaultsWithFormData(defaults: any, formData: any): any;
11
- getUiOptions(uiSchema: any): {};
12
- getSubmitButtonOptions(uiSchema: any): any;
13
- getDisplayLabel(schema: any, uiSchema: any, rootSchema: any): any;
14
- isObject(thing: any): boolean;
15
- mergeObjects(obj1: any, obj2: any, concatArrays?: boolean): any;
16
- asNumber(value: any): any;
17
- orderProperties(properties: any, order: any): any;
18
- isConstant(schema: any): any;
19
- toConstant(schema: any): any;
20
- isSelect(_schema: any, rootSchema?: {}): boolean;
21
- isMultiSelect(schema: any, rootSchema?: {}): boolean;
22
- isFilesArray(schema: any, uiSchema: any, rootSchema?: {}): boolean;
23
- isFixedItems(schema: any): any;
24
- isCustomWidget(uiSchema: any): boolean;
25
- allowAdditionalItems(schema: any): boolean;
26
- optionsList(schema: any): any;
27
- findSchemaDefinition($ref: any, rootSchema?: {}): any;
28
- stubExistingAdditionalProperties(schema: any, rootSchema?: {}, formData?: {}): any;
29
- resolveSchema(schema: any, rootSchema?: {}, formData?: {}): any;
30
- retrieveSchema(schema: any, rootSchema?: {}, formData?: {}): any;
31
- mergeSchemas(obj1: any, obj2: any): any;
32
- deepEquals(a: any, b: any, ca?: any[], cb?: any[]): any;
33
- shouldRender(comp: any, nextProps: any, nextState: any): boolean;
34
- toIdSchema(schema: any, id: any, rootSchema: any, formData?: {}, idPrefix?: string, idSeparator?: string): any;
35
- toPathSchema(schema: any, name: string | undefined, rootSchema: any, formData?: {}): any;
36
- parseDateString(dateString: any, includeTime?: boolean): {
37
- year: number;
38
- month: number;
39
- day: number;
40
- hour: number;
41
- minute: number;
42
- second: number;
43
- };
44
- toDateString({ year, month, day, hour, minute, second }: {
45
- year: any;
46
- month: any;
47
- day: any;
48
- hour?: number | undefined;
49
- minute?: number | undefined;
50
- second?: number | undefined;
51
- }, time?: boolean): string;
52
- utcToLocal(jsonDate: any): string;
53
- localToUTC(dateString: any): string | undefined;
54
- pad(num: any, size: any): string;
55
- dataURItoBlob(dataURI: any): {
56
- blob: Blob;
57
- name: any;
58
- };
59
- rangeSpec(schema: any): {
60
- step: any;
61
- min: any;
62
- max: any;
63
- };
64
- getMatchingOption(formData: any, options: any, rootSchema: any): number;
65
- schemaRequiresTrueValue(schema: any): any;
66
- ADDITIONAL_PROPERTY_FLAG: "__additional_property";
67
- guessType: (value: any) => "array" | "string" | "null" | "boolean" | "number" | "object";
68
- };
69
- import Form from "./components/Form";
70
- import { getDefaultRegistry } from "./defaultRegistry";
71
- export { withTheme };
@@ -1,10 +1,8 @@
1
- export default withTheme;
2
- declare function withTheme(themeProps: any): React.ForwardRefExoticComponent<React.RefAttributes<any>>;
3
- declare namespace withTheme {
4
- export namespace propTypes {
5
- export const widgets: PropTypes.Requireable<object>;
6
- export const fields: PropTypes.Requireable<object>;
7
- }
8
- }
9
1
  import React from "react";
10
- import PropTypes from "prop-types";
2
+ import Form, { FormProps } from "./components/Form";
3
+ /** The properties for the `withTheme` function, essentially a subset of properties from the `FormProps` that can be
4
+ * overridden while creating a theme
5
+ */
6
+ export declare type WithThemeProps<T = any, F = any> = Pick<FormProps<T, F>, "fields" | "templates" | "widgets" | "_internalFormWrapper">;
7
+ /** A Higher-Order component that creates a wrapper around a `Form` with the overrides from the `WithThemeProps` */
8
+ export default function withTheme<T = any, F = any>(themeProps: WithThemeProps<T, F>): React.ForwardRefExoticComponent<FormProps<T, F> & React.RefAttributes<Form<T, F>>>;
package/package.json CHANGED
@@ -1,105 +1,73 @@
1
1
  {
2
2
  "name": "@rjsf/core",
3
- "version": "4.2.1",
3
+ "version": "5.0.0-beta.1",
4
4
  "description": "A simple React component capable of building HTML forms out of a JSON schema.",
5
5
  "scripts": {
6
- "build": "rimraf dist && tsdx build --format cjs,es && cross-env NODE_ENV=production BABEL_ENV=umd webpack --config webpack.config.dist.js",
7
- "cs-check": "prettier -l \"{src,test}/**/*.js\"",
8
- "cs-format": "prettier \"{src,test}/**/*.js\" --write",
6
+ "build": "rimraf dist && dts build --format cjs,esm,umd",
7
+ "cs-check": "prettier -l \"{src,test}/**/*.[jt]s?(x)\"",
8
+ "cs-format": "prettier \"{src,test}/**/*.[jt]s?(x)\" --write",
9
9
  "lint": "eslint src test",
10
10
  "precommit": "lint-staged",
11
11
  "publish-to-npm": "npm run build && npm publish",
12
- "start": "tsdx watch",
13
- "test": "tsdx test",
14
- "test:watch": "tsdx test --watch",
15
- "test:update": "tsdx test --u",
16
- "test-old": "cross-env BABEL_ENV=test NODE_ENV=test mocha --require @babel/register --require ./test/setup-jsdom.js test/**/*_test.js",
17
- "test-coverage": "tsdx test --coverage"
12
+ "start": "dts watch",
13
+ "test": "dts test",
14
+ "test:watch": "dts test --watch",
15
+ "test-coverage": "dts test --coverage"
18
16
  },
19
17
  "lint-staged": {
20
- "{src,test}/**/*.js": [
18
+ "{src,test}/**/*.[jt]s?(x)": [
21
19
  "eslint --fix",
22
20
  "prettier --write"
23
21
  ]
24
22
  },
25
23
  "main": "dist/index.js",
26
24
  "module": "dist/core.esm.js",
27
- "typings": "index.d.ts",
25
+ "typings": "dist/index.d.ts",
28
26
  "files": [
29
27
  "dist",
30
- "lib",
31
- "index.d.ts"
28
+ "lib"
32
29
  ],
33
30
  "engineStrict": false,
34
31
  "engines": {
35
- "node": ">=12"
32
+ "node": ">=14"
36
33
  },
37
34
  "peerDependencies": {
38
- "react": ">=16 || >=17"
35
+ "react": "^16.14.0 || >=17"
39
36
  },
40
37
  "dependencies": {
41
- "@types/json-schema": "^7.0.7",
42
- "ajv": "^6.7.0",
43
- "core-js-pure": "^3.6.5",
44
- "json-schema-merge-allof": "^0.6.0",
45
- "jsonpointer": "^5.0.0",
46
38
  "lodash": "^4.17.15",
47
39
  "lodash-es": "^4.17.15",
48
- "nanoid": "^3.1.23",
49
- "prop-types": "^15.7.2",
50
- "react-is": "16.9.0"
40
+ "nanoid": "^3.3.4",
41
+ "prop-types": "^15.7.2"
51
42
  },
52
43
  "devDependencies": {
53
- "@babel/cli": "^7.4.4",
54
- "@babel/core": "^7.4.5",
55
- "@babel/plugin-proposal-class-properties": "^7.4.4",
56
- "@babel/plugin-proposal-optional-chaining": "^7.8.3",
57
- "@babel/plugin-transform-object-assign": "^7.8.3",
58
- "@babel/plugin-transform-react-jsx": "^7.3.0",
59
- "@babel/preset-env": "^7.4.5",
60
- "@babel/preset-react": "^7.0.0",
61
- "@babel/register": "^7.4.4",
44
+ "@babel/cli": "^7.18.10",
45
+ "@babel/core": "^7.18.13",
46
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
47
+ "@babel/plugin-proposal-optional-chaining": "^7.18.9",
48
+ "@babel/plugin-transform-object-assign": "^7.18.6",
49
+ "@babel/plugin-transform-react-jsx": "^7.18.10",
50
+ "@babel/preset-env": "^7.18.10",
51
+ "@babel/preset-react": "^7.18.6",
52
+ "@babel/register": "^7.18.9",
53
+ "@rjsf/utils": "^5.0.0-beta.1",
54
+ "@rjsf/validator-ajv6": "^5.0.0-beta.1",
55
+ "@types/lodash": "^4.14.184",
62
56
  "@types/react": "^17.0.39",
63
57
  "@types/react-dom": "^17.0.11",
64
- "@typescript-eslint/eslint-plugin": "^5.18.0",
65
- "@typescript-eslint/parser": "^5.18.0",
66
- "atob": "^2.0.3",
67
- "babel-loader": "^8.0.6",
58
+ "ajv": "^6.7.0",
59
+ "atob": "^2.1.2",
68
60
  "chai": "^3.3.0",
69
- "concurrently": "^5.1.0",
70
- "cross-env": "^7.0.2",
71
- "css-loader": "^0.23.1",
72
- "eslint": "^8.13.0",
73
- "eslint-plugin-flowtype": "^8.0.3",
74
- "eslint-plugin-import": "^2.26.0",
75
- "eslint-plugin-jsx-a11y": "^6.5.1",
76
- "eslint-plugin-react": "^7.29.4",
77
- "estraverse": "^4.2.0",
78
- "estraverse-fb": "^1.3.1",
79
- "express": "^4.14.0",
80
- "gh-pages": "^0.11.0",
61
+ "dts-cli": "^1.6.0",
62
+ "eslint": "^8.23.0",
81
63
  "html": "^1.0.0",
82
- "husky": "^0.13.2",
83
64
  "jsdom": "^16.5.3",
84
- "json-loader": "^0.5.7",
85
- "lint-staged": "^10.1.3",
86
- "loader-utils": "^1.2.3",
87
- "mini-css-extract-plugin": "^0.4.3",
88
65
  "mocha": "^5.2.0",
89
- "nyc": "^13.2.0",
90
- "prettier": "^1.15.1",
91
- "react": "^16.9.0",
92
- "react-dom": "^16.9.0",
93
- "react-portal": "^4.2.0",
94
- "react-transform-catch-errors": "^1.0.0",
95
- "react-transform-hmr": "^1.0.1",
96
- "redbox-react": "^1.3.3",
97
- "rimraf": "^2.5.4",
98
- "sinon": "^9.0.2",
99
- "style-loader": "^2.0.0",
100
- "webpack-cli": "^3.1.2",
101
- "webpack-dev-middleware": "^3.4.0",
102
- "webpack-hot-middleware": "^2.13.2"
66
+ "react": "^17.0.2",
67
+ "react-dom": "^17.0.2",
68
+ "react-portal": "^4.2.2",
69
+ "rimraf": "^3.0.2",
70
+ "sinon": "^9.0.2"
103
71
  },
104
72
  "directories": {
105
73
  "test": "test"
@@ -109,6 +77,9 @@
109
77
  "url": "git+https://github.com/rjsf-team/react-jsonschema-form.git"
110
78
  },
111
79
  "author": "Nicolas Perriault <nperriault@mozilla.com>",
80
+ "contributors": [
81
+ "Heath Chiavettone <heath.chiavettone@freenome.com"
82
+ ],
112
83
  "keywords": [
113
84
  "react",
114
85
  "form",
@@ -119,5 +90,5 @@
119
90
  "publishConfig": {
120
91
  "access": "public"
121
92
  },
122
- "gitHead": "d355518abef3706fdb4e9ff9ffe51efb4af73438"
93
+ "gitHead": "8fb173c73c5a2edfb1619d2a0f6bc1298c5b07ff"
123
94
  }
@@ -1,5 +0,0 @@
1
- export default function AddButton({ className, onClick, disabled }: {
2
- className: any;
3
- onClick: any;
4
- disabled: any;
5
- }): JSX.Element;
@@ -1 +0,0 @@
1
- export default function ErrorList(props: any): JSX.Element;
@@ -1 +0,0 @@
1
- export default function IconButton(props: any): JSX.Element;
@@ -1,9 +0,0 @@
1
- export default DescriptionField;
2
- declare function DescriptionField(props: any): JSX.Element | null;
3
- declare namespace DescriptionField {
4
- export namespace propTypes {
5
- export const id: PropTypes.Requireable<string>;
6
- export const description: PropTypes.Requireable<string | PropTypes.ReactElementLike>;
7
- }
8
- }
9
- import PropTypes from "prop-types";
@@ -1,10 +0,0 @@
1
- export default TitleField;
2
- declare function TitleField(props: any): JSX.Element;
3
- declare namespace TitleField {
4
- export namespace propTypes {
5
- export const id: PropTypes.Requireable<string>;
6
- export const title: PropTypes.Requireable<string>;
7
- export const required: PropTypes.Requireable<boolean>;
8
- }
9
- }
10
- import PropTypes from "prop-types";
@@ -1,14 +0,0 @@
1
- export default UnsupportedField;
2
- declare function UnsupportedField({ schema, idSchema, reason }: {
3
- schema: any;
4
- idSchema: any;
5
- reason: any;
6
- }): JSX.Element;
7
- declare namespace UnsupportedField {
8
- export namespace propTypes {
9
- export const schema: PropTypes.Validator<object>;
10
- export const idSchema: PropTypes.Requireable<object>;
11
- export const reason: PropTypes.Requireable<string>;
12
- }
13
- }
14
- import PropTypes from "prop-types";
@@ -1,23 +0,0 @@
1
- export default BaseInput;
2
- declare function BaseInput(props: any): (JSX.Element | null)[];
3
- declare namespace BaseInput {
4
- export const defaultProps: {
5
- required: boolean;
6
- disabled: boolean;
7
- readonly: boolean;
8
- autofocus: boolean;
9
- };
10
- export const propTypes: {
11
- id: PropTypes.Validator<string>;
12
- placeholder: PropTypes.Requireable<string>;
13
- value: PropTypes.Requireable<any>;
14
- required: PropTypes.Requireable<boolean>;
15
- disabled: PropTypes.Requireable<boolean>;
16
- readonly: PropTypes.Requireable<boolean>;
17
- autofocus: PropTypes.Requireable<boolean>;
18
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
19
- onBlur: PropTypes.Requireable<(...args: any[]) => any>;
20
- onFocus: PropTypes.Requireable<(...args: any[]) => any>;
21
- };
22
- }
23
- import PropTypes from "prop-types";
@@ -1,3 +0,0 @@
1
- export default function SubmitButton({ uiSchema }: {
2
- uiSchema: any;
3
- }): JSX.Element;
@@ -1,41 +0,0 @@
1
- export function getDefaultRegistry(): {
2
- fields: {
3
- AnyOfField: typeof import("./components/fields/MultiSchemaField").default;
4
- ArrayField: typeof import("./components/fields/ArrayField").default;
5
- BooleanField: typeof import("./components/fields/BooleanField").default;
6
- DescriptionField: typeof import("./components/fields/DescriptionField").default;
7
- NumberField: typeof import("./components/fields/NumberField").default;
8
- ObjectField: typeof import("./components/fields/ObjectField").default;
9
- OneOfField: typeof import("./components/fields/MultiSchemaField").default;
10
- SchemaField: typeof import("./components/fields/SchemaField").default;
11
- StringField: typeof import("./components/fields/StringField").default;
12
- TitleField: typeof import("./components/fields/TitleField").default;
13
- NullField: typeof import("./components/fields/NullField").default;
14
- UnsupportedField: typeof import("./components/fields/UnsupportedField").default;
15
- };
16
- widgets: {
17
- BaseInput: typeof import("./components/widgets/BaseInput").default;
18
- PasswordWidget: typeof import("./components/widgets/PasswordWidget").default;
19
- RadioWidget: typeof import("./components/widgets/RadioWidget").default;
20
- UpDownWidget: typeof import("./components/widgets/UpDownWidget").default;
21
- RangeWidget: typeof import("./components/widgets/RangeWidget").default;
22
- SelectWidget: typeof import("./components/widgets/SelectWidget").default;
23
- TextWidget: typeof import("./components/widgets/TextWidget").default;
24
- DateWidget: typeof import("./components/widgets/DateWidget").default;
25
- DateTimeWidget: typeof import("./components/widgets/DateTimeWidget").default;
26
- AltDateWidget: typeof import("./components/widgets/AltDateWidget").default;
27
- AltDateTimeWidget: typeof import("./components/widgets/AltDateTimeWidget").default;
28
- EmailWidget: typeof import("./components/widgets/EmailWidget").default;
29
- URLWidget: typeof import("./components/widgets/URLWidget").default;
30
- TextareaWidget: typeof import("./components/widgets/TextareaWidget").default;
31
- HiddenWidget: typeof import("./components/widgets/HiddenWidget").default;
32
- ColorWidget: typeof import("./components/widgets/ColorWidget").default;
33
- FileWidget: typeof import("./components/widgets/FileWidget").default;
34
- CheckboxWidget: typeof import("./components/widgets/CheckboxWidget").default;
35
- CheckboxesWidget: typeof import("./components/widgets/CheckboxesWidget").default;
36
- SubmitButton: typeof import("./components/widgets/SubmitButton").default;
37
- };
38
- definitions: {};
39
- rootSchema: {};
40
- formContext: {};
41
- };
package/dist/types.d.ts DELETED
@@ -1,50 +0,0 @@
1
- export const registry: PropTypes.Requireable<PropTypes.InferProps<{
2
- ArrayFieldTemplate: PropTypes.Requireable<PropTypes.ReactComponentLike>;
3
- FieldTemplate: PropTypes.Requireable<PropTypes.ReactComponentLike>;
4
- ObjectFieldTemplate: PropTypes.Requireable<PropTypes.ReactComponentLike>;
5
- definitions: PropTypes.Validator<object>;
6
- rootSchema: PropTypes.Requireable<object>;
7
- fields: PropTypes.Validator<{
8
- [x: string]: string | ((props: any, context?: any) => any) | (new (props: any, context?: any) => any) | null | undefined;
9
- }>;
10
- formContext: PropTypes.Validator<object>;
11
- widgets: PropTypes.Validator<{
12
- [x: string]: object | null | undefined;
13
- }>;
14
- }>>;
15
- export const fieldProps: {
16
- autofocus: PropTypes.Requireable<boolean>;
17
- disabled: PropTypes.Requireable<boolean>;
18
- errorSchema: PropTypes.Requireable<object>;
19
- formData: PropTypes.Requireable<any>;
20
- idSchema: PropTypes.Requireable<object>;
21
- onBlur: PropTypes.Requireable<(...args: any[]) => any>;
22
- onChange: PropTypes.Validator<(...args: any[]) => any>;
23
- onFocus: PropTypes.Requireable<(...args: any[]) => any>;
24
- rawErrors: PropTypes.Requireable<(string | null | undefined)[]>;
25
- readonly: PropTypes.Requireable<boolean>;
26
- registry: PropTypes.Validator<PropTypes.InferProps<{
27
- ArrayFieldTemplate: PropTypes.Requireable<PropTypes.ReactComponentLike>;
28
- FieldTemplate: PropTypes.Requireable<PropTypes.ReactComponentLike>;
29
- ObjectFieldTemplate: PropTypes.Requireable<PropTypes.ReactComponentLike>;
30
- definitions: PropTypes.Validator<object>;
31
- rootSchema: PropTypes.Requireable<object>;
32
- fields: PropTypes.Validator<{
33
- [x: string]: string | ((props: any, context?: any) => any) | (new (props: any, context?: any) => any) | null | undefined;
34
- }>;
35
- formContext: PropTypes.Validator<object>;
36
- widgets: PropTypes.Validator<{
37
- [x: string]: object | null | undefined;
38
- }>;
39
- }>>;
40
- required: PropTypes.Requireable<boolean>;
41
- schema: PropTypes.Validator<object>;
42
- uiSchema: PropTypes.Requireable<PropTypes.InferProps<{
43
- "ui:options": PropTypes.Requireable<PropTypes.InferProps<{
44
- addable: PropTypes.Requireable<boolean>;
45
- orderable: PropTypes.Requireable<boolean>;
46
- removable: PropTypes.Requireable<boolean>;
47
- }>>;
48
- }>>;
49
- };
50
- import PropTypes from "prop-types";
package/dist/utils.d.ts DELETED
@@ -1,81 +0,0 @@
1
- export function canExpand(schema: any, uiSchema: any, formData: any): any;
2
- export function getSchemaType(schema: any): any;
3
- export function getWidget(schema: any, widget: any, registeredWidgets?: {}): any;
4
- export function hasWidget(schema: any, widget: any, registeredWidgets?: {}): boolean;
5
- export function getDefaultFormState(_schema: any, formData: any, rootSchema?: {}, includeUndefinedValues?: boolean): any;
6
- /**
7
- * When merging defaults and form data, we want to merge in this specific way:
8
- * - objects are deeply merged
9
- * - arrays are merged in such a way that:
10
- * - when the array is set in form data, only array entries set in form data
11
- * are deeply merged; additional entries from the defaults are ignored
12
- * - when the array is not set in form data, the default is copied over
13
- * - scalars are overwritten/set by form data
14
- */
15
- export function mergeDefaultsWithFormData(defaults: any, formData: any): any;
16
- export function getUiOptions(uiSchema: any): {};
17
- export function getSubmitButtonOptions(uiSchema: any): any;
18
- export function getDisplayLabel(schema: any, uiSchema: any, rootSchema: any): any;
19
- export function isObject(thing: any): boolean;
20
- export function mergeObjects(obj1: any, obj2: any, concatArrays?: boolean): any;
21
- export function asNumber(value: any): any;
22
- export function orderProperties(properties: any, order: any): any;
23
- /**
24
- * This function checks if the given schema matches a single
25
- * constant value.
26
- */
27
- export function isConstant(schema: any): any;
28
- export function toConstant(schema: any): any;
29
- export function isSelect(_schema: any, rootSchema?: {}): boolean;
30
- export function isMultiSelect(schema: any, rootSchema?: {}): boolean;
31
- export function isFilesArray(schema: any, uiSchema: any, rootSchema?: {}): boolean;
32
- export function isFixedItems(schema: any): any;
33
- export function isCustomWidget(uiSchema: any): boolean;
34
- export function allowAdditionalItems(schema: any): boolean;
35
- export function optionsList(schema: any): any;
36
- export function findSchemaDefinition($ref: any, rootSchema?: {}): any;
37
- export function stubExistingAdditionalProperties(schema: any, rootSchema?: {}, formData?: {}): any;
38
- /**
39
- * Resolves references and dependencies within a schema and its 'allOf' children.
40
- *
41
- * Called internally by retrieveSchema.
42
- */
43
- export function resolveSchema(schema: any, rootSchema?: {}, formData?: {}): any;
44
- export function retrieveSchema(schema: any, rootSchema?: {}, formData?: {}): any;
45
- export function mergeSchemas(obj1: any, obj2: any): any;
46
- export function deepEquals(a: any, b: any, ca?: any[], cb?: any[]): any;
47
- export function shouldRender(comp: any, nextProps: any, nextState: any): boolean;
48
- export function toIdSchema(schema: any, id: any, rootSchema: any, formData?: {}, idPrefix?: string, idSeparator?: string): any;
49
- export function toPathSchema(schema: any, name: string | undefined, rootSchema: any, formData?: {}): any;
50
- export function parseDateString(dateString: any, includeTime?: boolean): {
51
- year: number;
52
- month: number;
53
- day: number;
54
- hour: number;
55
- minute: number;
56
- second: number;
57
- };
58
- export function toDateString({ year, month, day, hour, minute, second }: {
59
- year: any;
60
- month: any;
61
- day: any;
62
- hour?: number | undefined;
63
- minute?: number | undefined;
64
- second?: number | undefined;
65
- }, time?: boolean): string;
66
- export function utcToLocal(jsonDate: any): string;
67
- export function localToUTC(dateString: any): string | undefined;
68
- export function pad(num: any, size: any): string;
69
- export function dataURItoBlob(dataURI: any): {
70
- blob: Blob;
71
- name: any;
72
- };
73
- export function rangeSpec(schema: any): {
74
- step: any;
75
- min: any;
76
- max: any;
77
- };
78
- export function getMatchingOption(formData: any, options: any, rootSchema: any): number;
79
- export function schemaRequiresTrueValue(schema: any): any;
80
- export const ADDITIONAL_PROPERTY_FLAG: "__additional_property";
81
- export function guessType(value: any): "array" | "string" | "null" | "boolean" | "number" | "object";
@@ -1,21 +0,0 @@
1
- export function toErrorList(errorSchema: any, fieldName?: string): any[];
2
- /**
3
- * This function processes the formData with a user `validate` contributed
4
- * function, which receives the form data and an `errorHandler` object that
5
- * will be used to add custom validation errors for each field.
6
- */
7
- export default function validateFormData(formData: any, schema: any, customValidate: any, transformErrors: any, additionalMetaSchemas?: any[], customFormats?: {}): {
8
- errors: any[];
9
- errorSchema: any;
10
- };
11
- /**
12
- * Recursively prefixes all $ref's in a schema with `ROOT_SCHEMA_PREFIX`
13
- * This is used in isValid to make references to the rootSchema
14
- */
15
- export function withIdRefPrefix(schemaNode: any): any;
16
- /**
17
- * Validates data against a schema, returning true if the data is valid, or
18
- * false otherwise. If the schema is invalid, then this function will return
19
- * false.
20
- */
21
- export function isValid(schema: any, data: any, rootSchema: any): boolean | PromiseLike<any>;