@rjsf/utils 5.0.0-beta.1

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.
Files changed (62) hide show
  1. package/LICENSE.md +201 -0
  2. package/README.md +106 -0
  3. package/dist/allowAdditionalItems.d.ts +8 -0
  4. package/dist/asNumber.d.ts +10 -0
  5. package/dist/canExpand.d.ts +11 -0
  6. package/dist/constants.d.ts +27 -0
  7. package/dist/createSchemaUtils.d.ts +9 -0
  8. package/dist/dataURItoBlob.d.ts +10 -0
  9. package/dist/deepEquals.d.ts +8 -0
  10. package/dist/findSchemaDefinition.d.ts +20 -0
  11. package/dist/getInputProps.d.ts +10 -0
  12. package/dist/getSchemaType.d.ts +13 -0
  13. package/dist/getSubmitButtonOptions.d.ts +10 -0
  14. package/dist/getTemplate.d.ts +10 -0
  15. package/dist/getUiOptions.d.ts +8 -0
  16. package/dist/getWidget.d.ts +13 -0
  17. package/dist/guessType.d.ts +7 -0
  18. package/dist/hasWidget.d.ts +10 -0
  19. package/dist/index.d.ts +38 -0
  20. package/dist/index.js +8 -0
  21. package/dist/isConstant.d.ts +8 -0
  22. package/dist/isCustomWidget.d.ts +7 -0
  23. package/dist/isFixedItems.d.ts +8 -0
  24. package/dist/isObject.d.ts +7 -0
  25. package/dist/localToUTC.d.ts +6 -0
  26. package/dist/mergeDefaultsWithFormData.d.ts +15 -0
  27. package/dist/mergeObjects.d.ts +9 -0
  28. package/dist/mergeSchemas.d.ts +10 -0
  29. package/dist/optionsList.d.ts +10 -0
  30. package/dist/orderProperties.d.ts +11 -0
  31. package/dist/pad.d.ts +7 -0
  32. package/dist/parseDateString.d.ts +9 -0
  33. package/dist/processSelectValue.d.ts +11 -0
  34. package/dist/rangeSpec.d.ts +9 -0
  35. package/dist/schema/getDefaultFormState.d.ts +47 -0
  36. package/dist/schema/getDisplayLabel.d.ts +11 -0
  37. package/dist/schema/getMatchingOption.d.ts +10 -0
  38. package/dist/schema/index.d.ts +11 -0
  39. package/dist/schema/isFilesArray.d.ts +10 -0
  40. package/dist/schema/isMultiSelect.d.ts +9 -0
  41. package/dist/schema/isSelect.d.ts +9 -0
  42. package/dist/schema/mergeValidationData.d.ts +12 -0
  43. package/dist/schema/retrieveSchema.d.ts +98 -0
  44. package/dist/schema/toIdSchema.d.ts +13 -0
  45. package/dist/schema/toPathSchema.d.ts +11 -0
  46. package/dist/schemaRequiresTrueValue.d.ts +11 -0
  47. package/dist/shouldRender.d.ts +10 -0
  48. package/dist/toConstant.d.ts +9 -0
  49. package/dist/toDateString.d.ts +9 -0
  50. package/dist/types.d.ts +755 -0
  51. package/dist/utcToLocal.d.ts +6 -0
  52. package/dist/utils.cjs.development.js +2274 -0
  53. package/dist/utils.cjs.development.js.map +1 -0
  54. package/dist/utils.cjs.production.min.js +2 -0
  55. package/dist/utils.cjs.production.min.js.map +1 -0
  56. package/dist/utils.esm.js +2192 -0
  57. package/dist/utils.esm.js.map +1 -0
  58. package/dist/utils.umd.development.js +2269 -0
  59. package/dist/utils.umd.development.js.map +1 -0
  60. package/dist/utils.umd.production.min.js +2 -0
  61. package/dist/utils.umd.production.min.js.map +1 -0
  62. package/package.json +79 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.umd.production.min.js","sources":["../src/isObject.ts","../src/asNumber.ts","../src/constants.ts","../src/getUiOptions.ts","../src/deepEquals.ts","../src/findSchemaDefinition.ts","../src/schema/getMatchingOption.ts","../src/guessType.ts","../src/getSchemaType.ts","../src/isFixedItems.ts","../src/mergeDefaultsWithFormData.ts","../src/mergeObjects.ts","../src/isConstant.ts","../src/mergeSchemas.ts","../src/schema/retrieveSchema.ts","../src/schema/isSelect.ts","../src/schema/isMultiSelect.ts","../src/schema/getDefaultFormState.ts","../src/isCustomWidget.ts","../src/schema/isFilesArray.ts","../src/schema/getDisplayLabel.ts","../src/schema/mergeValidationData.ts","../src/schema/toIdSchema.ts","../src/schema/toPathSchema.ts","../src/createSchemaUtils.ts","../src/rangeSpec.ts","../src/getSubmitButtonOptions.ts","../src/getWidget.tsx","../src/toConstant.ts","../src/pad.ts","../src/processSelectValue.ts","../src/allowAdditionalItems.ts","../src/canExpand.ts","../src/dataURItoBlob.ts","../src/getInputProps.ts","../src/getTemplate.ts","../src/hasWidget.ts","../src/localToUTC.ts","../src/optionsList.ts","../src/orderProperties.ts","../src/parseDateString.ts","../src/schemaRequiresTrueValue.ts","../src/shouldRender.ts","../src/toDateString.ts","../src/utcToLocal.ts"],"sourcesContent":["/** Determines whether a `thing` is an object for the purposes of RSJF. In this case, `thing` is an object if it has\n * the type `object` but is NOT null, an array or a File.\n *\n * @param thing - The thing to check to see whether it is an object\n * @returns - True if it is a non-null, non-array, non-File object\n */\nexport default function isObject(thing: any) {\n if (typeof File !== \"undefined\" && thing instanceof File) {\n return false;\n }\n return typeof thing === \"object\" && thing !== null && !Array.isArray(thing);\n}\n","/** Attempts to convert the string into a number. If an empty string is provided, then `undefined` is returned. If a\n * `null` is provided, it is returned. If the string ends in a `.` then the string is returned because the user may be\n * in the middle of typing a float number. If a number ends in a pattern like `.0`, `.20`, `.030`, string is returned\n * because the user may be typing number that will end in a non-zero digit. Otherwise, the string is wrapped by\n * `Number()` and if that result is not `NaN`, that number will be returned, otherwise the string `value` will be.\n *\n * @param value - The string or null value to convert to a number\n * @returns - The `value` converted to a number when appropriate, otherwise the `value`\n */\nexport default function asNumber(value: string | null) {\n if (value === \"\") {\n return undefined;\n }\n if (value === null) {\n return null;\n }\n if (/\\.$/.test(value)) {\n // '3.' can't really be considered a number even if it parses in js. The\n // user is most likely entering a float.\n return value;\n }\n if (/\\.0$/.test(value)) {\n // we need to return this as a string here, to allow for input like 3.07\n return value;\n }\n\n if (/\\.\\d*0$/.test(value)) {\n // It's a number, that's cool - but we need it as a string so it doesn't screw\n // with the user when entering dollar amounts or other values (such as those with\n // specific precision or number of significant digits)\n return value;\n }\n\n const n = Number(value);\n const valid = typeof n === \"number\" && !Number.isNaN(n);\n\n return valid ? n : value;\n}\n","/** Below are the list of all the keys into various elements of a RJSFSchema or UiSchema that are used by the various\n * utility functions. In addition to those keys, there are the special `ADDITIONAL_PROPERTY_FLAG` and\n * `RJSF_ADDITONAL_PROPERTIES_FLAG` flags that is added to a schema under certain conditions by the `retrieveSchema()`\n * utility.\n */\nexport const ADDITIONAL_PROPERTY_FLAG = \"__additional_property\";\nexport const ADDITIONAL_PROPERTIES_KEY = \"additionalProperties\";\nexport const ALL_OF_KEY = \"allOf\";\nexport const ANY_OF_KEY = \"anyOf\";\nexport const CONST_KEY = \"const\";\nexport const DEFAULT_KEY = \"default\";\nexport const DEFINITIONS_KEY = \"definitions\";\nexport const DEPENDENCIES_KEY = \"dependencies\";\nexport const ENUM_KEY = \"enum\";\nexport const ERRORS_KEY = \"__errors\";\nexport const ID_KEY = \"$id\";\nexport const ITEMS_KEY = \"items\";\nexport const NAME_KEY = \"$name\";\nexport const ONE_OF_KEY = \"oneOf\";\nexport const PROPERTIES_KEY = \"properties\";\nexport const REQUIRED_KEY = \"required\";\nexport const SUBMIT_BTN_OPTIONS_KEY = \"submitButtonOptions\";\nexport const REF_KEY = \"$ref\";\nexport const RJSF_ADDITONAL_PROPERTIES_FLAG = \"__rjsf_additionalProperties\";\nexport const UI_FIELD_KEY = \"ui:field\";\nexport const UI_WIDGET_KEY = \"ui:widget\";\nexport const UI_OPTIONS_KEY = \"ui:options\";\n","import { UI_OPTIONS_KEY, UI_WIDGET_KEY } from \"./constants\";\nimport isObject from \"./isObject\";\nimport { UIOptionsType, UiSchema } from \"./types\";\n\n/** Get all passed options from ui:options, and ui:<optionName>, returning them in an object with the `ui:`\n * stripped off.\n *\n * @param [uiSchema={}] - The UI Schema from which to get any `ui:xxx` options\n * @returns - An object containing all of the `ui:xxx` options with the stripped off\n */\nexport default function getUiOptions<T = any, F = any>(\n uiSchema: UiSchema<T, F> = {}\n): UIOptionsType<T, F> {\n return Object.keys(uiSchema)\n .filter((key) => key.indexOf(\"ui:\") === 0)\n .reduce((options, key) => {\n const value = uiSchema[key];\n if (key === UI_WIDGET_KEY && isObject(value)) {\n console.error(\n \"Setting options via ui:widget object is no longer supported, use ui:options instead\"\n );\n return options;\n }\n if (key === UI_OPTIONS_KEY && isObject(value)) {\n return { ...options, ...value };\n }\n return { ...options, [key.substring(3)]: value };\n }, {});\n}\n","import isEqualWith from \"lodash/isEqualWith\";\n\n/** Implements a deep equals using the `lodash.isEqualWith` function, that provides a customized comparator that\n * assumes all functions are equivalent.\n *\n * @param a - The first element to compare\n * @param b - The second element to compare\n * @returns - True if the `a` and `b` are deeply equal, false otherwise\n */\nexport default function deepEquals(a: any, b: any): boolean {\n return isEqualWith(a, b, (obj: any, other: any) => {\n if (typeof obj === \"function\" && typeof other === \"function\") {\n // Assume all functions are equivalent\n // see https://github.com/rjsf-team/react-jsonschema-form/issues/255\n return true;\n }\n return undefined; // fallback to default isEquals behavior\n });\n}\n","import jsonpointer from \"jsonpointer\";\nimport omit from \"lodash/omit\";\n\nimport { REF_KEY } from \"./constants\";\nimport { GenericObjectType, RJSFSchema } from \"./types\";\n\n/** Splits out the value at the `key` in `object` from the `object`, returning an array that contains in the first\n * location, the `object` minus the `key: value` and in the second location the `value`.\n *\n * @param key - The key from the object to extract\n * @param object - The object from which to extract the element\n * @returns - An array with the first value being the object minus the `key` element and the second element being the\n * value from `object[key]`\n */\nexport function splitKeyElementFromObject(\n key: string,\n object: GenericObjectType\n) {\n const value = object[key];\n const remaining = omit(object, [key]);\n return [remaining, value];\n}\n\n/** Given the name of a `$ref` from within a schema, using the `rootSchema`, look up and return the sub-schema using the\n * path provided by that reference. If `#` is not the first character of the reference, or the path does not exist in\n * the schema, then throw an Error. Otherwise return the sub-schema. Also deals with nested `$ref`s in the sub-schema.\n *\n * @param $ref - The ref string for which the schema definition is desired\n * @param [rootSchema={}] - The root schema in which to search for the definition\n * @returns - The sub-schema within the `rootSchema` which matches the `$ref` if it exists\n * @throws - Error indicating that no schema for that reference exists\n */\nexport default function findSchemaDefinition(\n $ref?: string,\n rootSchema: RJSFSchema = {}\n): RJSFSchema {\n let ref = $ref || \"\";\n if (ref.startsWith(\"#\")) {\n // Decode URI fragment representation.\n ref = decodeURIComponent(ref.substring(1));\n } else {\n throw new Error(`Could not find a definition for ${$ref}.`);\n }\n const current: RJSFSchema = jsonpointer.get(rootSchema, ref);\n if (current === undefined) {\n throw new Error(`Could not find a definition for ${$ref}.`);\n }\n if (current[REF_KEY]) {\n const [remaining, theRef] = splitKeyElementFromObject(REF_KEY, current);\n const subSchema = findSchemaDefinition(theRef, rootSchema);\n if (Object.keys(remaining).length > 0) {\n return { ...remaining, ...subSchema };\n }\n return subSchema;\n }\n return current;\n}\n","import { RJSFSchema, ValidatorType } from \"../types\";\n\n/** Given the `formData` and list of `options`, attempts to find the index of the option that best matches the data.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param formData - The current formData, if any, used to figure out a match\n * @param options - The list of options to find a matching options from\n * @param rootSchema - The root schema, used to primarily to look up `$ref`s\n * @returns - The index of the matched option or 0 if none is available\n */\nexport default function getMatchingOption<T = any>(\n validator: ValidatorType,\n formData: T | undefined,\n options: RJSFSchema[],\n rootSchema: RJSFSchema\n): number {\n // For performance, skip validating subschemas if formData is undefined. We just\n // want to get the first option in that case.\n if (formData === undefined) {\n return 0;\n }\n for (let i = 0; i < options.length; i++) {\n const option = options[i];\n\n // If the schema describes an object then we need to add slightly more\n // strict matching to the schema, because unless the schema uses the\n // \"requires\" keyword, an object will match the schema as long as it\n // doesn't have matching keys with a conflicting type. To do this we use an\n // \"anyOf\" with an array of requires. This augmentation expresses that the\n // schema should match if any of the keys in the schema are present on the\n // object and pass validation.\n if (option.properties) {\n // Create an \"anyOf\" schema that requires at least one of the keys in the\n // \"properties\" object\n const requiresAnyOf = {\n anyOf: Object.keys(option.properties).map((key) => ({\n required: [key],\n })),\n };\n\n let augmentedSchema;\n\n // If the \"anyOf\" keyword already exists, wrap the augmentation in an \"allOf\"\n if (option.anyOf) {\n // Create a shallow clone of the option\n const { ...shallowClone } = option;\n\n if (!shallowClone.allOf) {\n shallowClone.allOf = [];\n } else {\n // If \"allOf\" already exists, shallow clone the array\n shallowClone.allOf = shallowClone.allOf.slice();\n }\n\n shallowClone.allOf.push(requiresAnyOf);\n\n augmentedSchema = shallowClone;\n } else {\n augmentedSchema = Object.assign({}, option, requiresAnyOf);\n }\n\n // Remove the \"required\" field as it's likely that not all fields have\n // been filled in yet, which will mean that the schema is not valid\n delete augmentedSchema.required;\n\n if (validator.isValid(augmentedSchema, formData, rootSchema)) {\n return i;\n }\n } else if (validator.isValid(option, formData, rootSchema)) {\n return i;\n }\n }\n return 0;\n}\n","/** Given a specific `value` attempts to guess the type of a schema element. In the case where we have to implicitly\n * create a schema, it is useful to know what type to use based on the data we are defining.\n *\n * @param value - The value from which to guess the type\n * @returns - The best guess for the object type\n */\nexport default function guessType(value: any) {\n if (Array.isArray(value)) {\n return \"array\";\n }\n if (typeof value === \"string\") {\n return \"string\";\n }\n if (value == null) {\n return \"null\";\n }\n if (typeof value === \"boolean\") {\n return \"boolean\";\n }\n if (!isNaN(value)) {\n return \"number\";\n }\n if (typeof value === \"object\") {\n return \"object\";\n }\n // Default to string if we can't figure it out\n return \"string\";\n}\n","import guessType from \"./guessType\";\nimport { RJSFSchema } from \"./types\";\n\n/** Gets the type of a given `schema`. If the type is not explicitly defined, then an attempt is made to infer it from\n * other elements of the schema as follows:\n * - schema.const: Returns the `guessType()` of that value\n * - schema.enum: Returns `string`\n * - schema.properties: Returns `object`\n * - schema.additionalProperties: Returns `object`\n * - type is an array with a length of 2 and one type is 'null': Returns the other type\n *\n * @param schema - The schema for which to get the type\n * @returns - The type of the schema\n */\nexport default function getSchemaType(\n schema: RJSFSchema\n): string | string[] | undefined {\n let { type } = schema;\n\n if (!type && schema.const) {\n return guessType(schema.const);\n }\n\n if (!type && schema.enum) {\n return \"string\";\n }\n\n if (!type && (schema.properties || schema.additionalProperties)) {\n return \"object\";\n }\n\n if (Array.isArray(type) && type.length === 2 && type.includes(\"null\")) {\n type = type.find((type) => type !== \"null\");\n }\n\n return type;\n}\n","import isObject from \"./isObject\";\nimport { RJSFSchema } from \"./types\";\n\n/** Detects whether the given `schema` contains fixed items. This is the case when `schema.items` is a non-empty array\n * that only contains objects.\n *\n * @param schema - The schema in which to check for fixed items\n * @returns - True if there are fixed items in the schema, false otherwise\n */\nexport default function isFixedItems(schema: RJSFSchema) {\n return (\n Array.isArray(schema.items) &&\n schema.items.length > 0 &&\n schema.items.every((item) => isObject(item))\n );\n}\n","import get from \"lodash/get\";\n\nimport isObject from \"./isObject\";\n\n/** Merges the `defaults` object of type `T` into the `formData` of type `T`\n *\n * When merging defaults and form data, we want to merge in this specific way:\n * - objects are deeply merged\n * - arrays are merged in such a way that:\n * - when the array is set in form data, only array entries set in form data\n * are deeply merged; additional entries from the defaults are ignored\n * - when the array is not set in form data, the default is copied over\n * - scalars are overwritten/set by form data\n *\n * @param defaults - The defaults to merge\n * @param formData - The form data into which the defaults will be merged\n * @returns - The resulting merged form data with defaults\n */\nexport default function mergeDefaultsWithFormData<T = any>(\n defaults: T,\n formData: T\n): T {\n if (Array.isArray(formData)) {\n const defaultsArray = Array.isArray(defaults) ? defaults : [];\n const mapped = formData.map((value, idx) => {\n if (defaultsArray[idx]) {\n return mergeDefaultsWithFormData<any>(defaultsArray[idx], value);\n }\n return value;\n });\n return mapped as unknown as T;\n }\n if (isObject(formData)) {\n // eslint-disable-next-line no-unused-vars\n const acc: { [key in keyof T]: any } = Object.assign({}, defaults); // Prevent mutation of source object.\n return Object.keys(formData).reduce((acc, key) => {\n acc[key as keyof T] = mergeDefaultsWithFormData<T>(\n defaults ? get(defaults, key) : {},\n get(formData, key)\n );\n return acc;\n }, acc);\n }\n return formData;\n}\n","import isObject from \"./isObject\";\nimport { GenericObjectType } from \"./types\";\n\n/** Recursively merge deeply nested objects.\n *\n * @param obj1 - The first object to merge\n * @param obj2 - The second object to merge\n * @param [concatArrays=false] - Optional flag that, when true, will cause arrays to be concatenated\n * @returns - A new object that is the merge of the two given objects\n */\nexport default function mergeObjects(\n obj1: GenericObjectType,\n obj2: GenericObjectType,\n concatArrays = false\n) {\n return Object.keys(obj2).reduce((acc, key) => {\n const left = obj1 ? obj1[key] : {},\n right = obj2[key];\n if (obj1 && key in obj1 && isObject(right)) {\n acc[key] = mergeObjects(left, right, concatArrays);\n } else if (concatArrays && Array.isArray(left) && Array.isArray(right)) {\n acc[key] = left.concat(right);\n } else {\n acc[key] = right;\n }\n return acc;\n }, Object.assign({}, obj1)); // Prevent mutation of source object.\n}\n","import { CONST_KEY } from \"./constants\";\nimport { RJSFSchema } from \"./types\";\n\n/** This function checks if the given `schema` matches a single constant value. This happens when either the schema has\n * an `enum` array with a single value or there is a `const` defined.\n *\n * @param schema - The schema for a field\n * @returns - True if the `schema` has a single constant value, false otherwise\n */\nexport default function isConstant(schema: RJSFSchema) {\n return (\n (Array.isArray(schema.enum) && schema.enum.length === 1) ||\n CONST_KEY in schema\n );\n}\n","import union from \"lodash/union\";\n\nimport { REQUIRED_KEY } from \"./constants\";\nimport getSchemaType from \"./getSchemaType\";\nimport isObject from \"./isObject\";\nimport { GenericObjectType } from \"./types\";\n\n/** Recursively merge deeply nested schemas. The difference between `mergeSchemas` and `mergeObjects` is that\n * `mergeSchemas` only concats arrays for values under the 'required' keyword, and when it does, it doesn't include\n * duplicate values.\n *\n * @param obj1 - The first schema object to merge\n * @param obj2 - The second schema object to merge\n * @returns - The merged schema object\n */\nexport default function mergeSchemas(\n obj1: GenericObjectType,\n obj2: GenericObjectType\n) {\n const acc = Object.assign({}, obj1); // Prevent mutation of source object.\n return Object.keys(obj2).reduce((acc, key) => {\n const left = obj1 ? obj1[key] : {},\n right = obj2[key];\n if (obj1 && key in obj1 && isObject(right)) {\n acc[key] = mergeSchemas(left, right);\n } else if (\n obj1 &&\n obj2 &&\n (getSchemaType(obj1) === \"object\" || getSchemaType(obj2) === \"object\") &&\n key === REQUIRED_KEY &&\n Array.isArray(left) &&\n Array.isArray(right)\n ) {\n // Don't include duplicate values when merging 'required' fields.\n acc[key] = union(left, right);\n } else {\n acc[key] = right;\n }\n return acc;\n }, acc);\n}\n","import get from \"lodash/get\";\nimport set from \"lodash/set\";\nimport mergeAllOf from \"json-schema-merge-allof\";\n\nimport {\n ADDITIONAL_PROPERTIES_KEY,\n ADDITIONAL_PROPERTY_FLAG,\n ALL_OF_KEY,\n DEPENDENCIES_KEY,\n REF_KEY,\n} from \"../constants\";\nimport findSchemaDefinition, {\n splitKeyElementFromObject,\n} from \"../findSchemaDefinition\";\nimport guessType from \"../guessType\";\nimport isObject from \"../isObject\";\nimport mergeSchemas from \"../mergeSchemas\";\nimport {\n GenericObjectType,\n RJSFSchema,\n RJSFSchemaDefinition,\n ValidatorType,\n} from \"../types\";\nimport getMatchingOption from \"./getMatchingOption\";\n\n/** Resolves a conditional block (if/else/then) by removing the condition and merging the appropriate conditional branch\n * with the rest of the schema\n *\n * @param validator - An implementation of the `ValidatorType` interface that is used to detect valid schema conditions\n * @param schema - The schema for which resolving a condition is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param formData - The current formData to assist retrieving a schema\n * @returns - A schema with the appropriate condition resolved\n */\nexport function resolveCondition<T = any>(\n validator: ValidatorType,\n schema: RJSFSchema,\n rootSchema: RJSFSchema,\n formData: T\n) {\n const {\n if: expression,\n then,\n else: otherwise,\n ...resolvedSchemaLessConditional\n } = schema;\n\n const conditionalSchema = validator.isValid(\n expression as RJSFSchema,\n formData,\n rootSchema\n )\n ? then\n : otherwise;\n\n if (conditionalSchema && typeof conditionalSchema !== \"boolean\") {\n return retrieveSchema<T>(\n validator,\n mergeSchemas(\n resolvedSchemaLessConditional,\n retrieveSchema(validator, conditionalSchema, rootSchema, formData)\n ),\n rootSchema,\n formData\n );\n }\n return retrieveSchema<T>(\n validator,\n resolvedSchemaLessConditional,\n rootSchema,\n formData\n );\n}\n\n/** Resolves references and dependencies within a schema and its 'allOf' children.\n * Called internally by retrieveSchema.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which resolving a schema is desired\n * @param [rootSchema={}] - The root schema that will be forwarded to all the APIs\n * @param [formData] - The current formData, if any, to assist retrieving a schema\n * @returns - The schema having its references and dependencies resolved\n */\nexport function resolveSchema<T = any>(\n validator: ValidatorType,\n schema: RJSFSchema,\n rootSchema: RJSFSchema = {},\n formData?: T\n): RJSFSchema {\n if (REF_KEY in schema) {\n return resolveReference<T>(validator, schema, rootSchema, formData);\n }\n if (DEPENDENCIES_KEY in schema) {\n const resolvedSchema = resolveDependencies<T>(\n validator,\n schema,\n rootSchema,\n formData\n );\n return retrieveSchema<T>(validator, resolvedSchema, rootSchema, formData);\n }\n if (ALL_OF_KEY in schema) {\n return {\n ...schema,\n allOf: schema.allOf!.map((allOfSubschema) =>\n retrieveSchema<T>(\n validator,\n allOfSubschema as RJSFSchema,\n rootSchema,\n formData\n )\n ),\n };\n }\n // No $ref or dependencies attribute found, returning the original schema.\n return schema;\n}\n\n/** Resolves references within a schema and its 'allOf' children.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which resolving a reference is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param [formData] - The current formData, if any, to assist retrieving a schema\n * @returns - The schema having its references resolved\n */\nexport function resolveReference<T = any>(\n validator: ValidatorType,\n schema: RJSFSchema,\n rootSchema: RJSFSchema,\n formData?: T\n): RJSFSchema {\n // Retrieve the referenced schema definition.\n const $refSchema = findSchemaDefinition(schema.$ref, rootSchema);\n // Drop the $ref property of the source schema.\n const { $ref, ...localSchema } = schema;\n // Update referenced schema definition with local schema properties.\n return retrieveSchema<T>(\n validator,\n { ...$refSchema, ...localSchema },\n rootSchema,\n formData\n );\n}\n\n/** Creates new 'properties' items for each key in the `formData`\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param theSchema - The schema for which the existing additional properties is desired\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s * @param validator\n * @param [aFormData] - The current formData, if any, to assist retrieving a schema\n * @returns - The updated schema with additional properties stubbed\n */\nexport function stubExistingAdditionalProperties<T = any>(\n validator: ValidatorType,\n theSchema: RJSFSchema,\n rootSchema?: RJSFSchema,\n aFormData?: T\n): RJSFSchema {\n // Clone the schema so we don't ruin the consumer's original\n const schema = {\n ...theSchema,\n properties: { ...theSchema.properties },\n };\n\n // make sure formData is an object\n const formData: GenericObjectType =\n aFormData && isObject(aFormData) ? aFormData : {};\n Object.keys(formData).forEach((key) => {\n if (key in schema.properties) {\n // No need to stub, our schema already has the property\n return;\n }\n\n let additionalProperties: RJSFSchema = {};\n if (typeof schema.additionalProperties !== \"boolean\") {\n if (REF_KEY in schema.additionalProperties!) {\n additionalProperties = retrieveSchema<T>(\n validator,\n { $ref: get(schema.additionalProperties, [REF_KEY]) },\n rootSchema,\n formData as T\n );\n } else if (\"type\" in schema.additionalProperties!) {\n additionalProperties = { ...schema.additionalProperties };\n } else {\n additionalProperties = { type: guessType(get(formData, [key])) };\n }\n } else {\n additionalProperties = { type: guessType(get(formData, [key])) };\n }\n\n // The type of our new key should match the additionalProperties value;\n schema.properties[key] = additionalProperties;\n // Set our additional property flag so we know it was dynamically added\n set(schema.properties, [key, ADDITIONAL_PROPERTY_FLAG], true);\n });\n\n return schema;\n}\n\n/** Retrieves an expanded schema that has had all of its conditions, additional properties, references and dependencies\n * resolved and merged into the `schema` given a `validator`, `rootSchema` and `rawFormData` that is used to do the\n * potentially recursive resolution.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which retrieving a schema is desired\n * @param [rootSchema={}] - The root schema that will be forwarded to all the APIs\n * @param [rawFormData] - The current formData, if any, to assist retrieving a schema\n * @returns - The schema having its conditions, additional properties, references and dependencies resolved\n */\nexport default function retrieveSchema<T = any>(\n validator: ValidatorType,\n schema: RJSFSchema,\n rootSchema: RJSFSchema = {},\n rawFormData?: T\n): RJSFSchema {\n if (!isObject(schema)) {\n return {};\n }\n let resolvedSchema = resolveSchema<T>(\n validator,\n schema,\n rootSchema,\n rawFormData\n );\n\n if (\"if\" in schema) {\n return resolveCondition<T>(validator, schema, rootSchema, rawFormData as T);\n }\n\n const formData: GenericObjectType = rawFormData || {};\n // For each level of the dependency, we need to recursively determine the appropriate resolved schema given the current state of formData.\n // Otherwise, nested allOf subschemas will not be correctly displayed.\n if (resolvedSchema.properties) {\n const properties: GenericObjectType = {};\n\n Object.entries(resolvedSchema.properties).forEach((entries) => {\n const propName = entries[0];\n const propSchema = entries[1] as RJSFSchema;\n const rawPropData = formData[propName];\n const propData = isObject(rawPropData) ? rawPropData : {};\n const resolvedPropSchema = retrieveSchema<T>(\n validator,\n propSchema,\n rootSchema,\n propData\n );\n\n properties[propName] = resolvedPropSchema;\n\n if (\n propSchema !== resolvedPropSchema &&\n resolvedSchema.properties !== properties\n ) {\n resolvedSchema = { ...resolvedSchema, properties };\n }\n });\n }\n\n if (ALL_OF_KEY in schema) {\n try {\n resolvedSchema = mergeAllOf({\n ...resolvedSchema,\n allOf: resolvedSchema.allOf,\n });\n } catch (e) {\n console.warn(\"could not merge subschemas in allOf:\\n\" + e);\n const { allOf, ...resolvedSchemaWithoutAllOf } = resolvedSchema;\n return resolvedSchemaWithoutAllOf;\n }\n }\n const hasAdditionalProperties =\n ADDITIONAL_PROPERTIES_KEY in resolvedSchema &&\n resolvedSchema.additionalProperties !== false;\n if (hasAdditionalProperties) {\n return stubExistingAdditionalProperties<T>(\n validator,\n resolvedSchema,\n rootSchema,\n formData as T\n );\n }\n return resolvedSchema;\n}\n\n/** Resolves dependencies within a schema and its 'allOf' children.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which resolving a dependency is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param [formData] - The current formData, if any, to assist retrieving a schema\n * @returns - The schema with its dependencies resolved\n */\nexport function resolveDependencies<T = any>(\n validator: ValidatorType,\n schema: RJSFSchema,\n rootSchema: RJSFSchema,\n formData?: T\n): RJSFSchema {\n // Drop the dependencies from the source schema.\n const { dependencies, ...remainingSchema } = schema;\n let resolvedSchema = remainingSchema;\n if (Array.isArray(resolvedSchema.oneOf)) {\n resolvedSchema = resolvedSchema.oneOf[\n getMatchingOption<T>(\n validator,\n formData,\n resolvedSchema.oneOf as RJSFSchema[],\n rootSchema\n )\n ] as RJSFSchema;\n } else if (Array.isArray(resolvedSchema.anyOf)) {\n resolvedSchema = resolvedSchema.anyOf[\n getMatchingOption<T>(\n validator,\n formData,\n resolvedSchema.anyOf as RJSFSchema[],\n rootSchema\n )\n ] as RJSFSchema;\n }\n return processDependencies<T>(\n validator,\n dependencies,\n resolvedSchema,\n rootSchema,\n formData\n );\n}\n\n/** Processes all the `dependencies` recursively into the `resolvedSchema` as needed\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param dependencies - The set of dependencies that needs to be processed\n * @param resolvedSchema - The schema for which processing dependencies is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param [formData] - The current formData, if any, to assist retrieving a schema\n * @returns - The schema with the `dependencies` resolved into it\n */\nexport function processDependencies<T = any>(\n validator: ValidatorType,\n dependencies: RJSFSchema[\"dependencies\"],\n resolvedSchema: RJSFSchema,\n rootSchema: RJSFSchema,\n formData?: T\n): RJSFSchema {\n let schema = resolvedSchema;\n // Process dependencies updating the local schema properties as appropriate.\n for (const dependencyKey in dependencies) {\n // Skip this dependency if its trigger property is not present.\n if (get(formData, [dependencyKey]) === undefined) {\n continue;\n }\n // Skip this dependency if it is not included in the schema (such as when dependencyKey is itself a hidden dependency.)\n if (schema.properties && !(dependencyKey in schema.properties)) {\n continue;\n }\n const [remainingDependencies, dependencyValue] = splitKeyElementFromObject(\n dependencyKey,\n dependencies as GenericObjectType\n );\n if (Array.isArray(dependencyValue)) {\n schema = withDependentProperties(schema, dependencyValue);\n } else if (isObject(dependencyValue)) {\n schema = withDependentSchema<T>(\n validator,\n schema,\n rootSchema,\n dependencyKey,\n dependencyValue as RJSFSchema,\n formData\n );\n }\n return processDependencies<T>(\n validator,\n remainingDependencies,\n schema,\n rootSchema,\n formData\n );\n }\n return schema;\n}\n\n/** Updates a schema with additionally required properties added\n *\n * @param schema - The schema for which resolving a dependent properties is desired\n * @param [additionallyRequired] - An optional array of additionally required names\n * @returns - The schema with the additional required values merged in\n */\nexport function withDependentProperties(\n schema: RJSFSchema,\n additionallyRequired?: string[]\n) {\n if (!additionallyRequired) {\n return schema;\n }\n const required = Array.isArray(schema.required)\n ? Array.from(new Set([...schema.required, ...additionallyRequired]))\n : additionallyRequired;\n return { ...schema, required: required };\n}\n\n/** Merges a dependent schema into the `schema` dealing with oneOfs and references\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param schema - The schema for which resolving a dependent schema is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param dependencyKey - The key name of the dependency\n * @param dependencyValue - The potentially dependent schema\n * @param formData- The current formData to assist retrieving a schema\n * @returns - The schema with the dependent schema resolved into it\n */\nexport function withDependentSchema<T>(\n validator: ValidatorType,\n schema: RJSFSchema,\n rootSchema: RJSFSchema,\n dependencyKey: string,\n dependencyValue: RJSFSchema,\n formData?: T\n) {\n const { oneOf, ...dependentSchema } = retrieveSchema<T>(\n validator,\n dependencyValue,\n rootSchema,\n formData\n );\n schema = mergeSchemas(schema, dependentSchema);\n // Since it does not contain oneOf, we return the original schema.\n if (oneOf === undefined) {\n return schema;\n }\n // Resolve $refs inside oneOf.\n const resolvedOneOf = oneOf.map((subschema) => {\n if (typeof subschema === \"boolean\" || !(REF_KEY in subschema)) {\n return subschema;\n }\n return resolveReference<T>(\n validator,\n subschema as RJSFSchema,\n rootSchema,\n formData\n );\n });\n return withExactlyOneSubschema<T>(\n validator,\n schema,\n rootSchema,\n dependencyKey,\n resolvedOneOf,\n formData\n );\n}\n\n/** Returns a `schema` with the best choice from the `oneOf` options merged into it\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used to validate oneOf options\n * @param schema - The schema for which resolving a oneOf subschema is desired\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @param dependencyKey - The key name of the oneOf dependency\n * @param oneOf - The list of schemas representing the oneOf options\n * @param [formData] - The current formData to assist retrieving a schema\n * @returns The schema with best choice of oneOf schemas merged into\n */\nexport function withExactlyOneSubschema<T = any>(\n validator: ValidatorType,\n schema: RJSFSchema,\n rootSchema: RJSFSchema,\n dependencyKey: string,\n oneOf: RJSFSchemaDefinition[],\n formData?: T\n) {\n const validSubschemas = oneOf.filter((subschema) => {\n if (typeof subschema === \"boolean\" || !subschema.properties) {\n return false;\n }\n const { [dependencyKey]: conditionPropertySchema } = subschema.properties;\n if (conditionPropertySchema) {\n const conditionSchema: RJSFSchema = {\n type: \"object\",\n properties: {\n [dependencyKey]: conditionPropertySchema,\n },\n };\n const { errors } = validator.validateFormData(formData, conditionSchema);\n return errors.length === 0;\n }\n return false;\n });\n\n if (validSubschemas.length !== 1) {\n console.warn(\n \"ignoring oneOf in dependencies because there isn't exactly one subschema that is valid\"\n );\n return schema;\n }\n const subschema: RJSFSchema = validSubschemas[0] as RJSFSchema;\n const [dependentSubschema] = splitKeyElementFromObject(\n dependencyKey,\n subschema.properties as GenericObjectType\n );\n const dependentSchema = { ...subschema, properties: dependentSubschema };\n return mergeSchemas(\n schema,\n retrieveSchema<T>(validator, dependentSchema, rootSchema, formData)\n );\n}\n","import isConstant from \"../isConstant\";\nimport { RJSFSchema, ValidatorType } from \"../types\";\nimport retrieveSchema from \"./retrieveSchema\";\n\n/** Checks to see if the `schema` combination represents a select\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param theSchema - The schema for which check for a select flag is desired\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @returns - True if schema contains a select, otherwise false\n */\nexport default function isSelect<T = any>(\n validator: ValidatorType,\n theSchema: RJSFSchema,\n rootSchema: RJSFSchema = {}\n) {\n const schema = retrieveSchema<T>(validator, theSchema, rootSchema, undefined);\n const altSchemas = schema.oneOf || schema.anyOf;\n if (Array.isArray(schema.enum)) {\n return true;\n }\n if (Array.isArray(altSchemas)) {\n return altSchemas.every(\n (altSchemas) => typeof altSchemas !== \"boolean\" && isConstant(altSchemas)\n );\n }\n return false;\n}\n","import { RJSFSchema, ValidatorType } from \"../types\";\n\nimport isSelect from \"./isSelect\";\n\n/** Checks to see if the `schema` combination represents a multi-select\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which check for a multi-select flag is desired\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @returns - True if schema contains a multi-select, otherwise false\n */\nexport default function isMultiSelect<T = any>(\n validator: ValidatorType,\n schema: RJSFSchema,\n rootSchema?: RJSFSchema\n) {\n if (\n !schema.uniqueItems ||\n !schema.items ||\n typeof schema.items === \"boolean\"\n ) {\n return false;\n }\n return isSelect<T>(validator, schema.items as RJSFSchema, rootSchema);\n}\n","import get from \"lodash/get\";\n\nimport {\n ANY_OF_KEY,\n DEFAULT_KEY,\n DEPENDENCIES_KEY,\n PROPERTIES_KEY,\n ONE_OF_KEY,\n REF_KEY,\n} from \"../constants\";\nimport findSchemaDefinition from \"../findSchemaDefinition\";\nimport getMatchingOption from \"./getMatchingOption\";\nimport getSchemaType from \"../getSchemaType\";\nimport isObject from \"../isObject\";\nimport isFixedItems from \"../isFixedItems\";\nimport mergeDefaultsWithFormData from \"../mergeDefaultsWithFormData\";\nimport mergeObjects from \"../mergeObjects\";\nimport { GenericObjectType, RJSFSchema, ValidatorType } from \"../types\";\nimport isMultiSelect from \"./isMultiSelect\";\nimport retrieveSchema, { resolveDependencies } from \"./retrieveSchema\";\n\n/** Enum that indicates how `schema.additionalItems` should be handled by the `getInnerSchemaForArrayItem()` function.\n */\nexport enum AdditionalItemsHandling {\n Ignore,\n Invert,\n Fallback,\n}\n\n/** Given a `schema` will return an inner schema that for an array item. This is computed differently based on the\n * `additionalItems` enum and the value of `idx`. There are four possible returns:\n * 1. If `idx` is >= 0, then if `schema.items` is an array the `idx`th element of the array is returned if it is a valid\n * index and not a boolean, otherwise it falls through to 3.\n * 2. If `schema.items` is not an array AND truthy and not a boolean, then `schema.items` is returned since it actually\n * is a schema, otherwise it falls through to 3.\n * 3. If `additionalItems` is not `AdditionalItemsHandling.Ignore` and `schema.additionalItems` is an object, then\n * `schema.additionalItems` is returned since it actually is a schema, otherwise it falls through to 4.\n * 4. {} is returned representing an empty schema\n *\n * @param schema - The schema from which to get the particular item\n * @param [additionalItems=AdditionalItemsHandling.Ignore] - How do we want to handle additional items?\n * @param [idx=-1] - Index, if non-negative, will be used to return the idx-th element in a `schema.items` array\n * @returns - The best fit schema object from the `schema` given the `additionalItems` and `idx` modifiers\n */\nexport function getInnerSchemaForArrayItem(\n schema: RJSFSchema,\n additionalItems: AdditionalItemsHandling = AdditionalItemsHandling.Ignore,\n idx = -1\n): RJSFSchema {\n if (idx >= 0) {\n if (Array.isArray(schema.items) && idx < schema.items.length) {\n const item = schema.items[idx];\n if (typeof item !== \"boolean\") {\n return item;\n }\n }\n } else if (\n schema.items &&\n !Array.isArray(schema.items) &&\n typeof schema.items !== \"boolean\"\n ) {\n return schema.items;\n }\n if (\n additionalItems !== AdditionalItemsHandling.Ignore &&\n isObject(schema.additionalItems)\n ) {\n return schema.additionalItems as RJSFSchema;\n }\n return {};\n}\n\n/** Computes the defaults for the current `schema` given the `rawFormData` and `parentDefaults` if any. This drills into\n * the each level of the schema, recursively, to fill out every level of defaults provided by the schema.\n *\n * @param validator - an implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which the default state is desired\n * @param [parentDefaults] - Any defaults provided by the parent field in the schema\n * @param [rootSchema] - The options root schema, used to primarily to look up `$ref`s\n * @param [rawFormData] - The current formData, if any, onto which to provide any missing defaults\n * @param [includeUndefinedValues=false] - Optional flag, if true, cause undefined values to be added as defaults\n * @returns - The resulting `formData` with all the defaults provided\n */\nexport function computeDefaults<T = any>(\n validator: ValidatorType,\n schema: RJSFSchema,\n parentDefaults?: T,\n rootSchema: RJSFSchema = {},\n rawFormData?: T,\n includeUndefinedValues = false\n): T | T[] | undefined {\n const formData = isObject(rawFormData) ? rawFormData : {};\n // Compute the defaults recursively: give highest priority to deepest nodes.\n let defaults: T | T[] | undefined = parentDefaults;\n if (isObject(defaults) && isObject(schema.default)) {\n // For object defaults, only override parent defaults that are defined in\n // schema.default.\n defaults = mergeObjects(\n defaults!,\n schema.default as GenericObjectType\n ) as T;\n } else if (DEFAULT_KEY in schema) {\n defaults = schema.default as unknown as T;\n } else if (REF_KEY in schema) {\n // Use referenced schema defaults for this node.\n const refSchema = findSchemaDefinition(schema[REF_KEY]!, rootSchema);\n return computeDefaults<T>(\n validator,\n refSchema,\n defaults,\n rootSchema,\n formData as T,\n includeUndefinedValues\n );\n } else if (DEPENDENCIES_KEY in schema) {\n const resolvedSchema = resolveDependencies(\n validator,\n schema,\n rootSchema,\n formData\n );\n return computeDefaults<T>(\n validator,\n resolvedSchema,\n defaults,\n rootSchema,\n formData as T,\n includeUndefinedValues\n );\n } else if (isFixedItems(schema)) {\n defaults = (schema.items! as RJSFSchema[]).map(\n (itemSchema: RJSFSchema, idx: number) =>\n computeDefaults<T>(\n validator,\n itemSchema,\n Array.isArray(parentDefaults) ? parentDefaults[idx] : undefined,\n rootSchema,\n formData as T,\n includeUndefinedValues\n )\n ) as T[];\n } else if (ONE_OF_KEY in schema) {\n schema = schema.oneOf![\n getMatchingOption(\n validator,\n undefined,\n schema.oneOf as RJSFSchema[],\n rootSchema\n )\n ] as RJSFSchema;\n } else if (ANY_OF_KEY in schema) {\n schema = schema.anyOf![\n getMatchingOption(\n validator,\n undefined,\n schema.anyOf as RJSFSchema[],\n rootSchema\n )\n ] as RJSFSchema;\n }\n\n // Not defaults defined for this node, fallback to generic typed ones.\n if (typeof defaults === \"undefined\") {\n defaults = schema.default as unknown as T;\n }\n\n switch (getSchemaType(schema)) {\n // We need to recur for object schema inner default values.\n case \"object\":\n return Object.keys(schema.properties || {}).reduce(\n (acc: GenericObjectType, key: string) => {\n // Compute the defaults for this node, with the parent defaults we might\n // have from a previous run: defaults[key].\n const computedDefault = computeDefaults<T>(\n validator,\n get(schema, [PROPERTIES_KEY, key]),\n get(defaults, [key]),\n rootSchema,\n get(formData, [key]),\n includeUndefinedValues\n );\n if (includeUndefinedValues || computedDefault !== undefined) {\n acc[key] = computedDefault;\n }\n return acc;\n },\n {}\n ) as T;\n\n case \"array\":\n // Inject defaults into existing array defaults\n if (Array.isArray(defaults)) {\n defaults = defaults.map((item, idx) => {\n const schemaItem: RJSFSchema = getInnerSchemaForArrayItem(\n schema,\n AdditionalItemsHandling.Fallback,\n idx\n );\n return computeDefaults<T>(validator, schemaItem, item, rootSchema);\n }) as T[];\n }\n\n // Deeply inject defaults into already existing form data\n if (Array.isArray(rawFormData)) {\n const schemaItem: RJSFSchema = getInnerSchemaForArrayItem(schema);\n defaults = rawFormData.map((item: T, idx: number) => {\n return computeDefaults<T>(\n validator,\n schemaItem,\n get(defaults, [idx]),\n rootSchema,\n item\n );\n }) as T[];\n }\n if (schema.minItems) {\n if (!isMultiSelect<T>(validator, schema, rootSchema)) {\n const defaultsLength = Array.isArray(defaults) ? defaults.length : 0;\n if (schema.minItems > defaultsLength) {\n const defaultEntries: T[] = (defaults || []) as T[];\n // populate the array with the defaults\n const fillerSchema: RJSFSchema = getInnerSchemaForArrayItem(\n schema,\n AdditionalItemsHandling.Invert\n );\n const fillerDefault = fillerSchema.default;\n const fillerEntries: T[] = new Array(\n schema.minItems - defaultsLength\n ).fill(\n computeDefaults<any>(\n validator,\n fillerSchema,\n fillerDefault,\n rootSchema\n )\n ) as T[];\n // then fill up the rest with either the item default or empty, up to minItems\n return defaultEntries.concat(fillerEntries);\n }\n }\n return defaults ? defaults : [];\n }\n }\n return defaults;\n}\n\n/** Returns the superset of `formData` that includes the given set updated to include any missing fields that have\n * computed to have defaults provided in the `schema`.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param theSchema - The schema for which the default state is desired\n * @param [formData] - The current formData, if any, onto which to provide any missing defaults\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @param [includeUndefinedValues=false] - Optional flag, if true, cause undefined values to be added as defaults\n * @returns - The resulting `formData` with all the defaults provided\n */\nexport default function getDefaultFormState<T = any>(\n validator: ValidatorType,\n theSchema: RJSFSchema,\n formData?: T,\n rootSchema?: RJSFSchema,\n includeUndefinedValues = false\n) {\n if (!isObject(theSchema)) {\n throw new Error(\"Invalid schema: \" + theSchema);\n }\n const schema = retrieveSchema<T>(validator, theSchema, rootSchema, formData);\n const defaults = computeDefaults<T>(\n validator,\n schema,\n undefined,\n rootSchema,\n formData,\n includeUndefinedValues\n );\n if (\n typeof formData === \"undefined\" ||\n formData === null ||\n (typeof formData === \"number\" && isNaN(formData))\n ) {\n // No form data? Use schema defaults.\n return defaults;\n }\n if (isObject(formData)) {\n return mergeDefaultsWithFormData<T>(defaults as T, formData);\n }\n if (Array.isArray(formData)) {\n return mergeDefaultsWithFormData<T[]>(defaults as T[], formData);\n }\n return formData;\n}\n","import getUiOptions from \"./getUiOptions\";\nimport { UiSchema } from \"./types\";\n\n/** Checks to see if the `uiSchema` contains the `widget` field and that the widget is not `hidden`\n *\n * @param uiSchema - The UI Schema from which to detect if it is customized\n * @returns - True if the `uiSchema` describes a custom widget, false otherwise\n */\nexport default function isCustomWidget<T = any, F = any>(\n uiSchema: UiSchema<T, F> = {}\n) {\n return (\n // TODO: Remove the `&& uiSchema['ui:widget'] !== 'hidden'` once we support hidden widgets for arrays.\n // https://react-jsonschema-form.readthedocs.io/en/latest/usage/widgets/#hidden-widgets\n \"widget\" in getUiOptions<T, F>(uiSchema) &&\n getUiOptions<T, F>(uiSchema)[\"widget\"] !== \"hidden\"\n );\n}\n","import { UI_WIDGET_KEY } from \"../constants\";\nimport { RJSFSchema, UiSchema, ValidatorType } from \"../types\";\nimport retrieveSchema from \"./retrieveSchema\";\n\n/** Checks to see if the `schema` and `uiSchema` combination represents an array of files\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which check for array of files flag is desired\n * @param [uiSchema={}] - The UI schema from which to check the widget\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @returns - True if schema/uiSchema contains an array of files, otherwise false\n */\nexport default function isFilesArray<T = any, F = any>(\n validator: ValidatorType,\n schema: RJSFSchema,\n uiSchema: UiSchema<T, F> = {},\n rootSchema?: RJSFSchema\n) {\n if (uiSchema[UI_WIDGET_KEY] === \"files\") {\n return true;\n }\n if (schema.items) {\n const itemsSchema = retrieveSchema<T>(\n validator,\n schema.items as RJSFSchema,\n rootSchema\n );\n return itemsSchema.type === \"string\" && itemsSchema.format === \"data-url\";\n }\n return false;\n}\n","import { UI_FIELD_KEY, UI_WIDGET_KEY } from \"../constants\";\nimport getSchemaType from \"../getSchemaType\";\nimport getUiOptions from \"../getUiOptions\";\nimport isCustomWidget from \"../isCustomWidget\";\nimport { RJSFSchema, UiSchema, ValidatorType } from \"../types\";\nimport isFilesArray from \"./isFilesArray\";\nimport isMultiSelect from \"./isMultiSelect\";\n\n/** Determines whether the combination of `schema` and `uiSchema` properties indicates that the label for the `schema`\n * should be displayed in a UI.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which the display label flag is desired\n * @param [uiSchema={}] - The UI schema from which to derive potentially displayable information\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @returns - True if the label should be displayed or false if it should not\n */\nexport default function getDisplayLabel<T = any, F = any>(\n validator: ValidatorType,\n schema: RJSFSchema,\n uiSchema: UiSchema<T, F> = {},\n rootSchema?: RJSFSchema\n): boolean {\n const uiOptions = getUiOptions<T, F>(uiSchema);\n const { label = true } = uiOptions;\n let displayLabel = !!label;\n const schemaType = getSchemaType(schema);\n\n if (schemaType === \"array\") {\n displayLabel =\n isMultiSelect<T>(validator, schema, rootSchema) ||\n isFilesArray<T, F>(validator, schema, uiSchema, rootSchema) ||\n isCustomWidget(uiSchema);\n }\n\n if (schemaType === \"object\") {\n displayLabel = false;\n }\n if (schemaType === \"boolean\" && !uiSchema[UI_WIDGET_KEY]) {\n displayLabel = false;\n }\n if (uiSchema[UI_FIELD_KEY]) {\n displayLabel = false;\n }\n return displayLabel;\n}\n","import isEmpty from \"lodash/isEmpty\";\n\nimport mergeObjects from \"../mergeObjects\";\nimport { ErrorSchema, ValidationData, ValidatorType } from \"../types\";\n\n/** Merges the errors in `additionalErrorSchema` into the existing `validationData` by combining the hierarchies in the\n * two `ErrorSchema`s and then appending the error list from the `additionalErrorSchema` obtained by calling\n * `validator.toErrorList()` onto the `errors` in the `validationData`. If no `additionalErrorSchema` is passed, then\n * `validationData` is returned.\n *\n * @param validator - The validator used to convert an ErrorSchema to a list of errors\n * @param validationData - The current `ValidationData` into which to merge the additional errors\n * @param [additionalErrorSchema] - The additional set of errors in an `ErrorSchema`\n * @returns - The `validationData` with the additional errors from `additionalErrorSchema` merged into it, if provided.\n */\nexport default function mergeValidationData<T = any>(\n validator: ValidatorType<T>,\n validationData: ValidationData<T>,\n additionalErrorSchema?: ErrorSchema<T>\n): ValidationData<T> {\n if (!additionalErrorSchema) {\n return validationData;\n }\n const { errors: oldErrors, errorSchema: oldErrorSchema } = validationData;\n let errors = validator.toErrorList(additionalErrorSchema);\n let errorSchema = additionalErrorSchema;\n if (!isEmpty(oldErrorSchema)) {\n errorSchema = mergeObjects(\n oldErrorSchema,\n additionalErrorSchema,\n true\n ) as ErrorSchema<T>;\n errors = [...oldErrors].concat(errors);\n }\n return { errorSchema, errors };\n}\n","import get from \"lodash/get\";\n\nimport {\n ALL_OF_KEY,\n DEPENDENCIES_KEY,\n ID_KEY,\n ITEMS_KEY,\n PROPERTIES_KEY,\n REF_KEY,\n} from \"../constants\";\nimport isObject from \"../isObject\";\nimport { IdSchema, RJSFSchema, ValidatorType } from \"../types\";\nimport retrieveSchema from \"./retrieveSchema\";\n\n/** Generates an `IdSchema` object for the `schema`, recursively\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which the `IdSchema` is desired\n * @param [id] - The base id for the schema\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @param [formData] - The current formData, if any, to assist retrieving a schema\n * @param [idPrefix='root'] - The prefix to use for the id\n * @param [idSeparator='_'] - The separator to use for the path segments in the id\n * @returns - The `IdSchema` object for the `schema`\n */\nexport default function toIdSchema<T = any>(\n validator: ValidatorType,\n schema: RJSFSchema,\n id?: string | null,\n rootSchema?: RJSFSchema,\n formData?: T,\n idPrefix = \"root\",\n idSeparator = \"_\"\n): IdSchema<T> {\n if (REF_KEY in schema || DEPENDENCIES_KEY in schema || ALL_OF_KEY in schema) {\n const _schema = retrieveSchema<T>(validator, schema, rootSchema, formData);\n return toIdSchema<T>(\n validator,\n _schema,\n id,\n rootSchema,\n formData,\n idPrefix,\n idSeparator\n );\n }\n if (ITEMS_KEY in schema && !get(schema, [ITEMS_KEY, REF_KEY])) {\n return toIdSchema<T>(\n validator,\n get(schema, ITEMS_KEY) as RJSFSchema,\n id,\n rootSchema,\n formData,\n idPrefix,\n idSeparator\n );\n }\n const $id = id || idPrefix;\n const idSchema: IdSchema = { $id } as IdSchema<T>;\n if (schema.type === \"object\" && PROPERTIES_KEY in schema) {\n for (const name in schema.properties) {\n const field = get(schema, [PROPERTIES_KEY, name]);\n const fieldId = idSchema[ID_KEY] + idSeparator + name;\n idSchema[name] = toIdSchema<T>(\n validator,\n isObject(field) ? field : {},\n fieldId,\n rootSchema,\n // It's possible that formData is not an object -- this can happen if an\n // array item has just been added, but not populated with data yet\n get(formData, [name]),\n idPrefix,\n idSeparator\n );\n }\n }\n return idSchema as IdSchema<T>;\n}\n","import get from \"lodash/get\";\nimport set from \"lodash/set\";\n\nimport {\n ALL_OF_KEY,\n ADDITIONAL_PROPERTIES_KEY,\n DEPENDENCIES_KEY,\n ITEMS_KEY,\n NAME_KEY,\n PROPERTIES_KEY,\n REF_KEY,\n RJSF_ADDITONAL_PROPERTIES_FLAG,\n} from \"../constants\";\nimport { PathSchema, RJSFSchema, ValidatorType } from \"../types\";\nimport retrieveSchema from \"./retrieveSchema\";\n\n/** Generates an `PathSchema` object for the `schema`, recursively\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary\n * @param schema - The schema for which the `PathSchema` is desired\n * @param [name=''] - The base name for the schema\n * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s\n * @param [formData] - The current formData, if any, to assist retrieving a schema\n * @returns - The `PathSchema` object for the `schema`\n */\nexport default function toPathSchema<T = any>(\n validator: ValidatorType,\n schema: RJSFSchema,\n name = \"\",\n rootSchema?: RJSFSchema,\n formData?: T\n): PathSchema<T> {\n if (REF_KEY in schema || DEPENDENCIES_KEY in schema || ALL_OF_KEY in schema) {\n const _schema = retrieveSchema<T>(validator, schema, rootSchema, formData);\n return toPathSchema<T>(validator, _schema, name, rootSchema, formData);\n }\n\n const pathSchema: PathSchema = {\n [NAME_KEY]: name.replace(/^\\./, \"\"),\n } as PathSchema;\n\n if (\n ADDITIONAL_PROPERTIES_KEY in schema &&\n schema[ADDITIONAL_PROPERTIES_KEY] === true\n ) {\n set(pathSchema, RJSF_ADDITONAL_PROPERTIES_FLAG, true);\n }\n\n if (ITEMS_KEY in schema && Array.isArray(formData)) {\n formData.forEach((element, i: number) => {\n pathSchema[i] = toPathSchema<T>(\n validator,\n schema.items as RJSFSchema,\n `${name}.${i}`,\n rootSchema,\n element\n );\n });\n } else if (PROPERTIES_KEY in schema) {\n for (const property in schema.properties) {\n const field = get(schema, [PROPERTIES_KEY, property]);\n pathSchema[property] = toPathSchema<T>(\n validator,\n field,\n `${name}.${property}`,\n rootSchema,\n // It's possible that formData is not an object -- this can happen if an\n // array item has just been added, but not populated with data yet\n get(formData, [property])\n );\n }\n }\n return pathSchema as PathSchema<T>;\n}\n","import deepEquals from \"./deepEquals\";\nimport {\n ErrorSchema,\n IdSchema,\n PathSchema,\n RJSFSchema,\n SchemaUtilsType,\n UiSchema,\n ValidationData,\n ValidatorType,\n} from \"./types\";\nimport {\n getDefaultFormState,\n getDisplayLabel,\n getMatchingOption,\n isFilesArray,\n isMultiSelect,\n isSelect,\n mergeValidationData,\n retrieveSchema,\n toIdSchema,\n toPathSchema,\n} from \"./schema\";\n\n/** The `SchemaUtils` class provides a wrapper around the publicly exported APIs in the `utils/schema` directory such\n * that one does not have to explicitly pass the `validator` or `rootSchema` to each method. Since both the `validator`\n * and `rootSchema` generally does not change across a `Form`, this allows for providing a simplified set of APIs to the\n * `@rjsf/core` components and the various themes as well. This class implements the `SchemaUtilsType` interface.\n */\nclass SchemaUtils<T = any> implements SchemaUtilsType<T> {\n rootSchema: RJSFSchema;\n validator: ValidatorType;\n\n /** Constructs the `SchemaUtils` instance with the given `validator` and `rootSchema` stored as instance variables\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n */\n constructor(validator: ValidatorType, rootSchema: RJSFSchema) {\n this.rootSchema = rootSchema;\n this.validator = validator;\n }\n\n /** Returns the `ValidatorType` in the `SchemaUtilsType`\n *\n * @returns - The `ValidatorType`\n */\n getValidator() {\n return this.validator;\n }\n\n /** Determines whether either the `validator` and `rootSchema` differ from the ones associated with this instance of\n * the `SchemaUtilsType`. If either `validator` or `rootSchema` are falsy, then return false to prevent the creation\n * of a new `SchemaUtilsType` with incomplete properties.\n *\n * @param validator - An implementation of the `ValidatorType` interface that will be compared against the current one\n * @param rootSchema - The root schema that will be compared against the current one\n * @returns - True if the `SchemaUtilsType` differs from the given `validator` or `rootSchema`\n */\n doesSchemaUtilsDiffer(\n validator: ValidatorType,\n rootSchema: RJSFSchema\n ): boolean {\n if (!validator || !rootSchema) {\n return false;\n }\n return (\n this.validator !== validator || !deepEquals(this.rootSchema, rootSchema)\n );\n }\n\n /** Returns the superset of `formData` that includes the given set updated to include any missing fields that have\n * computed to have defaults provided in the `schema`.\n *\n * @param schema - The schema for which the default state is desired\n * @param [formData] - The current formData, if any, onto which to provide any missing defaults\n * @param [includeUndefinedValues=false] - Optional flag, if true, cause undefined values to be added as defaults\n * @returns - The resulting `formData` with all the defaults provided\n */\n getDefaultFormState(\n schema: RJSFSchema,\n formData?: T,\n includeUndefinedValues = false\n ): T | T[] | undefined {\n return getDefaultFormState<T>(\n this.validator,\n schema,\n formData,\n this.rootSchema,\n includeUndefinedValues\n );\n }\n\n /** Determines whether the combination of `schema` and `uiSchema` properties indicates that the label for the `schema`\n * should be displayed in a UI.\n *\n * @param schema - The schema for which the display label flag is desired\n * @param [uiSchema] - The UI schema from which to derive potentially displayable information\n * @returns - True if the label should be displayed or false if it should not\n */\n getDisplayLabel<F = any>(schema: RJSFSchema, uiSchema?: UiSchema<T, F>) {\n return getDisplayLabel<T, F>(\n this.validator,\n schema,\n uiSchema,\n this.rootSchema\n );\n }\n\n /** Given the `formData` and list of `options`, attempts to find the index of the option that best matches the data.\n *\n * @param formData - The current formData, if any, onto which to provide any missing defaults\n * @param options - The list of options to find a matching options from\n * @returns - The index of the matched option or 0 if none is available\n */\n getMatchingOption(formData: T, options: RJSFSchema[]) {\n return getMatchingOption<T>(\n this.validator,\n formData,\n options,\n this.rootSchema\n );\n }\n\n /** Checks to see if the `schema` and `uiSchema` combination represents an array of files\n *\n * @param schema - The schema for which check for array of files flag is desired\n * @param [uiSchema] - The UI schema from which to check the widget\n * @returns - True if schema/uiSchema contains an array of files, otherwise false\n */\n isFilesArray<F = any>(schema: RJSFSchema, uiSchema?: UiSchema<T, F>) {\n return isFilesArray<T, F>(\n this.validator,\n schema,\n uiSchema,\n this.rootSchema\n );\n }\n\n /** Checks to see if the `schema` combination represents a multi-select\n *\n * @param schema - The schema for which check for a multi-select flag is desired\n * @returns - True if schema contains a multi-select, otherwise false\n */\n isMultiSelect(schema: RJSFSchema) {\n return isMultiSelect<T>(this.validator, schema, this.rootSchema);\n }\n\n /** Checks to see if the `schema` combination represents a select\n *\n * @param schema - The schema for which check for a select flag is desired\n * @returns - True if schema contains a select, otherwise false\n */\n isSelect(schema: RJSFSchema) {\n return isSelect<T>(this.validator, schema, this.rootSchema);\n }\n\n /** Merges the errors in `additionalErrorSchema` into the existing `validationData` by combining the hierarchies in\n * the two `ErrorSchema`s and then appending the error list from the `additionalErrorSchema` obtained by calling\n * `getValidator().toErrorList()` onto the `errors` in the `validationData`. If no `additionalErrorSchema` is passed,\n * then `validationData` is returned.\n *\n * @param validationData - The current `ValidationData` into which to merge the additional errors\n * @param [additionalErrorSchema] - The additional set of errors\n * @returns - The `validationData` with the additional errors from `additionalErrorSchema` merged into it, if provided.\n */\n mergeValidationData(\n validationData: ValidationData<T>,\n additionalErrorSchema?: ErrorSchema<T>\n ): ValidationData<T> {\n return mergeValidationData<T>(\n this.validator,\n validationData,\n additionalErrorSchema\n );\n }\n\n /** Retrieves an expanded schema that has had all of its conditions, additional properties, references and\n * dependencies resolved and merged into the `schema` given a `rawFormData` that is used to do the potentially\n * recursive resolution.\n *\n * @param schema - The schema for which retrieving a schema is desired\n * @param [rawFormData] - The current formData, if any, to assist retrieving a schema\n * @returns - The schema having its conditions, additional properties, references and dependencies resolved\n */\n retrieveSchema(schema: RJSFSchema, rawFormData: T) {\n return retrieveSchema<T>(\n this.validator,\n schema,\n this.rootSchema,\n rawFormData\n );\n }\n\n /** Generates an `IdSchema` object for the `schema`, recursively\n *\n * @param schema - The schema for which the display label flag is desired\n * @param [id] - The base id for the schema\n * @param [formData] - The current formData, if any, onto which to provide any missing defaults\n * @param [idPrefix='root'] - The prefix to use for the id\n * @param [idSeparator='_'] - The separator to use for the path segments in the id\n * @returns - The `IdSchema` object for the `schema`\n */\n toIdSchema(\n schema: RJSFSchema,\n id?: string | null,\n formData?: T,\n idPrefix = \"root\",\n idSeparator = \"_\"\n ): IdSchema<T> {\n return toIdSchema<T>(\n this.validator,\n schema,\n id,\n this.rootSchema,\n formData,\n idPrefix,\n idSeparator\n );\n }\n\n /** Generates an `PathSchema` object for the `schema`, recursively\n *\n * @param schema - The schema for which the display label flag is desired\n * @param [name] - The base name for the schema\n * @param [formData] - The current formData, if any, onto which to provide any missing defaults\n * @returns - The `PathSchema` object for the `schema`\n */\n toPathSchema(schema: RJSFSchema, name?: string, formData?: T): PathSchema<T> {\n return toPathSchema<T>(\n this.validator,\n schema,\n name,\n this.rootSchema,\n formData\n );\n }\n}\n\n/** Creates a `SchemaUtilsType` interface that is based around the given `validator` and `rootSchema` parameters. The\n * resulting interface implementation will forward the `validator` and `rootSchema` to all the wrapped APIs.\n *\n * @param validator - an implementation of the `ValidatorType` interface that will be forwarded to all the APIs\n * @param rootSchema - The root schema that will be forwarded to all the APIs\n * @returns - An implementation of a `SchemaUtilsType` interface\n */\nexport default function createSchemaUtils<T = any>(\n validator: ValidatorType,\n rootSchema: RJSFSchema\n): SchemaUtilsType<T> {\n return new SchemaUtils<T>(validator, rootSchema);\n}\n","import { RangeSpecType } from \"./types\";\nimport { RJSFSchema } from \"./types\";\n\n/** Extracts the range spec information `{ step?: number, min?: number, max?: number }` that can be spread onto an HTML\n * input from the range analog in the schema `{ multipleOf?: number, minimum?: number, maximum?: number }`.\n *\n * @param schema - The schema from which to extract the range spec\n * @returns - A range specification from the schema\n */\nexport default function rangeSpec(schema: RJSFSchema) {\n const spec: RangeSpecType = {};\n if (schema.multipleOf) {\n spec.step = schema.multipleOf;\n }\n if (schema.minimum || schema.minimum === 0) {\n spec.min = schema.minimum;\n }\n if (schema.maximum || schema.maximum === 0) {\n spec.max = schema.maximum;\n }\n return spec;\n}\n","import { SUBMIT_BTN_OPTIONS_KEY } from \"./constants\";\nimport getUiOptions from \"./getUiOptions\";\nimport { UiSchema, UISchemaSubmitButtonOptions } from \"./types\";\n\n/** The default submit button options, exported for testing purposes\n */\nexport const DEFAULT_OPTIONS: UISchemaSubmitButtonOptions = {\n props: {\n disabled: false,\n },\n submitText: \"Submit\",\n norender: false,\n};\n\n/** Extracts any `ui:submitButtonOptions` from the `uiSchema` and merges them onto the `DEFAULT_OPTIONS`\n *\n * @param [uiSchema={}] - the UI Schema from which to extract submit button props\n * @returns - The merging of the `DEFAULT_OPTIONS` with any custom ones\n */\nexport default function getSubmitButtonOptions<T = any, F = any>(\n uiSchema: UiSchema<T, F> = {}\n): UISchemaSubmitButtonOptions {\n const uiOptions = getUiOptions<T, F>(uiSchema);\n if (uiOptions && uiOptions[SUBMIT_BTN_OPTIONS_KEY]) {\n const options = uiOptions[\n SUBMIT_BTN_OPTIONS_KEY\n ] as UISchemaSubmitButtonOptions;\n return { ...DEFAULT_OPTIONS, ...options };\n }\n\n return DEFAULT_OPTIONS;\n}\n","import React from \"react\";\nimport ReactIs from \"react-is\";\nimport get from \"lodash/get\";\nimport set from \"lodash/set\";\n\nimport { RJSFSchema, Widget, RegistryWidgetsType } from \"./types\";\nimport getSchemaType from \"./getSchemaType\";\n\n/** The map of schema types to widget type to widget name\n */\nconst widgetMap: { [k: string]: { [j: string]: string } } = {\n boolean: {\n checkbox: \"CheckboxWidget\",\n radio: \"RadioWidget\",\n select: \"SelectWidget\",\n hidden: \"HiddenWidget\",\n },\n string: {\n text: \"TextWidget\",\n password: \"PasswordWidget\",\n email: \"EmailWidget\",\n hostname: \"TextWidget\",\n ipv4: \"TextWidget\",\n ipv6: \"TextWidget\",\n uri: \"URLWidget\",\n \"data-url\": \"FileWidget\",\n radio: \"RadioWidget\",\n select: \"SelectWidget\",\n textarea: \"TextareaWidget\",\n hidden: \"HiddenWidget\",\n date: \"DateWidget\",\n datetime: \"DateTimeWidget\",\n \"date-time\": \"DateTimeWidget\",\n \"alt-date\": \"AltDateWidget\",\n \"alt-datetime\": \"AltDateTimeWidget\",\n color: \"ColorWidget\",\n file: \"FileWidget\",\n },\n number: {\n text: \"TextWidget\",\n select: \"SelectWidget\",\n updown: \"UpDownWidget\",\n range: \"RangeWidget\",\n radio: \"RadioWidget\",\n hidden: \"HiddenWidget\",\n },\n integer: {\n text: \"TextWidget\",\n select: \"SelectWidget\",\n updown: \"UpDownWidget\",\n range: \"RangeWidget\",\n radio: \"RadioWidget\",\n hidden: \"HiddenWidget\",\n },\n array: {\n select: \"SelectWidget\",\n checkboxes: \"CheckboxesWidget\",\n files: \"FileWidget\",\n hidden: \"HiddenWidget\",\n },\n};\n\n/** Wraps the given widget with stateless functional component that will merge any `defaultProps.options` with the\n * `options` that are provided in the props. It will add the wrapper component as a `MergedWidget` property onto the\n * `Widget` so that future attempts to wrap `AWidget` will return the already existing wrapper.\n *\n * @param AWidget - A widget that will be wrapped or one that is already wrapped\n * @returns - The wrapper widget\n */\nfunction mergeWidgetOptions<T = any, F = any>(AWidget: Widget<T, F>) {\n let MergedWidget: Widget<T, F> = get(AWidget, \"MergedWidget\");\n // cache return value as property of widget for proper react reconciliation\n if (!MergedWidget) {\n const defaultOptions =\n (AWidget.defaultProps && AWidget.defaultProps.options) || {};\n MergedWidget = ({ options, ...props }) => {\n return <AWidget options={{ ...defaultOptions, ...options }} {...props} />;\n };\n set(AWidget, \"MergedWidget\", MergedWidget);\n }\n return MergedWidget;\n}\n\n/** Given a schema representing a field to render and either the name or actual `Widget` implementation, returns the\n * React component that is used to render the widget. If the `widget` is already a React component, then it is wrapped\n * with a `MergedWidget`. Otherwise an attempt is made to look up the widget inside of the `registeredWidgets` map based\n * on the schema type and `widget` name. If no widget component can be found an `Error` is thrown.\n *\n * @param schema - The schema for the field\n * @param [widget] - Either the name of the widget OR a `Widget` implementation to use\n * @param [registeredWidgets={}] - A registry of widget name to `Widget` implementation\n * @returns - The `Widget` component to use\n * @throws - An error if there is no `Widget` component that can be returned\n */\nexport default function getWidget<T = any, F = any>(\n schema: RJSFSchema,\n widget?: Widget<T, F> | string,\n registeredWidgets: RegistryWidgetsType<T, F> = {}\n): Widget<T, F> {\n const type = getSchemaType(schema);\n\n if (\n typeof widget === \"function\" ||\n (widget && ReactIs.isForwardRef(React.createElement(widget))) ||\n ReactIs.isMemo(widget)\n ) {\n return mergeWidgetOptions<T, F>(widget as Widget<T, F>);\n }\n\n if (typeof widget !== \"string\") {\n throw new Error(`Unsupported widget definition: ${typeof widget}`);\n }\n\n if (widget in registeredWidgets) {\n const registeredWidget = registeredWidgets[widget];\n return getWidget<T, F>(schema, registeredWidget, registeredWidgets);\n }\n\n if (typeof type === \"string\") {\n if (!(type in widgetMap)) {\n throw new Error(`No widget for type '${type}'`);\n }\n\n if (widget in widgetMap[type]) {\n const registeredWidget = registeredWidgets[widgetMap[type][widget]];\n return getWidget<T, F>(schema, registeredWidget, registeredWidgets);\n }\n }\n\n throw new Error(`No widget '${widget}' for type '${type}'`);\n}\n","import { CONST_KEY, ENUM_KEY } from \"./constants\";\nimport { RJSFSchema } from \"./types\";\n\n/** Returns the constant value from the schema when it is either a single value enum or has a const key. Otherwise\n * throws an error.\n *\n * @param schema - The schema from which to obtain the constant value\n * @returns - The constant value for the schema\n * @throws - Error when the schema does not have a constant value\n */\nexport default function toConstant(schema: RJSFSchema) {\n if (\n ENUM_KEY in schema &&\n Array.isArray(schema.enum) &&\n schema.enum.length === 1\n ) {\n return schema.enum[0];\n }\n if (CONST_KEY in schema) {\n return schema.const;\n }\n throw new Error(\"schema cannot be inferred as a constant\");\n}\n","/** Returns a string representation of the `num` that is padded with leading \"0\"s if necessary\n *\n * @param num - The number to pad\n * @param width - The width of the string at which no lead padding is necessary\n * @returns - The number converted to a string with leading zero padding if the number of digits is less than `width`\n */\nexport default function pad(num: number, width: number) {\n let s = String(num);\n while (s.length < width) {\n s = \"0\" + s;\n }\n return s;\n}\n","import get from \"lodash/get\";\n\nimport { RJSFSchema, UIOptionsType } from \"./types\";\nimport asNumber from \"./asNumber\";\nimport guessType from \"./guessType\";\n\nconst nums = new Set<any>([\"number\", \"integer\"]);\n\n/** Returns the real value for a select widget due to a silly limitation in the DOM which causes option change event\n * values to always be retrieved as strings. Uses the `schema` to help determine the value's true type. If the value is\n * an empty string, then the `emptyValue` from the `options` is returned, falling back to undefined.\n *\n * @param schema - The schema to used to determine the value's true type\n * @param [value] - The value to convert\n * @param [options] - The UIOptionsType from which to potentially extract the emptyValue\n * @returns - The `value` converted to the proper type\n */\nexport default function processSelectValue<T = any, F = any>(\n schema: RJSFSchema,\n value?: any,\n options?: UIOptionsType<T, F>\n) {\n const { enum: schemaEnum, type, items } = schema;\n if (value === \"\") {\n return options && options.emptyValue !== undefined\n ? options.emptyValue\n : undefined;\n }\n if (type === \"array\" && items && nums.has(get(items, \"type\"))) {\n return value.map(asNumber);\n }\n if (type === \"boolean\") {\n return value === \"true\";\n }\n if (nums.has(type)) {\n return asNumber(value);\n }\n\n // If type is undefined, but an enum is present, try and infer the type from\n // the enum values\n if (Array.isArray(schemaEnum)) {\n if (schemaEnum.every((x: any) => nums.has(guessType(x)))) {\n return asNumber(value);\n }\n if (schemaEnum.every((x: any) => guessType(x) === \"boolean\")) {\n return value === \"true\";\n }\n }\n\n return value;\n}\n","import isObject from \"./isObject\";\nimport { RJSFSchema } from \"./types\";\n\n/** Checks the schema to see if it is allowing additional items, by verifying that `schema.additionalItems` is an\n * object. The user is warned in the console if `schema.additionalItems` has the value `true`.\n *\n * @param schema - The schema object to check\n * @returns - True if additional items is allowed, otherwise false\n */\nexport default function allowAdditionalItems(schema: RJSFSchema) {\n if (schema.additionalItems === true) {\n console.warn(\"additionalItems=true is currently not supported\");\n }\n return isObject(schema.additionalItems);\n}\n","import { RJSFSchema, UiSchema } from \"./types\";\nimport getUiOptions from \"./getUiOptions\";\n\n/** Checks whether the field described by `schema`, having the `uiSchema` and `formData` supports expanding. The UI for\n * the field can expand if it has additional properties, is not forced as non-expandable by the `uiSchema` and the\n * `formData` object doesn't already have `schema.maxProperties` elements.\n *\n * @param schema - The schema for the field that is being checked\n * @param [uiSchema={}] - The uiSchema for the field\n * @param [formData] - The formData for the field\n * @returns - True if the schema element has additionalProperties, is expandable, and not at the maxProperties limit\n */\nexport default function canExpand<T = any, F = any>(\n schema: RJSFSchema,\n uiSchema: UiSchema<T, F> = {},\n formData?: T\n) {\n if (!schema.additionalProperties) {\n return false;\n }\n const { expandable = true } = getUiOptions<T, F>(uiSchema);\n if (expandable === false) {\n return expandable;\n }\n // if ui:options.expandable was not explicitly set to false, we can add\n // another property if we have not exceeded maxProperties yet\n if (schema.maxProperties !== undefined && formData) {\n return Object.keys(formData).length < schema.maxProperties;\n }\n return true;\n}\n","/** Given the `FileReader.readAsDataURL()` based `dataURI` extracts that data into an actual Blob along with the name\n * of that Blob if provided in the URL. If no name is provided, then the name falls back to `unknown`.\n *\n * @param dataURI - The `DataUrl` potentially containing name and raw data to be converted to a Blob\n * @returns - an object containing a Blob and its name, extracted from the URI\n */\nexport default function dataURItoBlob(dataURI: string) {\n // Split metadata from data\n const splitted: string[] = dataURI.split(\",\");\n // Split params\n const params: string[] = splitted[0].split(\";\");\n // Get mime-type from params\n const type: string = params[0].replace(\"data:\", \"\");\n // Filter the name property from params\n const properties = params.filter((param) => {\n return param.split(\"=\")[0] === \"name\";\n });\n // Look for the name and use unknown if no name property.\n let name: string;\n if (properties.length !== 1) {\n name = \"unknown\";\n } else {\n // Because we filtered out the other property,\n // we only have the name case here.\n name = properties[0].split(\"=\")[1];\n }\n\n // Built the Uint8Array Blob parameter from the base64 string.\n const binary = atob(splitted[1]);\n const array = [];\n for (let i = 0; i < binary.length; i++) {\n array.push(binary.charCodeAt(i));\n }\n // Create the blob object\n const blob = new window.Blob([new Uint8Array(array)], { type });\n\n return { blob, name };\n}\n","import rangeSpec from \"./rangeSpec\";\nimport { InputPropsType, RJSFSchema, UIOptionsType } from \"./types\";\n\n/** Using the `schema`, `defaultType` and `options`, extract out the props for the <input> element that make sense.\n *\n * @param schema - The schema for the field provided by the widget\n * @param [defaultType] - The default type, if any, for the field provided by the widget\n * @param [options={}] - The UI Options for the field provided by the widget\n * @param [autoDefaultStepAny=true] - Determines whether to auto-default step=any when the type is number and no step\n * @returns - The extracted `InputPropsType` object\n */\nexport default function getInputProps<T = any, F = any>(\n schema: RJSFSchema,\n defaultType?: string,\n options: UIOptionsType<T, F> = {},\n autoDefaultStepAny = true\n): InputPropsType {\n const inputProps: InputPropsType = {\n type: defaultType || \"text\",\n ...rangeSpec(schema),\n };\n\n // If options.inputType is set use that as the input type\n if (options.inputType) {\n inputProps.type = options.inputType;\n } else if (!defaultType) {\n // If the schema is of type number or integer, set the input type to number\n if (schema.type === \"number\") {\n inputProps.type = \"number\";\n // Only add step if one isn't already defined and we are auto-defaulting the \"any\" step\n if (autoDefaultStepAny && inputProps.step === undefined) {\n // Setting step to 'any' fixes a bug in Safari where decimals are not\n // allowed in number inputs\n inputProps.step = \"any\";\n }\n } else if (schema.type === \"integer\") {\n inputProps.type = \"number\";\n // Only add step if one isn't already defined\n if (inputProps.step === undefined) {\n // Since this is integer, you always want to step up or down in multiples of 1\n inputProps.step = 1;\n }\n }\n }\n\n if (options.autocomplete) {\n inputProps.autoComplete = options.autocomplete;\n }\n\n return inputProps;\n}\n","import { TemplatesType, Registry, UIOptionsType } from \"./types\";\n\n/** Returns the template with the given `name` from either the `uiSchema` if it is defined or from the `registry`\n * otherwise. NOTE, since `ButtonTemplates` are not overridden in `uiSchema` only those in the `registry` are returned.\n *\n * @param name - The name of the template to fetch, restricted to the keys of `TemplatesType`\n * @param registry - The `Registry` from which to read the template\n * @param [uiOptions={}] - The `UIOptionsType` from which to read an alternate template\n * @returns - The template from either the `uiSchema` or `registry` for the `name`\n */\nexport default function getTemplate<\n Name extends keyof TemplatesType<T, F>,\n T = any,\n F = any\n>(\n name: Name,\n registry: Registry<T, F>,\n uiOptions: UIOptionsType<T, F> = {}\n): TemplatesType<T, F>[Name] {\n const { templates } = registry;\n if (name === \"ButtonTemplates\") {\n return templates[name];\n }\n return (uiOptions[name] as TemplatesType<T, F>[Name]) || templates[name];\n}\n","import getWidget from \"./getWidget\";\nimport { RegistryWidgetsType, RJSFSchema, Widget } from \"./types\";\n\n/** Detects whether the `widget` exists for the `schema` with the associated `registryWidgets` and returns true if it\n * does, or false if it doesn't.\n *\n * @param schema - The schema for the field\n * @param widget - Either the name of the widget OR a `Widget` implementation to use\n * @param [registeredWidgets={}] - A registry of widget name to `Widget` implementation\n * @returns - True if the widget exists, false otherwise\n */\nexport default function hasWidget<T = any, F = any>(\n schema: RJSFSchema,\n widget: Widget<T, F> | string,\n registeredWidgets: RegistryWidgetsType<T, F> = {}\n) {\n try {\n getWidget(schema, widget, registeredWidgets);\n return true;\n } catch (e) {\n const err: Error = e as Error;\n if (\n err.message &&\n (err.message.startsWith(\"No widget\") ||\n err.message.startsWith(\"Unsupported widget\"))\n ) {\n return false;\n }\n throw e;\n }\n}\n","/** Converts a local Date string into a UTC date string\n *\n * @param dateString - The string representation of a date as accepted by the `Date()` constructor\n * @returns - A UTC date string if `dateString` is truthy, otherwise undefined\n */\nexport default function localToUTC(dateString: string) {\n return dateString ? new Date(dateString).toJSON() : undefined;\n}\n","import toConstant from \"./toConstant\";\nimport { RJSFSchema, EnumOptionsType } from \"./types\";\n\n/** Gets the list of options from the schema. If the schema has an enum list, then those enum values are returned. The\n * labels for the options will be extracted from the non-standard, RJSF-deprecated `enumNames` if it exists, otherwise\n * the label will be the same as the `value`. If the schema has a `oneOf` or `anyOf`, then the value is the list of\n * `const` values from the schema and the label is either the `schema.title` or the value.\n *\n * @param schema - The schema from which to extract the options list\n * @returns - The list of options from the schema\n */\nexport default function optionsList(\n schema: RJSFSchema\n): EnumOptionsType[] | undefined {\n // enumNames was deprecated in v5 and is intentionally omitted from the RJSFSchema type.\n // Cast the type to include enumNames so the feature still works.\n const schemaWithEnumNames = schema as RJSFSchema & { enumNames?: string[] };\n if (schemaWithEnumNames.enumNames && process.env.NODE_ENV !== \"production\") {\n console.warn(\n \"The enumNames property is deprecated and may be removed in a future major release.\"\n );\n }\n if (schema.enum) {\n return schema.enum.map((value, i) => {\n const label =\n (schemaWithEnumNames.enumNames && schemaWithEnumNames.enumNames[i]) ||\n String(value);\n return { label, value };\n });\n }\n const altSchemas = schema.oneOf || schema.anyOf;\n return (\n altSchemas &&\n altSchemas.map((aSchemaDef) => {\n const aSchema = aSchemaDef as RJSFSchema;\n const value = toConstant(aSchema);\n const label = aSchema.title || String(value);\n return {\n schema: aSchema,\n label,\n value,\n };\n })\n );\n}\n","import { GenericObjectType } from \"./types\";\n\n/** Given a list of `properties` and an `order` list, returns a list that contains the `properties` ordered correctly.\n * If `order` is not an array, then the untouched `properties` list is returned. Otherwise `properties` is ordered per\n * the `order` list. If `order` contains a '*' then any `properties` that are not mentioned explicity in `order` will be\n * places in the location of the `*`.\n *\n * @param properties - The list of property keys to be ordered\n * @param order - An array of property keys to be ordered first, with an optional '*' property\n * @returns - A list with the `properties` ordered\n * @throws - Error when the properties cannot be ordered correctly\n */\nexport default function orderProperties(\n properties: string[],\n order?: string[]\n): string[] {\n if (!Array.isArray(order)) {\n return properties;\n }\n\n const arrayToHash = (arr: string[]) =>\n arr.reduce((prev: GenericObjectType, curr) => {\n prev[curr] = true;\n return prev;\n }, {});\n const errorPropList = (arr: string[]) =>\n arr.length > 1\n ? `properties '${arr.join(\"', '\")}'`\n : `property '${arr[0]}'`;\n const propertyHash = arrayToHash(properties);\n const orderFiltered = order.filter(\n (prop) => prop === \"*\" || propertyHash[prop]\n );\n const orderHash = arrayToHash(orderFiltered);\n\n const rest = properties.filter((prop: string) => !orderHash[prop]);\n const restIndex = orderFiltered.indexOf(\"*\");\n if (restIndex === -1) {\n if (rest.length) {\n throw new Error(\n `uiSchema order list does not contain ${errorPropList(rest)}`\n );\n }\n return orderFiltered;\n }\n if (restIndex !== orderFiltered.lastIndexOf(\"*\")) {\n throw new Error(\"uiSchema order list contains more than one wildcard item\");\n }\n\n const complete = [...orderFiltered];\n complete.splice(restIndex, 1, ...rest);\n return complete;\n}\n","import { DateObject } from \"./types\";\n\n/** Parses the `dateString` into a `DateObject`, including the time information when `includeTime` is true\n *\n * @param dateString - The date string to parse into a DateObject\n * @param [includeTime=true] - Optional flag, if false, will not include the time data into the object\n * @returns - The date string converted to a `DateObject`\n * @throws - Error when the date cannot be parsed from the string\n */\nexport default function parseDateString(\n dateString?: string,\n includeTime = true\n): DateObject {\n if (!dateString) {\n return {\n year: -1,\n month: -1,\n day: -1,\n hour: includeTime ? -1 : 0,\n minute: includeTime ? -1 : 0,\n second: includeTime ? -1 : 0,\n };\n }\n const date = new Date(dateString);\n if (Number.isNaN(date.getTime())) {\n throw new Error(\"Unable to parse date \" + dateString);\n }\n return {\n year: date.getUTCFullYear(),\n month: date.getUTCMonth() + 1, // oh you, javascript.\n day: date.getUTCDate(),\n hour: includeTime ? date.getUTCHours() : 0,\n minute: includeTime ? date.getUTCMinutes() : 0,\n second: includeTime ? date.getUTCSeconds() : 0,\n };\n}\n","import { RJSFSchema, RJSFSchemaDefinition } from \"./types\";\n\n/** Check to see if a `schema` specifies that a value must be true. This happens when:\n * - `schema.const` is truthy\n * - `schema.enum` == `[true]`\n * - `schema.anyOf` or `schema.oneOf` has a single value which recursively returns true\n * - `schema.allOf` has at least one value which recursively returns true\n *\n * @param schema - The schema to check\n * @returns - True if the schema specifies a value that must be true, false otherwise\n */\nexport default function schemaRequiresTrueValue(schema: RJSFSchema): boolean {\n // Check if const is a truthy value\n if (schema.const) {\n return true;\n }\n\n // Check if an enum has a single value of true\n if (schema.enum && schema.enum.length === 1 && schema.enum[0] === true) {\n return true;\n }\n\n // If anyOf has a single value, evaluate the subschema\n if (schema.anyOf && schema.anyOf.length === 1) {\n return schemaRequiresTrueValue(schema.anyOf[0] as RJSFSchema);\n }\n\n // If oneOf has a single value, evaluate the subschema\n if (schema.oneOf && schema.oneOf.length === 1) {\n return schemaRequiresTrueValue(schema.oneOf[0] as RJSFSchema);\n }\n\n // Evaluate each subschema in allOf, to see if one of them requires a true value\n if (schema.allOf) {\n const schemaSome = (subSchema: RJSFSchemaDefinition) =>\n schemaRequiresTrueValue(subSchema as RJSFSchema);\n return schema.allOf.some(schemaSome);\n }\n\n return false;\n}\n","import React from \"react\";\n\nimport deepEquals from \"./deepEquals\";\n\n/** Determines whether the given `component` should be rerendered by comparing its current set of props and state\n * against the next set. If either of those two sets are not the same, then the component should be rerendered.\n *\n * @param component - A React component being checked\n * @param nextProps - The next set of props against which to check\n * @param nextState - The next set of state against which to check\n * @returns - True if the component should be re-rendered, false otherwise\n */\nexport default function shouldRender(\n component: React.Component,\n nextProps: any,\n nextState: any\n) {\n const { props, state } = component;\n return !deepEquals(props, nextProps) || !deepEquals(state, nextState);\n}\n","import { DateObject } from \"./types\";\n\n/** Returns a UTC date string for the given `dateObject`. If `time` is false, then the time portion of the string is\n * removed.\n *\n * @param dateObject - The `DateObject` to convert to a date string\n * @param [time=true] - Optional flag used to remove the time portion of the date string if false\n * @returns - The UTC date string\n */\nexport default function toDateString(dateObject: DateObject, time = true) {\n const { year, month, day, hour = 0, minute = 0, second = 0 } = dateObject;\n const utcTime = Date.UTC(year, month - 1, day, hour, minute, second);\n const datetime = new Date(utcTime).toJSON();\n return time ? datetime : datetime.slice(0, 10);\n}\n","import pad from \"./pad\";\n\n/** Converts a UTC date string into a local Date format\n *\n * @param jsonDate - A UTC date string\n * @returns - An empty string when `jsonDate` is falsey, otherwise a date string in local format\n */\nexport default function utcToLocal(jsonDate: string) {\n if (!jsonDate) {\n return \"\";\n }\n\n // required format of `'yyyy-MM-ddThh:mm' followed by optional ':ss' or ':ss.SSS'\n // https://html.spec.whatwg.org/multipage/input.html#local-date-and-time-state-(type%3Ddatetime-local)\n // > should be a _valid local date and time string_ (not GMT)\n\n // Note - date constructor passed local ISO-8601 does not correctly\n // change time to UTC in node pre-8\n const date = new Date(jsonDate);\n\n const yyyy = pad(date.getFullYear(), 4);\n const MM = pad(date.getMonth() + 1, 2);\n const dd = pad(date.getDate(), 2);\n const hh = pad(date.getHours(), 2);\n const mm = pad(date.getMinutes(), 2);\n const ss = pad(date.getSeconds(), 2);\n const SSS = pad(date.getMilliseconds(), 3);\n\n return `${yyyy}-${MM}-${dd}T${hh}:${mm}:${ss}.${SSS}`;\n}\n"],"names":["isObject","thing","File","Array","isArray","asNumber","value","test","n","Number","isNaN","ADDITIONAL_PROPERTY_FLAG","ADDITIONAL_PROPERTIES_KEY","ALL_OF_KEY","ANY_OF_KEY","CONST_KEY","DEFAULT_KEY","DEPENDENCIES_KEY","ENUM_KEY","ITEMS_KEY","NAME_KEY","ONE_OF_KEY","PROPERTIES_KEY","REQUIRED_KEY","REF_KEY","RJSF_ADDITONAL_PROPERTIES_FLAG","UI_WIDGET_KEY","UI_OPTIONS_KEY","getUiOptions","uiSchema","Object","keys","filter","key","indexOf","reduce","options","console","error","substring","deepEquals","a","b","isEqualWith","obj","other","splitKeyElementFromObject","object","omit","findSchemaDefinition","$ref","rootSchema","ref","startsWith","Error","decodeURIComponent","current","jsonpointer","get","undefined","remaining","theRef","subSchema","length","getMatchingOption","validator","formData","i","option","properties","requiresAnyOf","anyOf","map","required","augmentedSchema","shallowClone","allOf","slice","push","assign","isValid","guessType","getSchemaType","schema","type","const","enum","additionalProperties","includes","find","isFixedItems","items","every","item","mergeDefaultsWithFormData","defaults","defaultsArray","idx","acc","mergeObjects","obj1","obj2","concatArrays","left","right","concat","isConstant","mergeSchemas","union","resolveReference","$refSchema","localSchema","retrieveSchema","rawFormData","resolvedSchema","resolveDependencies","allOfSubschema","resolveSchema","if","expression","then","else","otherwise","resolvedSchemaLessConditional","conditionalSchema","resolveCondition","entries","forEach","propName","propSchema","rawPropData","propData","resolvedPropSchema","mergeAllOf","e","warn","resolvedSchemaWithoutAllOf","theSchema","aFormData","set","stubExistingAdditionalProperties","dependencies","remainingSchema","oneOf","processDependencies","dependencyKey","remainingDependencies","dependencyValue","withDependentProperties","withDependentSchema","additionallyRequired","from","Set","dependentSchema","resolvedOneOf","subschema","validSubschemas","conditionPropertySchema","conditionSchema","errors","validateFormData","dependentSubschema","withExactlyOneSubschema","isSelect","altSchemas","isMultiSelect","uniqueItems","AdditionalItemsHandling","getInnerSchemaForArrayItem","additionalItems","Ignore","computeDefaults","parentDefaults","includeUndefinedValues","default","refSchema","itemSchema","computedDefault","schemaItem","Fallback","minItems","defaultsLength","defaultEntries","fillerSchema","Invert","fillerDefault","fillerEntries","fill","getDefaultFormState","isCustomWidget","isFilesArray","itemsSchema","format","getDisplayLabel","uiOptions","label","displayLabel","schemaType","UI_FIELD_KEY","mergeValidationData","validationData","additionalErrorSchema","oldErrors","errorSchema","oldErrorSchema","toErrorList","isEmpty","toIdSchema","id","idPrefix","idSeparator","idSchema","$id","name","field","fieldId","toPathSchema","_schema","pathSchema","replace","element","property","SchemaUtils","constructor","this","getValidator","doesSchemaUtilsDiffer","rangeSpec","spec","multipleOf","step","minimum","min","maximum","max","DEFAULT_OPTIONS","props","disabled","submitText","norender","widgetMap","boolean","checkbox","radio","select","hidden","string","text","password","email","hostname","ipv4","ipv6","uri","textarea","date","datetime","color","file","number","updown","range","integer","array","checkboxes","files","getWidget","widget","registeredWidgets","ReactIs","isForwardRef","React","createElement","isMemo","AWidget","MergedWidget","defaultOptions","defaultProps","_ref","mergeWidgetOptions","toConstant","pad","num","width","s","String","nums","expandable","maxProperties","dataURI","splitted","split","params","param","binary","atob","charCodeAt","blob","window","Blob","Uint8Array","defaultType","autoDefaultStepAny","inputProps","inputType","autocomplete","autoComplete","registry","templates","err","message","dateString","Date","toJSON","schemaWithEnumNames","enumNames","aSchemaDef","aSchema","title","order","arrayToHash","arr","prev","curr","propertyHash","orderFiltered","prop","orderHash","rest","restIndex","join","lastIndexOf","complete","splice","includeTime","year","month","day","hour","minute","second","getTime","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","schemaEnum","emptyValue","has","x","schemaRequiresTrueValue","some","component","nextProps","nextState","state","dateObject","time","utcTime","UTC","jsonDate","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds"],"mappings":"06BAMwB,SAAAA,EAASC,GAC/B,QAAoB,oBAATC,MAAwBD,aAAiBC,MAG5B,iBAAVD,GAAgC,OAAVA,GAAmBE,MAAMC,QAAQH,GACtE,CCF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AAI1B,EAAK+G,WAAY,GAKhC,IAJWrF,GAAI1B,EAAKgH,aAAc,GAIlC,IAHWtF,GAAI1B,EAAKiH,aAAc,GAGlC,IAFYvF,GAAI1B,EAAKkH,kBAAmB,EAGzC"}
package/package.json ADDED
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "@rjsf/utils",
3
+ "version": "5.0.0-beta.1",
4
+ "main": "dist/index.js",
5
+ "module": "dist/utils.esm.js",
6
+ "typings": "dist/index.d.ts",
7
+ "description": "Utility functions for @rjsf/core",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "engineStrict": false,
12
+ "engines": {
13
+ "node": ">=14"
14
+ },
15
+ "scripts": {
16
+ "build": "rimraf dist && dts build --format cjs,esm,umd",
17
+ "cs-check": "prettier -l \"{src,test}/**/*.ts?(x)\"",
18
+ "cs-format": "prettier \"{src,test}/**/*.ts?(x)\" --write",
19
+ "lint": "eslint src test",
20
+ "precommit": "lint-staged",
21
+ "test": "dts test"
22
+ },
23
+ "lint-staged": {
24
+ "{src,test}/**/*.ts?(x)": [
25
+ "eslint --fix",
26
+ "prettier --write"
27
+ ]
28
+ },
29
+ "peerDependencies": {
30
+ "react": "^16.14.0 || >=17"
31
+ },
32
+ "dependencies": {
33
+ "json-schema-merge-allof": "^0.8.1",
34
+ "jsonpointer": "^5.0.1",
35
+ "lodash": "^4.17.15",
36
+ "lodash-es": "^4.17.15",
37
+ "react-is": "^18.2.0"
38
+ },
39
+ "devDependencies": {
40
+ "@babel/core": "^7.18.13",
41
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
42
+ "@babel/plugin-transform-modules-commonjs": "^7.18.6",
43
+ "@babel/plugin-transform-react-jsx": "^7.18.10",
44
+ "@babel/preset-env": "^7.18.10",
45
+ "@babel/preset-react": "^7.18.6",
46
+ "@types/jest-expect-message": "^1.0.4",
47
+ "@types/json-schema": "^7.0.9",
48
+ "@types/json-schema-merge-allof": "^0.6.1",
49
+ "@types/lodash": "^4.14.184",
50
+ "@types/react": "^17.0.48",
51
+ "@types/react-is": "^17.0.3",
52
+ "@types/react-test-renderer": "^17.0.2",
53
+ "dts-cli": "^1.6.0",
54
+ "eslint": "^8.23.0",
55
+ "jest-expect-message": "^1.0.2",
56
+ "react": "^17.0.2",
57
+ "react-test-renderer": "^17.0.2",
58
+ "rimraf": "^3.0.2"
59
+ },
60
+ "publishConfig": {
61
+ "access": "public"
62
+ },
63
+ "author": "Heath Chiavettone <heath.chiavettone@freenome.com",
64
+ "contributors": [],
65
+ "keywords": [
66
+ "react-jsonschema-form",
67
+ "jsonschema",
68
+ "json-schema",
69
+ "json",
70
+ "schema",
71
+ "rjsf-utils"
72
+ ],
73
+ "repository": {
74
+ "type": "git",
75
+ "url": "git+https://github.com/rjsf-team/react-jsonschema-form.git"
76
+ },
77
+ "license": "Apache-2.0",
78
+ "gitHead": "8fb173c73c5a2edfb1619d2a0f6bc1298c5b07ff"
79
+ }