@erpsquad/common 1.9.97 → 1.9.99
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/chunks/{actionCreator-DmP63jZz.esm.js → actionCreator-C-u8gtV-.esm.js} +2 -2
- package/dist/chunks/{actionCreator-DmP63jZz.esm.js.map → actionCreator-C-u8gtV-.esm.js.map} +1 -1
- package/dist/chunks/{actionCreator-DwRQnQNP.js → actionCreator-DSrKE0hh.js} +2 -2
- package/dist/chunks/{actionCreator-DwRQnQNP.js.map → actionCreator-DSrKE0hh.js.map} +1 -1
- package/dist/chunks/{android-12-switch-D3fU6Qtm.esm.js → android-12-switch-DSBIf4t0.esm.js} +46 -38
- package/dist/chunks/android-12-switch-DSBIf4t0.esm.js.map +1 -0
- package/dist/chunks/{android-12-switch-B5UmJZxg.js → android-12-switch-DvCF0gyx.js} +46 -38
- package/dist/chunks/android-12-switch-DvCF0gyx.js.map +1 -0
- package/dist/chunks/{apiHelper-BrzRrxpx.js → apiHelper-5tNsUtSY.js} +18 -10
- package/dist/chunks/apiHelper-5tNsUtSY.js.map +1 -0
- package/dist/chunks/{apiHelper-BvnhN2uo.esm.js → apiHelper-Cv_qWaYo.esm.js} +18 -10
- package/dist/chunks/apiHelper-Cv_qWaYo.esm.js.map +1 -0
- package/dist/chunks/{appbar-Dn00gF0A.esm.js → appbar-DM2iBqb4.esm.js} +5 -5
- package/dist/chunks/{appbar-Dn00gF0A.esm.js.map → appbar-DM2iBqb4.esm.js.map} +1 -1
- package/dist/chunks/{appbar-dBRF2bDa.js → appbar-rfkAYQdQ.js} +5 -5
- package/dist/chunks/{appbar-dBRF2bDa.js.map → appbar-rfkAYQdQ.js.map} +1 -1
- package/dist/chunks/{common-QvMCr1xx.js → common-6VUrYJDq.js} +10 -1
- package/dist/chunks/{common-QvMCr1xx.js.map → common-6VUrYJDq.js.map} +1 -1
- package/dist/chunks/{common-B-nmtH5r.esm.js → common-B6euWODJ.esm.js} +10 -1
- package/dist/chunks/{common-B-nmtH5r.esm.js.map → common-B6euWODJ.esm.js.map} +1 -1
- package/dist/chunks/{custom-editor-BvMlZ1Oc.js → custom-editor-DIQqk_yI.js} +2 -2
- package/dist/chunks/{custom-editor-BvMlZ1Oc.js.map → custom-editor-DIQqk_yI.js.map} +1 -1
- package/dist/chunks/{custom-editor-OrxKsIQY.esm.js → custom-editor-DnfTs5-j.esm.js} +2 -2
- package/dist/chunks/{custom-editor-OrxKsIQY.esm.js.map → custom-editor-DnfTs5-j.esm.js.map} +1 -1
- package/dist/chunks/{default-data-otyfdCNu.esm.js → default-data-BV_r59U9.esm.js} +14 -14
- package/dist/chunks/{default-data-otyfdCNu.esm.js.map → default-data-BV_r59U9.esm.js.map} +1 -1
- package/dist/chunks/{default-data-BCroqbYg.js → default-data-DQ7VPUoj.js} +14 -14
- package/dist/chunks/{default-data-BCroqbYg.js.map → default-data-DQ7VPUoj.js.map} +1 -1
- package/dist/chunks/{form-builder-conversion-Var45CEx.esm.js → form-builder-conversion-BdWASNEo.esm.js} +2 -2
- package/dist/chunks/{form-builder-conversion-Var45CEx.esm.js.map → form-builder-conversion-BdWASNEo.esm.js.map} +1 -1
- package/dist/chunks/{form-builder-conversion-nTpiw7Q2.js → form-builder-conversion-D69EGO5g.js} +2 -2
- package/dist/chunks/{form-builder-conversion-nTpiw7Q2.js.map → form-builder-conversion-D69EGO5g.js.map} +1 -1
- package/dist/chunks/{form-builder-deconversion-BjiEAt-i.esm.js → form-builder-deconversion-CUwBfP4C.esm.js} +3 -3
- package/dist/chunks/{form-builder-deconversion-BjiEAt-i.esm.js.map → form-builder-deconversion-CUwBfP4C.esm.js.map} +1 -1
- package/dist/chunks/{form-builder-deconversion-CFTqjOTb.js → form-builder-deconversion-v5GvXDZ9.js} +3 -3
- package/dist/chunks/{form-builder-deconversion-CFTqjOTb.js.map → form-builder-deconversion-v5GvXDZ9.js.map} +1 -1
- package/dist/chunks/{fullScreen-BdyRsEBm.esm.js → fullScreen-BO0UA3Zr.esm.js} +2 -2
- package/dist/chunks/{fullScreen-BdyRsEBm.esm.js.map → fullScreen-BO0UA3Zr.esm.js.map} +1 -1
- package/dist/chunks/{fullScreen-BHrQ0vTa.js → fullScreen-Bfrr-bT2.js} +2 -2
- package/dist/chunks/{fullScreen-BHrQ0vTa.js.map → fullScreen-Bfrr-bT2.js.map} +1 -1
- package/dist/chunks/{languageContext-s_EUKz_A.js → languageContext-BP7EvzMv.js} +3 -3
- package/dist/chunks/{languageContext-s_EUKz_A.js.map → languageContext-BP7EvzMv.js.map} +1 -1
- package/dist/chunks/{languageContext-CbCRCTbP.esm.js → languageContext-DM_LTp53.esm.js} +3 -3
- package/dist/chunks/{languageContext-CbCRCTbP.esm.js.map → languageContext-DM_LTp53.esm.js.map} +1 -1
- package/dist/chunks/{migration-utils-Bn35YUJM.esm.js → migration-utils-D9TSOBR0.esm.js} +2 -2
- package/dist/chunks/{migration-utils-Bn35YUJM.esm.js.map → migration-utils-D9TSOBR0.esm.js.map} +1 -1
- package/dist/chunks/{migration-utils-CmzV1tw3.js → migration-utils-DwLXzWtr.js} +2 -2
- package/dist/chunks/{migration-utils-CmzV1tw3.js.map → migration-utils-DwLXzWtr.js.map} +1 -1
- package/dist/chunks/module-routes-config-B8IucBuj.js +19 -0
- package/dist/chunks/module-routes-config-B8IucBuj.js.map +1 -0
- package/dist/chunks/module-routes-config-CCkZEtfg.esm.js +20 -0
- package/dist/chunks/module-routes-config-CCkZEtfg.esm.js.map +1 -0
- package/dist/chunks/{modules-BDHGBfwa.js → modules-C3T2Pnwc.js} +10 -5
- package/dist/chunks/modules-C3T2Pnwc.js.map +1 -0
- package/dist/chunks/{modules-UIv-lDBW.esm.js → modules-D5_hDIg9.esm.js} +10 -5
- package/dist/chunks/modules-D5_hDIg9.esm.js.map +1 -0
- package/dist/chunks/{page-context-DLUB4Qx9.esm.js → page-context-B_wK6kLR.esm.js} +4 -4
- package/dist/chunks/{page-context-DLUB4Qx9.esm.js.map → page-context-B_wK6kLR.esm.js.map} +1 -1
- package/dist/chunks/{page-context-DRbgpYFO.js → page-context-h7LEMAG0.js} +4 -4
- package/dist/chunks/{page-context-DRbgpYFO.js.map → page-context-h7LEMAG0.js.map} +1 -1
- package/dist/chunks/pathname.hrms-2_BEXO_r.js +262 -0
- package/dist/chunks/pathname.hrms-2_BEXO_r.js.map +1 -0
- package/dist/chunks/pathname.hrms-C5ojsho0.esm.js +263 -0
- package/dist/chunks/pathname.hrms-C5ojsho0.esm.js.map +1 -0
- package/dist/chunks/{reducer-Gajha1Kz.esm.js → reducer-Bpuo5eq1.esm.js} +2 -2
- package/dist/chunks/{reducer-Gajha1Kz.esm.js.map → reducer-Bpuo5eq1.esm.js.map} +1 -1
- package/dist/chunks/{reducer-DGvVphqy.js → reducer-t-U331ho.js} +2 -2
- package/dist/chunks/{reducer-DGvVphqy.js.map → reducer-t-U331ho.js.map} +1 -1
- package/dist/chunks/{route-page-map-DPlRjCJm.esm.js → route-page-map-C4wM0M4A.esm.js} +2 -2
- package/dist/chunks/{route-page-map-DPlRjCJm.esm.js.map → route-page-map-C4wM0M4A.esm.js.map} +1 -1
- package/dist/chunks/{route-page-map-Btth_lp5.js → route-page-map-CJLyl6P1.js} +2 -2
- package/dist/chunks/{route-page-map-Btth_lp5.js.map → route-page-map-CJLyl6P1.js.map} +1 -1
- package/dist/chunks/{shareSlice-Cn2PGA6m.js → shareSlice-Br9IsR9k.js} +2 -2
- package/dist/chunks/{shareSlice-Cn2PGA6m.js.map → shareSlice-Br9IsR9k.js.map} +1 -1
- package/dist/chunks/{shareSlice-DGme6jBu.esm.js → shareSlice-CbG_VJcW.esm.js} +2 -2
- package/dist/chunks/{shareSlice-DGme6jBu.esm.js.map → shareSlice-CbG_VJcW.esm.js.map} +1 -1
- package/dist/chunks/{sidebar-Dcw_6aQ7.js → sidebar-C2zkLZyA.js} +4 -4
- package/dist/chunks/{sidebar-Dcw_6aQ7.js.map → sidebar-C2zkLZyA.js.map} +1 -1
- package/dist/chunks/{sidebar-PZqii53B.esm.js → sidebar-l49eLo8p.esm.js} +4 -4
- package/dist/chunks/{sidebar-PZqii53B.esm.js.map → sidebar-l49eLo8p.esm.js.map} +1 -1
- package/dist/chunks/{sidebarScreen-DY4Uklrh.esm.js → sidebarScreen-BQN2N8jx.esm.js} +5 -5
- package/dist/chunks/{sidebarScreen-DY4Uklrh.esm.js.map → sidebarScreen-BQN2N8jx.esm.js.map} +1 -1
- package/dist/chunks/{sidebarScreen-FH1CEH8k.js → sidebarScreen-PoYXto7E.js} +5 -5
- package/dist/chunks/{sidebarScreen-FH1CEH8k.js.map → sidebarScreen-PoYXto7E.js.map} +1 -1
- package/dist/chunks/{store-DEoLcgbp.js → store-BdrUnJ3G.js} +3 -3
- package/dist/chunks/{store-DEoLcgbp.js.map → store-BdrUnJ3G.js.map} +1 -1
- package/dist/chunks/{store-zDGOGRDm.esm.js → store-ksRZPIIc.esm.js} +3 -3
- package/dist/chunks/{store-zDGOGRDm.esm.js.map → store-ksRZPIIc.esm.js.map} +1 -1
- package/dist/chunks/{translations-BVvsrCTo.js → translations-1vp9srMj.js} +2 -2
- package/dist/chunks/{translations-BVvsrCTo.js.map → translations-1vp9srMj.js.map} +1 -1
- package/dist/chunks/{translations-DJFxXzIm.esm.js → translations-B5t-KZNN.esm.js} +2 -2
- package/dist/chunks/{translations-DJFxXzIm.esm.js.map → translations-B5t-KZNN.esm.js.map} +1 -1
- package/dist/chunks/{uom-field-wrapper-CeeTt3Ph.esm.js → uom-field-wrapper-Ckop1JTE.esm.js} +15 -15
- package/dist/chunks/{uom-field-wrapper-CeeTt3Ph.esm.js.map → uom-field-wrapper-Ckop1JTE.esm.js.map} +1 -1
- package/dist/chunks/{uom-field-wrapper-UBPKubPh.js → uom-field-wrapper-l8HA79k1.js} +15 -15
- package/dist/chunks/{uom-field-wrapper-UBPKubPh.js.map → uom-field-wrapper-l8HA79k1.js.map} +1 -1
- package/dist/chunks/{useAccountSetting-BcPg1o6H.esm.js → useAccountSetting-D6Hhq1Pz.esm.js} +3 -3
- package/dist/chunks/{useAccountSetting-BcPg1o6H.esm.js.map → useAccountSetting-D6Hhq1Pz.esm.js.map} +1 -1
- package/dist/chunks/{useAccountSetting-B5qXSiGa.js → useAccountSetting-ngzko7sX.js} +3 -3
- package/dist/chunks/{useAccountSetting-B5qXSiGa.js.map → useAccountSetting-ngzko7sX.js.map} +1 -1
- package/dist/chunks/{useAuth-BhsPEB2T.js → useAuth-HvZ6U960.js} +2 -2
- package/dist/chunks/{useAuth-BhsPEB2T.js.map → useAuth-HvZ6U960.js.map} +1 -1
- package/dist/chunks/{useAuth-C4WcddEE.esm.js → useAuth-Tfx2guEJ.esm.js} +2 -2
- package/dist/chunks/{useAuth-C4WcddEE.esm.js.map → useAuth-Tfx2guEJ.esm.js.map} +1 -1
- package/dist/chunks/{useLangauge-Bie5anLS.esm.js → useLangauge-BU_fP3ZM.esm.js} +2 -2
- package/dist/chunks/{useLangauge-Bie5anLS.esm.js.map → useLangauge-BU_fP3ZM.esm.js.map} +1 -1
- package/dist/chunks/{useLangauge-BtG3kyRv.js → useLangauge-DwsR1jcv.js} +2 -2
- package/dist/chunks/{useLangauge-BtG3kyRv.js.map → useLangauge-DwsR1jcv.js.map} +1 -1
- package/dist/chunks/{useReduxIntegration-DvUNoDIr.js → useReduxIntegration-JMVTp0lq.js} +4 -4
- package/dist/chunks/{useReduxIntegration-DvUNoDIr.js.map → useReduxIntegration-JMVTp0lq.js.map} +1 -1
- package/dist/chunks/{useReduxIntegration-CPPcf1p7.esm.js → useReduxIntegration-VgWJGErE.esm.js} +4 -4
- package/dist/chunks/{useReduxIntegration-CPPcf1p7.esm.js.map → useReduxIntegration-VgWJGErE.esm.js.map} +1 -1
- package/dist/components/index.esm.js +9 -9
- package/dist/components/index.js +9 -9
- package/dist/components/providers/ERPUIProvider.d.ts +1 -0
- package/dist/constants/index.esm.js +3 -3
- package/dist/constants/index.js +3 -3
- package/dist/constants/pathnames/pathname.hrms.d.ts +61 -3
- package/dist/contexts/index.esm.js +3 -3
- package/dist/contexts/index.js +3 -3
- package/dist/hooks/index.esm.js +5 -5
- package/dist/hooks/index.js +5 -5
- package/dist/index.esm.js +55 -50
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +32 -27
- package/dist/index.js.map +1 -1
- package/dist/layout/index.esm.js +2 -2
- package/dist/layout/index.js +2 -2
- package/dist/redux/index.esm.js +4 -4
- package/dist/redux/index.js +4 -4
- package/dist/src/components/providers/ERPUIProvider.d.ts +1 -0
- package/dist/src/constants/pathnames/pathname.hrms.d.ts +61 -3
- package/dist/src/utils/api.d.ts +10 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/module-routes-config.d.ts +34 -0
- package/dist/src/views/form-builder/utils/common.d.ts +1 -1
- package/dist/utils/api.d.ts +10 -0
- package/dist/utils/index.esm.js +12 -7
- package/dist/utils/index.esm.js.map +1 -1
- package/dist/utils/index.js +11 -6
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/module-routes-config.d.ts +34 -0
- package/dist/views/form-builder/utils/common.d.ts +1 -1
- package/dist/views/index.esm.js +10 -10
- package/dist/views/index.js +9 -9
- package/package.json +1 -1
- package/dist/chunks/android-12-switch-B5UmJZxg.js.map +0 -1
- package/dist/chunks/android-12-switch-D3fU6Qtm.esm.js.map +0 -1
- package/dist/chunks/apiHelper-BrzRrxpx.js.map +0 -1
- package/dist/chunks/apiHelper-BvnhN2uo.esm.js.map +0 -1
- package/dist/chunks/modules-BDHGBfwa.js.map +0 -1
- package/dist/chunks/modules-UIv-lDBW.esm.js.map +0 -1
- package/dist/chunks/pathname.hrms-BVwbtB1M.js +0 -109
- package/dist/chunks/pathname.hrms-BVwbtB1M.js.map +0 -1
- package/dist/chunks/pathname.hrms-BiL7sQv0.esm.js +0 -110
- package/dist/chunks/pathname.hrms-BiL7sQv0.esm.js.map +0 -1
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const React = require("react");
|
|
3
3
|
const reactI18next = require("react-i18next");
|
|
4
|
-
const translations = require("./translations-
|
|
5
|
-
const modules = require("./modules-
|
|
6
|
-
const useAuth = require("./useAuth-
|
|
4
|
+
const translations = require("./translations-1vp9srMj.js");
|
|
5
|
+
const modules = require("./modules-C3T2Pnwc.js");
|
|
6
|
+
const useAuth = require("./useAuth-HvZ6U960.js");
|
|
7
7
|
const reactRedux = require("react-redux");
|
|
8
|
-
const useAccountSetting = require("./useAccountSetting-
|
|
8
|
+
const useAccountSetting = require("./useAccountSetting-ngzko7sX.js");
|
|
9
9
|
const reactRouterDom = require("react-router-dom");
|
|
10
10
|
const jsxRuntime = require("./jsx-runtime-B6vEU3CM.js");
|
|
11
11
|
const notistack = require("notistack");
|
|
12
|
-
const store = require("./store-
|
|
12
|
+
const store = require("./store-BdrUnJ3G.js");
|
|
13
13
|
const themeImpl = require("./theme-impl-BgGLJiHC.js");
|
|
14
|
-
const languageContext = require("./languageContext-
|
|
15
|
-
const pageContext = require("./page-context-
|
|
14
|
+
const languageContext = require("./languageContext-BP7EvzMv.js");
|
|
15
|
+
const pageContext = require("./page-context-h7LEMAG0.js");
|
|
16
16
|
const apiConfig = require("./api-config-DXwDMFn-.js");
|
|
17
|
-
const common = require("./common-
|
|
17
|
+
const common = require("./common-6VUrYJDq.js");
|
|
18
|
+
const moduleRoutesConfig = require("./module-routes-config-B8IucBuj.js");
|
|
18
19
|
let globalLastLoadedModules = "";
|
|
19
20
|
let globalIsLoading = false;
|
|
20
21
|
let globalInitialLoad = false;
|
|
@@ -127,7 +128,10 @@ const useGenericDataFetcher = (cols, pagination, fetchAction, customeFilter = ""
|
|
|
127
128
|
activePage.sort,
|
|
128
129
|
activePage.filterQueryString,
|
|
129
130
|
activePage.search,
|
|
130
|
-
// pagination?.skip
|
|
131
|
+
// pagination?.skip intentionally omitted: the Pagination component already
|
|
132
|
+
// mirrors skip into activePage.skip on pageNo change; including pagination.skip
|
|
133
|
+
// here would make fetchData identity change twice per pagination click,
|
|
134
|
+
// triggering the listing useEffect twice and causing duplicate API calls.
|
|
131
135
|
activePage == null ? void 0 : activePage.skip,
|
|
132
136
|
pagination == null ? void 0 : pagination.limit,
|
|
133
137
|
dispatch,
|
|
@@ -172,6 +176,7 @@ const ERPUIProvider = ({
|
|
|
172
176
|
// API configuration
|
|
173
177
|
apiConfig: providedApiConfig,
|
|
174
178
|
additionalApiConfigurations,
|
|
179
|
+
moduleRoutes,
|
|
175
180
|
routeToColumnsMap,
|
|
176
181
|
routeToResourceMap,
|
|
177
182
|
publicRoutes = []
|
|
@@ -186,6 +191,9 @@ const ERPUIProvider = ({
|
|
|
186
191
|
if (additionalApiConfigurations) {
|
|
187
192
|
common.extendApiConfigurations(additionalApiConfigurations);
|
|
188
193
|
}
|
|
194
|
+
if (moduleRoutes) {
|
|
195
|
+
moduleRoutesConfig.setModuleRoutes(moduleRoutes);
|
|
196
|
+
}
|
|
189
197
|
isInitialized.current = true;
|
|
190
198
|
} catch (error) {
|
|
191
199
|
console.error("Failed to initialize API configuration:", error);
|
|
@@ -263,4 +271,4 @@ exports.apiHelper = apiHelper;
|
|
|
263
271
|
exports.useAppTranslations = useAppTranslations;
|
|
264
272
|
exports.useERPUI = useERPUI;
|
|
265
273
|
exports.useGenericDataFetcher = useGenericDataFetcher;
|
|
266
|
-
//# sourceMappingURL=apiHelper-
|
|
274
|
+
//# sourceMappingURL=apiHelper-5tNsUtSY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiHelper-5tNsUtSY.js","sources":["../../src/hooks/use-translations.ts","../../src/hooks/useDataFetcher.tsx","../../src/components/providers/ERPUIProvider.tsx","../../src/hooks/apiHelper.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n// import { useLocation } from 'react-router-dom'\nimport { getI18n, useTranslation } from 'react-i18next'\nimport { loadModuleTranslations } from '../utils/translations'\nimport modules from '../constants/modules'\nimport { useAuth } from './useAuth'\n\n// Global state to prevent duplicate calls across all hook instances\nlet globalLastLoadedModules = ''\nlet globalIsLoading = false\nlet globalInitialLoad = false\n\nexport const useAppTranslations = () => {\n\tconst [isLoading, setIsLoading] = useState(globalInitialLoad)\n\tconst location = window.location\n\tconst i18nInstance = getI18n()\n\tconst { user, loading } = useAuth()\n\tconst { t } = useTranslation()\n\n\tuseEffect(() => {\n\t\tconst erpModules = modules(t)\n\t\tconst currentPath = location.pathname.toLowerCase()\n\t\tif(user?.id && !loading) {\n\t\n\t\t\tconst matchedModule = erpModules.find(\n\t\t\t\t(mod) =>\n\t\t\t\t\tmod.link.toLowerCase() === currentPath ||\n\t\t\t\t\tmod.connectedRoutes?.some((route: string) => currentPath.startsWith(route.toLowerCase()))\n\t\t\t)\n\t\n\t\t\tlet modulesToLoad: string[] = []\n\t\n\t\t\tif (matchedModule?.translationModule) {\n\t\t\t\tmodulesToLoad = [...matchedModule.translationModule, 'common']\n\t\t\t} else if (!matchedModule && currentPath === '/dashboard') {\n\t\t\t\tmodulesToLoad = ['common']\n\t\t\t}\n\t\n\t\t\tif (modulesToLoad.length > 0) {\n\t\t\t\tconst moduleKey = [...modulesToLoad].sort().join(',')\n\t\n\t\t\t\t// Skip if same modules are already loaded or currently loading\n\t\t\t\tif (globalLastLoadedModules === moduleKey || globalIsLoading) {\n\t\t\t\t\tif (globalInitialLoad) {\n\t\t\t\t\t\tsetIsLoading(false)\n\t\t\t\t\t\tglobalInitialLoad = false\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\n\t\t\t\tglobalIsLoading = true\n\t\t\t\tglobalLastLoadedModules = moduleKey\n\t\t\t\tsetIsLoading(true)\n\t\n\t\t\t\tloadModuleTranslations(modulesToLoad, i18nInstance).finally(() => {\n\t\t\t\t\tglobalIsLoading = false\n\t\t\t\t\tsetIsLoading(false)\n\t\t\t\t\tglobalInitialLoad = false\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\t// No modules to load, but still need to handle initial load state\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}\n\t\t}\n\t}, [location.pathname, t, user, loading])\n\n\treturn { isLoading }\n};\n\nexport default useAppTranslations;\n","import { useCallback, useState, useEffect } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { usePages } from './use-pages';\nimport { useLocation } from 'react-router-dom';\ninterface FilterParams {\n\tskip: number;\n\tlimit: number;\n\tsearch?: string;\n\tselect?: string;\n\torder?: string;\n\tfilters?: string;\n}\n\ninterface ActivePage {\n\tsort?: { id: string; desc: boolean };\n\tfilterQueryString?: string;\n\tsearch?: string;\n\tvisible_columns?: { visible: boolean; accessorKey: string }[];\n}\n\nconst useGenericDataFetcher = (\n\tcols?: ActivePage,\n\tpagination: { skip: number; limit: number },\n\tfetchAction: (filters: FilterParams) => void,\n\tcustomeFilter: any = '',\n\tcustomDeps?: any[],\n\tshowCreatedBy: boolean = true,\n\tcustomFields?: any = []\n) => {\n\tconst { activePage } = usePages();\n\tconst dispatch = useDispatch();\n\tconst location = useLocation();\n\n\tconst sourceColumns = Array.isArray(cols) ? cols?.filter((col: any) => col.visible) : activePage?.visible_columns;\n\n\tconst [trackedPath, setTrackedPath] = useState<string | null>(null);\n\tconst [trackedColumns, setTrackedColumns] = useState<any[]>([]);\n\n\tuseEffect(() => {\n\t\tif (trackedPath !== location?.pathname) {\n\t\t\tsetTrackedPath(location?.pathname);\n\t\t\tsetTrackedColumns([]);\n\t\t}\n\t}, [location?.pathname, trackedPath]);\n\n\tuseEffect(() => {\n\t\tif (trackedPath === location?.pathname && sourceColumns?.length > 0) {\n\t\t\tif (JSON.stringify(trackedColumns) !== JSON.stringify(sourceColumns)) {\n\t\t\t\tsetTrackedColumns(sourceColumns);\n\t\t\t}\n\t\t}\n\t}, [location?.pathname, trackedPath, sourceColumns]);\n\n\tconst getProcessedFilters = useCallback(() => {\n\t\tconst { filterQueryString } = activePage || {};\n\t\tconst queryString = filterQueryString?.replaceAll(/[()]/g, \"\") || '';\n\t\tconst extraQueryString = queryString.length ? `&${queryString}` : '';\n\t\tlet filters = customeFilter;\n\n\t\tif (extraQueryString) {\n\t\t\tfilters = filters ? `(${filters}${extraQueryString})` : `(${extraQueryString})`;\n\t\t} else if (filters) {\n\t\t\tfilters = `(${filters})`;\n\t\t}\n\n\t\treturn filters || undefined;\n\t\t//eslint-disable-next-line\n\t}, [activePage.filterQueryString, customeFilter]);\n\n\tconst fetchData = useCallback(() => {\n\t\tif (!fetchAction) {\n\t\t\treturn;\n\t\t}\n\t\tconst { sort = null, search } = activePage;\n\n\t\tif (!trackedColumns || trackedColumns.length === 0) return;\n\n\t\tconst filters = getProcessedFilters();\n\t\tconst visibleColumns = trackedColumns?.filter((vc) => vc.visible)\n\n\t\tconst selectPayload = visibleColumns?.length > 0 ? `[${visibleColumns\n\t\t\t?.map((item) =>\n\t\t\t\titem.accessorKey?.includes(\".\")\n\t\t\t\t\t? item.accessorKey.split(\".\")[0]\n\t\t\t\t\t: item.accessorKey\n\t\t\t)}${showCreatedBy ? ',created_at,created_by_data' : ''}${customFields?.length ? `,${customFields?.join(',')}` : ''}]` : undefined\n\t\tconst payload: FilterParams = {\n\t\t\tskip: activePage?.skip || pagination?.skip,\n\t\t\tlimit: pagination.limit,\n\t\t\tsearch,\n\t\t\tselect: selectPayload,\n\t\t\t...(sort && { order: `${sort.id}:${sort.desc ? -1 : 1}` }),\n\t\t\t...(filters && { filters }),\n\t\t};\n\n\t\tdispatch(fetchAction(payload));\n\t\t//eslint-disable-next-line\n\t}, [\n\t\ttrackedColumns,\n\t\tactivePage.sort,\n\t\tactivePage.filterQueryString,\n\t\tactivePage.search,\n\t\t// pagination?.skip intentionally omitted: the Pagination component already\n\t\t// mirrors skip into activePage.skip on pageNo change; including pagination.skip\n\t\t// here would make fetchData identity change twice per pagination click,\n\t\t// triggering the listing useEffect twice and causing duplicate API calls.\n\t\tactivePage?.skip,\n\t\tpagination?.limit,\n\t\tdispatch,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t...(customDeps || []),\n\t]);\n\n\n\n\treturn fetchData;\n};\n\nexport default useGenericDataFetcher;\n","import React, { createContext, useContext, ReactNode, Suspense } from 'react';\nimport { Provider as ReduxProvider } from 'react-redux';\nimport { ThemeProvider } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport { SnackbarProvider } from 'notistack';\nimport { BrowserRouter } from 'react-router-dom';\nimport { createLibraryStore, ApiClientConfig } from '../../redux';\nimport { createLightTheme, createDarkTheme, Color } from '../../theme';\nimport { AuthProvider } from '../../contexts/AuthContext';\nimport { LanguageProvider } from '../../contexts/languageContext';\nimport { PageProvider } from '../../contexts/page-context';\nimport { PermissionsProvider } from '../../contexts/permission-context';\nimport MUIThemeWrapper from '../../theme/themeWrapper';\nimport Loader from '../loader';\nimport useAppTranslations from '../../hooks/use-translations';\nimport '../../utils/i18n';\nimport { initializeApiConfig, ApiConfig } from '../../utils/api-config';\nimport { initializeApiBaseUrls, extendApiConfigurations } from '../../utils/api';\nimport { setModuleRoutes } from '../../utils/module-routes-config';\n\n// Context for library configuration\ninterface ERPUIContextValue {\n useRedux: boolean;\n apiClient?: ApiClientConfig;\n theme?: any;\n themeMode: 'light' | 'dark';\n direction: 'ltr' | 'rtl';\n primaryColor?: Color;\n}\n\nconst ERPUIContext = createContext<ERPUIContextValue>({\n useRedux: false,\n themeMode: 'light',\n direction: 'ltr',\n});\n\nexport const useERPUI = () => useContext(ERPUIContext);\n\n// Provider props interface\ninterface ERPUIProviderProps {\n children: ReactNode;\n\n // Redux configuration\n useRedux?: boolean;\n reduxStore?: any;\n apiClient?: ApiClientConfig;\n additionalReducers?: Record<string, any>;\n\n // Theme configuration\n theme?: any;\n themeMode?: 'light' | 'dark';\n primaryColor?: Color;\n direction?: 'ltr' | 'rtl';\n\n // Context providers configuration\n enableAuth?: boolean;\n enableLanguage?: boolean;\n enablePages?: boolean;\n enablePermissions?: boolean;\n enableRouter?: boolean;\n enableSnackbar?: boolean;\n\n // Other configuration\n enableCssBaseline?: boolean;\n snackbarConfig?: {\n maxSnack?: number;\n anchorOrigin?: {\n vertical: 'top' | 'bottom';\n horizontal: 'left' | 'center' | 'right';\n };\n autoHideDuration?: number;\n };\n\n // API configuration\n apiConfig?: ApiConfig;\n\n // Additional API configurations to extend the shared apiConfigurations map\n additionalApiConfigurations?: Record<string, any>;\n\n // Module routes override — allows MFE apps to inject their own full route set\n // so the header module dropdown can match routes correctly.\n // Example: { hrms: Object.values(PathnameHrms).map(p => Pathname.DASHBOARD_HRMS + p) }\n moduleRoutes?: Record<string, string[]>;\n\n // Route maps\n routeToColumnsMap?: Record<string, any>;\n routeToResourceMap?: Record<string, any>;\n publicRoutes?: string[]; // Optional prop to allow customization of public routes in AuthProvider\n}\n\nexport const ERPUIProvider: React.FC<ERPUIProviderProps> = ({\n children,\n\n // Redux props\n useRedux = false,\n reduxStore,\n apiClient,\n additionalReducers = {},\n\n // Theme props\n theme: customTheme,\n themeMode = 'light',\n primaryColor,\n direction = 'ltr',\n\n // Context providers configuration\n enableAuth = true,\n enableLanguage = true,\n enablePages = true,\n enablePermissions = true,\n enableRouter = false, // Default false since consuming app usually provides router\n enableSnackbar = true,\n\n // Other props\n enableCssBaseline = true,\n snackbarConfig = {\n maxSnack: 3,\n anchorOrigin: { vertical: 'top', horizontal: 'right' },\n autoHideDuration: 5000,\n },\n\n // API configuration\n apiConfig: providedApiConfig,\n additionalApiConfigurations,\n moduleRoutes,\n routeToColumnsMap,\n routeToResourceMap,\n publicRoutes = [], // Default empty array for public routes in AuthProvider \n}) => {\n console.log(\"additionalApiConfigurations...........\",additionalApiConfigurations)\n\n // Initialize API configuration synchronously before first render\n // This prevents \"API configuration not initialized\" errors when components\n // try to use the API during initial render\n const isInitialized = React.useRef(false);\n\n if (providedApiConfig && !isInitialized.current) {\n try {\n initializeApiConfig(providedApiConfig);\n initializeApiBaseUrls();\n if (additionalApiConfigurations) {\n extendApiConfigurations(additionalApiConfigurations);\n }\n // Inject MFE-provided module routes so the header can resolve modules\n if (moduleRoutes) {\n setModuleRoutes(moduleRoutes);\n }\n isInitialized.current = true;\n } catch (error) {\n console.error('Failed to initialize API configuration:', error);\n }\n }\n // const { isLoading } = useAppTranslations();\n // if (isLoading) {\n // return <Loader />;\n // }\n // Create or use provided Redux store\n const store = React.useMemo(() => {\n if (!useRedux) return null;\n\n if (reduxStore) {\n return reduxStore;\n }\n\n return createLibraryStore(additionalReducers, apiClient);\n }, [useRedux, reduxStore, additionalReducers, apiClient]);\n\n // Create theme\n const theme = React.useMemo(() => {\n if (customTheme) {\n return customTheme;\n }\n\n const themeCreator = themeMode === 'dark' ? createDarkTheme : createLightTheme;\n const { theme: generatedTheme } = themeCreator(primaryColor, direction);\n return generatedTheme;\n }, [customTheme, themeMode, primaryColor, direction]);\n\n // Context value\n const contextValue: ERPUIContextValue = {\n useRedux,\n apiClient,\n theme,\n themeMode,\n direction,\n primaryColor,\n };\n\n // Build provider tree from inside out\n let content = (\n <ERPUIContext.Provider value={contextValue}>\n {/* <ThemeProvider theme={theme}>\n {enableCssBaseline && <CssBaseline />} */}\n {/* <Suspense fallback={<Loader />}> */}\n <MUIThemeWrapper theme={theme} enableCssBaseline={enableCssBaseline}>\n {children}\n </MUIThemeWrapper>\n {/* </Suspense> */}\n {/* </ThemeProvider> */}\n </ERPUIContext.Provider>\n );\n\n // Wrap with snackbar provider if enabled\n if (enableSnackbar) {\n content = (\n <SnackbarProvider {...snackbarConfig}>\n {content}\n </SnackbarProvider>\n );\n }\n\n // Wrap with page provider if enabled\n // if (enablePages) {\n // content = (\n // <PageProvider routeToColumnsMap={routeToColumnsMap} routeToResourceMap={routeToResourceMap}>\n // {content}\n // </PageProvider>\n // );\n // }\n\n // Wrap with permissions provider if enabled\n if (enablePermissions) {\n content = (\n <PermissionsProvider>\n {content}\n </PermissionsProvider>\n );\n }\n\n // Wrap with language provider if enabled\n if (enableLanguage) {\n content = (\n <LanguageProvider>\n {content}\n </LanguageProvider>\n );\n }\n\n // Wrap with auth provider if enabled\n if (enableAuth) {\n content = (\n <AuthProvider publicRoutes={publicRoutes}>\n {content}\n </AuthProvider>\n );\n }\n\n // Wrap with router if enabled\n if (enableRouter) {\n content = (\n <BrowserRouter>\n {content}\n </BrowserRouter>\n );\n }\n\n // Wrap with Redux provider if enabled\n if (useRedux && store) {\n content = (\n <ReduxProvider store={store}>\n {content}\n </ReduxProvider>\n );\n }\n\n return content;\n};\n\nexport default ERPUIProvider;","import { enqueueSnackbar } from \"notistack\";\n\ntype ApiResponse = {\n meta?: {\n requestStatus?: string;\n };\n error?: {\n message?: string;\n };\n payload?:any\n};\n\ntype Callback = () => void;\n\nexport function apiHelper(res: ApiResponse, callBack?: Callback): void {\n if (res?.meta?.requestStatus === \"rejected\") {\n const errorMessage = (() => {\n try {\n return res.error?.message ? JSON.parse(res.error.message) : null;\n } catch {\n return { message: \"Something went wrong\" };\n }\n })();\n\n const message = errorMessage?.message?.replace(\"Error:\", \"\").trim() || \"Something went wrong\";\n\n enqueueSnackbar(message, {\n variant: \"error\",\n });\n return\n }\n\n if (callBack && typeof callBack === \"function\") {\n callBack();\n } else if (callBack) {\n console.warn(\"Provided callBack is not a function.\");\n }\n}\n"],"names":["useState","getI18n","useAuth","useTranslation","useEffect","modules","loadModuleTranslations","usePages","useDispatch","useLocation","useCallback","createContext","useContext","initializeApiConfig","initializeApiBaseUrls","extendApiConfigurations","setModuleRoutes","store","createLibraryStore","createDarkTheme","createLightTheme","jsx","MUIThemeWrapper","SnackbarProvider","PermissionsProvider","LanguageProvider","AuthProvider","BrowserRouter","ReduxProvider","_a","enqueueSnackbar"],"mappings":";;;;;;;;;;;;;;;;;;AAQA,IAAI,0BAA0B;AAC9B,IAAI,kBAAkB;AACtB,IAAI,oBAAoB;AAEjB,MAAM,qBAAqB,MAAM;AACvC,QAAM,CAAC,WAAW,YAAY,IAAIA,MAAAA,SAAS,iBAAiB;AAC5D,QAAM,WAAW,OAAO;AACxB,QAAM,eAA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;AACN,eAAO,EAAE,SAAS,uBAAA;AAAA,MACpB;AAAA,IACF,GAAA;AAEA,UAAM,YAAU,kDAAc,YAAd,mBAAuB,QAAQ,UAAU,IAAI,WAAU;AAEvEC,cAAAA,gBAAgB,SAAS;AAAA,MACvB,SAAS;AAAA,IAAA,CACV;AACD;AAAA,EACF;AAEA,MAAI,YAAY,OAAO,aAAa,YAAY;AAC9C,aAAA;AAAA,EACF,WAAW,UAAU;AACnB,YAAQ,KAAK,sCAAsC;AAAA,EACrD;AACF;;;;;;"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import React__default, { useState, useEffect, useCallback, useContext, createContext } from "react";
|
|
2
2
|
import { getI18n, useTranslation } from "react-i18next";
|
|
3
|
-
import { l as loadModuleTranslations } from "./translations-
|
|
4
|
-
import { m as modules } from "./modules-
|
|
5
|
-
import { u as useAuth, a as AuthProvider } from "./useAuth-
|
|
3
|
+
import { l as loadModuleTranslations } from "./translations-B5t-KZNN.esm.js";
|
|
4
|
+
import { m as modules } from "./modules-D5_hDIg9.esm.js";
|
|
5
|
+
import { u as useAuth, a as AuthProvider } from "./useAuth-Tfx2guEJ.esm.js";
|
|
6
6
|
import { useDispatch, Provider } from "react-redux";
|
|
7
|
-
import { f as usePages } from "./useAccountSetting-
|
|
7
|
+
import { f as usePages } from "./useAccountSetting-D6Hhq1Pz.esm.js";
|
|
8
8
|
import { useLocation, BrowserRouter } from "react-router-dom";
|
|
9
9
|
import { j as jsxRuntimeExports } from "./jsx-runtime-ClFauRgV.esm.js";
|
|
10
10
|
import { SnackbarProvider, enqueueSnackbar } from "notistack";
|
|
11
|
-
import { c as createLibraryStore } from "./store-
|
|
11
|
+
import { c as createLibraryStore } from "./store-ksRZPIIc.esm.js";
|
|
12
12
|
import { M as MUIThemeWrapper, c as createDarkTheme, a as createLightTheme } from "./theme-impl-B5ncd0_-.esm.js";
|
|
13
|
-
import { a as LanguageProvider } from "./languageContext-
|
|
14
|
-
import { c as PermissionsProvider } from "./page-context-
|
|
13
|
+
import { a as LanguageProvider } from "./languageContext-DM_LTp53.esm.js";
|
|
14
|
+
import { c as PermissionsProvider } from "./page-context-B_wK6kLR.esm.js";
|
|
15
15
|
import { i as initializeApiConfig } from "./api-config-GOys-syK.esm.js";
|
|
16
|
-
import { aY as initializeApiBaseUrls, z as extendApiConfigurations } from "./common-
|
|
16
|
+
import { aY as initializeApiBaseUrls, z as extendApiConfigurations } from "./common-B6euWODJ.esm.js";
|
|
17
|
+
import { s as setModuleRoutes } from "./module-routes-config-CCkZEtfg.esm.js";
|
|
17
18
|
let globalLastLoadedModules = "";
|
|
18
19
|
let globalIsLoading = false;
|
|
19
20
|
let globalInitialLoad = false;
|
|
@@ -126,7 +127,10 @@ const useGenericDataFetcher = (cols, pagination, fetchAction, customeFilter = ""
|
|
|
126
127
|
activePage.sort,
|
|
127
128
|
activePage.filterQueryString,
|
|
128
129
|
activePage.search,
|
|
129
|
-
// pagination?.skip
|
|
130
|
+
// pagination?.skip intentionally omitted: the Pagination component already
|
|
131
|
+
// mirrors skip into activePage.skip on pageNo change; including pagination.skip
|
|
132
|
+
// here would make fetchData identity change twice per pagination click,
|
|
133
|
+
// triggering the listing useEffect twice and causing duplicate API calls.
|
|
130
134
|
activePage == null ? void 0 : activePage.skip,
|
|
131
135
|
pagination == null ? void 0 : pagination.limit,
|
|
132
136
|
dispatch,
|
|
@@ -171,6 +175,7 @@ const ERPUIProvider = ({
|
|
|
171
175
|
// API configuration
|
|
172
176
|
apiConfig: providedApiConfig,
|
|
173
177
|
additionalApiConfigurations,
|
|
178
|
+
moduleRoutes,
|
|
174
179
|
routeToColumnsMap,
|
|
175
180
|
routeToResourceMap,
|
|
176
181
|
publicRoutes = []
|
|
@@ -185,6 +190,9 @@ const ERPUIProvider = ({
|
|
|
185
190
|
if (additionalApiConfigurations) {
|
|
186
191
|
extendApiConfigurations(additionalApiConfigurations);
|
|
187
192
|
}
|
|
193
|
+
if (moduleRoutes) {
|
|
194
|
+
setModuleRoutes(moduleRoutes);
|
|
195
|
+
}
|
|
188
196
|
isInitialized.current = true;
|
|
189
197
|
} catch (error) {
|
|
190
198
|
console.error("Failed to initialize API configuration:", error);
|
|
@@ -264,4 +272,4 @@ export {
|
|
|
264
272
|
useGenericDataFetcher as c,
|
|
265
273
|
useERPUI as u
|
|
266
274
|
};
|
|
267
|
-
//# sourceMappingURL=apiHelper-
|
|
275
|
+
//# sourceMappingURL=apiHelper-Cv_qWaYo.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiHelper-Cv_qWaYo.esm.js","sources":["../../src/hooks/use-translations.ts","../../src/hooks/useDataFetcher.tsx","../../src/components/providers/ERPUIProvider.tsx","../../src/hooks/apiHelper.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n// import { useLocation } from 'react-router-dom'\nimport { getI18n, useTranslation } from 'react-i18next'\nimport { loadModuleTranslations } from '../utils/translations'\nimport modules from '../constants/modules'\nimport { useAuth } from './useAuth'\n\n// Global state to prevent duplicate calls across all hook instances\nlet globalLastLoadedModules = ''\nlet globalIsLoading = false\nlet globalInitialLoad = false\n\nexport const useAppTranslations = () => {\n\tconst [isLoading, setIsLoading] = useState(globalInitialLoad)\n\tconst location = window.location\n\tconst i18nInstance = getI18n()\n\tconst { user, loading } = useAuth()\n\tconst { t } = useTranslation()\n\n\tuseEffect(() => {\n\t\tconst erpModules = modules(t)\n\t\tconst currentPath = location.pathname.toLowerCase()\n\t\tif(user?.id && !loading) {\n\t\n\t\t\tconst matchedModule = erpModules.find(\n\t\t\t\t(mod) =>\n\t\t\t\t\tmod.link.toLowerCase() === currentPath ||\n\t\t\t\t\tmod.connectedRoutes?.some((route: string) => currentPath.startsWith(route.toLowerCase()))\n\t\t\t)\n\t\n\t\t\tlet modulesToLoad: string[] = []\n\t\n\t\t\tif (matchedModule?.translationModule) {\n\t\t\t\tmodulesToLoad = [...matchedModule.translationModule, 'common']\n\t\t\t} else if (!matchedModule && currentPath === '/dashboard') {\n\t\t\t\tmodulesToLoad = ['common']\n\t\t\t}\n\t\n\t\t\tif (modulesToLoad.length > 0) {\n\t\t\t\tconst moduleKey = [...modulesToLoad].sort().join(',')\n\t\n\t\t\t\t// Skip if same modules are already loaded or currently loading\n\t\t\t\tif (globalLastLoadedModules === moduleKey || globalIsLoading) {\n\t\t\t\t\tif (globalInitialLoad) {\n\t\t\t\t\t\tsetIsLoading(false)\n\t\t\t\t\t\tglobalInitialLoad = false\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\n\t\t\t\tglobalIsLoading = true\n\t\t\t\tglobalLastLoadedModules = moduleKey\n\t\t\t\tsetIsLoading(true)\n\t\n\t\t\t\tloadModuleTranslations(modulesToLoad, i18nInstance).finally(() => {\n\t\t\t\t\tglobalIsLoading = false\n\t\t\t\t\tsetIsLoading(false)\n\t\t\t\t\tglobalInitialLoad = false\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\t// No modules to load, but still need to handle initial load state\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}\n\t\t}\n\t}, [location.pathname, t, user, loading])\n\n\treturn { isLoading }\n};\n\nexport default useAppTranslations;\n","import { useCallback, useState, useEffect } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { usePages } from './use-pages';\nimport { useLocation } from 'react-router-dom';\ninterface FilterParams {\n\tskip: number;\n\tlimit: number;\n\tsearch?: string;\n\tselect?: string;\n\torder?: string;\n\tfilters?: string;\n}\n\ninterface ActivePage {\n\tsort?: { id: string; desc: boolean };\n\tfilterQueryString?: string;\n\tsearch?: string;\n\tvisible_columns?: { visible: boolean; accessorKey: string }[];\n}\n\nconst useGenericDataFetcher = (\n\tcols?: ActivePage,\n\tpagination: { skip: number; limit: number },\n\tfetchAction: (filters: FilterParams) => void,\n\tcustomeFilter: any = '',\n\tcustomDeps?: any[],\n\tshowCreatedBy: boolean = true,\n\tcustomFields?: any = []\n) => {\n\tconst { activePage } = usePages();\n\tconst dispatch = useDispatch();\n\tconst location = useLocation();\n\n\tconst sourceColumns = Array.isArray(cols) ? cols?.filter((col: any) => col.visible) : activePage?.visible_columns;\n\n\tconst [trackedPath, setTrackedPath] = useState<string | null>(null);\n\tconst [trackedColumns, setTrackedColumns] = useState<any[]>([]);\n\n\tuseEffect(() => {\n\t\tif (trackedPath !== location?.pathname) {\n\t\t\tsetTrackedPath(location?.pathname);\n\t\t\tsetTrackedColumns([]);\n\t\t}\n\t}, [location?.pathname, trackedPath]);\n\n\tuseEffect(() => {\n\t\tif (trackedPath === location?.pathname && sourceColumns?.length > 0) {\n\t\t\tif (JSON.stringify(trackedColumns) !== JSON.stringify(sourceColumns)) {\n\t\t\t\tsetTrackedColumns(sourceColumns);\n\t\t\t}\n\t\t}\n\t}, [location?.pathname, trackedPath, sourceColumns]);\n\n\tconst getProcessedFilters = useCallback(() => {\n\t\tconst { filterQueryString } = activePage || {};\n\t\tconst queryString = filterQueryString?.replaceAll(/[()]/g, \"\") || '';\n\t\tconst extraQueryString = queryString.length ? `&${queryString}` : '';\n\t\tlet filters = customeFilter;\n\n\t\tif (extraQueryString) {\n\t\t\tfilters = filters ? `(${filters}${extraQueryString})` : `(${extraQueryString})`;\n\t\t} else if (filters) {\n\t\t\tfilters = `(${filters})`;\n\t\t}\n\n\t\treturn filters || undefined;\n\t\t//eslint-disable-next-line\n\t}, [activePage.filterQueryString, customeFilter]);\n\n\tconst fetchData = useCallback(() => {\n\t\tif (!fetchAction) {\n\t\t\treturn;\n\t\t}\n\t\tconst { sort = null, search } = activePage;\n\n\t\tif (!trackedColumns || trackedColumns.length === 0) return;\n\n\t\tconst filters = getProcessedFilters();\n\t\tconst visibleColumns = trackedColumns?.filter((vc) => vc.visible)\n\n\t\tconst selectPayload = visibleColumns?.length > 0 ? `[${visibleColumns\n\t\t\t?.map((item) =>\n\t\t\t\titem.accessorKey?.includes(\".\")\n\t\t\t\t\t? item.accessorKey.split(\".\")[0]\n\t\t\t\t\t: item.accessorKey\n\t\t\t)}${showCreatedBy ? ',created_at,created_by_data' : ''}${customFields?.length ? `,${customFields?.join(',')}` : ''}]` : undefined\n\t\tconst payload: FilterParams = {\n\t\t\tskip: activePage?.skip || pagination?.skip,\n\t\t\tlimit: pagination.limit,\n\t\t\tsearch,\n\t\t\tselect: selectPayload,\n\t\t\t...(sort && { order: `${sort.id}:${sort.desc ? -1 : 1}` }),\n\t\t\t...(filters && { filters }),\n\t\t};\n\n\t\tdispatch(fetchAction(payload));\n\t\t//eslint-disable-next-line\n\t}, [\n\t\ttrackedColumns,\n\t\tactivePage.sort,\n\t\tactivePage.filterQueryString,\n\t\tactivePage.search,\n\t\t// pagination?.skip intentionally omitted: the Pagination component already\n\t\t// mirrors skip into activePage.skip on pageNo change; including pagination.skip\n\t\t// here would make fetchData identity change twice per pagination click,\n\t\t// triggering the listing useEffect twice and causing duplicate API calls.\n\t\tactivePage?.skip,\n\t\tpagination?.limit,\n\t\tdispatch,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t...(customDeps || []),\n\t]);\n\n\n\n\treturn fetchData;\n};\n\nexport default useGenericDataFetcher;\n","import React, { createContext, useContext, ReactNode, Suspense } from 'react';\nimport { Provider as ReduxProvider } from 'react-redux';\nimport { ThemeProvider } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport { SnackbarProvider } from 'notistack';\nimport { BrowserRouter } from 'react-router-dom';\nimport { createLibraryStore, ApiClientConfig } from '../../redux';\nimport { createLightTheme, createDarkTheme, Color } from '../../theme';\nimport { AuthProvider } from '../../contexts/AuthContext';\nimport { LanguageProvider } from '../../contexts/languageContext';\nimport { PageProvider } from '../../contexts/page-context';\nimport { PermissionsProvider } from '../../contexts/permission-context';\nimport MUIThemeWrapper from '../../theme/themeWrapper';\nimport Loader from '../loader';\nimport useAppTranslations from '../../hooks/use-translations';\nimport '../../utils/i18n';\nimport { initializeApiConfig, ApiConfig } from '../../utils/api-config';\nimport { initializeApiBaseUrls, extendApiConfigurations } from '../../utils/api';\nimport { setModuleRoutes } from '../../utils/module-routes-config';\n\n// Context for library configuration\ninterface ERPUIContextValue {\n useRedux: boolean;\n apiClient?: ApiClientConfig;\n theme?: any;\n themeMode: 'light' | 'dark';\n direction: 'ltr' | 'rtl';\n primaryColor?: Color;\n}\n\nconst ERPUIContext = createContext<ERPUIContextValue>({\n useRedux: false,\n themeMode: 'light',\n direction: 'ltr',\n});\n\nexport const useERPUI = () => useContext(ERPUIContext);\n\n// Provider props interface\ninterface ERPUIProviderProps {\n children: ReactNode;\n\n // Redux configuration\n useRedux?: boolean;\n reduxStore?: any;\n apiClient?: ApiClientConfig;\n additionalReducers?: Record<string, any>;\n\n // Theme configuration\n theme?: any;\n themeMode?: 'light' | 'dark';\n primaryColor?: Color;\n direction?: 'ltr' | 'rtl';\n\n // Context providers configuration\n enableAuth?: boolean;\n enableLanguage?: boolean;\n enablePages?: boolean;\n enablePermissions?: boolean;\n enableRouter?: boolean;\n enableSnackbar?: boolean;\n\n // Other configuration\n enableCssBaseline?: boolean;\n snackbarConfig?: {\n maxSnack?: number;\n anchorOrigin?: {\n vertical: 'top' | 'bottom';\n horizontal: 'left' | 'center' | 'right';\n };\n autoHideDuration?: number;\n };\n\n // API configuration\n apiConfig?: ApiConfig;\n\n // Additional API configurations to extend the shared apiConfigurations map\n additionalApiConfigurations?: Record<string, any>;\n\n // Module routes override — allows MFE apps to inject their own full route set\n // so the header module dropdown can match routes correctly.\n // Example: { hrms: Object.values(PathnameHrms).map(p => Pathname.DASHBOARD_HRMS + p) }\n moduleRoutes?: Record<string, string[]>;\n\n // Route maps\n routeToColumnsMap?: Record<string, any>;\n routeToResourceMap?: Record<string, any>;\n publicRoutes?: string[]; // Optional prop to allow customization of public routes in AuthProvider\n}\n\nexport const ERPUIProvider: React.FC<ERPUIProviderProps> = ({\n children,\n\n // Redux props\n useRedux = false,\n reduxStore,\n apiClient,\n additionalReducers = {},\n\n // Theme props\n theme: customTheme,\n themeMode = 'light',\n primaryColor,\n direction = 'ltr',\n\n // Context providers configuration\n enableAuth = true,\n enableLanguage = true,\n enablePages = true,\n enablePermissions = true,\n enableRouter = false, // Default false since consuming app usually provides router\n enableSnackbar = true,\n\n // Other props\n enableCssBaseline = true,\n snackbarConfig = {\n maxSnack: 3,\n anchorOrigin: { vertical: 'top', horizontal: 'right' },\n autoHideDuration: 5000,\n },\n\n // API configuration\n apiConfig: providedApiConfig,\n additionalApiConfigurations,\n moduleRoutes,\n routeToColumnsMap,\n routeToResourceMap,\n publicRoutes = [], // Default empty array for public routes in AuthProvider \n}) => {\n console.log(\"additionalApiConfigurations...........\",additionalApiConfigurations)\n\n // Initialize API configuration synchronously before first render\n // This prevents \"API configuration not initialized\" errors when components\n // try to use the API during initial render\n const isInitialized = React.useRef(false);\n\n if (providedApiConfig && !isInitialized.current) {\n try {\n initializeApiConfig(providedApiConfig);\n initializeApiBaseUrls();\n if (additionalApiConfigurations) {\n extendApiConfigurations(additionalApiConfigurations);\n }\n // Inject MFE-provided module routes so the header can resolve modules\n if (moduleRoutes) {\n setModuleRoutes(moduleRoutes);\n }\n isInitialized.current = true;\n } catch (error) {\n console.error('Failed to initialize API configuration:', error);\n }\n }\n // const { isLoading } = useAppTranslations();\n // if (isLoading) {\n // return <Loader />;\n // }\n // Create or use provided Redux store\n const store = React.useMemo(() => {\n if (!useRedux) return null;\n\n if (reduxStore) {\n return reduxStore;\n }\n\n return createLibraryStore(additionalReducers, apiClient);\n }, [useRedux, reduxStore, additionalReducers, apiClient]);\n\n // Create theme\n const theme = React.useMemo(() => {\n if (customTheme) {\n return customTheme;\n }\n\n const themeCreator = themeMode === 'dark' ? createDarkTheme : createLightTheme;\n const { theme: generatedTheme } = themeCreator(primaryColor, direction);\n return generatedTheme;\n }, [customTheme, themeMode, primaryColor, direction]);\n\n // Context value\n const contextValue: ERPUIContextValue = {\n useRedux,\n apiClient,\n theme,\n themeMode,\n direction,\n primaryColor,\n };\n\n // Build provider tree from inside out\n let content = (\n <ERPUIContext.Provider value={contextValue}>\n {/* <ThemeProvider theme={theme}>\n {enableCssBaseline && <CssBaseline />} */}\n {/* <Suspense fallback={<Loader />}> */}\n <MUIThemeWrapper theme={theme} enableCssBaseline={enableCssBaseline}>\n {children}\n </MUIThemeWrapper>\n {/* </Suspense> */}\n {/* </ThemeProvider> */}\n </ERPUIContext.Provider>\n );\n\n // Wrap with snackbar provider if enabled\n if (enableSnackbar) {\n content = (\n <SnackbarProvider {...snackbarConfig}>\n {content}\n </SnackbarProvider>\n );\n }\n\n // Wrap with page provider if enabled\n // if (enablePages) {\n // content = (\n // <PageProvider routeToColumnsMap={routeToColumnsMap} routeToResourceMap={routeToResourceMap}>\n // {content}\n // </PageProvider>\n // );\n // }\n\n // Wrap with permissions provider if enabled\n if (enablePermissions) {\n content = (\n <PermissionsProvider>\n {content}\n </PermissionsProvider>\n );\n }\n\n // Wrap with language provider if enabled\n if (enableLanguage) {\n content = (\n <LanguageProvider>\n {content}\n </LanguageProvider>\n );\n }\n\n // Wrap with auth provider if enabled\n if (enableAuth) {\n content = (\n <AuthProvider publicRoutes={publicRoutes}>\n {content}\n </AuthProvider>\n );\n }\n\n // Wrap with router if enabled\n if (enableRouter) {\n content = (\n <BrowserRouter>\n {content}\n </BrowserRouter>\n );\n }\n\n // Wrap with Redux provider if enabled\n if (useRedux && store) {\n content = (\n <ReduxProvider store={store}>\n {content}\n </ReduxProvider>\n );\n }\n\n return content;\n};\n\nexport default ERPUIProvider;","import { enqueueSnackbar } from \"notistack\";\n\ntype ApiResponse = {\n meta?: {\n requestStatus?: string;\n };\n error?: {\n message?: string;\n };\n payload?:any\n};\n\ntype Callback = () => void;\n\nexport function apiHelper(res: ApiResponse, callBack?: Callback): void {\n if (res?.meta?.requestStatus === \"rejected\") {\n const errorMessage = (() => {\n try {\n return res.error?.message ? JSON.parse(res.error.message) : null;\n } catch {\n return { message: \"Something went wrong\" };\n }\n })();\n\n const message = errorMessage?.message?.replace(\"Error:\", \"\").trim() || \"Something went wrong\";\n\n enqueueSnackbar(message, {\n variant: \"error\",\n });\n return\n }\n\n if (callBack && typeof callBack === \"function\") {\n callBack();\n } else if (callBack) {\n console.warn(\"Provided callBack is not a function.\");\n }\n}\n"],"names":["React","jsx","ReduxProvider","_a"],"mappings":";;;;;;;;;;;;;;;;;AAQA,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,QAAA;AACrB,QAAM,EAAE,MAAM,QAAA,IAAY,QAAA;AAC1B,QAAM,EAAE,EAAA,IAAM,eAAA;AAEd,YAAU,MAAM;AACf,UAAM,aAAa,QAAQ,CAAC;AAC5B,UAAM,cAAc,SAAS,SAAS,YAAA;AACtC,SAAG,6BAAM,OAAM,CAAC,SAAS;AAExB,YAAM,gBAAgB,WAAW;AAAA,QAChC,CAAC,QAAA;;AACA,qBAAI,KAAK,YAAA,MAAkB,iBAC3B,SAAI,oBAAJ,mBAAqB,KAAK,CAAC,UAAkB,YAAY,WAAW,MAAM,aAAa;AAAA;AAAA,MAAC;AAG1F,UAAI,gBAA0B,CAAA;AAE9B,UAAI,+CAAe,mBAAmB;AACrC,wBAAgB,CAAC,GAAG,cAAc,mBAAmB,QAAQ;AAAA,MAC9D,WAAW,CAAC,iBAAiB,gBAAgB,cAAc;AAC1D,wBAAgB,CAAC,QAAQ;AAAA,MAC1B;AAEA,UAAI,cAAc,SAAS,GAAG;AAC7B,cAAM,YAAY,CAAC,GAAG,aAAa,EAAE,KAAA,EAAO,KAAK,GAAG;AAGpD,YAAI,4BAA4B,aAAa,iBAAiB;AAC7D,cAAI,mBAAmB;AACtB,yBAAa,KAAK;AAClB,gCAAoB;AAAA,UACrB;AACA;AAAA,QACD;AAEA,0BAAkB;AAClB,kC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AAI;AACF,iBAAOC,MAAA,IAAI,UAAJ,gBAAAA,IAAW,WAAU,KAAK,MAAM,IAAI,MAAM,OAAO,IAAI;AAAA,MAC9D,QAAQ;AACN,eAAO,EAAE,SAAS,uBAAA;AAAA,MACpB;AAAA,IACF,GAAA;AAEA,UAAM,YAAU,kDAAc,YAAd,mBAAuB,QAAQ,UAAU,IAAI,WAAU;AAEvE,oBAAgB,SAAS;AAAA,MACvB,SAAS;AAAA,IAAA,CACV;AACD;AAAA,EACF;AAEA,MAAI,YAAY,OAAO,aAAa,YAAY;AAC9C,aAAA;AAAA,EACF,WAAW,UAAU;AACnB,YAAQ,KAAK,sCAAsC;AAAA,EACrD;AACF;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { P as PropTypes, _ as _extends, e as _objectWithoutPropertiesLoose, k as interopRequireDefaultExports, v as styled$1, q as styleFunctionSx, T as THEME_ID, d as defaultTheme$1, g as generateUtilityClass, u as useDefaultProps, j as capitalize, f as alpha_1, C as ClassNameGenerator, a as createTheme } from "./identifier-u4E_J1of.esm.js";
|
|
2
|
-
import { e as useForkRef, r as requireCreateSvgIcon, T as Typography$1, f as useTimeout, j as useIsFocusVisible, k as useEventCallback, l as ownerDocument, o as ownerWindow, d as useEnhancedEffect, s as setRef, m as createChainedFunction, p as isMuiElement, h as debounce$1, i as default_1$9, u as useAuth, g as generateRouteWithId } from "./useAuth-
|
|
2
|
+
import { e as useForkRef, r as requireCreateSvgIcon, T as Typography$1, f as useTimeout, j as useIsFocusVisible, k as useEventCallback, l as ownerDocument, o as ownerWindow, d as useEnhancedEffect, s as setRef, m as createChainedFunction, p as isMuiElement, h as debounce$1, i as default_1$9, u as useAuth, g as generateRouteWithId } from "./useAuth-Tfx2guEJ.esm.js";
|
|
3
3
|
import { j as jsxRuntimeExports } from "./jsx-runtime-ClFauRgV.esm.js";
|
|
4
4
|
import { debounce } from "lodash";
|
|
5
5
|
import * as React from "react";
|
|
@@ -12,9 +12,9 @@ import { useNavigate, useLocation, matchRoutes, Link } from "react-router-dom";
|
|
|
12
12
|
import { useTranslation } from "react-i18next";
|
|
13
13
|
import { aH as PathnameGenerator, f as PathnameRental, aJ as PathnameGenerator$1, b as PathnameCrm, aI as PathnameGenerator$2, e as PathnamePurchase, aN as ROUTES, aK as PathnameGenerator$3, d as PathnameManufacturing, aL as PathnameGenerator$4, c as PathnameInventory, aM as PathnameGenerator$5, a as PathnameAccounting, P as Pathname } from "./pathname.rental-VYOFVGX6.esm.js";
|
|
14
14
|
import { i as images } from "./images-BY6aQF32.esm.js";
|
|
15
|
-
import { m as modules } from "./modules-
|
|
16
|
-
import { u as useLanguage } from "./useLangauge-
|
|
17
|
-
import { ar as getToken, a8 as getErrorMessage, aU as formatText, q as convertToUnderscore } from "./common-
|
|
15
|
+
import { m as modules } from "./modules-D5_hDIg9.esm.js";
|
|
16
|
+
import { u as useLanguage } from "./useLangauge-BU_fP3ZM.esm.js";
|
|
17
|
+
import { ar as getToken, a8 as getErrorMessage, aU as formatText, q as convertToUnderscore } from "./common-B6euWODJ.esm.js";
|
|
18
18
|
import { Controller, appendErrors, useForm } from "react-hook-form";
|
|
19
19
|
import { validateFieldsNatively, toNestErrors } from "@hookform/resolvers";
|
|
20
20
|
import * as Yup from "yup";
|
|
@@ -8561,4 +8561,4 @@ export {
|
|
|
8561
8561
|
default_1$8 as y,
|
|
8562
8562
|
List as z
|
|
8563
8563
|
};
|
|
8564
|
-
//# sourceMappingURL=appbar-
|
|
8564
|
+
//# sourceMappingURL=appbar-DM2iBqb4.esm.js.map
|