@rjsf/utils 6.0.0-beta.13 → 6.0.0-beta.15

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 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;
@@ -2993,8 +2996,8 @@ function getTemplate(name, registry, uiOptions = {}) {
2993
2996
  }
2994
2997
 
2995
2998
  // src/getTestIds.ts
2996
- var import_nanoid = require("nanoid");
2997
2999
  var import_get18 = __toESM(require("lodash/get"), 1);
3000
+ var import_uniqueId = __toESM(require("lodash/uniqueId"), 1);
2998
3001
  function getTestIds() {
2999
3002
  if (typeof process === "undefined" || (0, import_get18.default)(process, "env.NODE_ENV") !== "test") {
3000
3003
  return {};
@@ -3005,7 +3008,7 @@ function getTestIds() {
3005
3008
  {
3006
3009
  get(_obj, prop) {
3007
3010
  if (!ids.has(prop)) {
3008
- ids.set(prop, (0, import_nanoid.nanoid)());
3011
+ ids.set(prop, (0, import_uniqueId.default)("test-id-"));
3009
3012
  }
3010
3013
  return ids.get(prop);
3011
3014
  }