@descope/web-components-ui 1.0.403 → 1.0.405
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 +41 -22
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +41 -22
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/descope-hybrid-field-index-js.js +1 -1
- package/package.json +1 -1
- package/src/components/descope-hybrid-field/HybridFieldClass.js +41 -22
- package/src/index.d.ts +2 -1
package/dist/cjs/index.cjs.js
CHANGED
@@ -16853,8 +16853,6 @@ const componentName$2 = getComponentName('hybrid-field');
|
|
16853
16853
|
|
16854
16854
|
const attrs = {
|
16855
16855
|
shared: [
|
16856
|
-
'label',
|
16857
|
-
'placeholder',
|
16858
16856
|
'bordered',
|
16859
16857
|
'full-width',
|
16860
16858
|
'label-type',
|
@@ -16865,12 +16863,15 @@ const attrs = {
|
|
16865
16863
|
'st-host-direction',
|
16866
16864
|
],
|
16867
16865
|
email: [
|
16866
|
+
'label',
|
16867
|
+
'placeholder',
|
16868
16868
|
'data-errormessage-value-missing-email',
|
16869
16869
|
'data-errormessage-pattern-mismatch-email',
|
16870
16870
|
'external-input',
|
16871
16871
|
],
|
16872
16872
|
phone: {
|
16873
16873
|
countryCode: [
|
16874
|
+
'phone-input-label',
|
16874
16875
|
'country-input-label',
|
16875
16876
|
'country-input-placeholder',
|
16876
16877
|
'restrict-countries',
|
@@ -16879,6 +16880,7 @@ const attrs = {
|
|
16879
16880
|
'data-errormessage-value-missing-phone',
|
16880
16881
|
],
|
16881
16882
|
inputBox: [
|
16883
|
+
'label',
|
16882
16884
|
'restrict-countries',
|
16883
16885
|
'default-code',
|
16884
16886
|
'phone-minlength',
|
@@ -16893,7 +16895,7 @@ const attrMap = {
|
|
16893
16895
|
'data-errormessage-pattern-mismatch-email': 'data-errormessage-pattern-mismatch',
|
16894
16896
|
},
|
16895
16897
|
phone: {
|
16896
|
-
|
16898
|
+
'phone-input-label': 'label',
|
16897
16899
|
'phone-minlength': 'minlength',
|
16898
16900
|
'data-errormessage-value-missing-phone': 'data-errormessage-value-missing',
|
16899
16901
|
},
|
@@ -16926,7 +16928,7 @@ class RawHybridField extends BaseClass$1 {
|
|
16926
16928
|
}
|
16927
16929
|
.wrapper {
|
16928
16930
|
display: grid;
|
16929
|
-
|
16931
|
+
width: 100%;
|
16930
16932
|
}
|
16931
16933
|
descope-email-field,
|
16932
16934
|
descope-phone-field,
|
@@ -16981,11 +16983,29 @@ class RawHybridField extends BaseClass$1 {
|
|
16981
16983
|
this.activeInput.value = val;
|
16982
16984
|
}
|
16983
16985
|
|
16984
|
-
init() {
|
16986
|
+
async init() {
|
16985
16987
|
super.init?.();
|
16988
|
+
|
16986
16989
|
this.initInputs();
|
16987
16990
|
this.updateAttrs();
|
16988
16991
|
this.toggleInputVisibility();
|
16992
|
+
|
16993
|
+
await this.waitForInputs();
|
16994
|
+
|
16995
|
+
this.initInputEles();
|
16996
|
+
this.overrideEmailInputType();
|
16997
|
+
this.overrideEmailSetAttribute();
|
16998
|
+
}
|
16999
|
+
|
17000
|
+
waitForInputs() {
|
17001
|
+
return new Promise((resolve) => {
|
17002
|
+
const check = setInterval(() => {
|
17003
|
+
if (this.emailInputEle) {
|
17004
|
+
clearInterval(check);
|
17005
|
+
resolve();
|
17006
|
+
}
|
17007
|
+
});
|
17008
|
+
});
|
16989
17009
|
}
|
16990
17010
|
|
16991
17011
|
initInputs() {
|
@@ -16996,19 +17016,6 @@ class RawHybridField extends BaseClass$1 {
|
|
16996
17016
|
this.inputs = [this.emailInput, this.phoneCountryCodeInput, this.phoneInputBoxInput];
|
16997
17017
|
|
16998
17018
|
this.activeInput = this.emailInput;
|
16999
|
-
|
17000
|
-
this.initInputEles();
|
17001
|
-
this.overrideEmailInputType();
|
17002
|
-
|
17003
|
-
// We want to prevent Vaadin from changing the input type to `email`
|
17004
|
-
// otherwise, we cannot get the selectionStart from the input.
|
17005
|
-
const origEmailSetAttr = this.emailInput.setAttribute.bind(this.emailInputEle);
|
17006
|
-
this.emailInputEle.setAttribute = (name, value) => {
|
17007
|
-
if (name !== 'type' || value !== 'email' || !this.emailInput.hasAttribute('focused')) {
|
17008
|
-
return origEmailSetAttr(name, value);
|
17009
|
-
}
|
17010
|
-
return false;
|
17011
|
-
};
|
17012
17019
|
}
|
17013
17020
|
|
17014
17021
|
// we need to listen on the inner `input` element itself, otherwise we don't always get an `input` event
|
@@ -17020,7 +17027,7 @@ class RawHybridField extends BaseClass$1 {
|
|
17020
17027
|
];
|
17021
17028
|
|
17022
17029
|
inputEles.forEach((ele) => {
|
17023
|
-
ele
|
17030
|
+
ele.addEventListener('input', this.onValueChange.bind(this));
|
17024
17031
|
});
|
17025
17032
|
}
|
17026
17033
|
|
@@ -17030,14 +17037,24 @@ class RawHybridField extends BaseClass$1 {
|
|
17030
17037
|
});
|
17031
17038
|
this.emailInputEle.addEventListener('blur', () => {
|
17032
17039
|
setTimeout(() => {
|
17033
|
-
this.emailInputEle
|
17040
|
+
this.emailInputEle.setAttribute('type', 'email');
|
17034
17041
|
});
|
17035
17042
|
});
|
17036
17043
|
}
|
17037
17044
|
|
17038
|
-
|
17039
|
-
|
17045
|
+
// We want to prevent Vaadin from changing the input type to `email`
|
17046
|
+
// otherwise, we cannot get the selectionStart from the input.
|
17047
|
+
overrideEmailSetAttribute() {
|
17048
|
+
const origEmailSetAttr = this.emailInput.setAttribute.bind(this.emailInputEle);
|
17049
|
+
this.emailInputEle.setAttribute = (name, value) => {
|
17050
|
+
if (name !== 'type' || value !== 'email' || !this.emailInput.hasAttribute('focused')) {
|
17051
|
+
return origEmailSetAttr(name, value);
|
17052
|
+
}
|
17053
|
+
return false;
|
17054
|
+
};
|
17055
|
+
}
|
17040
17056
|
|
17057
|
+
updateAttrs() {
|
17041
17058
|
forwardAttrs(this, this.emailInput, { includeAttrs: attrs.email, mapAttrs: attrMap.email });
|
17042
17059
|
|
17043
17060
|
forwardAttrs(this, this.phoneCountryCodeInput, {
|
@@ -17050,6 +17067,8 @@ class RawHybridField extends BaseClass$1 {
|
|
17050
17067
|
mapAttrs: attrMap.phone,
|
17051
17068
|
});
|
17052
17069
|
|
17070
|
+
this.inputs.forEach((input) => forwardAttrs(this, input, { includeAttrs: attrs.shared }));
|
17071
|
+
|
17053
17072
|
setTimeout(() => this.phoneCountryCodeInput.setAttribute('default-code', this.defaultCode));
|
17054
17073
|
}
|
17055
17074
|
|