ouisys-component-library 3.0.42 → 3.0.44
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/FocusArea.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,{useCallback as
|
|
1
|
+
import e,{useCallback as t}from"react";var o=function(o){var r=o.children,n=o.tracker,c=t((function(){if(n.customEvent("creativeArea","click","form-focus"),"undefined"!=typeof window){var e=document.querySelector("#overlay");e&&(e.className="".concat(e.className," show"));var t=document.querySelector("#phone-input"),o=document.querySelector("#pin-input");t?t.focus():o&&o.focus(),"vibrate"in navigator&&navigator.vibrate([100,30,100,30,100])}}),[n]);return e.createElement("div",{id:"divFocus",className:"focus-area",onClick:c,role:"button",tabIndex:0,onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),c())}},r)};export{o as FocusArea};
|
|
2
2
|
//# sourceMappingURL=FocusArea.js.map
|
package/dist/FocusArea.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusArea.js","sources":["../src/FocusArea/FocusArea.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { IFocusAreaProps } from './FocusArea.types';\n\n\nexport const FocusArea = ({ children, tracker }: IFocusAreaProps) => {\n const divFocus = useCallback(() => {\n tracker.customEvent(\n \"creativeArea\",\n \"click\",\n \"form-focus\"\n );\n\n if (typeof window !== \"undefined\") {\n const overlay = document.querySelector(\"#overlay\") as HTMLElement;\n if (overlay) {\n overlay.className =
|
|
1
|
+
{"version":3,"file":"FocusArea.js","sources":["../src/FocusArea/FocusArea.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { IFocusAreaProps } from './FocusArea.types';\n\n\nexport const FocusArea = ({ children, tracker }: IFocusAreaProps) => {\n const divFocus = useCallback(() => {\n tracker.customEvent(\n \"creativeArea\",\n \"click\",\n \"form-focus\"\n );\n\n if (typeof window !== \"undefined\") {\n const overlay = document.querySelector(\"#overlay\") as HTMLElement;\n if (overlay) {\n overlay.className = `${overlay.className} show`;\n }\n const phoneInput = document.querySelector(\"#phone-input\") as HTMLInputElement;\n const pinInput = document.querySelector(\"#pin-input\") as HTMLInputElement;\n\n if (phoneInput) {\n phoneInput.focus();\n } else if (pinInput) {\n pinInput.focus();\n }\n // Vibrate if available\n if (\"vibrate\" in navigator) {\n navigator.vibrate([100, 30, 100, 30, 100]);\n }\n }\n }, [tracker]);\n\n return (\n <div\n id=\"divFocus\"\n className=\"focus-area\"\n onClick={divFocus}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n divFocus();\n }\n }}\n >\n {children}\n </div>\n );\n\n}"],"names":["FocusArea","_a","children","tracker","divFocus","useCallback","customEvent","window","overlay","document","querySelector","className","concat","phoneInput","pinInput","focus","navigator","vibrate","React","createElement","id","onClick","role","tabIndex","onKeyDown","e","key","preventDefault"],"mappings":"uCAIO,IAAMA,EAAY,SAACC,OAAEC,EAAQD,EAAAC,SAAEC,EAAOF,EAAAE,QACnCC,EAAWC,GAAY,WAOzB,GANAF,EAAQG,YACJ,eACA,QACA,cAGkB,oBAAXC,OAAwB,CAC/B,IAAMC,EAAUC,SAASC,cAAc,YACnCF,IACAA,EAAQG,UAAY,GAAAC,OAAGJ,EAAQG,oBAEnC,IAAME,EAAaJ,SAASC,cAAc,gBACpCI,EAAWL,SAASC,cAAc,cAEpCG,EACAA,EAAWE,QACJD,GACPA,EAASC,QAGT,YAAaC,WACbA,UAAUC,QAAQ,CAAC,IAAK,GAAI,IAAK,GAAI,KAE5C,CACL,GAAG,CAACd,IAEJ,OACIe,EACIC,cAAA,MAAA,CAAAC,GAAG,WACHT,UAAU,aACVU,QAASjB,EACTkB,KAAK,SACLC,SAAU,EACVC,UAAW,SAACC,GACM,UAAVA,EAAEC,KAA6B,MAAVD,EAAEC,MACvBD,EAAEE,iBACFvB,IAER,GAECF,EAIb"}
|