package.cjs.utils.general.js.map Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neeto-commons-frontend Show documentation
Show all versions of neeto-commons-frontend Show documentation
A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.
{"version":3,"file":"general.js","names":["_i18next","_interopRequireDefault","require","_neetoCist","_Toastr","_qs","_ramda","_this","_excluded","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","toCamelCasedString","string","replace","_","nextChar","toUpperCase","withEventTargetValue","curry","func","event","value","exports","getSubdomain","host","window","location","parts","split","simulateApiCall","result","error","errorProbability","undefined","delay","getRandomInt","Promise","resolve","reject","setTimeout","defaultErrorObj","success","notice","i18next","t","Math","random","copyToClipboard","_ref","_asyncToGenerator2","_regenerator","mark","_callee","text","_ref2","_ref2$showToastr","showToastr","_ref2$message","message","textArea","isCopied","_args","wrap","_callee$","_context","prev","next","navigator","clipboard","writeText","Toastr","t0","document","createElement","style","top","left","position","body","appendChild","focus","select","execCommand","removeChild","Error","t1","stop","_x","buildUrl","route","params","options","placeHolders","_options$toSnakeCase","toSnakeCase","toPairs","_ref3","_ref4","_slicedToArray2","includes","concat","encodeURIComponent","keyTransformer","camelToSnakeCase","identity","transformObjectKeys","transformObjectDeep","toJSON","queryParams","pipe","omit","stringify","isEmpty","toLocale","number","_window$globalProps","_window$globalProps$u","Number","toLocaleString","globalProps","user","locale","language","languages","parseQueryParams","search","_options$toCamelCase","toCamelCase","qsOptions","_objectWithoutProperties2","parse","ignoreQueryPrefix","pairedParams","_ref5","_ref6","camelCasedKey","getQueryParams","joinHyphenCase","_len","args","Array","_key","join","toLowerCase","hyphenize","fallbackString","String","debounce","timer","_len2","_key2","clearTimeout","getFromLocalStorage","JSON","localStorage","getItem","_unused2","setToLocalStorage","setItem","removeFromLocalStorage","removeItem","showThumbsUpToastr","icon","className"],"sources":["../../../src/utils/general.js"],"sourcesContent":["import i18next from \"i18next\";\nimport { camelToSnakeCase, getRandomInt, transformObjectDeep } from \"neetocist\";\nimport { Toastr } from \"neetoui\";\nimport { parse, stringify } from \"qs\";\nimport { identity, curry, isEmpty, omit, pipe, toPairs } from \"ramda\";\n\nconst toCamelCasedString = string =>\n string.replace(/[_-]+(\\w)/g, (_, nextChar) => nextChar.toUpperCase());\n\nexport const withEventTargetValue = /*#__PURE__*/ curry((func, event) =>\n func(event.target.value)\n);\n\nexport const getSubdomain = () => {\n const host = window.location.host;\n const parts = host.split(\".\");\n\n return parts.length >= 3 ? parts[0] : \"\";\n};\n\nexport const simulateApiCall = (\n result,\n error,\n errorProbability = 0.1,\n delay = getRandomInt(350, 1000)\n) =>\n new Promise((resolve, reject) =>\n setTimeout(() => {\n const defaultErrorObj = {\n success: false,\n notice: i18next.t(\"neetoCommons.notice.errorOccurred\"),\n };\n\n Math.random() < errorProbability\n ? reject({ ...defaultErrorObj, ...error })\n : resolve(result);\n }, delay)\n );\n\nexport const copyToClipboard = async (\n text,\n {\n showToastr = true,\n message = i18next.t(\"neetoCommons.toastr.success.copiedToClipboard\"),\n } = {}\n) => {\n try {\n await navigator.clipboard.writeText(text);\n showToastr && Toastr.success(message);\n } catch {\n try {\n const textArea = document.createElement(\"textarea\");\n textArea.value = text;\n\n textArea.style.top = \"0\";\n textArea.style.left = \"0\";\n textArea.style.position = \"fixed\";\n\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n\n const isCopied = document.execCommand(\"copy\");\n\n document.body.removeChild(textArea);\n\n if (!isCopied) {\n throw new Error(i18next.t(\"neetoCommons.copyToClipboard.failed\"));\n }\n\n showToastr && Toastr.success(message);\n } catch (error) {\n Toastr.error(error);\n }\n }\n};\n\nexport const buildUrl = (route, params, options = {}) => {\n const placeHolders = [];\n const { toSnakeCase = true } = options;\n toPairs(params).forEach(([key, value]) => {\n if (!route.includes(`:${key}`)) return;\n placeHolders.push(key);\n route = route.replace(`:${key}`, encodeURIComponent(value));\n });\n\n const keyTransformer = toSnakeCase ? camelToSnakeCase : identity;\n const transformObjectKeys = params =>\n transformObjectDeep(\n params,\n (key, value) => [keyTransformer(key), value],\n object =>\n typeof object?.toJSON === \"function\" ? object.toJSON() : object\n );\n\n const queryParams = pipe(\n omit(placeHolders),\n transformObjectKeys,\n stringify\n )(params);\n\n return isEmpty(queryParams) ? route : `${route}?${queryParams}`;\n};\n\nexport const toLocale = (number, options = undefined) =>\n Number(number).toLocaleString(\n window.globalProps?.user?.locale ||\n navigator.language ||\n navigator.languages[0],\n options\n );\n\nexport const parseQueryParams = (search, options = {}) => {\n const { toCamelCase = true, ...qsOptions } = options;\n let params = parse(search, {\n ignoreQueryPrefix: true,\n ...qsOptions,\n });\n\n if (toCamelCase) {\n const pairedParams = toPairs(params);\n params = {};\n pairedParams.forEach(([key, value]) => {\n const camelCasedKey = toCamelCasedString(key);\n params[camelCasedKey] = value;\n });\n }\n\n return params;\n};\n\nexport const getQueryParams = options =>\n parseQueryParams(location.search, options);\n\nexport const joinHyphenCase = (...args) =>\n args.join(\" \").replace(/\\s+/g, \"-\").toLowerCase();\n\nexport const hyphenize = (value, fallbackString = \"\") => {\n if (typeof value === \"number\") return String(value);\n\n if (value && typeof value === \"string\" && value.replace) {\n return value\n .replace(/[\\s_]/g, \"-\")\n .replace(/([a-z])([A-Z])/g, \"$1-$2\")\n .replace(/-+/g, \"-\")\n .toLowerCase();\n }\n\n return fallbackString;\n};\n\nexport const debounce = (func, delay = 350) => {\n let timer;\n\n return (...args) => {\n clearTimeout(timer);\n timer = setTimeout(() => func.apply(this, args), delay);\n };\n};\n\nexport const getFromLocalStorage = key => {\n try {\n // eslint-disable-next-line @bigbinary/neeto/no-local-storage\n return JSON.parse(localStorage.getItem(key));\n } catch {\n return null;\n }\n};\n\nexport const setToLocalStorage = (key, value) =>\n // eslint-disable-next-line @bigbinary/neeto/no-local-storage\n localStorage.setItem(key, JSON.stringify(value));\n\n// eslint-disable-next-line @bigbinary/neeto/no-local-storage\nexport const removeFromLocalStorage = key => localStorage.removeItem(key);\n\nexport const showThumbsUpToastr = () =>\n Toastr.success(\"\", { icon: \"👍\", className: \"w-20\" });\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAAgF,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEhF,IAAAG,GAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAAsE,IAAAK,KAAA;AAAA,IAAAC,SAAA;AAAA,SAAAC,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,wBAAA,CAAAR,MAAA,EAAAO,GAAA,EAAAE,UAAA,OAAAP,IAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,IAAA,EAAAG,OAAA,YAAAH,IAAA;AAAA,SAAAU,cAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,WAAAF,SAAA,CAAAD,CAAA,IAAAC,SAAA,CAAAD,CAAA,QAAAA,CAAA,OAAAf,OAAA,CAAAI,MAAA,CAAAc,MAAA,OAAAC,OAAA,WAAAC,GAAA,QAAAC,gBAAA,aAAAP,MAAA,EAAAM,GAAA,EAAAF,MAAA,CAAAE,GAAA,SAAAhB,MAAA,CAAAkB,yBAAA,GAAAlB,MAAA,CAAAmB,gBAAA,CAAAT,MAAA,EAAAV,MAAA,CAAAkB,yBAAA,CAAAJ,MAAA,KAA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