@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.
- package/dist/_virtual/index16.js +4 -4
- package/dist/_virtual/index17.js +4 -4
- package/dist/_virtual/index18.js +4 -4
- package/dist/_virtual/index19.js +4 -4
- package/dist/_virtual/index20.js +2 -2
- package/dist/_virtual/index21.js +2 -2
- package/dist/_virtual/index22.js +2 -2
- package/dist/_virtual/index3.js +2 -2
- package/dist/_virtual/index4.js +2 -2
- package/dist/components/OwpAutoLogoutDialog/OwpAutoLogoutDialog.js +68 -62
- package/dist/components/OwpAutoLogoutDialog/OwpAutoLogoutDialog.js.map +1 -1
- package/dist/components/OwpDialog/OwpAlertDialog.js +19 -18
- package/dist/components/OwpDialog/OwpAlertDialog.js.map +1 -1
- package/dist/components/OwpDialog/OwpDialog.js +34 -31
- package/dist/components/OwpDialog/OwpDialog.js.map +1 -1
- package/dist/components/OwpDialog/internal/useDialogOpenFocusCleanup.js +18 -0
- package/dist/components/OwpDialog/internal/useDialogOpenFocusCleanup.js.map +1 -0
- package/dist/components/OwpErrorBoundary/OwpErrorBoundary.js +25 -15
- package/dist/components/OwpErrorBoundary/OwpErrorBoundary.js.map +1 -1
- package/dist/components/OwpLayout/OwpLayout.js.map +1 -1
- package/dist/components/OwpNumberField/OwpNumberField.js +45 -24
- package/dist/components/OwpNumberField/OwpNumberField.js.map +1 -1
- package/dist/components/OwpPicker/OwpDatePicker.js +103 -103
- package/dist/components/OwpPicker/OwpDatePicker.js.map +1 -1
- package/dist/components/OwpScrollbars/OwpScrollbars.js +79 -52
- package/dist/components/OwpScrollbars/OwpScrollbars.js.map +1 -1
- package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js +157 -157
- package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js.map +1 -1
- package/dist/components/OwpTable/OwpDataTable.js +377 -342
- package/dist/components/OwpTable/OwpDataTable.js.map +1 -1
- package/dist/components/OwpTable/OwpTable.js +20 -19
- package/dist/components/OwpTable/OwpTable.js.map +1 -1
- package/dist/components/OwpTable/internal/OwpTableBase.js +81 -78
- package/dist/components/OwpTable/internal/OwpTableBase.js.map +1 -1
- package/dist/components/OwpTable/internal/treeGridTableStyle.js +88 -31
- package/dist/components/OwpTable/internal/treeGridTableStyle.js.map +1 -1
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js +304 -262
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
- package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +229 -222
- package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -1
- package/dist/components/OwpTreeGrid/internal/treeGridTheme.js +282 -277
- package/dist/components/OwpTreeGrid/internal/treeGridTheme.js.map +1 -1
- package/dist/configs/layoutConfig.js +0 -6
- package/dist/configs/layoutConfig.js.map +1 -1
- package/dist/constants/treeGrid.js +59 -46
- package/dist/constants/treeGrid.js.map +1 -1
- package/dist/constants.js +18 -18
- package/dist/constants.js.map +1 -1
- package/dist/features/themePreview/dialogs/ThemePreviewDialog.js +15 -15
- package/dist/features/themePreview/dialogs/ThemePreviewDialog.js.map +1 -1
- package/dist/hooks/internal/useNavbar.js +4 -4
- package/dist/hooks/useConfirm.js +1 -1
- package/dist/hooks/useConfirm.js.map +1 -1
- package/dist/hooks/useOwpDialogs.js +19 -0
- package/dist/hooks/useOwpDialogs.js.map +1 -0
- package/dist/hooks.js +34 -32
- package/dist/hooks.js.map +1 -1
- package/dist/index.js +69 -71
- package/dist/index.js.map +1 -1
- package/dist/layout/Layout.js +23 -27
- package/dist/layout/Layout.js.map +1 -1
- package/dist/layout/components/layouts/FooterLayout.js.map +1 -1
- package/dist/layout/components/menus/PasswordChangeMenu.js +25 -25
- package/dist/layout/components/menus/PasswordChangeMenu.js.map +1 -1
- package/dist/layout/components/toggles/NavigationSearchToggle.js +4 -4
- package/dist/layout/components/toggles/NavigationSearchToggle.js.map +1 -1
- package/dist/layout/components/toggles/NavigationShortcutsToggle.js +1 -1
- package/dist/layout/components/toggles/NavigationShortcutsToggle.js.map +1 -1
- package/dist/layout/components/toggles/ThemePreviewToggle.js +14 -14
- package/dist/layout/components/toggles/ThemePreviewToggle.js.map +1 -1
- package/dist/node_modules/.pnpm/autosuggest-highlight@3.3.4/node_modules/autosuggest-highlight/match/index.js +1 -1
- package/dist/node_modules/.pnpm/autosuggest-highlight@3.3.4/node_modules/autosuggest-highlight/parse/index.js +1 -1
- package/dist/node_modules/.pnpm/inko@1.1.1/node_modules/inko/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/constants.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/index.js +1 -1
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +1 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +1 -1
- 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
- package/dist/owp-app.css +1 -1
- package/dist/types/components/OwpAutoLogoutDialog/OwpAutoLogoutDialog.d.ts +5 -3
- package/dist/types/components/OwpDialog/OwpAlertDialog.d.ts +1 -1
- package/dist/types/components/OwpDialog/internal/useDialogOpenFocusCleanup.d.ts +5 -0
- package/dist/types/components/OwpErrorBoundary/OwpErrorBoundary.d.ts +8 -14
- package/dist/types/components/OwpNumberField/OwpNumberField.d.ts +18 -4
- package/dist/types/components/OwpScrollbars/OwpScrollbars.d.ts +28 -14
- package/dist/types/components/OwpTable/internal/OwpTableBase.d.ts +3 -1
- package/dist/types/components/OwpTable/internal/treeGridTableStyle.d.ts +61 -2
- package/dist/types/components/OwpTreeGrid/internal/treeGridTheme.d.ts +2 -1
- package/dist/types/configs/layoutConfig.d.ts +0 -6
- package/dist/types/constants/index.d.ts +0 -1
- package/dist/types/constants/treeGrid.d.ts +9 -0
- package/dist/types/features/themePreview/dialogs/ThemePreviewDialog.d.ts +1 -1
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/useOwpDialogs.d.ts +5 -0
- package/dist/types/hooks/useOwpSettings.d.ts +0 -6
- package/dist/types/index.d.ts +0 -1
- package/dist/types/store/atoms/owpSettingsAtoms.d.ts +0 -6
- package/dist/types/types/OwpDialogTypes.d.ts +1 -0
- package/dist/types/types/OwpRouteTypes.d.ts +25 -0
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/utils/index.d.ts +0 -1
- package/dist/types/utils/internal/blurActiveElement.d.ts +4 -0
- package/dist/utils/internal/blurActiveElement.js +12 -0
- package/dist/utils/internal/blurActiveElement.js.map +1 -0
- package/dist/utils/{navigationUtils.js → internal/navigationUtils.js} +3 -3
- package/dist/utils/internal/navigationUtils.js.map +1 -0
- package/dist/utils.js +23 -25
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/OwpEventEmitter/OwpEventEmitter.js +0 -51
- package/dist/components/OwpEventEmitter/OwpEventEmitter.js.map +0 -1
- package/dist/layout/components/layouts/LeftSideLayout.js +0 -13
- package/dist/layout/components/layouts/LeftSideLayout.js.map +0 -1
- package/dist/node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/array/some.js +0 -66
- package/dist/node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/array/some.js.map +0 -1
- package/dist/node_modules/.pnpm/perfect-scrollbar@1.5.6/node_modules/perfect-scrollbar/css/perfect-scrollbar.css +0 -1
- package/dist/types/components/OwpEventEmitter/OwpEventEmitter.d.ts +0 -27
- package/dist/types/components/OwpEventEmitter/index.d.ts +0 -1
- package/dist/types/layout/components/layouts/LeftSideLayout.d.ts +0 -6
- package/dist/types/utils/common/OwpUtils.d.ts +0 -119
- package/dist/types/utils/common/index.d.ts +0 -1
- package/dist/utils/common/OwpUtils.js +0 -196
- package/dist/utils/common/OwpUtils.js.map +0 -1
- package/dist/utils/navigationUtils.js.map +0 -1
- /package/dist/types/utils/{navigationUtils.d.ts → internal/navigationUtils.d.ts} +0 -0
package/dist/_virtual/index16.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
2
|
-
import { __require as
|
|
3
|
-
var
|
|
4
|
-
const
|
|
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
|
-
|
|
6
|
+
s as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index16.js.map
|
package/dist/_virtual/index17.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
2
|
-
import { __require as
|
|
3
|
-
var o =
|
|
4
|
-
const
|
|
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
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index17.js.map
|
package/dist/_virtual/index18.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
2
|
-
import { __require as
|
|
3
|
-
var o =
|
|
4
|
-
const
|
|
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
|
-
|
|
6
|
+
s as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index18.js.map
|
package/dist/_virtual/index19.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
2
|
-
import { __require as
|
|
3
|
-
var
|
|
4
|
-
const
|
|
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
|
-
|
|
6
|
+
i as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index19.js.map
|
package/dist/_virtual/index20.js
CHANGED
package/dist/_virtual/index21.js
CHANGED
package/dist/_virtual/index22.js
CHANGED
package/dist/_virtual/index3.js
CHANGED
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,85 +1,91 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
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
|
|
5
|
-
import { useOwpTranslation as
|
|
6
|
-
import { useStorage as
|
|
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,
|
|
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
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
51
|
+
I(() => {
|
|
52
|
+
if (!u)
|
|
53
|
+
return;
|
|
54
|
+
e(c());
|
|
55
|
+
const d = setInterval(() => {
|
|
56
|
+
e(c());
|
|
57
|
+
}, 1e3);
|
|
40
58
|
return () => {
|
|
41
|
-
clearInterval(
|
|
59
|
+
clearInterval(d);
|
|
42
60
|
};
|
|
43
|
-
}, [
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
}, [h])
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
65
|
-
}, [
|
|
70
|
+
l.current = !1;
|
|
71
|
+
}, [n]), /* @__PURE__ */ v(
|
|
66
72
|
b,
|
|
67
73
|
{
|
|
68
|
-
title:
|
|
74
|
+
title: a("Title.로그인 연장"),
|
|
69
75
|
canConfirm: !1,
|
|
70
|
-
open:
|
|
71
|
-
onClose:
|
|
76
|
+
open: u,
|
|
77
|
+
onClose: _,
|
|
72
78
|
maxWidth: "xs",
|
|
73
79
|
fullWidth: !0,
|
|
74
|
-
children: /* @__PURE__ */ v(R, { variant: "h6", children:
|
|
80
|
+
children: /* @__PURE__ */ v(R, { variant: "h6", children: a("Message.자동 로그아웃 남은 시간 안내", {
|
|
75
81
|
defaultValue: "{{seconds}}초 후 로그인 페이지로 이동합니다.",
|
|
76
|
-
seconds:
|
|
82
|
+
seconds: G(S)
|
|
77
83
|
}) })
|
|
78
84
|
}
|
|
79
85
|
);
|
|
80
86
|
}
|
|
81
|
-
|
|
87
|
+
o(X, "OwpAutoLogoutDialog");
|
|
82
88
|
export {
|
|
83
|
-
|
|
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.
|
|
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,MAAMA,IAAuB,KACvBC,IAAqB,MAErBC,IAAkB,eAClBC,IAA6D;AAAA,EACjE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAQA,SAASC,EAAgBC,GAAuB;AAC9C,SAAKC,EAASD,CAAM,IAIb,KAAK,IAAI,GAAG,KAAK,KAAKA,IAAS,GAAI,CAAC,IAHlC;AAIX;AANSE,EAAAH,GAAA;AAWF,SAASI,EAAoB,EAAE,SAAAC,KAAqC;AACzE,QAAMC,IAAWC,EAAA,GACX,EAAE,UAAAC,EAAA,IAAaC,EAAA,GACf,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,EAAE,aAAAC,EAAA,IAAgBC,EAAA,GAClB,EAAE,cAAAC,EAAA,IAAiBC,EAAA,GACnB,CAACC,GAAMC,CAAa,IAAIC,E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AAC;AAE3B,QAAMiB,IAAcT,EAAY,MAAM;AACpC,IAAAP,EAAc,EAAK,GACnBG,EAAa,IAAI,GACjBO,EAAA;AAAA,EACF,GAAG,CAACA,CAAK,CAAC;AAEV,SAAAI,EAAU,MAAM;AACd,QAAIvB,MAAaV,GAAiB;AAChC,MAAAsB,EAAa,IAAI,GACjBH,EAAc,EAAK;AACnB;AAAA,IACF;AAEA,IAAAI,EAAiB,UAAU;AAAA,EAC7B,GAAG,CAACb,CAAQ,CAAC,GAGX,gBAAA0B;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAOzB,EAAE,cAAc;AAAA,MACvB,YAAY;AAAA,MACZ,MAAAM;AAAA,MACA,SAASiB;AAAA,MACT,UAAS;AAAA,MACT,WAAS;AAAA,MAET,UAAA,gBAAAC,EAACE,GAAA,EAAW,SAAQ,MACjB,YAAE,4BAA4B;AAAA,QAC7B,cAAc;AAAA,QACd,SAASpC,EAAgBmB,CAAS;AAAA,MAAA,CACnC,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN;AAxGgBhB,EAAAC,GAAA;"}
|
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
var f = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
import { jsxs as s, jsx as
|
|
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
|
|
6
|
-
|
|
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:
|
|
9
|
-
onClose:
|
|
9
|
+
open: o,
|
|
10
|
+
onClose: r
|
|
10
11
|
}) => {
|
|
11
|
-
const { title: n, description: l, okButtonProps: d, cancelButtonProps:
|
|
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
|
-
|
|
14
|
+
v,
|
|
14
15
|
{
|
|
15
16
|
fullWidth: !0,
|
|
16
17
|
maxWidth: "xs",
|
|
17
|
-
open:
|
|
18
|
-
onClose: /* @__PURE__ */
|
|
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__ */
|
|
24
|
-
l && /* @__PURE__ */
|
|
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
|
-
!
|
|
27
|
-
/* @__PURE__ */
|
|
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:
|
|
31
|
+
color: g ?? "primary",
|
|
31
32
|
variant: "contained",
|
|
32
33
|
...d,
|
|
33
|
-
onClick: /* @__PURE__ */
|
|
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
|
-
|
|
43
|
+
C.displayName = "OwpAlertDialog";
|
|
43
44
|
export {
|
|
44
|
-
|
|
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 {
|
|
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,EA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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
|
|
5
|
-
import { DialogContent as
|
|
6
|
-
import { forwardRef as
|
|
7
|
-
|
|
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:
|
|
11
|
-
loading:
|
|
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:
|
|
19
|
+
onCancel: p,
|
|
19
20
|
onClose: t,
|
|
21
|
+
open: w,
|
|
20
22
|
useSubmit: a,
|
|
21
23
|
actions: u,
|
|
22
|
-
contentProps:
|
|
23
|
-
role:
|
|
24
|
-
...
|
|
24
|
+
contentProps: T,
|
|
25
|
+
role: B,
|
|
26
|
+
...O
|
|
25
27
|
}, k) => {
|
|
26
|
-
const { t:
|
|
27
|
-
{ position: "relative", minHeight:
|
|
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
|
-
|
|
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" :
|
|
37
|
-
onClose: /* @__PURE__ */ n((
|
|
38
|
-
|
|
39
|
+
role: h ? "alertdialog" : B,
|
|
40
|
+
onClose: /* @__PURE__ */ n((N, m) => {
|
|
41
|
+
m !== "backdropClick" && (t == null || t(N, m));
|
|
39
42
|
}, "onClose"),
|
|
40
|
-
...
|
|
43
|
+
...O,
|
|
41
44
|
children: [
|
|
42
|
-
e && /* @__PURE__ */ r(
|
|
43
|
-
/* @__PURE__ */ l(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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(
|
|
60
|
+
children: /* @__PURE__ */ r(q, { color: "secondary" })
|
|
58
61
|
}
|
|
59
62
|
)
|
|
60
63
|
] }),
|
|
61
|
-
/* @__PURE__ */ l(
|
|
62
|
-
u && /* @__PURE__ */ r(
|
|
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
|
|
69
|
-
|
|
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
|
-
|
|
104
|
+
J.displayName = "OwpDialog";
|
|
102
105
|
export {
|
|
103
|
-
|
|
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":"
|
|
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;AAGxE,WACE,gBAAAG;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,KAAAX;AAAA,QACA,WAAS;AAAA,QACT,MAAMK;AAAA,QACN,WAAWV,IAAY,SAAS;AAAA,QAChC,MAAMT,IAAc,gBAAgBY;AAAA,QACpC,SAAS,gBAAAc,EAAA,CAACC,GAAOC,MAAW;AAC1B,UAAIA,MAAW,oBAIfrB,KAAA,QAAAA,EAAUoB,GAAOC;AAAA,QACnB,GANS;AAAA,QAOR,GAAGf;AAAA,QAEH,UAAA;AAAA,UAAAhB,KAAS,g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A,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;"}
|