@descope/web-components-ui 1.0.339 → 1.0.341
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.cjs.js +30 -12
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +30 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/4978.js +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
- package/dist/umd/descope-new-password-index-js.js +1 -1
- package/dist/umd/descope-password-index-js.js +1 -1
- package/package.json +1 -1
- package/src/components/descope-password/PasswordClass.js +18 -10
- package/src/mixins/proxyInputMixin.js +10 -0
package/dist/index.esm.js
CHANGED
@@ -1080,6 +1080,16 @@ const proxyInputMixin =
|
|
1080
1080
|
}
|
1081
1081
|
};
|
1082
1082
|
|
1083
|
+
// We want to ensure that `input` events properly cross ShadowDOM boundries
|
1084
|
+
// e.g. When we autofill a component's input with 1Password, for instance,
|
1085
|
+
// the event is fired without `composed: true` and doesn't our component's
|
1086
|
+
// ShadowDOM.
|
1087
|
+
this.baseElement.addEventListener('input', (e) => {
|
1088
|
+
if (!e.composed) {
|
1089
|
+
this.dispatchEvent(new Event('input', { bubbles: true, composed: true }));
|
1090
|
+
}
|
1091
|
+
});
|
1092
|
+
|
1083
1093
|
triggerValidationEvents.forEach((e) => {
|
1084
1094
|
this.baseElement?.addEventListener(e, () => {
|
1085
1095
|
this.inputElement?.setCustomValidity('');
|
@@ -3443,18 +3453,26 @@ const componentName$D = getComponentName('password');
|
|
3443
3453
|
|
3444
3454
|
const customMixin$7 = (superclass) =>
|
3445
3455
|
class PasswordFieldMixinClass extends superclass {
|
3446
|
-
|
3447
|
-
|
3448
|
-
|
3449
|
-
|
3450
|
-
|
3451
|
-
|
3452
|
-
|
3453
|
-
|
3454
|
-
|
3455
|
-
|
3456
|
-
|
3457
|
-
this.
|
3456
|
+
init() {
|
3457
|
+
super.init?.();
|
3458
|
+
|
3459
|
+
this.handleCaretOnVisibilityChange();
|
3460
|
+
}
|
3461
|
+
|
3462
|
+
get caretPosition() {
|
3463
|
+
return this.value?.length || 0;
|
3464
|
+
}
|
3465
|
+
|
3466
|
+
handleCaretOnVisibilityChange() {
|
3467
|
+
const origTogglePasswordVisibility = this.baseElement._togglePasswordVisibility.bind(
|
3468
|
+
this.baseElement
|
3469
|
+
);
|
3470
|
+
this.baseElement._togglePasswordVisibility = () => {
|
3471
|
+
setTimeout(() => {
|
3472
|
+
origTogglePasswordVisibility();
|
3473
|
+
this.inputElement.setSelectionRange(this.caretPosition, this.caretPosition);
|
3474
|
+
});
|
3475
|
+
};
|
3458
3476
|
}
|
3459
3477
|
|
3460
3478
|
getAutocompleteType() {
|