@mxenabled/connect-widget 0.19.3 → 0.19.4
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/index.es.js +13 -1
- package/dist/index.es.js.map +1 -1
- package/dist/lastBuild.txt +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -70116,7 +70116,14 @@ const buildFormSchema = (loginFields) => {
|
|
|
70116
70116
|
const CREDENTIAL_FIELD_TYPES = {
|
|
70117
70117
|
PASSWORD: 1};
|
|
70118
70118
|
|
|
70119
|
+
const preventDefaultAndStopAllPropagation = (event) => {
|
|
70120
|
+
event.preventDefault();
|
|
70121
|
+
event.stopPropagation();
|
|
70122
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
70123
|
+
};
|
|
70124
|
+
|
|
70119
70125
|
const usePasswordInputValidation = () => {
|
|
70126
|
+
const showHideButtonRef = React__default.useRef(null);
|
|
70120
70127
|
const [isCapsLockOn, setIsCapsLockOn] = useState(false);
|
|
70121
70128
|
const handleKeyPress = (event) => "getModifierState" in event && setIsCapsLockOn(event.getModifierState("CapsLock"));
|
|
70122
70129
|
const handleFocus = (event) => event.target?.addEventListener("keydown", handleKeyPress);
|
|
@@ -70125,7 +70132,11 @@ const usePasswordInputValidation = () => {
|
|
|
70125
70132
|
setIsCapsLockOn(false);
|
|
70126
70133
|
};
|
|
70127
70134
|
const [showPassword, setShowPassword] = useState(false);
|
|
70128
|
-
const handleTogglePassword = () =>
|
|
70135
|
+
const handleTogglePassword = (e) => {
|
|
70136
|
+
preventDefaultAndStopAllPropagation(e);
|
|
70137
|
+
setShowPassword((show) => !show);
|
|
70138
|
+
setTimeout(() => showHideButtonRef.current && showHideButtonRef.current.focus(), 0);
|
|
70139
|
+
};
|
|
70129
70140
|
const [validateSpaceState, setValidateSpaceState] = useState(DEFAULT_VALIDATION_STATE);
|
|
70130
70141
|
const [validateSpaceMessage, setValidateSpaceMessage] = useState("");
|
|
70131
70142
|
const handleSpaceValidation = (e) => {
|
|
@@ -70182,6 +70193,7 @@ const usePasswordInputValidation = () => {
|
|
|
70182
70193
|
"aria-label": showPassword ? __("Hide password") : __("Show password"),
|
|
70183
70194
|
edge: "end",
|
|
70184
70195
|
onClick: handleTogglePassword,
|
|
70196
|
+
ref: showHideButtonRef,
|
|
70185
70197
|
children: showPassword ? /* @__PURE__ */ jsxRuntimeExports.jsx(M, { className: "material-symbols-rounded", name: "visibility_off" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(M, { className: "material-symbols-rounded", name: "visibility" })
|
|
70186
70198
|
}
|
|
70187
70199
|
) })
|