@rjsf/utils 5.1.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.
- package/LICENSE.md +183 -183
- package/dist/index.d.ts +171 -60
- package/dist/utils.cjs.development.js +317 -198
- package/dist/utils.cjs.development.js.map +1 -1
- package/dist/utils.cjs.production.min.js +1 -1
- package/dist/utils.cjs.production.min.js.map +1 -1
- package/dist/utils.esm.js +316 -198
- package/dist/utils.esm.js.map +1 -1
- package/dist/utils.umd.development.js +319 -201
- package/dist/utils.umd.development.js.map +1 -1
- package/dist/utils.umd.production.min.js +1 -1
- package/dist/utils.umd.production.min.js.map +1 -1
- package/package.json +2 -2
|
@@ -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,
|
|
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 !==
|
|
33
|
+
if (typeof File !== 'undefined' && thing instanceof File) {
|
|
35
34
|
return false;
|
|
36
35
|
}
|
|
37
|
-
if (typeof Date !==
|
|
36
|
+
if (typeof Date !== 'undefined' && thing instanceof Date) {
|
|
38
37
|
return false;
|
|
39
38
|
}
|
|
40
|
-
return typeof 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(
|
|
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 ===
|
|
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 =
|
|
159
|
-
var ADDITIONAL_PROPERTIES_KEY =
|
|
160
|
-
var ALL_OF_KEY =
|
|
161
|
-
var ANY_OF_KEY =
|
|
162
|
-
var CONST_KEY =
|
|
163
|
-
var DEFAULT_KEY =
|
|
164
|
-
var DEFINITIONS_KEY =
|
|
165
|
-
var DEPENDENCIES_KEY =
|
|
166
|
-
var ENUM_KEY =
|
|
167
|
-
var ERRORS_KEY =
|
|
168
|
-
var ID_KEY =
|
|
169
|
-
var ITEMS_KEY =
|
|
170
|
-
var NAME_KEY =
|
|
171
|
-
var ONE_OF_KEY =
|
|
172
|
-
var PROPERTIES_KEY =
|
|
173
|
-
var REQUIRED_KEY =
|
|
174
|
-
var SUBMIT_BTN_OPTIONS_KEY =
|
|
175
|
-
var REF_KEY =
|
|
176
|
-
var RJSF_ADDITONAL_PROPERTIES_FLAG =
|
|
177
|
-
var UI_FIELD_KEY =
|
|
178
|
-
var UI_WIDGET_KEY =
|
|
179
|
-
var UI_OPTIONS_KEY =
|
|
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(
|
|
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(
|
|
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 ===
|
|
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
|
|
389
|
+
return 'array';
|
|
391
390
|
}
|
|
392
|
-
if (typeof value ===
|
|
393
|
-
return
|
|
391
|
+
if (typeof value === 'string') {
|
|
392
|
+
return 'string';
|
|
394
393
|
}
|
|
395
394
|
if (value == null) {
|
|
396
|
-
return
|
|
395
|
+
return 'null';
|
|
397
396
|
}
|
|
398
|
-
if (typeof value ===
|
|
399
|
-
return
|
|
397
|
+
if (typeof value === 'boolean') {
|
|
398
|
+
return 'boolean';
|
|
400
399
|
}
|
|
401
400
|
if (!isNaN(value)) {
|
|
402
|
-
return
|
|
401
|
+
return 'number';
|
|
403
402
|
}
|
|
404
|
-
if (typeof value ===
|
|
405
|
-
return
|
|
403
|
+
if (typeof value === 'object') {
|
|
404
|
+
return 'object';
|
|
406
405
|
}
|
|
407
406
|
// Default to string if we can't figure it out
|
|
408
|
-
return
|
|
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
|
|
427
|
+
return 'string';
|
|
429
428
|
}
|
|
430
429
|
if (!type && (schema.properties || schema.additionalProperties)) {
|
|
431
|
-
return
|
|
430
|
+
return 'object';
|
|
432
431
|
}
|
|
433
|
-
if (Array.isArray(type) && type.length === 2 && type.includes(
|
|
432
|
+
if (Array.isArray(type) && type.length === 2 && type.includes('null')) {
|
|
434
433
|
type = type.find(function (type) {
|
|
435
|
-
return type !==
|
|
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) ===
|
|
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 !==
|
|
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 !==
|
|
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 (
|
|
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:
|
|
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 (
|
|
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(
|
|
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 ===
|
|
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 ===
|
|
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:
|
|
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:
|
|
766
|
+
type: 'object',
|
|
768
767
|
properties: {
|
|
769
768
|
__not_really_there__: {
|
|
770
|
-
type:
|
|
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 ===
|
|
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 ===
|
|
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 ===
|
|
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 !==
|
|
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 ===
|
|
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 !==
|
|
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 !==
|
|
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 ===
|
|
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
|
|
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
|
|
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(
|
|
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 ===
|
|
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
|
-
|
|
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] ===
|
|
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 ===
|
|
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 ===
|
|
1313
|
+
if (schemaType === 'array') {
|
|
1315
1314
|
displayLabel = isMultiSelect(validator, schema, rootSchema) || isFilesArray(validator, schema, uiSchema, rootSchema) || isCustomWidget(uiSchema);
|
|
1316
1315
|
}
|
|
1317
|
-
if (schemaType ===
|
|
1316
|
+
if (schemaType === 'object') {
|
|
1318
1317
|
displayLabel = false;
|
|
1319
1318
|
}
|
|
1320
|
-
if (schemaType ===
|
|
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(
|
|
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,
|
|
1439
|
-
var newSchemaTypeForKey = get__default["default"](newKeyedSchema,
|
|
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 ===
|
|
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 ===
|
|
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,
|
|
1459
|
-
var oldOptionDefault = get__default["default"](oldKeyedSchema,
|
|
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,
|
|
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,
|
|
1470
|
-
var oldOptionConst = get__default["default"](oldKeyedSchema,
|
|
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,
|
|
1481
|
-
var oldSchemaItems = get__default["default"](oldSchema,
|
|
1482
|
-
var newSchemaItems = get__default["default"](newSchema,
|
|
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 ===
|
|
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,
|
|
1494
|
-
var newSchemaType = get__default["default"](newSchemaItems,
|
|
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,
|
|
1498
|
-
if (newSchemaType ===
|
|
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 ===
|
|
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 =
|
|
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 ===
|
|
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(/^\./,
|
|
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 =
|
|
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,85 @@
|
|
|
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(
|
|
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(
|
|
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 =
|
|
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(
|
|
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
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
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
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1864
|
+
/** Potentially substitutes all replaceable parameters with the associated value(s) from the `params` if available. When
|
|
1865
|
+
* a `params` array is provided, each value in the array is used to replace any of the replaceable parameters in the
|
|
1866
|
+
* `inputString` using the `%1`, `%2`, etc. replacement specifiers.
|
|
1867
|
+
*
|
|
1868
|
+
* @param inputString - The string which will be potentially updated with replacement parameters
|
|
1869
|
+
* @param params - The optional list of replaceable parameter values to substitute into the english string
|
|
1870
|
+
* @returns - The updated string with any replacement specifiers replaced
|
|
1871
|
+
*/
|
|
1872
|
+
function replaceStringParameters(inputString, params) {
|
|
1873
|
+
var output = inputString;
|
|
1874
|
+
if (Array.isArray(params)) {
|
|
1875
|
+
var parts = output.split(/(%\d)/);
|
|
1876
|
+
params.forEach(function (param, index) {
|
|
1877
|
+
var partIndex = parts.findIndex(function (part) {
|
|
1878
|
+
return part === "%" + (index + 1);
|
|
1879
|
+
});
|
|
1880
|
+
if (partIndex >= 0) {
|
|
1881
|
+
parts[partIndex] = param;
|
|
1882
|
+
}
|
|
1883
|
+
});
|
|
1884
|
+
output = parts.join('');
|
|
1885
|
+
}
|
|
1886
|
+
return output;
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
/** Translates a `TranslatableString` value `stringToTranslate` into english. When a `params` array is provided, each
|
|
1890
|
+
* value in the array is used to replace any of the replaceable parameters in the `stringToTranslate` using the `%1`,
|
|
1891
|
+
* `%2`, etc. replacement specifiers.
|
|
1892
|
+
*
|
|
1893
|
+
* @param stringToTranslate - The `TranslatableString` value to convert to english
|
|
1894
|
+
* @param params - The optional list of replaceable parameter values to substitute into the english string
|
|
1895
|
+
* @returns - The `stringToTranslate` itself with any replaceable parameter values substituted
|
|
1896
|
+
*/
|
|
1897
|
+
function englishStringTranslator(stringToTranslate, params) {
|
|
1898
|
+
return replaceStringParameters(stringToTranslate, params);
|
|
1853
1899
|
}
|
|
1854
1900
|
|
|
1855
1901
|
/** Returns the value(s) from `allEnumOptions` at the index(es) provided by `valueIndex`. If `valueIndex` is not an
|
|
@@ -1875,7 +1921,7 @@
|
|
|
1875
1921
|
});
|
|
1876
1922
|
}
|
|
1877
1923
|
// So Number(null) and Number('') both return 0, so use emptyValue for those two values
|
|
1878
|
-
var index = valueIndex ===
|
|
1924
|
+
var index = valueIndex === '' || valueIndex === null ? -1 : Number(valueIndex);
|
|
1879
1925
|
var option = allEnumOptions[index];
|
|
1880
1926
|
return option ? option.value : emptyValue;
|
|
1881
1927
|
}
|
|
@@ -1941,7 +1987,7 @@
|
|
|
1941
1987
|
var selectedIndexes = allEnumOptions.map(function (opt, index) {
|
|
1942
1988
|
return enumOptionsIsSelected(opt.value, value) ? String(index) : undefined;
|
|
1943
1989
|
}).filter(function (opt) {
|
|
1944
|
-
return typeof opt !==
|
|
1990
|
+
return typeof opt !== 'undefined';
|
|
1945
1991
|
});
|
|
1946
1992
|
if (!multiple) {
|
|
1947
1993
|
return selectedIndexes[0];
|
|
@@ -2009,7 +2055,7 @@
|
|
|
2009
2055
|
* @private
|
|
2010
2056
|
*/
|
|
2011
2057
|
_proto.getOrCreateErrorBlock = function getOrCreateErrorBlock(pathOfError) {
|
|
2012
|
-
var hasPath = Array.isArray(pathOfError) && pathOfError.length > 0 || typeof pathOfError ===
|
|
2058
|
+
var hasPath = Array.isArray(pathOfError) && pathOfError.length > 0 || typeof pathOfError === 'string';
|
|
2013
2059
|
var errorBlock = hasPath ? get__default["default"](this.errorSchema, pathOfError) : this.errorSchema;
|
|
2014
2060
|
if (!errorBlock && pathOfError) {
|
|
2015
2061
|
errorBlock = {};
|
|
@@ -2121,23 +2167,23 @@
|
|
|
2121
2167
|
autoDefaultStepAny = true;
|
|
2122
2168
|
}
|
|
2123
2169
|
var inputProps = _extends({
|
|
2124
|
-
type: defaultType ||
|
|
2170
|
+
type: defaultType || 'text'
|
|
2125
2171
|
}, rangeSpec(schema));
|
|
2126
2172
|
// If options.inputType is set use that as the input type
|
|
2127
2173
|
if (options.inputType) {
|
|
2128
2174
|
inputProps.type = options.inputType;
|
|
2129
2175
|
} else if (!defaultType) {
|
|
2130
2176
|
// If the schema is of type number or integer, set the input type to number
|
|
2131
|
-
if (schema.type ===
|
|
2132
|
-
inputProps.type =
|
|
2177
|
+
if (schema.type === 'number') {
|
|
2178
|
+
inputProps.type = 'number';
|
|
2133
2179
|
// Only add step if one isn't already defined and we are auto-defaulting the "any" step
|
|
2134
2180
|
if (autoDefaultStepAny && inputProps.step === undefined) {
|
|
2135
2181
|
// Setting step to 'any' fixes a bug in Safari where decimals are not
|
|
2136
2182
|
// allowed in number inputs
|
|
2137
|
-
inputProps.step =
|
|
2183
|
+
inputProps.step = 'any';
|
|
2138
2184
|
}
|
|
2139
|
-
} else if (schema.type ===
|
|
2140
|
-
inputProps.type =
|
|
2185
|
+
} else if (schema.type === 'integer') {
|
|
2186
|
+
inputProps.type = 'number';
|
|
2141
2187
|
// Only add step if one isn't already defined
|
|
2142
2188
|
if (inputProps.step === undefined) {
|
|
2143
2189
|
// Since this is integer, you always want to step up or down in multiples of 1
|
|
@@ -2157,7 +2203,7 @@
|
|
|
2157
2203
|
props: {
|
|
2158
2204
|
disabled: false
|
|
2159
2205
|
},
|
|
2160
|
-
submitText:
|
|
2206
|
+
submitText: 'Submit',
|
|
2161
2207
|
norender: false
|
|
2162
2208
|
};
|
|
2163
2209
|
/** Extracts any `ui:submitButtonOptions` from the `uiSchema` and merges them onto the `DEFAULT_OPTIONS`
|
|
@@ -2190,7 +2236,7 @@
|
|
|
2190
2236
|
uiOptions = {};
|
|
2191
2237
|
}
|
|
2192
2238
|
var templates = registry.templates;
|
|
2193
|
-
if (name ===
|
|
2239
|
+
if (name === 'ButtonTemplates') {
|
|
2194
2240
|
return templates[name];
|
|
2195
2241
|
}
|
|
2196
2242
|
return (
|
|
@@ -2205,53 +2251,53 @@
|
|
|
2205
2251
|
*/
|
|
2206
2252
|
var widgetMap = {
|
|
2207
2253
|
"boolean": {
|
|
2208
|
-
checkbox:
|
|
2209
|
-
radio:
|
|
2210
|
-
select:
|
|
2211
|
-
hidden:
|
|
2254
|
+
checkbox: 'CheckboxWidget',
|
|
2255
|
+
radio: 'RadioWidget',
|
|
2256
|
+
select: 'SelectWidget',
|
|
2257
|
+
hidden: 'HiddenWidget'
|
|
2212
2258
|
},
|
|
2213
2259
|
string: {
|
|
2214
|
-
text:
|
|
2215
|
-
password:
|
|
2216
|
-
email:
|
|
2217
|
-
hostname:
|
|
2218
|
-
ipv4:
|
|
2219
|
-
ipv6:
|
|
2220
|
-
uri:
|
|
2221
|
-
|
|
2222
|
-
radio:
|
|
2223
|
-
select:
|
|
2224
|
-
textarea:
|
|
2225
|
-
hidden:
|
|
2226
|
-
date:
|
|
2227
|
-
datetime:
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
color:
|
|
2232
|
-
file:
|
|
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'
|
|
2233
2279
|
},
|
|
2234
2280
|
number: {
|
|
2235
|
-
text:
|
|
2236
|
-
select:
|
|
2237
|
-
updown:
|
|
2238
|
-
range:
|
|
2239
|
-
radio:
|
|
2240
|
-
hidden:
|
|
2281
|
+
text: 'TextWidget',
|
|
2282
|
+
select: 'SelectWidget',
|
|
2283
|
+
updown: 'UpDownWidget',
|
|
2284
|
+
range: 'RangeWidget',
|
|
2285
|
+
radio: 'RadioWidget',
|
|
2286
|
+
hidden: 'HiddenWidget'
|
|
2241
2287
|
},
|
|
2242
2288
|
integer: {
|
|
2243
|
-
text:
|
|
2244
|
-
select:
|
|
2245
|
-
updown:
|
|
2246
|
-
range:
|
|
2247
|
-
radio:
|
|
2248
|
-
hidden:
|
|
2289
|
+
text: 'TextWidget',
|
|
2290
|
+
select: 'SelectWidget',
|
|
2291
|
+
updown: 'UpDownWidget',
|
|
2292
|
+
range: 'RangeWidget',
|
|
2293
|
+
radio: 'RadioWidget',
|
|
2294
|
+
hidden: 'HiddenWidget'
|
|
2249
2295
|
},
|
|
2250
2296
|
array: {
|
|
2251
|
-
select:
|
|
2252
|
-
checkboxes:
|
|
2253
|
-
files:
|
|
2254
|
-
hidden:
|
|
2297
|
+
select: 'SelectWidget',
|
|
2298
|
+
checkboxes: 'CheckboxesWidget',
|
|
2299
|
+
files: 'FileWidget',
|
|
2300
|
+
hidden: 'HiddenWidget'
|
|
2255
2301
|
}
|
|
2256
2302
|
};
|
|
2257
2303
|
/** Wraps the given widget with stateless functional component that will merge any `defaultProps.options` with the
|
|
@@ -2262,18 +2308,18 @@
|
|
|
2262
2308
|
* @returns - The wrapper widget
|
|
2263
2309
|
*/
|
|
2264
2310
|
function mergeWidgetOptions(AWidget) {
|
|
2265
|
-
var MergedWidget = get__default["default"](AWidget,
|
|
2311
|
+
var MergedWidget = get__default["default"](AWidget, 'MergedWidget');
|
|
2266
2312
|
// cache return value as property of widget for proper react reconciliation
|
|
2267
2313
|
if (!MergedWidget) {
|
|
2268
2314
|
var defaultOptions = AWidget.defaultProps && AWidget.defaultProps.options || {};
|
|
2269
2315
|
MergedWidget = function MergedWidget(_ref) {
|
|
2270
2316
|
var options = _ref.options,
|
|
2271
2317
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
2272
|
-
return
|
|
2318
|
+
return jsxRuntime.jsx(AWidget, _extends({
|
|
2273
2319
|
options: _extends({}, defaultOptions, options)
|
|
2274
2320
|
}, props));
|
|
2275
2321
|
};
|
|
2276
|
-
set__default["default"](AWidget,
|
|
2322
|
+
set__default["default"](AWidget, 'MergedWidget', MergedWidget);
|
|
2277
2323
|
}
|
|
2278
2324
|
return MergedWidget;
|
|
2279
2325
|
}
|
|
@@ -2293,17 +2339,17 @@
|
|
|
2293
2339
|
registeredWidgets = {};
|
|
2294
2340
|
}
|
|
2295
2341
|
var type = getSchemaType(schema);
|
|
2296
|
-
if (typeof widget ===
|
|
2342
|
+
if (typeof widget === 'function' || widget && ReactIs__default["default"].isForwardRef( /*#__PURE__*/react.createElement(widget)) || ReactIs__default["default"].isMemo(widget)) {
|
|
2297
2343
|
return mergeWidgetOptions(widget);
|
|
2298
2344
|
}
|
|
2299
|
-
if (typeof widget !==
|
|
2345
|
+
if (typeof widget !== 'string') {
|
|
2300
2346
|
throw new Error("Unsupported widget definition: " + typeof widget);
|
|
2301
2347
|
}
|
|
2302
2348
|
if (widget in registeredWidgets) {
|
|
2303
2349
|
var registeredWidget = registeredWidgets[widget];
|
|
2304
2350
|
return getWidget(schema, registeredWidget, registeredWidgets);
|
|
2305
2351
|
}
|
|
2306
|
-
if (typeof type ===
|
|
2352
|
+
if (typeof type === 'string') {
|
|
2307
2353
|
if (!(type in widgetMap)) {
|
|
2308
2354
|
throw new Error("No widget for type '" + type + "'");
|
|
2309
2355
|
}
|
|
@@ -2332,7 +2378,7 @@
|
|
|
2332
2378
|
return true;
|
|
2333
2379
|
} catch (e) {
|
|
2334
2380
|
var err = e;
|
|
2335
|
-
if (err.message && (err.message.startsWith(
|
|
2381
|
+
if (err.message && (err.message.startsWith('No widget') || err.message.startsWith('Unsupported widget'))) {
|
|
2336
2382
|
return false;
|
|
2337
2383
|
}
|
|
2338
2384
|
throw e;
|
|
@@ -2354,7 +2400,7 @@
|
|
|
2354
2400
|
* @returns - The consistent id for the field description element from the given `id`
|
|
2355
2401
|
*/
|
|
2356
2402
|
function descriptionId(id) {
|
|
2357
|
-
return idGenerator(id,
|
|
2403
|
+
return idGenerator(id, 'description');
|
|
2358
2404
|
}
|
|
2359
2405
|
/** Return a consistent `id` for the field error element
|
|
2360
2406
|
*
|
|
@@ -2362,7 +2408,7 @@
|
|
|
2362
2408
|
* @returns - The consistent id for the field error element from the given `id`
|
|
2363
2409
|
*/
|
|
2364
2410
|
function errorId(id) {
|
|
2365
|
-
return idGenerator(id,
|
|
2411
|
+
return idGenerator(id, 'error');
|
|
2366
2412
|
}
|
|
2367
2413
|
/** Return a consistent `id` for the field examples element
|
|
2368
2414
|
*
|
|
@@ -2370,7 +2416,7 @@
|
|
|
2370
2416
|
* @returns - The consistent id for the field examples element from the given `id`
|
|
2371
2417
|
*/
|
|
2372
2418
|
function examplesId(id) {
|
|
2373
|
-
return idGenerator(id,
|
|
2419
|
+
return idGenerator(id, 'examples');
|
|
2374
2420
|
}
|
|
2375
2421
|
/** Return a consistent `id` for the field help element
|
|
2376
2422
|
*
|
|
@@ -2378,7 +2424,7 @@
|
|
|
2378
2424
|
* @returns - The consistent id for the field help element from the given `id`
|
|
2379
2425
|
*/
|
|
2380
2426
|
function helpId(id) {
|
|
2381
|
-
return idGenerator(id,
|
|
2427
|
+
return idGenerator(id, 'help');
|
|
2382
2428
|
}
|
|
2383
2429
|
/** Return a consistent `id` for the field title element
|
|
2384
2430
|
*
|
|
@@ -2386,7 +2432,7 @@
|
|
|
2386
2432
|
* @returns - The consistent id for the field title element from the given `id`
|
|
2387
2433
|
*/
|
|
2388
2434
|
function titleId(id) {
|
|
2389
|
-
return idGenerator(id,
|
|
2435
|
+
return idGenerator(id, 'title');
|
|
2390
2436
|
}
|
|
2391
2437
|
/** Return a list of element ids that contain additional information about the field that can be used to as the aria
|
|
2392
2438
|
* description of the field. This is correctly omitting `titleId` which would be "labeling" rather than "describing" the
|
|
@@ -2400,7 +2446,7 @@
|
|
|
2400
2446
|
if (includeExamples === void 0) {
|
|
2401
2447
|
includeExamples = false;
|
|
2402
2448
|
}
|
|
2403
|
-
var examples = includeExamples ? " " + examplesId(id) :
|
|
2449
|
+
var examples = includeExamples ? " " + examplesId(id) : '';
|
|
2404
2450
|
return errorId(id) + " " + descriptionId(id) + " " + helpId(id) + examples;
|
|
2405
2451
|
}
|
|
2406
2452
|
/** Return a consistent `id` for the `optionIndex`s of a `Radio` or `Checkboxes` widget
|
|
@@ -2436,7 +2482,7 @@
|
|
|
2436
2482
|
if (CONST_KEY in schema) {
|
|
2437
2483
|
return schema["const"];
|
|
2438
2484
|
}
|
|
2439
|
-
throw new Error(
|
|
2485
|
+
throw new Error('schema cannot be inferred as a constant');
|
|
2440
2486
|
}
|
|
2441
2487
|
|
|
2442
2488
|
/** Gets the list of options from the schema. If the schema has an enum list, then those enum values are returned. The
|
|
@@ -2451,8 +2497,8 @@
|
|
|
2451
2497
|
// enumNames was deprecated in v5 and is intentionally omitted from the RJSFSchema type.
|
|
2452
2498
|
// Cast the type to include enumNames so the feature still works.
|
|
2453
2499
|
var schemaWithEnumNames = schema;
|
|
2454
|
-
if (schemaWithEnumNames.enumNames && "development" !==
|
|
2455
|
-
console.warn(
|
|
2500
|
+
if (schemaWithEnumNames.enumNames && "development" !== 'production') {
|
|
2501
|
+
console.warn('The enumNames property is deprecated and may be removed in a future major release.');
|
|
2456
2502
|
}
|
|
2457
2503
|
if (schema["enum"]) {
|
|
2458
2504
|
return schema["enum"].map(function (value, i) {
|
|
@@ -2501,21 +2547,21 @@
|
|
|
2501
2547
|
};
|
|
2502
2548
|
var propertyHash = arrayToHash(properties);
|
|
2503
2549
|
var orderFiltered = order.filter(function (prop) {
|
|
2504
|
-
return prop ===
|
|
2550
|
+
return prop === '*' || propertyHash[prop];
|
|
2505
2551
|
});
|
|
2506
2552
|
var orderHash = arrayToHash(orderFiltered);
|
|
2507
2553
|
var rest = properties.filter(function (prop) {
|
|
2508
2554
|
return !orderHash[prop];
|
|
2509
2555
|
});
|
|
2510
|
-
var restIndex = orderFiltered.indexOf(
|
|
2556
|
+
var restIndex = orderFiltered.indexOf('*');
|
|
2511
2557
|
if (restIndex === -1) {
|
|
2512
2558
|
if (rest.length) {
|
|
2513
2559
|
throw new Error("uiSchema order list does not contain " + errorPropList(rest));
|
|
2514
2560
|
}
|
|
2515
2561
|
return orderFiltered;
|
|
2516
2562
|
}
|
|
2517
|
-
if (restIndex !== orderFiltered.lastIndexOf(
|
|
2518
|
-
throw new Error(
|
|
2563
|
+
if (restIndex !== orderFiltered.lastIndexOf('*')) {
|
|
2564
|
+
throw new Error('uiSchema order list contains more than one wildcard item');
|
|
2519
2565
|
}
|
|
2520
2566
|
var complete = [].concat(orderFiltered);
|
|
2521
2567
|
complete.splice.apply(complete, [restIndex, 1].concat(rest));
|
|
@@ -2531,7 +2577,7 @@
|
|
|
2531
2577
|
function pad(num, width) {
|
|
2532
2578
|
var s = String(num);
|
|
2533
2579
|
while (s.length < width) {
|
|
2534
|
-
s =
|
|
2580
|
+
s = '0' + s;
|
|
2535
2581
|
}
|
|
2536
2582
|
return s;
|
|
2537
2583
|
}
|
|
@@ -2559,7 +2605,7 @@
|
|
|
2559
2605
|
}
|
|
2560
2606
|
var date = new Date(dateString);
|
|
2561
2607
|
if (Number.isNaN(date.getTime())) {
|
|
2562
|
-
throw new Error(
|
|
2608
|
+
throw new Error('Unable to parse date ' + dateString);
|
|
2563
2609
|
}
|
|
2564
2610
|
return {
|
|
2565
2611
|
year: date.getUTCFullYear(),
|
|
@@ -2653,7 +2699,7 @@
|
|
|
2653
2699
|
*/
|
|
2654
2700
|
function utcToLocal(jsonDate) {
|
|
2655
2701
|
if (!jsonDate) {
|
|
2656
|
-
return
|
|
2702
|
+
return '';
|
|
2657
2703
|
}
|
|
2658
2704
|
// required format of `'yyyy-MM-ddThh:mm' followed by optional ':ss' or ':ss.SSS'
|
|
2659
2705
|
// https://html.spec.whatwg.org/multipage/input.html#local-date-and-time-state-(type%3Ddatetime-local)
|
|
@@ -2671,6 +2717,76 @@
|
|
|
2671
2717
|
return yyyy + "-" + MM + "-" + dd + "T" + hh + ":" + mm + ":" + ss + "." + SSS;
|
|
2672
2718
|
}
|
|
2673
2719
|
|
|
2720
|
+
/** An enumeration of all the translatable strings used by `@rjsf/core` and its themes. The value of each of the
|
|
2721
|
+
* enumeration keys is expected to be the actual english string. Some strings contain replaceable parameter values
|
|
2722
|
+
* as indicated by `%1`, `%2`, etc. The number after the `%` indicates the order of the parameter. The ordering of
|
|
2723
|
+
* parameters is important because some languages may choose to put the second parameter before the first in its
|
|
2724
|
+
* translation. Also, some strings are rendered using `markdown-to-jsx` and thus support markdown and inline html.
|
|
2725
|
+
*/
|
|
2726
|
+
exports.TranslatableString = void 0;
|
|
2727
|
+
(function (TranslatableString) {
|
|
2728
|
+
/** Fallback title of an array item, used by ArrayField */
|
|
2729
|
+
TranslatableString["ArrayItemTitle"] = "Item";
|
|
2730
|
+
/** Missing items reason, used by ArrayField */
|
|
2731
|
+
TranslatableString["MissingItems"] = "Missing items definition";
|
|
2732
|
+
/** Yes label, used by BooleanField */
|
|
2733
|
+
TranslatableString["YesLabel"] = "Yes";
|
|
2734
|
+
/** No label, used by BooleanField */
|
|
2735
|
+
TranslatableString["NoLabel"] = "No";
|
|
2736
|
+
/** Close label, used by ErrorList */
|
|
2737
|
+
TranslatableString["CloseLabel"] = "Close";
|
|
2738
|
+
/** Errors label, used by ErrorList */
|
|
2739
|
+
TranslatableString["ErrorsLabel"] = "Errors";
|
|
2740
|
+
/** New additionalProperties string default value, used by ObjectField */
|
|
2741
|
+
TranslatableString["NewStringDefault"] = "New Value";
|
|
2742
|
+
/** Add button title, used by AddButton */
|
|
2743
|
+
TranslatableString["AddButton"] = "Add";
|
|
2744
|
+
/** Add button title, used by AddButton */
|
|
2745
|
+
TranslatableString["AddItemButton"] = "Add Item";
|
|
2746
|
+
/** Move down button title, used by IconButton */
|
|
2747
|
+
TranslatableString["MoveDownButton"] = "Move down";
|
|
2748
|
+
/** Move up button title, used by IconButton */
|
|
2749
|
+
TranslatableString["MoveUpButton"] = "Move up";
|
|
2750
|
+
/** Remove button title, used by IconButton */
|
|
2751
|
+
TranslatableString["RemoveButton"] = "Remove";
|
|
2752
|
+
/** Now label, used by AltDateWidget */
|
|
2753
|
+
TranslatableString["NowLabel"] = "Now";
|
|
2754
|
+
/** Clear label, used by AltDateWidget */
|
|
2755
|
+
TranslatableString["ClearLabel"] = "Clear";
|
|
2756
|
+
/** Aria date label, used by DateWidget */
|
|
2757
|
+
TranslatableString["AriaDateLabel"] = "Select a date";
|
|
2758
|
+
/** Decrement button aria label, used by UpDownWidget */
|
|
2759
|
+
TranslatableString["DecrementAriaLabel"] = "Decrease value by 1";
|
|
2760
|
+
/** Increment button aria label, used by UpDownWidget */
|
|
2761
|
+
TranslatableString["IncrementAriaLabel"] = "Increase value by 1";
|
|
2762
|
+
// Strings with replaceable parameters
|
|
2763
|
+
/** Unknown field type reason, where %1 will be replaced with the type as provided by SchemaField */
|
|
2764
|
+
TranslatableString["UnknownFieldType"] = "Unknown field type %1";
|
|
2765
|
+
/** Option prefix, where %1 will be replaced with the option index as provided by MultiSchemaField */
|
|
2766
|
+
TranslatableString["OptionPrefix"] = "Option %1";
|
|
2767
|
+
/** Option prefix, where %1 and %2 will be replaced by the schema title and option index, respectively as provided by
|
|
2768
|
+
* MultiSchemaField
|
|
2769
|
+
*/
|
|
2770
|
+
TranslatableString["TitleOptionPrefix"] = "%1 option %2";
|
|
2771
|
+
/** Key label, where %1 will be replaced by the label as provided by WrapIfAdditionalTemplate */
|
|
2772
|
+
TranslatableString["KeyLabel"] = "%1 Key";
|
|
2773
|
+
// Strings with replaceable parameters AND/OR that support markdown and html
|
|
2774
|
+
/** Unsupported field schema, used by UnsupportedField */
|
|
2775
|
+
TranslatableString["UnsupportedField"] = "Unsupported field schema.";
|
|
2776
|
+
/** Unsupported field schema, where %1 will be replaced by the idSchema.$id as provided by UnsupportedField */
|
|
2777
|
+
TranslatableString["UnsupportedFieldWithId"] = "Unsupported field schema for field <code>%1</code>.";
|
|
2778
|
+
/** Unsupported field schema, where %1 will be replaced by the reason string as provided by UnsupportedField */
|
|
2779
|
+
TranslatableString["UnsupportedFieldWithReason"] = "Unsupported field schema: <em>%1</em>.";
|
|
2780
|
+
/** Unsupported field schema, where %1 and %2 will be replaced by the idSchema.$id and reason strings, respectively,
|
|
2781
|
+
* as provided by UnsupportedField
|
|
2782
|
+
*/
|
|
2783
|
+
TranslatableString["UnsupportedFieldWithIdAndReason"] = "Unsupported field schema for field <code>%1</code>: <em>%2</em>.";
|
|
2784
|
+
/** File name, type and size info, where %1, %2 and %3 will be replaced by the file name, file type and file size as
|
|
2785
|
+
* provided by FileWidget
|
|
2786
|
+
*/
|
|
2787
|
+
TranslatableString["FilesInfo"] = "<strong>%1</strong> (%2, %3 bytes)";
|
|
2788
|
+
})(exports.TranslatableString || (exports.TranslatableString = {}));
|
|
2789
|
+
|
|
2674
2790
|
exports.ADDITIONAL_PROPERTIES_KEY = ADDITIONAL_PROPERTIES_KEY;
|
|
2675
2791
|
exports.ADDITIONAL_PROPERTY_FLAG = ADDITIONAL_PROPERTY_FLAG;
|
|
2676
2792
|
exports.ALL_OF_KEY = ALL_OF_KEY;
|
|
@@ -2702,6 +2818,7 @@
|
|
|
2702
2818
|
exports.dataURItoBlob = dataURItoBlob;
|
|
2703
2819
|
exports.deepEquals = deepEquals;
|
|
2704
2820
|
exports.descriptionId = descriptionId;
|
|
2821
|
+
exports.englishStringTranslator = englishStringTranslator;
|
|
2705
2822
|
exports.enumOptionsDeselectValue = enumOptionsDeselectValue;
|
|
2706
2823
|
exports.enumOptionsIndexForValue = enumOptionsIndexForValue;
|
|
2707
2824
|
exports.enumOptionsIsSelected = enumOptionsIsSelected;
|
|
@@ -2742,6 +2859,7 @@
|
|
|
2742
2859
|
exports.pad = pad;
|
|
2743
2860
|
exports.parseDateString = parseDateString;
|
|
2744
2861
|
exports.rangeSpec = rangeSpec;
|
|
2862
|
+
exports.replaceStringParameters = replaceStringParameters;
|
|
2745
2863
|
exports.retrieveSchema = retrieveSchema;
|
|
2746
2864
|
exports.sanitizeDataForNewSchema = sanitizeDataForNewSchema;
|
|
2747
2865
|
exports.schemaRequiresTrueValue = schemaRequiresTrueValue;
|