@rjsf/utils 5.18.3 → 5.18.5
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.js +3 -1
- package/dist/index.js.map +2 -2
- package/dist/utils.esm.js +3 -1
- package/dist/utils.esm.js.map +2 -2
- package/dist/utils.umd.js +3 -1
- package/lib/constants.d.ts +5 -1
- package/lib/constants.js +5 -1
- package/lib/constants.js.map +1 -1
- package/lib/schema/toPathSchema.js +2 -2
- package/lib/schema/toPathSchema.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types.d.ts +6 -6
- package/package.json +3 -3
- package/src/constants.ts +5 -1
- package/src/schema/toPathSchema.ts +2 -2
- package/src/types.ts +6 -6
package/src/constants.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Below are the list of all the keys into various elements of a RJSFSchema or UiSchema that are used by the various
|
|
2
2
|
* utility functions. In addition to those keys, there are the special `ADDITIONAL_PROPERTY_FLAG` and
|
|
3
|
-
* `
|
|
3
|
+
* `RJSF_ADDITIONAL_PROPERTIES_FLAG` flags that is added to a schema under certain conditions by the `retrieveSchema()`
|
|
4
4
|
* utility.
|
|
5
5
|
*/
|
|
6
6
|
export const ADDITIONAL_PROPERTY_FLAG = '__additional_property';
|
|
@@ -23,7 +23,11 @@ export const PROPERTIES_KEY = 'properties';
|
|
|
23
23
|
export const REQUIRED_KEY = 'required';
|
|
24
24
|
export const SUBMIT_BTN_OPTIONS_KEY = 'submitButtonOptions';
|
|
25
25
|
export const REF_KEY = '$ref';
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Replace with correctly spelled constant `RJSF_ADDITIONAL_PROPERTIES_FLAG`
|
|
28
|
+
*/
|
|
26
29
|
export const RJSF_ADDITONAL_PROPERTIES_FLAG = '__rjsf_additionalProperties';
|
|
30
|
+
export const RJSF_ADDITIONAL_PROPERTIES_FLAG = '__rjsf_additionalProperties';
|
|
27
31
|
export const ROOT_SCHEMA_PREFIX = '__rjsf_rootSchema';
|
|
28
32
|
export const UI_FIELD_KEY = 'ui:field';
|
|
29
33
|
export const UI_WIDGET_KEY = 'ui:widget';
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
ONE_OF_KEY,
|
|
13
13
|
PROPERTIES_KEY,
|
|
14
14
|
REF_KEY,
|
|
15
|
-
|
|
15
|
+
RJSF_ADDITIONAL_PROPERTIES_FLAG,
|
|
16
16
|
} from '../constants';
|
|
17
17
|
import getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema';
|
|
18
18
|
import { FormContextType, PathSchema, RJSFSchema, StrictRJSFSchema, ValidatorType } from '../types';
|
|
@@ -69,7 +69,7 @@ function toPathSchemaInternal<T = any, S extends StrictRJSFSchema = RJSFSchema,
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
if (ADDITIONAL_PROPERTIES_KEY in schema && schema[ADDITIONAL_PROPERTIES_KEY] !== false) {
|
|
72
|
-
set(pathSchema,
|
|
72
|
+
set(pathSchema, RJSF_ADDITIONAL_PROPERTIES_FLAG, true);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
if (ITEMS_KEY in schema && Array.isArray(formData)) {
|
package/src/types.ts
CHANGED
|
@@ -380,11 +380,11 @@ export interface FieldProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F
|
|
|
380
380
|
/** A boolean value stating if the field should autofocus */
|
|
381
381
|
autofocus?: boolean;
|
|
382
382
|
/** A boolean value stating if the field is disabled */
|
|
383
|
-
disabled
|
|
383
|
+
disabled?: boolean;
|
|
384
384
|
/** A boolean value stating if the field is hiding its errors */
|
|
385
385
|
hideError?: boolean;
|
|
386
386
|
/** A boolean value stating if the field is read-only */
|
|
387
|
-
readonly
|
|
387
|
+
readonly?: boolean;
|
|
388
388
|
/** The required status of this field */
|
|
389
389
|
required?: boolean;
|
|
390
390
|
/** The unique name of the field, usually derived from the name of the property in the JSONSchema */
|
|
@@ -545,7 +545,7 @@ export type ArrayFieldTemplateItemType<
|
|
|
545
545
|
/** The className string */
|
|
546
546
|
className: string;
|
|
547
547
|
/** A boolean value stating if the array item is disabled */
|
|
548
|
-
disabled
|
|
548
|
+
disabled?: boolean;
|
|
549
549
|
/** A boolean value stating whether new items can be added to the array */
|
|
550
550
|
canAdd: boolean;
|
|
551
551
|
/** A boolean value stating whether the array item can be copied, assumed false if missing */
|
|
@@ -571,7 +571,7 @@ export type ArrayFieldTemplateItemType<
|
|
|
571
571
|
/** Returns a function that swaps the items at `index` with `newIndex` */
|
|
572
572
|
onReorderClick: (index: number, newIndex: number) => (event?: any) => void;
|
|
573
573
|
/** A boolean value stating if the array item is read-only */
|
|
574
|
-
readonly
|
|
574
|
+
readonly?: boolean;
|
|
575
575
|
/** A stable, unique key for the array item */
|
|
576
576
|
key: string;
|
|
577
577
|
/** The schema object for this array item */
|
|
@@ -631,9 +631,9 @@ export type ObjectFieldTemplatePropertyType = {
|
|
|
631
631
|
/** A string representing the property name */
|
|
632
632
|
name: string;
|
|
633
633
|
/** A boolean value stating if the object property is disabled */
|
|
634
|
-
disabled
|
|
634
|
+
disabled?: boolean;
|
|
635
635
|
/** A boolean value stating if the property is read-only */
|
|
636
|
-
readonly
|
|
636
|
+
readonly?: boolean;
|
|
637
637
|
/** A boolean value stating if the property should be hidden */
|
|
638
638
|
hidden: boolean;
|
|
639
639
|
};
|