@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.
Files changed (119) hide show
  1. package/lib/ErrorSchemaBuilder.d.ts +1 -1
  2. package/lib/ErrorSchemaBuilder.js +5 -5
  3. package/lib/allowAdditionalItems.d.ts +1 -1
  4. package/lib/allowAdditionalItems.js +1 -1
  5. package/lib/canExpand.d.ts +1 -1
  6. package/lib/canExpand.js +1 -1
  7. package/lib/constIsAjvDataReference.d.ts +1 -1
  8. package/lib/constIsAjvDataReference.js +2 -2
  9. package/lib/createErrorHandler.d.ts +1 -1
  10. package/lib/createErrorHandler.js +2 -2
  11. package/lib/createSchemaUtils.d.ts +1 -1
  12. package/lib/createSchemaUtils.js +2 -2
  13. package/lib/dateRangeOptions.d.ts +1 -1
  14. package/lib/dateRangeOptions.js +1 -1
  15. package/lib/deepEquals.js +1 -1
  16. package/lib/englishStringTranslator.d.ts +1 -1
  17. package/lib/englishStringTranslator.js +1 -1
  18. package/lib/enumOptionsDeselectValue.d.ts +1 -1
  19. package/lib/enumOptionsDeselectValue.js +2 -2
  20. package/lib/enumOptionsIndexForValue.d.ts +1 -1
  21. package/lib/enumOptionsIndexForValue.js +1 -1
  22. package/lib/enumOptionsIsSelected.d.ts +1 -1
  23. package/lib/enumOptionsIsSelected.js +1 -1
  24. package/lib/enumOptionsSelectValue.d.ts +1 -1
  25. package/lib/enumOptionsSelectValue.js +2 -2
  26. package/lib/enumOptionsValueForIndex.d.ts +1 -1
  27. package/lib/findSchemaDefinition.d.ts +1 -1
  28. package/lib/findSchemaDefinition.js +2 -2
  29. package/lib/getChangedFields.js +6 -6
  30. package/lib/getDateElementProps.d.ts +1 -1
  31. package/lib/getDiscriminatorFieldFromSchema.d.ts +1 -1
  32. package/lib/getDiscriminatorFieldFromSchema.js +2 -2
  33. package/lib/getInputProps.d.ts +1 -1
  34. package/lib/getInputProps.js +1 -1
  35. package/lib/getOptionMatchingSimpleDiscriminator.d.ts +1 -1
  36. package/lib/getOptionMatchingSimpleDiscriminator.js +2 -2
  37. package/lib/getSchemaType.d.ts +1 -1
  38. package/lib/getSchemaType.js +1 -1
  39. package/lib/getSubmitButtonOptions.d.ts +1 -1
  40. package/lib/getSubmitButtonOptions.js +2 -2
  41. package/lib/getTemplate.d.ts +1 -1
  42. package/lib/getUiOptions.d.ts +1 -1
  43. package/lib/getUiOptions.js +2 -2
  44. package/lib/getWidget.d.ts +1 -1
  45. package/lib/getWidget.js +3 -3
  46. package/lib/hasWidget.d.ts +1 -1
  47. package/lib/hasWidget.js +1 -1
  48. package/lib/hashForSchema.d.ts +1 -1
  49. package/lib/idGenerators.d.ts +1 -1
  50. package/lib/idGenerators.js +2 -2
  51. package/lib/index.d.ts +60 -60
  52. package/lib/index.js +60 -60
  53. package/lib/isConstant.d.ts +1 -1
  54. package/lib/isConstant.js +1 -1
  55. package/lib/isCustomWidget.d.ts +1 -1
  56. package/lib/isCustomWidget.js +1 -1
  57. package/lib/isFixedItems.d.ts +1 -1
  58. package/lib/isFixedItems.js +1 -1
  59. package/lib/mergeDefaultsWithFormData.js +3 -3
  60. package/lib/mergeObjects.d.ts +1 -1
  61. package/lib/mergeObjects.js +1 -1
  62. package/lib/mergeSchemas.d.ts +1 -1
  63. package/lib/mergeSchemas.js +4 -4
  64. package/lib/optionsList.d.ts +1 -1
  65. package/lib/optionsList.js +2 -2
  66. package/lib/parseDateString.d.ts +1 -1
  67. package/lib/parser/ParserValidator.d.ts +1 -1
  68. package/lib/parser/ParserValidator.js +4 -4
  69. package/lib/parser/index.d.ts +2 -2
  70. package/lib/parser/index.js +1 -1
  71. package/lib/parser/schemaParser.d.ts +2 -2
  72. package/lib/parser/schemaParser.js +5 -5
  73. package/lib/rangeSpec.d.ts +2 -2
  74. package/lib/schema/getClosestMatchingOption.d.ts +1 -1
  75. package/lib/schema/getClosestMatchingOption.js +13 -13
  76. package/lib/schema/getDefaultFormState.d.ts +1 -1
  77. package/lib/schema/getDefaultFormState.js +19 -19
  78. package/lib/schema/getDisplayLabel.d.ts +1 -1
  79. package/lib/schema/getDisplayLabel.js +6 -6
  80. package/lib/schema/getFirstMatchingOption.d.ts +1 -1
  81. package/lib/schema/getFirstMatchingOption.js +1 -1
  82. package/lib/schema/getMatchingOption.d.ts +1 -1
  83. package/lib/schema/getMatchingOption.js +5 -5
  84. package/lib/schema/index.d.ts +13 -13
  85. package/lib/schema/index.js +13 -13
  86. package/lib/schema/isFilesArray.d.ts +1 -1
  87. package/lib/schema/isFilesArray.js +2 -2
  88. package/lib/schema/isMultiSelect.d.ts +1 -1
  89. package/lib/schema/isMultiSelect.js +1 -1
  90. package/lib/schema/isSelect.d.ts +1 -1
  91. package/lib/schema/isSelect.js +2 -2
  92. package/lib/schema/mergeValidationData.d.ts +1 -1
  93. package/lib/schema/mergeValidationData.js +2 -2
  94. package/lib/schema/retrieveSchema.d.ts +1 -1
  95. package/lib/schema/retrieveSchema.js +15 -15
  96. package/lib/schema/sanitizeDataForNewSchema.d.ts +1 -1
  97. package/lib/schema/sanitizeDataForNewSchema.js +4 -4
  98. package/lib/schema/toIdSchema.d.ts +1 -1
  99. package/lib/schema/toIdSchema.js +6 -6
  100. package/lib/schema/toPathSchema.d.ts +1 -1
  101. package/lib/schema/toPathSchema.js +7 -7
  102. package/lib/schemaRequiresTrueValue.d.ts +1 -1
  103. package/lib/shouldRender.js +1 -1
  104. package/lib/toConstant.d.ts +1 -1
  105. package/lib/toConstant.js +1 -1
  106. package/lib/toDateString.d.ts +1 -1
  107. package/lib/toErrorList.d.ts +1 -1
  108. package/lib/toErrorList.js +2 -2
  109. package/lib/toErrorSchema.d.ts +1 -1
  110. package/lib/toErrorSchema.js +2 -2
  111. package/lib/types.d.ts +1 -1
  112. package/lib/unwrapErrorHandler.d.ts +1 -1
  113. package/lib/unwrapErrorHandler.js +1 -1
  114. package/lib/utcToLocal.js +1 -1
  115. package/lib/validationDataMerge.d.ts +1 -1
  116. package/lib/validationDataMerge.js +3 -3
  117. package/lib/withIdRefPrefix.d.ts +1 -1
  118. package/lib/withIdRefPrefix.js +2 -2
  119. package/package.json +27 -6
@@ -1,4 +1,4 @@
1
- import { ErrorSchema } from './types';
1
+ import { ErrorSchema } from './types.js';
2
2
  /** The `ErrorSchemaBuilder<T>` is used to build an `ErrorSchema<T>` since the definition of the `ErrorSchema` type is
3
3
  * designed for reading information rather than writing it. Use this class to add, replace or clear errors in an error
4
4
  * schema by using either dotted path or an array of path names. Once you are done building the `ErrorSchema`, you can
@@ -1,8 +1,8 @@
1
- import cloneDeep from 'lodash/cloneDeep';
2
- import get from 'lodash/get';
3
- import set from 'lodash/set';
4
- import setWith from 'lodash/setWith';
5
- import { ERRORS_KEY } from './constants';
1
+ import cloneDeep from 'lodash-es/cloneDeep.js';
2
+ import get from 'lodash-es/get.js';
3
+ import set from 'lodash-es/set.js';
4
+ import setWith from 'lodash-es/setWith.js';
5
+ import { ERRORS_KEY } from './constants.js';
6
6
  /** The `ErrorSchemaBuilder<T>` is used to build an `ErrorSchema<T>` since the definition of the `ErrorSchema` type is
7
7
  * designed for reading information rather than writing it. Use this class to add, replace or clear errors in an error
8
8
  * schema by using either dotted path or an array of path names. Once you are done building the `ErrorSchema`, you can
@@ -1,4 +1,4 @@
1
- import { RJSFSchema, StrictRJSFSchema } from './types';
1
+ import { RJSFSchema, StrictRJSFSchema } from './types.js';
2
2
  /** Checks the schema to see if it is allowing additional items, by verifying that `schema.additionalItems` is an
3
3
  * object. The user is warned in the console if `schema.additionalItems` has the value `true`.
4
4
  *
@@ -1,4 +1,4 @@
1
- import isObject from './isObject';
1
+ import isObject from './isObject.js';
2
2
  /** Checks the schema to see if it is allowing additional items, by verifying that `schema.additionalItems` is an
3
3
  * object. The user is warned in the console if `schema.additionalItems` has the value `true`.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { FormContextType, RJSFSchema, StrictRJSFSchema, UiSchema } from './types';
1
+ import { FormContextType, RJSFSchema, StrictRJSFSchema, UiSchema } from './types.js';
2
2
  /** Checks whether the field described by `schema`, having the `uiSchema` and `formData` supports expanding. The UI for
3
3
  * the field can expand if it has additional properties, is not forced as non-expandable by the `uiSchema` and the
4
4
  * `formData` object doesn't already have `schema.maxProperties` elements.
package/lib/canExpand.js CHANGED
@@ -1,4 +1,4 @@
1
- import getUiOptions from './getUiOptions';
1
+ import getUiOptions from './getUiOptions.js';
2
2
  /** Checks whether the field described by `schema`, having the `uiSchema` and `formData` supports expanding. The UI for
3
3
  * the field can expand if it has additional properties, is not forced as non-expandable by the `uiSchema` and the
4
4
  * `formData` object doesn't already have `schema.maxProperties` elements.
@@ -1,4 +1,4 @@
1
- import { RJSFSchema, StrictRJSFSchema } from './types';
1
+ import { RJSFSchema, StrictRJSFSchema } from './types.js';
2
2
  /**
3
3
  * Checks if the schema const property value is an AJV $data reference
4
4
  * and the current schema is not an object or array
@@ -1,5 +1,5 @@
1
- import { CONST_KEY, getSchemaType, isObject } from './';
2
- import isString from 'lodash/isString';
1
+ import { CONST_KEY, getSchemaType, isObject } from './index.js';
2
+ import isString from 'lodash-es/isString.js';
3
3
  /**
4
4
  * Checks if the schema const property value is an AJV $data reference
5
5
  * and the current schema is not an object or array
@@ -1,4 +1,4 @@
1
- import { FormValidation } from './types';
1
+ import { FormValidation } from './types.js';
2
2
  /** Given a `formData` object, recursively creates a `FormValidation` error handling structure around it
3
3
  *
4
4
  * @param formData - The form data around which the error handler is created
@@ -1,5 +1,5 @@
1
- import isPlainObject from 'lodash/isPlainObject';
2
- import { ERRORS_KEY } from './constants';
1
+ import isPlainObject from 'lodash-es/isPlainObject.js';
2
+ import { ERRORS_KEY } from './constants.js';
3
3
  /** Given a `formData` object, recursively creates a `FormValidation` error handling structure around it
4
4
  *
5
5
  * @param formData - The form data around which the error handler is created
@@ -1,4 +1,4 @@
1
- import { Experimental_CustomMergeAllOf, FormContextType, RJSFSchema, SchemaUtilsType, StrictRJSFSchema, ValidatorType } from './types';
1
+ import { Experimental_CustomMergeAllOf, FormContextType, RJSFSchema, SchemaUtilsType, StrictRJSFSchema, ValidatorType } from './types.js';
2
2
  /** Creates a `SchemaUtilsType` interface that is based around the given `validator` and `rootSchema` parameters. The
3
3
  * resulting interface implementation will forward the `validator` and `rootSchema` to all the wrapped APIs.
4
4
  *
@@ -1,5 +1,5 @@
1
- import deepEquals from './deepEquals';
2
- import { getDefaultFormState, getDisplayLabel, getClosestMatchingOption, getFirstMatchingOption, getMatchingOption, isFilesArray, isMultiSelect, isSelect, mergeValidationData, retrieveSchema, sanitizeDataForNewSchema, toIdSchema, toPathSchema, } from './schema';
1
+ import deepEquals from './deepEquals.js';
2
+ import { getDefaultFormState, getDisplayLabel, getClosestMatchingOption, getFirstMatchingOption, getMatchingOption, isFilesArray, isMultiSelect, isSelect, mergeValidationData, retrieveSchema, sanitizeDataForNewSchema, toIdSchema, toPathSchema, } from './schema/index.js';
3
3
  /** The `SchemaUtils` class provides a wrapper around the publicly exported APIs in the `utils/schema` directory such
4
4
  * that one does not have to explicitly pass the `validator`, `rootSchema`, `experimental_defaultFormStateBehavior` or
5
5
  * `experimental_customMergeAllOf` to each method. Since these generally do not change across a `Form`, this allows for
@@ -1,4 +1,4 @@
1
- import { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types';
1
+ import { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types.js';
2
2
  /** Returns a list of options for a date range between `start` and `stop`. If the start date is greater than the end
3
3
  * date, then the date range is reversed. If `start` and `stop` are negative numbers (or zero), then they will be
4
4
  * treated as relative to the current year.
@@ -1,4 +1,4 @@
1
- import pad from './pad';
1
+ import pad from './pad.js';
2
2
  /** Returns a list of options for a date range between `start` and `stop`. If the start date is greater than the end
3
3
  * date, then the date range is reversed. If `start` and `stop` are negative numbers (or zero), then they will be
4
4
  * treated as relative to the current year.
package/lib/deepEquals.js CHANGED
@@ -1,4 +1,4 @@
1
- import isEqualWith from 'lodash/isEqualWith';
1
+ import isEqualWith from 'lodash-es/isEqualWith.js';
2
2
  /** Implements a deep equals using the `lodash.isEqualWith` function, that provides a customized comparator that
3
3
  * assumes all functions are equivalent.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { TranslatableString } from './enums';
1
+ import { TranslatableString } from './enums.js';
2
2
  /** Translates a `TranslatableString` value `stringToTranslate` into english. When a `params` array is provided, each
3
3
  * value in the array is used to replace any of the replaceable parameters in the `stringToTranslate` using the `%1`,
4
4
  * `%2`, etc. replacement specifiers.
@@ -1,4 +1,4 @@
1
- import replaceStringParameters from './replaceStringParameters';
1
+ import replaceStringParameters from './replaceStringParameters.js';
2
2
  /** Translates a `TranslatableString` value `stringToTranslate` into english. When a `params` array is provided, each
3
3
  * value in the array is used to replace any of the replaceable parameters in the `stringToTranslate` using the `%1`,
4
4
  * `%2`, etc. replacement specifiers.
@@ -1,4 +1,4 @@
1
- import { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types';
1
+ import { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types.js';
2
2
  /** Removes the enum option value at the `valueIndex` from the currently `selected` (list of) value(s). If `selected` is
3
3
  * a list, then that list is updated to remove the enum option value with the `valueIndex` in `allEnumOptions`. If it is
4
4
  * a single value, then if the enum option value with the `valueIndex` in `allEnumOptions` matches `selected`, undefined
@@ -1,5 +1,5 @@
1
- import enumOptionsValueForIndex from './enumOptionsValueForIndex';
2
- import deepEquals from './deepEquals';
1
+ import enumOptionsValueForIndex from './enumOptionsValueForIndex.js';
2
+ import deepEquals from './deepEquals.js';
3
3
  /** Removes the enum option value at the `valueIndex` from the currently `selected` (list of) value(s). If `selected` is
4
4
  * a list, then that list is updated to remove the enum option value with the `valueIndex` in `allEnumOptions`. If it is
5
5
  * a single value, then if the enum option value with the `valueIndex` in `allEnumOptions` matches `selected`, undefined
@@ -1,4 +1,4 @@
1
- import { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types';
1
+ import { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types.js';
2
2
  /** Returns the index(es) of the options in `allEnumOptions` whose value(s) match the ones in `value`. All the
3
3
  * `enumOptions` are filtered based on whether they are a "selected" `value` and the index of each selected one is then
4
4
  * stored in an array. If `multiple` is true, that array is returned, otherwise the first element in the array is
@@ -1,4 +1,4 @@
1
- import enumOptionsIsSelected from './enumOptionsIsSelected';
1
+ import enumOptionsIsSelected from './enumOptionsIsSelected.js';
2
2
  /** Returns the index(es) of the options in `allEnumOptions` whose value(s) match the ones in `value`. All the
3
3
  * `enumOptions` are filtered based on whether they are a "selected" `value` and the index of each selected one is then
4
4
  * stored in an array. If `multiple` is true, that array is returned, otherwise the first element in the array is
@@ -1,4 +1,4 @@
1
- import { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types';
1
+ import { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types.js';
2
2
  /** Determines whether the given `value` is (one of) the `selected` value(s).
3
3
  *
4
4
  * @param value - The value being checked to see if it is selected
@@ -1,4 +1,4 @@
1
- import deepEquals from './deepEquals';
1
+ import deepEquals from './deepEquals.js';
2
2
  /** Determines whether the given `value` is (one of) the `selected` value(s).
3
3
  *
4
4
  * @param value - The value being checked to see if it is selected
@@ -1,4 +1,4 @@
1
- import { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types';
1
+ import { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types.js';
2
2
  /** Add the enum option value at the `valueIndex` to the list of `selected` values in the proper order as defined by
3
3
  * `allEnumOptions`
4
4
  *
@@ -1,5 +1,5 @@
1
- import enumOptionsValueForIndex from './enumOptionsValueForIndex';
2
- import isNil from 'lodash/isNil';
1
+ import enumOptionsValueForIndex from './enumOptionsValueForIndex.js';
2
+ import isNil from 'lodash-es/isNil.js';
3
3
  /** Add the enum option value at the `valueIndex` to the list of `selected` values in the proper order as defined by
4
4
  * `allEnumOptions`
5
5
  *
@@ -1,4 +1,4 @@
1
- import { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types';
1
+ import { EnumOptionsType, RJSFSchema, StrictRJSFSchema } from './types.js';
2
2
  /** Returns the value(s) from `allEnumOptions` at the index(es) provided by `valueIndex`. If `valueIndex` is not an
3
3
  * array AND the index is not valid for `allEnumOptions`, `emptyValue` is returned. If `valueIndex` is an array, AND it
4
4
  * contains an invalid index, the returned array will have the resulting undefined values filtered out, leaving only
@@ -1,4 +1,4 @@
1
- import { GenericObjectType, RJSFSchema, StrictRJSFSchema } from './types';
1
+ import { GenericObjectType, RJSFSchema, StrictRJSFSchema } from './types.js';
2
2
  /** Splits out the value at the `key` in `object` from the `object`, returning an array that contains in the first
3
3
  * location, the `object` minus the `key: value` and in the second location the `value`.
4
4
  *
@@ -1,6 +1,6 @@
1
1
  import jsonpointer from 'jsonpointer';
2
- import omit from 'lodash/omit';
3
- import { REF_KEY } from './constants';
2
+ import omit from 'lodash-es/omit.js';
3
+ import { REF_KEY } from './constants.js';
4
4
  /** Splits out the value at the `key` in `object` from the `object`, returning an array that contains in the first
5
5
  * location, the `object` minus the `key: value` and in the second location the `value`.
6
6
  *
@@ -1,9 +1,9 @@
1
- import keys from 'lodash/keys';
2
- import pickBy from 'lodash/pickBy';
3
- import isPlainObject from 'lodash/isPlainObject';
4
- import get from 'lodash/get';
5
- import difference from 'lodash/difference';
6
- import deepEquals from './deepEquals';
1
+ import keys from 'lodash-es/keys.js';
2
+ import pickBy from 'lodash-es/pickBy.js';
3
+ import isPlainObject from 'lodash-es/isPlainObject.js';
4
+ import get from 'lodash-es/get.js';
5
+ import difference from 'lodash-es/difference.js';
6
+ import deepEquals from './deepEquals.js';
7
7
  /**
8
8
  * Compares two objects and returns the names of the fields that have changed.
9
9
  * This function iterates over each field of object `a`, using `_.isEqual` to compare the field value
@@ -1,4 +1,4 @@
1
- import { type DateObject } from './types';
1
+ import { type DateObject } from './types.js';
2
2
  /** Available options for re-ordering date input element */
3
3
  export type DateElementFormat = 'DMY' | 'MDY' | 'YMD';
4
4
  /** Type describing format of DateElement prop */
@@ -1,4 +1,4 @@
1
- import { RJSFSchema, StrictRJSFSchema } from './types';
1
+ import { RJSFSchema, StrictRJSFSchema } from './types.js';
2
2
  /** Returns the `discriminator.propertyName` when defined in the `schema` if it is a string. A warning is generated when
3
3
  * it is not a string. Returns `undefined` when a valid discriminator is not present.
4
4
  *
@@ -1,5 +1,5 @@
1
- import get from 'lodash/get';
2
- import isString from 'lodash/isString';
1
+ import get from 'lodash-es/get.js';
2
+ import isString from 'lodash-es/isString.js';
3
3
  /** Returns the `discriminator.propertyName` when defined in the `schema` if it is a string. A warning is generated when
4
4
  * it is not a string. Returns `undefined` when a valid discriminator is not present.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { FormContextType, InputPropsType, RJSFSchema, StrictRJSFSchema, UIOptionsType } from './types';
1
+ import { FormContextType, InputPropsType, RJSFSchema, StrictRJSFSchema, UIOptionsType } from './types.js';
2
2
  /** Using the `schema`, `defaultType` and `options`, extract out the props for the <input> element that make sense.
3
3
  *
4
4
  * @param schema - The schema for the field provided by the widget
@@ -1,4 +1,4 @@
1
- import rangeSpec from './rangeSpec';
1
+ import rangeSpec from './rangeSpec.js';
2
2
  /** Using the `schema`, `defaultType` and `options`, extract out the props for the <input> element that make sense.
3
3
  *
4
4
  * @param schema - The schema for the field provided by the widget
@@ -1,4 +1,4 @@
1
- import { RJSFSchema, StrictRJSFSchema } from './types';
1
+ import { RJSFSchema, StrictRJSFSchema } from './types.js';
2
2
  /** Compares the value of `discriminatorField` within `formData` against the value of `discriminatorField` within schema for each `option`.
3
3
  * Returns index of first `option` whose discriminator matches formData. Returns `undefined` if there is no match.
4
4
  * This function does not work with discriminators of `"type": "object"` and `"type": "array"`
@@ -1,5 +1,5 @@
1
- import get from 'lodash/get';
2
- import { PROPERTIES_KEY } from './constants';
1
+ import get from 'lodash-es/get.js';
2
+ import { PROPERTIES_KEY } from './constants.js';
3
3
  /** Compares the value of `discriminatorField` within `formData` against the value of `discriminatorField` within schema for each `option`.
4
4
  * Returns index of first `option` whose discriminator matches formData. Returns `undefined` if there is no match.
5
5
  * This function does not work with discriminators of `"type": "object"` and `"type": "array"`
@@ -1,4 +1,4 @@
1
- import { RJSFSchema, StrictRJSFSchema } from './types';
1
+ import { RJSFSchema, StrictRJSFSchema } from './types.js';
2
2
  /** Gets the type of a given `schema`. If the type is not explicitly defined, then an attempt is made to infer it from
3
3
  * other elements of the schema as follows:
4
4
  * - schema.const: Returns the `guessType()` of that value
@@ -1,4 +1,4 @@
1
- import guessType from './guessType';
1
+ import guessType from './guessType.js';
2
2
  /** Gets the type of a given `schema`. If the type is not explicitly defined, then an attempt is made to infer it from
3
3
  * other elements of the schema as follows:
4
4
  * - schema.const: Returns the `guessType()` of that value
@@ -1,4 +1,4 @@
1
- import { FormContextType, RJSFSchema, StrictRJSFSchema, UiSchema, UISchemaSubmitButtonOptions } from './types';
1
+ import { FormContextType, RJSFSchema, StrictRJSFSchema, UiSchema, UISchemaSubmitButtonOptions } from './types.js';
2
2
  /** The default submit button options, exported for testing purposes
3
3
  */
4
4
  export declare const DEFAULT_OPTIONS: UISchemaSubmitButtonOptions;
@@ -1,5 +1,5 @@
1
- import { SUBMIT_BTN_OPTIONS_KEY } from './constants';
2
- import getUiOptions from './getUiOptions';
1
+ import { SUBMIT_BTN_OPTIONS_KEY } from './constants.js';
2
+ import getUiOptions from './getUiOptions.js';
3
3
  /** The default submit button options, exported for testing purposes
4
4
  */
5
5
  export const DEFAULT_OPTIONS = {
@@ -1,4 +1,4 @@
1
- import { FormContextType, TemplatesType, Registry, UIOptionsType, StrictRJSFSchema, RJSFSchema } from './types';
1
+ import { FormContextType, TemplatesType, Registry, UIOptionsType, StrictRJSFSchema, RJSFSchema } from './types.js';
2
2
  /** Returns the template with the given `name` from either the `uiSchema` if it is defined or from the `registry`
3
3
  * otherwise. NOTE, since `ButtonTemplates` are not overridden in `uiSchema` only those in the `registry` are returned.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { FormContextType, GlobalUISchemaOptions, RJSFSchema, StrictRJSFSchema, UIOptionsType, UiSchema } from './types';
1
+ import { FormContextType, GlobalUISchemaOptions, RJSFSchema, StrictRJSFSchema, UIOptionsType, UiSchema } from './types.js';
2
2
  /** Get all passed options from ui:options, and ui:<optionName>, returning them in an object with the `ui:`
3
3
  * stripped off. Any `globalOptions` will always be returned, unless they are overridden by options in the `uiSchema`.
4
4
  *
@@ -1,5 +1,5 @@
1
- import { UI_OPTIONS_KEY, UI_WIDGET_KEY } from './constants';
2
- import isObject from './isObject';
1
+ import { UI_OPTIONS_KEY, UI_WIDGET_KEY } from './constants.js';
2
+ import isObject from './isObject.js';
3
3
  /** Get all passed options from ui:options, and ui:<optionName>, returning them in an object with the `ui:`
4
4
  * stripped off. Any `globalOptions` will always be returned, unless they are overridden by options in the `uiSchema`.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { FormContextType, RJSFSchema, Widget, RegistryWidgetsType, StrictRJSFSchema } from './types';
1
+ import { FormContextType, RJSFSchema, Widget, RegistryWidgetsType, StrictRJSFSchema } from './types.js';
2
2
  /** Given a schema representing a field to render and either the name or actual `Widget` implementation, returns the
3
3
  * React component that is used to render the widget. If the `widget` is already a React component, then it is wrapped
4
4
  * with a `MergedWidget`. Otherwise an attempt is made to look up the widget inside of the `registeredWidgets` map based
package/lib/getWidget.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { createElement } from 'react';
3
3
  import ReactIs from 'react-is';
4
- import get from 'lodash/get';
5
- import set from 'lodash/set';
6
- import getSchemaType from './getSchemaType';
4
+ import get from 'lodash-es/get.js';
5
+ import set from 'lodash-es/set.js';
6
+ import getSchemaType from './getSchemaType.js';
7
7
  /** The map of schema types to widget type to widget name
8
8
  */
9
9
  const widgetMap = {
@@ -1,4 +1,4 @@
1
- import { FormContextType, RegistryWidgetsType, RJSFSchema, StrictRJSFSchema, Widget } from './types';
1
+ import { FormContextType, RegistryWidgetsType, RJSFSchema, StrictRJSFSchema, Widget } from './types.js';
2
2
  /** Detects whether the `widget` exists for the `schema` with the associated `registryWidgets` and returns true if it
3
3
  * does, or false if it doesn't.
4
4
  *
package/lib/hasWidget.js CHANGED
@@ -1,4 +1,4 @@
1
- import getWidget from './getWidget';
1
+ import getWidget from './getWidget.js';
2
2
  /** Detects whether the `widget` exists for the `schema` with the associated `registryWidgets` and returns true if it
3
3
  * does, or false if it doesn't.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { RJSFSchema, StrictRJSFSchema } from './types';
1
+ import { RJSFSchema, StrictRJSFSchema } from './types.js';
2
2
  /** Stringifies the schema and returns the hash of the resulting string. Sorts schema fields
3
3
  * in consistent order before stringify to prevent different hash ids for the same schema.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { IdSchema } from './types';
1
+ import { IdSchema } from './types.js';
2
2
  /** Return a consistent `id` for the field description element
3
3
  *
4
4
  * @param id - Either simple string id or an IdSchema from which to extract it
@@ -1,5 +1,5 @@
1
- import isString from 'lodash/isString';
2
- import { ID_KEY } from './constants';
1
+ import isString from 'lodash-es/isString.js';
2
+ import { ID_KEY } from './constants.js';
3
3
  /** Generates a consistent `id` pattern for a given `id` and a `suffix`
4
4
  *
5
5
  * @param id - Either simple string id or an IdSchema from which to extract it
package/lib/index.d.ts CHANGED
@@ -1,61 +1,61 @@
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, { type DateElementFormat } 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, { type DateElementFormat } 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, DateElementFormat, 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, };