1 line
3.6 KiB
JSON
1 line
3.6 KiB
JSON
{"ast":null,"code":"import { useEffect, useRef } from 'react';\nexport default function useRemovePasswordTimeout(inputRef, triggerOnMount) {\n const removePasswordTimeoutRef = useRef([]);\n const removePasswordTimeout = () => {\n removePasswordTimeoutRef.current.push(setTimeout(() => {\n var _a, _b, _c, _d;\n if (((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) && ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.input.getAttribute('type')) === 'password' && ((_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.input.hasAttribute('value'))) {\n (_d = inputRef.current) === null || _d === void 0 ? void 0 : _d.input.removeAttribute('value');\n }\n }));\n };\n useEffect(() => {\n if (triggerOnMount) {\n removePasswordTimeout();\n }\n return () => removePasswordTimeoutRef.current.forEach(timer => {\n if (timer) {\n clearTimeout(timer);\n }\n });\n }, []);\n return removePasswordTimeout;\n}","map":{"version":3,"names":["useEffect","useRef","useRemovePasswordTimeout","inputRef","triggerOnMount","removePasswordTimeoutRef","removePasswordTimeout","current","push","setTimeout","_a","_b","_c","_d","input","getAttribute","hasAttribute","removeAttribute","forEach","timer","clearTimeout"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/antd/es/input/hooks/useRemovePasswordTimeout.js"],"sourcesContent":["import { useEffect, useRef } from 'react';\nexport default function useRemovePasswordTimeout(inputRef, triggerOnMount) {\n const removePasswordTimeoutRef = useRef([]);\n const removePasswordTimeout = () => {\n removePasswordTimeoutRef.current.push(setTimeout(() => {\n var _a, _b, _c, _d;\n if (((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) && ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.input.getAttribute('type')) === 'password' && ((_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.input.hasAttribute('value'))) {\n (_d = inputRef.current) === null || _d === void 0 ? void 0 : _d.input.removeAttribute('value');\n }\n }));\n };\n useEffect(() => {\n if (triggerOnMount) {\n removePasswordTimeout();\n }\n return () => removePasswordTimeoutRef.current.forEach(timer => {\n if (timer) {\n clearTimeout(timer);\n }\n });\n }, []);\n return removePasswordTimeout;\n}"],"mappings":"AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,eAAe,SAASC,wBAAwBA,CAACC,QAAQ,EAAEC,cAAc,EAAE;EACzE,MAAMC,wBAAwB,GAAGJ,MAAM,CAAC,EAAE,CAAC;EAC3C,MAAMK,qBAAqB,GAAGA,CAAA,KAAM;IAClCD,wBAAwB,CAACE,OAAO,CAACC,IAAI,CAACC,UAAU,CAAC,MAAM;MACrD,IAAIC,EAAE,EAAEC,EAAE,EAAEC,EAAE,EAAEC,EAAE;MAClB,IAAI,CAAC,CAACH,EAAE,GAAGP,QAAQ,CAACI,OAAO,MAAM,IAAI,IAAIG,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,EAAE,CAACI,KAAK,KAAK,CAAC,CAACH,EAAE,GAAGR,QAAQ,CAACI,OAAO,MAAM,IAAI,IAAII,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,EAAE,CAACG,KAAK,CAACC,YAAY,CAAC,MAAM,CAAC,MAAM,UAAU,KAAK,CAACH,EAAE,GAAGT,QAAQ,CAACI,OAAO,MAAM,IAAI,IAAIK,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,EAAE,CAACE,KAAK,CAACE,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE;QAC3R,CAACH,EAAE,GAAGV,QAAQ,CAACI,OAAO,MAAM,IAAI,IAAIM,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,EAAE,CAACC,KAAK,CAACG,eAAe,CAAC,OAAO,CAAC;MAChG;IACF,CAAC,CAAC,CAAC;EACL,CAAC;EACDjB,SAAS,CAAC,MAAM;IACd,IAAII,cAAc,EAAE;MAClBE,qBAAqB,CAAC,CAAC;IACzB;IACA,OAAO,MAAMD,wBAAwB,CAACE,OAAO,CAACW,OAAO,CAACC,KAAK,IAAI;MAC7D,IAAIA,KAAK,EAAE;QACTC,YAAY,CAACD,KAAK,CAAC;MACrB;IACF,CAAC,CAAC;EACJ,CAAC,EAAE,EAAE,CAAC;EACN,OAAOb,qBAAqB;AAC9B","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]} |