ngxsmk-tel-input 1.0.6 → 1.0.8

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/README.md CHANGED
@@ -18,9 +18,9 @@ An Angular component for entering and validating **international telephone numbe
18
18
  ## Screenshots
19
19
 
20
20
  <p align="left">
21
- <img src="https://unpkg.com/ngxsmk-tel-input@1.0.4/docs/valid.png" alt="Valid phone number" width="420" />
21
+ <img src="https://unpkg.com/ngxsmk-tel-input@1.0.4/docs/valid.png" alt="Angular international phone input - valid" width="420" />
22
22
  &nbsp;&nbsp;
23
- <img src="https://unpkg.com/ngxsmk-tel-input@1.0.4/docs/invalid.png" alt="Invalid phone number" width="420" />
23
+ <img src="https://unpkg.com/ngxsmk-tel-input@1.0.4/docs/invalid.png" alt="Angular international phone input - Invalid" width="420" />
24
24
  </p>
25
25
 
26
26
  ---
@@ -90,13 +90,14 @@ Restart your dev server after editing `angular.json`.
90
90
  ```ts
91
91
  // app.component.ts
92
92
  import { Component } from '@angular/core';
93
- import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
94
- import { NgxsmkTelInputComponent } from 'ngxsmk-tel-input';
93
+ import { ReactiveFormsModule, FormBuilder, Validators, FormGroup } from '@angular/forms';
94
+ import { CommonModule } from '@angular/common';
95
+ import { NgxsmkTelInputComponent } from '../../../ngxsmk-tel-input/src/lib/ngxsmk-tel-input.component';
95
96
 
96
97
  @Component({
97
98
  selector: 'app-root',
98
99
  standalone: true,
99
- imports: [ReactiveFormsModule, NgxsmkTelInputComponent],
100
+ imports: [ReactiveFormsModule, CommonModule, NgxsmkTelInputComponent],
100
101
  template: `
101
102
  <form [formGroup]="fg" style="max-width:420px;display:grid;gap:12px">
102
103
  <ngxsmk-tel-input
@@ -107,19 +108,21 @@ import { NgxsmkTelInputComponent } from 'ngxsmk-tel-input';
107
108
  [preferredCountries]="['US','GB','AU']"
108
109
  (countryChange)="onCountry($event)">
109
110
  </ngxsmk-tel-input>
110
-
111
- <p *ngIf="fg.get('phone')?.hasError('phoneInvalid') && fg.get('phone')?.touched">
112
- Please enter a valid phone number.
113
- </p>
114
-
115
111
  <pre>Value: {{ fg.value | json }}</pre>
116
112
  </form>
117
113
  `
118
114
  })
119
115
  export class AppComponent {
120
- fg = this.fb.group({ phone: ['', Validators.required] });
121
- constructor(private readonly fb: FormBuilder) {}
116
+ fg: FormGroup;
117
+
118
+ constructor(private readonly fb: FormBuilder) {
119
+ this.fg = this.fb.group({
120
+ phone: ['', Validators.required]
121
+ });
122
+ }
123
+
122
124
  onCountry(e: { iso2: any }) { console.log('Country changed:', e.iso2); }
125
+
123
126
  }
124
127
  ```
125
128
 
package/package.json CHANGED
@@ -1,18 +1,51 @@
1
1
  {
2
2
  "name": "ngxsmk-tel-input",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
+ "description": "Angular international telephone input with country flag dropdown, formatting & validation (intl-tel-input + libphonenumber). ControlValueAccessor. Supports Angular 17–19.",
5
+ "keywords": [
6
+ "angular",
7
+ "angular-forms",
8
+ "controlvalueaccessor",
9
+ "phone-input",
10
+ "telephone",
11
+ "tel-input",
12
+ "international",
13
+ "intl-tel-input",
14
+ "libphonenumber",
15
+ "e164",
16
+ "phone-number-validation",
17
+ "country-flag"
18
+ ],
19
+ "homepage": "https://github.com/toozuuu/ngxsmk-tel-input#readme",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/toozuuu/ngxsmk-tel-input.git"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/toozuuu/ngxsmk-tel-input/issues"
26
+ },
4
27
  "author": {
5
- "email": "sachindilshan040@gmail.com",
6
28
  "name": "Sachin Dilshan",
29
+ "email": "sachindilshan040@gmail.com",
7
30
  "url": "https://www.linkedin.com/in/sachindilshan"
8
31
  },
9
- "description": "Angular telephone input with intl-tel-input + libphonenumber-js",
10
32
  "license": "MIT",
11
33
  "private": false,
12
34
  "sideEffects": false,
13
35
  "publishConfig": {
14
36
  "access": "public"
15
37
  },
38
+ "files": [
39
+ "bundles/",
40
+ "fesm*",
41
+ "esm*",
42
+ "schematics/",
43
+ "migrations/",
44
+ "src/",
45
+ "README.md",
46
+ "LICENSE",
47
+ "docs/"
48
+ ],
16
49
  "peerDependencies": {
17
50
  "@angular/common": ">=17",
18
51
  "@angular/core": ">=17",
@@ -32,12 +32,12 @@ type IntlTelInstance = any;
32
32
  standalone: true,
33
33
  imports: [],
34
34
  template: `
35
- <div class="ngx-tel" [class.disabled]="disabled" [attr.data-size]="size" [attr.data-variant]="variant">
35
+ <div class="ngxsmk-tel" [class.disabled]="disabled" [attr.data-size]="size" [attr.data-variant]="variant">
36
36
  @if (label) {
37
- <label class="ngx-tel__label" [for]="resolvedId">{{ label }}</label>
37
+ <label class="ngxsmk-tel__label" [for]="resolvedId">{{ label }}</label>
38
38
  }
39
39
 
40
- <div class="ngx-tel__wrap" [class.has-error]="showError">
40
+ <div class="ngxsmk-tel__wrap" [class.has-error]="showError">
41
41
  <div class="ngxsmk-tel-input__wrapper">
42
42
  <input
43
43
  #telInput
@@ -56,7 +56,7 @@ type IntlTelInstance = any;
56
56
 
57
57
  @if (showClear && currentRaw()) {
58
58
  <button type="button"
59
- class="ngx-tel__clear"
59
+ class="ngxsmk-tel__clear"
60
60
  (click)="clearInput()"
61
61
  [attr.aria-label]="'Clear phone number'">
62
62
  ×
@@ -66,11 +66,11 @@ type IntlTelInstance = any;
66
66
  </div>
67
67
 
68
68
  @if (hint && !showError) {
69
- <div class="ngx-tel__hint">{{ hint }}</div>
69
+ <div class="ngxsmk-tel__hint">{{ hint }}</div>
70
70
  }
71
71
 
72
72
  @if (showError) {
73
- <div class="ngx-tel__error">{{ errorText || 'Please enter a valid phone number.' }}</div>
73
+ <div class="ngxsmk-tel__error">{{ errorText || 'Please enter a valid phone number.' }}</div>
74
74
  }
75
75
 
76
76
  </div>
@@ -119,24 +119,24 @@ type IntlTelInstance = any;
119
119
  }
120
120
 
121
121
  /* ---------- Structure ---------- */
122
- .ngx-tel {
122
+ .ngxsmk-tel {
123
123
  width: 100%;
124
124
  color: var(--tel-fg);
125
125
  }
126
126
 
127
- .ngx-tel.disabled {
127
+ .ngxsmk-tel.disabled {
128
128
  opacity: .7;
129
129
  cursor: not-allowed;
130
130
  }
131
131
 
132
- .ngx-tel__label {
132
+ .ngxsmk-tel__label {
133
133
  display: inline-block;
134
134
  margin-bottom: 6px;
135
135
  font-size: .875rem;
136
136
  font-weight: 500;
137
137
  }
138
138
 
139
- .ngx-tel__wrap {
139
+ .ngxsmk-tel__wrap {
140
140
  position: relative;
141
141
  }
142
142
 
@@ -325,7 +325,7 @@ type IntlTelInstance = any;
325
325
  }
326
326
 
327
327
  /* Clear button */
328
- .ngx-tel__clear {
328
+ .ngxsmk-tel__clear {
329
329
  position: absolute;
330
330
  right: 8px;
331
331
  top: 50%;
@@ -341,24 +341,24 @@ type IntlTelInstance = any;
341
341
  color: var(--tel-placeholder);
342
342
  }
343
343
 
344
- .ngx-tel__clear:hover {
344
+ .ngxsmk-tel__clear:hover {
345
345
  background: rgba(148, 163, 184, .15);
346
346
  }
347
347
 
348
348
  /* Hint & Error */
349
- .ngx-tel__hint {
349
+ .ngxsmk-tel__hint {
350
350
  margin-top: 6px;
351
351
  font-size: 12px;
352
352
  color: var(--tel-placeholder);
353
353
  }
354
354
 
355
- .ngx-tel__error {
355
+ .ngxsmk-tel__error {
356
356
  margin-top: 6px;
357
357
  font-size: 12px;
358
358
  color: var(--tel-error);
359
359
  }
360
360
 
361
- .ngx-tel__wrap.has-error .ngxsmk-tel-input__control {
361
+ .ngxsmk-tel__wrap.has-error .ngxsmk-tel-input__control {
362
362
  border-color: var(--tel-error);
363
363
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .15);
364
364
  }
@@ -1,8 +0,0 @@
1
- # Changesets
2
-
3
- Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4
- with multi-package repos, or single-package repos to help you version and publish your code. You can
5
- find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6
-
7
- We have a quick list of common questions to get you started engaging with this project in
8
- [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
@@ -1,11 +0,0 @@
1
- {
2
- "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3
- "changelog": "@changesets/cli/changelog",
4
- "commit": false,
5
- "fixed": [],
6
- "linked": [],
7
- "access": "restricted",
8
- "baseBranch": "main",
9
- "updateInternalDependencies": "patch",
10
- "ignore": []
11
- }
package/ng-package.json DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
- "dest": "../../dist/ngxsmk-tel-input",
4
- "lib": {
5
- "entryFile": "src/public-api.ts"
6
- },
7
- "allowedNonPeerDependencies": [
8
- "intl-tel-input",
9
- "libphonenumber-js"
10
- ],
11
- "assets": [
12
- "README.md",
13
- "LICENSE",
14
- "docs"
15
- ]
16
- }
package/tsconfig.lib.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../out-tsc/lib",
5
- "declaration": true,
6
- "declarationMap": true,
7
- "inlineSources": true,
8
- "types": []
9
- },
10
- "exclude": [
11
- "**/*.spec.ts"
12
- ]
13
- }
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "./tsconfig.lib.json",
3
- "compilerOptions": {
4
- "declarationMap": false
5
- },
6
- "angularCompilerOptions": {
7
- "compilationMode": "partial"
8
- }
9
- }
@@ -1,13 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../out-tsc/spec",
5
- "types": [
6
- "jasmine"
7
- ]
8
- },
9
- "include": [
10
- "**/*.spec.ts",
11
- "**/*.d.ts"
12
- ]
13
- }