@descope/web-components-ui 1.0.212 → 1.0.213
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/dist/cjs/index.cjs.js +3 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +5 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/1000.js +1 -1
- package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
- package/package.json +1 -1
- package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +2 -4
- package/src/mixins/proxyInputMixin.js +3 -0
package/dist/index.esm.js
CHANGED
@@ -966,6 +966,9 @@ const proxyInputMixin =
|
|
966
966
|
// We do not want to show the default validity report tooltip
|
967
967
|
// So we are overriding the reportValidity fn to show the input's error message
|
968
968
|
reportValidity = () => {
|
969
|
+
// we want to update validity so in case the value was set programmatically, we won't get an error
|
970
|
+
this.inputElement.setCustomValidity('');
|
971
|
+
this.setCustomValidity('');
|
969
972
|
if (!this.checkValidity()) {
|
970
973
|
this.setAttribute('invalid', 'true');
|
971
974
|
this.#handleErrorMessage();
|
@@ -4790,7 +4793,7 @@ let PhoneFieldInternal$1 = class PhoneFieldInternal extends BaseInputClass$3 {
|
|
4790
4793
|
|
4791
4794
|
// override combo box setter to display dialCode value in input
|
4792
4795
|
this.countryCodeInput.customValueTransformFn = (val) => {
|
4793
|
-
const [, dialCode] = val
|
4796
|
+
const [, dialCode] = val?.split?.(' ') || [];
|
4794
4797
|
return dialCode;
|
4795
4798
|
};
|
4796
4799
|
}
|
@@ -4862,9 +4865,7 @@ let PhoneFieldInternal$1 = class PhoneFieldInternal extends BaseInputClass$3 {
|
|
4862
4865
|
}
|
4863
4866
|
|
4864
4867
|
getCountryByDialCode(countryDialCode) {
|
4865
|
-
return this.countryCodeInput.items?.find(
|
4866
|
-
(c) => c.getAttribute('data-country-code') === countryDialCode
|
4867
|
-
);
|
4868
|
+
return this.countryCodeInput.items?.find((c) => c.getAttribute('data-id') === countryDialCode);
|
4868
4869
|
}
|
4869
4870
|
|
4870
4871
|
getCountryByCodeId(countryCode) {
|