@bigbinary/neeto-commons-frontend 4.13.102 → 4.13.103

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.
Files changed (56) hide show
  1. package/dist/cjs/initializers/dayjs.js +5 -3
  2. package/dist/cjs/initializers/dayjs.js.map +1 -1
  3. package/dist/cjs/initializers/i18n.js +3 -3
  4. package/dist/cjs/initializers/i18n.js.map +1 -1
  5. package/dist/cjs/initializers/index.js +3 -1
  6. package/dist/cjs/initializers/index.js.map +1 -1
  7. package/dist/cjs/initializers/utils/{utils.js → index.js} +1 -1
  8. package/dist/cjs/initializers/utils/index.js.map +1 -0
  9. package/dist/cjs/react-utils/index.js +4 -0
  10. package/dist/cjs/react-utils/index.js.map +1 -1
  11. package/dist/cjs/react-utils/useLocalStorage/index.js +4 -0
  12. package/dist/cjs/react-utils/useLocalStorage/index.js.map +1 -1
  13. package/dist/cjs/react-utils/useLocalStorage/useLocalStorage.js +7 -3
  14. package/dist/cjs/react-utils/useLocalStorage/useLocalStorage.js.map +1 -1
  15. package/dist/cjs/utils/constants.js +14 -0
  16. package/dist/cjs/utils/constants.js.map +1 -0
  17. package/dist/cjs/utils/datetime.js +75 -50
  18. package/dist/cjs/utils/datetime.js.map +1 -1
  19. package/dist/cjs/utils/dayjsFormatOverrides/default.js +26 -0
  20. package/dist/cjs/utils/dayjsFormatOverrides/default.js.map +1 -0
  21. package/dist/cjs/utils/dayjsFormatOverrides/ja.js +25 -0
  22. package/dist/cjs/utils/dayjsFormatOverrides/ja.js.map +1 -0
  23. package/dist/cjs/utils/index.js +5 -0
  24. package/dist/cjs/utils/index.js.map +1 -1
  25. package/dist/cjs/utils/localePlugin.js +41 -8
  26. package/dist/cjs/utils/localePlugin.js.map +1 -1
  27. package/dist/initializers/dayjs.js +4 -2
  28. package/dist/initializers/dayjs.js.map +1 -1
  29. package/dist/initializers/i18n.js +2 -2
  30. package/dist/initializers/i18n.js.map +1 -1
  31. package/dist/initializers/index.js +3 -1
  32. package/dist/initializers/index.js.map +1 -1
  33. package/dist/initializers/utils/{utils.js → index.js} +1 -1
  34. package/dist/initializers/utils/index.js.map +1 -0
  35. package/dist/react-utils/index.js +4 -0
  36. package/dist/react-utils/index.js.map +1 -1
  37. package/dist/react-utils/useLocalStorage/index.js +4 -0
  38. package/dist/react-utils/useLocalStorage/index.js.map +1 -1
  39. package/dist/react-utils/useLocalStorage/useLocalStorage.js +7 -3
  40. package/dist/react-utils/useLocalStorage/useLocalStorage.js.map +1 -1
  41. package/dist/utils/constants.js +9 -0
  42. package/dist/utils/constants.js.map +1 -0
  43. package/dist/utils/datetime.js +74 -51
  44. package/dist/utils/datetime.js.map +1 -1
  45. package/dist/utils/dayjsFormatOverrides/default.js +24 -0
  46. package/dist/utils/dayjsFormatOverrides/default.js.map +1 -0
  47. package/dist/utils/dayjsFormatOverrides/ja.js +23 -0
  48. package/dist/utils/dayjsFormatOverrides/ja.js.map +1 -0
  49. package/dist/utils/index.js +4 -1
  50. package/dist/utils/index.js.map +1 -1
  51. package/dist/utils/localePlugin.js +37 -8
  52. package/dist/utils/localePlugin.js.map +1 -1
  53. package/package.json +1 -1
  54. package/utils.d.ts +8 -6
  55. package/dist/cjs/initializers/utils/utils.js.map +0 -1
  56. package/dist/initializers/utils/utils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/initializers/index.js"],"sourcesContent":["// TODO: kept for backward compatibility.\nimport useDisplayErrorPage from \"react-utils/useDisplayErrorPage\";\n\nimport initializeAxios from \"./axios\";\nimport initializeDayjs from \"./dayjs\";\nimport patchDomForExternalMutations from \"./domPatch\";\nimport initializeGlobalProps from \"./globalProps\";\nimport initializeI18n, { taxonomies } from \"./i18n\";\nimport initializeLogger from \"./logger\";\nimport disableReactDevTools from \"./reactDevTools\";\n\n// eslint-disable-next-line import/no-mutable-exports\nlet globalProps = {};\n\nexport { globalProps, useDisplayErrorPage, taxonomies };\n\nexport default async function initializeApplication({\n translationResources,\n skip,\n} = {}) {\n if (!skip?.globalProps) {\n initializeGlobalProps();\n // eslint-disable-next-line @bigbinary/neeto/no-globalProps-reassignment\n globalProps = window.globalProps;\n }\n\n if (typeof skip?.axios === \"object\" || !skip?.axios) {\n initializeAxios(skip?.axios);\n }\n\n if (!skip?.i18n) {\n await initializeI18n(translationResources);\n }\n\n if (!skip?.logger) initializeLogger();\n\n if (!skip?.dayjs) initializeDayjs(skip?.timezone);\n\n if (!skip?.domPatch) patchDomForExternalMutations();\n\n if (process.env.NODE_ENV === \"production\") disableReactDevTools();\n}\n"],"names":["globalProps","initializeApplication","_initializeApplication","apply","arguments","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_ref","translationResources","skip","_args","wrap","_callee$","_context","prev","next","length","undefined","initializeGlobalProps","window","_typeof","axios","initializeAxios","i18n","initializeI18n","logger","initializeLogger","dayjs","initializeDayjs","timezone","domPatch","patchDomForExternalMutations","process","env","NODE_ENV","disableReactDevTools","stop"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA;AACIA,mBAAW,GAAG;AAIlB,SAA8BC,qBAAqBA,GAAA;AAAA,EAAA,OAAAC,sBAAA,CAAAC,KAAA,CAAA,IAAA,EAAAC,SAAA,CAAA;AAAA;AAyBlD,SAAAF,sBAAA,GAAA;EAAAA,sBAAA,GAAAG,uBAAA,cAAAC,yBAAA,CAAAC,IAAA,CAzBc,SAAAC,OAAA,GAAA;AAAA,IAAA,IAAAC,IAAA;MAAAC,oBAAA;MAAAC,IAAA;AAAAC,MAAAA,KAAA,GAAAR,SAAA;AAAA,IAAA,OAAAE,yBAAA,CAAAO,IAAA,CAAA,SAAAC,SAAAC,QAAA,EAAA;AAAA,MAAA,OAAA,CAAA,EAAA,QAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;AAAA,QAAA,KAAA,CAAA;UAAAR,IAAA,GAAAG,KAAA,CAAAM,MAAA,GA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JA,IAAI,CAAEoB,QAAQ,CAAC;UAEjD,IAAI,EAACpB,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAA,MAAA,IAAJA,IAAI,CAAEqB,QAAQ,CAAA,EAAEC,qBAA4B,EAAE;UAEnD,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAEC,0BAAoB,EAAE;AAAC,QAAA,KAAA,EAAA;AAAA,QAAA,KAAA,KAAA;UAAA,OAAAtB,QAAA,CAAAuB,IAAA,EAAA;AAAA;AAAA,KAAA,EAAA9B,OAAA,CAAA;GACnE,CAAA,CAAA;AAAA,EAAA,OAAAN,sBAAA,CAAAC,KAAA,CAAA,IAAA,EAAAC,SAAA,CAAA;AAAA;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/initializers/index.js"],"sourcesContent":["// TODO: kept for backward compatibility.\nimport useDisplayErrorPage from \"react-utils/useDisplayErrorPage\";\n\nimport initializeAxios from \"./axios\";\nimport initializeDayjs from \"./dayjs\";\nimport patchDomForExternalMutations from \"./domPatch\";\nimport initializeGlobalProps from \"./globalProps\";\nimport initializeI18n, { taxonomies } from \"./i18n\";\nimport initializeLogger from \"./logger\";\nimport disableReactDevTools from \"./reactDevTools\";\n\n// eslint-disable-next-line import/no-mutable-exports\nlet globalProps = {};\n\nexport { globalProps, useDisplayErrorPage, taxonomies };\n\nexport default async function initializeApplication({\n translationResources,\n skip,\n} = {}) {\n if (!skip?.globalProps) {\n initializeGlobalProps();\n // eslint-disable-next-line @bigbinary/neeto/no-globalProps-reassignment\n globalProps = window.globalProps;\n }\n\n if (typeof skip?.axios === \"object\" || !skip?.axios) {\n initializeAxios(skip?.axios);\n }\n\n if (!skip?.i18n) {\n await initializeI18n(translationResources);\n }\n\n if (!skip?.logger) initializeLogger();\n\n if (!skip?.dayjs) initializeDayjs(skip?.timezone);\n\n if (!skip?.domPatch) patchDomForExternalMutations();\n\n if (process.env.NODE_ENV === \"production\") disableReactDevTools();\n}\n"],"names":["globalProps","initializeApplication","_initializeApplication","apply","arguments","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_ref","translationResources","skip","_args","wrap","_callee$","_context","prev","next","length","undefined","initializeGlobalProps","window","_typeof","axios","initializeAxios","i18n","initializeI18n","logger","initializeLogger","dayjs","initializeDayjs","timezone","domPatch","patchDomForExternalMutations","process","env","NODE_ENV","disableReactDevTools","stop"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA;AACIA,mBAAW,GAAG;AAIlB,SAA8BC,qBAAqBA,GAAA;AAAA,EAAA,OAAAC,sBAAA,CAAAC,KAAA,CAAA,IAAA,EAAAC,SAAA,CAAA;AAAA;AAyBlD,SAAAF,sBAAA,GAAA;EAAAA,sBAAA,GAAAG,uBAAA,cAAAC,yBAAA,CAAAC,IAAA,CAzBc,SAAAC,OAAA,GAAA;AAAA,IAAA,IAAAC,IAAA;MAAAC,oBAAA;MAAAC,IAAA;AAAAC,MAAAA,KAAA,GAAAR,SAAA;AAAA,IAAA,OAAAE,yBAAA,CAAAO,IAAA,CAAA,SAAAC,SAAAC,QAAA,EAAA;AAAA,MAAA,OAAA,CAAA,EAAA,QAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;AAAA,QAAA,KAAA,CAAA;UAAAR,IAAA,GAAAG,KAAA,CAAAM,MAAA,GAAA,CAAA,IAAAN,KAAA,CAAAO,CAAAA,CAAAA,KAAAA,SAAA,GAAAP,KAAA,CAGX,CAAA,CAAA,GAAA,EAAE,EAFJF,oBAAoB,GAAAD,IAAA,CAApBC,oBAAoB,EACpBC,IAAI,GAAAF,IAAA,CAAJE,IAAI;UAEJ,IAAI,EAACA,IAAI,KAAJA,IAAAA,IAAAA,IAAI,eAAJA,IAAI,CAAEX,WAAW,CAAE,EAAA;AACtBoB,YAAAA,wBAAqB,EAAE;AACvB;YACApB,mBAAW,GAAGqB,MAAM,CAACrB,WAAW;AACl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;GACnE,CAAA,CAAA;AAAA,EAAA,OAAAN,sBAAA,CAAAC,KAAA,CAAA,IAAA,EAAAC,SAAA,CAAA;AAAA;;;;;;;;;"}
@@ -32,4 +32,4 @@ var _replaceNullValuesWithGetter = function replaceNullValuesWithGetter(inputObj
32
32
  };
33
33
 
34
34
  exports.replaceNullValuesWithGetter = _replaceNullValuesWithGetter;
35
- //# sourceMappingURL=utils.js.map
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/initializers/utils/index.js"],"sourcesContent":["import i18n from \"i18next\";\n\nconst getter = key => () => i18n.t(`taxonomyDefaultLabels.${key}`);\n\nexport const replaceNullValuesWithGetter = (inputObject, parentKey = \"\") => {\n const result = {};\n\n for (const [key, value] of Object.entries(inputObject)) {\n const transKey = parentKey ? `${parentKey}.${key}` : key;\n\n if (value === null) {\n Object.defineProperty(result, key, { get: getter(transKey) });\n } else if (typeof value === \"object\") {\n result[key] = replaceNullValuesWithGetter(value, transKey);\n } else {\n result[key] = value;\n }\n }\n\n return result;\n};\n"],"names":["getter","key","i18n","t","concat","replaceNullValuesWithGetter","inputObject","parentKey","arguments","length","undefined","result","_i","_Object$entries","Object","entries","_Object$entries$_i","_slicedToArray","value","transKey","defineProperty","get","_typeof"],"mappings":";;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAMA,CAAGC,GAAG,EAAA;EAAA,OAAI,YAAA;IAAA,OAAMC,OAAI,CAACC,CAAC,CAAA,wBAAA,CAAAC,MAAA,CAA0BH,GAAG,CAAE,CAAC;AAAA,GAAA;AAAA,CAAA;AAE3D,IAAMI,4BAA2B,GAAG,SAA9BA,2BAA2BA,CAAIC,WAAW,EAAqB;AAAA,EAAA,IAAnBC,SAAS,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,EAAE;EACrE,IAAMG,MAAM,GAAG,EAAE;AAEjB,EAAA,KAAA,IAAAC,EAAA,GAAAC,CAAAA,EAAAA,eAAA,GAA2BC,MAAM,CAACC,OAAO,CAACT,WAAW,CAAC,EAAAM,EAAA,GAAAC,eAAA,CAAAJ,MAAA,EAAAG,EAAA,EAAE,EAAA;AAAnD,IAAA,IAAAI,kBAAA,GAAAC,4BAAA,CAAAJ,eAAA,CAAAD,EAAA,CAAA,EAAA,CAAA,CAAA;AAAOX,MAAAA,GAAG,GAAAe,kBAAA,CAAA,CAAA,CAAA;AAAEE,MAAAA,KAAK,GAAAF,kBAAA,CAAA,CAAA,CAAA;AACpB,IAAA,IAAMG,QAAQ,GAAGZ,SAAS,GAAA,EAAA,CAAAH,MAAA,CAAMG,SAAS,EAAA,GAAA,CAAA,CAAAH,MAAA,CAAIH,GAAG,CAAA,GAAKA,GAAG;IAExD,IAAIiB,KAAK,KAAK,IAAI,EAAE;AAClBJ,MAAAA,MAAM,CAACM,cAAc,CAACT,MAAM,EAAEV,GAAG,EAAE;QAAEoB,GAAG,EAAErB,MAAM,CAACmB,QAAQ;AAAE,OAAC,CAAC;AAC/D,KAAC,MAAM,IAAIG,eAAA,CAAOJ,KAAK,CAAA,KAAK,QAAQ,EAAE;MACpCP,MAAM,CAACV,GAAG,CAAC,GAAGI,4BAA2B,CAACa,KAAK,EAAEC,QAAQ,CAAC;AAC5D,KAAC,MAAM;AACLR,MAAAA,MAAM,CAACV,GAAG,CAAC,GAAGiB,KAAK;AACrB;AACF;AAEA,EAAA,OAAOP,MAAM;AACf;;;;"}
@@ -70,9 +70,13 @@ require('../_commonjsHelpers-BJu3ubxk.js');
70
70
  require('i18next');
71
71
  require('@bigbinary/neetoui/Toastr');
72
72
  require('qs');
73
+ require('../utils/datetime.js');
74
+ require('../utils/constants.js');
73
75
  require('../utils/dayjs.js');
74
76
  require('../toConsumableArray-tBKHqzE3.js');
75
77
  require('dayjs');
78
+ require('../utils/dayjsFormatOverrides/default.js');
79
+ require('../utils/localePlugin.js');
76
80
  require('../utils/createSubscription.js');
77
81
  require('@rails/actioncable');
78
82
  require('yup');
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -17,9 +17,13 @@ require('i18next');
17
17
  require('@bigbinary/neeto-cist');
18
18
  require('@bigbinary/neetoui/Toastr');
19
19
  require('qs');
20
+ require('../../utils/datetime.js');
21
+ require('../../utils/constants.js');
20
22
  require('../../utils/dayjs.js');
21
23
  require('../../toConsumableArray-tBKHqzE3.js');
22
24
  require('dayjs');
25
+ require('../../utils/dayjsFormatOverrides/default.js');
26
+ require('../../utils/localePlugin.js');
23
27
  require('../../utils/createSubscription.js');
24
28
  require('@rails/actioncable');
25
29
  require('yup');
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -6,7 +6,7 @@ var ramda = require('ramda');
6
6
  require('axios');
7
7
  require('../../initializers/constants.js');
8
8
  var utils_general = require('../../utils/general.js');
9
- require('../../utils/dayjs.js');
9
+ require('../../utils/datetime.js');
10
10
  require('../../utils/createSubscription.js');
11
11
  require('dayjs');
12
12
  require('i18next');
@@ -16,15 +16,19 @@ require('@bigbinary/neeto-cist');
16
16
  require('../../index-bFmfHzbL.js');
17
17
  require('@bigbinary/neeto-time-zones');
18
18
  require('ua-parser-js');
19
+ require('../../utils/dayjs.js');
19
20
  require('../../unsupportedIterableToArray-BoHMiKNA.js');
20
21
  require('../../objectWithoutProperties-wSsbHFcG.js');
21
22
  require('../../defineProperty-lChFfVqi.js');
22
23
  require('../../typeof-D4ZZ_FlZ.js');
23
24
  require('@bigbinary/neetoui/Toastr');
24
25
  require('qs');
25
- require('../../toConsumableArray-tBKHqzE3.js');
26
- require('@rails/actioncable');
26
+ require('../../utils/constants.js');
27
+ require('../../utils/dayjsFormatOverrides/default.js');
28
+ require('../../utils/localePlugin.js');
27
29
  require('../../_commonjsHelpers-BJu3ubxk.js');
30
+ require('@rails/actioncable');
31
+ require('../../toConsumableArray-tBKHqzE3.js');
28
32
 
29
33
  var getStorageValue = function getStorageValue(key, defaultValue) {
30
34
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"useLocalStorage.js","sources":["../../../../src/react-utils/useLocalStorage/useLocalStorage.js"],"sourcesContent":["/* eslint-disable @bigbinary/neeto/no-local-storage */\n\nimport { useState } from \"react\";\n\nimport { isNil } from \"ramda\";\nimport { removeFromLocalStorage, setToLocalStorage } from \"utils\";\n\nconst getStorageValue = (key, defaultValue) => {\n try {\n const storedValue = localStorage.getItem(key);\n\n return storedValue ? JSON.parse(storedValue) : defaultValue;\n } catch (error) {\n logger.error(error);\n\n return defaultValue;\n }\n};\n\nconst useLocalStorage = (key, defaultValue) => {\n const [storedValue, setStoredValue] = useState(() =>\n getStorageValue(key, defaultValue)\n );\n\n const setValue = value =>\n setStoredValue(prevStoredValue => {\n const newValue =\n typeof value === \"function\" ? value(prevStoredValue) : value;\n\n if (isNil(newValue)) {\n removeFromLocalStorage(key);\n } else {\n setToLocalStorage(key, newValue);\n }\n\n return newValue;\n });\n\n return [storedValue, setValue];\n};\n\nexport default useLocalStorage;\n"],"names":["getStorageValue","key","defaultValue","storedValue","localStorage","getItem","JSON","parse","error","logger","useLocalStorage","_useState","useState","_useState2","_slicedToArray","setStoredValue","setValue","value","prevStoredValue","newValue","isNil","removeFromLocalStorage","setToLocalStorage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAMA,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,GAAG,EAAEC,YAAY,EAAK;EAC7C,IAAI;AACF,IAAA,IAAMC,WAAW,GAAGC,YAAY,CAACC,OAAO,CAACJ,GAAG,CAAC;IAE7C,OAAOE,WAAW,GAAGG,IAAI,CAACC,KAAK,CAACJ,WAAW,CAAC,GAAGD,YAAY;GAC5D,CAAC,OAAOM,KAAK,EAAE;AACdC,IAAAA,MAAM,CAACD,KAAK,CAACA,KAAK,CAAC;AAEnB,IAAA,OAAON,YAAY;AACrB;AACF,CAAC;AAEKQ,IAAAA,eAAe,GAAG,SAAlBA,eAAeA,CAAIT,GAAG,EAAEC,YAAY,EAAK;EAC7C,IAAAS,SAAA,GAAsCC,cAAQ,CAAC,YAAA;AAAA,MAAA,OAC7CZ,eAAe,CAACC,GAAG,EAAEC,YAAY,CAAC;AAAA,KACpC,CAAC;IAAAW,UAAA,GAAAC,4BAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAFMR,IAAAA,WAAW,GAAAU,UAAA,CAAA,CAAA,CAAA;AAAEE,IAAAA,cAAc,GAAAF,UAAA,CAAA,CAAA,CAAA;AAIlC,EAAA,IAAMG,QAAQ,GAAG,SAAXA,QAAQA,CAAGC,KAAK,EAAA;AAAA,IAAA,OACpBF,cAAc,CAAC,UAAAG,eAAe,EAAI;AAChC,MAAA,IAAMC,QAAQ,GACZ,OAAOF,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACC,eAAe,CAAC,GAAGD,KAAK;AAE9D,MAAA,IAAIG,WAAK,CAACD,QAAQ,CAAC,EAAE;QACnBE,oCAAsB,CAACpB,GAAG,CAAC;AAC7B,OAAC,MAAM;AACLqB,QAAAA,+BAAiB,CAACrB,GAAG,EAAEkB,QAAQ,CAAC;AAClC;AAEA,MAAA,OAAOA,QAAQ;AACjB,KAAC,CAAC;AAAA,GAAA;AAEJ,EAAA,OAAO,CAAChB,WAAW,EAAEa,QAAQ,CAAC;AAChC;;;;"}
1
+ {"version":3,"file":"useLocalStorage.js","sources":["../../../../src/react-utils/useLocalStorage/useLocalStorage.js"],"sourcesContent":["/* eslint-disable @bigbinary/neeto/no-local-storage */\n\nimport { useState } from \"react\";\n\nimport { isNil } from \"ramda\";\nimport { removeFromLocalStorage, setToLocalStorage } from \"utils\";\n\nconst getStorageValue = (key, defaultValue) => {\n try {\n const storedValue = localStorage.getItem(key);\n\n return storedValue ? JSON.parse(storedValue) : defaultValue;\n } catch (error) {\n logger.error(error);\n\n return defaultValue;\n }\n};\n\nconst useLocalStorage = (key, defaultValue) => {\n const [storedValue, setStoredValue] = useState(() =>\n getStorageValue(key, defaultValue)\n );\n\n const setValue = value =>\n setStoredValue(prevStoredValue => {\n const newValue =\n typeof value === \"function\" ? value(prevStoredValue) : value;\n\n if (isNil(newValue)) {\n removeFromLocalStorage(key);\n } else {\n setToLocalStorage(key, newValue);\n }\n\n return newValue;\n });\n\n return [storedValue, setValue];\n};\n\nexport default useLocalStorage;\n"],"names":["getStorageValue","key","defaultValue","storedValue","localStorage","getItem","JSON","parse","error","logger","useLocalStorage","_useState","useState","_useState2","_slicedToArray","setStoredValue","setValue","value","prevStoredValue","newValue","isNil","removeFromLocalStorage","setToLocalStorage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAMA,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,GAAG,EAAEC,YAAY,EAAK;EAC7C,IAAI;AACF,IAAA,IAAMC,WAAW,GAAGC,YAAY,CAACC,OAAO,CAACJ,GAAG,CAAC;IAE7C,OAAOE,WAAW,GAAGG,IAAI,CAACC,KAAK,CAACJ,WAAW,CAAC,GAAGD,YAAY;GAC5D,CAAC,OAAOM,KAAK,EAAE;AACdC,IAAAA,MAAM,CAACD,KAAK,CAACA,KAAK,CAAC;AAEnB,IAAA,OAAON,YAAY;AACrB;AACF,CAAC;AAEKQ,IAAAA,eAAe,GAAG,SAAlBA,eAAeA,CAAIT,GAAG,EAAEC,YAAY,EAAK;EAC7C,IAAAS,SAAA,GAAsCC,cAAQ,CAAC,YAAA;AAAA,MAAA,OAC7CZ,eAAe,CAACC,GAAG,EAAEC,YAAY,CAAC;AAAA,KACpC,CAAC;IAAAW,UAAA,GAAAC,4BAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAFMR,IAAAA,WAAW,GAAAU,UAAA,CAAA,CAAA,CAAA;AAAEE,IAAAA,cAAc,GAAAF,UAAA,CAAA,CAAA,CAAA;AAIlC,EAAA,IAAMG,QAAQ,GAAG,SAAXA,QAAQA,CAAGC,KAAK,EAAA;AAAA,IAAA,OACpBF,cAAc,CAAC,UAAAG,eAAe,EAAI;AAChC,MAAA,IAAMC,QAAQ,GACZ,OAAOF,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACC,eAAe,CAAC,GAAGD,KAAK;AAE9D,MAAA,IAAIG,WAAK,CAACD,QAAQ,CAAC,EAAE;QACnBE,oCAAsB,CAACpB,GAAG,CAAC;AAC7B,OAAC,MAAM;AACLqB,QAAAA,+BAAiB,CAACrB,GAAG,EAAEkB,QAAQ,CAAC;AAClC;AAEA,MAAA,OAAOA,QAAQ;AACjB,KAAC,CAAC;AAAA,GAAA;AAEJ,EAAA,OAAO,CAAChB,WAAW,EAAEa,QAAQ,CAAC;AAChC;;;;"}
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); }
4
+
5
+ var FORMAT_WITH_TIME = ["time", "timeWithSeconds", "dateTime", "dateTimeWithSeconds", "dateWeekTime", "dateWeekTimeDayExtended", "extended"];
6
+ var FORMAT_OVERRIDE_LOADERS = {
7
+ ja: function ja() {
8
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./dayjsFormatOverrides/ja.js')); });
9
+ }
10
+ };
11
+
12
+ exports.FORMAT_OVERRIDE_LOADERS = FORMAT_OVERRIDE_LOADERS;
13
+ exports.FORMAT_WITH_TIME = FORMAT_WITH_TIME;
14
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../../../src/utils/constants.js"],"sourcesContent":["export const FORMAT_WITH_TIME = [\n \"time\",\n \"timeWithSeconds\",\n \"dateTime\",\n \"dateTimeWithSeconds\",\n \"dateWeekTime\",\n \"dateWeekTimeDayExtended\",\n \"extended\",\n];\n\nexport const FORMAT_OVERRIDE_LOADERS = {\n ja: () => import(\"./dayjsFormatOverrides/ja\"),\n};\n"],"names":["FORMAT_WITH_TIME","FORMAT_OVERRIDE_LOADERS","ja"],"mappings":";;;;IAAaA,gBAAgB,GAAG,CAC9B,MAAM,EACN,iBAAiB,EACjB,UAAU,EACV,qBAAqB,EACrB,cAAc,EACd,yBAAyB,EACzB,UAAU;AAGL,IAAMC,uBAAuB,GAAG;EACrCC,EAAE,EAAE,SAAJA,EAAEA,GAAA;IAAA,OAAQ,4HAAkC,MAAC;AAAA;AAC/C;;;;;"}
@@ -1,11 +1,17 @@
1
1
  'use strict';
2
2
 
3
+ var utils_constants = require('./constants.js');
3
4
  var utils_dayjs = require('./dayjs.js');
5
+ var utils_dayjsFormatOverrides_default = require('./dayjsFormatOverrides/default.js');
6
+ var utils_localePlugin = require('./localePlugin.js');
4
7
  require('../defineProperty-lChFfVqi.js');
5
8
  require('../typeof-D4ZZ_FlZ.js');
6
9
  require('../toConsumableArray-tBKHqzE3.js');
7
10
  require('../unsupportedIterableToArray-BoHMiKNA.js');
8
11
  require('dayjs');
12
+ require('../index-bFmfHzbL.js');
13
+ require('../_commonjsHelpers-BJu3ubxk.js');
14
+ require('i18next');
9
15
 
10
16
  /* eslint-disable @bigbinary/neeto/use-standard-date-time-formats */
11
17
  var getDefaultDateFormat = function getDefaultDateFormat() {
@@ -17,61 +23,80 @@ var getDefaultTimeFormat = function getDefaultTimeFormat() {
17
23
  return (_window$globalProps$u2 = (_window$globalProps2 = window.globalProps) === null || _window$globalProps2 === void 0 || (_window$globalProps2 = _window$globalProps2.user) === null || _window$globalProps2 === void 0 ? void 0 : _window$globalProps2.timeFormat) !== null && _window$globalProps$u2 !== void 0 ? _window$globalProps$u2 : "12h";
18
24
  }; // "12h" | "24h"
19
25
 
20
- var is12hourTimeFormat = function is12hourTimeFormat() {
26
+ var is12h = function is12h() {
21
27
  return getDefaultTimeFormat() === "12h";
22
28
  };
23
- var timeFormat = {
24
- fromNow: function fromNow(time) {
25
- return utils_dayjs(time).fromNow();
26
- },
27
- time: function time(_time) {
28
- return utils_dayjs(_time).format(is12hourTimeFormat() ? "h:mm A" : "HH:mm");
29
- },
30
- timeWithSeconds: function timeWithSeconds(time) {
31
- return utils_dayjs(time).format(is12hourTimeFormat() ? "h:mm:ss A" : "HH:mm:ss");
32
- },
33
- date: function date(time) {
34
- return utils_dayjs(time).format("ll");
35
- },
36
- dateWeek: function dateWeek(time) {
37
- return utils_dayjs(time).format("ll ddd");
38
- },
39
- dateWeekDayExtended: function dateWeekDayExtended(time) {
40
- return utils_dayjs(time).format("ll dddd");
41
- },
42
- dateWeekWithoutYear: function dateWeekWithoutYear(time) {
43
- return utils_dayjs(time).format("MMM D, ddd");
44
- },
45
- dateWeekWithoutYearDayExtended: function dateWeekWithoutYearDayExtended(time) {
46
- return utils_dayjs(time).format("MMM D, dddd");
47
- },
48
- dateTime: function dateTime(time) {
49
- return utils_dayjs(time).format(is12hourTimeFormat() ? "ll h:mm A" : "ll HH:mm");
50
- },
51
- dateTimeWithSeconds: function dateTimeWithSeconds(time) {
52
- return utils_dayjs(time).format(is12hourTimeFormat() ? "ll h:mm:ss A" : "ll HH:mm:ss");
53
- },
54
- dateWeekTime: function dateWeekTime(time) {
55
- return utils_dayjs(time).format(is12hourTimeFormat() ? "ll ddd h:mm A" : "ll ddd HH:mm");
56
- },
57
- dateWeekTimeDayExtended: function dateWeekTimeDayExtended(time) {
58
- return utils_dayjs(time).format(is12hourTimeFormat() ? "ll dddd h:mm A" : "ll dddd HH:mm");
59
- },
60
- extended: function extended(time) {
61
- var date = utils_dayjs(time);
62
- var dateTime = date.format(is12hourTimeFormat() ? "dddd LL h:mm A" : "dddd LL HH:mm");
63
- var fromNow = date.fromNow();
64
- return "".concat(dateTime, " (").concat(fromNow, ")");
65
- },
66
- "default": function _default(time) {
67
- return utils_dayjs(time).format(getDefaultDateFormat());
68
- },
69
- defaultWithTime: function defaultWithTime(time) {
70
- return utils_dayjs(time).format(is12hourTimeFormat() ? "".concat(getDefaultDateFormat(), " h:mm A") : "".concat(getDefaultDateFormat(), " HH:mm"));
71
- }
29
+ var getDateFormat = function getDateFormat(key, locale) {
30
+ var _overrides$resolvedKe;
31
+ var resolvedLocale = locale;
32
+ var overrides = utils_localePlugin.getLocaleFormatOverrides(resolvedLocale);
33
+ var resolvedKey = utils_constants.FORMAT_WITH_TIME.includes(key) ? key + (is12h() ? "12" : "24") : key;
34
+ return (_overrides$resolvedKe = overrides === null || overrides === void 0 ? void 0 : overrides[resolvedKey]) !== null && _overrides$resolvedKe !== void 0 ? _overrides$resolvedKe : utils_dayjsFormatOverrides_default[resolvedKey];
72
35
  };
36
+ var createTimeFormat = function createTimeFormat(dayjs) {
37
+ var locale = dayjs.locale();
38
+ return {
39
+ // Relative
40
+ fromNow: function fromNow(time) {
41
+ return dayjs(time).fromNow();
42
+ },
43
+ // Time only
44
+ time: function time(_time) {
45
+ return dayjs(_time).format(getDateFormat("time", locale));
46
+ },
47
+ timeWithSeconds: function timeWithSeconds(time) {
48
+ return dayjs(time).format(getDateFormat("timeWithSeconds", locale));
49
+ },
50
+ // Date only
51
+ date: function date(time) {
52
+ return dayjs(time).format(getDateFormat("date", locale));
53
+ },
54
+ dateWeek: function dateWeek(time) {
55
+ return dayjs(time).format(getDateFormat("dateWeek", locale));
56
+ },
57
+ dateWeekDayExtended: function dateWeekDayExtended(time) {
58
+ return dayjs(time).format(getDateFormat("dateWeekDayExtended", locale));
59
+ },
60
+ dateWeekWithoutYear: function dateWeekWithoutYear(time) {
61
+ return dayjs(time).format(getDateFormat("dateWeekWithoutYear", locale));
62
+ },
63
+ dateWeekWithoutYearDayExtended: function dateWeekWithoutYearDayExtended(time) {
64
+ return dayjs(time).format(getDateFormat("dateWeekWithoutYearDayExtended", locale));
65
+ },
66
+ // Date + time
67
+ dateTime: function dateTime(time) {
68
+ return dayjs(time).format(getDateFormat("dateTime", locale));
69
+ },
70
+ dateTimeWithSeconds: function dateTimeWithSeconds(time) {
71
+ return dayjs(time).format(getDateFormat("dateTimeWithSeconds", locale));
72
+ },
73
+ dateWeekTime: function dateWeekTime(time) {
74
+ return dayjs(time).format(getDateFormat("dateWeekTime", locale));
75
+ },
76
+ dateWeekTimeDayExtended: function dateWeekTimeDayExtended(time) {
77
+ return dayjs(time).format(getDateFormat("dateWeekTimeDayExtended", locale));
78
+ },
79
+ // Extended
80
+ extended: function extended(time) {
81
+ var date = dayjs(time);
82
+ var dateTime = date.format(getDateFormat("extended", locale));
83
+ var fromNow = date.fromNow();
84
+ return "".concat(dateTime, " (").concat(fromNow, ")");
85
+ },
86
+ "default": function _default(time) {
87
+ return dayjs(time).format(getDefaultDateFormat());
88
+ },
89
+ defaultWithTime: function defaultWithTime(time) {
90
+ return dayjs(time).format("".concat(getDefaultDateFormat(), " ").concat(getDateFormat("time", locale)));
91
+ }
92
+ };
93
+ };
94
+ var timeFormat = createTimeFormat(utils_dayjs);
95
+ var createDateFormat = createTimeFormat;
73
96
  var dateFormat = timeFormat;
74
97
 
98
+ exports.createDateFormat = createDateFormat;
99
+ exports.createTimeFormat = createTimeFormat;
75
100
  exports.dateFormat = dateFormat;
76
101
  exports.timeFormat = timeFormat;
77
102
  //# sourceMappingURL=datetime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"datetime.js","sources":["../../../src/utils/datetime.js"],"sourcesContent":["/* eslint-disable @bigbinary/neeto/use-standard-date-time-formats */\nimport dayjs from \"./dayjs\";\n\nconst getDefaultDateFormat = () =>\n window.globalProps?.user?.dateFormat ?? \"DD/MM/YYYY\";\n\nconst getDefaultTimeFormat = () =>\n window.globalProps?.user?.timeFormat ?? \"12h\"; // \"12h\" | \"24h\"\n\nconst is12hourTimeFormat = () => getDefaultTimeFormat() === \"12h\";\n\nexport const timeFormat = {\n fromNow: time => dayjs(time).fromNow(),\n\n time: time => dayjs(time).format(is12hourTimeFormat() ? \"h:mm A\" : \"HH:mm\"),\n\n timeWithSeconds: time =>\n dayjs(time).format(is12hourTimeFormat() ? \"h:mm:ss A\" : \"HH:mm:ss\"),\n\n date: time => dayjs(time).format(\"ll\"),\n dateWeek: time => dayjs(time).format(\"ll ddd\"),\n dateWeekDayExtended: time => dayjs(time).format(\"ll dddd\"),\n dateWeekWithoutYear: time => dayjs(time).format(\"MMM D, ddd\"),\n dateWeekWithoutYearDayExtended: time => dayjs(time).format(\"MMM D, dddd\"),\n\n dateTime: time =>\n dayjs(time).format(is12hourTimeFormat() ? \"ll h:mm A\" : \"ll HH:mm\"),\n\n dateTimeWithSeconds: time =>\n dayjs(time).format(is12hourTimeFormat() ? \"ll h:mm:ss A\" : \"ll HH:mm:ss\"),\n\n dateWeekTime: time =>\n dayjs(time).format(is12hourTimeFormat() ? \"ll ddd h:mm A\" : \"ll ddd HH:mm\"),\n\n dateWeekTimeDayExtended: time =>\n dayjs(time).format(\n is12hourTimeFormat() ? \"ll dddd h:mm A\" : \"ll dddd HH:mm\"\n ),\n\n extended: time => {\n const date = dayjs(time);\n const dateTime = date.format(\n is12hourTimeFormat() ? \"dddd LL h:mm A\" : \"dddd LL HH:mm\"\n );\n const fromNow = date.fromNow();\n\n return `${dateTime} (${fromNow})`;\n },\n\n default: time => dayjs(time).format(getDefaultDateFormat()),\n defaultWithTime: time =>\n dayjs(time).format(\n is12hourTimeFormat()\n ? `${getDefaultDateFormat()} h:mm A`\n : `${getDefaultDateFormat()} HH:mm`\n ),\n};\n\nexport const dateFormat = timeFormat;\n"],"names":["getDefaultDateFormat","_window$globalProps$u","_window$globalProps","window","globalProps","user","dateFormat","getDefaultTimeFormat","_window$globalProps$u2","_window$globalProps2","timeFormat","is12hourTimeFormat","fromNow","time","dayjs","format","timeWithSeconds","date","dateWeek","dateWeekDayExtended","dateWeekWithoutYear","dateWeekWithoutYearDayExtended","dateTime","dateTimeWithSeconds","dateWeekTime","dateWeekTimeDayExtended","extended","concat","default","defaultWithTime"],"mappings":";;;;;;;;;AAAA;AAGA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAoBA,GAAA;EAAA,IAAAC,qBAAA,EAAAC,mBAAA;EAAA,OAAAD,CAAAA,qBAAA,GAAAC,CAAAA,mBAAA,GACxBC,MAAM,CAACC,WAAW,MAAAF,IAAAA,IAAAA,mBAAA,KAAAA,MAAAA,IAAAA,CAAAA,mBAAA,GAAlBA,mBAAA,CAAoBG,IAAI,MAAA,IAAA,IAAAH,mBAAA,KAAA,MAAA,GAAA,MAAA,GAAxBA,mBAAA,CAA0BI,UAAU,MAAA,IAAA,IAAAL,qBAAA,KAAA,MAAA,GAAAA,qBAAA,GAAI,YAAY;AAAA,CAAA;AAEtD,IAAMM,oBAAoB,GAAG,SAAvBA,oBAAoBA,GAAA;EAAA,IAAAC,sBAAA,EAAAC,oBAAA;EAAA,OAAAD,CAAAA,sBAAA,GAAAC,CAAAA,oBAAA,GACxBN,MAAM,CAACC,WAAW,MAAAK,IAAAA,IAAAA,oBAAA,KAAAA,MAAAA,IAAAA,CAAAA,oBAAA,GAAlBA,oBAAA,CAAoBJ,IAAI,MAAA,IAAA,IAAAI,oBAAA,KAAA,MAAA,GAAA,MAAA,GAAxBA,oBAAA,CAA0BC,UAAU,MAAA,IAAA,IAAAF,sBAAA,KAAA,MAAA,GAA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,EAAAK,IAAAA,CAAAA,CAAAA,MAAA,CAAKf,OAAO,EAAA,GAAA,CAAA;GAC/B;EAED,SAAS,EAAA,SAATgB,QAAOA,CAAEf,IAAI,EAAA;IAAA,OAAIC,WAAK,CAACD,IAAI,CAAC,CAACE,MAAM,CAACf,oBAAoB,EAAE,CAAC;AAAA,GAAA;AAC3D6B,EAAAA,eAAe,EAAE,SAAjBA,eAAeA,CAAEhB,IAAI,EAAA;IAAA,OACnBC,WAAK,CAACD,IAAI,CAAC,CAACE,MAAM,CAChBJ,kBAAkB,EAAE,GAAA,EAAA,CAAAgB,MAAA,CACb3B,oBAAoB,EAAE,EAAA2B,SAAAA,CAAAA,GAAAA,EAAAA,CAAAA,MAAA,CACtB3B,oBAAoB,EAAE,EAAA,QAAA,CAC/B,CAAC;AAAA;AACL;AAEO,IAAMM,UAAU,GAAGI;;;;;"}
1
+ {"version":3,"file":"datetime.js","sources":["../../../src/utils/datetime.js"],"sourcesContent":["/* eslint-disable @bigbinary/neeto/use-standard-date-time-formats */\nimport { FORMAT_WITH_TIME } from \"./constants\";\nimport commonDayjs from \"./dayjs\";\nimport defaultFormats from \"./dayjsFormatOverrides/default\";\nimport { getLocaleFormatOverrides } from \"./localePlugin\";\n\nconst getDefaultDateFormat = () =>\n window.globalProps?.user?.dateFormat ?? \"DD/MM/YYYY\";\n\nconst getDefaultTimeFormat = () =>\n window.globalProps?.user?.timeFormat ?? \"12h\"; // \"12h\" | \"24h\"\n\nconst is12h = () => getDefaultTimeFormat() === \"12h\";\n\nconst getDateFormat = (key, locale) => {\n const resolvedLocale = locale;\n const overrides = getLocaleFormatOverrides(resolvedLocale);\n\n const resolvedKey = FORMAT_WITH_TIME.includes(key)\n ? key + (is12h() ? \"12\" : \"24\")\n : key;\n\n return overrides?.[resolvedKey] ?? defaultFormats[resolvedKey];\n};\n\nexport const createTimeFormat = dayjs => {\n const locale = dayjs.locale();\n\n return {\n // Relative\n fromNow: time => dayjs(time).fromNow(),\n\n // Time only\n time: time => dayjs(time).format(getDateFormat(\"time\", locale)),\n timeWithSeconds: time =>\n dayjs(time).format(getDateFormat(\"timeWithSeconds\", locale)),\n\n // Date only\n date: time => dayjs(time).format(getDateFormat(\"date\", locale)),\n dateWeek: time => dayjs(time).format(getDateFormat(\"dateWeek\", locale)),\n dateWeekDayExtended: time =>\n dayjs(time).format(getDateFormat(\"dateWeekDayExtended\", locale)),\n dateWeekWithoutYear: time =>\n dayjs(time).format(getDateFormat(\"dateWeekWithoutYear\", locale)),\n dateWeekWithoutYearDayExtended: time =>\n dayjs(time).format(\n getDateFormat(\"dateWeekWithoutYearDayExtended\", locale)\n ),\n\n // Date + time\n dateTime: time => dayjs(time).format(getDateFormat(\"dateTime\", locale)),\n dateTimeWithSeconds: time =>\n dayjs(time).format(getDateFormat(\"dateTimeWithSeconds\", locale)),\n dateWeekTime: time =>\n dayjs(time).format(getDateFormat(\"dateWeekTime\", locale)),\n dateWeekTimeDayExtended: time =>\n dayjs(time).format(getDateFormat(\"dateWeekTimeDayExtended\", locale)),\n\n // Extended\n extended: time => {\n const date = dayjs(time);\n const dateTime = date.format(getDateFormat(\"extended\", locale));\n const fromNow = date.fromNow();\n\n return `${dateTime} (${fromNow})`;\n },\n\n default: time => dayjs(time).format(getDefaultDateFormat()),\n defaultWithTime: time =>\n dayjs(time).format(\n `${getDefaultDateFormat()} ${getDateFormat(\"time\", locale)}`\n ),\n };\n};\n\nexport const timeFormat = createTimeFormat(commonDayjs);\n\nexport const createDateFormat = createTimeFormat;\nexport const dateFormat = timeFormat;\n"],"names":["getDefaultDateFormat","_window$globalProps$u","_window$globalProps","window","globalProps","user","dateFormat","getDefaultTimeFormat","_window$globalProps$u2","_window$globalProps2","timeFormat","is12h","getDateFormat","key","locale","_overrides$resolvedKe","resolvedLocale","overrides","getLocaleFormatOverrides","resolvedKey","FORMAT_WITH_TIME","includes","defaultFormats","createTimeFormat","dayjs","fromNow","time","format","timeWithSeconds","date","dateWeek","dateWeekDayExtended","dateWeekWithoutYear","dateWeekWithoutYearDayExtended","dateTime","dateTimeWithSeconds","dateWeekTime","dateWeekTimeDayExtended","extended","concat","default","defaultWithTime","commonDayjs","createDateFormat"],"mappings":";;;;;;;;;;;;;;;AAAA;AAMA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAoBA,GAAA;EAAA,IAAAC,qBAAA,EAAAC,mBAAA;EAAA,OAAAD,CAAAA,qBAAA,GAAAC,CAAAA,mBAAA,GACxBC,MAAM,CAACC,WAAW,MAAAF,IAAAA,IAAAA,mBAAA,KAAAA,MAAAA,IAAAA,CAAAA,mBAAA,GAAlBA,mBAAA,CAAoBG,IAAI,MAAA,IAAA,IAAAH,mBAAA,KAAA,MAAA,GAAA,MAAA,GAAxBA,mBAAA,CAA0BI,UAAU,MAAA,IAAA,IAAAL,qBAAA,KAAA,MAAA,GAAAA,qBAAA,GAAI,YAAY;AAAA,CAAA;AAEtD,IAAMM,oBAAoB,GAAG,SAAvBA,oBAAoBA,GAAA;EAAA,IAAAC,sBAAA,EAAAC,oBAAA;EAAA,OAAAD,CAAAA,sBAAA,GAAAC,CAAAA,oBAAA,GACxBN,MAAM,CAACC,WAAW,MAAAK,IAAAA,IAAAA,oBAAA,KAAAA,MAAAA,IAAAA,CAAAA,oBAAA,GAAlBA,oBAAA,CAAoBJ,IAAI,MAAA,IAAA,IAAAI,oBAAA,KAAA,MAAA,GAAA,MAAA,GAAxBA,oBAAA,CAA0BC,UAAU,MAAA,IAAA,IAAAF,sBAAA,KAAA,MAAA,GAAAA,sBAAA,GAAI,KAAK;AAAA,CAAA,CAAC;;AAEhD,IAAMG,KAAK,GAAG,SAARA,KAAKA,GAAA;AAAA,EAAA,OAASJ,oBAAoB,EAAE,KAAK,KAAK;AAAA,CAAA;AAEpD,IAAMK,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,GAAG,EAAEC,MAAM,EAAK;AAAA,EAAA,IAAAC,qBAAA;EACrC,IAAMC,cAAc,GAAGF,MAAM;AAC7B,EAAA,I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m A",
5
+ time24: "HH:mm",
6
+ timeWithSeconds12: "h:mm:ss A",
7
+ timeWithSeconds24: "HH:mm:ss",
8
+ date: "ll",
9
+ dateWeek: "ll ddd",
10
+ dateWeekDayExtended: "ll dddd",
11
+ dateWeekWithoutYear: "MMM D, ddd",
12
+ dateWeekWithoutYearDayExtended: "MMM D, dddd",
13
+ dateTime12: "ll h:mm A",
14
+ dateTime24: "ll HH:mm",
15
+ dateTimeWithSeconds12: "ll h:mm:ss A",
16
+ dateTimeWithSeconds24: "ll HH:mm:ss",
17
+ dateWeekTime12: "ll ddd h:mm A",
18
+ dateWeekTime24: "ll ddd HH:mm",
19
+ dateWeekTimeDayExtended12: "ll dddd h:mm A",
20
+ dateWeekTimeDayExtended24: "ll dddd HH:mm",
21
+ extended12: "dddd LL h:mm A",
22
+ extended24: "dddd LL HH:mm"
23
+ };
24
+
25
+ module.exports = defaultFormats;
26
+ //# sourceMappingURL=default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default.js","sources":["../../../../src/utils/dayjsFormatOverrides/default.js"],"sourcesContent":["export default {\n time12: \"h:mm A\",\n time24: \"HH:mm\",\n timeWithSeconds12: \"h:mm:ss A\",\n timeWithSeconds24: \"HH:mm:ss\",\n date: \"ll\",\n dateWeek: \"ll ddd\",\n dateWeekDayExtended: \"ll dddd\",\n dateWeekWithoutYear: \"MMM D, ddd\",\n dateWeekWithoutYearDayExtended: \"MMM D, dddd\",\n dateTime12: \"ll h:mm A\",\n dateTime24: \"ll HH:mm\",\n dateTimeWithSeconds12: \"ll h:mm:ss A\",\n dateTimeWithSeconds24: \"ll HH:mm:ss\",\n dateWeekTime12: \"ll ddd h:mm A\",\n dateWeekTime24: \"ll ddd HH:mm\",\n dateWeekTimeDayExtended12: \"ll dddd h:mm A\",\n dateWeekTimeDayExtended24: \"ll dddd HH:mm\",\n extended12: \"dddd LL h:mm A\",\n extended24: \"dddd LL HH:mm\",\n};\n"],"names":["time12","time24","timeWithSeconds12","timeWithSeconds24","date","dateWeek","dateWeekDayExtended","dateWeekWithoutYear","dateWeekWithoutYearDayExtended","dateTime12","dateTime24","dateTimeWithSeconds12","dateTimeWithSeconds24","dateWeekTime12","dateWeekTime24","dateWeekTimeDayExtended12","dateWeekTimeDayExtended24","extended12","extended24"],"mappings":";;AAAA,qBAAe;AACbA,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,MAAM,EAAE,OAAO;AACfC,EAAAA,iBAAiB,EAAE,WAAW;AAC9BC,EAAAA,iBAAiB,EAAE,UAAU;AAC7BC,EAAAA,IAAI,EAAE,IAAI;AACVC,EAAAA,QAAQ,EAAE,QAAQ;AAClBC,EAAAA,mBAAmB,EAAE,SAAS;AAC9BC,EAAAA,mBAAmB,EAAE,YAAY;AACjCC,EAAAA,8BAA8B,EAAE,aAAa;AAC7CC,EAAAA,UAAU,EAAE,WAAW;AACvBC,EAAAA,UAAU,EAAE,UAAU;AACtBC,EAAAA,qBAAqB,EAAE,cAAc;AACrCC,EAAAA,qBAAqB,EAAE,aAAa;AACpCC,EAAAA,cAAc,EAAE,eAAe;AAC/BC,EAAAA,cAAc,EAAE,cAAc;AAC9BC,EAAAA,yBAAyB,EAAE,gBAAgB;AAC3CC,EAAAA,yBAAyB,EAAE,eAAe;AAC1CC,EAAAA,UAAU,EAAE,gBAAgB;AAC5BC,EAAAA,UAAU,EAAE;AACd,CAAC;;;;"}
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ var ja = {
4
+ time12: "A h時mm分",
5
+ time24: "HH:mm",
6
+ timeWithSeconds12: "A h時mm分ss秒",
7
+ timeWithSeconds24: "HH:mm:ss",
8
+ dateWeek: "YYYY年M月D日(ddd)",
9
+ dateWeekDayExtended: "YYYY年M月D日(dddd)",
10
+ dateWeekWithoutYear: "M月D日(ddd)",
11
+ dateWeekWithoutYearDayExtended: "M月D日(dddd)",
12
+ dateTime12: "YYYY年M月D日 A h時mm分",
13
+ dateTime24: "YYYY年M月D日 HH:mm",
14
+ dateTimeWithSeconds12: "YYYY年M月D日 A h時mm分ss秒",
15
+ dateTimeWithSeconds24: "YYYY年M月D日 HH:mm:ss",
16
+ dateWeekTime12: "YYYY年M月D日(ddd) A h時mm分",
17
+ dateWeekTime24: "YYYY年M月D日(ddd) HH:mm",
18
+ dateWeekTimeDayExtended12: "YYYY年M月D日(dddd) A h時mm分",
19
+ dateWeekTimeDayExtended24: "YYYY年M月D日(dddd) HH:mm",
20
+ extended12: "YYYY年M月D日(dddd) A h時mm分",
21
+ extended24: "YYYY年M月D日(dddd) HH:mm"
22
+ };
23
+
24
+ module.exports = ja;
25
+ //# sourceMappingURL=ja.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ja.js","sources":["../../../../src/utils/dayjsFormatOverrides/ja.js"],"sourcesContent":["export default {\n time12: \"A h時mm分\",\n time24: \"HH:mm\",\n timeWithSeconds12: \"A h時mm分ss秒\",\n timeWithSeconds24: \"HH:mm:ss\",\n dateWeek: \"YYYY年M月D日(ddd)\",\n dateWeekDayExtended: \"YYYY年M月D日(dddd)\",\n dateWeekWithoutYear: \"M月D日(ddd)\",\n dateWeekWithoutYearDayExtended: \"M月D日(dddd)\",\n dateTime12: \"YYYY年M月D日 A h時mm分\",\n dateTime24: \"YYYY年M月D日 HH:mm\",\n dateTimeWithSeconds12: \"YYYY年M月D日 A h時mm分ss秒\",\n dateTimeWithSeconds24: \"YYYY年M月D日 HH:mm:ss\",\n dateWeekTime12: \"YYYY年M月D日(ddd) A h時mm分\",\n dateWeekTime24: \"YYYY年M月D日(ddd) HH:mm\",\n dateWeekTimeDayExtended12: \"YYYY年M月D日(dddd) A h時mm分\",\n dateWeekTimeDayExtended24: \"YYYY年M月D日(dddd) HH:mm\",\n extended12: \"YYYY年M月D日(dddd) A h時mm分\",\n extended24: \"YYYY年M月D日(dddd) HH:mm\",\n};\n"],"names":["time12","time24","timeWithSeconds12","timeWithSeconds24","dateWeek","dateWeekDayExtended","dateWeekWithoutYear","dateWeekWithoutYearDayExtended","dateTime12","dateTime24","dateTimeWithSeconds12","dateTimeWithSeconds24","dateWeekTime12","dateWeekTime24","dateWeekTimeDayExtended12","dateWeekTimeDayExtended24","extended12","extended24"],"mappings":";;AAAA,SAAe;AACbA,EAAAA,MAAM,EAAE,SAAS;AACjBC,EAAAA,MAAM,EAAE,OAAO;AACfC,EAAAA,iBAAiB,EAAE,YAAY;AAC/BC,EAAAA,iBAAiB,EAAE,UAAU;AAC7BC,EAAAA,QAAQ,EAAE,gBAAgB;AAC1BC,EAAAA,mBAAmB,EAAE,iBAAiB;AACtCC,EAAAA,mBAAmB,EAAE,WAAW;AAChCC,EAAAA,8BAA8B,EAAE,YAAY;AAC5CC,EAAAA,UAAU,EAAE,mBAAmB;AAC/BC,EAAAA,UAAU,EAAE,iBAAiB;AAC7BC,EAAAA,qBAAqB,EAAE,sBAAsB;AAC7CC,EAAAA,qBAAqB,EAAE,oBAAoB;AAC3CC,EAAAA,cAAc,EAAE,wBAAwB;AACxCC,EAAAA,cAAc,EAAE,sBAAsB;AACtCC,EAAAA,yBAAyB,EAAE,yBAAyB;AACpDC,EAAAA,yBAAyB,EAAE,uBAAuB;AAClDC,EAAAA,UAAU,EAAE,yBAAyB;AACrCC,EAAAA,UAAU,EAAE;AACd,CAAC;;;;"}
@@ -27,6 +27,9 @@ require('i18next');
27
27
  require('@bigbinary/neeto-cist');
28
28
  require('@bigbinary/neetoui/Toastr');
29
29
  require('qs');
30
+ require('./constants.js');
31
+ require('./dayjsFormatOverrides/default.js');
32
+ require('./localePlugin.js');
30
33
  require('@rails/actioncable');
31
34
  require('dayjs');
32
35
  require('../constants/regex.js');
@@ -54,6 +57,8 @@ exports.showThumbsUpToastr = utils_general.showThumbsUpToastr;
54
57
  exports.simulateApiCall = utils_general.simulateApiCall;
55
58
  exports.toLocale = utils_general.toLocale;
56
59
  exports.withEventTargetValue = utils_general.withEventTargetValue;
60
+ exports.createDateFormat = utils_datetime.createDateFormat;
61
+ exports.createTimeFormat = utils_datetime.createTimeFormat;
57
62
  exports.dateFormat = utils_datetime.dateFormat;
58
63
  exports.timeFormat = utils_datetime.timeFormat;
59
64
  exports.hasAllPermissions = utils_permissions.hasAllPermissions;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,10 +1,25 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var defineProperty = require('../defineProperty-lChFfVqi.js');
3
6
  var index = require('../index-bFmfHzbL.js');
4
7
  var i18next = require('i18next');
8
+ var utils_constants = require('./constants.js');
9
+ var utils_dayjsFormatOverrides_default = require('./dayjsFormatOverrides/default.js');
10
+ require('../typeof-D4ZZ_FlZ.js');
5
11
  require('../_commonjsHelpers-BJu3ubxk.js');
6
12
 
13
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { defineProperty._defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
15
  var DEFAULT_LOCALE = "en";
16
+ var localeFormatOverridesCache = {};
17
+ var getLocaleFormatOverrides = function getLocaleFormatOverrides(locale) {
18
+ return localeFormatOverridesCache[locale];
19
+ };
20
+ var setLocaleFormatOverrides = function setLocaleFormatOverrides(locale, overrides) {
21
+ localeFormatOverridesCache[locale] = overrides;
22
+ };
8
23
  var LOCALES = {
9
24
  af: function af() {
10
25
  return import('dayjs/locale/af');
@@ -457,7 +472,7 @@ var getDayjsLocale = function getDayjsLocale() {
457
472
  };
458
473
  var localePlugin = (/*#__PURE__*/function () {
459
474
  var _ref = index._asyncToGenerator(/*#__PURE__*/index._regeneratorRuntime.mark(function _callee(_o, _c, d) {
460
- var locale;
475
+ var locale, loadOverride, overrides;
461
476
  return index._regeneratorRuntime.wrap(function _callee$(_context) {
462
477
  while (1) switch (_context.prev = _context.next) {
463
478
  case 0:
@@ -466,23 +481,41 @@ var localePlugin = (/*#__PURE__*/function () {
466
481
  _context.next = 4;
467
482
  return LOCALES[locale]();
468
483
  case 4:
484
+ loadOverride = utils_constants.FORMAT_OVERRIDE_LOADERS[locale];
485
+ if (!loadOverride) {
486
+ _context.next = 11;
487
+ break;
488
+ }
489
+ _context.next = 8;
490
+ return loadOverride();
491
+ case 8:
492
+ _context.t0 = _context.sent["default"];
493
+ _context.next = 12;
494
+ break;
495
+ case 11:
496
+ _context.t0 = {};
497
+ case 12:
498
+ overrides = _context.t0;
499
+ setLocaleFormatOverrides(locale, _objectSpread(_objectSpread({}, utils_dayjsFormatOverrides_default), overrides));
469
500
  d.locale(locale);
470
- _context.next = 10;
501
+ _context.next = 20;
471
502
  break;
472
- case 7:
473
- _context.prev = 7;
474
- _context.t0 = _context["catch"](0);
503
+ case 17:
504
+ _context.prev = 17;
505
+ _context.t1 = _context["catch"](0);
475
506
  d.locale(DEFAULT_LOCALE);
476
- case 10:
507
+ case 20:
477
508
  case "end":
478
509
  return _context.stop();
479
510
  }
480
- }, _callee, null, [[0, 7]]);
511
+ }, _callee, null, [[0, 17]]);
481
512
  }));
482
513
  return function (_x, _x2, _x3) {
483
514
  return _ref.apply(this, arguments);
484
515
  };
485
516
  }());
486
517
 
487
- module.exports = localePlugin;
518
+ exports.default = localePlugin;
519
+ exports.getLocaleFormatOverrides = getLocaleFormatOverrides;
520
+ exports.setLocaleFormatOverrides = setLocaleFormatOverrides;
488
521
  //# sourceMappingURL=localePlugin.js.map