refactor(async-select-and-search-select): refactor types in async-select- & search-select-input #3043
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This are the changes from a previous PR. I cherry-picked those changes, added them on top of the current main-branch and resolved merge-issues as well as the remaining-issues caused by the changes that we did meanwhile.
🤖 Summary
This pull request focuses on enhancing type safety and flexibility for the
TSearchSelectFieldProps
andTAsyncSelectInputProps
types in thesearch-select-field
andasync-select-input
components. The changes introduce generic type parameters to these types, allowing for more precise typing and better support for various option, multi-select, and group configurations.Key changes include:
Enhancements to Type Safety and Flexibility:
Generic Type Parameters for
ReactSelectAsyncProps
andTCustomEvent
:ReactSelectAsyncProps
andTCustomEvent
to allow for more precise typing of options, multi-select, and groups. ([[1]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-d37b3a6d219648d2c7a5c398afed99038657c169c87f8cfff85ca8fbd6e920d4L23-R37)
,[[2]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-8583bf9581373c6db9fbe10aa7035c10cb55918d683af5f0d6dfee9f9e45c8fbL37-R63)
)Generic Type Parameters for
TSearchSelectFieldProps
:TSearchSelectFieldProps
to enhance type safety and support various configurations. Updated all relevant properties to use these generic parameters. ([[1]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-d37b3a6d219648d2c7a5c398afed99038657c169c87f8cfff85ca8fbd6e920d4L48-R60)
,[[2]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-d37b3a6d219648d2c7a5c398afed99038657c169c87f8cfff85ca8fbd6e920d4L74-R158)
,[[3]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-d37b3a6d219648d2c7a5c398afed99038657c169c87f8cfff85ca8fbd6e920d4L165-R199)
,[[4]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-d37b3a6d219648d2c7a5c398afed99038657c169c87f8cfff85ca8fbd6e920d4L181-R233)
,[[5]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-d37b3a6d219648d2c7a5c398afed99038657c169c87f8cfff85ca8fbd6e920d4L211-R292)
,[[6]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-d37b3a6d219648d2c7a5c398afed99038657c169c87f8cfff85ca8fbd6e920d4L251-R308)
)Generic Type Parameters for
TAsyncSelectInputProps
:TAsyncSelectInputProps
to improve type safety and flexibility. Updated all relevant properties to use these generic parameters. ([[1]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-8583bf9581373c6db9fbe10aa7035c10cb55918d683af5f0d6dfee9f9e45c8fbL1-R8)
,[[2]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-8583bf9581373c6db9fbe10aa7035c10cb55918d683af5f0d6dfee9f9e45c8fbL95-R140)
,[[3]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-8583bf9581373c6db9fbe10aa7035c10cb55918d683af5f0d6dfee9f9e45c8fbL124-R213)
,[[4]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-8583bf9581373c6db9fbe10aa7035c10cb55918d683af5f0d6dfee9f9e45c8fbL184-R271)
,[[5]](https://github.com/commercetools/ui-kit/pull/3043/files#diff-8583bf9581373c6db9fbe10aa7035c10cb55918d683af5f0d6dfee9f9e45c8fbL232-R346)
)Introduction of
TOptionInnerPropsData
Type:TOptionInnerPropsData
to represent the inner properties of options, enhancing clarity and type safety in theSearchSelectField
component. ([packages/components/fields/search-select-field/src/search-select-field.tsxR382-R387](https://github.com/commercetools/ui-kit/pull/3043/files#diff-d37b3a6d219648d2c7a5c398afed99038657c169c87f8cfff85ca8fbd6e920d4R382-R387)
)