@rjsf/utils 5.24.4 → 5.24.7
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/lib/ErrorSchemaBuilder.d.ts +1 -1
- package/lib/ErrorSchemaBuilder.js +5 -5
- package/lib/allowAdditionalItems.d.ts +1 -1
- package/lib/allowAdditionalItems.js +1 -1
- package/lib/canExpand.d.ts +1 -1
- package/lib/canExpand.js +1 -1
- package/lib/constIsAjvDataReference.d.ts +1 -1
- package/lib/constIsAjvDataReference.js +2 -2
- package/lib/createErrorHandler.d.ts +1 -1
- package/lib/createErrorHandler.js +2 -2
- package/lib/createSchemaUtils.d.ts +1 -1
- package/lib/createSchemaUtils.js +2 -2
- package/lib/dateRangeOptions.d.ts +1 -1
- package/lib/dateRangeOptions.js +1 -1
- package/lib/deepEquals.js +1 -1
- package/lib/englishStringTranslator.d.ts +1 -1
- package/lib/englishStringTranslator.js +1 -1
- package/lib/enumOptionsDeselectValue.d.ts +1 -1
- package/lib/enumOptionsDeselectValue.js +2 -2
- package/lib/enumOptionsIndexForValue.d.ts +1 -1
- package/lib/enumOptionsIndexForValue.js +1 -1
- package/lib/enumOptionsIsSelected.d.ts +1 -1
- package/lib/enumOptionsIsSelected.js +1 -1
- package/lib/enumOptionsSelectValue.d.ts +1 -1
- package/lib/enumOptionsSelectValue.js +2 -2
- package/lib/enumOptionsValueForIndex.d.ts +1 -1
- package/lib/findSchemaDefinition.d.ts +1 -1
- package/lib/findSchemaDefinition.js +2 -2
- package/lib/getChangedFields.js +6 -6
- package/lib/getDateElementProps.d.ts +1 -1
- package/lib/getDiscriminatorFieldFromSchema.d.ts +1 -1
- package/lib/getDiscriminatorFieldFromSchema.js +2 -2
- package/lib/getInputProps.d.ts +1 -1
- package/lib/getInputProps.js +1 -1
- package/lib/getOptionMatchingSimpleDiscriminator.d.ts +1 -1
- package/lib/getOptionMatchingSimpleDiscriminator.js +2 -2
- package/lib/getSchemaType.d.ts +1 -1
- package/lib/getSchemaType.js +1 -1
- package/lib/getSubmitButtonOptions.d.ts +1 -1
- package/lib/getSubmitButtonOptions.js +2 -2
- package/lib/getTemplate.d.ts +1 -1
- package/lib/getUiOptions.d.ts +1 -1
- package/lib/getUiOptions.js +2 -2
- package/lib/getWidget.d.ts +1 -1
- package/lib/getWidget.js +3 -3
- package/lib/hasWidget.d.ts +1 -1
- package/lib/hasWidget.js +1 -1
- package/lib/hashForSchema.d.ts +1 -1
- package/lib/idGenerators.d.ts +1 -1
- package/lib/idGenerators.js +2 -2
- package/lib/index.d.ts +60 -60
- package/lib/index.js +60 -60
- package/lib/isConstant.d.ts +1 -1
- package/lib/isConstant.js +1 -1
- package/lib/isCustomWidget.d.ts +1 -1
- package/lib/isCustomWidget.js +1 -1
- package/lib/isFixedItems.d.ts +1 -1
- package/lib/isFixedItems.js +1 -1
- package/lib/mergeDefaultsWithFormData.js +3 -3
- package/lib/mergeObjects.d.ts +1 -1
- package/lib/mergeObjects.js +1 -1
- package/lib/mergeSchemas.d.ts +1 -1
- package/lib/mergeSchemas.js +4 -4
- package/lib/optionsList.d.ts +1 -1
- package/lib/optionsList.js +2 -2
- package/lib/parseDateString.d.ts +1 -1
- package/lib/parser/ParserValidator.d.ts +1 -1
- package/lib/parser/ParserValidator.js +4 -4
- package/lib/parser/index.d.ts +2 -2
- package/lib/parser/index.js +1 -1
- package/lib/parser/schemaParser.d.ts +2 -2
- package/lib/parser/schemaParser.js +5 -5
- package/lib/rangeSpec.d.ts +2 -2
- package/lib/schema/getClosestMatchingOption.d.ts +1 -1
- package/lib/schema/getClosestMatchingOption.js +13 -13
- package/lib/schema/getDefaultFormState.d.ts +1 -1
- package/lib/schema/getDefaultFormState.js +19 -19
- package/lib/schema/getDisplayLabel.d.ts +1 -1
- package/lib/schema/getDisplayLabel.js +6 -6
- package/lib/schema/getFirstMatchingOption.d.ts +1 -1
- package/lib/schema/getFirstMatchingOption.js +1 -1
- package/lib/schema/getMatchingOption.d.ts +1 -1
- package/lib/schema/getMatchingOption.js +5 -5
- package/lib/schema/index.d.ts +13 -13
- package/lib/schema/index.js +13 -13
- package/lib/schema/isFilesArray.d.ts +1 -1
- package/lib/schema/isFilesArray.js +2 -2
- package/lib/schema/isMultiSelect.d.ts +1 -1
- package/lib/schema/isMultiSelect.js +1 -1
- package/lib/schema/isSelect.d.ts +1 -1
- package/lib/schema/isSelect.js +2 -2
- package/lib/schema/mergeValidationData.d.ts +1 -1
- package/lib/schema/mergeValidationData.js +2 -2
- package/lib/schema/retrieveSchema.d.ts +1 -1
- package/lib/schema/retrieveSchema.js +15 -15
- package/lib/schema/sanitizeDataForNewSchema.d.ts +1 -1
- package/lib/schema/sanitizeDataForNewSchema.js +4 -4
- package/lib/schema/toIdSchema.d.ts +1 -1
- package/lib/schema/toIdSchema.js +6 -6
- package/lib/schema/toPathSchema.d.ts +1 -1
- package/lib/schema/toPathSchema.js +7 -7
- package/lib/schemaRequiresTrueValue.d.ts +1 -1
- package/lib/shouldRender.js +1 -1
- package/lib/toConstant.d.ts +1 -1
- package/lib/toConstant.js +1 -1
- package/lib/toDateString.d.ts +1 -1
- package/lib/toErrorList.d.ts +1 -1
- package/lib/toErrorList.js +2 -2
- package/lib/toErrorSchema.d.ts +1 -1
- package/lib/toErrorSchema.js +2 -2
- package/lib/types.d.ts +1 -1
- package/lib/unwrapErrorHandler.d.ts +1 -1
- package/lib/unwrapErrorHandler.js +1 -1
- package/lib/utcToLocal.js +1 -1
- package/lib/validationDataMerge.d.ts +1 -1
- package/lib/validationDataMerge.js +3 -3
- package/lib/withIdRefPrefix.d.ts +1 -1
- package/lib/withIdRefPrefix.js +2 -2
- package/package.json +27 -6
package/lib/index.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import allowAdditionalItems from './allowAdditionalItems';
|
|
2
|
-
import asNumber from './asNumber';
|
|
3
|
-
import canExpand from './canExpand';
|
|
4
|
-
import createErrorHandler from './createErrorHandler';
|
|
5
|
-
import createSchemaUtils from './createSchemaUtils';
|
|
6
|
-
import dataURItoBlob from './dataURItoBlob';
|
|
7
|
-
import dateRangeOptions from './dateRangeOptions';
|
|
8
|
-
import deepEquals from './deepEquals';
|
|
9
|
-
import englishStringTranslator from './englishStringTranslator';
|
|
10
|
-
import enumOptionsDeselectValue from './enumOptionsDeselectValue';
|
|
11
|
-
import enumOptionsIndexForValue from './enumOptionsIndexForValue';
|
|
12
|
-
import enumOptionsIsSelected from './enumOptionsIsSelected';
|
|
13
|
-
import enumOptionsSelectValue from './enumOptionsSelectValue';
|
|
14
|
-
import enumOptionsValueForIndex from './enumOptionsValueForIndex';
|
|
15
|
-
import ErrorSchemaBuilder from './ErrorSchemaBuilder';
|
|
16
|
-
import findSchemaDefinition from './findSchemaDefinition';
|
|
17
|
-
import getDateElementProps from './getDateElementProps';
|
|
18
|
-
import getDiscriminatorFieldFromSchema from './getDiscriminatorFieldFromSchema';
|
|
19
|
-
import getInputProps from './getInputProps';
|
|
20
|
-
import getSchemaType from './getSchemaType';
|
|
21
|
-
import getSubmitButtonOptions from './getSubmitButtonOptions';
|
|
22
|
-
import getTemplate from './getTemplate';
|
|
23
|
-
import getUiOptions from './getUiOptions';
|
|
24
|
-
import getWidget from './getWidget';
|
|
25
|
-
import guessType from './guessType';
|
|
26
|
-
import hashForSchema from './hashForSchema';
|
|
27
|
-
import hasWidget from './hasWidget';
|
|
28
|
-
import { ariaDescribedByIds, descriptionId, errorId, examplesId, helpId, optionId, titleId } from './idGenerators';
|
|
29
|
-
import isConstant from './isConstant';
|
|
30
|
-
import isCustomWidget from './isCustomWidget';
|
|
31
|
-
import isFixedItems from './isFixedItems';
|
|
32
|
-
import isObject from './isObject';
|
|
33
|
-
import labelValue from './labelValue';
|
|
34
|
-
import localToUTC from './localToUTC';
|
|
35
|
-
import mergeDefaultsWithFormData from './mergeDefaultsWithFormData';
|
|
36
|
-
import mergeObjects from './mergeObjects';
|
|
37
|
-
import mergeSchemas from './mergeSchemas';
|
|
38
|
-
import optionsList from './optionsList';
|
|
39
|
-
import orderProperties from './orderProperties';
|
|
40
|
-
import pad from './pad';
|
|
41
|
-
import parseDateString from './parseDateString';
|
|
42
|
-
import rangeSpec from './rangeSpec';
|
|
43
|
-
import replaceStringParameters from './replaceStringParameters';
|
|
44
|
-
import schemaRequiresTrueValue from './schemaRequiresTrueValue';
|
|
45
|
-
import shouldRender from './shouldRender';
|
|
46
|
-
import toConstant from './toConstant';
|
|
47
|
-
import toDateString from './toDateString';
|
|
48
|
-
import toErrorList from './toErrorList';
|
|
49
|
-
import toErrorSchema from './toErrorSchema';
|
|
50
|
-
import unwrapErrorHandler from './unwrapErrorHandler';
|
|
51
|
-
import utcToLocal from './utcToLocal';
|
|
52
|
-
import validationDataMerge from './validationDataMerge';
|
|
53
|
-
import withIdRefPrefix from './withIdRefPrefix';
|
|
54
|
-
import getOptionMatchingSimpleDiscriminator from './getOptionMatchingSimpleDiscriminator';
|
|
55
|
-
import getChangedFields from './getChangedFields';
|
|
56
|
-
export * from './types';
|
|
57
|
-
export * from './enums';
|
|
58
|
-
export * from './constants';
|
|
59
|
-
export * from './parser';
|
|
60
|
-
export * from './schema';
|
|
1
|
+
import allowAdditionalItems from './allowAdditionalItems.js';
|
|
2
|
+
import asNumber from './asNumber.js';
|
|
3
|
+
import canExpand from './canExpand.js';
|
|
4
|
+
import createErrorHandler from './createErrorHandler.js';
|
|
5
|
+
import createSchemaUtils from './createSchemaUtils.js';
|
|
6
|
+
import dataURItoBlob from './dataURItoBlob.js';
|
|
7
|
+
import dateRangeOptions from './dateRangeOptions.js';
|
|
8
|
+
import deepEquals from './deepEquals.js';
|
|
9
|
+
import englishStringTranslator from './englishStringTranslator.js';
|
|
10
|
+
import enumOptionsDeselectValue from './enumOptionsDeselectValue.js';
|
|
11
|
+
import enumOptionsIndexForValue from './enumOptionsIndexForValue.js';
|
|
12
|
+
import enumOptionsIsSelected from './enumOptionsIsSelected.js';
|
|
13
|
+
import enumOptionsSelectValue from './enumOptionsSelectValue.js';
|
|
14
|
+
import enumOptionsValueForIndex from './enumOptionsValueForIndex.js';
|
|
15
|
+
import ErrorSchemaBuilder from './ErrorSchemaBuilder.js';
|
|
16
|
+
import findSchemaDefinition from './findSchemaDefinition.js';
|
|
17
|
+
import getDateElementProps from './getDateElementProps.js';
|
|
18
|
+
import getDiscriminatorFieldFromSchema from './getDiscriminatorFieldFromSchema.js';
|
|
19
|
+
import getInputProps from './getInputProps.js';
|
|
20
|
+
import getSchemaType from './getSchemaType.js';
|
|
21
|
+
import getSubmitButtonOptions from './getSubmitButtonOptions.js';
|
|
22
|
+
import getTemplate from './getTemplate.js';
|
|
23
|
+
import getUiOptions from './getUiOptions.js';
|
|
24
|
+
import getWidget from './getWidget.js';
|
|
25
|
+
import guessType from './guessType.js';
|
|
26
|
+
import hashForSchema from './hashForSchema.js';
|
|
27
|
+
import hasWidget from './hasWidget.js';
|
|
28
|
+
import { ariaDescribedByIds, descriptionId, errorId, examplesId, helpId, optionId, titleId } from './idGenerators.js';
|
|
29
|
+
import isConstant from './isConstant.js';
|
|
30
|
+
import isCustomWidget from './isCustomWidget.js';
|
|
31
|
+
import isFixedItems from './isFixedItems.js';
|
|
32
|
+
import isObject from './isObject.js';
|
|
33
|
+
import labelValue from './labelValue.js';
|
|
34
|
+
import localToUTC from './localToUTC.js';
|
|
35
|
+
import mergeDefaultsWithFormData from './mergeDefaultsWithFormData.js';
|
|
36
|
+
import mergeObjects from './mergeObjects.js';
|
|
37
|
+
import mergeSchemas from './mergeSchemas.js';
|
|
38
|
+
import optionsList from './optionsList.js';
|
|
39
|
+
import orderProperties from './orderProperties.js';
|
|
40
|
+
import pad from './pad.js';
|
|
41
|
+
import parseDateString from './parseDateString.js';
|
|
42
|
+
import rangeSpec from './rangeSpec.js';
|
|
43
|
+
import replaceStringParameters from './replaceStringParameters.js';
|
|
44
|
+
import schemaRequiresTrueValue from './schemaRequiresTrueValue.js';
|
|
45
|
+
import shouldRender from './shouldRender.js';
|
|
46
|
+
import toConstant from './toConstant.js';
|
|
47
|
+
import toDateString from './toDateString.js';
|
|
48
|
+
import toErrorList from './toErrorList.js';
|
|
49
|
+
import toErrorSchema from './toErrorSchema.js';
|
|
50
|
+
import unwrapErrorHandler from './unwrapErrorHandler.js';
|
|
51
|
+
import utcToLocal from './utcToLocal.js';
|
|
52
|
+
import validationDataMerge from './validationDataMerge.js';
|
|
53
|
+
import withIdRefPrefix from './withIdRefPrefix.js';
|
|
54
|
+
import getOptionMatchingSimpleDiscriminator from './getOptionMatchingSimpleDiscriminator.js';
|
|
55
|
+
import getChangedFields from './getChangedFields.js';
|
|
56
|
+
export * from './types.js';
|
|
57
|
+
export * from './enums.js';
|
|
58
|
+
export * from './constants.js';
|
|
59
|
+
export * from './parser/index.js';
|
|
60
|
+
export * from './schema/index.js';
|
|
61
61
|
export { allowAdditionalItems, ariaDescribedByIds, asNumber, canExpand, createErrorHandler, createSchemaUtils, dataURItoBlob, dateRangeOptions, deepEquals, descriptionId, englishStringTranslator, enumOptionsDeselectValue, enumOptionsIndexForValue, enumOptionsIsSelected, enumOptionsSelectValue, enumOptionsValueForIndex, errorId, examplesId, ErrorSchemaBuilder, findSchemaDefinition, getChangedFields, getDateElementProps, getDiscriminatorFieldFromSchema, getInputProps, getOptionMatchingSimpleDiscriminator, getSchemaType, getSubmitButtonOptions, getTemplate, getUiOptions, getWidget, guessType, hasWidget, hashForSchema, helpId, isConstant, isCustomWidget, isFixedItems, isObject, labelValue, localToUTC, mergeDefaultsWithFormData, mergeObjects, mergeSchemas, optionId, optionsList, orderProperties, pad, parseDateString, rangeSpec, replaceStringParameters, schemaRequiresTrueValue, shouldRender, titleId, toConstant, toDateString, toErrorList, toErrorSchema, unwrapErrorHandler, utcToLocal, validationDataMerge, withIdRefPrefix, };
|
|
62
62
|
//# sourceMappingURL=index.js.map
|
package/lib/isConstant.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RJSFSchema, StrictRJSFSchema } from './types';
|
|
1
|
+
import { RJSFSchema, StrictRJSFSchema } from './types.js';
|
|
2
2
|
/** This function checks if the given `schema` matches a single constant value. This happens when either the schema has
|
|
3
3
|
* an `enum` array with a single value or there is a `const` defined.
|
|
4
4
|
*
|
package/lib/isConstant.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CONST_KEY } from './constants';
|
|
1
|
+
import { CONST_KEY } from './constants.js';
|
|
2
2
|
/** This function checks if the given `schema` matches a single constant value. This happens when either the schema has
|
|
3
3
|
* an `enum` array with a single value or there is a `const` defined.
|
|
4
4
|
*
|
package/lib/isCustomWidget.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormContextType, RJSFSchema, StrictRJSFSchema, UiSchema } from './types';
|
|
1
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema, UiSchema } from './types.js';
|
|
2
2
|
/** Checks to see if the `uiSchema` contains the `widget` field and that the widget is not `hidden`
|
|
3
3
|
*
|
|
4
4
|
* @param uiSchema - The UI Schema from which to detect if it is customized
|
package/lib/isCustomWidget.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import getUiOptions from './getUiOptions';
|
|
1
|
+
import getUiOptions from './getUiOptions.js';
|
|
2
2
|
/** Checks to see if the `uiSchema` contains the `widget` field and that the widget is not `hidden`
|
|
3
3
|
*
|
|
4
4
|
* @param uiSchema - The UI Schema from which to detect if it is customized
|
package/lib/isFixedItems.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RJSFSchema, StrictRJSFSchema } from './types';
|
|
1
|
+
import { RJSFSchema, StrictRJSFSchema } from './types.js';
|
|
2
2
|
/** Detects whether the given `schema` contains fixed items. This is the case when `schema.items` is a non-empty array
|
|
3
3
|
* that only contains objects.
|
|
4
4
|
*
|
package/lib/isFixedItems.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import get from 'lodash/get';
|
|
2
|
-
import isObject from './isObject';
|
|
3
|
-
import isNil from 'lodash/isNil';
|
|
1
|
+
import get from 'lodash-es/get.js';
|
|
2
|
+
import isObject from './isObject.js';
|
|
3
|
+
import isNil from 'lodash-es/isNil.js';
|
|
4
4
|
/** Merges the `defaults` object of type `T` into the `formData` of type `T`
|
|
5
5
|
*
|
|
6
6
|
* When merging defaults and form data, we want to merge in this specific way:
|
package/lib/mergeObjects.d.ts
CHANGED
package/lib/mergeObjects.js
CHANGED
package/lib/mergeSchemas.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GenericObjectType } from './types';
|
|
1
|
+
import { GenericObjectType } from './types.js';
|
|
2
2
|
/** Recursively merge deeply nested schemas. The difference between `mergeSchemas` and `mergeObjects` is that
|
|
3
3
|
* `mergeSchemas` only concats arrays for values under the 'required' keyword, and when it does, it doesn't include
|
|
4
4
|
* duplicate values.
|
package/lib/mergeSchemas.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import union from 'lodash/union';
|
|
2
|
-
import { REQUIRED_KEY } from './constants';
|
|
3
|
-
import getSchemaType from './getSchemaType';
|
|
4
|
-
import isObject from './isObject';
|
|
1
|
+
import union from 'lodash-es/union.js';
|
|
2
|
+
import { REQUIRED_KEY } from './constants.js';
|
|
3
|
+
import getSchemaType from './getSchemaType.js';
|
|
4
|
+
import isObject from './isObject.js';
|
|
5
5
|
/** Recursively merge deeply nested schemas. The difference between `mergeSchemas` and `mergeObjects` is that
|
|
6
6
|
* `mergeSchemas` only concats arrays for values under the 'required' keyword, and when it does, it doesn't include
|
|
7
7
|
* duplicate values.
|
package/lib/optionsList.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RJSFSchema, EnumOptionsType, StrictRJSFSchema, FormContextType, UiSchema } from './types';
|
|
1
|
+
import { RJSFSchema, EnumOptionsType, StrictRJSFSchema, FormContextType, UiSchema } from './types.js';
|
|
2
2
|
/** Gets the list of options from the `schema`. If the schema has an enum list, then those enum values are returned. The
|
|
3
3
|
* labels for the options will be extracted from the non-standard, RJSF-deprecated `enumNames` if it exists, otherwise
|
|
4
4
|
* the label will be the same as the `value`. If the schema has a `oneOf` or `anyOf`, then the value is the list of
|
package/lib/optionsList.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import toConstant from './toConstant';
|
|
2
|
-
import getUiOptions from './getUiOptions';
|
|
1
|
+
import toConstant from './toConstant.js';
|
|
2
|
+
import getUiOptions from './getUiOptions.js';
|
|
3
3
|
/** Gets the list of options from the `schema`. If the schema has an enum list, then those enum values are returned. The
|
|
4
4
|
* labels for the options will be extracted from the non-standard, RJSF-deprecated `enumNames` if it exists, otherwise
|
|
5
5
|
* the label will be the same as the `value`. If the schema has a `oneOf` or `anyOf`, then the value is the list of
|
package/lib/parseDateString.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CustomValidator, ErrorSchema, ErrorTransformer, FormContextType, RJSFSchema, RJSFValidationError, StrictRJSFSchema, UiSchema, ValidationData, ValidatorType } from '../types';
|
|
1
|
+
import { CustomValidator, ErrorSchema, ErrorTransformer, FormContextType, RJSFSchema, RJSFValidationError, StrictRJSFSchema, UiSchema, ValidationData, ValidatorType } from '../types.js';
|
|
2
2
|
/** The type of the map of schema hash to schema
|
|
3
3
|
*/
|
|
4
4
|
export type SchemaMap<S extends StrictRJSFSchema = RJSFSchema> = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import get from 'lodash/get';
|
|
2
|
-
import { ID_KEY } from '../constants';
|
|
3
|
-
import hashForSchema from '../hashForSchema';
|
|
4
|
-
import deepEquals from '../deepEquals';
|
|
1
|
+
import get from 'lodash-es/get.js';
|
|
2
|
+
import { ID_KEY } from '../constants.js';
|
|
3
|
+
import hashForSchema from '../hashForSchema.js';
|
|
4
|
+
import deepEquals from '../deepEquals.js';
|
|
5
5
|
/** An implementation of the `ValidatorType` interface that is designed for use in capturing schemas used by the
|
|
6
6
|
* `isValid()` function. The rest of the implementation of the interface throws errors when it is attempted to be used.
|
|
7
7
|
* An instance of the object allows the caller to capture the schemas used in calls to the `isValid()` function. These
|
package/lib/parser/index.d.ts
CHANGED
package/lib/parser/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FormContextType, RJSFSchema, StrictRJSFSchema } from '../types';
|
|
2
|
-
import { SchemaMap } from './ParserValidator';
|
|
1
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema } from '../types.js';
|
|
2
|
+
import { SchemaMap } from './ParserValidator.js';
|
|
3
3
|
/** Parses the given `rootSchema` to extract out all the sub-schemas that maybe contained within it. Returns a map of
|
|
4
4
|
* the hash of the schema to schema/sub-schema.
|
|
5
5
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import forEach from 'lodash/forEach';
|
|
2
|
-
import { ITEMS_KEY, PROPERTIES_KEY } from '../constants';
|
|
3
|
-
import ParserValidator from './ParserValidator';
|
|
4
|
-
import { resolveAnyOrOneOfSchemas, retrieveSchemaInternal } from '../schema/retrieveSchema';
|
|
5
|
-
import deepEquals from '../deepEquals';
|
|
1
|
+
import forEach from 'lodash-es/forEach.js';
|
|
2
|
+
import { ITEMS_KEY, PROPERTIES_KEY } from '../constants.js';
|
|
3
|
+
import ParserValidator from './ParserValidator.js';
|
|
4
|
+
import { resolveAnyOrOneOfSchemas, retrieveSchemaInternal } from '../schema/retrieveSchema.js';
|
|
5
|
+
import deepEquals from '../deepEquals.js';
|
|
6
6
|
/** Recursive function used to parse the given `schema` belonging to the `rootSchema`. The `validator` is used to
|
|
7
7
|
* capture the sub-schemas that the `isValid()` function is called with. For each schema returned by the
|
|
8
8
|
* `retrieveSchemaInternal()`, the `resolveAnyOrOneOfSchemas()` function is called. For each of the schemas returned
|
package/lib/rangeSpec.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RangeSpecType, StrictRJSFSchema } from './types';
|
|
2
|
-
import { RJSFSchema } from './types';
|
|
1
|
+
import { RangeSpecType, StrictRJSFSchema } from './types.js';
|
|
2
|
+
import { RJSFSchema } from './types.js';
|
|
3
3
|
/** Extracts the range spec information `{ step?: number, min?: number, max?: number }` that can be spread onto an HTML
|
|
4
4
|
* input from the range analog in the schema `{ multipleOf?: number, minimum?: number, maximum?: number }`.
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Experimental_CustomMergeAllOf, FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType } from '../types';
|
|
1
|
+
import { Experimental_CustomMergeAllOf, FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType } from '../types.js';
|
|
2
2
|
/** A junk option used to determine when the getFirstMatchingOption call really matches an option rather than returning
|
|
3
3
|
* the first item
|
|
4
4
|
*/
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import get from 'lodash/get';
|
|
2
|
-
import has from 'lodash/has';
|
|
3
|
-
import isNumber from 'lodash/isNumber';
|
|
4
|
-
import isObject from 'lodash/isObject';
|
|
5
|
-
import isString from 'lodash/isString';
|
|
6
|
-
import reduce from 'lodash/reduce';
|
|
7
|
-
import times from 'lodash/times';
|
|
8
|
-
import getFirstMatchingOption from './getFirstMatchingOption';
|
|
9
|
-
import retrieveSchema, { resolveAllReferences } from './retrieveSchema';
|
|
10
|
-
import { ONE_OF_KEY, REF_KEY, JUNK_OPTION_ID, ANY_OF_KEY } from '../constants';
|
|
11
|
-
import guessType from '../guessType';
|
|
12
|
-
import getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema';
|
|
13
|
-
import getOptionMatchingSimpleDiscriminator from '../getOptionMatchingSimpleDiscriminator';
|
|
1
|
+
import get from 'lodash-es/get.js';
|
|
2
|
+
import has from 'lodash-es/has.js';
|
|
3
|
+
import isNumber from 'lodash-es/isNumber.js';
|
|
4
|
+
import isObject from 'lodash-es/isObject.js';
|
|
5
|
+
import isString from 'lodash-es/isString.js';
|
|
6
|
+
import reduce from 'lodash-es/reduce.js';
|
|
7
|
+
import times from 'lodash-es/times.js';
|
|
8
|
+
import getFirstMatchingOption from './getFirstMatchingOption.js';
|
|
9
|
+
import retrieveSchema, { resolveAllReferences } from './retrieveSchema.js';
|
|
10
|
+
import { ONE_OF_KEY, REF_KEY, JUNK_OPTION_ID, ANY_OF_KEY } from '../constants.js';
|
|
11
|
+
import guessType from '../guessType.js';
|
|
12
|
+
import getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema.js';
|
|
13
|
+
import getOptionMatchingSimpleDiscriminator from '../getOptionMatchingSimpleDiscriminator.js';
|
|
14
14
|
/** A junk option used to determine when the getFirstMatchingOption call really matches an option rather than returning
|
|
15
15
|
* the first item
|
|
16
16
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Experimental_CustomMergeAllOf, Experimental_DefaultFormStateBehavior, FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType } from '../types';
|
|
1
|
+
import { Experimental_CustomMergeAllOf, Experimental_DefaultFormStateBehavior, FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType } from '../types.js';
|
|
2
2
|
/** Enum that indicates how `schema.additionalItems` should be handled by the `getInnerSchemaForArrayItem()` function.
|
|
3
3
|
*/
|
|
4
4
|
export declare enum AdditionalItemsHandling {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import get from 'lodash/get';
|
|
2
|
-
import isEmpty from 'lodash/isEmpty';
|
|
3
|
-
import { ALL_OF_KEY, ANY_OF_KEY, CONST_KEY, DEFAULT_KEY, DEPENDENCIES_KEY, ONE_OF_KEY, PROPERTIES_KEY, REF_KEY, } from '../constants';
|
|
4
|
-
import findSchemaDefinition from '../findSchemaDefinition';
|
|
5
|
-
import getClosestMatchingOption from './getClosestMatchingOption';
|
|
6
|
-
import getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema';
|
|
7
|
-
import getSchemaType from '../getSchemaType';
|
|
8
|
-
import isObject from '../isObject';
|
|
9
|
-
import isFixedItems from '../isFixedItems';
|
|
10
|
-
import mergeDefaultsWithFormData from '../mergeDefaultsWithFormData';
|
|
11
|
-
import mergeObjects from '../mergeObjects';
|
|
12
|
-
import mergeSchemas from '../mergeSchemas';
|
|
13
|
-
import isMultiSelect from './isMultiSelect';
|
|
14
|
-
import isSelect from './isSelect';
|
|
15
|
-
import retrieveSchema, { resolveDependencies } from './retrieveSchema';
|
|
16
|
-
import isConstant from '../isConstant';
|
|
17
|
-
import constIsAjvDataReference from '../constIsAjvDataReference';
|
|
18
|
-
import optionsList from '../optionsList';
|
|
19
|
-
import deepEquals from '../deepEquals';
|
|
1
|
+
import get from 'lodash-es/get.js';
|
|
2
|
+
import isEmpty from 'lodash-es/isEmpty.js';
|
|
3
|
+
import { ALL_OF_KEY, ANY_OF_KEY, CONST_KEY, DEFAULT_KEY, DEPENDENCIES_KEY, ONE_OF_KEY, PROPERTIES_KEY, REF_KEY, } from '../constants.js';
|
|
4
|
+
import findSchemaDefinition from '../findSchemaDefinition.js';
|
|
5
|
+
import getClosestMatchingOption from './getClosestMatchingOption.js';
|
|
6
|
+
import getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema.js';
|
|
7
|
+
import getSchemaType from '../getSchemaType.js';
|
|
8
|
+
import isObject from '../isObject.js';
|
|
9
|
+
import isFixedItems from '../isFixedItems.js';
|
|
10
|
+
import mergeDefaultsWithFormData from '../mergeDefaultsWithFormData.js';
|
|
11
|
+
import mergeObjects from '../mergeObjects.js';
|
|
12
|
+
import mergeSchemas from '../mergeSchemas.js';
|
|
13
|
+
import isMultiSelect from './isMultiSelect.js';
|
|
14
|
+
import isSelect from './isSelect.js';
|
|
15
|
+
import retrieveSchema, { resolveDependencies } from './retrieveSchema.js';
|
|
16
|
+
import isConstant from '../isConstant.js';
|
|
17
|
+
import constIsAjvDataReference from '../constIsAjvDataReference.js';
|
|
18
|
+
import optionsList from '../optionsList.js';
|
|
19
|
+
import deepEquals from '../deepEquals.js';
|
|
20
20
|
const PRIMITIVE_TYPES = ['string', 'number', 'integer', 'boolean', 'null'];
|
|
21
21
|
/** Enum that indicates how `schema.additionalItems` should be handled by the `getInnerSchemaForArrayItem()` function.
|
|
22
22
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormContextType, GlobalUISchemaOptions, RJSFSchema, StrictRJSFSchema, UiSchema, ValidatorType, Experimental_CustomMergeAllOf } from '../types';
|
|
1
|
+
import { FormContextType, GlobalUISchemaOptions, RJSFSchema, StrictRJSFSchema, UiSchema, ValidatorType, Experimental_CustomMergeAllOf } from '../types.js';
|
|
2
2
|
/** Determines whether the combination of `schema` and `uiSchema` properties indicates that the label for the `schema`
|
|
3
3
|
* should be displayed in a UI.
|
|
4
4
|
*
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { UI_FIELD_KEY, UI_WIDGET_KEY } from '../constants';
|
|
2
|
-
import getSchemaType from '../getSchemaType';
|
|
3
|
-
import getUiOptions from '../getUiOptions';
|
|
4
|
-
import isCustomWidget from '../isCustomWidget';
|
|
5
|
-
import isFilesArray from './isFilesArray';
|
|
6
|
-
import isMultiSelect from './isMultiSelect';
|
|
1
|
+
import { UI_FIELD_KEY, UI_WIDGET_KEY } from '../constants.js';
|
|
2
|
+
import getSchemaType from '../getSchemaType.js';
|
|
3
|
+
import getUiOptions from '../getUiOptions.js';
|
|
4
|
+
import isCustomWidget from '../isCustomWidget.js';
|
|
5
|
+
import isFilesArray from './isFilesArray.js';
|
|
6
|
+
import isMultiSelect from './isMultiSelect.js';
|
|
7
7
|
/** Determines whether the combination of `schema` and `uiSchema` properties indicates that the label for the `schema`
|
|
8
8
|
* should be displayed in a UI.
|
|
9
9
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType } from '../types';
|
|
1
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType } from '../types.js';
|
|
2
2
|
/** Given the `formData` and list of `options`, attempts to find the index of the first option that matches the data.
|
|
3
3
|
* Always returns the first option if there is nothing that matches.
|
|
4
4
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import getMatchingOption from './getMatchingOption';
|
|
1
|
+
import getMatchingOption from './getMatchingOption.js';
|
|
2
2
|
/** Given the `formData` and list of `options`, attempts to find the index of the first option that matches the data.
|
|
3
3
|
* Always returns the first option if there is nothing that matches.
|
|
4
4
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType } from '../types';
|
|
1
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType } from '../types.js';
|
|
2
2
|
/** Given the `formData` and list of `options`, attempts to find the index of the option that best matches the data.
|
|
3
3
|
* Deprecated, use `getFirstMatchingOption()` instead.
|
|
4
4
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import get from 'lodash/get';
|
|
2
|
-
import has from 'lodash/has';
|
|
3
|
-
import isNumber from 'lodash/isNumber';
|
|
4
|
-
import { PROPERTIES_KEY } from '../constants';
|
|
5
|
-
import getOptionMatchingSimpleDiscriminator from '../getOptionMatchingSimpleDiscriminator';
|
|
1
|
+
import get from 'lodash-es/get.js';
|
|
2
|
+
import has from 'lodash-es/has.js';
|
|
3
|
+
import isNumber from 'lodash-es/isNumber.js';
|
|
4
|
+
import { PROPERTIES_KEY } from '../constants.js';
|
|
5
|
+
import getOptionMatchingSimpleDiscriminator from '../getOptionMatchingSimpleDiscriminator.js';
|
|
6
6
|
/** Given the `formData` and list of `options`, attempts to find the index of the option that best matches the data.
|
|
7
7
|
* Deprecated, use `getFirstMatchingOption()` instead.
|
|
8
8
|
*
|
package/lib/schema/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import getDefaultFormState from './getDefaultFormState';
|
|
2
|
-
import getDisplayLabel from './getDisplayLabel';
|
|
3
|
-
import getClosestMatchingOption from './getClosestMatchingOption';
|
|
4
|
-
import getFirstMatchingOption from './getFirstMatchingOption';
|
|
5
|
-
import getMatchingOption from './getMatchingOption';
|
|
6
|
-
import isFilesArray from './isFilesArray';
|
|
7
|
-
import isMultiSelect from './isMultiSelect';
|
|
8
|
-
import isSelect from './isSelect';
|
|
9
|
-
import mergeValidationData from './mergeValidationData';
|
|
10
|
-
import retrieveSchema from './retrieveSchema';
|
|
11
|
-
import sanitizeDataForNewSchema from './sanitizeDataForNewSchema';
|
|
12
|
-
import toIdSchema from './toIdSchema';
|
|
13
|
-
import toPathSchema from './toPathSchema';
|
|
1
|
+
import getDefaultFormState from './getDefaultFormState.js';
|
|
2
|
+
import getDisplayLabel from './getDisplayLabel.js';
|
|
3
|
+
import getClosestMatchingOption from './getClosestMatchingOption.js';
|
|
4
|
+
import getFirstMatchingOption from './getFirstMatchingOption.js';
|
|
5
|
+
import getMatchingOption from './getMatchingOption.js';
|
|
6
|
+
import isFilesArray from './isFilesArray.js';
|
|
7
|
+
import isMultiSelect from './isMultiSelect.js';
|
|
8
|
+
import isSelect from './isSelect.js';
|
|
9
|
+
import mergeValidationData from './mergeValidationData.js';
|
|
10
|
+
import retrieveSchema from './retrieveSchema.js';
|
|
11
|
+
import sanitizeDataForNewSchema from './sanitizeDataForNewSchema.js';
|
|
12
|
+
import toIdSchema from './toIdSchema.js';
|
|
13
|
+
import toPathSchema from './toPathSchema.js';
|
|
14
14
|
export { getDefaultFormState, getDisplayLabel, getClosestMatchingOption, getFirstMatchingOption, getMatchingOption, isFilesArray, isMultiSelect, isSelect, mergeValidationData, retrieveSchema, sanitizeDataForNewSchema, toIdSchema, toPathSchema, };
|
package/lib/schema/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import getDefaultFormState from './getDefaultFormState';
|
|
2
|
-
import getDisplayLabel from './getDisplayLabel';
|
|
3
|
-
import getClosestMatchingOption from './getClosestMatchingOption';
|
|
4
|
-
import getFirstMatchingOption from './getFirstMatchingOption';
|
|
5
|
-
import getMatchingOption from './getMatchingOption';
|
|
6
|
-
import isFilesArray from './isFilesArray';
|
|
7
|
-
import isMultiSelect from './isMultiSelect';
|
|
8
|
-
import isSelect from './isSelect';
|
|
9
|
-
import mergeValidationData from './mergeValidationData';
|
|
10
|
-
import retrieveSchema from './retrieveSchema';
|
|
11
|
-
import sanitizeDataForNewSchema from './sanitizeDataForNewSchema';
|
|
12
|
-
import toIdSchema from './toIdSchema';
|
|
13
|
-
import toPathSchema from './toPathSchema';
|
|
1
|
+
import getDefaultFormState from './getDefaultFormState.js';
|
|
2
|
+
import getDisplayLabel from './getDisplayLabel.js';
|
|
3
|
+
import getClosestMatchingOption from './getClosestMatchingOption.js';
|
|
4
|
+
import getFirstMatchingOption from './getFirstMatchingOption.js';
|
|
5
|
+
import getMatchingOption from './getMatchingOption.js';
|
|
6
|
+
import isFilesArray from './isFilesArray.js';
|
|
7
|
+
import isMultiSelect from './isMultiSelect.js';
|
|
8
|
+
import isSelect from './isSelect.js';
|
|
9
|
+
import mergeValidationData from './mergeValidationData.js';
|
|
10
|
+
import retrieveSchema from './retrieveSchema.js';
|
|
11
|
+
import sanitizeDataForNewSchema from './sanitizeDataForNewSchema.js';
|
|
12
|
+
import toIdSchema from './toIdSchema.js';
|
|
13
|
+
import toPathSchema from './toPathSchema.js';
|
|
14
14
|
export { getDefaultFormState, getDisplayLabel, getClosestMatchingOption, getFirstMatchingOption, getMatchingOption, isFilesArray, isMultiSelect, isSelect, mergeValidationData, retrieveSchema, sanitizeDataForNewSchema, toIdSchema, toPathSchema, };
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Experimental_CustomMergeAllOf, FormContextType, RJSFSchema, StrictRJSFSchema, UiSchema, ValidatorType } from '../types';
|
|
1
|
+
import { Experimental_CustomMergeAllOf, FormContextType, RJSFSchema, StrictRJSFSchema, UiSchema, ValidatorType } from '../types.js';
|
|
2
2
|
/** Checks to see if the `schema` and `uiSchema` combination represents an array of files
|
|
3
3
|
*
|
|
4
4
|
* @param validator - An implementation of the `ValidatorType` interface that will be used when necessary
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UI_WIDGET_KEY } from '../constants';
|
|
2
|
-
import retrieveSchema from './retrieveSchema';
|
|
1
|
+
import { UI_WIDGET_KEY } from '../constants.js';
|
|
2
|
+
import retrieveSchema from './retrieveSchema.js';
|
|
3
3
|
/** Checks to see if the `schema` and `uiSchema` combination represents an array of files
|
|
4
4
|
*
|
|
5
5
|
* @param validator - An implementation of the `ValidatorType` interface that will be used when necessary
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType, Experimental_CustomMergeAllOf } from '../types';
|
|
1
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType, Experimental_CustomMergeAllOf } from '../types.js';
|
|
2
2
|
/** Checks to see if the `schema` combination represents a multi-select
|
|
3
3
|
*
|
|
4
4
|
* @param validator - An implementation of the `ValidatorType` interface that will be used when necessary
|
package/lib/schema/isSelect.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType, Experimental_CustomMergeAllOf } from '../types';
|
|
1
|
+
import { FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType, Experimental_CustomMergeAllOf } from '../types.js';
|
|
2
2
|
/** Checks to see if the `schema` combination represents a select
|
|
3
3
|
*
|
|
4
4
|
* @param validator - An implementation of the `ValidatorType` interface that will be used when necessary
|
package/lib/schema/isSelect.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import isConstant from '../isConstant';
|
|
2
|
-
import retrieveSchema from './retrieveSchema';
|
|
1
|
+
import isConstant from '../isConstant.js';
|
|
2
|
+
import retrieveSchema from './retrieveSchema.js';
|
|
3
3
|
/** Checks to see if the `schema` combination represents a select
|
|
4
4
|
*
|
|
5
5
|
* @param validator - An implementation of the `ValidatorType` interface that will be used when necessary
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorSchema, FormContextType, RJSFSchema, StrictRJSFSchema, ValidationData, ValidatorType } from '../types';
|
|
1
|
+
import { ErrorSchema, FormContextType, RJSFSchema, StrictRJSFSchema, ValidationData, ValidatorType } from '../types.js';
|
|
2
2
|
/** Merges the errors in `additionalErrorSchema` into the existing `validationData` by combining the hierarchies in the
|
|
3
3
|
* two `ErrorSchema`s and then appending the error list from the `additionalErrorSchema` obtained by calling
|
|
4
4
|
* `validator.toErrorList()` onto the `errors` in the `validationData`. If no `additionalErrorSchema` is passed, then
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import isEmpty from 'lodash/isEmpty';
|
|
2
|
-
import mergeObjects from '../mergeObjects';
|
|
1
|
+
import isEmpty from 'lodash-es/isEmpty.js';
|
|
2
|
+
import mergeObjects from '../mergeObjects.js';
|
|
3
3
|
/** Merges the errors in `additionalErrorSchema` into the existing `validationData` by combining the hierarchies in the
|
|
4
4
|
* two `ErrorSchema`s and then appending the error list from the `additionalErrorSchema` obtained by calling
|
|
5
5
|
* `validator.toErrorList()` onto the `errors` in the `validationData`. If no `additionalErrorSchema` is passed, then
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Experimental_CustomMergeAllOf, FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType } from '../types';
|
|
1
|
+
import { Experimental_CustomMergeAllOf, FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType } from '../types.js';
|
|
2
2
|
/** Retrieves an expanded schema that has had all of its conditions, additional properties, references and dependencies
|
|
3
3
|
* resolved and merged into the `schema` given a `validator`, `rootSchema` and `rawFormData` that is used to do the
|
|
4
4
|
* potentially recursive resolution.
|