@rjsf/utils 5.2.0 → 5.2.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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash-es/isEqualWith'), require('lodash-es/get'), require('lodash-es/isEmpty'), require('jsonpointer'), require('lodash-es/omit'), require('lodash-es/has'), require('lodash-es/isObject'), require('lodash-es/isString'), require('lodash-es/reduce'), require('lodash-es/times'), require('lodash-es/set'), require('json-schema-merge-allof'), require('lodash-es/union'), require('lodash-es/isEqual'), require('lodash-es/cloneDeep'), require('react'), require('react-is')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'lodash-es/isEqualWith', 'lodash-es/get', 'lodash-es/isEmpty', 'jsonpointer', 'lodash-es/omit', 'lodash-es/has', 'lodash-es/isObject', 'lodash-es/isString', 'lodash-es/reduce', 'lodash-es/times', 'lodash-es/set', 'json-schema-merge-allof', 'lodash-es/union', 'lodash-es/isEqual', 'lodash-es/cloneDeep', 'react', 'react-is'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@rjsf/utils"] = {}, global.isEqualWith, global.get, global.isEmpty, global.jsonpointer, global.omit, global.has, global.isObject$1, global.isString, global.reduce, global.times, global.set, global.mergeAllOf, global.union, global.isEqual, global.cloneDeep, global.React, global.ReactIs));
5
- })(this, (function (exports, isEqualWith, get, isEmpty, jsonpointer, omit, has, isObject$1, isString, reduce, times, set, mergeAllOf, union, isEqual, cloneDeep, React, ReactIs) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash-es/isEqualWith'), require('lodash-es/get'), require('lodash-es/isEmpty'), require('jsonpointer'), require('lodash-es/omit'), require('lodash-es/has'), require('lodash-es/isObject'), require('lodash-es/isString'), require('lodash-es/reduce'), require('lodash-es/times'), require('lodash-es/set'), require('json-schema-merge-allof'), require('lodash-es/union'), require('lodash-es/isEqual'), require('lodash-es/cloneDeep'), require('react/jsx-runtime'), require('react'), require('react-is')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'lodash-es/isEqualWith', 'lodash-es/get', 'lodash-es/isEmpty', 'jsonpointer', 'lodash-es/omit', 'lodash-es/has', 'lodash-es/isObject', 'lodash-es/isString', 'lodash-es/reduce', 'lodash-es/times', 'lodash-es/set', 'json-schema-merge-allof', 'lodash-es/union', 'lodash-es/isEqual', 'lodash-es/cloneDeep', 'react/jsx-runtime', 'react', 'react-is'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@rjsf/utils"] = {}, global.isEqualWith, global.get, global.isEmpty, global.jsonpointer, global.omit, global.has, global.isObject$1, global.isString, global.reduce, global.times, global.set, global.mergeAllOf, global.union, global.isEqual, global.cloneDeep, global.jsxRuntime, global.React, global.ReactIs));
5
+ })(this, (function (exports, isEqualWith, get, isEmpty, jsonpointer, omit, has, isObject$1, isString, reduce, times, set, mergeAllOf, union, isEqual, cloneDeep, jsxRuntime, react, ReactIs) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -21,7 +21,6 @@
21
21
  var union__default = /*#__PURE__*/_interopDefaultLegacy(union);
22
22
  var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
23
23
  var cloneDeep__default = /*#__PURE__*/_interopDefaultLegacy(cloneDeep);
24
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
25
24
  var ReactIs__default = /*#__PURE__*/_interopDefaultLegacy(ReactIs);
26
25
 
27
26
  /** Determines whether a `thing` is an object for the purposes of RSJF. In this case, `thing` is an object if it has
@@ -31,13 +30,13 @@
31
30
  * @returns - True if it is a non-null, non-array, non-File object
32
31
  */
33
32
  function isObject(thing) {
34
- if (typeof File !== "undefined" && thing instanceof File) {
33
+ if (typeof File !== 'undefined' && thing instanceof File) {
35
34
  return false;
36
35
  }
37
- if (typeof Date !== "undefined" && thing instanceof Date) {
36
+ if (typeof Date !== 'undefined' && thing instanceof Date) {
38
37
  return false;
39
38
  }
40
- return typeof thing === "object" && thing !== null && !Array.isArray(thing);
39
+ return typeof thing === 'object' && thing !== null && !Array.isArray(thing);
41
40
  }
42
41
 
43
42
  /** Checks the schema to see if it is allowing additional items, by verifying that `schema.additionalItems` is an
@@ -48,7 +47,7 @@
48
47
  */
49
48
  function allowAdditionalItems(schema) {
50
49
  if (schema.additionalItems === true) {
51
- console.warn("additionalItems=true is currently not supported");
50
+ console.warn('additionalItems=true is currently not supported');
52
51
  }
53
52
  return isObject(schema.additionalItems);
54
53
  }
@@ -63,7 +62,7 @@
63
62
  * @returns - The `value` converted to a number when appropriate, otherwise the `value`
64
63
  */
65
64
  function asNumber(value) {
66
- if (value === "") {
65
+ if (value === '') {
67
66
  return undefined;
68
67
  }
69
68
  if (value === null) {
@@ -85,7 +84,7 @@
85
84
  return value;
86
85
  }
87
86
  var n = Number(value);
88
- var valid = typeof n === "number" && !Number.isNaN(n);
87
+ var valid = typeof n === 'number' && !Number.isNaN(n);
89
88
  return valid ? n : value;
90
89
  }
91
90
 
@@ -155,28 +154,28 @@
155
154
  * `RJSF_ADDITONAL_PROPERTIES_FLAG` flags that is added to a schema under certain conditions by the `retrieveSchema()`
156
155
  * utility.
157
156
  */
158
- var ADDITIONAL_PROPERTY_FLAG = "__additional_property";
159
- var ADDITIONAL_PROPERTIES_KEY = "additionalProperties";
160
- var ALL_OF_KEY = "allOf";
161
- var ANY_OF_KEY = "anyOf";
162
- var CONST_KEY = "const";
163
- var DEFAULT_KEY = "default";
164
- var DEFINITIONS_KEY = "definitions";
165
- var DEPENDENCIES_KEY = "dependencies";
166
- var ENUM_KEY = "enum";
167
- var ERRORS_KEY = "__errors";
168
- var ID_KEY = "$id";
169
- var ITEMS_KEY = "items";
170
- var NAME_KEY = "$name";
171
- var ONE_OF_KEY = "oneOf";
172
- var PROPERTIES_KEY = "properties";
173
- var REQUIRED_KEY = "required";
174
- var SUBMIT_BTN_OPTIONS_KEY = "submitButtonOptions";
175
- var REF_KEY = "$ref";
176
- var RJSF_ADDITONAL_PROPERTIES_FLAG = "__rjsf_additionalProperties";
177
- var UI_FIELD_KEY = "ui:field";
178
- var UI_WIDGET_KEY = "ui:widget";
179
- var UI_OPTIONS_KEY = "ui:options";
157
+ var ADDITIONAL_PROPERTY_FLAG = '__additional_property';
158
+ var ADDITIONAL_PROPERTIES_KEY = 'additionalProperties';
159
+ var ALL_OF_KEY = 'allOf';
160
+ var ANY_OF_KEY = 'anyOf';
161
+ var CONST_KEY = 'const';
162
+ var DEFAULT_KEY = 'default';
163
+ var DEFINITIONS_KEY = 'definitions';
164
+ var DEPENDENCIES_KEY = 'dependencies';
165
+ var ENUM_KEY = 'enum';
166
+ var ERRORS_KEY = '__errors';
167
+ var ID_KEY = '$id';
168
+ var ITEMS_KEY = 'items';
169
+ var NAME_KEY = '$name';
170
+ var ONE_OF_KEY = 'oneOf';
171
+ var PROPERTIES_KEY = 'properties';
172
+ var REQUIRED_KEY = 'required';
173
+ var SUBMIT_BTN_OPTIONS_KEY = 'submitButtonOptions';
174
+ var REF_KEY = '$ref';
175
+ var RJSF_ADDITONAL_PROPERTIES_FLAG = '__rjsf_additionalProperties';
176
+ var UI_FIELD_KEY = 'ui:field';
177
+ var UI_WIDGET_KEY = 'ui:widget';
178
+ var UI_OPTIONS_KEY = 'ui:options';
180
179
 
181
180
  /** Get all passed options from ui:options, and ui:<optionName>, returning them in an object with the `ui:`
182
181
  * stripped off.
@@ -189,12 +188,12 @@
189
188
  uiSchema = {};
190
189
  }
191
190
  return Object.keys(uiSchema).filter(function (key) {
192
- return key.indexOf("ui:") === 0;
191
+ return key.indexOf('ui:') === 0;
193
192
  }).reduce(function (options, key) {
194
193
  var _extends2;
195
194
  var value = uiSchema[key];
196
195
  if (key === UI_WIDGET_KEY && isObject(value)) {
197
- console.error("Setting options via ui:widget object is no longer supported, use ui:options instead");
196
+ console.error('Setting options via ui:widget object is no longer supported, use ui:options instead');
198
197
  return options;
199
198
  }
200
199
  if (key === UI_OPTIONS_KEY && isObject(value)) {
@@ -243,7 +242,7 @@
243
242
  */
244
243
  function deepEquals(a, b) {
245
244
  return isEqualWith__default["default"](a, b, function (obj, other) {
246
- if (typeof obj === "function" && typeof other === "function") {
245
+ if (typeof obj === 'function' && typeof other === 'function') {
247
246
  // Assume all functions are equivalent
248
247
  // see https://github.com/rjsf-team/react-jsonschema-form/issues/255
249
248
  return true;
@@ -278,8 +277,8 @@
278
277
  if (rootSchema === void 0) {
279
278
  rootSchema = {};
280
279
  }
281
- var ref = $ref || "";
282
- if (ref.startsWith("#")) {
280
+ var ref = $ref || '';
281
+ if (ref.startsWith('#')) {
283
282
  // Decode URI fragment representation.
284
283
  ref = decodeURIComponent(ref.substring(1));
285
284
  } else {
@@ -387,25 +386,25 @@
387
386
  */
388
387
  function guessType(value) {
389
388
  if (Array.isArray(value)) {
390
- return "array";
389
+ return 'array';
391
390
  }
392
- if (typeof value === "string") {
393
- return "string";
391
+ if (typeof value === 'string') {
392
+ return 'string';
394
393
  }
395
394
  if (value == null) {
396
- return "null";
395
+ return 'null';
397
396
  }
398
- if (typeof value === "boolean") {
399
- return "boolean";
397
+ if (typeof value === 'boolean') {
398
+ return 'boolean';
400
399
  }
401
400
  if (!isNaN(value)) {
402
- return "number";
401
+ return 'number';
403
402
  }
404
- if (typeof value === "object") {
405
- return "object";
403
+ if (typeof value === 'object') {
404
+ return 'object';
406
405
  }
407
406
  // Default to string if we can't figure it out
408
- return "string";
407
+ return 'string';
409
408
  }
410
409
 
411
410
  /** Gets the type of a given `schema`. If the type is not explicitly defined, then an attempt is made to infer it from
@@ -425,14 +424,14 @@
425
424
  return guessType(schema["const"]);
426
425
  }
427
426
  if (!type && schema["enum"]) {
428
- return "string";
427
+ return 'string';
429
428
  }
430
429
  if (!type && (schema.properties || schema.additionalProperties)) {
431
- return "object";
430
+ return 'object';
432
431
  }
433
- if (Array.isArray(type) && type.length === 2 && type.includes("null")) {
432
+ if (Array.isArray(type) && type.length === 2 && type.includes('null')) {
434
433
  type = type.find(function (type) {
435
- return type !== "null";
434
+ return type !== 'null';
436
435
  });
437
436
  }
438
437
  return type;
@@ -453,7 +452,7 @@
453
452
  right = obj2[key];
454
453
  if (obj1 && key in obj1 && isObject(right)) {
455
454
  acc[key] = mergeSchemas(left, right);
456
- } else if (obj1 && obj2 && (getSchemaType(obj1) === "object" || getSchemaType(obj2) === "object") && key === REQUIRED_KEY && Array.isArray(left) && Array.isArray(right)) {
455
+ } else if (obj1 && obj2 && (getSchemaType(obj1) === 'object' || getSchemaType(obj2) === 'object') && key === REQUIRED_KEY && Array.isArray(left) && Array.isArray(right)) {
457
456
  // Don't include duplicate values when merging 'required' fields.
458
457
  acc[key] = union__default["default"](left, right);
459
458
  } else {
@@ -483,7 +482,7 @@
483
482
  otherwise = schema["else"],
484
483
  resolvedSchemaLessConditional = _objectWithoutPropertiesLoose(schema, _excluded$1);
485
484
  var conditionalSchema = validator.isValid(expression, formData, rootSchema) ? then : otherwise;
486
- if (conditionalSchema && typeof conditionalSchema !== "boolean") {
485
+ if (conditionalSchema && typeof conditionalSchema !== 'boolean') {
487
486
  return retrieveSchema(validator, mergeSchemas(resolvedSchemaLessConditional, retrieveSchema(validator, conditionalSchema, rootSchema, formData)), rootSchema, formData);
488
487
  }
489
488
  return retrieveSchema(validator, resolvedSchemaLessConditional, rootSchema, formData);
@@ -555,16 +554,16 @@
555
554
  return;
556
555
  }
557
556
  var additionalProperties = {};
558
- if (typeof schema.additionalProperties !== "boolean") {
557
+ if (typeof schema.additionalProperties !== 'boolean') {
559
558
  if (REF_KEY in schema.additionalProperties) {
560
559
  additionalProperties = retrieveSchema(validator, {
561
560
  $ref: get__default["default"](schema.additionalProperties, [REF_KEY])
562
561
  }, rootSchema, formData);
563
- } else if ("type" in schema.additionalProperties) {
562
+ } else if ('type' in schema.additionalProperties) {
564
563
  additionalProperties = _extends({}, schema.additionalProperties);
565
564
  } else if (ANY_OF_KEY in schema.additionalProperties || ONE_OF_KEY in schema.additionalProperties) {
566
565
  additionalProperties = _extends({
567
- type: "object"
566
+ type: 'object'
568
567
  }, schema.additionalProperties);
569
568
  } else {
570
569
  additionalProperties = {
@@ -601,7 +600,7 @@
601
600
  return {};
602
601
  }
603
602
  var resolvedSchema = resolveSchema(validator, schema, rootSchema, rawFormData);
604
- if ("if" in schema) {
603
+ if ('if' in schema) {
605
604
  return resolveCondition(validator, schema, rootSchema, rawFormData);
606
605
  }
607
606
  var formData = rawFormData || {};
@@ -611,7 +610,7 @@
611
610
  deep: false
612
611
  });
613
612
  } catch (e) {
614
- console.warn("could not merge subschemas in allOf:\n" + e);
613
+ console.warn('could not merge subschemas in allOf:\n' + e);
615
614
  var _resolvedSchema = resolvedSchema,
616
615
  resolvedSchemaWithoutAllOf = _objectWithoutPropertiesLoose(_resolvedSchema, _excluded3);
617
616
  return resolvedSchemaWithoutAllOf;
@@ -712,7 +711,7 @@
712
711
  }
713
712
  // Resolve $refs inside oneOf.
714
713
  var resolvedOneOf = oneOf.map(function (subschema) {
715
- if (typeof subschema === "boolean" || !(REF_KEY in subschema)) {
714
+ if (typeof subschema === 'boolean' || !(REF_KEY in subschema)) {
716
715
  return subschema;
717
716
  }
718
717
  return resolveReference(validator, subschema, rootSchema, formData);
@@ -731,14 +730,14 @@
731
730
  */
732
731
  function withExactlyOneSubschema(validator, schema, rootSchema, dependencyKey, oneOf, formData) {
733
732
  var validSubschemas = oneOf.filter(function (subschema) {
734
- if (typeof subschema === "boolean" || !subschema || !subschema.properties) {
733
+ if (typeof subschema === 'boolean' || !subschema || !subschema.properties) {
735
734
  return false;
736
735
  }
737
736
  var conditionPropertySchema = subschema.properties[dependencyKey];
738
737
  if (conditionPropertySchema) {
739
738
  var _properties;
740
739
  var conditionSchema = {
741
- type: "object",
740
+ type: 'object',
742
741
  properties: (_properties = {}, _properties[dependencyKey] = conditionPropertySchema, _properties)
743
742
  };
744
743
  var _validator$validateFo = validator.validateFormData(formData, conditionSchema),
@@ -764,10 +763,10 @@
764
763
  * the first item
765
764
  */
766
765
  var JUNK_OPTION = {
767
- type: "object",
766
+ type: 'object',
768
767
  properties: {
769
768
  __not_really_there__: {
770
- type: "number"
769
+ type: 'number'
771
770
  }
772
771
  }
773
772
  };
@@ -800,7 +799,7 @@
800
799
  if (isObject__default["default"](schema.properties)) {
801
800
  totalScore += reduce__default["default"](schema.properties, function (score, value, key) {
802
801
  var formValue = get__default["default"](formData, key);
803
- if (typeof value === "boolean") {
802
+ if (typeof value === 'boolean') {
804
803
  return score;
805
804
  }
806
805
  if (has__default["default"](value, REF_KEY)) {
@@ -810,7 +809,7 @@
810
809
  if (has__default["default"](value, ONE_OF_KEY) && formValue) {
811
810
  return score + getClosestMatchingOption(validator, rootSchema, formValue, get__default["default"](value, ONE_OF_KEY));
812
811
  }
813
- if (value.type === "object") {
812
+ if (value.type === 'object') {
814
813
  return score + calculateIndexScore(validator, rootSchema, value, formValue || {});
815
814
  }
816
815
  if (value.type === guessType(formValue)) {
@@ -970,7 +969,7 @@
970
969
  acc[key] = mergeObjects(left, right, concatArrays);
971
970
  } else if (concatArrays && Array.isArray(left) && Array.isArray(right)) {
972
971
  var toMerge = right;
973
- if (concatArrays === "preventDuplicates") {
972
+ if (concatArrays === 'preventDuplicates') {
974
973
  toMerge = right.reduce(function (result, value) {
975
974
  if (!left.includes(value)) {
976
975
  result.push(value);
@@ -1014,7 +1013,7 @@
1014
1013
  }
1015
1014
  if (Array.isArray(altSchemas)) {
1016
1015
  return altSchemas.every(function (altSchemas) {
1017
- return typeof altSchemas !== "boolean" && isConstant(altSchemas);
1016
+ return typeof altSchemas !== 'boolean' && isConstant(altSchemas);
1018
1017
  });
1019
1018
  }
1020
1019
  return false;
@@ -1028,7 +1027,7 @@
1028
1027
  * @returns - True if schema contains a multi-select, otherwise false
1029
1028
  */
1030
1029
  function isMultiSelect(validator, schema, rootSchema) {
1031
- if (!schema.uniqueItems || !schema.items || typeof schema.items === "boolean") {
1030
+ if (!schema.uniqueItems || !schema.items || typeof schema.items === 'boolean') {
1032
1031
  return false;
1033
1032
  }
1034
1033
  return isSelect(validator, schema.items, rootSchema);
@@ -1067,11 +1066,11 @@
1067
1066
  if (idx >= 0) {
1068
1067
  if (Array.isArray(schema.items) && idx < schema.items.length) {
1069
1068
  var item = schema.items[idx];
1070
- if (typeof item !== "boolean") {
1069
+ if (typeof item !== 'boolean') {
1071
1070
  return item;
1072
1071
  }
1073
1072
  }
1074
- } else if (schema.items && !Array.isArray(schema.items) && typeof schema.items !== "boolean") {
1073
+ } else if (schema.items && !Array.isArray(schema.items) && typeof schema.items !== 'boolean') {
1075
1074
  return schema.items;
1076
1075
  }
1077
1076
  if (additionalItems !== AdditionalItemsHandling.Ignore && isObject(schema.additionalItems)) {
@@ -1163,12 +1162,12 @@
1163
1162
  schema = schema.anyOf[getClosestMatchingOption(validator, rootSchema, isEmpty__default["default"](formData) ? undefined : formData, schema.anyOf, 0)];
1164
1163
  }
1165
1164
  // Not defaults defined for this node, fallback to generic typed ones.
1166
- if (typeof defaults === "undefined") {
1165
+ if (typeof defaults === 'undefined') {
1167
1166
  defaults = schema["default"];
1168
1167
  }
1169
1168
  switch (getSchemaType(schema)) {
1170
1169
  // We need to recur for object schema inner default values.
1171
- case "object":
1170
+ case 'object':
1172
1171
  {
1173
1172
  var objectDefaults = Object.keys(schema.properties || {}).reduce(function (acc, key) {
1174
1173
  // Compute the defaults for this node, with the parent defaults we might
@@ -1188,7 +1187,7 @@
1188
1187
  }
1189
1188
  return objectDefaults;
1190
1189
  }
1191
- case "array":
1190
+ case 'array':
1192
1191
  // Inject defaults into existing array defaults
1193
1192
  if (Array.isArray(defaults)) {
1194
1193
  defaults = defaults.map(function (item, idx) {
@@ -1238,11 +1237,11 @@
1238
1237
  includeUndefinedValues = false;
1239
1238
  }
1240
1239
  if (!isObject(theSchema)) {
1241
- throw new Error("Invalid schema: " + theSchema);
1240
+ throw new Error('Invalid schema: ' + theSchema);
1242
1241
  }
1243
1242
  var schema = retrieveSchema(validator, theSchema, rootSchema, formData);
1244
1243
  var defaults = computeDefaults(validator, schema, undefined, rootSchema, formData, includeUndefinedValues);
1245
- if (typeof formData === "undefined" || formData === null || typeof formData === "number" && isNaN(formData)) {
1244
+ if (typeof formData === 'undefined' || formData === null || typeof formData === 'number' && isNaN(formData)) {
1246
1245
  // No form data? Use schema defaults.
1247
1246
  return defaults;
1248
1247
  }
@@ -1267,7 +1266,7 @@
1267
1266
  return (
1268
1267
  // TODO: Remove the `&& uiSchema['ui:widget'] !== 'hidden'` once we support hidden widgets for arrays.
1269
1268
  // https://react-jsonschema-form.readthedocs.io/en/latest/usage/widgets/#hidden-widgets
1270
- "widget" in getUiOptions(uiSchema) && getUiOptions(uiSchema)["widget"] !== "hidden"
1269
+ 'widget' in getUiOptions(uiSchema) && getUiOptions(uiSchema)['widget'] !== 'hidden'
1271
1270
  );
1272
1271
  }
1273
1272
 
@@ -1283,12 +1282,12 @@
1283
1282
  if (uiSchema === void 0) {
1284
1283
  uiSchema = {};
1285
1284
  }
1286
- if (uiSchema[UI_WIDGET_KEY] === "files") {
1285
+ if (uiSchema[UI_WIDGET_KEY] === 'files') {
1287
1286
  return true;
1288
1287
  }
1289
1288
  if (schema.items) {
1290
1289
  var itemsSchema = retrieveSchema(validator, schema.items, rootSchema);
1291
- return itemsSchema.type === "string" && itemsSchema.format === "data-url";
1290
+ return itemsSchema.type === 'string' && itemsSchema.format === 'data-url';
1292
1291
  }
1293
1292
  return false;
1294
1293
  }
@@ -1311,13 +1310,13 @@
1311
1310
  label = _uiOptions$label === void 0 ? true : _uiOptions$label;
1312
1311
  var displayLabel = !!label;
1313
1312
  var schemaType = getSchemaType(schema);
1314
- if (schemaType === "array") {
1313
+ if (schemaType === 'array') {
1315
1314
  displayLabel = isMultiSelect(validator, schema, rootSchema) || isFilesArray(validator, schema, uiSchema, rootSchema) || isCustomWidget(uiSchema);
1316
1315
  }
1317
- if (schemaType === "object") {
1316
+ if (schemaType === 'object') {
1318
1317
  displayLabel = false;
1319
1318
  }
1320
- if (schemaType === "boolean" && !uiSchema[UI_WIDGET_KEY]) {
1319
+ if (schemaType === 'boolean' && !uiSchema[UI_WIDGET_KEY]) {
1321
1320
  displayLabel = false;
1322
1321
  }
1323
1322
  if (uiSchema[UI_FIELD_KEY]) {
@@ -1354,7 +1353,7 @@
1354
1353
  };
1355
1354
  }
1356
1355
 
1357
- var NO_VALUE = /*#__PURE__*/Symbol("no Value");
1356
+ var NO_VALUE = /*#__PURE__*/Symbol('no Value');
1358
1357
  /** Sanitize the `data` associated with the `oldSchema` so it is considered appropriate for the `newSchema`. If the new
1359
1358
  * schema does not contain any properties, then `undefined` is returned to clear all the form data. Due to the nature
1360
1359
  * of schemas, this sanitization happens recursively for nested objects of data. Also, any properties in the old schema
@@ -1435,8 +1434,8 @@
1435
1434
  newKeyedSchema = retrieveSchema(validator, newKeyedSchema, rootSchema, formValue);
1436
1435
  }
1437
1436
  // Now get types and see if they are the same
1438
- var oldSchemaTypeForKey = get__default["default"](oldKeyedSchema, "type");
1439
- var newSchemaTypeForKey = get__default["default"](newKeyedSchema, "type");
1437
+ var oldSchemaTypeForKey = get__default["default"](oldKeyedSchema, 'type');
1438
+ var newSchemaTypeForKey = get__default["default"](newKeyedSchema, 'type');
1440
1439
  // Check if the old option has the same key with the same type
1441
1440
  if (!oldSchemaTypeForKey || oldSchemaTypeForKey === newSchemaTypeForKey) {
1442
1441
  if (has__default["default"](removeOldSchemaData, key)) {
@@ -1444,10 +1443,10 @@
1444
1443
  delete removeOldSchemaData[key];
1445
1444
  }
1446
1445
  // If it is an object, we'll recurse and store the resulting sanitized data for the key
1447
- if (newSchemaTypeForKey === "object" || newSchemaTypeForKey === "array" && Array.isArray(formValue)) {
1446
+ if (newSchemaTypeForKey === 'object' || newSchemaTypeForKey === 'array' && Array.isArray(formValue)) {
1448
1447
  // SIDE-EFFECT: process the new schema type of object recursively to save iterations
1449
1448
  var itemData = sanitizeDataForNewSchema(validator, rootSchema, newKeyedSchema, oldKeyedSchema, formValue);
1450
- if (itemData !== undefined || newSchemaTypeForKey === "array") {
1449
+ if (itemData !== undefined || newSchemaTypeForKey === 'array') {
1451
1450
  // only put undefined values for the array type and not the object type
1452
1451
  nestedData[key] = itemData;
1453
1452
  }
@@ -1455,19 +1454,19 @@
1455
1454
  // Ok, the non-object types match, let's make sure that a default or a const of a different value is replaced
1456
1455
  // with the new default or const. This allows the case where two schemas differ that only by the default/const
1457
1456
  // value to be properly selected
1458
- var newOptionDefault = get__default["default"](newKeyedSchema, "default", NO_VALUE);
1459
- var oldOptionDefault = get__default["default"](oldKeyedSchema, "default", NO_VALUE);
1457
+ var newOptionDefault = get__default["default"](newKeyedSchema, 'default', NO_VALUE);
1458
+ var oldOptionDefault = get__default["default"](oldKeyedSchema, 'default', NO_VALUE);
1460
1459
  if (newOptionDefault !== NO_VALUE && newOptionDefault !== formValue) {
1461
1460
  if (oldOptionDefault === formValue) {
1462
1461
  // If the old default matches the formValue, we'll update the new value to match the new default
1463
1462
  removeOldSchemaData[key] = newOptionDefault;
1464
- } else if (get__default["default"](newKeyedSchema, "readOnly") === true) {
1463
+ } else if (get__default["default"](newKeyedSchema, 'readOnly') === true) {
1465
1464
  // If the new schema has the default set to read-only, treat it like a const and remove the value
1466
1465
  removeOldSchemaData[key] = undefined;
1467
1466
  }
1468
1467
  }
1469
- var newOptionConst = get__default["default"](newKeyedSchema, "const", NO_VALUE);
1470
- var oldOptionConst = get__default["default"](oldKeyedSchema, "const", NO_VALUE);
1468
+ var newOptionConst = get__default["default"](newKeyedSchema, 'const', NO_VALUE);
1469
+ var oldOptionConst = get__default["default"](oldKeyedSchema, 'const', NO_VALUE);
1471
1470
  if (newOptionConst !== NO_VALUE && newOptionConst !== formValue) {
1472
1471
  // Since this is a const, if the old value matches, replace the value with the new const otherwise clear it
1473
1472
  removeOldSchemaData[key] = oldOptionConst === formValue ? newOptionConst : undefined;
@@ -1477,12 +1476,12 @@
1477
1476
  });
1478
1477
  newFormData = _extends({}, data, removeOldSchemaData, nestedData);
1479
1478
  // First apply removing the old schema data, then apply the nested data, then apply the old data keys to keep
1480
- } else if (get__default["default"](oldSchema, "type") === "array" && get__default["default"](newSchema, "type") === "array" && Array.isArray(data)) {
1481
- var oldSchemaItems = get__default["default"](oldSchema, "items");
1482
- var newSchemaItems = get__default["default"](newSchema, "items");
1479
+ } else if (get__default["default"](oldSchema, 'type') === 'array' && get__default["default"](newSchema, 'type') === 'array' && Array.isArray(data)) {
1480
+ var oldSchemaItems = get__default["default"](oldSchema, 'items');
1481
+ var newSchemaItems = get__default["default"](newSchema, 'items');
1483
1482
  // If any of the array types `items` are arrays (remember arrays are objects) then we'll just drop the data
1484
1483
  // Eventually, we may want to deal with when either of the `items` are arrays since those tuple validations
1485
- if (typeof oldSchemaItems === "object" && typeof newSchemaItems === "object" && !Array.isArray(oldSchemaItems) && !Array.isArray(newSchemaItems)) {
1484
+ if (typeof oldSchemaItems === 'object' && typeof newSchemaItems === 'object' && !Array.isArray(oldSchemaItems) && !Array.isArray(newSchemaItems)) {
1486
1485
  if (has__default["default"](oldSchemaItems, REF_KEY)) {
1487
1486
  oldSchemaItems = retrieveSchema(validator, oldSchemaItems, rootSchema, data);
1488
1487
  }
@@ -1490,12 +1489,12 @@
1490
1489
  newSchemaItems = retrieveSchema(validator, newSchemaItems, rootSchema, data);
1491
1490
  }
1492
1491
  // Now get types and see if they are the same
1493
- var oldSchemaType = get__default["default"](oldSchemaItems, "type");
1494
- var newSchemaType = get__default["default"](newSchemaItems, "type");
1492
+ var oldSchemaType = get__default["default"](oldSchemaItems, 'type');
1493
+ var newSchemaType = get__default["default"](newSchemaItems, 'type');
1495
1494
  // Check if the old option has the same key with the same type
1496
1495
  if (!oldSchemaType || oldSchemaType === newSchemaType) {
1497
- var maxItems = get__default["default"](newSchema, "maxItems", -1);
1498
- if (newSchemaType === "object") {
1496
+ var maxItems = get__default["default"](newSchema, 'maxItems', -1);
1497
+ if (newSchemaType === 'object') {
1499
1498
  newFormData = data.reduce(function (newValue, aValue) {
1500
1499
  var itemValue = sanitizeDataForNewSchema(validator, rootSchema, newSchemaItems, oldSchemaItems, aValue);
1501
1500
  if (itemValue !== undefined && (maxItems < 0 || newValue.length < maxItems)) {
@@ -1507,7 +1506,7 @@
1507
1506
  newFormData = maxItems > 0 && data.length > maxItems ? data.slice(0, maxItems) : data;
1508
1507
  }
1509
1508
  }
1510
- } else if (typeof oldSchemaItems === "boolean" && typeof newSchemaItems === "boolean" && oldSchemaItems === newSchemaItems) {
1509
+ } else if (typeof oldSchemaItems === 'boolean' && typeof newSchemaItems === 'boolean' && oldSchemaItems === newSchemaItems) {
1511
1510
  // If they are both booleans and have the same value just return the data as is otherwise fall-thru to undefined
1512
1511
  newFormData = data;
1513
1512
  }
@@ -1530,10 +1529,10 @@
1530
1529
  */
1531
1530
  function toIdSchema(validator, schema, id, rootSchema, formData, idPrefix, idSeparator) {
1532
1531
  if (idPrefix === void 0) {
1533
- idPrefix = "root";
1532
+ idPrefix = 'root';
1534
1533
  }
1535
1534
  if (idSeparator === void 0) {
1536
- idSeparator = "_";
1535
+ idSeparator = '_';
1537
1536
  }
1538
1537
  if (REF_KEY in schema || DEPENDENCIES_KEY in schema || ALL_OF_KEY in schema) {
1539
1538
  var _schema = retrieveSchema(validator, schema, rootSchema, formData);
@@ -1546,7 +1545,7 @@
1546
1545
  var idSchema = {
1547
1546
  $id: $id
1548
1547
  };
1549
- if (schema.type === "object" && PROPERTIES_KEY in schema) {
1548
+ if (schema.type === 'object' && PROPERTIES_KEY in schema) {
1550
1549
  for (var name in schema.properties) {
1551
1550
  var field = get__default["default"](schema, [PROPERTIES_KEY, name]);
1552
1551
  var fieldId = idSchema[ID_KEY] + idSeparator + name;
@@ -1571,13 +1570,13 @@
1571
1570
  function toPathSchema(validator, schema, name, rootSchema, formData) {
1572
1571
  var _pathSchema;
1573
1572
  if (name === void 0) {
1574
- name = "";
1573
+ name = '';
1575
1574
  }
1576
1575
  if (REF_KEY in schema || DEPENDENCIES_KEY in schema || ALL_OF_KEY in schema) {
1577
1576
  var _schema = retrieveSchema(validator, schema, rootSchema, formData);
1578
1577
  return toPathSchema(validator, _schema, name, rootSchema, formData);
1579
1578
  }
1580
- var pathSchema = (_pathSchema = {}, _pathSchema[NAME_KEY] = name.replace(/^\./, ""), _pathSchema);
1579
+ var pathSchema = (_pathSchema = {}, _pathSchema[NAME_KEY] = name.replace(/^\./, ''), _pathSchema);
1581
1580
  if (ONE_OF_KEY in schema) {
1582
1581
  var index = getClosestMatchingOption(validator, rootSchema, formData, schema.oneOf, 0);
1583
1582
  var _schema2 = schema.oneOf[index];
@@ -1780,10 +1779,10 @@
1780
1779
  */;
1781
1780
  _proto.toIdSchema = function toIdSchema$1(schema, id, formData, idPrefix, idSeparator) {
1782
1781
  if (idPrefix === void 0) {
1783
- idPrefix = "root";
1782
+ idPrefix = 'root';
1784
1783
  }
1785
1784
  if (idSeparator === void 0) {
1786
- idSeparator = "_";
1785
+ idSeparator = '_';
1787
1786
  }
1788
1787
  return toIdSchema(this.validator, schema, id, this.rootSchema, formData, idPrefix, idSeparator);
1789
1788
  }
@@ -1818,38 +1817,48 @@
1818
1817
  */
1819
1818
  function dataURItoBlob(dataURI) {
1820
1819
  // Split metadata from data
1821
- var splitted = dataURI.split(",");
1820
+ var splitted = dataURI.split(',');
1822
1821
  // Split params
1823
- var params = splitted[0].split(";");
1822
+ var params = splitted[0].split(';');
1824
1823
  // Get mime-type from params
1825
- var type = params[0].replace("data:", "");
1824
+ var type = params[0].replace('data:', '');
1826
1825
  // Filter the name property from params
1827
1826
  var properties = params.filter(function (param) {
1828
- return param.split("=")[0] === "name";
1827
+ return param.split('=')[0] === 'name';
1829
1828
  });
1830
1829
  // Look for the name and use unknown if no name property.
1831
1830
  var name;
1832
1831
  if (properties.length !== 1) {
1833
- name = "unknown";
1832
+ name = 'unknown';
1834
1833
  } else {
1835
1834
  // Because we filtered out the other property,
1836
- // we only have the name case here.
1837
- name = properties[0].split("=")[1];
1835
+ // we only have the name case here, which we decode to make it human-readable
1836
+ name = decodeURI(properties[0].split('=')[1]);
1838
1837
  }
1839
1838
  // Built the Uint8Array Blob parameter from the base64 string.
1840
- var binary = atob(splitted[1]);
1841
- var array = [];
1842
- for (var i = 0; i < binary.length; i++) {
1843
- array.push(binary.charCodeAt(i));
1844
- }
1845
- // Create the blob object
1846
- var blob = new window.Blob([new Uint8Array(array)], {
1847
- type: type
1848
- });
1849
- return {
1850
- blob: blob,
1851
- name: name
1852
- };
1839
+ try {
1840
+ var binary = atob(splitted[1]);
1841
+ var array = [];
1842
+ for (var i = 0; i < binary.length; i++) {
1843
+ array.push(binary.charCodeAt(i));
1844
+ }
1845
+ // Create the blob object
1846
+ var blob = new window.Blob([new Uint8Array(array)], {
1847
+ type: type
1848
+ });
1849
+ return {
1850
+ blob: blob,
1851
+ name: name
1852
+ };
1853
+ } catch (error) {
1854
+ return {
1855
+ blob: {
1856
+ size: 0,
1857
+ type: error.message
1858
+ },
1859
+ name: dataURI
1860
+ };
1861
+ }
1853
1862
  }
1854
1863
 
1855
1864
  /** Potentially substitutes all replaceable parameters with the associated value(s) from the `params` if available. When
@@ -1863,9 +1872,16 @@
1863
1872
  function replaceStringParameters(inputString, params) {
1864
1873
  var output = inputString;
1865
1874
  if (Array.isArray(params)) {
1875
+ var parts = output.split(/(%\d)/);
1866
1876
  params.forEach(function (param, index) {
1867
- output = output.replace("%" + (index + 1), param);
1877
+ var partIndex = parts.findIndex(function (part) {
1878
+ return part === "%" + (index + 1);
1879
+ });
1880
+ if (partIndex >= 0) {
1881
+ parts[partIndex] = param;
1882
+ }
1868
1883
  });
1884
+ output = parts.join('');
1869
1885
  }
1870
1886
  return output;
1871
1887
  }
@@ -1905,7 +1921,7 @@
1905
1921
  });
1906
1922
  }
1907
1923
  // So Number(null) and Number('') both return 0, so use emptyValue for those two values
1908
- var index = valueIndex === "" || valueIndex === null ? -1 : Number(valueIndex);
1924
+ var index = valueIndex === '' || valueIndex === null ? -1 : Number(valueIndex);
1909
1925
  var option = allEnumOptions[index];
1910
1926
  return option ? option.value : emptyValue;
1911
1927
  }
@@ -1971,7 +1987,7 @@
1971
1987
  var selectedIndexes = allEnumOptions.map(function (opt, index) {
1972
1988
  return enumOptionsIsSelected(opt.value, value) ? String(index) : undefined;
1973
1989
  }).filter(function (opt) {
1974
- return typeof opt !== "undefined";
1990
+ return typeof opt !== 'undefined';
1975
1991
  });
1976
1992
  if (!multiple) {
1977
1993
  return selectedIndexes[0];
@@ -2039,7 +2055,7 @@
2039
2055
  * @private
2040
2056
  */
2041
2057
  _proto.getOrCreateErrorBlock = function getOrCreateErrorBlock(pathOfError) {
2042
- var hasPath = Array.isArray(pathOfError) && pathOfError.length > 0 || typeof pathOfError === "string";
2058
+ var hasPath = Array.isArray(pathOfError) && pathOfError.length > 0 || typeof pathOfError === 'string';
2043
2059
  var errorBlock = hasPath ? get__default["default"](this.errorSchema, pathOfError) : this.errorSchema;
2044
2060
  if (!errorBlock && pathOfError) {
2045
2061
  errorBlock = {};
@@ -2151,23 +2167,23 @@
2151
2167
  autoDefaultStepAny = true;
2152
2168
  }
2153
2169
  var inputProps = _extends({
2154
- type: defaultType || "text"
2170
+ type: defaultType || 'text'
2155
2171
  }, rangeSpec(schema));
2156
2172
  // If options.inputType is set use that as the input type
2157
2173
  if (options.inputType) {
2158
2174
  inputProps.type = options.inputType;
2159
2175
  } else if (!defaultType) {
2160
2176
  // If the schema is of type number or integer, set the input type to number
2161
- if (schema.type === "number") {
2162
- inputProps.type = "number";
2177
+ if (schema.type === 'number') {
2178
+ inputProps.type = 'number';
2163
2179
  // Only add step if one isn't already defined and we are auto-defaulting the "any" step
2164
2180
  if (autoDefaultStepAny && inputProps.step === undefined) {
2165
2181
  // Setting step to 'any' fixes a bug in Safari where decimals are not
2166
2182
  // allowed in number inputs
2167
- inputProps.step = "any";
2183
+ inputProps.step = 'any';
2168
2184
  }
2169
- } else if (schema.type === "integer") {
2170
- inputProps.type = "number";
2185
+ } else if (schema.type === 'integer') {
2186
+ inputProps.type = 'number';
2171
2187
  // Only add step if one isn't already defined
2172
2188
  if (inputProps.step === undefined) {
2173
2189
  // Since this is integer, you always want to step up or down in multiples of 1
@@ -2187,7 +2203,7 @@
2187
2203
  props: {
2188
2204
  disabled: false
2189
2205
  },
2190
- submitText: "Submit",
2206
+ submitText: 'Submit',
2191
2207
  norender: false
2192
2208
  };
2193
2209
  /** Extracts any `ui:submitButtonOptions` from the `uiSchema` and merges them onto the `DEFAULT_OPTIONS`
@@ -2220,7 +2236,7 @@
2220
2236
  uiOptions = {};
2221
2237
  }
2222
2238
  var templates = registry.templates;
2223
- if (name === "ButtonTemplates") {
2239
+ if (name === 'ButtonTemplates') {
2224
2240
  return templates[name];
2225
2241
  }
2226
2242
  return (
@@ -2235,53 +2251,53 @@
2235
2251
  */
2236
2252
  var widgetMap = {
2237
2253
  "boolean": {
2238
- checkbox: "CheckboxWidget",
2239
- radio: "RadioWidget",
2240
- select: "SelectWidget",
2241
- hidden: "HiddenWidget"
2254
+ checkbox: 'CheckboxWidget',
2255
+ radio: 'RadioWidget',
2256
+ select: 'SelectWidget',
2257
+ hidden: 'HiddenWidget'
2242
2258
  },
2243
2259
  string: {
2244
- text: "TextWidget",
2245
- password: "PasswordWidget",
2246
- email: "EmailWidget",
2247
- hostname: "TextWidget",
2248
- ipv4: "TextWidget",
2249
- ipv6: "TextWidget",
2250
- uri: "URLWidget",
2251
- "data-url": "FileWidget",
2252
- radio: "RadioWidget",
2253
- select: "SelectWidget",
2254
- textarea: "TextareaWidget",
2255
- hidden: "HiddenWidget",
2256
- date: "DateWidget",
2257
- datetime: "DateTimeWidget",
2258
- "date-time": "DateTimeWidget",
2259
- "alt-date": "AltDateWidget",
2260
- "alt-datetime": "AltDateTimeWidget",
2261
- color: "ColorWidget",
2262
- file: "FileWidget"
2260
+ text: 'TextWidget',
2261
+ password: 'PasswordWidget',
2262
+ email: 'EmailWidget',
2263
+ hostname: 'TextWidget',
2264
+ ipv4: 'TextWidget',
2265
+ ipv6: 'TextWidget',
2266
+ uri: 'URLWidget',
2267
+ 'data-url': 'FileWidget',
2268
+ radio: 'RadioWidget',
2269
+ select: 'SelectWidget',
2270
+ textarea: 'TextareaWidget',
2271
+ hidden: 'HiddenWidget',
2272
+ date: 'DateWidget',
2273
+ datetime: 'DateTimeWidget',
2274
+ 'date-time': 'DateTimeWidget',
2275
+ 'alt-date': 'AltDateWidget',
2276
+ 'alt-datetime': 'AltDateTimeWidget',
2277
+ color: 'ColorWidget',
2278
+ file: 'FileWidget'
2263
2279
  },
2264
2280
  number: {
2265
- text: "TextWidget",
2266
- select: "SelectWidget",
2267
- updown: "UpDownWidget",
2268
- range: "RangeWidget",
2269
- radio: "RadioWidget",
2270
- hidden: "HiddenWidget"
2281
+ text: 'TextWidget',
2282
+ select: 'SelectWidget',
2283
+ updown: 'UpDownWidget',
2284
+ range: 'RangeWidget',
2285
+ radio: 'RadioWidget',
2286
+ hidden: 'HiddenWidget'
2271
2287
  },
2272
2288
  integer: {
2273
- text: "TextWidget",
2274
- select: "SelectWidget",
2275
- updown: "UpDownWidget",
2276
- range: "RangeWidget",
2277
- radio: "RadioWidget",
2278
- hidden: "HiddenWidget"
2289
+ text: 'TextWidget',
2290
+ select: 'SelectWidget',
2291
+ updown: 'UpDownWidget',
2292
+ range: 'RangeWidget',
2293
+ radio: 'RadioWidget',
2294
+ hidden: 'HiddenWidget'
2279
2295
  },
2280
2296
  array: {
2281
- select: "SelectWidget",
2282
- checkboxes: "CheckboxesWidget",
2283
- files: "FileWidget",
2284
- hidden: "HiddenWidget"
2297
+ select: 'SelectWidget',
2298
+ checkboxes: 'CheckboxesWidget',
2299
+ files: 'FileWidget',
2300
+ hidden: 'HiddenWidget'
2285
2301
  }
2286
2302
  };
2287
2303
  /** Wraps the given widget with stateless functional component that will merge any `defaultProps.options` with the
@@ -2292,18 +2308,18 @@
2292
2308
  * @returns - The wrapper widget
2293
2309
  */
2294
2310
  function mergeWidgetOptions(AWidget) {
2295
- var MergedWidget = get__default["default"](AWidget, "MergedWidget");
2311
+ var MergedWidget = get__default["default"](AWidget, 'MergedWidget');
2296
2312
  // cache return value as property of widget for proper react reconciliation
2297
2313
  if (!MergedWidget) {
2298
2314
  var defaultOptions = AWidget.defaultProps && AWidget.defaultProps.options || {};
2299
2315
  MergedWidget = function MergedWidget(_ref) {
2300
2316
  var options = _ref.options,
2301
2317
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
2302
- return /*#__PURE__*/React__default["default"].createElement(AWidget, _extends({
2318
+ return jsxRuntime.jsx(AWidget, _extends({
2303
2319
  options: _extends({}, defaultOptions, options)
2304
2320
  }, props));
2305
2321
  };
2306
- set__default["default"](AWidget, "MergedWidget", MergedWidget);
2322
+ set__default["default"](AWidget, 'MergedWidget', MergedWidget);
2307
2323
  }
2308
2324
  return MergedWidget;
2309
2325
  }
@@ -2323,17 +2339,17 @@
2323
2339
  registeredWidgets = {};
2324
2340
  }
2325
2341
  var type = getSchemaType(schema);
2326
- if (typeof widget === "function" || widget && ReactIs__default["default"].isForwardRef( /*#__PURE__*/React__default["default"].createElement(widget)) || ReactIs__default["default"].isMemo(widget)) {
2342
+ if (typeof widget === 'function' || widget && ReactIs__default["default"].isForwardRef( /*#__PURE__*/react.createElement(widget)) || ReactIs__default["default"].isMemo(widget)) {
2327
2343
  return mergeWidgetOptions(widget);
2328
2344
  }
2329
- if (typeof widget !== "string") {
2345
+ if (typeof widget !== 'string') {
2330
2346
  throw new Error("Unsupported widget definition: " + typeof widget);
2331
2347
  }
2332
2348
  if (widget in registeredWidgets) {
2333
2349
  var registeredWidget = registeredWidgets[widget];
2334
2350
  return getWidget(schema, registeredWidget, registeredWidgets);
2335
2351
  }
2336
- if (typeof type === "string") {
2352
+ if (typeof type === 'string') {
2337
2353
  if (!(type in widgetMap)) {
2338
2354
  throw new Error("No widget for type '" + type + "'");
2339
2355
  }
@@ -2362,7 +2378,7 @@
2362
2378
  return true;
2363
2379
  } catch (e) {
2364
2380
  var err = e;
2365
- if (err.message && (err.message.startsWith("No widget") || err.message.startsWith("Unsupported widget"))) {
2381
+ if (err.message && (err.message.startsWith('No widget') || err.message.startsWith('Unsupported widget'))) {
2366
2382
  return false;
2367
2383
  }
2368
2384
  throw e;
@@ -2384,7 +2400,7 @@
2384
2400
  * @returns - The consistent id for the field description element from the given `id`
2385
2401
  */
2386
2402
  function descriptionId(id) {
2387
- return idGenerator(id, "description");
2403
+ return idGenerator(id, 'description');
2388
2404
  }
2389
2405
  /** Return a consistent `id` for the field error element
2390
2406
  *
@@ -2392,7 +2408,7 @@
2392
2408
  * @returns - The consistent id for the field error element from the given `id`
2393
2409
  */
2394
2410
  function errorId(id) {
2395
- return idGenerator(id, "error");
2411
+ return idGenerator(id, 'error');
2396
2412
  }
2397
2413
  /** Return a consistent `id` for the field examples element
2398
2414
  *
@@ -2400,7 +2416,7 @@
2400
2416
  * @returns - The consistent id for the field examples element from the given `id`
2401
2417
  */
2402
2418
  function examplesId(id) {
2403
- return idGenerator(id, "examples");
2419
+ return idGenerator(id, 'examples');
2404
2420
  }
2405
2421
  /** Return a consistent `id` for the field help element
2406
2422
  *
@@ -2408,7 +2424,7 @@
2408
2424
  * @returns - The consistent id for the field help element from the given `id`
2409
2425
  */
2410
2426
  function helpId(id) {
2411
- return idGenerator(id, "help");
2427
+ return idGenerator(id, 'help');
2412
2428
  }
2413
2429
  /** Return a consistent `id` for the field title element
2414
2430
  *
@@ -2416,7 +2432,7 @@
2416
2432
  * @returns - The consistent id for the field title element from the given `id`
2417
2433
  */
2418
2434
  function titleId(id) {
2419
- return idGenerator(id, "title");
2435
+ return idGenerator(id, 'title');
2420
2436
  }
2421
2437
  /** Return a list of element ids that contain additional information about the field that can be used to as the aria
2422
2438
  * description of the field. This is correctly omitting `titleId` which would be "labeling" rather than "describing" the
@@ -2430,7 +2446,7 @@
2430
2446
  if (includeExamples === void 0) {
2431
2447
  includeExamples = false;
2432
2448
  }
2433
- var examples = includeExamples ? " " + examplesId(id) : "";
2449
+ var examples = includeExamples ? " " + examplesId(id) : '';
2434
2450
  return errorId(id) + " " + descriptionId(id) + " " + helpId(id) + examples;
2435
2451
  }
2436
2452
  /** Return a consistent `id` for the `optionIndex`s of a `Radio` or `Checkboxes` widget
@@ -2466,7 +2482,7 @@
2466
2482
  if (CONST_KEY in schema) {
2467
2483
  return schema["const"];
2468
2484
  }
2469
- throw new Error("schema cannot be inferred as a constant");
2485
+ throw new Error('schema cannot be inferred as a constant');
2470
2486
  }
2471
2487
 
2472
2488
  /** Gets the list of options from the schema. If the schema has an enum list, then those enum values are returned. The
@@ -2481,8 +2497,8 @@
2481
2497
  // enumNames was deprecated in v5 and is intentionally omitted from the RJSFSchema type.
2482
2498
  // Cast the type to include enumNames so the feature still works.
2483
2499
  var schemaWithEnumNames = schema;
2484
- if (schemaWithEnumNames.enumNames && "development" !== "production") {
2485
- console.warn("The enumNames property is deprecated and may be removed in a future major release.");
2500
+ if (schemaWithEnumNames.enumNames && "development" !== 'production') {
2501
+ console.warn('The enumNames property is deprecated and may be removed in a future major release.');
2486
2502
  }
2487
2503
  if (schema["enum"]) {
2488
2504
  return schema["enum"].map(function (value, i) {
@@ -2531,21 +2547,21 @@
2531
2547
  };
2532
2548
  var propertyHash = arrayToHash(properties);
2533
2549
  var orderFiltered = order.filter(function (prop) {
2534
- return prop === "*" || propertyHash[prop];
2550
+ return prop === '*' || propertyHash[prop];
2535
2551
  });
2536
2552
  var orderHash = arrayToHash(orderFiltered);
2537
2553
  var rest = properties.filter(function (prop) {
2538
2554
  return !orderHash[prop];
2539
2555
  });
2540
- var restIndex = orderFiltered.indexOf("*");
2556
+ var restIndex = orderFiltered.indexOf('*');
2541
2557
  if (restIndex === -1) {
2542
2558
  if (rest.length) {
2543
2559
  throw new Error("uiSchema order list does not contain " + errorPropList(rest));
2544
2560
  }
2545
2561
  return orderFiltered;
2546
2562
  }
2547
- if (restIndex !== orderFiltered.lastIndexOf("*")) {
2548
- throw new Error("uiSchema order list contains more than one wildcard item");
2563
+ if (restIndex !== orderFiltered.lastIndexOf('*')) {
2564
+ throw new Error('uiSchema order list contains more than one wildcard item');
2549
2565
  }
2550
2566
  var complete = [].concat(orderFiltered);
2551
2567
  complete.splice.apply(complete, [restIndex, 1].concat(rest));
@@ -2561,7 +2577,7 @@
2561
2577
  function pad(num, width) {
2562
2578
  var s = String(num);
2563
2579
  while (s.length < width) {
2564
- s = "0" + s;
2580
+ s = '0' + s;
2565
2581
  }
2566
2582
  return s;
2567
2583
  }
@@ -2589,7 +2605,7 @@
2589
2605
  }
2590
2606
  var date = new Date(dateString);
2591
2607
  if (Number.isNaN(date.getTime())) {
2592
- throw new Error("Unable to parse date " + dateString);
2608
+ throw new Error('Unable to parse date ' + dateString);
2593
2609
  }
2594
2610
  return {
2595
2611
  year: date.getUTCFullYear(),
@@ -2683,7 +2699,7 @@
2683
2699
  */
2684
2700
  function utcToLocal(jsonDate) {
2685
2701
  if (!jsonDate) {
2686
- return "";
2702
+ return '';
2687
2703
  }
2688
2704
  // required format of `'yyyy-MM-ddThh:mm' followed by optional ':ss' or ':ss.SSS'
2689
2705
  // https://html.spec.whatwg.org/multipage/input.html#local-date-and-time-state-(type%3Ddatetime-local)