All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.cjs.react-utils.metaClick.metaClick.js.map Maven / Gradle / Ivy

Go to download

A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.

There is a newer version: 4.12.3
Show newest version
{"version":3,"file":"metaClick.js","names":["_ramda","require","handleMetaClick","exports","curry","history","params","event","options","arguments","length","undefined","isMetaKeyPressed","window","open","pathname","_options$isHistoryRep","isHistoryReplace","historyMethod","replace","push","ctrlKey","metaKey"],"sources":["../../../../src/react-utils/metaClick/metaClick.js"],"sourcesContent":["import { curry } from \"ramda\";\n\nexport const handleMetaClick = curry((history, params, event, options = {}) => {\n  if (isMetaKeyPressed(event)) {\n    return window.open(params.pathname || params, \"_blank\");\n  }\n\n  const { isHistoryReplace = false } = options;\n  const historyMethod = isHistoryReplace ? history.replace : history.push;\n\n  return historyMethod(params);\n});\n\nexport const isMetaKeyPressed = event => !!(event?.ctrlKey || event?.metaKey);\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEO,IAAMC,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,IAAAE,YAAK,EAAC,UAACC,OAAO,EAAEC,MAAM,EAAEC,KAAK,EAAmB;EAAA,IAAjBC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACxE,IAAIG,gBAAgB,CAACL,KAAK,CAAC,EAAE;IAC3B,OAAOM,MAAM,CAACC,IAAI,CAACR,MAAM,CAACS,QAAQ,IAAIT,MAAM,EAAE,QAAQ,CAAC;EACzD;EAEA,IAAAU,qBAAA,GAAqCR,OAAO,CAApCS,gBAAgB;IAAhBA,gBAAgB,GAAAD,qBAAA,cAAG,KAAK,GAAAA,qBAAA;EAChC,IAAME,aAAa,GAAGD,gBAAgB,GAAGZ,OAAO,CAACc,OAAO,GAAGd,OAAO,CAACe,IAAI;EAEvE,OAAOF,aAAa,CAACZ,MAAM,CAAC;AAC9B,CAAC,CAAC;AAEK,IAAMM,gBAAgB,GAAAT,OAAA,CAAAS,gBAAA,GAAG,SAAnBA,gBAAgBA,CAAGL,KAAK;EAAA,OAAI,CAAC,EAAEA,KAAK,aAALA,KAAK,eAALA,KAAK,CAAEc,OAAO,IAAId,KAAK,aAALA,KAAK,eAALA,KAAK,CAAEe,OAAO,CAAC;AAAA","ignoreList":[]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy