@rjsf/utils 6.0.0-beta.13 → 6.0.0-beta.14
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 +6 -3
- package/dist/index.js.map +2 -2
- package/dist/utils.esm.js +6 -3
- package/dist/utils.esm.js.map +2 -2
- package/dist/utils.umd.js +6 -3
- package/lib/createSchemaUtils.js +3 -1
- package/lib/createSchemaUtils.js.map +1 -1
- package/lib/getUiOptions.js +4 -0
- package/lib/getUiOptions.js.map +1 -1
- package/lib/schema/getDisplayLabel.js +2 -2
- package/lib/schema/getDisplayLabel.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types.d.ts +18 -3
- package/package.json +5 -5
- package/src/createSchemaUtils.ts +4 -1
- package/src/getUiOptions.ts +4 -0
- package/src/schema/getDisplayLabel.ts +2 -2
- package/src/types.ts +21 -3
package/dist/index.js
CHANGED
|
@@ -233,6 +233,9 @@ var JSON_SCHEMA_DRAFT_2020_12 = "https://json-schema.org/draft/2020-12/schema";
|
|
|
233
233
|
|
|
234
234
|
// src/getUiOptions.ts
|
|
235
235
|
function getUiOptions(uiSchema = {}, globalOptions = {}) {
|
|
236
|
+
if (!uiSchema) {
|
|
237
|
+
return { ...globalOptions };
|
|
238
|
+
}
|
|
236
239
|
return Object.keys(uiSchema).filter((key) => key.indexOf("ui:") === 0).reduce(
|
|
237
240
|
(options, key) => {
|
|
238
241
|
const value = uiSchema[key];
|
|
@@ -2019,10 +2022,10 @@ function getDisplayLabel(validator, schema, uiSchema = {}, rootSchema, globalOpt
|
|
|
2019
2022
|
if (schemaType === "object") {
|
|
2020
2023
|
displayLabel = false;
|
|
2021
2024
|
}
|
|
2022
|
-
if (schemaType === "boolean" && !uiSchema[UI_WIDGET_KEY]) {
|
|
2025
|
+
if (schemaType === "boolean" && uiSchema && !uiSchema[UI_WIDGET_KEY]) {
|
|
2023
2026
|
displayLabel = false;
|
|
2024
2027
|
}
|
|
2025
|
-
if (uiSchema[UI_FIELD_KEY]) {
|
|
2028
|
+
if (uiSchema && uiSchema[UI_FIELD_KEY]) {
|
|
2026
2029
|
displayLabel = false;
|
|
2027
2030
|
}
|
|
2028
2031
|
return displayLabel;
|
|
@@ -2358,7 +2361,7 @@ var SchemaUtils = class {
|
|
|
2358
2361
|
* @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas
|
|
2359
2362
|
*/
|
|
2360
2363
|
constructor(validator, rootSchema, experimental_defaultFormStateBehavior, experimental_customMergeAllOf) {
|
|
2361
|
-
if (rootSchema[SCHEMA_KEY] === JSON_SCHEMA_DRAFT_2020_12) {
|
|
2364
|
+
if (rootSchema && rootSchema[SCHEMA_KEY] === JSON_SCHEMA_DRAFT_2020_12) {
|
|
2362
2365
|
this.rootSchema = makeAllReferencesAbsolute(rootSchema, (0, import_get16.default)(rootSchema, ID_KEY, "#"));
|
|
2363
2366
|
} else {
|
|
2364
2367
|
this.rootSchema = rootSchema;
|