ngxsmk-tel-input 1.6.4 → 1.6.5
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/.changeset/README.md +8 -0
- package/.changeset/config.json +11 -0
- package/README.md +1 -1
- package/docs/invalid.png +0 -0
- package/docs/kr.png +0 -0
- package/docs/valid.png +0 -0
- package/ng-package.json +8 -0
- package/package.json +59 -69
- package/src/lib/ngxsmk-tel-input.component.scss +226 -0
- package/src/lib/ngxsmk-tel-input.component.spec.ts +24 -0
- package/src/lib/ngxsmk-tel-input.component.ts +562 -0
- package/src/lib/ngxsmk-tel-input.service.spec.ts +15 -0
- package/src/lib/ngxsmk-tel-input.service.ts +17 -0
- package/src/lib/types.ts +11 -0
- package/{public-api.d.ts → src/public-api.ts} +3 -4
- package/tsconfig.lib.json +14 -0
- package/tsconfig.spec.json +13 -0
- package/fesm2022/ngxsmk-tel-input.mjs +0 -623
- package/fesm2022/ngxsmk-tel-input.mjs.map +0 -1
- package/index.d.ts +0 -6
- package/lib/ngxsmk-tel-input.component.d.ts +0 -113
- package/lib/ngxsmk-tel-input.component.d.ts.map +0 -1
- package/lib/ngxsmk-tel-input.service.d.ts +0 -13
- package/lib/ngxsmk-tel-input.service.d.ts.map +0 -1
- package/lib/types.d.ts +0 -10
- package/lib/types.d.ts.map +0 -1
- package/ngxsmk-tel-input.d.ts.map +0 -1
- package/public-api.d.ts.map +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
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)
|
|
@@ -0,0 +1,11 @@
|
|
|
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/README.md
CHANGED
|
@@ -368,4 +368,4 @@ Clear `.angular/cache`, rebuild the lib, and restart `ng serve`.
|
|
|
368
368
|
* UI powered by [`intl-tel-input`](https://github.com/jackocnr/intl-tel-input)
|
|
369
369
|
* Parsing & validation by [`libphonenumber-js`](https://github.com/catamphetamine/libphonenumber-js)
|
|
370
370
|
|
|
371
|
-
Last updated: 2025-08-
|
|
371
|
+
Last updated: 2025-08-29
|
package/docs/invalid.png
ADDED
|
Binary file
|
package/docs/kr.png
ADDED
|
Binary file
|
package/docs/valid.png
ADDED
|
Binary file
|
package/ng-package.json
ADDED
package/package.json
CHANGED
|
@@ -1,69 +1,59 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ngxsmk-tel-input",
|
|
3
|
-
"version": "1.6.
|
|
4
|
-
"description": "Angular international telephone input (intl-tel-input UI + libphonenumber-js validation). ControlValueAccessor. SSR-safe.",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"sideEffects": false,
|
|
7
|
-
"publishConfig": {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"keywords": [
|
|
24
|
-
"ngxsmk-tel-input",
|
|
25
|
-
"angular",
|
|
26
|
-
"angular-forms",
|
|
27
|
-
"controlvalueaccessor",
|
|
28
|
-
"cva",
|
|
29
|
-
"phone-input",
|
|
30
|
-
"telephone-input",
|
|
31
|
-
"international-phone",
|
|
32
|
-
"intl-tel-input",
|
|
33
|
-
"libphonenumber-js",
|
|
34
|
-
"e164",
|
|
35
|
-
"country-code",
|
|
36
|
-
"dial-code",
|
|
37
|
-
"separate-dial-code",
|
|
38
|
-
"national-mode",
|
|
39
|
-
"country-flags",
|
|
40
|
-
"i18n",
|
|
41
|
-
"localization",
|
|
42
|
-
"rtl",
|
|
43
|
-
"a11y",
|
|
44
|
-
"ssr",
|
|
45
|
-
"typescript"
|
|
46
|
-
],
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"@angular/
|
|
50
|
-
"@angular/
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"exports": {
|
|
61
|
-
"./package.json": {
|
|
62
|
-
"default": "./package.json"
|
|
63
|
-
},
|
|
64
|
-
".": {
|
|
65
|
-
"types": "./index.d.ts",
|
|
66
|
-
"default": "./fesm2022/ngxsmk-tel-input.mjs"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "ngxsmk-tel-input",
|
|
3
|
+
"version": "1.6.5",
|
|
4
|
+
"description": "Angular international telephone input (intl-tel-input UI + libphonenumber-js validation). ControlValueAccessor. SSR-safe.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"publishConfig": { "access": "public" },
|
|
8
|
+
|
|
9
|
+
"author": {
|
|
10
|
+
"name": "Sachin Dilshan",
|
|
11
|
+
"email": "sachindilshan040@gmail.com",
|
|
12
|
+
"url": "https://github.com/toozuuu"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/toozuuu/ngxsmk-tel-input#readme",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/toozuuu/ngxsmk-tel-input.git"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/toozuuu/ngxsmk-tel-input/issues"
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
"keywords": [
|
|
24
|
+
"ngxsmk-tel-input",
|
|
25
|
+
"angular",
|
|
26
|
+
"angular-forms",
|
|
27
|
+
"controlvalueaccessor",
|
|
28
|
+
"cva",
|
|
29
|
+
"phone-input",
|
|
30
|
+
"telephone-input",
|
|
31
|
+
"international-phone",
|
|
32
|
+
"intl-tel-input",
|
|
33
|
+
"libphonenumber-js",
|
|
34
|
+
"e164",
|
|
35
|
+
"country-code",
|
|
36
|
+
"dial-code",
|
|
37
|
+
"separate-dial-code",
|
|
38
|
+
"national-mode",
|
|
39
|
+
"country-flags",
|
|
40
|
+
"i18n",
|
|
41
|
+
"localization",
|
|
42
|
+
"rtl",
|
|
43
|
+
"a11y",
|
|
44
|
+
"ssr",
|
|
45
|
+
"typescript"
|
|
46
|
+
],
|
|
47
|
+
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"@angular/common": ">=17 <21",
|
|
50
|
+
"@angular/core": ">=17 <21",
|
|
51
|
+
"@angular/forms": ">=17 <21",
|
|
52
|
+
"rxjs": ">=7.8.0",
|
|
53
|
+
"intl-tel-input": "^25.3.2",
|
|
54
|
+
"libphonenumber-js": "^1.12.10 || ^1.12.11"
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"tslib": "^2.3.0"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/* ---------- Theme tokens ---------- */
|
|
2
|
+
:host {
|
|
3
|
+
--tel-bg: #fff;
|
|
4
|
+
--tel-fg: #0f172a;
|
|
5
|
+
--tel-border: #c0c0c0;
|
|
6
|
+
--tel-border-hover: #9aa0a6;
|
|
7
|
+
--tel-ring: #2563eb;
|
|
8
|
+
--tel-placeholder: #9ca3af;
|
|
9
|
+
--tel-error: #ef4444;
|
|
10
|
+
--tel-radius: 12px;
|
|
11
|
+
--tel-focus-shadow: 0 0 0 3px rgba(37, 99, 235, .25);
|
|
12
|
+
|
|
13
|
+
--tel-dd-bg: var(--tel-bg);
|
|
14
|
+
--tel-dd-border: var(--tel-border);
|
|
15
|
+
--tel-dd-shadow: 0 24px 60px rgba(0, 0, 0, .18);
|
|
16
|
+
--tel-dd-radius: 12px;
|
|
17
|
+
--tel-dd-item-hover: rgba(37, 99, 235, .08);
|
|
18
|
+
--tel-dd-z: 2000;
|
|
19
|
+
--tel-dd-search-bg: rgba(148, 163, 184, .08);
|
|
20
|
+
|
|
21
|
+
display: block;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host-context(.dark) {
|
|
25
|
+
--tel-bg: #0b0f17;
|
|
26
|
+
--tel-fg: #e5e7eb;
|
|
27
|
+
--tel-border: #334155;
|
|
28
|
+
--tel-border-hover: #475569;
|
|
29
|
+
--tel-ring: #60a5fa;
|
|
30
|
+
--tel-placeholder: #94a3b8;
|
|
31
|
+
|
|
32
|
+
--tel-dd-bg: #0f1521;
|
|
33
|
+
--tel-dd-border: #324056;
|
|
34
|
+
--tel-dd-search-bg: rgba(148, 163, 184, .12);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* ---------- Structure ---------- */
|
|
38
|
+
.ngxsmk-tel {
|
|
39
|
+
width: 100%;
|
|
40
|
+
color: var(--tel-fg);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ngxsmk-tel.disabled {
|
|
44
|
+
opacity: .7;
|
|
45
|
+
cursor: not-allowed;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.ngxsmk-tel__label {
|
|
49
|
+
display: inline-block;
|
|
50
|
+
margin-bottom: 6px;
|
|
51
|
+
font-size: .875rem;
|
|
52
|
+
font-weight: 500;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ngxsmk-tel__wrap {
|
|
56
|
+
position: relative;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ngxsmk-tel-input__wrapper,
|
|
60
|
+
:host ::ng-deep .iti {
|
|
61
|
+
width: 100%;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ngxsmk-tel-input__control {
|
|
65
|
+
width: 100%;
|
|
66
|
+
height: 40px;
|
|
67
|
+
font: inherit;
|
|
68
|
+
color: var(--tel-fg);
|
|
69
|
+
background: var(--tel-bg);
|
|
70
|
+
border: 1px solid var(--tel-border);
|
|
71
|
+
border-radius: var(--tel-radius);
|
|
72
|
+
padding: 10px 40px 10px 12px;
|
|
73
|
+
outline: none;
|
|
74
|
+
transition: border-color .15s, box-shadow .15s, background .15s;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ngxsmk-tel-input__control::placeholder {
|
|
78
|
+
color: var(--tel-placeholder);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ngxsmk-tel-input__control:hover {
|
|
82
|
+
border-color: var(--tel-border-hover);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.ngxsmk-tel-input__control:focus {
|
|
86
|
+
border-color: var(--tel-ring);
|
|
87
|
+
box-shadow: var(--tel-focus-shadow);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Size presets */
|
|
91
|
+
[data-size="sm"] .ngxsmk-tel-input__control {
|
|
92
|
+
height: 34px;
|
|
93
|
+
font-size: 13px;
|
|
94
|
+
padding: 6px 36px 6px 10px;
|
|
95
|
+
border-radius: 10px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
[data-size="lg"] .ngxsmk-tel-input__control {
|
|
99
|
+
height: 46px;
|
|
100
|
+
font-size: 16px;
|
|
101
|
+
padding: 12px 44px 12px 14px;
|
|
102
|
+
border-radius: 14px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* Variants */
|
|
106
|
+
[data-variant="filled"] .ngxsmk-tel-input__control {
|
|
107
|
+
background: rgba(148, 163, 184, .08);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
[data-variant="underline"] .ngxsmk-tel-input__control {
|
|
111
|
+
border: 0;
|
|
112
|
+
border-bottom: 2px solid var(--tel-border);
|
|
113
|
+
border-radius: 0;
|
|
114
|
+
padding-left: 0;
|
|
115
|
+
padding-right: 34px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
[data-variant="underline"] .ngxsmk-tel-input__control:focus {
|
|
119
|
+
border-bottom-color: var(--tel-ring);
|
|
120
|
+
box-shadow: none;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* ---------- intl-tel-input dropdown (deep selectors) ---------- */
|
|
124
|
+
:host ::ng-deep .iti__flag-container {
|
|
125
|
+
border-top-left-radius: var(--tel-radius);
|
|
126
|
+
border-bottom-left-radius: var(--tel-radius);
|
|
127
|
+
border: 1px solid var(--tel-border);
|
|
128
|
+
border-right: none;
|
|
129
|
+
background: var(--tel-bg);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:host ::ng-deep .iti__selected-flag {
|
|
133
|
+
height: 100%;
|
|
134
|
+
padding: 0 10px;
|
|
135
|
+
display: inline-flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
:host ::ng-deep .iti__country-list {
|
|
140
|
+
background: var(--tel-dd-bg);
|
|
141
|
+
border: 1px solid var(--tel-dd-border);
|
|
142
|
+
border-radius: var(--tel-dd-radius);
|
|
143
|
+
box-shadow: var(--tel-dd-shadow);
|
|
144
|
+
max-height: min(50vh, 360px);
|
|
145
|
+
overflow: auto;
|
|
146
|
+
padding: 6px 0;
|
|
147
|
+
width: max(280px, 100%);
|
|
148
|
+
z-index: var(--tel-dd-z);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
:host ::ng-deep .iti--container .iti__country-list {
|
|
152
|
+
z-index: var(--tel-dd-z);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
:host ::ng-deep .iti__search-input {
|
|
156
|
+
position: sticky;
|
|
157
|
+
top: 0;
|
|
158
|
+
margin: 0;
|
|
159
|
+
padding: 10px 12px;
|
|
160
|
+
width: 100%;
|
|
161
|
+
border: 0;
|
|
162
|
+
border-bottom: 1px solid var(--tel-dd-border);
|
|
163
|
+
outline: none;
|
|
164
|
+
background: var(--tel-dd-search-bg);
|
|
165
|
+
color: var(--tel-fg);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:host ::ng-deep .iti__country {
|
|
169
|
+
display: grid;
|
|
170
|
+
grid-template-columns: 28px 1fr auto;
|
|
171
|
+
align-items: center;
|
|
172
|
+
column-gap: .5rem;
|
|
173
|
+
padding: 10px 12px;
|
|
174
|
+
cursor: pointer;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
:host ::ng-deep .iti__dial-code {
|
|
178
|
+
color: var(--tel-placeholder);
|
|
179
|
+
font-weight: 600;
|
|
180
|
+
margin-left: 10px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* Clear button */
|
|
184
|
+
.ngxsmk-tel__clear {
|
|
185
|
+
position: absolute;
|
|
186
|
+
right: 8px;
|
|
187
|
+
top: 50%;
|
|
188
|
+
transform: translateY(-50%);
|
|
189
|
+
border: 0;
|
|
190
|
+
background: transparent;
|
|
191
|
+
font-size: 18px;
|
|
192
|
+
line-height: 1;
|
|
193
|
+
width: 28px;
|
|
194
|
+
height: 28px;
|
|
195
|
+
border-radius: 50%;
|
|
196
|
+
cursor: pointer;
|
|
197
|
+
color: var(--tel-placeholder);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.ngxsmk-tel__clear:hover {
|
|
201
|
+
background: rgba(148, 163, 184, .15);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/* Hint & Error */
|
|
205
|
+
.ngxsmk-tel__hint {
|
|
206
|
+
margin-top: 6px;
|
|
207
|
+
font-size: 12px;
|
|
208
|
+
color: var(--tel-placeholder);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.ngxsmk-tel__error {
|
|
212
|
+
margin-top: 6px;
|
|
213
|
+
font-size: 12px;
|
|
214
|
+
color: var(--tel-error);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.ngxsmk-tel__wrap.has-error .ngxsmk-tel-input__control {
|
|
218
|
+
border-color: var(--tel-error);
|
|
219
|
+
box-shadow: 0 0 0 3px rgba(239, 68, 68, .15);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.ngxsmk-tel.disabled .iti__flag-container,
|
|
223
|
+
.ngxsmk-tel.disabled .iti__selected-flag {
|
|
224
|
+
pointer-events: none;
|
|
225
|
+
opacity: 0.6;
|
|
226
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { PLATFORM_ID } from '@angular/core';
|
|
3
|
+
import { NgxsmkTelInputComponent } from './ngxsmk-tel-input.component';
|
|
4
|
+
|
|
5
|
+
describe('NgxsmkTelInputComponent', () => {
|
|
6
|
+
let component: NgxsmkTelInputComponent;
|
|
7
|
+
let fixture: ComponentFixture<NgxsmkTelInputComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [NgxsmkTelInputComponent],
|
|
12
|
+
// Pretend we're on the server so ngAfterViewInit skips intl-tel-input init
|
|
13
|
+
providers: [{ provide: PLATFORM_ID, useValue: 'server' }],
|
|
14
|
+
}).compileComponents();
|
|
15
|
+
|
|
16
|
+
fixture = TestBed.createComponent(NgxsmkTelInputComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|