@intl-tel-input/angular 28.0.2 → 28.0.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/README.md +14 -2
- package/dist/IntlTelInput.d.ts +1 -1
- package/dist/IntlTelInput.js +62 -36
- package/dist/IntlTelInputWithUtils.js +62 -36
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Angular component for intl-tel-input
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
For entering, formatting, and validating international telephone numbers.
|
|
4
4
|
|
|
5
5
|
[Explore docs »](https://intl-tel-input.com/docs/angular-component)
|
|
6
6
|
|
|
@@ -10,6 +10,10 @@ An Angular component for the [intl-tel-input](https://github.com/jackocnr/intl-t
|
|
|
10
10
|
<img width="271" height="279" alt="intl-tel-input screenshot showing country dropdown open" src="https://raw.github.com/jackocnr/intl-tel-input/master/screenshots/iti-github-light.png">
|
|
11
11
|
</picture>
|
|
12
12
|
|
|
13
|
+
## Resources
|
|
14
|
+
|
|
15
|
+
Check out the [website](https://intl-tel-input.com), where you can find [a full set of docs](https://intl-tel-input.com/docs/angular-component), a [live playground](https://intl-tel-input.com/playground/) where you can try out all of the options, as well as plenty of [examples](https://intl-tel-input.com/examples/angular-component/validation) of different setups.
|
|
16
|
+
|
|
13
17
|
## Running the demos locally
|
|
14
18
|
|
|
15
19
|
1. Initialise the submodules: `git submodule update --init --recursive`
|
|
@@ -17,3 +21,11 @@ An Angular component for the [intl-tel-input](https://github.com/jackocnr/intl-t
|
|
|
17
21
|
3. Build: `npm run build`
|
|
18
22
|
|
|
19
23
|
You can then open `packages/angular/demo/validation/index.html` in your browser to try the validation demo. View the full list of [available demos](https://github.com/jackocnr/intl-tel-input/tree/master/packages/angular/demo).
|
|
24
|
+
|
|
25
|
+
## Issues and contributing
|
|
26
|
+
|
|
27
|
+
Please report issues and open pull requests on the [main repository](https://github.com/jackocnr/intl-tel-input).
|
|
28
|
+
|
|
29
|
+
## License
|
|
30
|
+
|
|
31
|
+
MIT
|
package/dist/IntlTelInput.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ declare class IntlTelInput implements AfterViewInit, OnDestroy, OnChanges, Contr
|
|
|
63
63
|
click: EventEmitter<MouseEvent>;
|
|
64
64
|
private iti?;
|
|
65
65
|
private appliedInputAttrKeys;
|
|
66
|
-
private
|
|
66
|
+
private libraryInputClasses;
|
|
67
67
|
private lastEmittedNumber?;
|
|
68
68
|
private lastEmittedCountry?;
|
|
69
69
|
private lastEmittedValidity?;
|
package/dist/IntlTelInput.js
CHANGED
|
@@ -1965,7 +1965,7 @@ var defaults = {
|
|
|
1965
1965
|
//* A function to load the utils script.
|
|
1966
1966
|
loadUtils: null,
|
|
1967
1967
|
//* National vs international formatting for numbers e.g. placeholders and displaying existing numbers.
|
|
1968
|
-
nationalMode:
|
|
1968
|
+
nationalMode: false,
|
|
1969
1969
|
//* Display only these countries.
|
|
1970
1970
|
onlyCountries: null,
|
|
1971
1971
|
//* Number type to use for placeholders.
|
|
@@ -2250,31 +2250,50 @@ var createEl = (tagName, attrs, container) => {
|
|
|
2250
2250
|
};
|
|
2251
2251
|
|
|
2252
2252
|
// packages/core/src/js/core/icons.ts
|
|
2253
|
-
var
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2253
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
2254
|
+
var buildSvg = ([tag, attrs, children]) => {
|
|
2255
|
+
const el = document.createElementNS(SVG_NS, tag);
|
|
2256
|
+
if (attrs) {
|
|
2257
|
+
for (const k in attrs) {
|
|
2258
|
+
el.setAttribute(k, String(attrs[k]));
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
if (children) {
|
|
2262
|
+
for (const c of children) {
|
|
2263
|
+
el.appendChild(buildSvg(c));
|
|
2264
|
+
}
|
|
2265
|
+
}
|
|
2266
|
+
return el;
|
|
2267
|
+
};
|
|
2268
|
+
var buildSearchIcon = () => buildSvg(
|
|
2269
|
+
["svg", { class: "iti__search-icon-svg", width: 14, height: 14, viewBox: "0 0 24 24", focusable: "false", [ARIA.HIDDEN]: "true" }, [
|
|
2270
|
+
["circle", { cx: 11, cy: 11, r: 7 }],
|
|
2271
|
+
["line", { x1: 21, y1: 21, x2: 16.65, y2: 16.65 }]
|
|
2272
|
+
]]
|
|
2273
|
+
);
|
|
2258
2274
|
var buildClearIcon = (id) => {
|
|
2259
2275
|
const maskId = `iti-${id}-clear-mask`;
|
|
2260
|
-
return
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2276
|
+
return buildSvg(
|
|
2277
|
+
["svg", { class: "iti__search-clear-svg", width: 12, height: 12, viewBox: "0 0 16 16", [ARIA.HIDDEN]: "true", focusable: "false" }, [
|
|
2278
|
+
["mask", { id: maskId, maskUnits: "userSpaceOnUse" }, [
|
|
2279
|
+
["rect", { width: 16, height: 16, fill: "white" }],
|
|
2280
|
+
["path", { d: "M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8", stroke: "black", "stroke-linecap": "round", class: "iti__search-clear-x" }]
|
|
2281
|
+
]],
|
|
2282
|
+
["circle", { cx: 8, cy: 8, r: 8, class: "iti__search-clear-bg", mask: `url(#${maskId})` }]
|
|
2283
|
+
]]
|
|
2284
|
+
);
|
|
2268
2285
|
};
|
|
2269
|
-
var buildCheckIcon = () =>
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2286
|
+
var buildCheckIcon = () => buildSvg(
|
|
2287
|
+
["svg", { class: "iti__country-check-svg", width: 14, height: 14, viewBox: "0 0 16 16", fill: "currentColor", focusable: "false", [ARIA.HIDDEN]: "true" }, [
|
|
2288
|
+
["path", { d: "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z" }]
|
|
2289
|
+
]]
|
|
2290
|
+
);
|
|
2291
|
+
var buildGlobeIcon = () => buildSvg(
|
|
2292
|
+
["svg", { width: 256, height: 256, viewBox: "0 0 512 512", class: "iti__globe-svg" }, [
|
|
2293
|
+
["path", { d: "M508 213a240 240 0 0 0-449-87l-2 5-2 5c-8 14-13 30-17 46a65 65 0 0 1 56 4c16-10 35-19 56-27l9-3c-6 23-10 48-10 74h-16l4 6c3 4 5 8 6 13h6c0 22 3 44 8 65l2 10-25-10-4 5 12 18 9 3 6 2 8 3 9 26 1 2 16-7h1l-5-13-1-2c24 6 49 9 75 10v26l11 10 7 7v-30l1-13c22 0 44-3 65-8l10-2-21 48-1 1a317 317 0 0 1-14 23l-21 5h-2c6 16 7 33 1 50a240 240 0 0 0 211-265m-401-56-11 6c19-44 54-79 98-98-11 20-21 44-29 69-21 6-40 15-58 23m154 182v4c-29-1-57-6-81-13-7-25-12-52-13-81h94zm0-109h-94c1-29 6-56 13-81 24-7 52-12 81-13zm0-112c-22 1-44 4-65 8l-10 2 12-30 9-17 1-2a332 332 0 0 1 13-23c13-4 26-6 40-7zm187 69 6 4c4 12 6 25 6 38v1h-68c-1-26-4-51-10-74l48 20 1 1 14 8zm-14-44 10 20c-20-11-43-21-68-29-8-25-18-49-29-69 37 16 67 44 87 78M279 49h1c13 1 27 3 39 7l14 23 1 2a343 343 0 0 1 12 26l2 5 6 16c-23-6-48-9-74-10h-1zm0 87h1c29 1 56 6 81 13 7 24 12 51 12 80v1h-94zm2 207h-2v-94h95c-1 29-6 56-13 81-24 7-51 12-80 13m86 60-20 10c11-20 21-43 29-68 25-8 48-18 68-29-16 37-43 67-77 87m87-115-7 5-16 9-2 1a337 337 0 0 1-47 21c6-24 9-49 10-75h68c0 13-2 27-6 39" }],
|
|
2294
|
+
["path", { d: "m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40" }]
|
|
2295
|
+
]]
|
|
2296
|
+
);
|
|
2278
2297
|
|
|
2279
2298
|
// packages/core/src/js/core/countrySearch.ts
|
|
2280
2299
|
var buildSearchTokens = (countries) => {
|
|
@@ -2627,7 +2646,7 @@ var UI = class _UI {
|
|
|
2627
2646
|
},
|
|
2628
2647
|
searchWrapper
|
|
2629
2648
|
);
|
|
2630
|
-
this.#searchIconEl.
|
|
2649
|
+
this.#searchIconEl.appendChild(buildSearchIcon());
|
|
2631
2650
|
this.#searchInputEl = createEl(
|
|
2632
2651
|
"input",
|
|
2633
2652
|
{
|
|
@@ -2656,7 +2675,7 @@ var UI = class _UI {
|
|
|
2656
2675
|
},
|
|
2657
2676
|
searchWrapper
|
|
2658
2677
|
);
|
|
2659
|
-
this.#searchClearButtonEl.
|
|
2678
|
+
this.#searchClearButtonEl.appendChild(buildClearIcon(this.#id));
|
|
2660
2679
|
this.#searchResultsLiveRegionEl = createEl(
|
|
2661
2680
|
"span",
|
|
2662
2681
|
{ class: "iti__a11y-text" },
|
|
@@ -3156,7 +3175,7 @@ var UI = class _UI {
|
|
|
3156
3175
|
{ class: "iti__country-check", [ARIA.HIDDEN]: "true" },
|
|
3157
3176
|
newListItem
|
|
3158
3177
|
);
|
|
3159
|
-
checkIcon.
|
|
3178
|
+
checkIcon.appendChild(buildCheckIcon());
|
|
3160
3179
|
this.#selectedListItemEl = newListItem;
|
|
3161
3180
|
if (this.#options.dropdownAlwaysOpen) {
|
|
3162
3181
|
this.#highlightListItem(newListItem);
|
|
@@ -3301,20 +3320,27 @@ var UI = class _UI {
|
|
|
3301
3320
|
}
|
|
3302
3321
|
if (this.#selectedCountryEl) {
|
|
3303
3322
|
const flagClass = iso2 && showFlags ? `${CLASSES.FLAG} iti__${iso2}` : `${CLASSES.FLAG} ${CLASSES.GLOBE}`;
|
|
3304
|
-
let ariaLabel, title
|
|
3323
|
+
let ariaLabel, title;
|
|
3324
|
+
let flagContent = null;
|
|
3305
3325
|
if (iso2) {
|
|
3306
3326
|
title = name;
|
|
3307
3327
|
ariaLabel = i18n.selectedCountryAriaLabel.replace("${countryName}", name).replace("${dialCode}", `+${dialCode}`);
|
|
3308
|
-
|
|
3328
|
+
if (!showFlags) {
|
|
3329
|
+
flagContent = buildGlobeIcon();
|
|
3330
|
+
}
|
|
3309
3331
|
} else {
|
|
3310
3332
|
title = i18n.noCountrySelected;
|
|
3311
3333
|
ariaLabel = i18n.noCountrySelected;
|
|
3312
|
-
|
|
3334
|
+
flagContent = buildGlobeIcon();
|
|
3313
3335
|
}
|
|
3314
3336
|
this.#selectedFlagEl.className = flagClass;
|
|
3315
3337
|
this.#selectedCountryEl.setAttribute("title", title);
|
|
3316
3338
|
this.#selectedCountryEl.setAttribute(ARIA.LABEL, ariaLabel);
|
|
3317
|
-
|
|
3339
|
+
if (flagContent) {
|
|
3340
|
+
this.#selectedFlagEl.replaceChildren(flagContent);
|
|
3341
|
+
} else {
|
|
3342
|
+
this.#selectedFlagEl.replaceChildren();
|
|
3343
|
+
}
|
|
3318
3344
|
}
|
|
3319
3345
|
if (separateDialCode) {
|
|
3320
3346
|
const fullDialCode = dialCode ? `+${dialCode}` : "";
|
|
@@ -4633,7 +4659,7 @@ var intlTelInput = Object.assign(
|
|
|
4633
4659
|
attachUtils,
|
|
4634
4660
|
startedLoadingUtils: false,
|
|
4635
4661
|
startedLoadingAutoCountry: false,
|
|
4636
|
-
version: "28.0.
|
|
4662
|
+
version: "28.0.4",
|
|
4637
4663
|
NUMBER_FORMAT,
|
|
4638
4664
|
NUMBER_TYPE,
|
|
4639
4665
|
VALIDATION_ERROR
|
|
@@ -4657,7 +4683,7 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
4657
4683
|
inputAttributes = {};
|
|
4658
4684
|
disabled = false;
|
|
4659
4685
|
readonly = false;
|
|
4660
|
-
//
|
|
4686
|
+
// Library initialisation options (one @Input per option)
|
|
4661
4687
|
allowDropdown;
|
|
4662
4688
|
allowedNumberTypes;
|
|
4663
4689
|
allowNumberExtensions;
|
|
@@ -4704,8 +4730,8 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
4704
4730
|
click = new EventEmitter();
|
|
4705
4731
|
iti;
|
|
4706
4732
|
appliedInputAttrKeys = /* @__PURE__ */ new Set();
|
|
4707
|
-
// Classes the
|
|
4708
|
-
|
|
4733
|
+
// Classes the library adds directly to the input (e.g. iti__tel-input)
|
|
4734
|
+
libraryInputClasses = "";
|
|
4709
4735
|
lastEmittedNumber;
|
|
4710
4736
|
lastEmittedCountry;
|
|
4711
4737
|
lastEmittedValidity;
|
|
@@ -4730,7 +4756,7 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
4730
4756
|
};
|
|
4731
4757
|
ngAfterViewInit() {
|
|
4732
4758
|
this.iti = intlTelInput_default(this.inputRef.nativeElement, this.buildInitOptions());
|
|
4733
|
-
this.
|
|
4759
|
+
this.libraryInputClasses = this.inputRef.nativeElement.className;
|
|
4734
4760
|
this.inputRef.nativeElement.addEventListener("open:countrydropdown", this.handleOpenDropdown);
|
|
4735
4761
|
this.inputRef.nativeElement.addEventListener("close:countrydropdown", this.handleCloseDropdown);
|
|
4736
4762
|
this.inputRef.nativeElement.addEventListener("strict:reject", this.handleStrictReject);
|
|
@@ -4896,7 +4922,7 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
4896
4922
|
warnInputAttr(key);
|
|
4897
4923
|
} else {
|
|
4898
4924
|
currentKeys.add(key);
|
|
4899
|
-
const next = key === "class" && this.
|
|
4925
|
+
const next = key === "class" && this.libraryInputClasses ? `${this.libraryInputClasses} ${value}` : value;
|
|
4900
4926
|
this.inputRef.nativeElement.setAttribute(key, next);
|
|
4901
4927
|
}
|
|
4902
4928
|
});
|
|
@@ -1965,7 +1965,7 @@ var defaults = {
|
|
|
1965
1965
|
//* A function to load the utils script.
|
|
1966
1966
|
loadUtils: null,
|
|
1967
1967
|
//* National vs international formatting for numbers e.g. placeholders and displaying existing numbers.
|
|
1968
|
-
nationalMode:
|
|
1968
|
+
nationalMode: false,
|
|
1969
1969
|
//* Display only these countries.
|
|
1970
1970
|
onlyCountries: null,
|
|
1971
1971
|
//* Number type to use for placeholders.
|
|
@@ -2250,31 +2250,50 @@ var createEl = (tagName, attrs, container) => {
|
|
|
2250
2250
|
};
|
|
2251
2251
|
|
|
2252
2252
|
// packages/core/src/js/core/icons.ts
|
|
2253
|
-
var
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2253
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
2254
|
+
var buildSvg = ([tag, attrs, children]) => {
|
|
2255
|
+
const el = document.createElementNS(SVG_NS, tag);
|
|
2256
|
+
if (attrs) {
|
|
2257
|
+
for (const k in attrs) {
|
|
2258
|
+
el.setAttribute(k, String(attrs[k]));
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
if (children) {
|
|
2262
|
+
for (const c of children) {
|
|
2263
|
+
el.appendChild(buildSvg(c));
|
|
2264
|
+
}
|
|
2265
|
+
}
|
|
2266
|
+
return el;
|
|
2267
|
+
};
|
|
2268
|
+
var buildSearchIcon = () => buildSvg(
|
|
2269
|
+
["svg", { class: "iti__search-icon-svg", width: 14, height: 14, viewBox: "0 0 24 24", focusable: "false", [ARIA.HIDDEN]: "true" }, [
|
|
2270
|
+
["circle", { cx: 11, cy: 11, r: 7 }],
|
|
2271
|
+
["line", { x1: 21, y1: 21, x2: 16.65, y2: 16.65 }]
|
|
2272
|
+
]]
|
|
2273
|
+
);
|
|
2258
2274
|
var buildClearIcon = (id) => {
|
|
2259
2275
|
const maskId = `iti-${id}-clear-mask`;
|
|
2260
|
-
return
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2276
|
+
return buildSvg(
|
|
2277
|
+
["svg", { class: "iti__search-clear-svg", width: 12, height: 12, viewBox: "0 0 16 16", [ARIA.HIDDEN]: "true", focusable: "false" }, [
|
|
2278
|
+
["mask", { id: maskId, maskUnits: "userSpaceOnUse" }, [
|
|
2279
|
+
["rect", { width: 16, height: 16, fill: "white" }],
|
|
2280
|
+
["path", { d: "M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8", stroke: "black", "stroke-linecap": "round", class: "iti__search-clear-x" }]
|
|
2281
|
+
]],
|
|
2282
|
+
["circle", { cx: 8, cy: 8, r: 8, class: "iti__search-clear-bg", mask: `url(#${maskId})` }]
|
|
2283
|
+
]]
|
|
2284
|
+
);
|
|
2268
2285
|
};
|
|
2269
|
-
var buildCheckIcon = () =>
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2286
|
+
var buildCheckIcon = () => buildSvg(
|
|
2287
|
+
["svg", { class: "iti__country-check-svg", width: 14, height: 14, viewBox: "0 0 16 16", fill: "currentColor", focusable: "false", [ARIA.HIDDEN]: "true" }, [
|
|
2288
|
+
["path", { d: "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z" }]
|
|
2289
|
+
]]
|
|
2290
|
+
);
|
|
2291
|
+
var buildGlobeIcon = () => buildSvg(
|
|
2292
|
+
["svg", { width: 256, height: 256, viewBox: "0 0 512 512", class: "iti__globe-svg" }, [
|
|
2293
|
+
["path", { d: "M508 213a240 240 0 0 0-449-87l-2 5-2 5c-8 14-13 30-17 46a65 65 0 0 1 56 4c16-10 35-19 56-27l9-3c-6 23-10 48-10 74h-16l4 6c3 4 5 8 6 13h6c0 22 3 44 8 65l2 10-25-10-4 5 12 18 9 3 6 2 8 3 9 26 1 2 16-7h1l-5-13-1-2c24 6 49 9 75 10v26l11 10 7 7v-30l1-13c22 0 44-3 65-8l10-2-21 48-1 1a317 317 0 0 1-14 23l-21 5h-2c6 16 7 33 1 50a240 240 0 0 0 211-265m-401-56-11 6c19-44 54-79 98-98-11 20-21 44-29 69-21 6-40 15-58 23m154 182v4c-29-1-57-6-81-13-7-25-12-52-13-81h94zm0-109h-94c1-29 6-56 13-81 24-7 52-12 81-13zm0-112c-22 1-44 4-65 8l-10 2 12-30 9-17 1-2a332 332 0 0 1 13-23c13-4 26-6 40-7zm187 69 6 4c4 12 6 25 6 38v1h-68c-1-26-4-51-10-74l48 20 1 1 14 8zm-14-44 10 20c-20-11-43-21-68-29-8-25-18-49-29-69 37 16 67 44 87 78M279 49h1c13 1 27 3 39 7l14 23 1 2a343 343 0 0 1 12 26l2 5 6 16c-23-6-48-9-74-10h-1zm0 87h1c29 1 56 6 81 13 7 24 12 51 12 80v1h-94zm2 207h-2v-94h95c-1 29-6 56-13 81-24 7-51 12-80 13m86 60-20 10c11-20 21-43 29-68 25-8 48-18 68-29-16 37-43 67-77 87m87-115-7 5-16 9-2 1a337 337 0 0 1-47 21c6-24 9-49 10-75h68c0 13-2 27-6 39" }],
|
|
2294
|
+
["path", { d: "m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40" }]
|
|
2295
|
+
]]
|
|
2296
|
+
);
|
|
2278
2297
|
|
|
2279
2298
|
// packages/core/src/js/core/countrySearch.ts
|
|
2280
2299
|
var buildSearchTokens = (countries) => {
|
|
@@ -2627,7 +2646,7 @@ var UI = class _UI {
|
|
|
2627
2646
|
},
|
|
2628
2647
|
searchWrapper
|
|
2629
2648
|
);
|
|
2630
|
-
this.#searchIconEl.
|
|
2649
|
+
this.#searchIconEl.appendChild(buildSearchIcon());
|
|
2631
2650
|
this.#searchInputEl = createEl(
|
|
2632
2651
|
"input",
|
|
2633
2652
|
{
|
|
@@ -2656,7 +2675,7 @@ var UI = class _UI {
|
|
|
2656
2675
|
},
|
|
2657
2676
|
searchWrapper
|
|
2658
2677
|
);
|
|
2659
|
-
this.#searchClearButtonEl.
|
|
2678
|
+
this.#searchClearButtonEl.appendChild(buildClearIcon(this.#id));
|
|
2660
2679
|
this.#searchResultsLiveRegionEl = createEl(
|
|
2661
2680
|
"span",
|
|
2662
2681
|
{ class: "iti__a11y-text" },
|
|
@@ -3156,7 +3175,7 @@ var UI = class _UI {
|
|
|
3156
3175
|
{ class: "iti__country-check", [ARIA.HIDDEN]: "true" },
|
|
3157
3176
|
newListItem
|
|
3158
3177
|
);
|
|
3159
|
-
checkIcon.
|
|
3178
|
+
checkIcon.appendChild(buildCheckIcon());
|
|
3160
3179
|
this.#selectedListItemEl = newListItem;
|
|
3161
3180
|
if (this.#options.dropdownAlwaysOpen) {
|
|
3162
3181
|
this.#highlightListItem(newListItem);
|
|
@@ -3301,20 +3320,27 @@ var UI = class _UI {
|
|
|
3301
3320
|
}
|
|
3302
3321
|
if (this.#selectedCountryEl) {
|
|
3303
3322
|
const flagClass = iso2 && showFlags ? `${CLASSES.FLAG} iti__${iso2}` : `${CLASSES.FLAG} ${CLASSES.GLOBE}`;
|
|
3304
|
-
let ariaLabel, title
|
|
3323
|
+
let ariaLabel, title;
|
|
3324
|
+
let flagContent = null;
|
|
3305
3325
|
if (iso2) {
|
|
3306
3326
|
title = name;
|
|
3307
3327
|
ariaLabel = i18n.selectedCountryAriaLabel.replace("${countryName}", name).replace("${dialCode}", `+${dialCode}`);
|
|
3308
|
-
|
|
3328
|
+
if (!showFlags) {
|
|
3329
|
+
flagContent = buildGlobeIcon();
|
|
3330
|
+
}
|
|
3309
3331
|
} else {
|
|
3310
3332
|
title = i18n.noCountrySelected;
|
|
3311
3333
|
ariaLabel = i18n.noCountrySelected;
|
|
3312
|
-
|
|
3334
|
+
flagContent = buildGlobeIcon();
|
|
3313
3335
|
}
|
|
3314
3336
|
this.#selectedFlagEl.className = flagClass;
|
|
3315
3337
|
this.#selectedCountryEl.setAttribute("title", title);
|
|
3316
3338
|
this.#selectedCountryEl.setAttribute(ARIA.LABEL, ariaLabel);
|
|
3317
|
-
|
|
3339
|
+
if (flagContent) {
|
|
3340
|
+
this.#selectedFlagEl.replaceChildren(flagContent);
|
|
3341
|
+
} else {
|
|
3342
|
+
this.#selectedFlagEl.replaceChildren();
|
|
3343
|
+
}
|
|
3318
3344
|
}
|
|
3319
3345
|
if (separateDialCode) {
|
|
3320
3346
|
const fullDialCode = dialCode ? `+${dialCode}` : "";
|
|
@@ -4633,7 +4659,7 @@ var intlTelInput = Object.assign(
|
|
|
4633
4659
|
attachUtils,
|
|
4634
4660
|
startedLoadingUtils: false,
|
|
4635
4661
|
startedLoadingAutoCountry: false,
|
|
4636
|
-
version: "28.0.
|
|
4662
|
+
version: "28.0.4",
|
|
4637
4663
|
NUMBER_FORMAT,
|
|
4638
4664
|
NUMBER_TYPE,
|
|
4639
4665
|
VALIDATION_ERROR
|
|
@@ -11011,7 +11037,7 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
11011
11037
|
inputAttributes = {};
|
|
11012
11038
|
disabled = false;
|
|
11013
11039
|
readonly = false;
|
|
11014
|
-
//
|
|
11040
|
+
// Library initialisation options (one @Input per option)
|
|
11015
11041
|
allowDropdown;
|
|
11016
11042
|
allowedNumberTypes;
|
|
11017
11043
|
allowNumberExtensions;
|
|
@@ -11058,8 +11084,8 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
11058
11084
|
click = new EventEmitter();
|
|
11059
11085
|
iti;
|
|
11060
11086
|
appliedInputAttrKeys = /* @__PURE__ */ new Set();
|
|
11061
|
-
// Classes the
|
|
11062
|
-
|
|
11087
|
+
// Classes the library adds directly to the input (e.g. iti__tel-input)
|
|
11088
|
+
libraryInputClasses = "";
|
|
11063
11089
|
lastEmittedNumber;
|
|
11064
11090
|
lastEmittedCountry;
|
|
11065
11091
|
lastEmittedValidity;
|
|
@@ -11084,7 +11110,7 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
11084
11110
|
};
|
|
11085
11111
|
ngAfterViewInit() {
|
|
11086
11112
|
this.iti = intlTelInput_default(this.inputRef.nativeElement, this.buildInitOptions());
|
|
11087
|
-
this.
|
|
11113
|
+
this.libraryInputClasses = this.inputRef.nativeElement.className;
|
|
11088
11114
|
this.inputRef.nativeElement.addEventListener("open:countrydropdown", this.handleOpenDropdown);
|
|
11089
11115
|
this.inputRef.nativeElement.addEventListener("close:countrydropdown", this.handleCloseDropdown);
|
|
11090
11116
|
this.inputRef.nativeElement.addEventListener("strict:reject", this.handleStrictReject);
|
|
@@ -11250,7 +11276,7 @@ var IntlTelInput = class _IntlTelInput {
|
|
|
11250
11276
|
warnInputAttr(key);
|
|
11251
11277
|
} else {
|
|
11252
11278
|
currentKeys.add(key);
|
|
11253
|
-
const next = key === "class" && this.
|
|
11279
|
+
const next = key === "class" && this.libraryInputClasses ? `${this.libraryInputClasses} ${value}` : value;
|
|
11254
11280
|
this.inputRef.nativeElement.setAttribute(key, next);
|
|
11255
11281
|
}
|
|
11256
11282
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intl-tel-input/angular",
|
|
3
|
-
"version": "28.0.
|
|
4
|
-
"description": "An Angular component for
|
|
3
|
+
"version": "28.0.4",
|
|
4
|
+
"description": "An Angular component for intl-tel-input, for entering, formatting, and validating international telephone numbers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Jack O'Connor (http://jackocnr.com)",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"README.md"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"intl-tel-input": "^28.0.
|
|
37
|
+
"intl-tel-input": "^28.0.4"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@angular/common": ">=17",
|