@rjsf/core 5.0.0-beta.8 → 5.0.0-beta.9

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/index.d.ts CHANGED
@@ -274,6 +274,12 @@ declare class Form<T = any, F = any> extends Component<FormProps<T, F>, FormStat
274
274
  getRegistry(): Registry<T, F>;
275
275
  /** Provides a function that can be used to programmatically submit the `Form` */
276
276
  submit(): void;
277
+ /** Programmatically validate the form. If `onError` is provided, then it will be called with the list of errors the
278
+ * same way as would happen on form submission.
279
+ *
280
+ * @returns - True if the form is valid, false otherwise.
281
+ */
282
+ validateForm(): boolean;
277
283
  /** Renders the `Form` fields inside the <form> | `tagName` or `_internalFormWrapper`, rendering any errors if
278
284
  * needed along with the submit button or any children of the form.
279
285
  */
@@ -283,9 +289,9 @@ declare class Form<T = any, F = any> extends Component<FormProps<T, F>, FormStat
283
289
  /** The properties for the `withTheme` function, essentially a subset of properties from the `FormProps` that can be
284
290
  * overridden while creating a theme
285
291
  */
286
- declare type WithThemeProps<T = any, F = any> = Pick<FormProps<T, F>, "fields" | "templates" | "widgets" | "_internalFormWrapper">;
292
+ declare type ThemeProps<T = any, F = any> = Pick<FormProps<T, F>, "fields" | "templates" | "widgets" | "_internalFormWrapper">;
287
293
  /** A Higher-Order component that creates a wrapper around a `Form` with the overrides from the `WithThemeProps` */
288
- declare function withTheme<T = any, F = any>(themeProps: WithThemeProps<T, F>): React.ForwardRefExoticComponent<FormProps<T, F> & React.RefAttributes<Form<T, F>>>;
294
+ declare function withTheme<T = any, F = any>(themeProps: ThemeProps<T, F>): React.ForwardRefExoticComponent<FormProps<T, F> & React.RefAttributes<Form<T, F>>>;
289
295
 
290
296
  /** The default registry consists of all the fields, templates and widgets provided in the core implementation,
291
297
  * plus an empty `rootSchema` and `formContext. We omit schemaUtils here because it cannot be defaulted without a
@@ -293,4 +299,4 @@ declare function withTheme<T = any, F = any>(themeProps: WithThemeProps<T, F>):
293
299
  */
294
300
  declare function getDefaultRegistry<T = any, F = any>(): Omit<Registry<T, F>, "schemaUtils">;
295
301
 
296
- export { FormProps, FormState, IChangeEvent, WithThemeProps, Form as default, getDefaultRegistry, withTheme };
302
+ export { FormProps, FormState, IChangeEvent, ThemeProps, Form as default, getDefaultRegistry, withTheme };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rjsf/core",
3
- "version": "5.0.0-beta.8",
3
+ "version": "5.0.0-beta.9",
4
4
  "description": "A simple React component capable of building HTML forms out of a JSON schema.",
5
5
  "scripts": {
6
6
  "build": "rimraf dist && dts build --rollupTypes --format cjs,esm,umd",
@@ -51,9 +51,9 @@
51
51
  "@babel/preset-env": "^7.18.10",
52
52
  "@babel/preset-react": "^7.18.6",
53
53
  "@babel/register": "^7.18.9",
54
- "@rjsf/utils": "^5.0.0-beta.8",
55
- "@rjsf/validator-ajv6": "^5.0.0-beta.8",
56
- "@rjsf/validator-ajv8": "^5.0.0-beta.8",
54
+ "@rjsf/utils": "^5.0.0-beta.9",
55
+ "@rjsf/validator-ajv6": "^5.0.0-beta.9",
56
+ "@rjsf/validator-ajv8": "^5.0.0-beta.9",
57
57
  "@types/lodash": "^4.14.184",
58
58
  "@types/react": "^17.0.39",
59
59
  "@types/react-dom": "^17.0.11",
@@ -92,5 +92,5 @@
92
92
  "publishConfig": {
93
93
  "access": "public"
94
94
  },
95
- "gitHead": "8e6a64e6b398f01bf04b1e64a0d4982196bdc05c"
95
+ "gitHead": "6a0a58190ff616344d80c558a755cda1835954f6"
96
96
  }