@rjsf/utils 6.7.1 → 6.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +521 -425
- package/dist/index.cjs.map +4 -4
- package/dist/utils.esm.js +520 -424
- package/dist/utils.esm.js.map +4 -4
- package/dist/utils.umd.js +579 -333
- package/lib/ErrorSchemaBuilder.d.ts +8 -7
- package/lib/ErrorSchemaBuilder.d.ts.map +1 -0
- package/lib/ErrorSchemaBuilder.js +29 -27
- package/lib/ErrorSchemaBuilder.js.map +1 -1
- package/lib/SelectedOptionDescription.d.ts +2 -1
- package/lib/SelectedOptionDescription.d.ts.map +1 -0
- package/lib/SelectedOptionDescription.js +6 -7
- package/lib/SelectedOptionDescription.js.map +1 -1
- package/lib/allowAdditionalItems.d.ts +2 -1
- package/lib/allowAdditionalItems.d.ts.map +1 -0
- package/lib/allowAdditionalItems.js +1 -1
- package/lib/allowAdditionalItems.js.map +1 -1
- package/lib/asNumber.d.ts +1 -0
- package/lib/asNumber.d.ts.map +1 -0
- package/lib/asNumber.js +1 -1
- package/lib/asNumber.js.map +1 -1
- package/lib/canExpand.d.ts +2 -1
- package/lib/canExpand.d.ts.map +1 -0
- package/lib/canExpand.js +1 -1
- package/lib/canExpand.js.map +1 -1
- package/lib/constIsAjvDataReference.d.ts +2 -1
- package/lib/constIsAjvDataReference.d.ts.map +1 -0
- package/lib/constIsAjvDataReference.js +2 -3
- package/lib/constIsAjvDataReference.js.map +1 -1
- package/lib/constants.d.ts +1 -0
- package/lib/constants.d.ts.map +1 -0
- package/lib/createErrorHandler.d.ts +2 -1
- package/lib/createErrorHandler.d.ts.map +1 -0
- package/lib/createErrorHandler.js +3 -4
- package/lib/createErrorHandler.js.map +1 -1
- package/lib/createSchemaUtils.d.ts +2 -1
- package/lib/createSchemaUtils.d.ts.map +1 -0
- package/lib/createSchemaUtils.js +10 -7
- package/lib/createSchemaUtils.js.map +1 -1
- package/lib/dataURItoBlob.d.ts +1 -0
- package/lib/dataURItoBlob.d.ts.map +1 -0
- package/lib/dataURItoBlob.js +1 -2
- package/lib/dataURItoBlob.js.map +1 -1
- package/lib/dateRangeOptions.d.ts +2 -1
- package/lib/dateRangeOptions.d.ts.map +1 -0
- package/lib/dateRangeOptions.js +1 -1
- package/lib/dateRangeOptions.js.map +1 -1
- package/lib/deepEquals.d.ts +1 -0
- package/lib/deepEquals.d.ts.map +1 -0
- package/lib/englishStringTranslator.d.ts +2 -1
- package/lib/englishStringTranslator.d.ts.map +1 -0
- package/lib/englishStringTranslator.js +1 -1
- package/lib/englishStringTranslator.js.map +1 -1
- package/lib/enumOptionSelectedValue.d.ts +2 -1
- package/lib/enumOptionSelectedValue.d.ts.map +1 -0
- package/lib/enumOptionSelectedValue.js +1 -1
- package/lib/enumOptionSelectedValue.js.map +1 -1
- package/lib/enumOptionValueDecoder.d.ts +2 -1
- package/lib/enumOptionValueDecoder.d.ts.map +1 -0
- package/lib/enumOptionValueDecoder.js +1 -1
- package/lib/enumOptionValueDecoder.js.map +1 -1
- package/lib/enumOptionValueEncoder.d.ts +2 -1
- package/lib/enumOptionValueEncoder.d.ts.map +1 -0
- package/lib/enumOptionValueEncoder.js +1 -2
- package/lib/enumOptionValueEncoder.js.map +1 -1
- package/lib/enumOptionsDeselectValue.d.ts +2 -1
- package/lib/enumOptionsDeselectValue.d.ts.map +1 -0
- package/lib/enumOptionsDeselectValue.js +2 -2
- package/lib/enumOptionsDeselectValue.js.map +1 -1
- package/lib/enumOptionsIndexForValue.d.ts +2 -1
- package/lib/enumOptionsIndexForValue.d.ts.map +1 -0
- package/lib/enumOptionsIndexForValue.js +1 -1
- package/lib/enumOptionsIndexForValue.js.map +1 -1
- package/lib/enumOptionsIsSelected.d.ts +2 -1
- package/lib/enumOptionsIsSelected.d.ts.map +1 -0
- package/lib/enumOptionsIsSelected.js +1 -1
- package/lib/enumOptionsIsSelected.js.map +1 -1
- package/lib/enumOptionsSelectValue.d.ts +2 -1
- package/lib/enumOptionsSelectValue.d.ts.map +1 -0
- package/lib/enumOptionsSelectValue.js +2 -3
- package/lib/enumOptionsSelectValue.js.map +1 -1
- package/lib/enumOptionsValueForIndex.d.ts +2 -1
- package/lib/enumOptionsValueForIndex.d.ts.map +1 -0
- package/lib/enums.d.ts +1 -0
- package/lib/enums.d.ts.map +1 -0
- package/lib/findSchemaDefinition.d.ts +2 -1
- package/lib/findSchemaDefinition.d.ts.map +1 -0
- package/lib/findSchemaDefinition.js +7 -11
- package/lib/findSchemaDefinition.js.map +1 -1
- package/lib/getChangedFields.d.ts +11 -2
- package/lib/getChangedFields.d.ts.map +1 -0
- package/lib/getChangedFields.js +57 -18
- package/lib/getChangedFields.js.map +1 -1
- package/lib/getDateElementProps.d.ts +2 -1
- package/lib/getDateElementProps.d.ts.map +1 -0
- package/lib/getDecimalSeparator.d.ts +1 -0
- package/lib/getDecimalSeparator.d.ts.map +1 -0
- package/lib/getDecimalSeparator.js +1 -2
- package/lib/getDecimalSeparator.js.map +1 -1
- package/lib/getDiscriminatorFieldFromSchema.d.ts +2 -1
- package/lib/getDiscriminatorFieldFromSchema.d.ts.map +1 -0
- package/lib/getDiscriminatorFieldFromSchema.js +4 -5
- package/lib/getDiscriminatorFieldFromSchema.js.map +1 -1
- package/lib/getInputProps.d.ts +2 -1
- package/lib/getInputProps.d.ts.map +1 -0
- package/lib/getInputProps.js +4 -1
- package/lib/getInputProps.js.map +1 -1
- package/lib/getOptionMatchingSimpleDiscriminator.d.ts +2 -1
- package/lib/getOptionMatchingSimpleDiscriminator.d.ts.map +1 -0
- package/lib/getOptionMatchingSimpleDiscriminator.js +6 -6
- package/lib/getOptionMatchingSimpleDiscriminator.js.map +1 -1
- package/lib/getOptionValueFormat.d.ts +2 -1
- package/lib/getOptionValueFormat.d.ts.map +1 -0
- package/lib/getOptionValueFormat.js +1 -2
- package/lib/getOptionValueFormat.js.map +1 -1
- package/lib/getPropertySchema.d.ts +12 -0
- package/lib/getPropertySchema.d.ts.map +1 -0
- package/lib/getPropertySchema.js +14 -0
- package/lib/getPropertySchema.js.map +1 -0
- package/lib/getSchemaType.d.ts +2 -1
- package/lib/getSchemaType.d.ts.map +1 -0
- package/lib/getSchemaType.js +1 -1
- package/lib/getSchemaType.js.map +1 -1
- package/lib/getSubmitButtonOptions.d.ts +2 -1
- package/lib/getSubmitButtonOptions.d.ts.map +1 -0
- package/lib/getSubmitButtonOptions.js +3 -3
- package/lib/getSubmitButtonOptions.js.map +1 -1
- package/lib/getTemplate.d.ts +2 -1
- package/lib/getTemplate.d.ts.map +1 -0
- package/lib/getTestIds.d.ts +2 -1
- package/lib/getTestIds.d.ts.map +1 -0
- package/lib/getTestIds.js +6 -5
- package/lib/getTestIds.js.map +1 -1
- package/lib/getUiOptions.d.ts +2 -1
- package/lib/getUiOptions.d.ts.map +1 -0
- package/lib/getUiOptions.js +2 -2
- package/lib/getUiOptions.js.map +1 -1
- package/lib/getWidget.d.ts +2 -1
- package/lib/getWidget.d.ts.map +1 -0
- package/lib/getWidget.js +6 -7
- package/lib/getWidget.js.map +1 -1
- package/lib/guessType.d.ts +2 -1
- package/lib/guessType.d.ts.map +1 -0
- package/lib/hasWidget.d.ts +2 -1
- package/lib/hasWidget.d.ts.map +1 -0
- package/lib/hasWidget.js +1 -1
- package/lib/hasWidget.js.map +1 -1
- package/lib/hashForSchema.d.ts +4 -2
- package/lib/hashForSchema.d.ts.map +1 -0
- package/lib/hashForSchema.js +17 -8
- package/lib/hashForSchema.js.map +1 -1
- package/lib/idGenerators.d.ts +2 -1
- package/lib/idGenerators.d.ts.map +1 -0
- package/lib/idGenerators.js +2 -3
- package/lib/idGenerators.js.map +1 -1
- package/lib/index.d.ts +93 -87
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +85 -81
- package/lib/index.js.map +1 -1
- package/lib/isConstant.d.ts +2 -1
- package/lib/isConstant.d.ts.map +1 -0
- package/lib/isConstant.js +1 -1
- package/lib/isConstant.js.map +1 -1
- package/lib/isCustomWidget.d.ts +2 -1
- package/lib/isCustomWidget.d.ts.map +1 -0
- package/lib/isCustomWidget.js +1 -1
- package/lib/isCustomWidget.js.map +1 -1
- package/lib/isFixedItems.d.ts +2 -1
- package/lib/isFixedItems.d.ts.map +1 -0
- package/lib/isFixedItems.js +1 -1
- package/lib/isFixedItems.js.map +1 -1
- package/lib/isFormDataAvailable.d.ts +1 -0
- package/lib/isFormDataAvailable.d.ts.map +1 -0
- package/lib/isFormDataAvailable.js +7 -4
- package/lib/isFormDataAvailable.js.map +1 -1
- package/lib/isObject.d.ts +3 -1
- package/lib/isObject.d.ts.map +1 -0
- package/lib/isObject.js +8 -2
- package/lib/isObject.js.map +1 -1
- package/lib/isPlainObject.d.ts +9 -0
- package/lib/isPlainObject.d.ts.map +1 -0
- package/lib/isPlainObject.js +15 -0
- package/lib/isPlainObject.js.map +1 -0
- package/lib/isRootSchema.d.ts +2 -1
- package/lib/isRootSchema.d.ts.map +1 -0
- package/lib/isRootSchema.js +2 -2
- package/lib/isRootSchema.js.map +1 -1
- package/lib/jsonSchemaAugmentation.d.ts +1 -0
- package/lib/jsonSchemaAugmentation.d.ts.map +1 -0
- package/lib/labelValue.d.ts +1 -0
- package/lib/labelValue.d.ts.map +1 -0
- package/lib/localToUTC.d.ts +1 -0
- package/lib/localToUTC.d.ts.map +1 -0
- package/lib/logUnsupportedDefaultForEnum.d.ts +2 -1
- package/lib/logUnsupportedDefaultForEnum.d.ts.map +1 -0
- package/lib/logUnsupportedDefaultForEnum.js +1 -1
- package/lib/logUnsupportedDefaultForEnum.js.map +1 -1
- package/lib/lookupFromFormContext.d.ts +3 -2
- package/lib/lookupFromFormContext.d.ts.map +1 -0
- package/lib/lookupFromFormContext.js +4 -5
- package/lib/lookupFromFormContext.js.map +1 -1
- package/lib/mergeDefaultsWithFormData.d.ts +1 -0
- package/lib/mergeDefaultsWithFormData.d.ts.map +1 -0
- package/lib/mergeDefaultsWithFormData.js +20 -16
- package/lib/mergeDefaultsWithFormData.js.map +1 -1
- package/lib/mergeObjects.d.ts +2 -1
- package/lib/mergeObjects.d.ts.map +1 -0
- package/lib/mergeObjects.js +1 -1
- package/lib/mergeObjects.js.map +1 -1
- package/lib/mergeSchemas.d.ts +2 -1
- package/lib/mergeSchemas.d.ts.map +1 -0
- package/lib/mergeSchemas.js +4 -5
- package/lib/mergeSchemas.js.map +1 -1
- package/lib/nameGenerators.d.ts +2 -1
- package/lib/nameGenerators.d.ts.map +1 -0
- package/lib/noop.d.ts +5 -0
- package/lib/noop.d.ts.map +1 -0
- package/lib/noop.js +5 -0
- package/lib/noop.js.map +1 -0
- package/lib/optionsList.d.ts +2 -1
- package/lib/optionsList.d.ts.map +1 -0
- package/lib/optionsList.js +15 -15
- package/lib/optionsList.js.map +1 -1
- package/lib/orderProperties.d.ts +1 -0
- package/lib/orderProperties.d.ts.map +1 -0
- package/lib/pad.d.ts +1 -0
- package/lib/pad.d.ts.map +1 -0
- package/lib/parseDateString.d.ts +2 -1
- package/lib/parseDateString.d.ts.map +1 -0
- package/lib/parser/ParserValidator.d.ts +2 -1
- package/lib/parser/ParserValidator.d.ts.map +1 -0
- package/lib/parser/ParserValidator.js +8 -7
- package/lib/parser/ParserValidator.js.map +1 -1
- package/lib/parser/index.d.ts +3 -2
- package/lib/parser/index.d.ts.map +1 -0
- package/lib/parser/index.js +1 -1
- package/lib/parser/index.js.map +1 -1
- package/lib/parser/schemaParser.d.ts +3 -2
- package/lib/parser/schemaParser.d.ts.map +1 -0
- package/lib/parser/schemaParser.js +6 -7
- package/lib/parser/schemaParser.js.map +1 -1
- package/lib/pathUtils.d.ts +77 -0
- package/lib/pathUtils.d.ts.map +1 -0
- package/lib/pathUtils.js +192 -0
- package/lib/pathUtils.js.map +1 -0
- package/lib/rangeSpec.d.ts +2 -1
- package/lib/rangeSpec.d.ts.map +1 -0
- package/lib/removeOptionalEmptyObjects.d.ts +2 -1
- package/lib/removeOptionalEmptyObjects.d.ts.map +1 -0
- package/lib/removeOptionalEmptyObjects.js +2 -2
- package/lib/removeOptionalEmptyObjects.js.map +1 -1
- package/lib/replaceStringParameters.d.ts +1 -0
- package/lib/replaceStringParameters.d.ts.map +1 -0
- package/lib/resolveUiSchema.d.ts +2 -1
- package/lib/resolveUiSchema.d.ts.map +1 -0
- package/lib/resolveUiSchema.js +6 -8
- package/lib/resolveUiSchema.js.map +1 -1
- package/lib/schema/findFieldInSchema.d.ts +2 -1
- package/lib/schema/findFieldInSchema.d.ts.map +1 -0
- package/lib/schema/findFieldInSchema.js +10 -11
- package/lib/schema/findFieldInSchema.js.map +1 -1
- package/lib/schema/findSelectedOptionInXxxOf.d.ts +2 -1
- package/lib/schema/findSelectedOptionInXxxOf.d.ts.map +1 -0
- package/lib/schema/findSelectedOptionInXxxOf.js +7 -7
- package/lib/schema/findSelectedOptionInXxxOf.js.map +1 -1
- package/lib/schema/getClosestMatchingOption.d.ts +2 -1
- package/lib/schema/getClosestMatchingOption.d.ts.map +1 -0
- package/lib/schema/getClosestMatchingOption.js +18 -23
- package/lib/schema/getClosestMatchingOption.js.map +1 -1
- package/lib/schema/getDefaultFormState.d.ts +2 -1
- package/lib/schema/getDefaultFormState.d.ts.map +1 -0
- package/lib/schema/getDefaultFormState.js +78 -56
- package/lib/schema/getDefaultFormState.js.map +1 -1
- package/lib/schema/getDisplayLabel.d.ts +2 -1
- package/lib/schema/getDisplayLabel.d.ts.map +1 -0
- package/lib/schema/getDisplayLabel.js +7 -7
- package/lib/schema/getDisplayLabel.js.map +1 -1
- package/lib/schema/getFirstMatchingOption.d.ts +2 -1
- package/lib/schema/getFirstMatchingOption.d.ts.map +1 -0
- package/lib/schema/getFirstMatchingOption.js +9 -9
- package/lib/schema/getFirstMatchingOption.js.map +1 -1
- package/lib/schema/getFromSchema.d.ts +3 -2
- package/lib/schema/getFromSchema.d.ts.map +1 -0
- package/lib/schema/getFromSchema.js +10 -11
- package/lib/schema/getFromSchema.js.map +1 -1
- package/lib/schema/index.d.ts +15 -14
- package/lib/schema/index.d.ts.map +1 -0
- package/lib/schema/index.js +14 -14
- package/lib/schema/index.js.map +1 -1
- package/lib/schema/isFilesArray.d.ts +2 -1
- package/lib/schema/isFilesArray.d.ts.map +1 -0
- package/lib/schema/isFilesArray.js +2 -2
- package/lib/schema/isFilesArray.js.map +1 -1
- package/lib/schema/isMultiSelect.d.ts +2 -1
- package/lib/schema/isMultiSelect.d.ts.map +1 -0
- package/lib/schema/isMultiSelect.js +1 -1
- package/lib/schema/isMultiSelect.js.map +1 -1
- package/lib/schema/isSelect.d.ts +2 -1
- package/lib/schema/isSelect.d.ts.map +1 -0
- package/lib/schema/isSelect.js +2 -2
- package/lib/schema/isSelect.js.map +1 -1
- package/lib/schema/omitExtraData.d.ts +2 -1
- package/lib/schema/omitExtraData.d.ts.map +1 -0
- package/lib/schema/omitExtraData.js +100 -64
- package/lib/schema/omitExtraData.js.map +1 -1
- package/lib/schema/retrieveSchema.d.ts +2 -1
- package/lib/schema/retrieveSchema.d.ts.map +1 -0
- package/lib/schema/retrieveSchema.js +32 -40
- package/lib/schema/retrieveSchema.js.map +1 -1
- package/lib/schema/sanitizeDataForNewSchema.d.ts +4 -3
- package/lib/schema/sanitizeDataForNewSchema.d.ts.map +1 -0
- package/lib/schema/sanitizeDataForNewSchema.js +41 -39
- package/lib/schema/sanitizeDataForNewSchema.js.map +1 -1
- package/lib/schema/shallowAllOfMerge.d.ts +1 -0
- package/lib/schema/shallowAllOfMerge.d.ts.map +1 -0
- package/lib/schema/toPathSchema.d.ts +2 -1
- package/lib/schema/toPathSchema.d.ts.map +1 -0
- package/lib/schema/toPathSchema.js +14 -14
- package/lib/schema/toPathSchema.js.map +1 -1
- package/lib/schemaRequiresTrueValue.d.ts +2 -1
- package/lib/schemaRequiresTrueValue.d.ts.map +1 -0
- package/lib/schemaRequiresTrueValue.js +3 -4
- package/lib/schemaRequiresTrueValue.js.map +1 -1
- package/lib/shallowEquals.d.ts +1 -0
- package/lib/shallowEquals.d.ts.map +1 -0
- package/lib/shouldRender.d.ts +2 -1
- package/lib/shouldRender.d.ts.map +1 -0
- package/lib/shouldRender.js +2 -2
- package/lib/shouldRender.js.map +1 -1
- package/lib/shouldRenderOptionalField.d.ts +2 -1
- package/lib/shouldRenderOptionalField.d.ts.map +1 -0
- package/lib/shouldRenderOptionalField.js +11 -10
- package/lib/shouldRenderOptionalField.js.map +1 -1
- package/lib/toConstant.d.ts +2 -1
- package/lib/toConstant.d.ts.map +1 -0
- package/lib/toConstant.js +1 -1
- package/lib/toConstant.js.map +1 -1
- package/lib/toDateString.d.ts +2 -1
- package/lib/toDateString.d.ts.map +1 -0
- package/lib/toErrorList.d.ts +2 -1
- package/lib/toErrorList.d.ts.map +1 -0
- package/lib/toErrorList.js +20 -21
- package/lib/toErrorList.js.map +1 -1
- package/lib/toErrorSchema.d.ts +2 -1
- package/lib/toErrorSchema.d.ts.map +1 -0
- package/lib/toErrorSchema.js +4 -9
- package/lib/toErrorSchema.js.map +1 -1
- package/lib/toFieldPathId.d.ts +2 -1
- package/lib/toFieldPathId.d.ts.map +1 -0
- package/lib/toFieldPathId.js +2 -2
- package/lib/toFieldPathId.js.map +1 -1
- package/lib/types.d.ts +15 -5
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +1 -1
- package/lib/types.js.map +1 -1
- package/lib/unwrapErrorHandler.d.ts +2 -1
- package/lib/unwrapErrorHandler.d.ts.map +1 -0
- package/lib/unwrapErrorHandler.js +13 -4
- package/lib/unwrapErrorHandler.js.map +1 -1
- package/lib/useAltDateWidgetProps.d.ts +3 -2
- package/lib/useAltDateWidgetProps.d.ts.map +1 -0
- package/lib/useAltDateWidgetProps.js +5 -5
- package/lib/useAltDateWidgetProps.js.map +1 -1
- package/lib/useDeepCompareMemo.d.ts +1 -0
- package/lib/useDeepCompareMemo.d.ts.map +1 -0
- package/lib/useDeepCompareMemo.js +1 -1
- package/lib/useDeepCompareMemo.js.map +1 -1
- package/lib/useFileWidgetProps.d.ts +1 -0
- package/lib/useFileWidgetProps.d.ts.map +1 -0
- package/lib/useFileWidgetProps.js +3 -4
- package/lib/useFileWidgetProps.js.map +1 -1
- package/lib/utcToLocal.d.ts +1 -0
- package/lib/utcToLocal.d.ts.map +1 -0
- package/lib/utcToLocal.js +1 -1
- package/lib/utcToLocal.js.map +1 -1
- package/lib/validationDataMerge.d.ts +2 -1
- package/lib/validationDataMerge.d.ts.map +1 -0
- package/lib/validationDataMerge.js +3 -4
- package/lib/validationDataMerge.js.map +1 -1
- package/lib/withIdRefPrefix.d.ts +2 -1
- package/lib/withIdRefPrefix.d.ts.map +1 -0
- package/lib/withIdRefPrefix.js +2 -2
- package/lib/withIdRefPrefix.js.map +1 -1
- package/package.json +5 -6
- package/src/ErrorSchemaBuilder.ts +25 -24
- package/src/SelectedOptionDescription.tsx +5 -5
- package/src/allowAdditionalItems.ts +2 -2
- package/src/asNumber.ts +1 -1
- package/src/canExpand.ts +2 -2
- package/src/constIsAjvDataReference.ts +5 -4
- package/src/createErrorHandler.ts +5 -7
- package/src/createSchemaUtils.ts +8 -10
- package/src/dateRangeOptions.ts +2 -2
- package/src/englishStringTranslator.ts +2 -2
- package/src/enumOptionSelectedValue.ts +2 -2
- package/src/enumOptionValueDecoder.ts +2 -2
- package/src/enumOptionValueEncoder.ts +2 -4
- package/src/enumOptionsDeselectValue.ts +3 -3
- package/src/enumOptionsIndexForValue.ts +2 -2
- package/src/enumOptionsIsSelected.ts +2 -2
- package/src/enumOptionsSelectValue.ts +3 -5
- package/src/enumOptionsValueForIndex.ts +1 -1
- package/src/findSchemaDefinition.ts +8 -12
- package/src/getChangedFields.ts +57 -18
- package/src/getDateElementProps.ts +1 -1
- package/src/getDiscriminatorFieldFromSchema.ts +5 -7
- package/src/getInputProps.ts +6 -2
- package/src/getOptionMatchingSimpleDiscriminator.ts +7 -7
- package/src/getOptionValueFormat.ts +1 -1
- package/src/getPropertySchema.ts +18 -0
- package/src/getSchemaType.ts +2 -2
- package/src/getSubmitButtonOptions.ts +3 -3
- package/src/getTemplate.ts +1 -1
- package/src/getTestIds.ts +7 -6
- package/src/getUiOptions.ts +3 -3
- package/src/getWidget.tsx +6 -6
- package/src/hasWidget.ts +2 -2
- package/src/hashForSchema.ts +20 -9
- package/src/idGenerators.ts +3 -5
- package/src/index.ts +99 -85
- package/src/isConstant.ts +2 -2
- package/src/isCustomWidget.ts +2 -2
- package/src/isFixedItems.ts +2 -2
- package/src/isFormDataAvailable.ts +7 -5
- package/src/isObject.ts +15 -3
- package/src/isPlainObject.ts +14 -0
- package/src/isRootSchema.ts +3 -3
- package/src/logUnsupportedDefaultForEnum.ts +2 -2
- package/src/lookupFromFormContext.ts +7 -8
- package/src/mergeDefaultsWithFormData.ts +22 -18
- package/src/mergeObjects.ts +2 -2
- package/src/mergeSchemas.ts +5 -7
- package/src/nameGenerators.ts +1 -1
- package/src/noop.ts +4 -0
- package/src/optionsList.ts +9 -9
- package/src/orderProperties.ts +1 -1
- package/src/parseDateString.ts +1 -1
- package/src/parser/ParserValidator.ts +5 -7
- package/src/parser/index.ts +2 -2
- package/src/parser/schemaParser.ts +8 -10
- package/src/pathUtils.ts +203 -0
- package/src/rangeSpec.ts +1 -1
- package/src/removeOptionalEmptyObjects.ts +3 -3
- package/src/resolveUiSchema.ts +5 -7
- package/src/schema/findFieldInSchema.ts +11 -13
- package/src/schema/findSelectedOptionInXxxOf.ts +9 -10
- package/src/schema/getClosestMatchingOption.ts +73 -83
- package/src/schema/getDefaultFormState.ts +62 -34
- package/src/schema/getDisplayLabel.ts +7 -7
- package/src/schema/getFirstMatchingOption.ts +10 -11
- package/src/schema/getFromSchema.ts +12 -14
- package/src/schema/index.ts +14 -14
- package/src/schema/isFilesArray.ts +3 -3
- package/src/schema/isMultiSelect.ts +2 -2
- package/src/schema/isSelect.ts +3 -3
- package/src/schema/omitExtraData.ts +104 -68
- package/src/schema/retrieveSchema.ts +47 -60
- package/src/schema/sanitizeDataForNewSchema.ts +42 -41
- package/src/schema/toPathSchema.ts +14 -14
- package/src/schemaRequiresTrueValue.ts +1 -1
- package/src/shouldRender.ts +3 -3
- package/src/shouldRenderOptionalField.ts +14 -14
- package/src/toConstant.ts +2 -2
- package/src/toDateString.ts +1 -1
- package/src/toErrorList.ts +22 -25
- package/src/toErrorSchema.ts +5 -11
- package/src/toFieldPathId.ts +2 -2
- package/src/types.ts +14 -5
- package/src/unwrapErrorHandler.ts +15 -6
- package/src/useAltDateWidgetProps.tsx +7 -7
- package/src/useDeepCompareMemo.ts +1 -1
- package/src/useFileWidgetProps.ts +1 -1
- package/src/utcToLocal.ts +1 -1
- package/src/validationDataMerge.ts +4 -6
- package/src/withIdRefPrefix.ts +3 -4
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/src/tsconfig.json +0 -9
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import type { JSONSchema7Object } from 'json-schema';
|
|
2
|
-
import get from 'lodash/get';
|
|
3
|
-
import isEmpty from 'lodash/isEmpty';
|
|
4
2
|
|
|
5
3
|
import {
|
|
6
4
|
ALL_OF_KEY,
|
|
@@ -10,21 +8,22 @@ import {
|
|
|
10
8
|
DEPENDENCIES_KEY,
|
|
11
9
|
IF_KEY,
|
|
12
10
|
ONE_OF_KEY,
|
|
13
|
-
PROPERTIES_KEY,
|
|
14
11
|
REF_KEY,
|
|
15
|
-
} from '../constants';
|
|
16
|
-
import constIsAjvDataReference from '../constIsAjvDataReference';
|
|
17
|
-
import deepEquals from '../deepEquals';
|
|
18
|
-
import findSchemaDefinition from '../findSchemaDefinition';
|
|
19
|
-
import getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema';
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
12
|
+
} from '../constants.ts';
|
|
13
|
+
import constIsAjvDataReference from '../constIsAjvDataReference.ts';
|
|
14
|
+
import deepEquals from '../deepEquals.ts';
|
|
15
|
+
import findSchemaDefinition from '../findSchemaDefinition.ts';
|
|
16
|
+
import getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema.ts';
|
|
17
|
+
import getPropertySchema from '../getPropertySchema.ts';
|
|
18
|
+
import getSchemaType from '../getSchemaType.ts';
|
|
19
|
+
import isConstant from '../isConstant.ts';
|
|
20
|
+
import isFixedItems from '../isFixedItems.ts';
|
|
21
|
+
import isObject from '../isObject.ts';
|
|
22
|
+
import mergeDefaultsWithFormData from '../mergeDefaultsWithFormData.ts';
|
|
23
|
+
import mergeObjects from '../mergeObjects.ts';
|
|
24
|
+
import mergeSchemas from '../mergeSchemas.ts';
|
|
25
|
+
import optionsList from '../optionsList.ts';
|
|
26
|
+
import { getByPath } from '../pathUtils.ts';
|
|
28
27
|
import type {
|
|
29
28
|
Experimental_CustomMergeAllOf,
|
|
30
29
|
Experimental_DefaultFormStateBehavior,
|
|
@@ -33,11 +32,11 @@ import type {
|
|
|
33
32
|
RJSFSchema,
|
|
34
33
|
StrictRJSFSchema,
|
|
35
34
|
ValidatorType,
|
|
36
|
-
} from '../types';
|
|
37
|
-
import getClosestMatchingOption from './getClosestMatchingOption';
|
|
38
|
-
import isMultiSelect from './isMultiSelect';
|
|
39
|
-
import isSelect from './isSelect';
|
|
40
|
-
import retrieveSchema, { resolveDependencies } from './retrieveSchema';
|
|
35
|
+
} from '../types.ts';
|
|
36
|
+
import getClosestMatchingOption from './getClosestMatchingOption.ts';
|
|
37
|
+
import isMultiSelect from './isMultiSelect.ts';
|
|
38
|
+
import isSelect from './isSelect.ts';
|
|
39
|
+
import retrieveSchema, { resolveDependencies } from './retrieveSchema.ts';
|
|
41
40
|
|
|
42
41
|
const PRIMITIVE_TYPES = ['string', 'number', 'integer', 'boolean', 'null'];
|
|
43
42
|
|
|
@@ -85,6 +84,22 @@ export function getInnerSchemaForArrayItem<S extends StrictRJSFSchema = RJSFSche
|
|
|
85
84
|
return {} as S;
|
|
86
85
|
}
|
|
87
86
|
|
|
87
|
+
/** Determines whether `value` holds anything: a non-empty string or array, or an object with at least one own key.
|
|
88
|
+
* Everything else — including numbers, booleans, `null` and `undefined` — has no content.
|
|
89
|
+
*
|
|
90
|
+
* @param value - The value to inspect
|
|
91
|
+
* @returns - True if the value holds content, otherwise false
|
|
92
|
+
*/
|
|
93
|
+
function hasContent(value: unknown): boolean {
|
|
94
|
+
if (typeof value === 'string' || Array.isArray(value)) {
|
|
95
|
+
return value.length > 0;
|
|
96
|
+
}
|
|
97
|
+
if (typeof value === 'object' && value !== null) {
|
|
98
|
+
return Object.keys(value).length > 0;
|
|
99
|
+
}
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
|
|
88
103
|
/** Checks if the given `schema` contains the `null` type along with another type AND if the `default` contained within
|
|
89
104
|
* the schema is `null` AND the `computedDefault` is empty. If all of those conditions are true, then the `schema`'s
|
|
90
105
|
* default should be `null` rather than `computedDefault`.
|
|
@@ -99,7 +114,7 @@ export function computeDefaultBasedOnSchemaTypeAndDefaults<T = any, S extends St
|
|
|
99
114
|
) {
|
|
100
115
|
const { default: schemaDefault, type } = schema;
|
|
101
116
|
const shouldReturnNullAsDefault =
|
|
102
|
-
Array.isArray(type) && type.includes('null') &&
|
|
117
|
+
Array.isArray(type) && type.includes('null') && !hasContent(computedDefault) && schemaDefault === null;
|
|
103
118
|
return shouldReturnNullAsDefault ? (null as T) : computedDefault;
|
|
104
119
|
}
|
|
105
120
|
|
|
@@ -144,7 +159,11 @@ function maybeAddDefaultToObject<T = any>(
|
|
|
144
159
|
} else if (includeUndefinedValues === 'excludeObjectChildren') {
|
|
145
160
|
// Fix for Issue #4709: When in 'excludeObjectChildren' mode, don't set primitive fields to empty objects
|
|
146
161
|
// Only add the computed default if it's not an empty object placeholder for a primitive field
|
|
147
|
-
if (
|
|
162
|
+
if (
|
|
163
|
+
(isNullType && computedDefault !== undefined) ||
|
|
164
|
+
!isObject(computedDefault) ||
|
|
165
|
+
Object.keys(computedDefault).length > 0
|
|
166
|
+
) {
|
|
148
167
|
acc[key] = computedDefault;
|
|
149
168
|
}
|
|
150
169
|
// If computedDefault is an empty object {}, don't add it - let the field stay undefined
|
|
@@ -156,14 +175,14 @@ function maybeAddDefaultToObject<T = any>(
|
|
|
156
175
|
if (isObject(computedDefault)) {
|
|
157
176
|
// If emptyObjectFields 'skipEmptyDefaults' store computedDefault if it's a non-empty object(e.g. not {})
|
|
158
177
|
if (emptyObjectFields === 'skipEmptyDefaults') {
|
|
159
|
-
if (
|
|
178
|
+
if (Object.keys(computedDefault).length > 0) {
|
|
160
179
|
acc[key] = computedDefault;
|
|
161
180
|
}
|
|
162
181
|
} // Else store computedDefault if it's a non-empty object(e.g. not {}) and satisfies certain conditions
|
|
163
182
|
// Condition 1: If computedDefault is not empty or if the key is a required field
|
|
164
183
|
// Condition 2: If the parent object is required or emptyObjectFields is not 'populateRequiredDefaults'
|
|
165
184
|
else if (
|
|
166
|
-
(
|
|
185
|
+
(Object.keys(computedDefault).length > 0 || requiredFields.includes(key)) &&
|
|
167
186
|
(isSelfOrParentRequired || emptyObjectFields !== 'populateRequiredDefaults')
|
|
168
187
|
) {
|
|
169
188
|
acc[key] = computedDefault;
|
|
@@ -293,7 +312,8 @@ export function computeDefaults<T = any, S extends StrictRJSFSchema = RJSFSchema
|
|
|
293
312
|
// Then set the defaults from the current schema for the referenced schema.
|
|
294
313
|
// Only do this if rawFormData has no meaningful data - we don't want to override user's existing values.
|
|
295
314
|
// Check for undefined OR empty object - rawFormData may be coerced to {} when not an object.
|
|
296
|
-
const hasNoExistingData =
|
|
315
|
+
const hasNoExistingData =
|
|
316
|
+
rawFormData === undefined || (isObject(rawFormData) && Object.keys(rawFormData).length === 0);
|
|
297
317
|
if (schemaToCompute && !defaults && hasNoExistingData) {
|
|
298
318
|
defaults = schema.default as T | undefined;
|
|
299
319
|
}
|
|
@@ -483,13 +503,13 @@ export function ensureFormDataMatchingSchema<
|
|
|
483
503
|
} else if (isObject(validFormData) && isObject(schemaToMatch.properties)) {
|
|
484
504
|
validFormData = Object.keys(schemaToMatch.properties).reduce(
|
|
485
505
|
(acc: GenericObjectType, key: string) => {
|
|
486
|
-
const propertySchema
|
|
506
|
+
const propertySchema = getPropertySchema<S>(schemaToMatch, key);
|
|
487
507
|
if (key in acc && (shouldRetrieveAllOf || (isObject(propertySchema) && ALL_OF_KEY in propertySchema))) {
|
|
488
508
|
acc[key] = ensureFormDataMatchingSchema<T, S, F>(
|
|
489
509
|
validator,
|
|
490
510
|
propertySchema,
|
|
491
511
|
rootSchema,
|
|
492
|
-
|
|
512
|
+
acc[key],
|
|
493
513
|
experimental_defaultFormStateBehavior,
|
|
494
514
|
experimental_customMergeAllOf,
|
|
495
515
|
);
|
|
@@ -543,7 +563,7 @@ export function getObjectDefaults<T = any, S extends StrictRJSFSchema = RJSFSche
|
|
|
543
563
|
const parentConst = retrievedSchema[CONST_KEY];
|
|
544
564
|
const objectDefaults = Object.keys(retrievedSchema.properties || {}).reduce(
|
|
545
565
|
(acc: GenericObjectType, key: string) => {
|
|
546
|
-
const propertySchema
|
|
566
|
+
const propertySchema = getPropertySchema<S>(retrievedSchema, key);
|
|
547
567
|
// Check if the parent schema has a const property defined AND we are supporting const as defaults, then we
|
|
548
568
|
// should always return the computedDefault since it's coming from the const.
|
|
549
569
|
const hasParentConst = isObject(parentConst) && (parentConst as JSONSchema7Object)[key] !== undefined;
|
|
@@ -559,8 +579,8 @@ export function getObjectDefaults<T = any, S extends StrictRJSFSchema = RJSFSche
|
|
|
559
579
|
experimental_defaultFormStateBehavior,
|
|
560
580
|
experimental_customMergeAllOf,
|
|
561
581
|
includeUndefinedValues: includeUndefinedValues === true,
|
|
562
|
-
parentDefaults:
|
|
563
|
-
rawFormData:
|
|
582
|
+
parentDefaults: getByPath<T>(defaults, key),
|
|
583
|
+
rawFormData: getByPath<T>(formData, key),
|
|
564
584
|
required: retrievedSchema.required?.includes(key),
|
|
565
585
|
shouldMergeDefaultsIntoFormData,
|
|
566
586
|
initialDefaultsGenerated,
|
|
@@ -611,8 +631,8 @@ export function getObjectDefaults<T = any, S extends StrictRJSFSchema = RJSFSche
|
|
|
611
631
|
experimental_defaultFormStateBehavior,
|
|
612
632
|
experimental_customMergeAllOf,
|
|
613
633
|
includeUndefinedValues: includeUndefinedValues === true,
|
|
614
|
-
parentDefaults:
|
|
615
|
-
rawFormData:
|
|
634
|
+
parentDefaults: getByPath<T>(defaults, key),
|
|
635
|
+
rawFormData: getByPath<T>(formData, key),
|
|
616
636
|
required: retrievedSchema.required?.includes(key),
|
|
617
637
|
shouldMergeDefaultsIntoFormData,
|
|
618
638
|
initialDefaultsGenerated,
|
|
@@ -702,7 +722,7 @@ export function getArrayDefaults<T = any, S extends StrictRJSFSchema = RJSFSchem
|
|
|
702
722
|
experimental_defaultFormStateBehavior,
|
|
703
723
|
experimental_customMergeAllOf,
|
|
704
724
|
rawFormData: item,
|
|
705
|
-
parentDefaults:
|
|
725
|
+
parentDefaults: getByPath<T>(defaults, idx),
|
|
706
726
|
required,
|
|
707
727
|
shouldMergeDefaultsIntoFormData,
|
|
708
728
|
initialDefaultsGenerated,
|
|
@@ -792,6 +812,14 @@ export function getDefaultBasedOnSchemaType<
|
|
|
792
812
|
case 'array': {
|
|
793
813
|
return getArrayDefaults(validator, rawSchema, computeDefaultsProps, defaults as T[]);
|
|
794
814
|
}
|
|
815
|
+
case 'boolean': {
|
|
816
|
+
// A required boolean with no explicit default gets false — it must be
|
|
817
|
+
// present in the submitted data, and false is the natural zero-value.
|
|
818
|
+
if (computeDefaultsProps.required && defaults === undefined) {
|
|
819
|
+
return false as unknown as T;
|
|
820
|
+
}
|
|
821
|
+
return undefined;
|
|
822
|
+
}
|
|
795
823
|
default:
|
|
796
824
|
return undefined;
|
|
797
825
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ADDITIONAL_PROPERTY_FLAG, UI_FIELD_KEY, UI_WIDGET_KEY } from '../constants';
|
|
2
|
-
import getSchemaType from '../getSchemaType';
|
|
3
|
-
import getUiOptions from '../getUiOptions';
|
|
4
|
-
import isCustomWidget from '../isCustomWidget';
|
|
1
|
+
import { ADDITIONAL_PROPERTY_FLAG, UI_FIELD_KEY, UI_WIDGET_KEY } from '../constants.ts';
|
|
2
|
+
import getSchemaType from '../getSchemaType.ts';
|
|
3
|
+
import getUiOptions from '../getUiOptions.ts';
|
|
4
|
+
import isCustomWidget from '../isCustomWidget.ts';
|
|
5
5
|
import type {
|
|
6
6
|
FormContextType,
|
|
7
7
|
GlobalUISchemaOptions,
|
|
@@ -11,9 +11,9 @@ import type {
|
|
|
11
11
|
UiSchema,
|
|
12
12
|
ValidatorType,
|
|
13
13
|
Experimental_CustomMergeAllOf,
|
|
14
|
-
} from '../types';
|
|
15
|
-
import isFilesArray from './isFilesArray';
|
|
16
|
-
import isMultiSelect from './isMultiSelect';
|
|
14
|
+
} from '../types.ts';
|
|
15
|
+
import isFilesArray from './isFilesArray.ts';
|
|
16
|
+
import isMultiSelect from './isMultiSelect.ts';
|
|
17
17
|
|
|
18
18
|
/** Determines whether the combination of `schema` and `uiSchema` properties indicates that the label for the `schema`
|
|
19
19
|
* should be displayed in a UI.
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import { PROPERTIES_KEY } from '../constants';
|
|
6
|
-
import getOptionMatchingSimpleDiscriminator from '../getOptionMatchingSimpleDiscriminator';
|
|
7
|
-
import type { FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType } from '../types';
|
|
1
|
+
import { PROPERTIES_KEY } from '../constants.ts';
|
|
2
|
+
import getOptionMatchingSimpleDiscriminator from '../getOptionMatchingSimpleDiscriminator.ts';
|
|
3
|
+
import { getByPath } from '../pathUtils.ts';
|
|
4
|
+
import type { FormContextType, RJSFSchema, StrictRJSFSchema, ValidatorType } from '../types.ts';
|
|
8
5
|
|
|
9
6
|
/** Given the `formData` and list of `options`, attempts to find the index of the first option that matches the data.
|
|
10
7
|
* Always returns the first option if there is nothing that matches.
|
|
@@ -35,7 +32,7 @@ export default function getFirstMatchingOption<
|
|
|
35
32
|
}
|
|
36
33
|
|
|
37
34
|
const simpleDiscriminatorMatch = getOptionMatchingSimpleDiscriminator(formData, options, discriminatorField);
|
|
38
|
-
if (
|
|
35
|
+
if (typeof simpleDiscriminatorMatch === 'number') {
|
|
39
36
|
return simpleDiscriminatorMatch;
|
|
40
37
|
}
|
|
41
38
|
|
|
@@ -43,9 +40,11 @@ export default function getFirstMatchingOption<
|
|
|
43
40
|
const option = options[i];
|
|
44
41
|
|
|
45
42
|
// If we have a discriminator field, then we will use this to make the determination
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
const discriminator = discriminatorField
|
|
44
|
+
? (option[PROPERTIES_KEY]?.[discriminatorField] as S | undefined)
|
|
45
|
+
: undefined;
|
|
46
|
+
if (discriminatorField && discriminator !== undefined) {
|
|
47
|
+
const value = getByPath<T>(formData, discriminatorField);
|
|
49
48
|
if (validator.isValid(discriminator, value, rootSchema)) {
|
|
50
49
|
return i;
|
|
51
50
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import isEmpty from 'lodash/isEmpty';
|
|
4
|
-
|
|
5
|
-
import { REF_KEY } from '../constants';
|
|
1
|
+
import { REF_KEY } from '../constants.ts';
|
|
2
|
+
import { getByPath, hasByPath, toPath } from '../pathUtils.ts';
|
|
6
3
|
import type {
|
|
7
4
|
Experimental_CustomMergeAllOf,
|
|
8
5
|
FormContextType,
|
|
@@ -10,10 +7,10 @@ import type {
|
|
|
10
7
|
SchemaFieldPath,
|
|
11
8
|
StrictRJSFSchema,
|
|
12
9
|
ValidatorType,
|
|
13
|
-
} from '../types';
|
|
14
|
-
import retrieveSchema from './retrieveSchema';
|
|
10
|
+
} from '../types.ts';
|
|
11
|
+
import retrieveSchema from './retrieveSchema.ts';
|
|
15
12
|
|
|
16
|
-
/** Internal helper function that acts like
|
|
13
|
+
/** Internal helper function that acts like `getByPath` but additionally retrieves `$ref`s as needed to get the path
|
|
17
14
|
* for schemas containing potentially nested `$ref`s.
|
|
18
15
|
*
|
|
19
16
|
* @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs
|
|
@@ -31,16 +28,17 @@ function getFromSchemaInternal<T = any, S extends StrictRJSFSchema = RJSFSchema,
|
|
|
31
28
|
experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>,
|
|
32
29
|
): T | S | undefined {
|
|
33
30
|
let fieldSchema = schema;
|
|
34
|
-
|
|
31
|
+
// hasByPath instead of `in` because `schema` can be undefined at runtime when drilling past a non-matching xxxOf
|
|
32
|
+
if (hasByPath(schema, REF_KEY)) {
|
|
35
33
|
fieldSchema = retrieveSchema<T, S, F>(validator, schema, rootSchema, undefined, experimental_customMergeAllOf);
|
|
36
34
|
}
|
|
37
|
-
if (
|
|
35
|
+
if (path.length === 0) {
|
|
38
36
|
return fieldSchema;
|
|
39
37
|
}
|
|
40
|
-
const pathList = Array.isArray(path) ? [...path] : path
|
|
38
|
+
const pathList = Array.isArray(path) ? [...path] : toPath(path);
|
|
41
39
|
const [part, ...nestedPath] = pathList;
|
|
42
|
-
if (part !== undefined && part !== '' &&
|
|
43
|
-
fieldSchema =
|
|
40
|
+
if (part !== undefined && part !== '' && hasByPath(fieldSchema, part)) {
|
|
41
|
+
fieldSchema = getByPath<S>(fieldSchema, part);
|
|
44
42
|
return getFromSchemaInternal<T, S, F>(
|
|
45
43
|
validator,
|
|
46
44
|
rootSchema,
|
|
@@ -52,7 +50,7 @@ function getFromSchemaInternal<T = any, S extends StrictRJSFSchema = RJSFSchema,
|
|
|
52
50
|
return undefined;
|
|
53
51
|
}
|
|
54
52
|
|
|
55
|
-
/** Helper that acts like
|
|
53
|
+
/** Helper that acts like `getByPath` but additionally retrieves `$ref`s as needed to get the path for schemas
|
|
56
54
|
* containing potentially nested `$ref`s.
|
|
57
55
|
*
|
|
58
56
|
* @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs
|
package/src/schema/index.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import findFieldInSchema from './findFieldInSchema';
|
|
2
|
-
import findSelectedOptionInXxxOf from './findSelectedOptionInXxxOf';
|
|
3
|
-
import getClosestMatchingOption from './getClosestMatchingOption';
|
|
4
|
-
import getDefaultFormState from './getDefaultFormState';
|
|
5
|
-
import getDisplayLabel from './getDisplayLabel';
|
|
6
|
-
import getFirstMatchingOption from './getFirstMatchingOption';
|
|
7
|
-
import getFromSchema from './getFromSchema';
|
|
8
|
-
import isFilesArray from './isFilesArray';
|
|
9
|
-
import isMultiSelect from './isMultiSelect';
|
|
10
|
-
import isSelect from './isSelect';
|
|
11
|
-
import omitExtraData, { getUsedFormData, getFieldNames, isValueEmpty } from './omitExtraData';
|
|
12
|
-
import retrieveSchema, { relaxOptionsForScoring } from './retrieveSchema';
|
|
13
|
-
import sanitizeDataForNewSchema from './sanitizeDataForNewSchema';
|
|
14
|
-
import toPathSchema from './toPathSchema';
|
|
1
|
+
import findFieldInSchema from './findFieldInSchema.ts';
|
|
2
|
+
import findSelectedOptionInXxxOf from './findSelectedOptionInXxxOf.ts';
|
|
3
|
+
import getClosestMatchingOption from './getClosestMatchingOption.ts';
|
|
4
|
+
import getDefaultFormState from './getDefaultFormState.ts';
|
|
5
|
+
import getDisplayLabel from './getDisplayLabel.ts';
|
|
6
|
+
import getFirstMatchingOption from './getFirstMatchingOption.ts';
|
|
7
|
+
import getFromSchema from './getFromSchema.ts';
|
|
8
|
+
import isFilesArray from './isFilesArray.ts';
|
|
9
|
+
import isMultiSelect from './isMultiSelect.ts';
|
|
10
|
+
import isSelect from './isSelect.ts';
|
|
11
|
+
import omitExtraData, { getUsedFormData, getFieldNames, isValueEmpty } from './omitExtraData.ts';
|
|
12
|
+
import retrieveSchema, { relaxOptionsForScoring } from './retrieveSchema.ts';
|
|
13
|
+
import sanitizeDataForNewSchema from './sanitizeDataForNewSchema.ts';
|
|
14
|
+
import toPathSchema from './toPathSchema.ts';
|
|
15
15
|
|
|
16
16
|
export {
|
|
17
17
|
findFieldInSchema,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UI_WIDGET_KEY } from '../constants';
|
|
1
|
+
import { UI_WIDGET_KEY } from '../constants.ts';
|
|
2
2
|
import type {
|
|
3
3
|
Experimental_CustomMergeAllOf,
|
|
4
4
|
FormContextType,
|
|
@@ -6,8 +6,8 @@ import type {
|
|
|
6
6
|
StrictRJSFSchema,
|
|
7
7
|
UiSchema,
|
|
8
8
|
ValidatorType,
|
|
9
|
-
} from '../types';
|
|
10
|
-
import retrieveSchema from './retrieveSchema';
|
|
9
|
+
} from '../types.ts';
|
|
10
|
+
import retrieveSchema from './retrieveSchema.ts';
|
|
11
11
|
|
|
12
12
|
/** Checks to see if the `schema` and `uiSchema` combination represents an array of files
|
|
13
13
|
*
|
|
@@ -4,8 +4,8 @@ import type {
|
|
|
4
4
|
StrictRJSFSchema,
|
|
5
5
|
ValidatorType,
|
|
6
6
|
Experimental_CustomMergeAllOf,
|
|
7
|
-
} from '../types';
|
|
8
|
-
import isSelect from './isSelect';
|
|
7
|
+
} from '../types.ts';
|
|
8
|
+
import isSelect from './isSelect.ts';
|
|
9
9
|
|
|
10
10
|
/** Checks to see if the `schema` combination represents a multi-select
|
|
11
11
|
*
|
package/src/schema/isSelect.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import isConstant from '../isConstant';
|
|
1
|
+
import isConstant from '../isConstant.ts';
|
|
2
2
|
import type {
|
|
3
3
|
FormContextType,
|
|
4
4
|
RJSFSchema,
|
|
5
5
|
StrictRJSFSchema,
|
|
6
6
|
ValidatorType,
|
|
7
7
|
Experimental_CustomMergeAllOf,
|
|
8
|
-
} from '../types';
|
|
9
|
-
import retrieveSchema from './retrieveSchema';
|
|
8
|
+
} from '../types.ts';
|
|
9
|
+
import retrieveSchema from './retrieveSchema.ts';
|
|
10
10
|
|
|
11
11
|
/** Checks to see if the `schema` combination represents a select
|
|
12
12
|
*
|