ngxsmk-tel-input 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngxsmk-tel-input",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Angular international telephone input with country flag dropdown, formatting & validation (intl-tel-input + libphonenumber). ControlValueAccessor. Supports Angular 17–19.",
5
5
  "keywords": [
6
6
  "ngxsmk-tel-input",
@@ -282,8 +282,17 @@ export class NgxsmkTelInputComponent implements AfterViewInit, OnChanges, OnDest
282
282
  private async initIntlTelInput() {
283
283
  const [{default: intlTelInput}] = await Promise.all([import('intl-tel-input')]);
284
284
 
285
- const toLowerKeys = (m?: CountryMap) =>
286
- m ? Object.fromEntries(Object.entries(m).map(([k, v]) => [k.toLowerCase(), v])) : undefined;
285
+ const toLowerKeys = (m?: CountryMap) => {
286
+ if (!m) return undefined;
287
+ const out: Record<string, string> = {};
288
+ for (const k in m) {
289
+ if (Object.prototype.hasOwnProperty.call(m, k)) {
290
+ const v = (m as Record<string, string | undefined>)[k];
291
+ if (v != null) out[k.toLowerCase()] = v;
292
+ }
293
+ }
294
+ return out;
295
+ };
287
296
 
288
297
  const config: any = {
289
298
  initialCountry: this.initialCountry === 'auto' ? 'auto' : (this.initialCountry?.toLowerCase() || 'us'),
@@ -0,0 +1,11 @@
1
+ import type { CountryCode } from 'libphonenumber-js';
2
+
3
+ export type CountryMap = Partial<Record<CountryCode, string>>;
4
+
5
+ export interface IntlTelI18n {
6
+ selectedCountryAriaLabel?: string;
7
+ countryListAriaLabel?: string;
8
+ searchPlaceholder?: string;
9
+ zeroSearchResults?: string;
10
+ noCountrySelected?: string;
11
+ }
package/src/public-api.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './lib/ngxsmk-tel-input.component';
2
2
  export * from './lib/ngxsmk-tel-input.service';
3
+ export type { IntlTelI18n, CountryMap } from './lib/types';