-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(intl-phone-input): add ruNumber priority and empty country state #294
Conversation
🦋 Changeset detectedLatest commit: 4962fb3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Pull Request Test Coverage Report for Build 3274147886
💛 - Coveralls |
Собрана новая демка. |
Собрана новая демка. |
Собрана новая демка. |
Собрана новая демка. |
/* | ||
* Разрешает очищать поле крестиком | ||
*/ | ||
canClear?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Предлагаю назвать проп как в инпуте - clear
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
переименовал
canBeEmptyCountry?: boolean; | ||
|
||
/* | ||
* Разрешает состояние без выбранной страны |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Неверное описание пропа
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
поправил
/* | ||
* Разрешает состояние без выбранной страны | ||
*/ | ||
canBeEmptyCountry?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Проп ruNumberPriority не работает вместе с canBeEmptyCountry. Так и должно быть? Если да, то нужно этот момент указать в описании
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
работает при указании дефолтной страны - отметил это в описании
Собрана новая демка. |
@@ -53,7 +55,7 @@ export type IntlPhoneInputProps = Partial<Omit<InputAutocompleteProps, 'onChange | |||
/** | |||
* Обработчик события изменения страны | |||
*/ | |||
onCountryChange?: (countryCode: CountryCode) => void; | |||
onCountryChange?: (countryCode?: CountryCode) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Мажорка будет
/* | ||
* Разрешает очищать поле крестиком | ||
*/ | ||
clear?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Надо бы пример с очисткой удалить
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
удалил
Нужно добавить ченджсет |
@igorokFront допиши, пожалуйста, в ченджсет почему это мажорка и что нужно знать тем кто будет обновляться (вкратце любыми словами) |
Собрана новая демка. |
добавил |
Собрана новая демка. |
Собрана новая демка. |
Собрана новая демка. |
@@ -143,6 +143,19 @@ export const IntlPhoneInput = forwardRef<HTMLInputElement, IntlPhoneInputProps>( | |||
newValue = utils.input(inputValue); | |||
} | |||
|
|||
if (countryIso2 === 'ru') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Разве форматированием не phoneLibUtils должна заниматься?
макеты https://www.figma.com/file/cdNnkh2QdxuvYLrBm4cubM/branch/pxLATDZssLAEKvbtCMeQdP/Web-%3A%3A-Core-Default-Components?node-id=65619%3A78962
задача https://jira.moscow.alfaintra.net/browse/FASTPAY-1856
добавлены пропсы:
staticFlag - отключает селект выбора страны
canBeEmptyCountry - добавляет состояние невыбранной страны
ruNumberPriority - приоритет ввода российского номера (при дефолтно выбранном российском флаге ввод числа добавит
+7)
canClear - необходим для сброса страны при очистке поля