@owp/core 2.5.33 → 2.5.35

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 (127) hide show
  1. package/dist/_virtual/index16.js +4 -4
  2. package/dist/_virtual/index17.js +4 -4
  3. package/dist/_virtual/index18.js +4 -4
  4. package/dist/_virtual/index19.js +4 -4
  5. package/dist/_virtual/index20.js +2 -2
  6. package/dist/_virtual/index21.js +2 -2
  7. package/dist/_virtual/index22.js +2 -2
  8. package/dist/_virtual/index3.js +2 -2
  9. package/dist/_virtual/index4.js +2 -2
  10. package/dist/components/OwpAutoLogoutDialog/OwpAutoLogoutDialog.js +68 -62
  11. package/dist/components/OwpAutoLogoutDialog/OwpAutoLogoutDialog.js.map +1 -1
  12. package/dist/components/OwpDialog/OwpAlertDialog.js +19 -18
  13. package/dist/components/OwpDialog/OwpAlertDialog.js.map +1 -1
  14. package/dist/components/OwpDialog/OwpDialog.js +34 -31
  15. package/dist/components/OwpDialog/OwpDialog.js.map +1 -1
  16. package/dist/components/OwpDialog/internal/useDialogOpenFocusCleanup.js +18 -0
  17. package/dist/components/OwpDialog/internal/useDialogOpenFocusCleanup.js.map +1 -0
  18. package/dist/components/OwpErrorBoundary/OwpErrorBoundary.js +25 -15
  19. package/dist/components/OwpErrorBoundary/OwpErrorBoundary.js.map +1 -1
  20. package/dist/components/OwpLayout/OwpLayout.js.map +1 -1
  21. package/dist/components/OwpNumberField/OwpNumberField.js +45 -24
  22. package/dist/components/OwpNumberField/OwpNumberField.js.map +1 -1
  23. package/dist/components/OwpPicker/OwpDatePicker.js +103 -103
  24. package/dist/components/OwpPicker/OwpDatePicker.js.map +1 -1
  25. package/dist/components/OwpScrollbars/OwpScrollbars.js +79 -52
  26. package/dist/components/OwpScrollbars/OwpScrollbars.js.map +1 -1
  27. package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js +157 -157
  28. package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js.map +1 -1
  29. package/dist/components/OwpTable/OwpDataTable.js +377 -342
  30. package/dist/components/OwpTable/OwpDataTable.js.map +1 -1
  31. package/dist/components/OwpTable/OwpTable.js +20 -19
  32. package/dist/components/OwpTable/OwpTable.js.map +1 -1
  33. package/dist/components/OwpTable/internal/OwpTableBase.js +81 -78
  34. package/dist/components/OwpTable/internal/OwpTableBase.js.map +1 -1
  35. package/dist/components/OwpTable/internal/treeGridTableStyle.js +88 -31
  36. package/dist/components/OwpTable/internal/treeGridTableStyle.js.map +1 -1
  37. package/dist/components/OwpTreeGrid/OwpTreeGrid.js +304 -262
  38. package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
  39. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +229 -222
  40. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -1
  41. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js +282 -277
  42. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js.map +1 -1
  43. package/dist/configs/layoutConfig.js +0 -6
  44. package/dist/configs/layoutConfig.js.map +1 -1
  45. package/dist/constants/treeGrid.js +59 -46
  46. package/dist/constants/treeGrid.js.map +1 -1
  47. package/dist/constants.js +18 -18
  48. package/dist/constants.js.map +1 -1
  49. package/dist/features/themePreview/dialogs/ThemePreviewDialog.js +15 -15
  50. package/dist/features/themePreview/dialogs/ThemePreviewDialog.js.map +1 -1
  51. package/dist/hooks/internal/useNavbar.js +4 -4
  52. package/dist/hooks/useConfirm.js +1 -1
  53. package/dist/hooks/useConfirm.js.map +1 -1
  54. package/dist/hooks/useOwpDialogs.js +19 -0
  55. package/dist/hooks/useOwpDialogs.js.map +1 -0
  56. package/dist/hooks.js +34 -32
  57. package/dist/hooks.js.map +1 -1
  58. package/dist/index.js +69 -71
  59. package/dist/index.js.map +1 -1
  60. package/dist/layout/Layout.js +23 -27
  61. package/dist/layout/Layout.js.map +1 -1
  62. package/dist/layout/components/layouts/FooterLayout.js.map +1 -1
  63. package/dist/layout/components/menus/PasswordChangeMenu.js +25 -25
  64. package/dist/layout/components/menus/PasswordChangeMenu.js.map +1 -1
  65. package/dist/layout/components/toggles/NavigationSearchToggle.js +4 -4
  66. package/dist/layout/components/toggles/NavigationSearchToggle.js.map +1 -1
  67. package/dist/layout/components/toggles/NavigationShortcutsToggle.js +1 -1
  68. package/dist/layout/components/toggles/NavigationShortcutsToggle.js.map +1 -1
  69. package/dist/layout/components/toggles/ThemePreviewToggle.js +14 -14
  70. package/dist/layout/components/toggles/ThemePreviewToggle.js.map +1 -1
  71. package/dist/node_modules/.pnpm/autosuggest-highlight@3.3.4/node_modules/autosuggest-highlight/match/index.js +1 -1
  72. package/dist/node_modules/.pnpm/autosuggest-highlight@3.3.4/node_modules/autosuggest-highlight/parse/index.js +1 -1
  73. package/dist/node_modules/.pnpm/inko@1.1.1/node_modules/inko/index.js +1 -1
  74. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
  75. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/constants.js +1 -1
  76. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/index.js +1 -1
  77. package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +1 -1
  78. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +1 -1
  79. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +1 -1
  80. package/dist/node_modules/.pnpm/react-overlays@5.2.1_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-overlays/esm/Portal.js +1 -1
  81. package/dist/owp-app.css +1 -1
  82. package/dist/types/components/OwpAutoLogoutDialog/OwpAutoLogoutDialog.d.ts +5 -3
  83. package/dist/types/components/OwpDialog/OwpAlertDialog.d.ts +1 -1
  84. package/dist/types/components/OwpDialog/internal/useDialogOpenFocusCleanup.d.ts +5 -0
  85. package/dist/types/components/OwpErrorBoundary/OwpErrorBoundary.d.ts +8 -14
  86. package/dist/types/components/OwpNumberField/OwpNumberField.d.ts +18 -4
  87. package/dist/types/components/OwpScrollbars/OwpScrollbars.d.ts +28 -14
  88. package/dist/types/components/OwpTable/internal/OwpTableBase.d.ts +3 -1
  89. package/dist/types/components/OwpTable/internal/treeGridTableStyle.d.ts +61 -2
  90. package/dist/types/components/OwpTreeGrid/internal/treeGridTheme.d.ts +2 -1
  91. package/dist/types/configs/layoutConfig.d.ts +0 -6
  92. package/dist/types/constants/index.d.ts +0 -1
  93. package/dist/types/constants/treeGrid.d.ts +9 -0
  94. package/dist/types/features/themePreview/dialogs/ThemePreviewDialog.d.ts +1 -1
  95. package/dist/types/hooks/index.d.ts +1 -0
  96. package/dist/types/hooks/useOwpDialogs.d.ts +5 -0
  97. package/dist/types/hooks/useOwpSettings.d.ts +0 -6
  98. package/dist/types/index.d.ts +0 -1
  99. package/dist/types/store/atoms/owpSettingsAtoms.d.ts +0 -6
  100. package/dist/types/types/OwpDialogTypes.d.ts +1 -0
  101. package/dist/types/types/OwpRouteTypes.d.ts +25 -0
  102. package/dist/types/types/index.d.ts +2 -0
  103. package/dist/types/utils/index.d.ts +0 -1
  104. package/dist/types/utils/internal/blurActiveElement.d.ts +4 -0
  105. package/dist/utils/internal/blurActiveElement.js +12 -0
  106. package/dist/utils/internal/blurActiveElement.js.map +1 -0
  107. package/dist/utils/{navigationUtils.js → internal/navigationUtils.js} +3 -3
  108. package/dist/utils/internal/navigationUtils.js.map +1 -0
  109. package/dist/utils.js +23 -25
  110. package/dist/utils.js.map +1 -1
  111. package/package.json +1 -1
  112. package/dist/components/OwpEventEmitter/OwpEventEmitter.js +0 -51
  113. package/dist/components/OwpEventEmitter/OwpEventEmitter.js.map +0 -1
  114. package/dist/layout/components/layouts/LeftSideLayout.js +0 -13
  115. package/dist/layout/components/layouts/LeftSideLayout.js.map +0 -1
  116. package/dist/node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/array/some.js +0 -66
  117. package/dist/node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/array/some.js.map +0 -1
  118. package/dist/node_modules/.pnpm/perfect-scrollbar@1.5.6/node_modules/perfect-scrollbar/css/perfect-scrollbar.css +0 -1
  119. package/dist/types/components/OwpEventEmitter/OwpEventEmitter.d.ts +0 -27
  120. package/dist/types/components/OwpEventEmitter/index.d.ts +0 -1
  121. package/dist/types/layout/components/layouts/LeftSideLayout.d.ts +0 -6
  122. package/dist/types/utils/common/OwpUtils.d.ts +0 -119
  123. package/dist/types/utils/common/index.d.ts +0 -1
  124. package/dist/utils/common/OwpUtils.js +0 -196
  125. package/dist/utils/common/OwpUtils.js.map +0 -1
  126. package/dist/utils/navigationUtils.js.map +0 -1
  127. /package/dist/types/utils/{navigationUtils.d.ts → internal/navigationUtils.d.ts} +0 -0
@@ -1,8 +1,8 @@
1
1
  import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as t } from "../node_modules/.pnpm/autosuggest-highlight@3.3.4/node_modules/autosuggest-highlight/match/index.js";
3
- var o = t();
4
- const m = /* @__PURE__ */ r(o);
2
+ import { __require as o } from "../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js";
3
+ var p = /* @__PURE__ */ o();
4
+ const s = /* @__PURE__ */ r(p);
5
5
  export {
6
- m as default
6
+ s as default
7
7
  };
8
8
  //# sourceMappingURL=index16.js.map
@@ -1,8 +1,8 @@
1
1
  import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as e } from "../node_modules/.pnpm/autosuggest-highlight@3.3.4/node_modules/autosuggest-highlight/parse/index.js";
3
- var o = e();
4
- const s = /* @__PURE__ */ r(o);
2
+ import { __require as t } from "../node_modules/.pnpm/autosuggest-highlight@3.3.4/node_modules/autosuggest-highlight/match/index.js";
3
+ var o = t();
4
+ const m = /* @__PURE__ */ r(o);
5
5
  export {
6
- s as default
6
+ m as default
7
7
  };
8
8
  //# sourceMappingURL=index17.js.map
@@ -1,8 +1,8 @@
1
1
  import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as t } from "../node_modules/.pnpm/react-autosuggest@10.1.0_react@19.2.4/node_modules/react-autosuggest/dist/index.js";
3
- var o = t();
4
- const i = /* @__PURE__ */ r(o);
2
+ import { __require as e } from "../node_modules/.pnpm/autosuggest-highlight@3.3.4/node_modules/autosuggest-highlight/parse/index.js";
3
+ var o = e();
4
+ const s = /* @__PURE__ */ r(o);
5
5
  export {
6
- i as default
6
+ s as default
7
7
  };
8
8
  //# sourceMappingURL=index18.js.map
@@ -1,8 +1,8 @@
1
1
  import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as o } from "../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js";
3
- var p = /* @__PURE__ */ o();
4
- const s = /* @__PURE__ */ r(p);
2
+ import { __require as t } from "../node_modules/.pnpm/react-autosuggest@10.1.0_react@19.2.4/node_modules/react-autosuggest/dist/index.js";
3
+ var o = t();
4
+ const i = /* @__PURE__ */ r(o);
5
5
  export {
6
- s as default
6
+ i as default
7
7
  };
8
8
  //# sourceMappingURL=index19.js.map
@@ -1,5 +1,5 @@
1
- var a = { exports: {} };
1
+ var p = { exports: {} };
2
2
  export {
3
- a as __module
3
+ p as __module
4
4
  };
5
5
  //# sourceMappingURL=index20.js.map
@@ -1,5 +1,5 @@
1
- var e = { exports: {} };
1
+ var a = { exports: {} };
2
2
  export {
3
- e as __module
3
+ a as __module
4
4
  };
5
5
  //# sourceMappingURL=index21.js.map
@@ -1,5 +1,5 @@
1
- var p = { exports: {} };
1
+ var e = { exports: {} };
2
2
  export {
3
- p as __module
3
+ e as __module
4
4
  };
5
5
  //# sourceMappingURL=index22.js.map
@@ -1,5 +1,5 @@
1
- var r = {};
1
+ var o = { exports: {} };
2
2
  export {
3
- r as __exports
3
+ o as __module
4
4
  };
5
5
  //# sourceMappingURL=index3.js.map
@@ -1,5 +1,5 @@
1
- var o = { exports: {} };
1
+ var r = {};
2
2
  export {
3
- o as __module
3
+ r as __exports
4
4
  };
5
5
  //# sourceMappingURL=index4.js.map
@@ -1,85 +1,91 @@
1
- var _ = Object.defineProperty;
2
- var i = (t, o) => _(t, "name", { value: o, configurable: !0 });
1
+ var w = Object.defineProperty;
2
+ var o = (t, i) => w(t, "name", { value: i, configurable: !0 });
3
3
  import { jsx as v } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
4
- import { useConfirm as L } from "../../hooks/useConfirm.js";
5
- import { useOwpTranslation as N } from "../../hooks/useOwpTranslation.js";
6
- import { useStorage as E } from "../../hooks/useStorage.js";
4
+ import { useConfirm as E } from "../../hooks/useConfirm.js";
5
+ import { useOwpTranslation as L } from "../../hooks/useOwpTranslation.js";
6
+ import { useStorage as N } from "../../hooks/useStorage.js";
7
7
  import { Typography as R } from "@mui/material";
8
- import { useState as M, useRef as x, useEffect as O, useCallback as S } from "react";
8
+ import { useState as M, useRef as x, useCallback as O, useEffect as I } from "react";
9
9
  import { useIdleTimer as y } from "../../node_modules/.pnpm/react-idle-timer@5.7.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-idle-timer/dist/index.legacy.esm.js";
10
- import { useNavigate as C, useLocation as D } from "react-router-dom";
11
- import { isNumber as a } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isNumber.js";
10
+ import { useNavigate as A, useLocation as C } from "react-router-dom";
12
11
  import { OwpDialog as b } from "../OwpDialog/OwpDialog.js";
13
- const T = 6e4, A = 36e5, I = "/auth/login";
14
- function P(t) {
15
- return a(t) ? Math.floor(t / 1e3) : "";
12
+ import { isNumber as D } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isNumber.js";
13
+ const P = 6e4, U = 36e5, s = "/auth/login", k = [
14
+ "mousemove",
15
+ "keydown",
16
+ "wheel",
17
+ "DOMMouseScroll",
18
+ "mousewheel",
19
+ "mousedown",
20
+ "touchstart",
21
+ "touchmove",
22
+ "MSPointerDown",
23
+ "MSPointerMove",
24
+ "visibilitychange"
25
+ ];
26
+ function G(t) {
27
+ return D(t) ? Math.max(0, Math.ceil(t / 1e3)) : "";
16
28
  }
17
- i(P, "millisToSeconds");
18
- function J({ timeout: t }) {
19
- const o = C(), { pathname: l } = D(), { t: n } = N(), { confirmInfo: m } = L(), { resetStorage: c } = E(), [r, s] = M(!1), [e, f] = M(null), p = x(!1), { getRemainingTime: g, reset: h } = y({
20
- timeout: t ?? A,
21
- events: [
22
- "mousemove",
23
- "keydown",
24
- "wheel",
25
- "DOMMouseScroll",
26
- "mousewheel",
27
- "mousedown",
28
- "touchstart",
29
- "touchmove",
30
- "MSPointerDown",
31
- "MSPointerMove",
32
- "visibilitychange"
33
- ],
34
- throttle: 500
29
+ o(G, "millisToSeconds");
30
+ function X({ timeout: t }) {
31
+ const i = A(), { pathname: n } = C(), { t: a } = L(), { confirmInfo: f } = E(), { resetStorage: p } = N(), [u, r] = M(!1), [S, e] = M(null), l = x(!1), T = O(async () => {
32
+ l.current || (l.current = !0, e(null), r(!1), await f({
33
+ title: a("Message.로그인 페이지로 이동합니다.")
34
+ }), p(), i(s, { replace: !0 }));
35
+ }, [f, i, p, a]), g = t ?? U, { getRemainingTime: c, reset: h } = y({
36
+ timeout: g,
37
+ promptBeforeIdle: Math.min(g, P),
38
+ events: k,
39
+ throttle: 500,
40
+ disabled: n === s,
41
+ onPrompt: /* @__PURE__ */ o((d, m) => {
42
+ n === s || l.current || (e((m == null ? void 0 : m.getRemainingTime()) ?? null), r(!0));
43
+ }, "onPrompt"),
44
+ onIdle: /* @__PURE__ */ o(() => {
45
+ n !== s && T();
46
+ }, "onIdle"),
47
+ onActive: /* @__PURE__ */ o(() => {
48
+ e(null), r(!1);
49
+ }, "onActive")
35
50
  });
36
- O(() => {
37
- const w = setInterval(() => {
38
- f(g());
39
- }, 500);
51
+ I(() => {
52
+ if (!u)
53
+ return;
54
+ e(c());
55
+ const d = setInterval(() => {
56
+ e(c());
57
+ }, 1e3);
40
58
  return () => {
41
- clearInterval(w);
59
+ clearInterval(d);
42
60
  };
43
- }, [g]);
44
- const u = S(() => {
45
- s(!1), h();
46
- }, [h]), d = S(async () => {
47
- p.current || (p.current = !0, f(null), s(!1), await m({
48
- title: n("Message.로그인 페이지로 이동합니다.")
49
- }), c(), o(I));
50
- }, [m, o, c, n]);
51
- return O(() => {
52
- if (l === I) {
53
- s(!1);
54
- return;
55
- }
56
- if (!r && a(e) && e > 0 && e <= T) {
57
- s(!0);
58
- return;
59
- }
60
- if (r && a(e) && e > T) {
61
- u();
61
+ }, [c, u]);
62
+ const _ = O(() => {
63
+ r(!1), e(null), h();
64
+ }, [h]);
65
+ return I(() => {
66
+ if (n === s) {
67
+ e(null), r(!1);
62
68
  return;
63
69
  }
64
- a(e) && e <= 0 && d();
65
- }, [r, e, l, u, d]), /* @__PURE__ */ v(
70
+ l.current = !1;
71
+ }, [n]), /* @__PURE__ */ v(
66
72
  b,
67
73
  {
68
- title: n("Title.로그인 연장"),
74
+ title: a("Title.로그인 연장"),
69
75
  canConfirm: !1,
70
- open: r,
71
- onClose: /* @__PURE__ */ i(() => u(), "onClose"),
76
+ open: u,
77
+ onClose: _,
72
78
  maxWidth: "xs",
73
79
  fullWidth: !0,
74
- children: /* @__PURE__ */ v(R, { variant: "h6", children: n("Message.자동 로그아웃 남은 시간 안내", {
80
+ children: /* @__PURE__ */ v(R, { variant: "h6", children: a("Message.자동 로그아웃 남은 시간 안내", {
75
81
  defaultValue: "{{seconds}}초 후 로그인 페이지로 이동합니다.",
76
- seconds: P(e)
82
+ seconds: G(S)
77
83
  }) })
78
84
  }
79
85
  );
80
86
  }
81
- i(J, "OwpAutoLogoutDialog");
87
+ o(X, "OwpAutoLogoutDialog");
82
88
  export {
83
- J as OwpAutoLogoutDialog
89
+ X as OwpAutoLogoutDialog
84
90
  };
85
91
  //# sourceMappingURL=OwpAutoLogoutDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OwpAutoLogoutDialog.js","sources":["../../../src/components/OwpAutoLogoutDialog/OwpAutoLogoutDialog.tsx"],"sourcesContent":["import { OwpDialog } from '@/components/OwpDialog';\nimport { useConfirm } from '@/hooks/useConfirm';\nimport { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport { useStorage } from '@/hooks/useStorage';\nimport { Typography } from '@mui/material';\nimport { isNumber } from 'es-toolkit/compat';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { useIdleTimer } from 'react-idle-timer/legacy';\nimport { useLocation, useNavigate } from 'react-router-dom';\n\nconst ONE_MINUTE_TO_MILLIS = 60000;\nconst ONE_HOUR_TO_MILLIS = 3600000;\n\nconst LOGIN_PATH_NAME = '/auth/login';\n\n/**\n * 밀리초 초 단위 변환\n * @param millis 밀리초\n */\nfunction millisToSeconds(millis: number | null) {\n if (!isNumber(millis)) {\n return '';\n }\n\n return Math.floor(millis / 1000);\n}\n/**\n * OwpAutoLogoutDialog 컴포넌트\n * @param timeout 자동 로그아웃 시간(ms)\n */\nexport function OwpAutoLogoutDialog({ timeout }: { timeout?: number }) {\n const navigate = useNavigate();\n const { pathname } = useLocation();\n const { t } = useOwpTranslation();\n const { confirmInfo } = useConfirm();\n const { resetStorage } = useStorage();\n const [open, setOpenStatus] = useState(false);\n const [remaining, setRemaining] = useState<number | null>(null);\n const isRedirectingRef = useRef(false);\n const { getRemainingTime, reset } = useIdleTimer({\n timeout: timeout ?? ONE_HOUR_TO_MILLIS,\n events: [\n 'mousemove',\n 'keydown',\n 'wheel',\n 'DOMMouseScroll',\n 'mousewheel',\n 'mousedown',\n 'touchstart',\n 'touchmove',\n 'MSPointerDown',\n 'MSPointerMove',\n 'visibilitychange',\n ],\n throttle: 500,\n });\n\n useEffect(() => {\n const interval = setInterval(() => {\n setRemaining(getRemainingTime());\n }, 500);\n\n return () => {\n clearInterval(interval);\n };\n }, [getRemainingTime]);\n\n const handleClose = useCallback(() => {\n setOpenStatus(false);\n reset();\n }, [reset]);\n\n \n const handleSessionExpired = useCallback(async () => {\n if (isRedirectingRef.current) {\n return;\n }\n\n isRedirectingRef.current = true;\n setRemaining(null);\n setOpenStatus(false);\n\n await confirmInfo({\n title: t('Message.로그인 페이지로 이동합니다.'),\n });\n\n resetStorage();\n navigate(LOGIN_PATH_NAME);\n }, [confirmInfo, navigate, resetStorage, t]);\n\n useEffect(() => {\n if (pathname === LOGIN_PATH_NAME) {\n setOpenStatus(false);\n return;\n }\n\n if (!open && isNumber(remaining) && remaining > 0 && remaining <= ONE_MINUTE_TO_MILLIS) {\n setOpenStatus(true);\n return;\n }\n\n if (open && isNumber(remaining) && remaining > ONE_MINUTE_TO_MILLIS) {\n handleClose();\n return;\n }\n\n if (isNumber(remaining) && remaining <= 0) {\n void handleSessionExpired();\n }\n }, [open, remaining, pathname, handleClose, handleSessionExpired]);\n\n return (\n <OwpDialog\n title={t('Title.로그인 연장')}\n canConfirm={false}\n open={open}\n onClose={() => handleClose()}\n maxWidth=\"xs\"\n fullWidth\n >\n <Typography variant=\"h6\">\n {t('Message.자동 로그아웃 남은 시간 안내', {\n defaultValue: '{{seconds}}초 후 로그인 페이지로 이동합니다.',\n seconds: millisToSeconds(remaining),\n })}\n </Typography>\n </OwpDialog>\n );\n}\n"],"names":["ONE_MINUTE_TO_MILLIS","ONE_HOUR_TO_MILLIS","LOGIN_PATH_NAME","millisToSeconds","millis","isNumber","__name","OwpAutoLogoutDialog","timeout","navigate","useNavigate","pathname","useLocation","t","useOwpTranslation","confirmInfo","useConfirm","resetStorage","useStorage","open","setOpenStatus","useState","remaining","setRemaining","isRedirectingRef","useRef","getRemainingTime","reset","useIdleTimer","useEffect","interval","handleClose","useCallback","handleSessionExpired","jsx","OwpDialog","Typography"],"mappings":";;;;;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EAAE,yBAAyB;AAAA,IAAA,CACnC,GAEDI,EAAA,GACAR,EAASP,CAAe;AAAA,EAC1B,GAAG,CAACa,GAAaN,GAAUQ,GAAcJ,CAAC,CAAC;AAE3C,SAAAgB,EAAU,MAAM;AACd,QAAIlB,MAAaT,GAAiB;AAChC,MAAAkB,EAAc,EAAK;AACnB;AAAA,IACF;AAEA,QAAI,CAACD,KAAQd,EAASiB,CAAS,KAAKA,IAAY,KAAKA,KAAatB,GAAsB;AACtF,MAAAoB,EAAc,EAAI;AAClB;AAAA,IACF;AAEA,QAAID,KAAQd,EAASiB,CAAS,KAAKA,IAAYtB,GAAsB;AACnE,MAAA+B,EAAA;AACA;AAAA,IACF;AAEA,IAAI1B,EAASiB,CAAS,KAAKA,KAAa,KACjCW,EAAA;AAAA,EAET,GAAG,CAACd,GAAMG,GAAWX,GAAUoB,GAAaE,CAAoB,CAAC,GAG/D,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAOtB,EAAE,cAAc;AAAA,MACvB,YAAY;AAAA,MACZ,MAAAM;AAAA,MACA,SAAS,gBAAAb,EAAA,MAAMyB,EAAA,GAAN;AAAA,MACT,UAAS;AAAA,MACT,WAAS;AAAA,MAET,UAAA,gBAAAG,EAACE,GAAA,EAAW,SAAQ,MACjB,YAAE,4BAA4B;AAAA,QAC7B,cAAc;AAAA,QACd,SAASjC,EAAgBmB,CAAS;AAAA,MAAA,CACnC,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN;AAlGgBhB,EAAAC,GAAA;"}
1
+ {"version":3,"file":"OwpAutoLogoutDialog.js","sources":["../../../src/components/OwpAutoLogoutDialog/OwpAutoLogoutDialog.tsx"],"sourcesContent":["import { OwpDialog } from '@/components/OwpDialog';\nimport { useConfirm } from '@/hooks/useConfirm';\nimport { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport { useStorage } from '@/hooks/useStorage';\nimport { Typography } from '@mui/material';\nimport { isNumber } from 'es-toolkit/compat';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { useIdleTimer, type IIdleTimerProps } from 'react-idle-timer/legacy';\nimport { useLocation, useNavigate } from 'react-router-dom';\n\nconst ONE_MINUTE_TO_MILLIS = 60000;\nconst ONE_HOUR_TO_MILLIS = 3600000;\n\nconst LOGIN_PATH_NAME = '/auth/login';\nconst AUTO_LOGOUT_EVENTS: NonNullable<IIdleTimerProps['events']> = [\n 'mousemove',\n 'keydown',\n 'wheel',\n 'DOMMouseScroll',\n 'mousewheel',\n 'mousedown',\n 'touchstart',\n 'touchmove',\n 'MSPointerDown',\n 'MSPointerMove',\n 'visibilitychange',\n];\n\ntype OwpAutoLogoutDialogProps = { timeout?: number };\n\n/**\n * 밀리초 초 단위 변환\n * @param millis 밀리초\n */\nfunction millisToSeconds(millis: number | null) {\n if (!isNumber(millis)) {\n return '';\n }\n\n return Math.max(0, Math.ceil(millis / 1000));\n}\n/**\n * OwpAutoLogoutDialog 컴포넌트\n * @param timeout 자동 로그아웃 시간(ms)\n */\nexport function OwpAutoLogoutDialog({ timeout }: OwpAutoLogoutDialogProps) {\n const navigate = useNavigate();\n const { pathname } = useLocation();\n const { t } = useOwpTranslation();\n const { confirmInfo } = useConfirm();\n const { resetStorage } = useStorage();\n const [open, setOpenStatus] = useState(false);\n const [remaining, setRemaining] = useState<number | null>(null);\n const isRedirectingRef = useRef(false);\n\n const handleSessionExpired = useCallback(async () => {\n if (isRedirectingRef.current) {\n return;\n }\n\n isRedirectingRef.current = true;\n setRemaining(null);\n setOpenStatus(false);\n\n await confirmInfo({\n title: t('Message.로그인 페이지로 이동합니다.'),\n });\n\n resetStorage();\n navigate(LOGIN_PATH_NAME, { replace: true });\n }, [confirmInfo, navigate, resetStorage, t]);\n\n const resolvedTimeout = timeout ?? ONE_HOUR_TO_MILLIS;\n const { getRemainingTime, reset } = useIdleTimer({\n timeout: resolvedTimeout,\n promptBeforeIdle: Math.min(resolvedTimeout, ONE_MINUTE_TO_MILLIS),\n events: AUTO_LOGOUT_EVENTS,\n throttle: 500,\n disabled: pathname === LOGIN_PATH_NAME,\n onPrompt: (_event, idleTimer) => {\n if (pathname === LOGIN_PATH_NAME || isRedirectingRef.current) {\n return;\n }\n\n setRemaining(idleTimer?.getRemainingTime() ?? null);\n setOpenStatus(true);\n },\n onIdle: () => {\n if (pathname === LOGIN_PATH_NAME) {\n return;\n }\n\n void handleSessionExpired();\n },\n onActive: () => {\n setRemaining(null);\n setOpenStatus(false);\n },\n });\n\n useEffect(() => {\n if (!open) {\n return;\n }\n\n setRemaining(getRemainingTime());\n\n const interval = setInterval(() => {\n setRemaining(getRemainingTime());\n }, 1000);\n\n return () => {\n clearInterval(interval);\n };\n }, [getRemainingTime, open]);\n\n const handleClose = useCallback(() => {\n setOpenStatus(false);\n setRemaining(null);\n reset();\n }, [reset]);\n\n useEffect(() => {\n if (pathname === LOGIN_PATH_NAME) {\n setRemaining(null);\n setOpenStatus(false);\n return;\n }\n\n isRedirectingRef.current = false;\n }, [pathname]);\n\n return (\n <OwpDialog\n title={t('Title.로그인 연장')}\n canConfirm={false}\n open={open}\n onClose={handleClose}\n maxWidth=\"xs\"\n fullWidth\n >\n <Typography variant=\"h6\">\n {t('Message.자동 로그아웃 남은 시간 안내', {\n defaultValue: '{{seconds}}초 후 로그인 페이지로 이동합니다.',\n seconds: millisToSeconds(remaining),\n })}\n </Typography>\n </OwpDialog>\n );\n}\n"],"names":["ONE_MINUTE_TO_MILLIS","ONE_HOUR_TO_MILLIS","LOGIN_PATH_NAME","AUTO_LOGOUT_EVENTS","millisToSeconds","millis","isNumber","__name","OwpAutoLogoutDialog","timeout","navigate","useNavigate","pathname","useLocation","t","useOwpTranslation","confirmInfo","useConfirm","resetStorage","useStorage","open","setOpenStatus","useState","remaining","setRemaining","isRedirectingRef","useRef","handleSessionExpired","useCallback","resolvedTimeout","getRemainingTime","reset","useIdleTimer","_event","idleTimer","useEffect","interval","handleClose","jsx","OwpDialog","Typography"],"mappings":";;;;;;;;;;;;AAUA,M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AAxGgBhB,EAAAC,GAAA;"}
@@ -1,36 +1,37 @@
1
1
  var f = Object.defineProperty;
2
- var i = (t, r) => f(t, "name", { value: r, configurable: !0 });
3
- import { jsxs as s, jsx as e } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
2
+ var e = (t, o) => f(t, "name", { value: o, configurable: !0 });
3
+ import { jsxs as s, jsx as i } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
4
4
  import { useOwpTranslation as D } from "../../hooks/useOwpTranslation.js";
5
- import { DialogActions as T, Button as a, Dialog as k, DialogTitle as v, DialogContentText as B, DialogContent as b } from "@mui/material";
6
- const p = /* @__PURE__ */ i(({
5
+ import { DialogActions as T, Button as a, Dialog as v, DialogTitle as k, DialogContentText as B, DialogContent as O } from "@mui/material";
6
+ import { useDialogOpenFocusCleanup as b } from "./internal/useDialogOpenFocusCleanup.js";
7
+ const C = /* @__PURE__ */ e(({
7
8
  payload: t,
8
- open: r,
9
- onClose: o
9
+ open: o,
10
+ onClose: r
10
11
  }) => {
11
- const { title: n, description: l, okButtonProps: d, cancelButtonProps: g, severity: u, useInfo: x } = t, { t: c } = D(), h = (t == null ? void 0 : t.okText) ?? c("Button.확인"), m = (t == null ? void 0 : t.cancelText) ?? c("Button.취소");
12
+ const { title: n, description: l, okButtonProps: d, cancelButtonProps: u, severity: g, useInfo: m } = t, { t: c } = D(), x = b(o), h = (t == null ? void 0 : t.okText) ?? c("Button.확인"), p = (t == null ? void 0 : t.cancelText) ?? c("Button.취소");
12
13
  return /* @__PURE__ */ s(
13
- k,
14
+ v,
14
15
  {
15
16
  fullWidth: !0,
16
17
  maxWidth: "xs",
17
- open: r,
18
- onClose: /* @__PURE__ */ i(() => o(!1), "onClose"),
18
+ open: x,
19
+ onClose: /* @__PURE__ */ e(() => r(!1), "onClose"),
19
20
  role: "alertdialog",
20
21
  "aria-labelledby": n ? "alert-dialog-title" : void 0,
21
22
  "aria-describedby": l ? "alert-dialog-description" : void 0,
22
23
  children: [
23
- n && /* @__PURE__ */ e(v, { id: "alert-dialog-title", children: n }),
24
- l && /* @__PURE__ */ e(b, { children: /* @__PURE__ */ e(B, { id: "alert-dialog-description", children: l }) }),
24
+ n && /* @__PURE__ */ i(k, { id: "alert-dialog-title", children: n }),
25
+ l && /* @__PURE__ */ i(O, { children: /* @__PURE__ */ i(B, { id: "alert-dialog-description", children: l }) }),
25
26
  /* @__PURE__ */ s(T, { children: [
26
- !x && /* @__PURE__ */ e(a, { ...g, variant: "outlined", onClick: /* @__PURE__ */ i(() => o(!1), "onClick"), children: m }),
27
- /* @__PURE__ */ e(
27
+ !m && /* @__PURE__ */ i(a, { ...u, variant: "outlined", onClick: /* @__PURE__ */ e(() => r(!1), "onClick"), children: p }),
28
+ /* @__PURE__ */ i(
28
29
  a,
29
30
  {
30
- color: u ?? "primary",
31
+ color: g ?? "primary",
31
32
  variant: "contained",
32
33
  ...d,
33
- onClick: /* @__PURE__ */ i(() => o(!0), "onClick"),
34
+ onClick: /* @__PURE__ */ e(() => r(!0), "onClick"),
34
35
  children: h
35
36
  }
36
37
  )
@@ -39,8 +40,8 @@ const p = /* @__PURE__ */ i(({
39
40
  }
40
41
  );
41
42
  }, "OwpAlertDialog");
42
- p.displayName = "OwpAlertDialog";
43
+ C.displayName = "OwpAlertDialog";
43
44
  export {
44
- p as OwpAlertDialog
45
+ C as OwpAlertDialog
45
46
  };
46
47
  //# sourceMappingURL=OwpAlertDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OwpAlertDialog.js","sources":["../../../src/components/OwpDialog/OwpAlertDialog.tsx"],"sourcesContent":["import { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n} from '@mui/material';\nimport type { ButtonProps } from '@mui/material';\nimport type { DialogProps } from '@toolpad/core/useDialogs';\nimport type { ReactNode } from 'react';\n\nexport type OwpAlertDialogSeverity =\n | 'primary'\n | 'secondary'\n | 'error'\n | 'info'\n | 'success'\n | 'warning';\n\nexport interface OwpAlertDialogPayload {\n title?: ReactNode | string;\n description?: ReactNode | string;\n okText?: string;\n cancelText?: string;\n severity?: OwpAlertDialogSeverity;\n useInfo?: boolean;\n okButtonProps?: ButtonProps;\n cancelButtonProps?: ButtonProps;\n}\n\n/**\n * 경고성 확인 대화상자 컴포넌트\n * @param payload 대화상자 표시 속성\n * @param open 열림 여부\n * @param onClose 닫힘 핸들러\n */\nconst OwpAlertDialog = ({\n payload,\n open,\n onClose,\n}: DialogProps<OwpAlertDialogPayload, boolean>) => {\n const { title, description, okButtonProps, cancelButtonProps, severity, useInfo } = payload;\n const { t } = useOwpTranslation();\n\n const okText = payload?.okText ?? t('Button.확인');\n const cancelText = payload?.cancelText ?? t('Button.취소');\n\n return (\n <Dialog\n fullWidth\n maxWidth=\"xs\"\n open={open}\n onClose={() => onClose(false)}\n role=\"alertdialog\"\n aria-labelledby={title ? 'alert-dialog-title' : undefined}\n aria-describedby={description ? 'alert-dialog-description' : undefined}\n >\n {title && <DialogTitle id=\"alert-dialog-title\">{title}</DialogTitle>}\n {description && (\n <DialogContent>\n <DialogContentText id=\"alert-dialog-description\">{description}</DialogContentText>\n </DialogContent>\n )}\n <DialogActions>\n {!useInfo && (\n <Button {...cancelButtonProps} variant=\"outlined\" onClick={() => onClose(false)}>\n {cancelText}\n </Button>\n )}\n <Button\n color={severity ?? 'primary'}\n variant=\"contained\"\n {...okButtonProps}\n onClick={() => onClose(true)}\n >\n {okText}\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n\nOwpAlertDialog.displayName = 'OwpAlertDialog';\n\nexport { OwpAlertDialog };\n"],"names":["OwpAlertDialog","__name","payload","open","onClose","title","description","okButtonProps","cancelButtonProps","severity","useInfo","t","useOwpTranslation","okText","cancelText","jsxs","Dialog","jsx","DialogTitle","DialogContent","DialogContentText","DialogActions","Button"],"mappings":";;;;;AAsCA,MAAMA,IAAiB,gBAAAC,EAAA,CAAC;AAAA,EACtB,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AACF,MAAmD;AACjD,QAAM,EAAE,OAAAC,GAAO,aAAAC,GAAa,eAAAC,GAAe,mBAAAC,GAAmB,UAAAC,GAAU,SAAAC,MAAYR,GAC9E,EAAE,GAAAS,EAAA,IAAMC,EAAA,GAERC,KAASX,KAAA,gBAAAA,EAAS,WAAUS,EAAE,WAAW,GACzCG,KAAaZ,KAAA,gBAAAA,EAAS,eAAcS,EAAE,WAAW;AAEvD,SACE,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAS;AAAA,MACT,UAAS;AAAA,MACT,MAAAb;AAAA,MACA,SAAS,gBAAAF,EAAA,MAAMG,EAAQ,EAAK,GAAnB;AAAA,MACT,MAAK;AAAA,MACL,mBAAiBC,IAAQ,uBAAuB;AAAA,MAChD,oBAAkBC,IAAc,6BAA6B;AAAA,MAE5D,UAAA;AAAA,QAAAD,KAAS,gBAAAY,EAACC,GAAA,EAAY,IAAG,sBAAsB,UAAAb,GAAM;AAAA,QACrDC,uBACEa,GAAA,EACC,UAAA,gBAAAF,EAACG,KAAkB,IAAG,4BAA4B,aAAY,EAAA,CAChE;AAAA,0BAEDC,GAAA,EACE,UAAA;AAAA,UAAA,CAACX,KACA,gBAAAO,EAACK,GAAA,EAAQ,GAAGd,GAAmB,SAAQ,YAAW,SAAS,gBAAAP,EAAA,MAAMG,EAAQ,EAAK,GAAnB,YACxD,UAAAU,EAAA,CACH;AAAA,UAEF,gBAAAG;AAAA,YAACK;AAAA,YAAA;AAAA,cACC,OAAOb,KAAY;AAAA,cACnB,SAAQ;AAAA,cACP,GAAGF;AAAA,cACJ,SAAS,gBAAAN,EAAA,MAAMG,EAAQ,EAAI,GAAlB;AAAA,cAER,UAAAS;AAAA,YAAA;AAAA,UAAA;AAAA,QACH,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GA5CuB;AA8CvBb,EAAe,cAAc;"}
1
+ {"version":3,"file":"OwpAlertDialog.js","sources":["../../../src/components/OwpDialog/OwpAlertDialog.tsx"],"sourcesContent":["import { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport type { DialogProps } from '@/types/OwpDialogTypes';\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n} from '@mui/material';\nimport type { ButtonProps } from '@mui/material';\nimport type { ReactNode } from 'react';\nimport { useDialogOpenFocusCleanup } from './internal/useDialogOpenFocusCleanup';\n\nexport type OwpAlertDialogSeverity =\n | 'primary'\n | 'secondary'\n | 'error'\n | 'info'\n | 'success'\n | 'warning';\n\nexport interface OwpAlertDialogPayload {\n title?: ReactNode | string;\n description?: ReactNode | string;\n okText?: string;\n cancelText?: string;\n severity?: OwpAlertDialogSeverity;\n useInfo?: boolean;\n okButtonProps?: ButtonProps;\n cancelButtonProps?: ButtonProps;\n}\n\n/**\n * 경고성 확인 대화상자 컴포넌트\n * @param payload 대화상자 표시 속성\n * @param open 열림 여부\n * @param onClose 닫힘 핸들러\n */\nconst OwpAlertDialog = ({\n payload,\n open,\n onClose,\n}: DialogProps<OwpAlertDialogPayload, boolean>) => {\n const { title, description, okButtonProps, cancelButtonProps, severity, useInfo } = payload;\n const { t } = useOwpTranslation();\n const resolvedOpen = useDialogOpenFocusCleanup(open);\n\n const okText = payload?.okText ?? t('Button.확인');\n const cancelText = payload?.cancelText ?? t('Button.취소');\n\n return (\n <Dialog\n fullWidth\n maxWidth=\"xs\"\n open={resolvedOpen}\n onClose={() => onClose(false)}\n role=\"alertdialog\"\n aria-labelledby={title ? 'alert-dialog-title' : undefined}\n aria-describedby={description ? 'alert-dialog-description' : undefined}\n >\n {title && <DialogTitle id=\"alert-dialog-title\">{title}</DialogTitle>}\n {description && (\n <DialogContent>\n <DialogContentText id=\"alert-dialog-description\">{description}</DialogContentText>\n </DialogContent>\n )}\n <DialogActions>\n {!useInfo && (\n <Button {...cancelButtonProps} variant=\"outlined\" onClick={() => onClose(false)}>\n {cancelText}\n </Button>\n )}\n <Button\n color={severity ?? 'primary'}\n variant=\"contained\"\n {...okButtonProps}\n onClick={() => onClose(true)}\n >\n {okText}\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n\nOwpAlertDialog.displayName = 'OwpAlertDialog';\n\nexport { OwpAlertDialog };\n"],"names":["OwpAlertDialog","__name","payload","open","onClose","title","description","okButtonProps","cancelButtonProps","severity","useInfo","t","useOwpTranslation","resolvedOpen","useDialogOpenFocusCleanup","okText","cancelText","jsxs","Dialog","jsx","DialogTitle","DialogContent","DialogContentText","DialogActions","Button"],"mappings":";;;;;;AAuCA,MAAMA,IAAiB,gBAAAC,EAAA,CAAC;AAAA,EACtB,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AACF,MAAmD;AACjD,QAAM,EAAE,OAAAC,GAAO,aAAAC,GAAa,eAAAC,GAAe,mBAAAC,GAAmB,UAAAC,GAAU,SAAAC,MAAYR,GAC9E,EAAE,GAAAS,EAAA,IAAMC,EAAA,GACRC,IAAeC,EAA0BX,CAAI,GAE7CY,KAASb,KAAA,gBAAAA,EAAS,WAAUS,EAAE,WAAW,GACzCK,KAAad,KAAA,gBAAAA,EAAS,eAAcS,EAAE,WAAW;AAEvD,SACE,gBAAAM;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAS;AAAA,MACT,UAAS;AAAA,MACT,MAAML;AAAA,MACN,SAAS,gBAAAZ,EAAA,MAAMG,EAAQ,EAAK,GAAnB;AAAA,MACT,MAAK;AAAA,MACL,mBAAiBC,IAAQ,uBAAuB;AAAA,MAChD,oBAAkBC,IAAc,6BAA6B;AAAA,MAE5D,UAAA;AAAA,QAAAD,KAAS,gBAAAc,EAACC,GAAA,EAAY,IAAG,sBAAsB,UAAAf,GAAM;AAAA,QACrDC,uBACEe,GAAA,EACC,UAAA,gBAAAF,EAACG,KAAkB,IAAG,4BAA4B,aAAY,EAAA,CAChE;AAAA,0BAEDC,GAAA,EACE,UAAA;AAAA,UAAA,CAACb,KACA,gBAAAS,EAACK,GAAA,EAAQ,GAAGhB,GAAmB,SAAQ,YAAW,SAAS,gBAAAP,EAAA,MAAMG,EAAQ,EAAK,GAAnB,YACxD,UAAAY,EAAA,CACH;AAAA,UAEF,gBAAAG;AAAA,YAACK;AAAA,YAAA;AAAA,cACC,OAAOf,KAAY;AAAA,cACnB,SAAQ;AAAA,cACP,GAAGF;AAAA,cACJ,SAAS,gBAAAN,EAAA,MAAMG,EAAQ,EAAI,GAAlB;AAAA,cAER,UAAAW;AAAA,YAAA;AAAA,UAAA;AAAA,QACH,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GA7CuB;AA+CvBf,EAAe,cAAc;"}
@@ -1,49 +1,52 @@
1
- var K = Object.defineProperty;
2
- var n = (e, c) => K(e, "name", { value: c, configurable: !0 });
1
+ var P = Object.defineProperty;
2
+ var n = (e, o) => P(e, "name", { value: o, configurable: !0 });
3
3
  import { jsxs as l, jsx as r } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
4
- import { useOwpTranslation as N } from "../../hooks/useOwpTranslation.js";
5
- import { DialogContent as P, DialogActions as z, Dialog as H, DialogTitle as R, CircularProgress as W, Box as m, Button as y } from "@mui/material";
6
- import { forwardRef as q } from "react";
7
- const E = q(
4
+ import { useOwpTranslation as z } from "../../hooks/useOwpTranslation.js";
5
+ import { DialogContent as F, DialogActions as H, Dialog as R, DialogTitle as W, CircularProgress as q, Box as x, Button as y } from "@mui/material";
6
+ import { forwardRef as E } from "react";
7
+ import { useDialogOpenFocusCleanup as G } from "./internal/useDialogOpenFocusCleanup.js";
8
+ const J = E(
8
9
  ({
9
10
  title: e,
10
- children: c,
11
- loading: o = !1,
11
+ children: o,
12
+ loading: c = !1,
12
13
  alertDialog: h = !1,
13
14
  canCancel: g = !0,
14
15
  canConfirm: s = !0,
15
16
  confirmText: D,
16
17
  cancelText: v,
17
18
  onConfirm: d,
18
- onCancel: f,
19
+ onCancel: p,
19
20
  onClose: t,
21
+ open: w,
20
22
  useSubmit: a,
21
23
  actions: u,
22
- contentProps: w,
23
- role: T,
24
- ...B
24
+ contentProps: T,
25
+ role: B,
26
+ ...O
25
27
  }, k) => {
26
- const { t: p } = N(), b = D ?? p("Button.저장"), j = v ?? p(s ? "Button.취소" : "Button.닫기"), { sx: i, ...A } = w ?? {}, O = [
27
- { position: "relative", minHeight: o ? 120 : void 0 },
28
+ const { t: f } = z(), b = D ?? f("Button.저장"), j = v ?? f(s ? "Button.취소" : "Button.닫기"), A = G(w), { sx: i, ...I } = T ?? {}, K = [
29
+ { position: "relative", minHeight: c ? 120 : void 0 },
28
30
  ...Array.isArray(i) ? i : i ? [i] : []
29
31
  ];
30
32
  return /* @__PURE__ */ l(
31
- H,
33
+ R,
32
34
  {
33
35
  ref: k,
34
36
  fullWidth: !0,
37
+ open: A,
35
38
  component: a ? "form" : void 0,
36
- role: h ? "alertdialog" : T,
37
- onClose: /* @__PURE__ */ n((I, x) => {
38
- x !== "backdropClick" && (t == null || t(I, x));
39
+ role: h ? "alertdialog" : B,
40
+ onClose: /* @__PURE__ */ n((N, m) => {
41
+ m !== "backdropClick" && (t == null || t(N, m));
39
42
  }, "onClose"),
40
- ...B,
43
+ ...O,
41
44
  children: [
42
- e && /* @__PURE__ */ r(R, { children: e }),
43
- /* @__PURE__ */ l(P, { dividers: !0, "aria-busy": o, ...A, sx: O, children: [
44
- c,
45
- o && /* @__PURE__ */ r(
46
- m,
45
+ e && /* @__PURE__ */ r(W, { children: e }),
46
+ /* @__PURE__ */ l(F, { dividers: !0, "aria-busy": c, ...I, sx: K, children: [
47
+ o,
48
+ c && /* @__PURE__ */ r(
49
+ x,
47
50
  {
48
51
  "aria-hidden": "true",
49
52
  sx: {
@@ -54,19 +57,19 @@ const E = q(
54
57
  alignItems: "center",
55
58
  justifyContent: "center"
56
59
  },
57
- children: /* @__PURE__ */ r(W, { color: "secondary" })
60
+ children: /* @__PURE__ */ r(q, { color: "secondary" })
58
61
  }
59
62
  )
60
63
  ] }),
61
- /* @__PURE__ */ l(z, { children: [
62
- u && /* @__PURE__ */ r(m, { className: "flex w-full items-start", children: u }),
64
+ /* @__PURE__ */ l(H, { children: [
65
+ u && /* @__PURE__ */ r(x, { className: "flex w-full items-start", children: u }),
63
66
  g && /* @__PURE__ */ r(
64
67
  y,
65
68
  {
66
69
  variant: "outlined",
67
70
  onClick: /* @__PURE__ */ n(() => {
68
- if (typeof f == "function") {
69
- f();
71
+ if (typeof p == "function") {
72
+ p();
70
73
  return;
71
74
  }
72
75
  t == null || t({}, "escapeKeyDown");
@@ -98,8 +101,8 @@ const E = q(
98
101
  );
99
102
  }
100
103
  );
101
- E.displayName = "OwpDialog";
104
+ J.displayName = "OwpDialog";
102
105
  export {
103
- E as OwpDialog
106
+ J as OwpDialog
104
107
  };
105
108
  //# sourceMappingURL=OwpDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OwpDialog.js","sources":["../../../src/components/OwpDialog/OwpDialog.tsx"],"sourcesContent":["import { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport {\n Box,\n Button,\n CircularProgress,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentProps,\n DialogProps,\n DialogTitle,\n} from '@mui/material';\nimport { forwardRef, ReactNode } from 'react';\n\nexport interface OwpDialogProps extends Omit<DialogProps, 'title'> {\n title?: ReactNode;\n children?: ReactNode;\n loading?: boolean;\n alertDialog?: boolean;\n canConfirm?: boolean;\n canCancel?: boolean;\n confirmText?: string;\n cancelText?: string;\n useSubmit?: boolean;\n actions?: ReactNode;\n contentProps?: DialogContentProps;\n onConfirm?: () => void;\n onCancel?: () => void;\n}\n\n/**\n * OwpDialog 컴포넌트\n * @param title 제목\n * @param children 하위 콘텐츠\n * @param loading 본문 로딩 여부\n * @param alertDialog alertdialog role 적용 여부\n * @param canCancel canCancel 값\n * @param canConfirm canConfirm 값\n * @param onConfirm onConfirm 핸들러\n * @param onCancel onCancel 핸들러\n */\nconst OwpDialog = forwardRef<HTMLDivElement, OwpDialogProps>(\n (\n {\n title,\n children,\n loading = false,\n alertDialog = false,\n canCancel = true,\n canConfirm = true,\n confirmText: confirmTextProp,\n cancelText: cancelTextProp,\n onConfirm,\n onCancel,\n onClose,\n useSubmit,\n actions,\n contentProps,\n role: roleProp,\n ...dialogProps\n },\n ref,\n ) => {\n const { t } = useOwpTranslation();\n const confirmText = confirmTextProp ?? t('Button.저장');\n const cancelText = cancelTextProp ?? t(canConfirm ? 'Button.취소' : 'Button.닫기');\n const { sx: contentSx, ...restContentProps } = contentProps ?? {};\n const resolvedContentSx = [\n { position: 'relative', minHeight: loading ? 120 : undefined },\n ...(Array.isArray(contentSx) ? contentSx : contentSx ? [contentSx] : []),\n ];\n\n return (\n <Dialog\n ref={ref}\n fullWidth\n component={useSubmit ? 'form' : undefined}\n role={alertDialog ? 'alertdialog' : roleProp}\n onClose={(event, reason) => {\n if (reason === 'backdropClick') {\n return;\n }\n\n onClose?.(event, reason);\n }}\n {...dialogProps}\n >\n {title && <DialogTitle>{title}</DialogTitle>}\n <DialogContent dividers aria-busy={loading} {...restContentProps} sx={resolvedContentSx}>\n {children}\n {loading && (\n <Box\n aria-hidden=\"true\"\n sx={{\n position: 'absolute',\n inset: 0,\n zIndex: 1,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n >\n <CircularProgress color=\"secondary\" />\n </Box>\n )}\n </DialogContent>\n <DialogActions>\n {actions && <Box className=\"flex w-full items-start\">{actions}</Box>}\n {canCancel && (\n <Button\n variant=\"outlined\"\n onClick={() => {\n if (typeof onCancel === 'function') {\n onCancel();\n return;\n }\n\n onClose?.({}, 'escapeKeyDown');\n }}\n >\n {cancelText}\n </Button>\n )}\n {canConfirm && (\n <Button\n variant=\"contained\"\n color=\"secondary\"\n type={useSubmit ? 'submit' : 'button'}\n onClick={() => {\n if (useSubmit) {\n return;\n }\n\n if (typeof onConfirm === 'function') {\n onConfirm();\n return;\n }\n\n onClose?.({}, 'escapeKeyDown');\n }}\n >\n {confirmText}\n </Button>\n )}\n </DialogActions>\n </Dialog>\n );\n },\n);\n\nOwpDialog.displayName = 'OwpDialog';\nexport { OwpDialog };\n"],"names":["OwpDialog","forwardRef","title","children","loading","alertDialog","canCancel","canConfirm","confirmTextProp","cancelTextProp","onConfirm","onCancel","onClose","useSubmit","actions","contentProps","roleProp","dialogProps","ref","t","useOwpTranslation","confirmText","cancelText","contentSx","restContentProps","resolvedContentSx","jsxs","Dialog","__name","event","reason","jsx","DialogTitle","DialogContent","Box","CircularProgress","DialogActions","Button"],"mappings":";;;;;;AAyCA,MAAMA,IAAYC;AAAA,EAChB,CACE;AAAA,IACE,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,aAAAC,IAAc;AAAA,IACd,WAAAC,IAAY;AAAA,IACZ,YAAAC,IAAa;AAAA,IACb,aAAaC;AAAA,IACb,YAAYC;AAAA,IACZ,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,cAAAC;AAAA,IACA,MAAMC;AAAA,IACN,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAcb,KAAmBW,EAAE,WAAW,GAC9CG,IAAab,KAAkBU,EAAEZ,IAAa,cAAc,WAAW,GACvE,EAAE,IAAIgB,GAAW,GAAGC,EAAA,IAAqBT,KAAgB,CAAA,GACzDU,IAAoB;AAAA,MACxB,EAAE,UAAU,YAAY,WAAWrB,IAAU,MAAM,OAAA;AAAA,MACnD,GAAI,MAAM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AA,gBASR,UAAAU;AAAA,cAAA;AAAA,YAAA;AAAA,YAGJf,KACC,gBAAAwB;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,SAAQ;AAAA,gBACR,OAAM;AAAA,gBACN,MAAMxB,IAAY,WAAW;AAAA,gBAC7B,SAAS,gBAAAe,EAAA,MAAM;AACb,sBAAI,CAAAf,GAIJ;AAAA,wBAAI,OAAOH,KAAc,YAAY;AACnC,sBAAAA,EAAA;AACA;AAAA,oBACF;AAEA,oBAAAE,KAAA,QAAAA,EAAU,CAAA,GAAI;AAAA;AAAA,gBAChB,GAXS;AAAA,gBAaR,UAAAS;AAAA,cAAA;AAAA,YAAA;AAAA,UACH,EAAA,CAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEArB,EAAU,cAAc;"}
1
+ {"version":3,"file":"OwpDialog.js","sources":["../../../src/components/OwpDialog/OwpDialog.tsx"],"sourcesContent":["import { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport {\n Box,\n Button,\n CircularProgress,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentProps,\n DialogProps,\n DialogTitle,\n} from '@mui/material';\nimport { forwardRef, ReactNode } from 'react';\nimport { useDialogOpenFocusCleanup } from './internal/useDialogOpenFocusCleanup';\n\nexport interface OwpDialogProps extends Omit<DialogProps, 'title'> {\n title?: ReactNode;\n children?: ReactNode;\n loading?: boolean;\n alertDialog?: boolean;\n canConfirm?: boolean;\n canCancel?: boolean;\n confirmText?: string;\n cancelText?: string;\n useSubmit?: boolean;\n actions?: ReactNode;\n contentProps?: DialogContentProps;\n onConfirm?: () => void;\n onCancel?: () => void;\n}\n\n/**\n * OwpDialog 컴포넌트\n * @param title 제목\n * @param children 하위 콘텐츠\n * @param loading 본문 로딩 여부\n * @param alertDialog alertdialog role 적용 여부\n * @param canCancel canCancel 값\n * @param canConfirm canConfirm 값\n * @param onConfirm onConfirm 핸들러\n * @param onCancel onCancel 핸들러\n */\nconst OwpDialog = forwardRef<HTMLDivElement, OwpDialogProps>(\n (\n {\n title,\n children,\n loading = false,\n alertDialog = false,\n canCancel = true,\n canConfirm = true,\n confirmText: confirmTextProp,\n cancelText: cancelTextProp,\n onConfirm,\n onCancel,\n onClose,\n open,\n useSubmit,\n actions,\n contentProps,\n role: roleProp,\n ...dialogProps\n },\n ref,\n ) => {\n const { t } = useOwpTranslation();\n const confirmText = confirmTextProp ?? t('Button.저장');\n const cancelText = cancelTextProp ?? t(canConfirm ? 'Button.취소' : 'Button.닫기');\n const resolvedOpen = useDialogOpenFocusCleanup(open);\n const { sx: contentSx, ...restContentProps } = contentProps ?? {};\n const resolvedContentSx = [\n { position: 'relative', minHeight: loading ? 120 : undefined },\n ...(Array.isArray(contentSx) ? contentSx : contentSx ? [contentSx] : []),\n ];\n\n return (\n <Dialog\n ref={ref}\n fullWidth\n open={resolvedOpen}\n component={useSubmit ? 'form' : undefined}\n role={alertDialog ? 'alertdialog' : roleProp}\n onClose={(event, reason) => {\n if (reason === 'backdropClick') {\n return;\n }\n\n onClose?.(event, reason);\n }}\n {...dialogProps}\n >\n {title && <DialogTitle>{title}</DialogTitle>}\n <DialogContent dividers aria-busy={loading} {...restContentProps} sx={resolvedContentSx}>\n {children}\n {loading && (\n <Box\n aria-hidden=\"true\"\n sx={{\n position: 'absolute',\n inset: 0,\n zIndex: 1,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n >\n <CircularProgress color=\"secondary\" />\n </Box>\n )}\n </DialogContent>\n <DialogActions>\n {actions && <Box className=\"flex w-full items-start\">{actions}</Box>}\n {canCancel && (\n <Button\n variant=\"outlined\"\n onClick={() => {\n if (typeof onCancel === 'function') {\n onCancel();\n return;\n }\n\n onClose?.({}, 'escapeKeyDown');\n }}\n >\n {cancelText}\n </Button>\n )}\n {canConfirm && (\n <Button\n variant=\"contained\"\n color=\"secondary\"\n type={useSubmit ? 'submit' : 'button'}\n onClick={() => {\n if (useSubmit) {\n return;\n }\n\n if (typeof onConfirm === 'function') {\n onConfirm();\n return;\n }\n\n onClose?.({}, 'escapeKeyDown');\n }}\n >\n {confirmText}\n </Button>\n )}\n </DialogActions>\n </Dialog>\n );\n },\n);\n\nOwpDialog.displayName = 'OwpDialog';\nexport { OwpDialog };\n"],"names":["OwpDialog","forwardRef","title","children","loading","alertDialog","canCancel","canConfirm","confirmTextProp","cancelTextProp","onConfirm","onCancel","onClose","open","useSubmit","actions","contentProps","roleProp","dialogProps","ref","t","useOwpTranslation","confirmText","cancelText","resolvedOpen","useDialogOpenFocusCleanup","contentSx","restContentProps","resolvedContentSx","jsxs","Dialog","__name","event","reason","jsx","DialogTitle","DialogContent","Box","CircularProgress","DialogActions","Button"],"mappings":";;;;;;;AA0CA,MAAMA,IAAYC;AAAA,EAChB,CACE;AAAA,IACE,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,aAAAC,IAAc;AAAA,IACd,WAAAC,IAAY;AAAA,IACZ,YAAAC,IAAa;AAAA,IACb,aAAaC;AAAA,IACb,YAAYC;AAAA,IACZ,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,MAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,cAAAC;AAAA,IACA,MAAMC;AAAA,IACN,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAcd,KAAmBY,EAAE,WAAW,GAC9CG,IAAad,KAAkBW,EAAEb,IAAa,cAAc,WAAW,GACvEiB,IAAeC,EAA0BZ,CAAI,GAC7C,EAAE,IAAIa,GAAW,GAAGC,EAAA,IAAqBX,KAAgB,CAAA,GACzDY,IAAoB;AAAA,MACxB,EAAE,UAAU,YAAY,WAAWxB,IAAU,MAAM,OAAA;AAAA,MACnD,GAAI,MAAM,QAAQsB,CAAS,IAAIA,IAAYA,IAAY,CAACA,CAAS,IAAI,CAAA;AAAA,IAAC;AA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B,KACC,gBAAA2B;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,SAAQ;AAAA,gBACR,OAAM;AAAA,gBACN,MAAM1B,IAAY,WAAW;AAAA,gBAC7B,SAAS,gBAAAiB,EAAA,MAAM;AACb,sBAAI,CAAAjB,GAIJ;AAAA,wBAAI,OAAOJ,KAAc,YAAY;AACnC,sBAAAA,EAAA;AACA;AAAA,oBACF;AAEA,oBAAAE,KAAA,QAAAA,EAAU,CAAA,GAAI;AAAA;AAAA,gBAChB,GAXS;AAAA,gBAaR,UAAAU;AAAA,cAAA;AAAA,YAAA;AAAA,UACH,EAAA,CAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAtB,EAAU,cAAc;"}
@@ -0,0 +1,18 @@
1
+ var n = Object.defineProperty;
2
+ var o = (t, e) => n(t, "name", { value: e, configurable: !0 });
3
+ import { blurActiveElement as r } from "../../../utils/internal/blurActiveElement.js";
4
+ import { useState as f, useLayoutEffect as c, useEffect as a } from "react";
5
+ const l = typeof window < "u" ? c : a, m = /* @__PURE__ */ o((t) => {
6
+ const e = t === !0, [u, s] = f(!1);
7
+ return l(() => {
8
+ if (!e) {
9
+ s(!1);
10
+ return;
11
+ }
12
+ r(), s(!0);
13
+ }, [e]), e && u;
14
+ }, "useDialogOpenFocusCleanup");
15
+ export {
16
+ m as useDialogOpenFocusCleanup
17
+ };
18
+ //# sourceMappingURL=useDialogOpenFocusCleanup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDialogOpenFocusCleanup.js","sources":["../../../../src/components/OwpDialog/internal/useDialogOpenFocusCleanup.ts"],"sourcesContent":["import { blurActiveElement } from '@/utils/internal/blurActiveElement';\nimport { useEffect, useLayoutEffect, useState } from 'react';\n\nconst useEnhancedEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\n/**\n * Dialog open 전 focus 정리 상태\n * @param open 요청 open 여부\n */\nexport const useDialogOpenFocusCleanup = (open?: boolean) => {\n const shouldOpen = open === true;\n const [isFocusCleared, setIsFocusCleared] = useState(false);\n\n useEnhancedEffect(() => {\n if (!shouldOpen) {\n setIsFocusCleared(false);\n return;\n }\n\n blurActiveElement();\n setIsFocusCleared(true);\n }, [shouldOpen]);\n\n return shouldOpen && isFocusCleared;\n};\n"],"names":["useEnhancedEffect","useLayoutEffect","useEffect","useDialogOpenFocusCleanup","__name","open","shouldOpen","isFocusCleared","setIsFocusCleared","useState","blurActiveElement"],"mappings":";;;;AAGA,MAAMA,IAAoB,OAAO,SAAW,MAAcC,IAAkBC,GAM/DC,IAA4B,gBAAAC,EAAA,CAACC,MAAmB;AAC3D,QAAMC,IAAaD,MAAS,IACtB,CAACE,GAAgBC,CAAiB,IAAIC,EAAS,EAAK;AAE1D,SAAAT,EAAkB,MAAM;AACtB,QAAI,CAACM,GAAY;AACf,MAAAE,EAAkB,EAAK;AACvB;AAAA,IACF;AAEA,IAAAE,EAAA,GACAF,EAAkB,EAAI;AAAA,EACxB,GAAG,CAACF,CAAU,CAAC,GAERA,KAAcC;AACvB,GAfyC;"}