@owp/core 2.2.6 → 2.3.1
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/index5.js +5 -2
- package/dist/_virtual/index5.js.map +1 -1
- package/dist/_virtual/index6.js +2 -5
- package/dist/_virtual/index6.js.map +1 -1
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/OwpDialog/OwpDialog.js +30 -32
- package/dist/components/OwpDialog/OwpDialog.js.map +1 -1
- package/dist/components/OwpLayout/OwpLayout.js +29 -30
- package/dist/components/OwpLayout/OwpLayout.js.map +1 -1
- package/dist/components/OwpMrtTable/OwpMrtTable.js +393 -255
- package/dist/components/OwpMrtTable/OwpMrtTable.js.map +1 -1
- package/dist/components/OwpScrollbars/OwpScrollbars.js +16 -17
- package/dist/components/OwpScrollbars/OwpScrollbars.js.map +1 -1
- package/dist/components/OwpStyleProvider/OwpStyleProvider.js +28 -29
- package/dist/components/OwpStyleProvider/OwpStyleProvider.js.map +1 -1
- package/dist/components/OwpTable/OwpDataTable.js +45 -45
- package/dist/components/OwpTable/OwpDataTable.js.map +1 -1
- package/dist/components/OwpTable/OwpTable.js +6 -6
- package/dist/components/OwpTable/OwpTable.js.map +1 -1
- package/dist/components/OwpTable/OwpVerticalTable.js +55 -53
- package/dist/components/OwpTable/OwpVerticalTable.js.map +1 -1
- package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +80 -74
- package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -1
- package/dist/constants/storageKeys.js +1 -0
- package/dist/constants/storageKeys.js.map +1 -1
- package/dist/contexts/OwpCoreProvider.js +22 -36
- package/dist/contexts/OwpCoreProvider.js.map +1 -1
- package/dist/contexts/OwpStoreProvider.js +9 -9
- package/dist/contexts/OwpStoreProvider.js.map +1 -1
- package/dist/hooks/useCurrentUserSeq.js +11 -0
- package/dist/hooks/useCurrentUserSeq.js.map +1 -0
- package/dist/hooks/useNavbar.js +24 -0
- package/dist/hooks/useNavbar.js.map +1 -0
- package/dist/hooks/useOwpSettings.js +21 -0
- package/dist/hooks/useOwpSettings.js.map +1 -0
- package/dist/hooks.js +78 -62
- package/dist/hooks.js.map +1 -1
- package/dist/index.js +58 -59
- package/dist/layout/Layout.js +28 -29
- package/dist/layout/Layout.js.map +1 -1
- package/dist/layout/components/layouts/FooterLayout.js +15 -16
- package/dist/layout/components/layouts/FooterLayout.js.map +1 -1
- package/dist/layout/components/layouts/NavbarToggleFabLayout.js +21 -18
- package/dist/layout/components/layouts/NavbarToggleFabLayout.js.map +1 -1
- package/dist/layout/components/layouts/NavbarWrapperLayout.js +20 -21
- package/dist/layout/components/layouts/NavbarWrapperLayout.js.map +1 -1
- package/dist/layout/components/navbar/NavbarPinToggleButton.js +10 -11
- package/dist/layout/components/navbar/NavbarPinToggleButton.js.map +1 -1
- package/dist/layout/components/navbar/NavbarToggleButton.js +31 -32
- package/dist/layout/components/navbar/NavbarToggleButton.js.map +1 -1
- package/dist/layout/components/navbar/style/NavbarStyle.js +36 -37
- package/dist/layout/components/navbar/style/NavbarStyle.js.map +1 -1
- package/dist/layout/components/navbar/style/NavbarStyleContent.js +29 -30
- package/dist/layout/components/navbar/style/NavbarStyleContent.js.map +1 -1
- package/dist/layout/components/navigation/Navigation.js +18 -22
- package/dist/layout/components/navigation/Navigation.js.map +1 -1
- package/dist/layout/components/toggles/NavigationSearchToggle.js +55 -60
- package/dist/layout/components/toggles/NavigationSearchToggle.js.map +1 -1
- package/dist/layout/components/toggles/NavigationShortcutsToggle.js +44 -49
- package/dist/layout/components/toggles/NavigationShortcutsToggle.js.map +1 -1
- package/dist/layout/components/toolbar/ToolbarLayout.js +26 -27
- package/dist/layout/components/toolbar/ToolbarLayout.js.map +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/EAN_UPC/constants.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/react-imask@7.6.1_react@19.2.4/node_modules/react-imask/esm/mixin.js +1 -1
- package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.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/store/atoms/navbarAtoms.js +84 -0
- package/dist/store/atoms/navbarAtoms.js.map +1 -0
- package/dist/store/atoms/owpSettingsAtoms.js +140 -0
- package/dist/store/atoms/owpSettingsAtoms.js.map +1 -0
- package/dist/store/atoms/owpStore.js +29 -0
- package/dist/store/atoms/owpStore.js.map +1 -0
- package/dist/store.js +44 -39
- package/dist/store.js.map +1 -1
- package/dist/types/components/OwpDialog/OwpDialog.d.ts +1 -9
- package/dist/types/components/OwpMrtTable/OwpMrtTable.d.ts +9 -0
- package/dist/types/components/OwpPicker/internal/DatePickerInput.d.ts +1 -1
- package/dist/types/components/OwpTable/OwpTable.d.ts +1 -1
- package/dist/types/components/OwpTable/OwpVerticalTable.d.ts +3 -1
- package/dist/types/components/OwpTabs/OwpTab.d.ts +1 -1
- package/dist/types/components/OwpTabs/OwpTabs.d.ts +1 -1
- package/dist/types/constants/storageKeys.d.ts +1 -0
- package/dist/types/contexts/OwpCoreProvider.d.ts +2 -2
- package/dist/types/contexts/OwpStoreProvider.d.ts +4 -4
- package/dist/types/hooks/index.d.ts +3 -1
- package/dist/types/hooks/useCurrentUserSeq.d.ts +8 -0
- package/dist/types/hooks/useNavbar.d.ts +19 -0
- package/dist/types/hooks/useOwpSettings.d.ts +79 -0
- package/dist/types/layout/components/navigation/Navigation.d.ts +6 -2
- package/dist/types/layout/components/toggles/NavigationSearchToggle.d.ts +5 -2
- package/dist/types/layout/components/toggles/NavigationShortcutsToggle.d.ts +5 -2
- package/dist/types/store/atoms/index.d.ts +3 -0
- package/dist/types/store/atoms/internal/types.d.ts +29 -0
- package/dist/types/store/atoms/navbarAtoms.d.ts +48 -0
- package/dist/types/store/atoms/owpSettingsAtoms.d.ts +89 -0
- package/dist/types/store/atoms/owpStore.d.ts +13 -0
- package/dist/types/store/index.d.ts +1 -3
- package/dist/types/utils/treeGridExportExcelUtil.d.ts +0 -4
- package/dist/types/utils/treeGridUtil.d.ts +0 -59
- package/dist/utils/treeGridExportExcelUtil.js +57 -58
- package/dist/utils/treeGridExportExcelUtil.js.map +1 -1
- package/dist/utils/treeGridUtil.js +69 -83
- package/dist/utils/treeGridUtil.js.map +1 -1
- package/dist/utils.js +71 -86
- package/package.json +2 -6
- package/dist/hooks/useAppStore.js +0 -8
- package/dist/hooks/useAppStore.js.map +0 -1
- package/dist/store/generateReducersFromSlices.js +0 -18
- package/dist/store/generateReducersFromSlices.js.map +0 -1
- package/dist/store/lazyLoadedSlices.js +0 -16
- package/dist/store/lazyLoadedSlices.js.map +0 -1
- package/dist/store/middleware.js +0 -9
- package/dist/store/middleware.js.map +0 -1
- package/dist/store/navbarSlice.js +0 -71
- package/dist/store/navbarSlice.js.map +0 -1
- package/dist/store/navigationSlice.js +0 -46
- package/dist/store/navigationSlice.js.map +0 -1
- package/dist/store/owpSettingsSlice.js +0 -195
- package/dist/store/owpSettingsSlice.js.map +0 -1
- package/dist/store/store.js +0 -17
- package/dist/store/store.js.map +0 -1
- package/dist/store/withSlices.js +0 -27
- package/dist/store/withSlices.js.map +0 -1
- package/dist/types/hooks/useAppStore.d.ts +0 -7
- package/dist/types/store/generateReducersFromSlices.d.ts +0 -6
- package/dist/types/store/lazyLoadedSlices.d.ts +0 -9
- package/dist/types/store/middleware.d.ts +0 -17
- package/dist/types/store/navbarSlice.d.ts +0 -22
- package/dist/types/store/navigationSlice.d.ts +0 -93
- package/dist/types/store/owpSettingsSlice.d.ts +0 -112
- package/dist/types/store/store.d.ts +0 -13
- package/dist/types/store/withSlices.d.ts +0 -11
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,5 +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
5
|
export {
|
|
3
|
-
|
|
6
|
+
s as default
|
|
4
7
|
};
|
|
5
8
|
//# sourceMappingURL=index5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index5.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index5.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/dist/_virtual/index6.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
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);
|
|
1
|
+
var p = { exports: {} };
|
|
5
2
|
export {
|
|
6
|
-
|
|
3
|
+
p as __module
|
|
7
4
|
};
|
|
8
5
|
//# sourceMappingURL=index6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index6.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index6.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/_virtual/index7.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
var v = Object.defineProperty;
|
|
2
2
|
var c = (i, e) => v(i, "name", { value: e, 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
|
|
5
|
-
import { DialogContent as
|
|
6
|
-
import { forwardRef as
|
|
7
|
-
const
|
|
4
|
+
import { useOwpTranslation as s } from "../../hooks/useOwpTranslation.js";
|
|
5
|
+
import { DialogContent as O, DialogActions as j, Dialog as K, DialogTitle as N, Box as b, Button as m } from "@mui/material";
|
|
6
|
+
import { forwardRef as A } from "react";
|
|
7
|
+
const R = A(
|
|
8
8
|
({
|
|
9
9
|
title: i,
|
|
10
10
|
children: e,
|
|
11
|
-
canCancel:
|
|
11
|
+
canCancel: x = !0,
|
|
12
12
|
canConfirm: a = !0,
|
|
13
|
-
confirmText:
|
|
14
|
-
cancelText:
|
|
15
|
-
onConfirm:
|
|
16
|
-
onCancel:
|
|
13
|
+
confirmText: D,
|
|
14
|
+
cancelText: h,
|
|
15
|
+
onConfirm: f,
|
|
16
|
+
onCancel: o,
|
|
17
17
|
onClose: t,
|
|
18
18
|
useSubmit: n,
|
|
19
|
-
actions:
|
|
20
|
-
contentProps:
|
|
19
|
+
actions: u,
|
|
20
|
+
contentProps: w,
|
|
21
21
|
...y
|
|
22
|
-
},
|
|
23
|
-
const { t:
|
|
22
|
+
}, g) => {
|
|
23
|
+
const { t: d } = s(), T = D ?? d("Button.저장"), B = h ?? d(a ? "Button.취소" : "Button.닫기");
|
|
24
24
|
return /* @__PURE__ */ l(
|
|
25
|
-
|
|
25
|
+
K,
|
|
26
26
|
{
|
|
27
|
-
ref:
|
|
27
|
+
ref: g,
|
|
28
28
|
fullWidth: !0,
|
|
29
29
|
component: n ? "form" : void 0,
|
|
30
|
-
onClose: /* @__PURE__ */ c((
|
|
31
|
-
|
|
30
|
+
onClose: /* @__PURE__ */ c((k, p) => {
|
|
31
|
+
p !== "backdropClick" && (t == null || t(k, p));
|
|
32
32
|
}, "onClose"),
|
|
33
33
|
...y,
|
|
34
34
|
children: [
|
|
35
|
-
i && /* @__PURE__ */ r(
|
|
36
|
-
/* @__PURE__ */ r(
|
|
37
|
-
/* @__PURE__ */ l(
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
i && /* @__PURE__ */ r(N, { children: i }),
|
|
36
|
+
/* @__PURE__ */ r(O, { dividers: !0, ...w, children: e }),
|
|
37
|
+
/* @__PURE__ */ l(j, { children: [
|
|
38
|
+
u && /* @__PURE__ */ r(b, { className: "flex w-full items-start", children: u }),
|
|
39
|
+
x && /* @__PURE__ */ r(
|
|
40
40
|
m,
|
|
41
41
|
{
|
|
42
42
|
variant: "outlined",
|
|
43
43
|
onClick: /* @__PURE__ */ c(() => {
|
|
44
|
-
if (typeof
|
|
45
|
-
|
|
44
|
+
if (typeof o == "function") {
|
|
45
|
+
o();
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
t == null || t({}, "escapeKeyDown");
|
|
49
49
|
}, "onClick"),
|
|
50
|
-
children:
|
|
50
|
+
children: B
|
|
51
51
|
}
|
|
52
52
|
),
|
|
53
53
|
a && /* @__PURE__ */ r(
|
|
@@ -58,14 +58,14 @@ const x = R(
|
|
|
58
58
|
type: n ? "submit" : "button",
|
|
59
59
|
onClick: /* @__PURE__ */ c(() => {
|
|
60
60
|
if (!n) {
|
|
61
|
-
if (typeof
|
|
62
|
-
|
|
61
|
+
if (typeof f == "function") {
|
|
62
|
+
f();
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
t == null || t({}, "escapeKeyDown");
|
|
66
66
|
}
|
|
67
67
|
}, "onClick"),
|
|
68
|
-
children:
|
|
68
|
+
children: T
|
|
69
69
|
}
|
|
70
70
|
)
|
|
71
71
|
] })
|
|
@@ -74,10 +74,8 @@ const x = R(
|
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
76
|
);
|
|
77
|
-
|
|
78
|
-
const G = x;
|
|
77
|
+
R.displayName = "OwpDialog";
|
|
79
78
|
export {
|
|
80
|
-
|
|
81
|
-
x as OwpDialog
|
|
79
|
+
R as OwpDialog
|
|
82
80
|
};
|
|
83
81
|
//# 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 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 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 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 canCancel = true,\n canConfirm = true,\n confirmText: confirmTextProp,\n cancelText: cancelTextProp,\n onConfirm,\n onCancel,\n onClose,\n useSubmit,\n actions,\n contentProps,\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\n return (\n <Dialog\n ref={ref}\n fullWidth\n component={useSubmit ? 'form' : undefined}\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 {...contentProps}>\n {children}\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';\
|
|
1
|
+
{"version":3,"file":"OwpDialog.js","sources":["../../../src/components/OwpDialog/OwpDialog.tsx"],"sourcesContent":["import { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport {\n Box,\n Button,\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 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 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 canCancel = true,\n canConfirm = true,\n confirmText: confirmTextProp,\n cancelText: cancelTextProp,\n onConfirm,\n onCancel,\n onClose,\n useSubmit,\n actions,\n contentProps,\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\n return (\n <Dialog\n ref={ref}\n fullWidth\n component={useSubmit ? 'form' : undefined}\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 {...contentProps}>\n {children}\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","canCancel","canConfirm","confirmTextProp","cancelTextProp","onConfirm","onCancel","onClose","useSubmit","actions","contentProps","dialogProps","ref","t","useOwpTranslation","confirmText","cancelText","jsxs","Dialog","__name","event","reason","jsx","DialogTitle","DialogContent","DialogActions","Box","Button"],"mappings":";;;;;;AAoCA,MAAMA,IAAYC;AAAA,EAChB,CACE;AAAA,IACE,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,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,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAM,EAAE,GAAAC,EAAA,IAA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AaR,UAAAQ;AAAA,cAAA;AAAA,YAAA;AAAA,UACH,EAAA,CAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAlB,EAAU,cAAc;"}
|
|
@@ -1,48 +1,47 @@
|
|
|
1
|
-
var
|
|
2
|
-
var g = (s, o) =>
|
|
3
|
-
import { jsx as
|
|
1
|
+
var w = Object.defineProperty;
|
|
2
|
+
var g = (s, o) => w(s, "name", { value: o, configurable: !0 });
|
|
3
|
+
import { jsx as L } 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 { themeLayouts as R } from "../../layout/themeLayouts.js";
|
|
5
5
|
import { useOwpAppContext as z } from "../../contexts/OwpAppProvider.js";
|
|
6
|
-
import { generateSettings as
|
|
7
|
-
import { useOwpTranslation as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { useRef as D, useMemo as f, useEffect as h } from "react";
|
|
6
|
+
import { generateSettings as O } from "../../configs/defaultConfig.js";
|
|
7
|
+
import { useOwpTranslation as C } from "../../hooks/useOwpTranslation.js";
|
|
8
|
+
import { useSetSettings as P, useGetCurrentSettings as x, useGetDefaultSettings as j } from "../../hooks/useOwpSettings.js";
|
|
9
|
+
import { useRef as B, useMemo as f, useEffect as S } from "react";
|
|
11
10
|
import { useLocation as E, matchRoutes as F } from "react-router-dom";
|
|
12
|
-
import { isEqual as
|
|
13
|
-
import { merge as
|
|
14
|
-
import { OwpLoading as
|
|
15
|
-
function
|
|
11
|
+
import { isEqual as G } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/predicate/isEqual.js";
|
|
12
|
+
import { merge as M } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/object/merge.js";
|
|
13
|
+
import { OwpLoading as T } from "../OwpLoading/OwpLoading.js";
|
|
14
|
+
function Y(s) {
|
|
16
15
|
var y;
|
|
17
|
-
const { routesConfig: o } = z(), { i18n: r } =
|
|
18
|
-
() =>
|
|
19
|
-
[
|
|
20
|
-
), c = f(() =>
|
|
21
|
-
() => t === c ||
|
|
16
|
+
const { routesConfig: o } = z(), { i18n: r } = C(), { layouts: m = R, children: u } = s, a = P(), t = x(), n = j(), l = (y = t == null ? void 0 : t.layout) == null ? void 0 : y.style, e = E(), { pathname: d } = e, h = B(!1), p = f(
|
|
17
|
+
() => b(o, d, "settings", !0),
|
|
18
|
+
[d, o]
|
|
19
|
+
), c = f(() => p === void 0 ? n : O(n, p), [n, p]), i = f(
|
|
20
|
+
() => t === c || G(c, t),
|
|
22
21
|
[c, t]
|
|
23
22
|
);
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
}, [c,
|
|
23
|
+
return S(() => {
|
|
24
|
+
i || a(c);
|
|
25
|
+
}, [c, i, a]), S(() => {
|
|
27
26
|
window.scrollTo(0, 0);
|
|
28
|
-
}, [
|
|
29
|
-
|
|
30
|
-
}, [r.isInitialized,
|
|
27
|
+
}, [d]), S(() => {
|
|
28
|
+
i && r.isInitialized && (h.current = !0);
|
|
29
|
+
}, [r.isInitialized, i]), f(() => !r.isInitialized || !i && !h.current ? /* @__PURE__ */ L(T, {}) : Object.entries(m).map(([I, v]) => I === l ? /* @__PURE__ */ L(v, { children: u }, I) : null), [u, r.isInitialized, i, l, m]);
|
|
31
30
|
}
|
|
32
|
-
g(
|
|
33
|
-
function
|
|
31
|
+
g(Y, "OwpLayout");
|
|
32
|
+
function b(s, o, r, m = !0) {
|
|
34
33
|
const u = F(s, o);
|
|
35
34
|
if (!u)
|
|
36
35
|
return;
|
|
37
36
|
let a = !1;
|
|
38
|
-
const t = u.reduce((
|
|
39
|
-
const e =
|
|
40
|
-
return e === void 0 ?
|
|
37
|
+
const t = u.reduce((n, l) => {
|
|
38
|
+
const e = l.route[r];
|
|
39
|
+
return e === void 0 ? n : (a = !0, !m || e === null ? e : M(n ?? {}, e));
|
|
41
40
|
}, void 0);
|
|
42
41
|
return a ? t : void 0;
|
|
43
42
|
}
|
|
44
|
-
g(
|
|
43
|
+
g(b, "getRouteParamUtil");
|
|
45
44
|
export {
|
|
46
|
-
|
|
45
|
+
Y as OwpLayout
|
|
47
46
|
};
|
|
48
47
|
//# sourceMappingURL=OwpLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwpLayout.js","sources":["../../../src/components/OwpLayout/OwpLayout.tsx"],"sourcesContent":["import { themeLayouts, themeLayoutsType } from '@/layout/themeLayouts';\nimport { useOwpAppContext } from '@/contexts/OwpAppProvider';\nimport { generateSettings } from '@/configs/defaultConfig';\nimport { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport {
|
|
1
|
+
{"version":3,"file":"OwpLayout.js","sources":["../../../src/components/OwpLayout/OwpLayout.tsx"],"sourcesContent":["import { themeLayouts, themeLayoutsType } from '@/layout/themeLayouts';\nimport { useOwpAppContext } from '@/contexts/OwpAppProvider';\nimport { generateSettings } from '@/configs/defaultConfig';\nimport { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport {\n useGetCurrentSettings,\n useGetDefaultSettings,\n useSetSettings,\n} from '@/hooks/useOwpSettings';\nimport type { OwpSettingsConfigType } from '@/types/OwpSettingsTypes';\nimport { OwpRoutesType } from '@/utils/common/OwpUtils';\nimport { isEqual, merge } from 'es-toolkit/compat';\nimport { type ReactNode, useEffect, useMemo, useRef } from 'react';\nimport { matchRoutes, RouteMatch, RouteObject, useLocation } from 'react-router-dom';\nimport { OwpLoading } from '../OwpLoading';\n\nexport type OwpRouteObjectType = RouteObject & {\n settings?: OwpSettingsConfigType;\n auth?: string[] | [] | null | undefined;\n};\n\nexport type OwpRouteMatchType = RouteMatch & {\n route: OwpRouteObjectType;\n};\n\ntype OwpLayoutProps = {\n layouts?: themeLayoutsType;\n children?: ReactNode;\n};\n\n/**\n * OwpLayout\n * React frontend component in a React project that is used for layouting the user interface. The component\n * handles generating user interface settings related to current routes, merged with default settings, and uses\n * the new settings to generate layouts.\n */\nfunction OwpLayout(props: OwpLayoutProps) {\n const { routesConfig } = useOwpAppContext();\n const { i18n } = useOwpTranslation();\n\n const { layouts = themeLayouts, children } = props;\n const setSettings = useSetSettings();\n const settings = useGetCurrentSettings();\n const defaultSettings = useGetDefaultSettings();\n\n const layoutStyle = settings?.layout?.style;\n const location = useLocation();\n const { pathname } = location;\n const hasCompletedInitialLayoutSyncRef = useRef(false);\n\n const matchedSettings = useMemo(\n () => getRouteParamUtil(routesConfig, pathname, 'settings', true),\n [pathname, routesConfig],\n );\n const currentSettings = useMemo(() => {\n if (matchedSettings === undefined) {\n return defaultSettings;\n }\n\n return generateSettings(defaultSettings, matchedSettings);\n }, [defaultSettings, matchedSettings]);\n const isSettingsSynchronized = useMemo(\n () => settings === currentSettings || isEqual(currentSettings, settings),\n [currentSettings, settings],\n );\n\n useEffect(() => {\n if (isSettingsSynchronized) {\n return;\n }\n\n setSettings(currentSettings);\n }, [currentSettings, isSettingsSynchronized, setSettings]);\n\n useEffect(() => {\n window.scrollTo(0, 0);\n }, [pathname]);\n\n useEffect(() => {\n if (isSettingsSynchronized && i18n.isInitialized) {\n hasCompletedInitialLayoutSyncRef.current = true;\n }\n }, [i18n.isInitialized, isSettingsSynchronized]);\n\n return useMemo(() => {\n const shouldBlockForInitialLoading =\n !i18n.isInitialized ||\n (!isSettingsSynchronized && !hasCompletedInitialLayoutSyncRef.current);\n\n if (shouldBlockForInitialLoading) {\n return <OwpLoading />;\n }\n\n return Object.entries(layouts).map(([key, Layout]) => {\n if (key === layoutStyle) {\n return <Layout key={key}>{children}</Layout>;\n }\n\n return null;\n });\n }, [children, i18n.isInitialized, isSettingsSynchronized, layoutStyle, layouts]);\n}\n\nexport { OwpLayout };\n\n/**\n * Utility function to retrieve and merge or replace a specific route parameter from matched routes.\n *\n * @param pathname The current pathname\n * @param key The key of the parameter to merge or replace (e.g., 'settings', 'auth')\n * @param useMerge Whether to merge the parameter (using es-toolkit merge) or replace it\n * @returns The merged or replaced parameter data of type T\n */\nfunction getRouteParamUtil<T>(\n routes: OwpRoutesType,\n pathname: string,\n key: keyof OwpRouteObjectType,\n useMerge: boolean = true,\n): T | undefined {\n const matchedRoutes = matchRoutes(routes, pathname) as OwpRouteMatchType[] | null;\n\n if (!matchedRoutes) {\n return undefined;\n }\n\n let hasMatchedParam = false;\n\n const resolvedRouteParam = matchedRoutes.reduce<T | undefined>((acc, match) => {\n const routeParam = match.route[key] as T | undefined;\n\n if (routeParam === undefined) {\n return acc;\n }\n\n hasMatchedParam = true;\n\n if (!useMerge) {\n return routeParam;\n }\n\n if (routeParam === null) {\n return routeParam;\n }\n\n return merge(acc ?? {}, routeParam);\n }, undefined);\n\n return hasMatchedParam ? resolvedRouteParam : undefined;\n}\n"],"names":["OwpLayout","props","routesConfig","useOwpAppContext","i18n","useOwpTranslation","layouts","themeLayouts","children","setSettings","useSetSettings","settings","useGetCurrentSettings","defaultSettings","useGetDefaultSettings","layoutStyle","_a","location","useLocation","pathname","hasCompletedInitialLayoutSyncRef","useRef","matchedSettings","useMemo","getRouteParamUtil","currentSettings","generateSettings","isSettingsSynchronized","isEqual","useEffect","OwpLoading","key","Layout","jsx","__name","routes","useMerge","matchedRoutes","matchRoutes","hasMatchedParam","resolvedRouteParam","acc","match","routeParam","merge"],"mappings":";;;;;;;;;;;;;AAoCA,SAASA,EAAUC,GAAuB;;AACxC,QAAM,EAAE,cAAAC,EAAA,IAAiBC,EAAA,GACnB,EAAE,MAAAC,EAAA,IAASC,EAAA,GAEX,EAAE,SAAAC,IAAUC,GAAc,UAAAC,EAAA,IAAaP,GACvCQ,IAAcC,EAAA,GACdC,IAAWC,EAAA,GACXC,IAAkBC,EAAA,GAElBC,KAAcC,IAAAL,KAAA,gBAAAA,EAAU,WAAV,gBAAAK,EAAkB,OAChCC,IAAWC,EAAA,GACX,EAAE,UAAAC,MAAaF,GACfG,IAAmCC,EAAO,EAAK,G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