@erpsquad/common 1.8.101 → 1.8.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.
- package/dist/_virtual/index/index.esm11.js +4 -2
- package/dist/_virtual/index/index.esm11.js.map +1 -1
- package/dist/_virtual/index/index.esm2.js +2 -4
- package/dist/_virtual/index/index.esm2.js.map +1 -1
- package/dist/_virtual/index/index11.js +1 -1
- package/dist/_virtual/index/index2.js +1 -1
- package/dist/hooks/use-translations/index.esm.js +1 -2
- package/dist/hooks/use-translations/index.esm.js.map +1 -1
- package/dist/hooks/use-translations/index.js +1 -1
- package/dist/hooks/use-translations/index.js.map +1 -1
- package/dist/node_modules/@asseinfo/react-kanban/dist/index/index.esm.js +1 -1
- package/dist/node_modules/@asseinfo/react-kanban/dist/index/index.js +1 -1
- package/dist/node_modules/@asseinfo/react-kanban/dist/index/index.js.map +1 -1
- package/dist/node_modules/@mui/icons-material/utils/createSvgIcon/index.esm.js +1 -1
- package/dist/node_modules/@mui/icons-material/utils/createSvgIcon/index.js +1 -1
- package/dist/node_modules/@mui/icons-material/utils/createSvgIcon/index.js.map +1 -1
- package/dist/style.css +72 -72
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { getAugmentedNamespace } from "../_commonjsHelpers/index.esm.js";
|
|
2
|
+
import * as index from "../../node_modules/@mui/material/utils/index/index.esm.js";
|
|
3
|
+
var require$$0 = /* @__PURE__ */ getAugmentedNamespace(index);
|
|
2
4
|
export {
|
|
3
|
-
|
|
5
|
+
require$$0 as default
|
|
4
6
|
};
|
|
5
7
|
//# sourceMappingURL=index.esm11.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm11.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm11.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import * as index from "../../node_modules/@mui/material/utils/index/index.esm.js";
|
|
3
|
-
var require$$0 = /* @__PURE__ */ getAugmentedNamespace(index);
|
|
1
|
+
var dist = { exports: {} };
|
|
4
2
|
export {
|
|
5
|
-
|
|
3
|
+
dist as __module
|
|
6
4
|
};
|
|
7
5
|
//# sourceMappingURL=index.esm2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm2.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_commonjsHelpers/index.js"),r=require("../../node_modules/@mui/material/utils/index/index.js"),s=/* @__PURE__ */e.getAugmentedNamespace(r);exports.default=s;
|
|
2
2
|
//# sourceMappingURL=index11.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0})
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.__module={exports:{}};
|
|
2
2
|
//# sourceMappingURL=index2.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useState, useEffect } from "react";
|
|
2
|
-
import { useLocation } from "react-router-dom";
|
|
3
2
|
import { useTranslation } from "react-i18next";
|
|
4
3
|
import { loadModuleTranslations } from "../../utils/translations/index.esm.js";
|
|
5
4
|
import modules from "../../constants/modules/index.esm.js";
|
|
@@ -8,7 +7,7 @@ let globalIsLoading = false;
|
|
|
8
7
|
let globalInitialLoad = true;
|
|
9
8
|
const useAppTranslations = () => {
|
|
10
9
|
const [isLoading, setIsLoading] = useState(globalInitialLoad);
|
|
11
|
-
const location =
|
|
10
|
+
const location = window.location;
|
|
12
11
|
const { t } = useTranslation();
|
|
13
12
|
useEffect(() => {
|
|
14
13
|
const erpModules = modules(t);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../src/hooks/use-translations.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../src/hooks/use-translations.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n// import { useLocation } from 'react-router-dom'\nimport { useTranslation } from 'react-i18next'\nimport { loadModuleTranslations } from '../utils/translations'\nimport modules from '../constants/modules'\n\n// Global state to prevent duplicate calls across all hook instances\nlet globalLastLoadedModules = ''\nlet globalIsLoading = false\nlet globalInitialLoad = true\n\nexport const useAppTranslations = () => {\n\tconst [isLoading, setIsLoading] = useState(globalInitialLoad)\n\tconst location = window.location\n\tconst { t } = useTranslation()\n\n\tuseEffect(() => {\n\t\tconst erpModules = modules(t)\n\t\tconst currentPath = location.pathname.toLowerCase()\n\n\t\tconst matchedModule = erpModules.find(\n\t\t\t(mod) =>\n\t\t\t\tmod.link.toLowerCase() === currentPath ||\n\t\t\t\tmod.connectedRoutes?.some((route: string) => currentPath.startsWith(route.toLowerCase()))\n\t\t)\n\n\t\tlet modulesToLoad: string[] = []\n\n\t\tif (matchedModule?.translationModule) {\n\t\t\tmodulesToLoad = [...matchedModule.translationModule, 'common']\n\t\t} else if (!matchedModule && currentPath === '/dashboard') {\n\t\t\tmodulesToLoad = ['common']\n\t\t}\n\n\t\tif (modulesToLoad.length > 0) {\n\t\t\tconst moduleKey = [...modulesToLoad].sort().join(',')\n\n\t\t\t// Skip if same modules are already loaded or currently loading\n\t\t\tif (globalLastLoadedModules === moduleKey || globalIsLoading) {\n\t\t\t\tif (globalInitialLoad) {\n\t\t\t\t\tsetIsLoading(false)\n\t\t\t\t\tglobalInitialLoad = false\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tglobalIsLoading = true\n\t\t\tglobalLastLoadedModules = moduleKey\n\t\t\tsetIsLoading(true)\n\n\t\t\tloadModuleTranslations(modulesToLoad).finally(() => {\n\t\t\t\tglobalIsLoading = false\n\t\t\t\tsetIsLoading(false)\n\t\t\t\tglobalInitialLoad = false\n\t\t\t})\n\t\t} else {\n\t\t\t// No modules to load, but still need to handle initial load state\n\t\t\tif (globalInitialLoad) {\n\t\t\t\tsetIsLoading(false)\n\t\t\t\tglobalInitialLoad = false\n\t\t\t}\n\t\t}\n\t}, [location.pathname, t])\n\n\treturn { isLoading }\n};\n\nexport default useAppTranslations;\n"],"names":[],"mappings":";;;;AAOA,IAAI,0BAA0B;AAC9B,IAAI,kBAAkB;AACtB,IAAI,oBAAoB;AAEjB,MAAM,qBAAqB,MAAM;AACvC,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,iBAAiB;AAC5D,QAAM,WAAW,OAAO;AACxB,QAAM,EAAE,EAAA,IAAM,eAAA;AAEd,YAAU,MAAM;AACf,UAAM,aAAa,QAAQ,CAAC;AAC5B,UAAM,cAAc,SAAS,SAAS,YAAA;AAEtC,UAAM,gBAAgB,WAAW;AAAA,MAChC,CAAC,QAAA;;AACA,mBAAI,KAAK,YAAA,MAAkB,iBAC3B,SAAI,oBAAJ,mBAAqB,KAAK,CAAC,UAAkB,YAAY,WAAW,MAAM,aAAa;AAAA;AAAA,IAAC;AAG1F,QAAI,gBAA0B,CAAA;AAE9B,QAAI,+CAAe,mBAAmB;AACrC,sBAAgB,CAAC,GAAG,cAAc,mBAAmB,QAAQ;AAAA,IAC9D,WAAW,CAAC,iBAAiB,gBAAgB,cAAc;AAC1D,sBAAgB,CAAC,QAAQ;AAAA,IAC1B;AAEA,QAAI,cAAc,SAAS,GAAG;AAC7B,YAAM,YAAY,CAAC,GAAG,aAAa,EAAE,KAAA,EAAO,KAAK,GAAG;AAGpD,UAAI,4BAA4B,aAAa,iBAAiB;AAC7D,YAAI,mBAAmB;AACtB,uBAAa,KAAK;AAClB,8BAAoB;AAAA,QACrB;AACA;AAAA,MACD;AAEA,wBAAkB;AAClB,gCAA0B;AAC1B,mBAAa,IAAI;AAEjB,6BAAuB,aAAa,EAAE,QAAQ,MAAM;AACnD,0BAAkB;AAClB,qBAAa,KAAK;AAClB,4BAAoB;AAAA,MACrB,CAAC;AAAA,IACF,OAAO;AAEN,UAAI,mBAAmB;AACtB,qBAAa,KAAK;AAClB,4BAAoB;AAAA,MACrB;AAAA,IACD;AAAA,EACD,GAAG,CAAC,SAAS,UAAU,CAAC,CAAC;AAEzB,SAAO,EAAE,UAAA;AACV;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-i18next"),o=require("../../utils/translations/index.js"),n=require("../../constants/modules/index.js");let s="",r=!1,a=!0;const i=()=>{const[i,l]=e.useState(a),u=window.location,{t:d}=t.useTranslation();return e.useEffect(()=>{const e=n.default(d),t=u.pathname.toLowerCase(),i=e.find(e=>{var o;return e.link.toLowerCase()===t||(null==(o=e.connectedRoutes)?void 0:o.some(e=>t.startsWith(e.toLowerCase())))});let c=[];if((null==i?void 0:i.translationModule)?c=[...i.translationModule,"common"]:i||"/dashboard"!==t||(c=["common"]),c.length>0){const e=[...c].sort().join(",");if(s===e||r)return void(a&&(l(!1),a=!1));r=!0,s=e,l(!0),o.loadModuleTranslations(c).finally(()=>{r=!1,l(!1),a=!1})}else a&&(l(!1),a=!1)},[u.pathname,d]),{isLoading:i}};exports.default=i,exports.useAppTranslations=i;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/hooks/use-translations.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/hooks/use-translations.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n// import { useLocation } from 'react-router-dom'\nimport { useTranslation } from 'react-i18next'\nimport { loadModuleTranslations } from '../utils/translations'\nimport modules from '../constants/modules'\n\n// Global state to prevent duplicate calls across all hook instances\nlet globalLastLoadedModules = ''\nlet globalIsLoading = false\nlet globalInitialLoad = true\n\nexport const useAppTranslations = () => {\n\tconst [isLoading, setIsLoading] = useState(globalInitialLoad)\n\tconst location = window.location\n\tconst { t } = useTranslation()\n\n\tuseEffect(() => {\n\t\tconst erpModules = modules(t)\n\t\tconst currentPath = location.pathname.toLowerCase()\n\n\t\tconst matchedModule = erpModules.find(\n\t\t\t(mod) =>\n\t\t\t\tmod.link.toLowerCase() === currentPath ||\n\t\t\t\tmod.connectedRoutes?.some((route: string) => currentPath.startsWith(route.toLowerCase()))\n\t\t)\n\n\t\tlet modulesToLoad: string[] = []\n\n\t\tif (matchedModule?.translationModule) {\n\t\t\tmodulesToLoad = [...matchedModule.translationModule, 'common']\n\t\t} else if (!matchedModule && currentPath === '/dashboard') {\n\t\t\tmodulesToLoad = ['common']\n\t\t}\n\n\t\tif (modulesToLoad.length > 0) {\n\t\t\tconst moduleKey = [...modulesToLoad].sort().join(',')\n\n\t\t\t// Skip if same modules are already loaded or currently loading\n\t\t\tif (globalLastLoadedModules === moduleKey || globalIsLoading) {\n\t\t\t\tif (globalInitialLoad) {\n\t\t\t\t\tsetIsLoading(false)\n\t\t\t\t\tglobalInitialLoad = false\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tglobalIsLoading = true\n\t\t\tglobalLastLoadedModules = moduleKey\n\t\t\tsetIsLoading(true)\n\n\t\t\tloadModuleTranslations(modulesToLoad).finally(() => {\n\t\t\t\tglobalIsLoading = false\n\t\t\t\tsetIsLoading(false)\n\t\t\t\tglobalInitialLoad = false\n\t\t\t})\n\t\t} else {\n\t\t\t// No modules to load, but still need to handle initial load state\n\t\t\tif (globalInitialLoad) {\n\t\t\t\tsetIsLoading(false)\n\t\t\t\tglobalInitialLoad = false\n\t\t\t}\n\t\t}\n\t}, [location.pathname, t])\n\n\treturn { isLoading }\n};\n\nexport default useAppTranslations;\n"],"names":["globalLastLoadedModules","globalIsLoading","globalInitialLoad","useAppTranslations","isLoading","setIsLoading","useState","location","window","t","useTranslation","useEffect","erpModules","modules","currentPath","pathname","toLowerCase","matchedModule","find","mod","link","_a","connectedRoutes","some","route","startsWith","modulesToLoad","translationModule","length","moduleKey","sort","join","loadModuleTranslations","finally"],"mappings":"mNAOA,IAAIA,EAA0B,GAC1BC,GAAkB,EAClBC,GAAoB,EAEjB,MAAMC,EAAqB,KACjC,MAAOC,EAAWC,GAAgBC,EAAAA,SAASJ,GACrCK,EAAWC,OAAOD,UAClBE,EAAEA,GAAMC,mBAkDd,OAhDAC,EAAAA,UAAU,KACT,MAAMC,EAAaC,EAAAA,QAAQJ,GACrBK,EAAcP,EAASQ,SAASC,cAEhCC,EAAgBL,EAAWM,KAC/BC,UACA,OAAAA,EAAIC,KAAKJ,gBAAkBF,IAC3B,OAAAO,IAAIC,sBAAJ,EAAAD,EAAqBE,KAAMC,GAAkBV,EAAYW,WAAWD,EAAMR,mBAG5E,IAAIU,EAA0B,GAQ9B,UANIT,WAAeU,mBAClBD,EAAgB,IAAIT,EAAcU,kBAAmB,UAC1CV,GAAiC,eAAhBH,IAC5BY,EAAgB,CAAC,WAGdA,EAAcE,OAAS,EAAG,CAC7B,MAAMC,EAAY,IAAIH,GAAeI,OAAOC,KAAK,KAGjD,GAAI/B,IAA4B6B,GAAa5B,EAK5C,YAJIC,IACHG,GAAa,GACbH,GAAoB,IAKtBD,GAAkB,EAClBD,EAA0B6B,EAC1BxB,GAAa,GAEb2B,yBAAuBN,GAAeO,QAAQ,KAC7ChC,GAAkB,EAClBI,GAAa,GACbH,GAAoB,GAEtB,MAEKA,IACHG,GAAa,GACbH,GAAoB,IAGpB,CAACK,EAASQ,SAAUN,IAEhB,CAAEL"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDefaultExportFromCjs } from "../../../../../_virtual/_commonjsHelpers/index.esm.js";
|
|
2
|
-
import { __module as dist } from "../../../../../_virtual/index/index.
|
|
2
|
+
import { __module as dist } from "../../../../../_virtual/index/index.esm2.js";
|
|
3
3
|
import React__default from "react";
|
|
4
4
|
import ReactDOM__default from "react-dom";
|
|
5
5
|
import require$$0 from "react-is";
|