@owp/core 1.27.0 → 1.29.0

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 (130) hide show
  1. package/colors.d.ts +2 -0
  2. package/constants.d.ts +2 -0
  3. package/context.d.ts +2 -0
  4. package/dist/{Close-DA97hwNx.js → Close-Cm04EulE.js} +331 -341
  5. package/dist/Close-Cm04EulE.js.map +1 -0
  6. package/dist/OwpStoreProvider-CFq963Pl.js +30 -0
  7. package/dist/OwpStoreProvider-CFq963Pl.js.map +1 -0
  8. package/dist/OwpUtils-9lHSCdan.js.map +1 -1
  9. package/dist/{QuickPanel-EyvjMTxX.js → QuickPanel-DlrhsNXW.js} +2 -2
  10. package/dist/{QuickPanel-EyvjMTxX.js.map → QuickPanel-DlrhsNXW.js.map} +1 -1
  11. package/dist/constants.js +17 -18
  12. package/dist/constants.js.map +1 -1
  13. package/dist/context.js +24 -22
  14. package/dist/context.js.map +1 -1
  15. package/dist/hooks.js +97 -64
  16. package/dist/hooks.js.map +1 -1
  17. package/dist/{index-CdxKoZlQ.js → index-Dn7pPU3W.js} +12546 -13902
  18. package/dist/index-Dn7pPU3W.js.map +1 -0
  19. package/dist/index.js +78 -117
  20. package/dist/{lazyLoadedSlices-Bjy1crVY.js → lazyLoadedSlices-BYAl2fil.js} +710 -718
  21. package/dist/lazyLoadedSlices-BYAl2fil.js.map +1 -0
  22. package/dist/owp-app.css +1 -1
  23. package/dist/store.js +38 -3
  24. package/dist/store.js.map +1 -1
  25. package/dist/{toUpper-CilZrxEa.js → toUpper-K8I4frC5.js} +2 -2
  26. package/dist/{toUpper-CilZrxEa.js.map → toUpper-K8I4frC5.js.map} +1 -1
  27. package/dist/{treeGrid-CjB04cBq.js → treeGrid-DRAoPLXh.js} +11 -11
  28. package/dist/{treeGrid-CjB04cBq.js.map → treeGrid-DRAoPLXh.js.map} +1 -1
  29. package/dist/{treeGridUtil-_FDvRzzt.js → treeGridUtil-C46Qi5LG.js} +2 -2
  30. package/dist/{treeGridUtil-_FDvRzzt.js.map → treeGridUtil-C46Qi5LG.js.map} +1 -1
  31. package/dist/types/components/OwpCommonDialog/OwpCommonDialog.d.ts +1 -26
  32. package/dist/types/components/OwpDialog/OwpDialog.d.ts +32 -6
  33. package/dist/types/components/OwpDialog/index.d.ts +1 -4
  34. package/dist/types/components/OwpErrorBoundary/OwpErrorBoundary.d.ts +1 -1
  35. package/dist/types/components/OwpLanguageSwitcherSelect/index.d.ts +1 -0
  36. package/dist/types/components/OwpLayout/OwpLayout.d.ts +1 -1
  37. package/dist/types/components/OwpMrtTable/OwpMrtTable.d.ts +7 -3
  38. package/dist/types/components/OwpMrtTable/OwpMrtTableTopToolbar.d.ts +6 -0
  39. package/dist/types/components/OwpNavLinkAdapter/OwpNavLinkAdapter.d.ts +16 -0
  40. package/dist/types/components/OwpNavLinkAdapter/index.d.ts +2 -0
  41. package/dist/types/components/OwpNavigation/horizontal/types/OwpNavHorizontalGroup.d.ts +1 -2
  42. package/dist/types/components/OwpNavigation/horizontal/types/OwpNavHorizontalItem.d.ts +1 -2
  43. package/dist/types/components/OwpNavigation/horizontal/types/OwpNavHorizontalLink.d.ts +1 -2
  44. package/dist/types/components/{shared-components/PageBreadcrumb.d.ts → OwpPageBreadcrumb/OwpPageBreadcrumb.d.ts} +1 -1
  45. package/dist/types/components/OwpPageBreadcrumb/index.d.ts +2 -0
  46. package/dist/types/components/OwpTable/OwpTable.d.ts +1 -1
  47. package/dist/types/components/{shared-components/tabs → OwpTabs}/OwpTab.d.ts +1 -1
  48. package/dist/types/components/{shared-components/tabs → OwpTabs}/OwpTabs.d.ts +1 -1
  49. package/dist/types/components/OwpTabs/index.d.ts +2 -0
  50. package/dist/types/components/OwpThemeSelector/SchemePreview.d.ts +1 -1
  51. package/dist/types/components/OwpThemeSelector/ThemePreview.d.ts +1 -1
  52. package/dist/types/components/OwpTreeGrid/OwpTreeGridToolbar.d.ts +1 -1
  53. package/dist/types/components/layouts/shared-components/navigation/store/navigationSlice.d.ts +9 -9
  54. package/dist/types/components/layouts/themeLayoutConfigs.d.ts +1 -1
  55. package/dist/types/context/OwpAppProvider.d.ts +1 -1
  56. package/dist/types/context/OwpCoreProvider.d.ts +1 -1
  57. package/dist/types/{store → context}/OwpStoreProvider.d.ts +1 -1
  58. package/dist/types/context/index.d.ts +1 -0
  59. package/dist/types/hooks/index.d.ts +1 -0
  60. package/dist/types/hooks/useAccessTokenGuard.d.ts +12 -0
  61. package/dist/types/hooks/useStorage.d.ts +10 -1
  62. package/dist/types/index.d.ts +4 -13
  63. package/dist/types/store/generateReducersFromSlices.d.ts +4 -1
  64. package/dist/types/store/hooks.d.ts +3 -0
  65. package/dist/types/store/index.d.ts +5 -1
  66. package/dist/types/store/lazyLoadedSlices.d.ts +3 -0
  67. package/dist/types/store/middleware.d.ts +3 -0
  68. package/dist/types/{components/OwpSettings → store}/owpSettingsSlice.d.ts +1 -1
  69. package/dist/types/store/store.d.ts +3 -0
  70. package/dist/types/store/withSlices.d.ts +2 -2
  71. package/dist/types/{components/OwpSettings/OwpSettings.d.ts → types/OwpSettingsTypes.d.ts} +0 -12
  72. package/dist/types/utils/common/OwpUtils.d.ts +1 -1
  73. package/dist/types/utils/createDateRangeSearchParams.d.ts +16 -0
  74. package/dist/types/utils/fetchFile.d.ts +12 -0
  75. package/dist/types/utils/index.d.ts +3 -0
  76. package/dist/types/utils/sanitizeAuthInputValue.d.ts +10 -0
  77. package/dist/useOwpTranslation-CMrtqKkT.js +190 -0
  78. package/dist/useOwpTranslation-CMrtqKkT.js.map +1 -0
  79. package/dist/useStorage-BA0D8KA7.js +67 -0
  80. package/dist/useStorage-BA0D8KA7.js.map +1 -0
  81. package/dist/{useTreeGridExcelExport-BGh2y8Cg.js → useTreeGridExcelExport-DLMecvHS.js} +62 -71
  82. package/dist/useTreeGridExcelExport-DLMecvHS.js.map +1 -0
  83. package/dist/utils.js +2066 -2026
  84. package/dist/utils.js.map +1 -1
  85. package/hooks.d.ts +2 -0
  86. package/index.d.ts +3 -0
  87. package/package.json +5 -12
  88. package/store.d.ts +2 -0
  89. package/treegrid-global.d.ts +4904 -0
  90. package/utils.d.ts +2 -0
  91. package/dist/Close-DA97hwNx.js.map +0 -1
  92. package/dist/OwpStoreProvider-BKRp9Maw.js +0 -34
  93. package/dist/OwpStoreProvider-BKRp9Maw.js.map +0 -1
  94. package/dist/index-CdxKoZlQ.js.map +0 -1
  95. package/dist/language-CwsGUe4C.js +0 -5
  96. package/dist/language-CwsGUe4C.js.map +0 -1
  97. package/dist/lazyLoadedSlices-Bjy1crVY.js.map +0 -1
  98. package/dist/types/auth/authRoles.d.ts +0 -21
  99. package/dist/types/components/NavLinkAdapter/NavLinkAdapter.d.ts +0 -18
  100. package/dist/types/components/NavLinkAdapter/index.d.ts +0 -1
  101. package/dist/types/components/OwpDialog/owpDialogSlice.d.ts +0 -14
  102. package/dist/types/components/OwpMessage/OwpMessage.d.ts +0 -11
  103. package/dist/types/components/OwpMessage/index.d.ts +0 -4
  104. package/dist/types/components/OwpMessage/owpMessageSlice.d.ts +0 -14
  105. package/dist/types/components/OwpSettings/OwpLayoutConfig.d.ts +0 -16
  106. package/dist/types/components/OwpSettings/OwpLayoutConfigs.d.ts +0 -14
  107. package/dist/types/components/OwpSettings/index.d.ts +0 -1
  108. package/dist/types/components/OwpSettings/palette-generator/PalettePreview.d.ts +0 -14
  109. package/dist/types/components/OwpSettings/palette-generator/PaletteSelector.d.ts +0 -15
  110. package/dist/types/components/OwpSettings/palette-generator/SectionPreview.d.ts +0 -12
  111. package/dist/types/components/layouts/shared-components/AdjustFontSize.d.ts +0 -8
  112. package/dist/types/components/layouts/shared-components/OwpSettingsViewerDialog.d.ts +0 -8
  113. package/dist/types/components/layouts/shared-components/configurator/Configurator.d.ts +0 -9
  114. package/dist/types/components/layouts/shared-components/configurator/SettingsPanel.d.ts +0 -12
  115. package/dist/types/components/layouts/shared-components/configurator/ThemesPanel.d.ts +0 -12
  116. package/dist/types/components/shared-components/LightDarkModeToggle.d.ts +0 -8
  117. package/dist/types/components/shared-components/PageTitle.d.ts +0 -11
  118. package/dist/types/components/shared-components/data-table/DataTable.d.ts +0 -12
  119. package/dist/types/components/shared-components/data-table/DataTableTopToolbar.d.ts +0 -6
  120. package/dist/types/components/shared-components/index.d.ts +0 -7
  121. package/dist/types/components/withRouter/index.d.ts +0 -1
  122. package/dist/types/components/withRouter/withRouter.d.ts +0 -14
  123. package/dist/types/store/apiService.d.ts +0 -3
  124. package/dist/types/store/withReducer.d.ts +0 -5
  125. package/dist/useOwpTranslation-VarZsCQ4.js +0 -233
  126. package/dist/useOwpTranslation-VarZsCQ4.js.map +0 -1
  127. package/dist/useTreeGridExcelExport-BGh2y8Cg.js.map +0 -1
  128. /package/dist/types/components/{layouts/shared-components → OwpLanguageSwitcherSelect}/OwpLanguageSwitcherSelect.d.ts +0 -0
  129. /package/dist/types/components/{shared-components/data-table → OwpMrtTable}/utils/parseFromValuesOrFunc.d.ts +0 -0
  130. /package/dist/types/{components/OwpSettings → types}/ThemeFormConfigTypes.d.ts +0 -0
package/dist/constants.js CHANGED
@@ -1,25 +1,24 @@
1
- import { D as a, e as R, b as s, d as G, c as e, a as C, g as I, h as D, f as N, T as O } from "./treeGrid-CjB04cBq.js";
2
- import { F as r } from "./language-CwsGUe4C.js";
3
- import { S as n } from "./storageKeys-DRzte9LZ.js";
4
- const E = {
1
+ import { f as a, d as s, a as G, c as e, D as C, b as I, T as c, e as n, g as D, h as N } from "./treeGrid-DRAoPLXh.js";
2
+ import { S as o } from "./storageKeys-DRzte9LZ.js";
3
+ const L = ["kr", "en", "lc"], E = {
5
4
  accessToken: "jwt_access_token",
6
5
  currentLanguage: "CurrentLanguage"
7
- }, L = E.accessToken, _ = E.currentLanguage;
6
+ }, _ = E.accessToken, T = E.currentLanguage;
8
7
  export {
9
- _ as CURRENT_LANGUAGE,
8
+ T as CURRENT_LANGUAGE,
10
9
  a as DEFAULT_CELL_ALIGNMENT,
11
- R as DEFAULT_HEADER_FILL,
12
- s as DEFAULT_HEADER_FONT,
13
- G as DEFAULT_THIN_BORDER,
14
- e as DEFAULT_VALUE_FONT,
15
- C as DEFAULT_WRAP_CELL_ALIGNMENT,
16
- r as FALLBACK_LANGUAGE_LIST,
10
+ s as DEFAULT_HEADER_FILL,
11
+ G as DEFAULT_HEADER_FONT,
12
+ e as DEFAULT_THIN_BORDER,
13
+ C as DEFAULT_VALUE_FONT,
14
+ I as DEFAULT_WRAP_CELL_ALIGNMENT,
15
+ L as FALLBACK_LANGUAGE_LIST,
17
16
  E as LOCAL_STORAGE_KEYS,
18
- L as STORAGE_ACCESS_TOKEN_KEY,
19
- n as STORAGE_KEYS,
20
- I as TREEGRID_CELL_HIGHLIGHT_CLASS,
21
- D as TREEGRID_CELL_HIGHLIGHT_COLOR,
22
- N as TREEGRID_INPUT_CELL_COLOR,
23
- O as TREEGRID_WARNING_CELL_COLOR
17
+ _ as STORAGE_ACCESS_TOKEN_KEY,
18
+ o as STORAGE_KEYS,
19
+ c as TREEGRID_CELL_HIGHLIGHT_CLASS,
20
+ n as TREEGRID_CELL_HIGHLIGHT_COLOR,
21
+ D as TREEGRID_INPUT_CELL_COLOR,
22
+ N as TREEGRID_WARNING_CELL_COLOR
24
23
  };
25
24
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../src/constants/localStorageKeys.ts"],"sourcesContent":["/**\n * 로컬 스토리지 키 목록\n */\nexport const LOCAL_STORAGE_KEYS = {\n accessToken: 'jwt_access_token',\n currentLanguage: 'CurrentLanguage',\n} as const;\n\nexport const STORAGE_ACCESS_TOKEN_KEY = LOCAL_STORAGE_KEYS.accessToken;\nexport const CURRENT_LANGUAGE = LOCAL_STORAGE_KEYS.currentLanguage;\n"],"names":["LOCAL_STORAGE_KEYS","STORAGE_ACCESS_TOKEN_KEY","CURRENT_LANGUAGE"],"mappings":";;;AAGO,MAAMA,IAAqB;AAAA,EAChC,aAAa;AAAA,EACb,iBAAiB;AACnB,GAEaC,IAA2BD,EAAmB,aAC9CE,IAAmBF,EAAmB;"}
1
+ {"version":3,"file":"constants.js","sources":["../src/constants/language.ts","../src/constants/localStorageKeys.ts"],"sourcesContent":["export const FALLBACK_LANGUAGE_LIST = ['kr', 'en', 'lc'];\n","/**\n * 로컬 스토리지 키 목록\n */\nexport const LOCAL_STORAGE_KEYS = {\n accessToken: 'jwt_access_token',\n currentLanguage: 'CurrentLanguage',\n} as const;\n\nexport const STORAGE_ACCESS_TOKEN_KEY = LOCAL_STORAGE_KEYS.accessToken;\nexport const CURRENT_LANGUAGE = LOCAL_STORAGE_KEYS.currentLanguage;\n"],"names":["FALLBACK_LANGUAGE_LIST","LOCAL_STORAGE_KEYS","STORAGE_ACCESS_TOKEN_KEY","CURRENT_LANGUAGE"],"mappings":";;AAAO,MAAMA,IAAyB,CAAC,MAAM,MAAM,IAAI,GCG1CC,IAAqB;AAAA,EAChC,aAAa;AAAA,EACb,iBAAiB;AACnB,GAEaC,IAA2BD,EAAmB,aAC9CE,IAAmBF,EAAmB;"}
package/dist/context.js CHANGED
@@ -1,16 +1,17 @@
1
1
  var f = Object.defineProperty;
2
2
  var l = (i, m) => f(i, "name", { value: m, configurable: !0 });
3
- import { O as a, u as p, a as d, C as g } from "./Close-DA97hwNx.js";
4
- import { b as K } from "./Close-DA97hwNx.js";
5
- import { j as e, a as h } from "./emotion-react-jsx-runtime.browser.esm-Cb9H5d3i.js";
6
- import { StyledEngineProvider as O } from "@mui/material/styles";
7
- import { QueryClient as S, QueryClientProvider as w } from "@tanstack/react-query";
8
- import { useRef as x } from "react";
9
- import { O as F } from "./OwpStoreProvider-BKRp9Maw.js";
3
+ import { O as p, u as a } from "./useOwpTranslation-CMrtqKkT.js";
4
+ import { a as M } from "./useOwpTranslation-CMrtqKkT.js";
5
+ import { j as e, a as d } from "./emotion-react-jsx-runtime.browser.esm-Cb9H5d3i.js";
6
+ import { StyledEngineProvider as g } from "@mui/material/styles";
7
+ import { QueryClient as O, QueryClientProvider as h } from "@tanstack/react-query";
8
+ import { useRef as S } from "react";
9
+ import { O as w } from "./OwpStoreProvider-CFq963Pl.js";
10
+ import { O as x, C as F } from "./Close-Cm04EulE.js";
10
11
  import C from "@mui/material/IconButton";
11
12
  import { DialogsProvider as y } from "@toolpad/core/useDialogs";
12
13
  import { SnackbarProvider as A, closeSnackbar as L } from "notistack";
13
- function R({
14
+ function U({
14
15
  children: i,
15
16
  queryClient: m,
16
17
  queryClientConfig: t,
@@ -18,10 +19,10 @@ function R({
18
19
  styledEngineProviderProps: r = { injectFirst: !0 },
19
20
  ...u
20
21
  }) {
21
- const n = x(void 0), s = m ?? n.current ?? (n.current = new S(t));
22
- return /* @__PURE__ */ e(a, { ...u, children: /* @__PURE__ */ e(F, { preloadedState: o, children: /* @__PURE__ */ e(w, { client: s, children: /* @__PURE__ */ e(O, { ...r, children: i }) }) }) });
22
+ const n = S(void 0), s = m ?? n.current ?? (n.current = new O(t));
23
+ return /* @__PURE__ */ e(p, { ...u, children: /* @__PURE__ */ e(w, { preloadedState: o, children: /* @__PURE__ */ e(h, { client: s, children: /* @__PURE__ */ e(g, { ...r, children: i }) }) }) });
23
24
  }
24
- l(R, "OwpCoreProvider");
25
+ l(U, "OwpCoreProvider");
25
26
  const c = {
26
27
  maxSnack: 5,
27
28
  autoHideDuration: 3e3,
@@ -36,14 +37,14 @@ const c = {
36
37
  classes: {
37
38
  containerRoot: "bottom-0 right-0 mb-52 md:mb-68 mr-8 lg:mr-80"
38
39
  },
39
- action: /* @__PURE__ */ l((i) => /* @__PURE__ */ e(C, { onClick: /* @__PURE__ */ l(() => L(i), "onClick"), children: /* @__PURE__ */ e(g, { fontSize: "small", sx: { color: "#FFFFFF" } }) }), "action")
40
+ action: /* @__PURE__ */ l((i) => /* @__PURE__ */ e(C, { onClick: /* @__PURE__ */ l(() => L(i), "onClick"), children: /* @__PURE__ */ e(F, { fontSize: "small", sx: { color: "#FFFFFF" } }) }), "action")
40
41
  };
41
- function U({
42
+ function G({
42
43
  children: i,
43
44
  dialogsProviderProps: m,
44
45
  snackbarProviderProps: t
45
46
  }) {
46
- const { env: o } = p(), r = {
47
+ const { env: o } = a(), r = {
47
48
  ...c,
48
49
  ...t,
49
50
  style: {
@@ -56,17 +57,18 @@ function U({
56
57
  },
57
58
  action: (t == null ? void 0 : t.action) ?? c.action
58
59
  }, u = Number(o == null ? void 0 : o.autoLogoutTimeout), n = Number.isFinite(u) ? u : void 0;
59
- return /* @__PURE__ */ e(y, { ...m, children: /* @__PURE__ */ h(A, { ...r, children: [
60
+ return /* @__PURE__ */ e(y, { ...m, children: /* @__PURE__ */ d(A, { ...r, children: [
60
61
  i,
61
- (o == null ? void 0 : o.isAutoLogoutEnabled) && /* @__PURE__ */ e(d, { timeout: n })
62
+ (o == null ? void 0 : o.isAutoLogoutEnabled) && /* @__PURE__ */ e(x, { timeout: n })
62
63
  ] }) });
63
64
  }
64
- l(U, "OwpUiProvider");
65
+ l(G, "OwpUiProvider");
65
66
  export {
66
- K as OwpAppContext,
67
- a as OwpAppProvider,
68
- R as OwpCoreProvider,
69
- U as OwpUiProvider,
70
- p as useOwpAppContext
67
+ M as OwpAppContext,
68
+ p as OwpAppProvider,
69
+ U as OwpCoreProvider,
70
+ w as OwpStoreProvider,
71
+ G as OwpUiProvider,
72
+ a as useOwpAppContext
71
73
  };
72
74
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../src/context/OwpCoreProvider.tsx","../src/context/OwpUiProvider.tsx"],"sourcesContent":["import { StyledEngineProvider } from '@mui/material/styles';\nimport { QueryClient, QueryClientConfig, QueryClientProvider } from '@tanstack/react-query';\nimport { ComponentProps, useRef } from 'react';\nimport { OwpStoreProvider, OwpStoreProviderProps } from '../store/OwpStoreProvider';\nimport { OwpAppProvider, OwpAppProviderProps } from './OwpAppProvider';\n\ntype OwpStyledEngineProviderProps = Omit<ComponentProps<typeof StyledEngineProvider>, 'children'>;\n\nexport interface OwpCoreProviderProps extends OwpAppProviderProps {\n queryClient?: QueryClient;\n queryClientConfig?: QueryClientConfig;\n storePreloadedState?: OwpStoreProviderProps['preloadedState'];\n styledEngineProviderProps?: OwpStyledEngineProviderProps;\n}\n\n/**\n * App, Redux, React Query provider composition\n * @param queryClient 외부 QueryClient 인스턴스\n * @param queryClientConfig QueryClient 생성 옵션\n * @param storePreloadedState 초기 Redux 상태\n * @param styledEngineProviderProps StyledEngineProvider 옵션\n */\nexport function OwpCoreProvider({\n children,\n queryClient,\n queryClientConfig,\n storePreloadedState,\n styledEngineProviderProps = { injectFirst: true },\n ...appProviderProps\n}: OwpCoreProviderProps) {\n const queryClientRef = useRef<QueryClient | undefined>(undefined);\n const client = queryClient ?? (queryClientRef.current ??= new QueryClient(queryClientConfig));\n\n return (\n <OwpAppProvider {...appProviderProps}>\n <OwpStoreProvider preloadedState={storePreloadedState}>\n <QueryClientProvider client={client}>\n <StyledEngineProvider {...styledEngineProviderProps}>{children}</StyledEngineProvider>\n </QueryClientProvider>\n </OwpStoreProvider>\n </OwpAppProvider>\n );\n}\n","import { OwpAutoLogoutDialog } from '@/components/OwpAutoLogoutDialog/OwpAutoLogoutDialog';\nimport CloseIcon from '@mui/icons-material/Close';\nimport IconButton from '@mui/material/IconButton';\nimport { DialogsProvider } from '@toolpad/core/useDialogs';\nimport { closeSnackbar, SnackbarKey, SnackbarProvider } from 'notistack';\nimport { ComponentProps, ReactNode } from 'react';\nimport { useOwpAppContext } from './OwpAppProvider';\n\ntype OwpDialogsProviderProps = Omit<ComponentProps<typeof DialogsProvider>, 'children'>;\ntype OwpSnackbarProviderProps = Omit<ComponentProps<typeof SnackbarProvider>, 'children'>;\n\nexport interface OwpUiProviderProps {\n children?: ReactNode;\n dialogsProviderProps?: OwpDialogsProviderProps;\n snackbarProviderProps?: OwpSnackbarProviderProps;\n}\n\nconst defaultSnackbarProviderProps: OwpSnackbarProviderProps = {\n maxSnack: 5,\n autoHideDuration: 3000,\n anchorOrigin: {\n vertical: 'top',\n horizontal: 'center',\n },\n style: {\n fontSize: '1.25rem',\n lineHeight: '1.75rem',\n },\n classes: {\n containerRoot: 'bottom-0 right-0 mb-52 md:mb-68 mr-8 lg:mr-80',\n },\n action: (snackbarKey: SnackbarKey) => (\n <IconButton onClick={() => closeSnackbar(snackbarKey)}>\n <CloseIcon fontSize=\"small\" sx={{ color: '#FFFFFF' }} />\n </IconButton>\n ),\n};\n\n/**\n * Dialog, snackbar provider composition\n * @param dialogsProviderProps DialogsProvider 옵션\n * @param snackbarProviderProps SnackbarProvider 옵션\n */\nexport function OwpUiProvider({\n children,\n dialogsProviderProps,\n snackbarProviderProps,\n}: OwpUiProviderProps) {\n const { env } = useOwpAppContext();\n const resolvedSnackbarProviderProps: OwpSnackbarProviderProps = {\n ...defaultSnackbarProviderProps,\n ...snackbarProviderProps,\n style: {\n ...defaultSnackbarProviderProps.style,\n ...snackbarProviderProps?.style,\n },\n classes: {\n ...defaultSnackbarProviderProps.classes,\n ...snackbarProviderProps?.classes,\n },\n action: snackbarProviderProps?.action ?? defaultSnackbarProviderProps.action,\n };\n const resolvedAutoLogoutTimeout = Number(env?.autoLogoutTimeout);\n const autoLogoutTimeout = Number.isFinite(resolvedAutoLogoutTimeout)\n ? resolvedAutoLogoutTimeout\n : undefined;\n\n return (\n <DialogsProvider {...dialogsProviderProps}>\n <SnackbarProvider {...resolvedSnackbarProviderProps}>\n {children}\n {env?.isAutoLogoutEnabled && <OwpAutoLogoutDialog timeout={autoLogoutTimeout} />}\n </SnackbarProvider>\n </DialogsProvider>\n );\n}\n"],"names":["OwpCoreProvider","children","queryClient","queryClientConfig","storePreloadedState","styledEngineProviderProps","appProviderProps","queryClientRef","useRef","client","QueryClient","OwpAppProvider","jsx","OwpStoreProvider","QueryClientProvider","StyledEngineProvider","__name","defaultSnackbarProviderProps","snackbarKey","IconButton","closeSnackbar","CloseIcon","OwpUiProvider","dialogsProviderProps","snackbarProviderProps","env","useOwpAppContext","resolvedSnackbarProviderPro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AC9D,GAAGV;AAAA,IACH,GAAGO;AAAA,IACH,OAAO;AAAA,MACL,GAAGP,EAA6B;AAAA,MAChC,GAAGO,KAAA,gBAAAA,EAAuB;AAAA,IAAA;AAAA,IAE5B,SAAS;AAAA,MACP,GAAGP,EAA6B;AAAA,MAChC,GAAGO,KAAA,gBAAAA,EAAuB;AAAA,IAAA;AAAA,IAE5B,SAAQA,KAAA,gBAAAA,EAAuB,WAAUP,EAA6B;AAAA,EAAA,GAElEW,IAA4B,OAAOH,KAAA,gBAAAA,EAAK,iBAAiB,GACzDI,IAAoB,OAAO,SAASD,CAAyB,IAC/DA,IACA;AAEJ,2BACGE,GAAA,EAAiB,GAAGP,GACnB,UAAA,gBAAAQ,EAACC,GAAA,EAAkB,GAAGL,GACnB,UAAA;AAAA,IAAA1B;AAAA,KACAwB,KAAA,gBAAAA,EAAK,wBAAuB,gBAAAb,EAACqB,GAAA,EAAoB,SAASJ,EAAA,CAAmB;AAAA,EAAA,EAAA,CAChF,EAAA,CACF;AAEJ;AAhCgBb,EAAAM,GAAA;"}
1
+ {"version":3,"file":"context.js","sources":["../src/context/OwpCoreProvider.tsx","../src/context/OwpUiProvider.tsx"],"sourcesContent":["import { StyledEngineProvider } from '@mui/material/styles';\nimport { QueryClient, QueryClientConfig, QueryClientProvider } from '@tanstack/react-query';\nimport { ComponentProps, useRef } from 'react';\nimport { OwpAppProvider, OwpAppProviderProps } from './OwpAppProvider';\nimport { OwpStoreProvider, OwpStoreProviderProps } from './OwpStoreProvider';\n\ntype OwpStyledEngineProviderProps = Omit<ComponentProps<typeof StyledEngineProvider>, 'children'>;\n\nexport interface OwpCoreProviderProps extends OwpAppProviderProps {\n queryClient?: QueryClient;\n queryClientConfig?: QueryClientConfig;\n storePreloadedState?: OwpStoreProviderProps['preloadedState'];\n styledEngineProviderProps?: OwpStyledEngineProviderProps;\n}\n\n/**\n * App, Redux, React Query provider composition\n * @param queryClient 외부 QueryClient 인스턴스\n * @param queryClientConfig QueryClient 생성 옵션\n * @param storePreloadedState 초기 Redux 상태\n * @param styledEngineProviderProps StyledEngineProvider 옵션\n */\nexport function OwpCoreProvider({\n children,\n queryClient,\n queryClientConfig,\n storePreloadedState,\n styledEngineProviderProps = { injectFirst: true },\n ...appProviderProps\n}: OwpCoreProviderProps) {\n const queryClientRef = useRef<QueryClient | undefined>(undefined);\n const client = queryClient ?? (queryClientRef.current ??= new QueryClient(queryClientConfig));\n\n return (\n <OwpAppProvider {...appProviderProps}>\n <OwpStoreProvider preloadedState={storePreloadedState}>\n <QueryClientProvider client={client}>\n <StyledEngineProvider {...styledEngineProviderProps}>{children}</StyledEngineProvider>\n </QueryClientProvider>\n </OwpStoreProvider>\n </OwpAppProvider>\n );\n}\n","import { OwpAutoLogoutDialog } from '@/components/OwpAutoLogoutDialog/OwpAutoLogoutDialog';\nimport CloseIcon from '@mui/icons-material/Close';\nimport IconButton from '@mui/material/IconButton';\nimport { DialogsProvider } from '@toolpad/core/useDialogs';\nimport { closeSnackbar, SnackbarKey, SnackbarProvider } from 'notistack';\nimport { ComponentProps, ReactNode } from 'react';\nimport { useOwpAppContext } from './OwpAppProvider';\n\ntype OwpDialogsProviderProps = Omit<ComponentProps<typeof DialogsProvider>, 'children'>;\ntype OwpSnackbarProviderProps = Omit<ComponentProps<typeof SnackbarProvider>, 'children'>;\n\nexport interface OwpUiProviderProps {\n children?: ReactNode;\n dialogsProviderProps?: OwpDialogsProviderProps;\n snackbarProviderProps?: OwpSnackbarProviderProps;\n}\n\nconst defaultSnackbarProviderProps: OwpSnackbarProviderProps = {\n maxSnack: 5,\n autoHideDuration: 3000,\n anchorOrigin: {\n vertical: 'top',\n horizontal: 'center',\n },\n style: {\n fontSize: '1.25rem',\n lineHeight: '1.75rem',\n },\n classes: {\n containerRoot: 'bottom-0 right-0 mb-52 md:mb-68 mr-8 lg:mr-80',\n },\n action: (snackbarKey: SnackbarKey) => (\n <IconButton onClick={() => closeSnackbar(snackbarKey)}>\n <CloseIcon fontSize=\"small\" sx={{ color: '#FFFFFF' }} />\n </IconButton>\n ),\n};\n\n/**\n * Dialog, snackbar provider composition\n * @param dialogsProviderProps DialogsProvider 옵션\n * @param snackbarProviderProps SnackbarProvider 옵션\n */\nexport function OwpUiProvider({\n children,\n dialogsProviderProps,\n snackbarProviderProps,\n}: OwpUiProviderProps) {\n const { env } = useOwpAppContext();\n const resolvedSnackbarProviderProps: OwpSnackbarProviderProps = {\n ...defaultSnackbarProviderProps,\n ...snackbarProviderProps,\n style: {\n ...defaultSnackbarProviderProps.style,\n ...snackbarProviderProps?.style,\n },\n classes: {\n ...defaultSnackbarProviderProps.classes,\n ...snackbarProviderProps?.classes,\n },\n action: snackbarProviderProps?.action ?? defaultSnackbarProviderProps.action,\n };\n const resolvedAutoLogoutTimeout = Number(env?.autoLogoutTimeout);\n const autoLogoutTimeout = Number.isFinite(resolvedAutoLogoutTimeout)\n ? resolvedAutoLogoutTimeout\n : undefined;\n\n return (\n <DialogsProvider {...dialogsProviderProps}>\n <SnackbarProvider {...resolvedSnackbarProviderProps}>\n {children}\n {env?.isAutoLogoutEnabled && <OwpAutoLogoutDialog timeout={autoLogoutTimeout} />}\n </SnackbarProvider>\n </DialogsProvider>\n );\n}\n"],"names":["OwpCoreProvider","children","queryClient","queryClientConfig","storePreloadedState","styledEngineProviderProps","appProviderProps","queryClientRef","useRef","client","QueryClient","OwpAppProvider","jsx","OwpStoreProvider","QueryClientProvider","StyledEngineProvider","__name","defaultSnackbarProviderProps","snackbarKey","IconButton","closeSnackbar","CloseIcon","OwpUiProvider","dialogsProviderProps","snackbarProviderProps","env","useOwpAppContext","resolvedSnackbarProviderProps","resolvedAutoLogoutTimeout","autoLogoutTimeout","DialogsProvider","jsxs","SnackbarProvider","OwpAutoLogoutDialog"],"mappings":";;;;;;;;;;;;;AAsBO,SAASA,EAAgB;AAAA,EAC9B,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,2BAAAC,IAA4B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;AAAA,IAE5B,SAAQA,KAAA,gBAAAA,EAAuB,WAAUP,EAA6B;AAAA,EAAA,GAElEW,IAA4B,OAAOH,KAAA,gBAAAA,EAAK,iBAAiB,GACzDI,IAAoB,OAAO,SAASD,CAAyB,IAC/DA,IACA;AAEJ,2BACGE,GAAA,EAAiB,GAAGP,GACnB,UAAA,gBAAAQ,EAACC,GAAA,EAAkB,GAAGL,GACnB,UAAA;AAAA,IAAA1B;AAAA,KACAwB,KAAA,gBAAAA,EAAK,wBAAuB,gBAAAb,EAACqB,GAAA,EAAoB,SAASJ,EAAA,CAAmB;AAAA,EAAA,EAAA,CAChF,EAAA,CACF;AAEJ;AAhCgBb,EAAAM,GAAA;"}
package/dist/hooks.js CHANGED
@@ -1,79 +1,112 @@
1
- var M = Object.defineProperty;
2
- var t = (r, e) => M(r, "name", { value: e, configurable: !0 });
3
- import { u as f } from "./useTreeGridExcelExport-BGh2y8Cg.js";
4
- import { g as y, i as B, j as F, h as $, c as q, e as w, b as z, k as Q, n as R, m as V, a as W, d as Y, f as H, l as J, o as Z, p as ee, q as te, r as re } from "./useTreeGridExcelExport-BGh2y8Cg.js";
5
- import { u as oe, a as ue, b as ne } from "./useOwpTranslation-VarZsCQ4.js";
6
- import { S as c } from "./storageKeys-DRzte9LZ.js";
7
- import { useAtomValue as i, useSetAtom as O } from "jotai";
8
- import { atomWithStorage as p } from "jotai/utils";
9
- import { s as L } from "./treeGridUtil-_FDvRzzt.js";
10
- import { useEffect as C, useRef as I } from "react";
11
- import { F as me } from "./language-CwsGUe4C.js";
12
- const D = p(
13
- c.currentUser,
1
+ var T = Object.defineProperty;
2
+ var o = (e, t) => T(e, "name", { value: t, configurable: !0 });
3
+ import { u as g } from "./useTreeGridExcelExport-DLMecvHS.js";
4
+ import { g as J, i as Z, j as ee, h as te, c as oe, e as re, b as se, k as ne, m as ue, a as ae, d as ce, f as ie, l as me, n as Ce, o as Ee, p as fe, q as pe } from "./useTreeGridExcelExport-DLMecvHS.js";
5
+ import { STORAGE_ACCESS_TOKEN_KEY as l } from "./constants.js";
6
+ import { FALLBACK_LANGUAGE_LIST as Oe } from "./constants.js";
7
+ import { u as I } from "./useOwpTranslation-CMrtqKkT.js";
8
+ import { c as ge, b as Se } from "./useOwpTranslation-CMrtqKkT.js";
9
+ import { useRef as f, useEffect as i } from "react";
10
+ import { useLocation as _, useNavigate as M } from "react-router-dom";
11
+ import { S as p } from "./storageKeys-DRzte9LZ.js";
12
+ import { useAtomValue as d, useSetAtom as O } from "jotai";
13
+ import { atomWithStorage as L } from "jotai/utils";
14
+ import { g as De, s as Ge, u as Te } from "./useStorage-BA0D8KA7.js";
15
+ import { s as S } from "./treeGridUtil-C46Qi5LG.js";
16
+ const N = "/auth/login", U = "Message.로그인이 필요합니다.", B = /* @__PURE__ */ o(({
17
+ loginPath: e = N,
18
+ isEnabled: t,
19
+ snackbarMessageKey: s = U
20
+ } = {}) => {
21
+ const { env: r } = I(), n = _(), u = M(), a = typeof window > "u" ? null : window.localStorage.getItem(l), c = n.pathname.startsWith(e), C = (t ?? (r == null ? void 0 : r.isAccessTokenGuardEnabled) ?? !0) && !a && !c, E = f(!1);
22
+ return i(() => {
23
+ if (!C) {
24
+ E.current = !1;
25
+ return;
26
+ }
27
+ E.current || (E.current = !0, u(e, {
28
+ replace: !0,
29
+ state: s ? {
30
+ snackbarMessageKey: s
31
+ } : void 0
32
+ }));
33
+ }, [e, u, C, s]), C;
34
+ }, "useAccessTokenGuard"), A = L(
35
+ p.currentUser,
14
36
  void 0
15
- ), _ = /* @__PURE__ */ t(() => i(D), "useGetCurrentUser"), h = /* @__PURE__ */ t(() => O(D), "useSetCurrentUser"), g = p(c.currentUserId, ""), l = /* @__PURE__ */ t(() => i(g), "useGetCurrentUserId"), k = /* @__PURE__ */ t(() => O(g), "useSetCurrentUserId"), S = p(
16
- c.lockLoadingProps,
37
+ ), F = /* @__PURE__ */ o(() => d(A), "useGetCurrentUser"), Y = /* @__PURE__ */ o(() => O(A), "useSetCurrentUser"), D = L(p.currentUserId, ""), j = /* @__PURE__ */ o(() => d(D), "useGetCurrentUserId"), H = /* @__PURE__ */ o(() => O(D), "useSetCurrentUserId"), G = L(
38
+ p.lockLoadingProps,
17
39
  { loading: !1 }
18
- ), x = /* @__PURE__ */ t(() => i(S), "useGetPageLockLoading"), X = /* @__PURE__ */ t(() => ({ setLoading: O(S) }), "usePageLockLoading"), v = /* @__PURE__ */ t((r, e, u, s) => {
19
- const o = f(), n = o == null ? void 0 : o[u];
20
- C(() => {
21
- !s || !n || L(
22
- r,
40
+ ), W = /* @__PURE__ */ o(() => d(G), "useGetPageLockLoading"), $ = /* @__PURE__ */ o(() => ({ setLoading: O(G) }), "usePageLockLoading");
41
+ function q(e) {
42
+ const t = f();
43
+ return i(() => {
44
+ t.current = e;
45
+ }, [e]), t.current;
46
+ }
47
+ o(q, "usePrevious");
48
+ const y = /* @__PURE__ */ o((e, t, s, r) => {
49
+ const n = g(), u = n == null ? void 0 : n[s];
50
+ i(() => {
51
+ !r || !u || S(
23
52
  e,
24
- n,
53
+ t,
54
+ u,
25
55
  "IPX_COMMONCODE.CODEID",
26
56
  ["IPX_COMMONCODE.CODENM", "IPX_COMMONCODE.CODEID"]
27
57
  );
28
- }, [u, e, r, s, n]);
29
- }, "useTreeGridCommonCodeEnum"), b = /* @__PURE__ */ t((r, e, u) => {
30
- const s = f(), o = I(e), n = e.map(({ field: a, codeId: m }) => `${a}:${m}`).join("|");
31
- C(() => {
32
- o.current = e;
33
- }, [e]), C(() => {
34
- !u || !s || o.current.forEach(({ field: a, codeId: m }) => {
35
- const E = s[m];
36
- E && L(
37
- r,
58
+ }, [s, t, e, r, u]);
59
+ }, "useTreeGridCommonCodeEnum"), z = /* @__PURE__ */ o((e, t, s) => {
60
+ const r = g(), n = f(t), u = t.map(({ field: a, codeId: c }) => `${a}:${c}`).join("|");
61
+ i(() => {
62
+ n.current = t;
63
+ }, [t]), i(() => {
64
+ !s || !r || n.current.forEach(({ field: a, codeId: c }) => {
65
+ const m = r[c];
66
+ m && S(
67
+ e,
38
68
  a,
39
- E,
69
+ m,
40
70
  "IPX_COMMONCODE.CODEID",
41
71
  ["IPX_COMMONCODE.CODENM", "IPX_COMMONCODE.CODEID"]
42
72
  );
43
73
  });
44
- }, [s, n, r, u]);
74
+ }, [r, u, e, s]);
45
75
  }, "useTreeGridCommonCodeEnums");
46
76
  export {
47
- me as FALLBACK_LANGUAGE_LIST,
48
- oe as useConfirm,
49
- y as useDebounce,
50
- B as useDeepCompareEffect,
51
- F as useDeepCompareEffectNoCheck,
52
- $ as useDeepCompareMemoize,
53
- f as useGetCommonCodeList,
54
- q as useGetCurrentLanguage,
55
- w as useGetCurrentLogoSrc,
56
- _ as useGetCurrentUser,
57
- l as useGetCurrentUserId,
58
- z as useGetLanguageList,
59
- Q as useGetNavigationList,
60
- x as useGetPageLockLoading,
61
- R as useGetShortcuts,
62
- ue as useOwpTranslation,
63
- X as usePageLockLoading,
64
- V as usePrevious,
65
- W as useSetCommonCodeList,
66
- Y as useSetCurrentLanguage,
67
- H as useSetCurrentLogoSrc,
68
- h as useSetCurrentUser,
69
- k as useSetCurrentUserId,
70
- J as useSetNavigationList,
71
- Z as useSetShortcuts,
72
- ne as useStorage,
73
- ee as useThemeMediaQuery,
74
- te as useTimeout,
75
- v as useTreeGridCommonCodeEnum,
76
- b as useTreeGridCommonCodeEnums,
77
- re as useTreeGridExcelExport
77
+ Oe as FALLBACK_LANGUAGE_LIST,
78
+ De as getEnv,
79
+ Ge as setEnv,
80
+ B as useAccessTokenGuard,
81
+ ge as useConfirm,
82
+ J as useDebounce,
83
+ Z as useDeepCompareEffect,
84
+ ee as useDeepCompareEffectNoCheck,
85
+ te as useDeepCompareMemoize,
86
+ g as useGetCommonCodeList,
87
+ oe as useGetCurrentLanguage,
88
+ re as useGetCurrentLogoSrc,
89
+ F as useGetCurrentUser,
90
+ j as useGetCurrentUserId,
91
+ se as useGetLanguageList,
92
+ ne as useGetNavigationList,
93
+ W as useGetPageLockLoading,
94
+ ue as useGetShortcuts,
95
+ Se as useOwpTranslation,
96
+ $ as usePageLockLoading,
97
+ q as usePrevious,
98
+ ae as useSetCommonCodeList,
99
+ ce as useSetCurrentLanguage,
100
+ ie as useSetCurrentLogoSrc,
101
+ Y as useSetCurrentUser,
102
+ H as useSetCurrentUserId,
103
+ me as useSetNavigationList,
104
+ Ce as useSetShortcuts,
105
+ Te as useStorage,
106
+ Ee as useThemeMediaQuery,
107
+ fe as useTimeout,
108
+ y as useTreeGridCommonCodeEnum,
109
+ z as useTreeGridCommonCodeEnums,
110
+ pe as useTreeGridExcelExport
78
111
  };
79
112
  //# sourceMappingURL=hooks.js.map
package/dist/hooks.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.js","sources":["../src/hooks/useCurrentUser.ts","../src/hooks/useCurrentUserId.ts","../src/hooks/usePageLockLoading.ts","../src/hooks/useTreeGridCommonCodeEnum.ts","../src/hooks/useTreeGridCommonCodeEnums.ts"],"sourcesContent":["import { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nexport interface CurrentUser {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n}\n\nconst currentUserAtom = atomWithStorage<CurrentUser | undefined>(\n STORAGE_KEYS.currentUser,\n undefined,\n);\n\n/**\n * 현재 사용자 정보 조회\n */\nexport const useGetCurrentUser = () => {\n return useAtomValue(currentUserAtom);\n};\n\n/**\n * 현재 사용자 정보 설정\n */\nexport const useSetCurrentUser = () => {\n return useSetAtom(currentUserAtom);\n};\n","import { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nconst currentUserIdAtom = atomWithStorage<string | ''>(STORAGE_KEYS.currentUserId, '');\n\n/**\n * 현재 사용자 ID 조회 훅\n */\nexport const useGetCurrentUserId = () => {\n return useAtomValue(currentUserIdAtom);\n};\n\n/**\n * 현재 사용자 ID 설정 훅\n */\nexport const useSetCurrentUserId = () => {\n return useSetAtom(currentUserIdAtom);\n};\n","import type { OwpPageLockLoadingProps } from '@/components/OwpPageLockLoading';\nimport { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nconst currentLockLoadingAtom = atomWithStorage<OwpPageLockLoadingProps | undefined>(\n STORAGE_KEYS.lockLoadingProps,\n { loading: false },\n);\n\n/**\n * 페이지 잠금 로딩 상태 조회\n */\nexport const useGetPageLockLoading = () => {\n return useAtomValue(currentLockLoadingAtom);\n};\n\n/**\n * 페이지 잠금 로딩 상태 설정\n */\nexport const usePageLockLoading = () => {\n return { setLoading: useSetAtom(currentLockLoadingAtom) };\n};\n","import { useGetCommonCodeList } from '@/hooks/useCommonCodeList';\nimport { setTreeGridColumnEnumOptionsById } from '@/utils/treeGridUtil';\nimport { useEffect } from 'react';\n\n/**\n * TreeGrid 공통코드 Enum 옵션 반영\n * @param id TreeGrid 인스턴스 ID\n * @param field Enum을 반영할 컬럼명\n * @param codeId 공통코드 그룹 ID\n * @param isGridReady TreeGrid 준비 여부\n */\nexport const useTreeGridCommonCodeEnum = (\n id: string,\n field: string,\n codeId: string,\n isGridReady: boolean,\n) => {\n const commonCodeMap = useGetCommonCodeList();\n const options = commonCodeMap?.[codeId];\n\n useEffect(() => {\n if (!isGridReady || !options) {\n return;\n }\n\n setTreeGridColumnEnumOptionsById(\n id,\n field,\n options,\n 'IPX_COMMONCODE.CODEID',\n ['IPX_COMMONCODE.CODENM', 'IPX_COMMONCODE.CODEID'],\n );\n }, [codeId, field, id, isGridReady, options]);\n};\n","import { useGetCommonCodeList } from '@/hooks/useCommonCodeList';\nimport { setTreeGridColumnEnumOptionsById } from '@/utils/treeGridUtil';\nimport { useEffect, useRef } from 'react';\n\n/**\n * TreeGrid 공통코드 Enum 옵션 정보\n * @param field Enum을 반영할 컬럼명\n * @param codeId 공통코드 그룹 ID\n */\nexport interface TreeGridCommonCodeEnumConfig {\n field: string;\n codeId: string;\n}\n\n/**\n * TreeGrid 공통코드 Enum 옵션 일괄 반영\n * @param id TreeGrid 인스턴스 ID\n * @param configs Enum 반영 대상 목록\n * @param isGridReady TreeGrid 준비 여부\n */\nexport const useTreeGridCommonCodeEnums = (\n id: string,\n configs: TreeGridCommonCodeEnumConfig[],\n isGridReady: boolean,\n) => {\n const commonCodeMap = useGetCommonCodeList();\n const configsRef = useRef(configs);\n const configDependencyKey = configs.map(({ field, codeId }) => `${field}:${codeId}`).join('|');\n\n useEffect(() => {\n configsRef.current = configs;\n }, [configs]);\n\n useEffect(() => {\n if (!isGridReady || !commonCodeMap) {\n return;\n }\n\n configsRef.current.forEach(({ field, codeId }) => {\n const options = commonCodeMap[codeId];\n\n if (!options) {\n return;\n }\n\n setTreeGridColumnEnumOptionsById(\n id,\n field,\n options,\n 'IPX_COMMONCODE.CODEID',\n ['IPX_COMMONCODE.CODENM', 'IPX_COMMONCODE.CODEID'],\n );\n });\n }, [commonCodeMap, configDependencyKey, id, isGridReady]);\n};\n"],"names":["currentUserAtom","atomWithStorage","STORAGE_KEYS","useGetCurrentUser","__name","useAtomValue","useSetCurrentUser","useSetAtom","currentUserIdAtom","useGetCurrentUserId","useSetCurrentUserId","currentLockLoadingAtom","useGetPageLockLoading","usePageLockLoading","useTreeGridCommonCodeEnum","id","field","codeId","isGridReady","commonCodeMap","useGetCommonCodeList","options","useEffect","setTreeGridColumnEnumOptionsById","useTreeGridCommonCodeEnums","configs","configsRef","useRef","configDependencyKey"],"mappings":";;;;;;;;;;;AASA,MAAMA,IAAkBC;AAAA,EACtBC,EAAa;AAAA,EACb;AACF,GAKaC,IAAoB,gBAAAC,EAAA,MACxBC,EAAaL,CAAe,GADJ,sBAOpBM,IAAoB,gBAAAF,EAAA,MACxBG,EAAWP,CAAe,GADF,sBCpB3BQ,IAAoBP,EAA6BC,EAAa,eAAe,EAAE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QACA,CAAC,yBAAyB,uBAAuB;AAAA,MAAA;AAAA,IAErD,CAAC;AAAA,EACH,GAAG,CAACF,GAAeS,GAAqBb,GAAIG,CAAW,CAAC;AAC1D,GAlC0C;"}
1
+ {"version":3,"file":"hooks.js","sources":["../src/hooks/useAccessTokenGuard.ts","../src/hooks/useCurrentUser.ts","../src/hooks/useCurrentUserId.ts","../src/hooks/usePageLockLoading.ts","../src/hooks/usePrevious.ts","../src/hooks/useTreeGridCommonCodeEnum.ts","../src/hooks/useTreeGridCommonCodeEnums.ts"],"sourcesContent":["import { STORAGE_ACCESS_TOKEN_KEY } from '@/constants/localStorageKeys';\nimport { useOwpAppContext } from '@/context/OwpAppProvider';\nimport { useEffect, useRef } from 'react';\nimport { useLocation, useNavigate } from 'react-router-dom';\n\nexport interface UseAccessTokenGuardOptions {\n loginPath?: string;\n isEnabled?: boolean;\n snackbarMessageKey?: string;\n}\n\nconst DEFAULT_LOGIN_PATH = '/auth/login';\nconst DEFAULT_SNACKBAR_MESSAGE_KEY = 'Message.로그인이 필요합니다.';\n\n/**\n * 액세스 토큰 기반 로그인 가드\n * @param loginPath 로그인 라우트 경로\n * @param isEnabled 가드 활성화 여부\n * @param snackbarMessageKey 로그인 필요 안내 메시지 키\n */\nexport const useAccessTokenGuard = ({\n loginPath = DEFAULT_LOGIN_PATH,\n isEnabled,\n snackbarMessageKey = DEFAULT_SNACKBAR_MESSAGE_KEY,\n}: UseAccessTokenGuardOptions = {}) => {\n const { env } = useOwpAppContext();\n const location = useLocation();\n const navigate = useNavigate();\n const accessToken =\n typeof window === 'undefined' ? null : window.localStorage.getItem(STORAGE_ACCESS_TOKEN_KEY);\n const isLoginRoute = location.pathname.startsWith(loginPath);\n const isAccessTokenGuardEnabled = isEnabled ?? env?.isAccessTokenGuardEnabled ?? true;\n const shouldRedirectToLogin = isAccessTokenGuardEnabled && !accessToken && !isLoginRoute;\n const hasHandledRedirectRef = useRef(false);\n\n useEffect(() => {\n if (!shouldRedirectToLogin) {\n hasHandledRedirectRef.current = false;\n return;\n }\n\n if (hasHandledRedirectRef.current) {\n return;\n }\n\n hasHandledRedirectRef.current = true;\n\n navigate(loginPath, {\n replace: true,\n state: snackbarMessageKey\n ? {\n snackbarMessageKey,\n }\n : undefined,\n });\n }, [loginPath, navigate, shouldRedirectToLogin, snackbarMessageKey]);\n\n return shouldRedirectToLogin;\n};\n","import { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nexport interface CurrentUser {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n}\n\nconst currentUserAtom = atomWithStorage<CurrentUser | undefined>(\n STORAGE_KEYS.currentUser,\n undefined,\n);\n\n/**\n * 현재 사용자 정보 조회\n */\nexport const useGetCurrentUser = () => {\n return useAtomValue(currentUserAtom);\n};\n\n/**\n * 현재 사용자 정보 설정\n */\nexport const useSetCurrentUser = () => {\n return useSetAtom(currentUserAtom);\n};\n","import { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nconst currentUserIdAtom = atomWithStorage<string | ''>(STORAGE_KEYS.currentUserId, '');\n\n/**\n * 현재 사용자 ID 조회 훅\n */\nexport const useGetCurrentUserId = () => {\n return useAtomValue(currentUserIdAtom);\n};\n\n/**\n * 현재 사용자 ID 설정 훅\n */\nexport const useSetCurrentUserId = () => {\n return useSetAtom(currentUserIdAtom);\n};\n","import type { OwpPageLockLoadingProps } from '@/components/OwpPageLockLoading';\nimport { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\nconst currentLockLoadingAtom = atomWithStorage<OwpPageLockLoadingProps | undefined>(\n STORAGE_KEYS.lockLoadingProps,\n { loading: false },\n);\n\n/**\n * 페이지 잠금 로딩 상태 조회\n */\nexport const useGetPageLockLoading = () => {\n return useAtomValue(currentLockLoadingAtom);\n};\n\n/**\n * 페이지 잠금 로딩 상태 설정\n */\nexport const usePageLockLoading = () => {\n return { setLoading: useSetAtom(currentLockLoadingAtom) };\n};\n","import { useEffect, useRef } from 'react';\n\n/**\n * The usePrevious function is a custom hook that returns the previous value of a variable.\n * It takes in a value as a parameter and returns the previous value.\n */\nexport function usePrevious<T>(value: T): T | undefined {\n const ref = useRef<T | undefined>();\n\n // Store current value in ref\n useEffect(() => {\n ref.current = value;\n }, [value]);\n\n // Return previous value (happens before update in useEffect above)\n return ref.current;\n}\n","import { useGetCommonCodeList } from '@/hooks/useCommonCodeList';\nimport { setTreeGridColumnEnumOptionsById } from '@/utils/treeGridUtil';\nimport { useEffect } from 'react';\n\n/**\n * TreeGrid 공통코드 Enum 옵션 반영\n * @param id TreeGrid 인스턴스 ID\n * @param field Enum을 반영할 컬럼명\n * @param codeId 공통코드 그룹 ID\n * @param isGridReady TreeGrid 준비 여부\n */\nexport const useTreeGridCommonCodeEnum = (\n id: string,\n field: string,\n codeId: string,\n isGridReady: boolean,\n) => {\n const commonCodeMap = useGetCommonCodeList();\n const options = commonCodeMap?.[codeId];\n\n useEffect(() => {\n if (!isGridReady || !options) {\n return;\n }\n\n setTreeGridColumnEnumOptionsById(\n id,\n field,\n options,\n 'IPX_COMMONCODE.CODEID',\n ['IPX_COMMONCODE.CODENM', 'IPX_COMMONCODE.CODEID'],\n );\n }, [codeId, field, id, isGridReady, options]);\n};\n","import { useGetCommonCodeList } from '@/hooks/useCommonCodeList';\nimport { setTreeGridColumnEnumOptionsById } from '@/utils/treeGridUtil';\nimport { useEffect, useRef } from 'react';\n\n/**\n * TreeGrid 공통코드 Enum 옵션 정보\n * @param field Enum을 반영할 컬럼명\n * @param codeId 공통코드 그룹 ID\n */\nexport interface TreeGridCommonCodeEnumConfig {\n field: string;\n codeId: string;\n}\n\n/**\n * TreeGrid 공통코드 Enum 옵션 일괄 반영\n * @param id TreeGrid 인스턴스 ID\n * @param configs Enum 반영 대상 목록\n * @param isGridReady TreeGrid 준비 여부\n */\nexport const useTreeGridCommonCodeEnums = (\n id: string,\n configs: TreeGridCommonCodeEnumConfig[],\n isGridReady: boolean,\n) => {\n const commonCodeMap = useGetCommonCodeList();\n const configsRef = useRef(configs);\n const configDependencyKey = configs.map(({ field, codeId }) => `${field}:${codeId}`).join('|');\n\n useEffect(() => {\n configsRef.current = configs;\n }, [configs]);\n\n useEffect(() => {\n if (!isGridReady || !commonCodeMap) {\n return;\n }\n\n configsRef.current.forEach(({ field, codeId }) => {\n const options = commonCodeMap[codeId];\n\n if (!options) {\n return;\n }\n\n setTreeGridColumnEnumOptionsById(\n id,\n field,\n options,\n 'IPX_COMMONCODE.CODEID',\n ['IPX_COMMONCODE.CODENM', 'IPX_COMMONCODE.CODEID'],\n );\n });\n }, [commonCodeMap, configDependencyKey, id, isGridReady]);\n};\n"],"names":["DEFAULT_LOGIN_PATH","DEFAULT_SNACKBAR_MESSAGE_KEY","useAccessTokenGuard","__name","loginPath","isEnabled","snackbarMessageKey","env","useOwpAppContext","location","useLocation","navigate","useNavigate","accessToken","STORAGE_ACCESS_TOKEN_KEY","isLoginRoute","shouldRedirectToLogin","hasHandledRedirectRef","useRef","useEffect","currentUserAtom","atomWithStorage","STORAGE_KEYS","useGetCurrentUser","useAtomValue","useSetCurrentUser","useSetAtom","currentUserIdAtom","useGetCurrentUserId","useSetCurrentUserId","currentLockLoadingAtom","useGetPageLockLoading","usePageLockLoading","usePrevious","value","ref","useTreeGridCommonCodeEnum","id","field","codeId","isGridReady","commonCodeMap","useGetCommonCodeList","options","setTreeGridColumnEnumOptionsById","useTreeGridCommonCodeEnums","configs","configsRef","configDependencyKey"],"mappings":";;;;;;;;;;;;;;;AAWA,MAAMA,IAAqB,eACrBC,IAA+B,uBAQxBC,IAAsB,gBAAAC,EAAA,CAAC;AAAA,EAClC,WAAAC,IAAYJ;AAAA,EACZ,WAAAK;AAAA,EACA,oBAAAC,IAAqBL;AACvB,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