@descope/web-components-ui 1.0.350 → 1.0.352
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.cjs.js +41 -3
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +43 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/descope-grid-index-js.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-grid/GridClass.js +8 -0
- package/src/components/descope-new-password/NewPasswordClass.js +1 -0
- package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +2 -0
- package/src/components/descope-password/PasswordClass.js +32 -3
package/dist/index.esm.js
CHANGED
@@ -3460,10 +3460,20 @@ const componentName$E = getComponentName('password');
|
|
3460
3460
|
|
3461
3461
|
const customMixin$7 = (superclass) =>
|
3462
3462
|
class PasswordFieldMixinClass extends superclass {
|
3463
|
+
static get observedAttributes() {
|
3464
|
+
return ['manual-visibility-toggle'];
|
3465
|
+
}
|
3466
|
+
|
3467
|
+
get manualToggleVisibility() {
|
3468
|
+
return this.getAttribute('manual-visibility-toggle') === 'true';
|
3469
|
+
}
|
3470
|
+
|
3463
3471
|
init() {
|
3464
3472
|
super.init?.();
|
3465
|
-
|
3466
3473
|
this.handleCaretOnVisibilityChange();
|
3474
|
+
this.origSetPasswordVisible = this.baseElement._setPasswordVisible;
|
3475
|
+
this.origSetFocused = this.baseElement._setFocused;
|
3476
|
+
this.baseElement._setFocused = this.setFocus.bind(this);
|
3467
3477
|
}
|
3468
3478
|
|
3469
3479
|
get caretPosition() {
|
@@ -3482,8 +3492,27 @@ const customMixin$7 = (superclass) =>
|
|
3482
3492
|
};
|
3483
3493
|
}
|
3484
3494
|
|
3485
|
-
|
3486
|
-
|
3495
|
+
// We use `manual-visibility-toggle` to to toggle the password's visibility
|
3496
|
+
// even if the input field is focused-out. However, on focusout - Vaadin resets
|
3497
|
+
// password visibility. Since we don't want to override Vaadin's native setFocus
|
3498
|
+
// function (which is part of their FocusMixin).
|
3499
|
+
// So, here we override the part of logic that runs within Vaadin's setFocus that reports
|
3500
|
+
// the password visibility state. This logic is part of our `manual-visibility-toggle` only.
|
3501
|
+
setFocus(focused) {
|
3502
|
+
if (this.manualToggleVisibility) {
|
3503
|
+
this.baseElement._setPasswordVisible = () => {};
|
3504
|
+
}
|
3505
|
+
this.origSetFocused.call(this.baseElement, focused);
|
3506
|
+
this.baseElement._setPasswordVisible = this.origSetPasswordVisible.bind(this.baseElement);
|
3507
|
+
}
|
3508
|
+
|
3509
|
+
resetPasswordVisibilityToggle() {
|
3510
|
+
this.baseElement._setPasswordVisible = this.origSetPasswordVisible;
|
3511
|
+
this.baseElement._setFocused = this.origSetFocus;
|
3512
|
+
}
|
3513
|
+
|
3514
|
+
attributeChangedCallback(attrName, oldValue, newValue) {
|
3515
|
+
super.attributeChangedCallback?.(attrName, oldValue, newValue);
|
3487
3516
|
}
|
3488
3517
|
};
|
3489
3518
|
|
@@ -6802,6 +6831,7 @@ const customMixin$4 = (superclass) =>
|
|
6802
6831
|
'available-policies',
|
6803
6832
|
'data-password-policy-value-minlength',
|
6804
6833
|
'label-type',
|
6834
|
+
'manual-visibility-toggle',
|
6805
6835
|
],
|
6806
6836
|
});
|
6807
6837
|
}
|
@@ -6949,6 +6979,7 @@ const commonAttrs = [
|
|
6949
6979
|
'draggable',
|
6950
6980
|
'autocomplete',
|
6951
6981
|
'label-type',
|
6982
|
+
'manual-visibility-toggle',
|
6952
6983
|
];
|
6953
6984
|
|
6954
6985
|
const inputRelatedAttrs = [].concat(
|
@@ -7064,6 +7095,7 @@ class NewPasswordInternal extends BaseInputClass$4 {
|
|
7064
7095
|
'available-policies',
|
7065
7096
|
'active-policies',
|
7066
7097
|
'data-password-policy-value-minlength',
|
7098
|
+
'manual-visibility-toggle',
|
7067
7099
|
],
|
7068
7100
|
mapAttrs: {
|
7069
7101
|
'policy-label': 'label',
|
@@ -8744,6 +8776,14 @@ const GridMixin = (superclass) =>
|
|
8744
8776
|
// disable the grid sort
|
8745
8777
|
this.baseElement._mapSorters = () => {};
|
8746
8778
|
|
8779
|
+
// there is an issue in vaadin that on some cases when trying to render the details panel, the row is null and this fn throwing
|
8780
|
+
// so we override it to prevent the error
|
8781
|
+
const origUpdateDetailsCellHeight = this.baseElement._updateDetailsCellHeight;
|
8782
|
+
this.baseElement._updateDetailsCellHeight = (row) => {
|
8783
|
+
if (!row) return;
|
8784
|
+
origUpdateDetailsCellHeight.call(this.baseElement, row);
|
8785
|
+
};
|
8786
|
+
|
8747
8787
|
this.baseElement.rowDetailsRenderer = this.#rowDetailsRenderer.bind(this);
|
8748
8788
|
}
|
8749
8789
|
|