ui-core-abv 0.3.28 → 0.3.29
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/fesm2022/ui-core-abv.mjs
CHANGED
|
@@ -1841,6 +1841,8 @@ class UicPhoneInputComponent extends base$1 {
|
|
|
1841
1841
|
selectedCountry;
|
|
1842
1842
|
filteredCountries = [];
|
|
1843
1843
|
dropdownId = `phone-dropdown-${Math.random().toString(36).slice(2, 8)}`;
|
|
1844
|
+
pendingNormalizedValue = null;
|
|
1845
|
+
changeRegistered = false;
|
|
1844
1846
|
_countries = PHONE_COUNTRIES;
|
|
1845
1847
|
host = inject((ElementRef));
|
|
1846
1848
|
overlay = inject(Overlay);
|
|
@@ -1868,6 +1870,7 @@ class UicPhoneInputComponent extends base$1 {
|
|
|
1868
1870
|
}
|
|
1869
1871
|
writeValue(value) {
|
|
1870
1872
|
const normalizedValue = typeof value === 'string' ? this.parseStringValue(value) : value;
|
|
1873
|
+
this.pendingNormalizedValue = typeof value === 'string' ? normalizedValue : null;
|
|
1871
1874
|
super.writeValue(normalizedValue);
|
|
1872
1875
|
if (!normalizedValue) {
|
|
1873
1876
|
this.phoneNumber = '';
|
|
@@ -1882,6 +1885,14 @@ class UicPhoneInputComponent extends base$1 {
|
|
|
1882
1885
|
this.propagateNormalizedValue(normalizedValue);
|
|
1883
1886
|
}
|
|
1884
1887
|
}
|
|
1888
|
+
registerOnChange(fn) {
|
|
1889
|
+
super.registerOnChange(fn);
|
|
1890
|
+
this.changeRegistered = true;
|
|
1891
|
+
if (this.pendingNormalizedValue) {
|
|
1892
|
+
this.onChange(this.pendingNormalizedValue);
|
|
1893
|
+
this.pendingNormalizedValue = null;
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1885
1896
|
toggleDropdown() {
|
|
1886
1897
|
if (this.disabled || this.loading)
|
|
1887
1898
|
return;
|
|
@@ -2029,9 +2040,17 @@ class UicPhoneInputComponent extends base$1 {
|
|
|
2029
2040
|
}, undefined);
|
|
2030
2041
|
}
|
|
2031
2042
|
propagateNormalizedValue(value) {
|
|
2043
|
+
if (typeof value === 'string')
|
|
2044
|
+
return;
|
|
2032
2045
|
this.value = value;
|
|
2033
2046
|
this.valueChange.emit(value);
|
|
2034
|
-
this.
|
|
2047
|
+
if (this.changeRegistered) {
|
|
2048
|
+
this.onChange(value);
|
|
2049
|
+
this.pendingNormalizedValue = null;
|
|
2050
|
+
}
|
|
2051
|
+
else {
|
|
2052
|
+
this.pendingNormalizedValue = value;
|
|
2053
|
+
}
|
|
2035
2054
|
}
|
|
2036
2055
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicPhoneInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2037
2056
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicPhoneInputComponent, isStandalone: true, selector: "ui-phone-input", inputs: { icon: "icon", iconColor: "iconColor", internalIcon: "internalIcon", internalIconColor: "internalIconColor", size: "size", label: "label", error: "error", tip: "tip", placeholder: "placeholder", disabled: "disabled", loading: "loading", preferredCountries: "preferredCountries", flagPath: "flagPath", countries: "countries" }, providers: [
|