You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add excludeCountries, searchPlaceholder, and flag visibility controls (#90)
## PR Description
### **Description**
This PR introduces several highly requested features and customization
inputs to `ngxsmk-tel-input`, achieving parity and superiority over
`ngx-intl-tel-input-gg`. All new configurations support both the
traditional `@Input()` bindings and the modern Signal-based `input()`
APIs.
### **Key Features Added**
1. **Exclude Specific Countries (`excludeCountries` /
`excludeCountriesSignal`)**
- Allows excluding specific ISO-2 country codes from appearing inside
the dropdown list.
2. **Custom Search Placeholder (`searchPlaceholder` /
`searchPlaceholderSignal`)**
- Dynamically customizes the placeholder text of the country search
field inside the dropdown container.
3. **Hide Flags Completely (`showFlags` / `showFlagsSignal`)**
- Completely removes flag elements from both the selected input wrapper
and country dropdown list for minimalist, text-only layouts.
4. **Hide Flags only in Dropdown (`searchCountryFlag` /
`searchCountryFlagSignal`)**
- Hides flag icons only within the search results dropdown list, keeping
the flag in the selected dial code wrapper.
---
### **Files Changed**
- **Core logic & mappings**:
[ngxsmk-tel-input.component.ts](file:///d:/My%20Projects/ngxsmk-tel-input/projects/ngxsmk-tel-input/src/lib/ngxsmk-tel-input.component.ts)
- **CSS flag-hiding rules**:
[ngxsmk-tel-input.component.scss](file:///d:/My%20Projects/ngxsmk-tel-input/projects/ngxsmk-tel-input/src/lib/ngxsmk-tel-input.component.scss)
- **Type enhancements**:
[types-enhanced.ts](file:///d:/My%20Projects/ngxsmk-tel-input/projects/ngxsmk-tel-input/src/lib/types-enhanced.ts)
- **Test coverage**:
[ngxsmk-tel-input.component.spec.ts](file:///d:/My%20Projects/ngxsmk-tel-input/projects/ngxsmk-tel-input/src/lib/ngxsmk-tel-input.component.spec.ts)
- **Documentation**:
[CHANGELOG.md](file:///d:/My%20Projects/ngxsmk-tel-input/CHANGELOG.md),
[README.md](file:///d:/My%20Projects/ngxsmk-tel-input/README.md),
library
[README.md](file:///d:/My%20Projects/ngxsmk-tel-input/projects/ngxsmk-tel-input/README.md),
[SIGNALS_API.md](file:///d:/My%20Projects/ngxsmk-tel-input/projects/ngxsmk-tel-input/SIGNALS_API.md),
and
[TYPESCRIPT.md](file:///d:/My%20Projects/ngxsmk-tel-input/projects/ngxsmk-tel-input/TYPESCRIPT.md).
---
### **Verification Results**
- **Automated Tests**: Unit tests added for each new input/signal
combination. All 75 tests pass:
```bash
npm run test:lib -- --watch=false --browsers=ChromeHeadless
```
- **Successful Compilations**: Verified that the library (`npm run
build:lib`) and the demo application (`npm run build:demo`) compile
cleanly without Ivy bails or warnings.
---------
Co-authored-by: Sébastien Gaillard <82144644+SebGaillard1@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,20 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
-
## [1.6.11] - 2026-05-01
10
+
### Added
11
+
-**excludeCountries / excludeCountriesSignal**: Exclude specific country ISO codes from appearing in the dropdown list.
12
+
-**searchPlaceholder / searchPlaceholderSignal**: Customizable placeholder text for the country search input.
13
+
-**showFlags / showFlagsSignal**: Hides flags completely from the selected input and country dropdown.
14
+
-**searchCountryFlag / searchCountryFlagSignal**: Hides flag icons only within the dropdown list items while maintaining the selected flag display.
11
15
12
-
### Changed
13
-
- Bumped stable/current package version references across workspace to `1.6.11`.
16
+
---
14
17
15
-
## [1.6.10] - 2026-01-19
18
+
## [1.7.0] - 2026-06-06
16
19
17
20
### Changed
18
-
-**Dependencies**: Updated `intl-tel-input` to version 25 compatibility.
19
-
-**Internal**: Migrated `preferredCountries` to `countryOrder` to support `intl-tel-input` v25.
20
21
-**Example Components**: All example components (E-commerce Checkout, User Registration, Profile Management) now default to dark mode theme
21
22
-**Demo App**: Default theme changed to dark mode for better visibility and consistency
22
23
-**Navigation UI**: Fixed icon and text colors in dark mode navigation menu for better contrast and readability
23
24
25
+
### Fixed
26
+
-**Invalid Country Code False Positive**: Fixed `isInvalidInternationalNumber()` incorrectly flagging valid international numbers whose country code starts with a single-digit prefix that is itself not a country code (e.g. Greece `+30`, France `+33`, Germany `+49`, Australia `+61`, India `+91`). The loop now continues through all 1–3 digit prefix candidates and only flags a number as invalid if none of them produce a valid parse, rather than short-circuiting on the first failure. Non-`+` prefixed (national-format) inputs are also no longer passed through the loop at all.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,15 @@ By participating in this project, you are expected to uphold the project's goals
6
6
7
7
---
8
8
9
-
## How to Contribute
9
+
## How to Contribute
10
10
11
11
There are several ways you can help improve this project:
12
12
13
13
1.**Report Bugs:** Submit an issue if you find a problem.
14
14
2.**Suggest Features:** Open an issue to propose new functionality.
15
15
3.**Contribute Code:** Submit a Pull Request with bug fixes or new features.
16
16
17
-
## Reporting Bugs
17
+
## Reporting Bugs
18
18
19
19
If you find a bug, please check the [Issues page](https://github.com/toozuuu/ngxsmk-tel-input/issues) to see if it has already been reported.
20
20
@@ -24,13 +24,13 @@ When submitting a new bug report, please include:
24
24
* Your **Angular version** and the **browser** you are using.
25
25
* A minimal reproduction link (e.g., CodePen, JSFiddle) if possible.
26
26
27
-
## Suggesting Enhancements
27
+
## Suggesting Enhancements
28
28
29
29
If you have an idea for a new feature or an enhancement, please open a new issue on the [Issues page](https://github.com/toozuuu/ngxsmk-tel-input/issues).
30
30
31
31
Describe the feature, why you think it would be useful, and how it aligns with the goals of the library.
32
32
33
-
## Code Contributions (Pull Requests)
33
+
## Code Contributions (Pull Requests)
34
34
35
35
We welcome pull requests for bug fixes and new features.
Copy file name to clipboardExpand all lines: README.md
+40-47Lines changed: 40 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,65 +1,57 @@
1
1
# ngxsmk-tel-input
2
2
3
-
An Angular **phone input / telephone input** component with country dropdown, flags, international formatting, and robust validation.
4
-
Built on top of [`intl-tel-input`](https://github.com/jackocnr/intl-tel-input)+ [`libphonenumber-js`](https://github.com/catamphetamine/libphonenumber-js), and fully compatible with Angular Reactive Forms and template-driven forms through `ControlValueAccessor`.
3
+
An Angular **telephone input** component with country dropdown, flags, and robust validation/formatting.
4
+
Wraps [`intl-tel-input`](https://github.com/jackocnr/intl-tel-input)for the UI and [`libphonenumber-js`](https://github.com/catamphetamine/libphonenumber-js) for parsing/validation. Implements `ControlValueAccessor` so it plugs into Angular Forms.
5
5
6
6
> Emits **E.164** by default (e.g. `+14155550123`). SSR‑safe via lazy browser‑only import.
7
7
8
-
## Try it live on StackBlitz
8
+
## Try it live on StackBlitz
9
9
10
10
[](https://stackblitz.com/~/github.com/toozuuu/ngxsmk-tel-input)
11
11
12
12
---
13
13
14
-
## Features
14
+
## Features
15
15
16
16
* Country dropdown with flags
17
-
* E.164 output (display can be national with `nationalMode`)
17
+
* E.164 output (display can be configured via `nationalDisplay`)
18
18
* Reactive & template‑driven Forms support (CVA)
19
19
* Built‑in validation using libphonenumber‑js
20
20
***Enhanced validation**: Detects invalid country codes (like "11", "99") and shows appropriate error states
21
21
***Mobile responsive**: Optimized for touch devices with proper tap targets, prevents iOS zoom, and responsive dropdown
22
-
***Dark & Light themes**: Improved dark-mode contrast, consistent code/readout colors, and automatic system preference detection
22
+
***Dark & Light themes**: Comprehensive theme system with automatic system preference detection
23
23
***Accessibility**: Full ARIA support, screen reader compatibility, keyboard navigation
24
+
***Integrations & Ionic ready**: Built-in support for Twilio, Vonage, AWS SNS, and Ionic Framework overlays/themes (see [INTEGRATIONS.md](./projects/ngxsmk-tel-input/INTEGRATIONS.md))
|`initialCountry`|`CountryCode \| 'auto'`|`'US'`| Starting country (also respected when initial form value is `''`). `'auto'` uses geoIp stub (`US` by default). |
251
243
|`preferredCountries`|`CountryCode[]`|`['US','GB']`| Pin these at the top. |
|`utilsScript`|`string`| — | Path/URL to `utils.js` (needed for example placeholders). |
276
272
|`customPlaceholder`|`(example: string, country: any) => string`| — | Transform the example placeholder. |
277
273
|`clearAriaLabel`|`string`|`'Clear phone number'`| ARIA label for the clear button. |
@@ -287,18 +283,15 @@ Arabic + RTL example
287
283
|`countryChange`|`{ iso2: CountryCode }`| Fired when selected country changes. |
288
284
|`validityChange`|`boolean`| Fired when validity flips. |
289
285
|`inputChange`|`{ raw: string; e164: string \| null; iso2: CountryCode }`| Emitted on every keystroke. |
290
-
|`ready`|`void`| Emitted after plugin + listeners finish wiring (including each re-init cycle). |
291
286
292
287
### Public methods
293
288
294
289
*`focus(): void`
295
290
*`selectCountry(iso2: CountryCode): void`
296
291
297
-
For deterministic first render behavior, prefer setting `[initialCountry]` directly. If you call imperative APIs like `selectCountry(...)` immediately after mount, wait for `(ready)` first.
298
-
299
292
---
300
293
301
-
## Formatting & validity behavior
294
+
## Formatting & validity behavior
302
295
303
296
* No formatting while invalid. As-you-type masking only starts when the digits form a valid number for the selected country.
304
297
@@ -311,7 +304,7 @@ For rare patterns not covered by libphonenumber-js, the control falls back to ra
311
304
---
312
305
313
306
314
-
## Theming
307
+
## Theming
315
308
316
309
### CSS Variables
317
310
@@ -365,7 +358,7 @@ Dark mode: wrap in a `.dark` parent or use `[theme]="'dark'"` — tokens adapt a
0 commit comments