@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/utils.esm.js CHANGED
@@ -80,6 +80,9 @@ var JSON_SCHEMA_DRAFT_2020_12 = "https://json-schema.org/draft/2020-12/schema";
80
80
 
81
81
  // src/getUiOptions.ts
82
82
  function getUiOptions(uiSchema = {}, globalOptions = {}) {
83
+ if (!uiSchema) {
84
+ return { ...globalOptions };
85
+ }
83
86
  return Object.keys(uiSchema).filter((key) => key.indexOf("ui:") === 0).reduce(
84
87
  (options, key) => {
85
88
  const value = uiSchema[key];
@@ -1866,10 +1869,10 @@ function getDisplayLabel(validator, schema, uiSchema = {}, rootSchema, globalOpt
1866
1869
  if (schemaType === "object") {
1867
1870
  displayLabel = false;
1868
1871
  }
1869
- if (schemaType === "boolean" && !uiSchema[UI_WIDGET_KEY]) {
1872
+ if (schemaType === "boolean" && uiSchema && !uiSchema[UI_WIDGET_KEY]) {
1870
1873
  displayLabel = false;
1871
1874
  }
1872
- if (uiSchema[UI_FIELD_KEY]) {
1875
+ if (uiSchema && uiSchema[UI_FIELD_KEY]) {
1873
1876
  displayLabel = false;
1874
1877
  }
1875
1878
  return displayLabel;
@@ -2205,7 +2208,7 @@ var SchemaUtils = class {
2205
2208
  * @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas
2206
2209
  */
2207
2210
  constructor(validator, rootSchema, experimental_defaultFormStateBehavior, experimental_customMergeAllOf) {
2208
- if (rootSchema[SCHEMA_KEY] === JSON_SCHEMA_DRAFT_2020_12) {
2211
+ if (rootSchema && rootSchema[SCHEMA_KEY] === JSON_SCHEMA_DRAFT_2020_12) {
2209
2212
  this.rootSchema = makeAllReferencesAbsolute(rootSchema, get16(rootSchema, ID_KEY, "#"));
2210
2213
  } else {
2211
2214
  this.rootSchema = rootSchema;