Skip to content

Commit d1e8b0c

Browse files
AhmedAmineZrAhmed Amine Zribinouha06
authored
feat: Create component - phone number input (#326)(#497)(#498)(#338)
* feat: add phone number input * feat: phone number input * chore: remove assets from lib * chore : add country selector prefix to field * chore: remove countryselector from inputdecoration * chore: update logic phone number input * chore: update changelog * chore: update comment in enligsh * chore: resolve loader spacing * chore: format number with prefix from decoration * chore: update te localizable core and documentation * chore: comment condition not used * chore: change logic of implementation of country * chore: update documentation in phone number input * chore : readonl input and country selector shared * feat: Add onComplete write on text and phone field * chore: refacto function on change * chore: change label by enable * review : remove comments and update comment on EN * review: make changes recommended * refacto: renaming classes by form input * feat: refacto style by outlined * chore: create new file with decoration form * chore: remove comment * feat: resolve issue about exception * chore: update localized in arabic & remove todo * review: add is loader when enable * chore: update localizable * review: country selector open when enable readonly * review: update with Alias for OudsFormInputDeco * review: update accessibility for country selector * chore: add on pressed for suffix icon * feat: update with label max line * feat: change phone number input in main component * feat: update func of getLabelMaxLines * feat: Add dart doc for phoneNumberInput * chore: resolve issue placeholder in hintText * review: remove countries from doc * review: change place of outlined label * feat: add documentation library country selector * review: update tokens after review design * chore: add has prefix to hide/show prefix number * chore: resolve readOnly FloatingLabel * chore: update documentation for error case * review: extract Textfield Method and add doc * chore: activate loader only after typing * chore: resove formatting phone number * chore: add prefix of country to returned value if exist * chore: update icons with theme * chore: update le width with 80% of screen * chore: Add Accessibility phoneNumberInput * chore: resolve padding de FormFieldsCustomization * chore: update Accecibility * review: we don't clean text if we select the some country * chore: update label color when error & comment debugPrint * chore: update doc with new format * chore: resolve issue accessibility * chore: when prefix on country selector be off * resolve: improve a11y on prefix and vocal #497 #498 * chore: update icon error and a11y * chore: update localizable strings PhoneNumberInput * fix : update doc * chore: update accessibility prefix --------- Co-authored-by: Ahmed Amine Zribi <ahmedamine.zribi@sofrecom> Co-authored-by: nhammami <nouha.hammami@sofrecom.com>
1 parent a4ae393 commit d1e8b0c

File tree

305 files changed

+14708
-35
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+14708
-35
lines changed

app/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66
## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/0.7.0...develop)
77

88
### Added
9+
- [DemoApp][Library] Create component - `Phone Number Input` ([#326](https://github.com/Orange-OpenSource/ouds-flutter/issues/326))
910
- [DemoApp][Library] Manage the new medium font weight `Typography` ([#403](https://github.com/Orange-OpenSource/ouds-flutter/issues/#403))
1011
- [Tool] Add `ITSAppUsesNonExemptEncryption` into info.plist ([#526](https://github.com/Orange-OpenSource/ouds-flutter/issues/#526))
1112

@@ -195,4 +196,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
195196
- [Library] Create the basics of a documentation ([#7](https://github.com/Orange-OpenSource/ouds-flutter/issues/7))
196197
- [Library] Create the basic architecture of the library ([#4](https://github.com/Orange-OpenSource/ouds-flutter/issues/4))
197198
- [DemoApp] Distribute demo app for validation ([#5](https://github.com/Orange-OpenSource/ouds-flutter/issues/13))
198-
- [DemoApp] Create the basic architecture of the demo application ([#5](https://github.com/Orange-OpenSource/ouds-flutter/issues/5))
199+
- [DemoApp] Create the basic architecture of the demo application ([#5](https://github.com/Orange-OpenSource/ouds-flutter/issues/5))
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

app/lib/l10n/gen/ouds_flutter_app_localizations.dart

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,36 @@ abstract class AppLocalizations {
869869
/// **'Helper Text'**
870870
String get app_components_textInputHelperText_label;
871871

872+
/// No description provided for @app_components_phoneNumberInput_label.
873+
///
874+
/// In en, this message translates to:
875+
/// **'Phone number input'**
876+
String get app_components_phoneNumberInput_label;
877+
878+
/// No description provided for @app_components_phoneNumberInput_description_text.
879+
///
880+
/// In en, this message translates to:
881+
/// **'A Phone Number Input is a form field specifically designed to capture and validate telephone numbers, often in international format. It typically integrates a country selector, allowing users to choose their country and automatically apply the corresponding dialing code (such as +33 for France).'**
882+
String get app_components_phoneNumberInput_description_text;
883+
884+
/// No description provided for @app_components_phoneNumberInput_country_selector_label.
885+
///
886+
/// In en, this message translates to:
887+
/// **'Country selector'**
888+
String get app_components_phoneNumberInput_country_selector_label;
889+
890+
/// No description provided for @app_components_phoneNumberInput_prefix_label.
891+
///
892+
/// In en, this message translates to:
893+
/// **'Prefix'**
894+
String get app_components_phoneNumberInput_prefix_label;
895+
896+
/// No description provided for @app_components_phoneNumberInput_error_label.
897+
///
898+
/// In en, this message translates to:
899+
/// **'The phone number can\'t be empty.'**
900+
String get app_components_phoneNumberInput_error_label;
901+
872902
/// No description provided for @app_components_link_label.
873903
///
874904
/// In en, this message translates to:

app/lib/l10n/gen/ouds_flutter_app_localizations_ar.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,24 @@ class AppLocalizationsAr extends AppLocalizations {
421421
@override
422422
String get app_components_textInputHelperText_label => 'نص المساعدة.';
423423

424+
@override
425+
String get app_components_phoneNumberInput_label => 'Phone number input';
426+
427+
@override
428+
String get app_components_phoneNumberInput_description_text =>
429+
'Phone Number هو حقل نموذج مصمم خصيصًا لالتقاط أرقام الهواتف والتحقق منها، وغالبًا ما يكون بتنسيق دولي. عادةً ما يتضمن محددًا للدولة، مما يسمح للمستخدمين باختيار بلدهم وتطبيق رمز الاتصال المقابل تلقائيًا (مثل 33 لفرنسا).';
430+
431+
@override
432+
String get app_components_phoneNumberInput_country_selector_label =>
433+
'Country selector';
434+
435+
@override
436+
String get app_components_phoneNumberInput_prefix_label => 'Prefix';
437+
438+
@override
439+
String get app_components_phoneNumberInput_error_label =>
440+
'لا يمكن أن يكون رقم الهاتف فارغًا.';
441+
424442
@override
425443
String get app_components_link_label => 'Link';
426444

app/lib/l10n/gen/ouds_flutter_app_localizations_en.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,24 @@ class AppLocalizationsEn extends AppLocalizations {
421421
@override
422422
String get app_components_textInputHelperText_label => 'Helper Text';
423423

424+
@override
425+
String get app_components_phoneNumberInput_label => 'Phone number input';
426+
427+
@override
428+
String get app_components_phoneNumberInput_description_text =>
429+
'A Phone Number Input is a form field specifically designed to capture and validate telephone numbers, often in international format. It typically integrates a country selector, allowing users to choose their country and automatically apply the corresponding dialing code (such as +33 for France).';
430+
431+
@override
432+
String get app_components_phoneNumberInput_country_selector_label =>
433+
'Country selector';
434+
435+
@override
436+
String get app_components_phoneNumberInput_prefix_label => 'Prefix';
437+
438+
@override
439+
String get app_components_phoneNumberInput_error_label =>
440+
'The phone number can\'t be empty.';
441+
424442
@override
425443
String get app_components_link_label => 'Link';
426444

app/lib/l10n/ouds_flutter_ar.arb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@
8888
"app_components_textInput_trailingAction_a11y": "وصف محتوى أيقونة النهاية",
8989
"app_components_textInputHelperText_label": "نص المساعدة.",
9090

91+
"@_components_phone_number_input": {},
92+
"app_components_phoneNumberInput_description_text": "Phone Number هو حقل نموذج مصمم خصيصًا لالتقاط أرقام الهواتف والتحقق منها، وغالبًا ما يكون بتنسيق دولي. عادةً ما يتضمن محددًا للدولة، مما يسمح للمستخدمين باختيار بلدهم وتطبيق رمز الاتصال المقابل تلقائيًا (مثل 33 لفرنسا).",
93+
"app_components_phoneNumberInput_error_label": "لا يمكن أن يكون رقم الهاتف فارغًا.",
94+
9195
"@_components_link": {},
9296
"app_components_link_description_text": "تُستخدم links لتوجيه المستخدمين إلى موارد أو أقسام إضافية، سواء كانت داخلية (ضمن نفس التطبيق) أو خارجية (مثل موقع إلكتروني أو مستند).",
9397

app/lib/l10n/ouds_flutter_en.arb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@
196196
"app_components_textInput_helperLink_label": "Helper link",
197197
"app_components_textInputHelperText_label": "Helper Text",
198198

199+
"@_components_phone_number_input": {},
200+
"app_components_phoneNumberInput_label": "Phone number input",
201+
"app_components_phoneNumberInput_description_text": "A Phone Number Input is a form field specifically designed to capture and validate telephone numbers, often in international format. It typically integrates a country selector, allowing users to choose their country and automatically apply the corresponding dialing code (such as +33 for France).",
202+
"app_components_phoneNumberInput_country_selector_label": "Country selector",
203+
"app_components_phoneNumberInput_prefix_label": "Prefix",
204+
"app_components_phoneNumberInput_error_label": "The phone number can't be empty.",
205+
199206
"@_components_link": {},
200207
"app_components_link_label": "Link",
201208
"app_components_link_description_text": "Links direct users to other resources or sections, whether internal (within the same application) or external (to a website or document).",

app/lib/ui/components/components.dart

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ import 'package:ouds_core/components/badge/ouds_badge.dart';
1515
import 'package:ouds_core/components/button/ouds_button.dart';
1616
import 'package:ouds_core/components/checkbox/ouds_checkbox.dart';
1717
import 'package:ouds_core/components/chip/ouds_filter_chip.dart';
18+
import 'package:ouds_core/components/country_selector/countries.dart';
19+
import 'package:ouds_core/components/country_selector/ouds_country_selector.dart';
1820
import 'package:ouds_core/components/divider/ouds_divider.dart';
1921
import 'package:ouds_core/components/form_input/internal/ouds_form_input_decoration.dart';
22+
import 'package:ouds_core/components/form_input/ouds_phone_number_input.dart';
2023
import 'package:ouds_core/components/form_input/ouds_text_input.dart';
2124
import 'package:ouds_core/components/form_input/password_input/ouds_password_input.dart';
2225
import 'package:ouds_core/components/form_input/password_input/ouds_password_input_decoration.dart';
@@ -37,15 +40,16 @@ import 'package:ouds_flutter_demo/ui/components/component_container.dart';
3740
import 'package:ouds_flutter_demo/ui/components/component_entities.dart';
3841
import 'package:ouds_flutter_demo/ui/components/divider/divider_demo_screen.dart';
3942
import 'package:ouds_flutter_demo/ui/components/form_input/password_input/password_input_demo_screen.dart';
43+
import 'package:ouds_flutter_demo/ui/components/form_input/phone_number/phone_number_input_demo_screen.dart';
4044
import 'package:ouds_flutter_demo/ui/components/form_input/text_input/text_input_demo_screen.dart';
4145
import 'package:ouds_flutter_demo/ui/components/link/link_demo_screen.dart';
4246
import 'package:ouds_flutter_demo/ui/components/pin_code_input/pin_code_input_demo_screen.dart';
4347
import 'package:ouds_flutter_demo/ui/components/radio_button/radio_button_demo_screen.dart';
4448
import 'package:ouds_flutter_demo/ui/components/radio_button/radio_button_item_demo_screen.dart';
4549
import 'package:ouds_flutter_demo/ui/components/switch/switch_demo_screen.dart';
4650
import 'package:ouds_flutter_demo/ui/components/switch/switch_item_demo_screen.dart';
47-
import 'package:ouds_flutter_demo/ui/components/tag/tag_demo_screen.dart';
4851
import 'package:ouds_flutter_demo/ui/components/tag/input_tag_demo_screen.dart';
52+
import 'package:ouds_flutter_demo/ui/components/tag/tag_demo_screen.dart';
4953
import 'package:ouds_theme_contract/ouds_theme.dart';
5054

5155
List<Component> components(BuildContext context) {
@@ -195,6 +199,25 @@ List<Component> components(BuildContext context) {
195199
context.l10n.app_components_passwordInput_description_text,
196200
PasswordInputDemoScreen(),
197201
),
202+
Component(
203+
context.l10n.app_components_phoneNumberInput_label,
204+
ComponentContainer(
205+
child: Padding(
206+
padding: const EdgeInsetsGeometry.directional(start: 20.0, end: 20.0),
207+
child: Center(
208+
child: OudsPhoneNumberInput(
209+
decoration: OudsInputDecoration(labelText: "Phone number", helperText: "Include your full number without spaces.", outlined: false),
210+
countrySelector: CountrySelector(
211+
countryFilter: CountryFilter.custom,
212+
codes: ["fr", "tn", "us"],
213+
),
214+
),
215+
),
216+
),
217+
),
218+
context.l10n.app_components_phoneNumberInput_description_text,
219+
PhoneNumberInputDemoScreen(),
220+
),
198221
Component(
199222
context.l10n.app_components_pinCodeInput_label,
200223
ComponentContainer(

0 commit comments

Comments
 (0)