Skip to content
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

Merged
merged 11 commits into from
Oct 18, 2022

Conversation

igorokFront
Copy link
Contributor

@igorokFront igorokFront commented Oct 6, 2022

макеты 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 - необходим для сброса страны при очистке поля

@changeset-bot
Copy link

changeset-bot bot commented Oct 6, 2022

🦋 Changeset detected

Latest commit: 4962fb3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@alfalab/core-components-intl-phone-input Major

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

@coveralls
Copy link

coveralls commented Oct 6, 2022

Pull Request Test Coverage Report for Build 3274147886

  • 91 of 115 (79.13%) changed or added relevant lines in 4 files are covered.
  • 76 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+0.05%) to 81.537%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/intl-phone-input/src/utils/preparePasteData.ts 23 28 82.14%
packages/intl-phone-input/src/component.tsx 65 84 77.38%
Files with Coverage Reduction New Missed Lines %
packages/pure-cell/src/components/amount/component.tsx 5 25.93%
packages/pure-cell/src/components/category/component.tsx 5 35.71%
packages/attach/src/Component.tsx 6 80.16%
packages/pure-cell/src/components/amount-title/component.tsx 7 35.0%
packages/calendar/src/components/calendar-mobile/Component.tsx 53 12.42%
Totals Coverage Status
Change from base Build 3175478421: 0.05%
Covered Lines: 6781
Relevant Lines: 7618

💛 - Coveralls

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

/*
* Разрешает очищать поле крестиком
*/
canClear?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Предлагаю назвать проп как в инпуте - clear

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

переименовал

canBeEmptyCountry?: boolean;

/*
* Разрешает состояние без выбранной страны
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Неверное описание пропа

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

поправил

/*
* Разрешает состояние без выбранной страны
*/
canBeEmptyCountry?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Проп ruNumberPriority не работает вместе с canBeEmptyCountry. Так и должно быть? Если да, то нужно этот момент указать в описании

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

работает при указании дефолтной страны - отметил это в описании

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@@ -53,7 +55,7 @@ export type IntlPhoneInputProps = Partial<Omit<InputAutocompleteProps, 'onChange
/**
* Обработчик события изменения страны
*/
onCountryChange?: (countryCode: CountryCode) => void;
onCountryChange?: (countryCode?: CountryCode) => void;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мажорка будет

/*
* Разрешает очищать поле крестиком
*/
clear?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Надо бы пример с очисткой удалить

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

удалил

@SiebenSieben
Copy link
Contributor

SiebenSieben commented Oct 12, 2022

Нужно добавить ченджсет

@SiebenSieben
Copy link
Contributor

@igorokFront допиши, пожалуйста, в ченджсет почему это мажорка и что нужно знать тем кто будет обновляться (вкратце любыми словами)

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@igorokFront
Copy link
Contributor Author

@igorokFront допиши, пожалуйста, в ченджсет почему это мажорка и что нужно знать тем кто будет обновляться (вкратце любыми словами)

добавил

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@@ -143,6 +143,19 @@ export const IntlPhoneInput = forwardRef<HTMLInputElement, IntlPhoneInputProps>(
newValue = utils.input(inputValue);
}

if (countryIso2 === 'ru') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Разве форматированием не phoneLibUtils должна заниматься?

@SiebenSieben SiebenSieben merged commit dcd90e8 into master Oct 18, 2022
@SiebenSieben SiebenSieben deleted the feat/FASTPAY-1856 branch October 18, 2022 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants