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
TSearchSelectFieldPropsandTAsyncSelectInputPropstypes in thesearch-select-fieldandasync-select-inputcomponents. 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
ReactSelectAsyncPropsandTCustomEvent:ReactSelectAsyncPropsandTCustomEventto 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:TSearchSelectFieldPropsto 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:TAsyncSelectInputPropsto 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
TOptionInnerPropsDataType:TOptionInnerPropsDatato represent the inner properties of options, enhancing clarity and type safety in theSearchSelectFieldcomponent. ([packages/components/fields/search-select-field/src/search-select-field.tsxR382-R387](https://github.com/commercetools/ui-kit/pull/3043/files#diff-d37b3a6d219648d2c7a5c398afed99038657c169c87f8cfff85ca8fbd6e920d4R382-R387))