@owp/core 2.2.4 → 2.2.6
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/index11.js +2 -2
- package/dist/_virtual/index12.js +2 -2
- package/dist/_virtual/index13.js +2 -2
- package/dist/_virtual/index14.js +2 -2
- package/dist/_virtual/index16.js +2 -5
- package/dist/_virtual/index16.js.map +1 -1
- package/dist/_virtual/index17.js +2 -2
- package/dist/_virtual/index6.js +5 -2
- package/dist/_virtual/index6.js.map +1 -1
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/OwpCommonCode/OwpCommonCodeSelector.js +68 -149
- package/dist/components/OwpCommonCode/OwpCommonCodeSelector.js.map +1 -1
- package/dist/components/OwpDialog/OwpDialog.js +48 -46
- package/dist/components/OwpDialog/OwpDialog.js.map +1 -1
- package/dist/components/OwpErrorStatusPage/OwpErrorStatusPage.js +24 -24
- package/dist/components/OwpErrorStatusPage/OwpErrorStatusPage.js.map +1 -1
- package/dist/components/OwpMrtTable/OwpMrtTable.js +2 -2
- package/dist/components/OwpMrtTable/OwpMrtTable.js.map +1 -1
- package/dist/components/OwpMrtTable/{OwpMrtTableNoDataOverlay.js → internal/OwpMrtTableNoDataOverlay.js} +1 -1
- package/dist/components/OwpMrtTable/internal/OwpMrtTableNoDataOverlay.js.map +1 -0
- package/dist/components/OwpMrtTable/{OwpMrtTableTopToolbar.js → internal/OwpMrtTableTopToolbar.js} +3 -3
- package/dist/components/OwpMrtTable/internal/OwpMrtTableTopToolbar.js.map +1 -0
- package/dist/components/OwpOptionSelector/OwpOptionSelector.js +52 -38
- package/dist/components/OwpOptionSelector/OwpOptionSelector.js.map +1 -1
- package/dist/components/OwpPageCarded/OwpPageCarded.js +81 -77
- package/dist/components/OwpPageCarded/OwpPageCarded.js.map +1 -1
- package/dist/components/OwpPageCarded/{OwpPageCardedHeader.js → internal/OwpPageCardedHeader.js} +2 -2
- package/dist/components/OwpPageCarded/internal/OwpPageCardedHeader.js.map +1 -0
- package/dist/components/OwpPageCarded/{OwpPageCardedSidebar.js → internal/OwpPageCardedSidebar.js} +3 -3
- package/dist/components/OwpPageCarded/internal/OwpPageCardedSidebar.js.map +1 -0
- package/dist/components/OwpPageCarded/{OwpPageCardedSidebarContent.js → internal/OwpPageCardedSidebarContent.js} +2 -2
- package/dist/components/OwpPageCarded/internal/OwpPageCardedSidebarContent.js.map +1 -0
- package/dist/components/OwpPicker/OwpDatePicker.js +90 -83
- package/dist/components/OwpPicker/OwpDatePicker.js.map +1 -1
- package/dist/components/OwpPicker/OwpDateRangePicker.js +57 -50
- package/dist/components/OwpPicker/OwpDateRangePicker.js.map +1 -1
- package/dist/components/OwpPicker/OwpTimePicker.js +65 -61
- package/dist/components/OwpPicker/OwpTimePicker.js.map +1 -1
- package/dist/components/OwpPicker/OwpWeekDatePicker.js +58 -52
- package/dist/components/OwpPicker/OwpWeekDatePicker.js.map +1 -1
- package/dist/components/OwpPicker/OwpYearRangePicker.js +68 -62
- package/dist/components/OwpPicker/OwpYearRangePicker.js.map +1 -1
- package/dist/components/OwpPicker/{constants.js → constants/index.js} +1 -1
- package/dist/components/OwpPicker/constants/index.js.map +1 -0
- package/dist/components/OwpPicker/{AnimatedCalendarContainer.js → internal/AnimatedCalendarContainer.js} +2 -2
- package/dist/components/OwpPicker/internal/AnimatedCalendarContainer.js.map +1 -0
- package/dist/components/OwpPicker/{CalendarContainer.js → internal/CalendarContainer.js} +2 -2
- package/dist/components/OwpPicker/internal/CalendarContainer.js.map +1 -0
- package/dist/components/OwpPicker/{DatePickerInput.js → internal/DatePickerInput.js} +4 -4
- package/dist/components/OwpPicker/internal/DatePickerInput.js.map +1 -0
- package/dist/components/OwpQuerySelector/OwpQuerySelector.js +266 -0
- package/dist/components/OwpQuerySelector/OwpQuerySelector.js.map +1 -0
- package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js +390 -0
- package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js.map +1 -0
- package/dist/components/OwpSelectorBase/OwpSelectorBase.js +14 -0
- package/dist/components/OwpSelectorBase/OwpSelectorBase.js.map +1 -0
- package/dist/components/OwpSelectorBase/OwpSelectorSelect.js +152 -0
- package/dist/components/OwpSelectorBase/OwpSelectorSelect.js.map +1 -0
- package/dist/components/OwpSelectorBase/hooks/useOwpSelectorBase.js +120 -0
- package/dist/components/OwpSelectorBase/hooks/useOwpSelectorBase.js.map +1 -0
- package/dist/components/OwpSelectorBase/utils/querySelectorUtils.js +24 -0
- package/dist/components/OwpSelectorBase/utils/querySelectorUtils.js.map +1 -0
- package/dist/components/OwpStyleProvider/OwpStyleProvider.js +90 -42
- package/dist/components/OwpStyleProvider/OwpStyleProvider.js.map +1 -1
- package/dist/components/OwpSuspense/OwpSuspense.js.map +1 -1
- package/dist/components/OwpTable/OwpTable.js +50 -51
- package/dist/components/OwpTable/OwpTable.js.map +1 -1
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js +163 -308
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
- package/dist/components/OwpTreeGrid/hooks/useOwpTreeGridOverlayFrame.js +1 -1
- package/dist/components/OwpTreeGrid/hooks/useOwpTreeGridOverlayFrame.js.map +1 -1
- package/dist/components/OwpTreeGrid/{OwpTreeGridLoadingOverlay.js → internal/OwpTreeGridLoadingOverlay.js} +2 -2
- package/dist/components/OwpTreeGrid/internal/OwpTreeGridLoadingOverlay.js.map +1 -0
- package/dist/components/OwpTreeGrid/{OwpTreeGridNoDataOverlay.js → internal/OwpTreeGridNoDataOverlay.js} +2 -2
- package/dist/components/OwpTreeGrid/internal/OwpTreeGridNoDataOverlay.js.map +1 -0
- package/dist/components/OwpTreeGrid/{utils/index.js → internal/treeGridLayout.js} +1 -1
- package/dist/components/OwpTreeGrid/internal/treeGridLayout.js.map +1 -0
- package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +176 -0
- package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -0
- package/dist/components/OwpTreeGrid/utils/perf.js.map +1 -0
- package/dist/components/OwpZoomImageSlider/OwpZoomImageSlider.js +1 -1
- package/dist/components/OwpZoomImageSlider/OwpZoomImageSlider.js.map +1 -1
- package/dist/components/OwpZoomImageSlider/{ZoomImage.js → internal/ZoomImage.js} +1 -1
- package/dist/components/OwpZoomImageSlider/internal/ZoomImage.js.map +1 -0
- package/dist/index.js +100 -104
- package/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/ArrowDropDown.js +9 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/ArrowDropDown.js.map +1 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isFunction.js +10 -0
- package/dist/node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isFunction.js.map +1 -0
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE39/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/GenericBarcode/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/MSI/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/codabar/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/pharmacode/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/renderers/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/react-imask@7.6.1_react@19.2.4/node_modules/react-imask/esm/mixin.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/OwpCommonCode/OwpCommonCodeSelector.d.ts +16 -6
- package/dist/types/components/OwpOptionSelector/OwpOptionSelector.d.ts +9 -8
- package/dist/types/components/OwpPageCarded/OwpPageCarded.d.ts +12 -41
- package/dist/types/components/OwpPageSkeleton/index.d.ts +1 -0
- package/dist/types/components/OwpPicker/OwpWeekDatePicker.d.ts +0 -1
- package/dist/types/components/OwpPicker/OwpYearRangePicker.d.ts +0 -1
- package/dist/types/components/OwpQuerySelector/OwpQuerySelector.d.ts +6 -0
- package/dist/types/components/OwpQuerySelector/index.d.ts +2 -0
- package/dist/types/components/OwpQuerySelector/types/index.d.ts +1 -0
- package/dist/types/components/OwpQuerySelector/types/types.d.ts +44 -0
- package/dist/types/components/OwpSelectorBase/OwpSelectorAutocomplete.d.ts +11 -0
- package/dist/types/components/OwpSelectorBase/OwpSelectorBase.d.ts +6 -0
- package/dist/types/components/OwpSelectorBase/OwpSelectorSelect.d.ts +11 -0
- package/dist/types/components/OwpSelectorBase/hooks/useOwpSelectorBase.d.ts +6 -0
- package/dist/types/components/OwpSelectorBase/types/index.d.ts +1 -0
- package/dist/types/components/OwpSelectorBase/types/types.d.ts +59 -0
- package/dist/types/components/OwpSelectorBase/utils/index.d.ts +1 -0
- package/dist/types/components/OwpSelectorBase/utils/querySelectorUtils.d.ts +31 -0
- package/dist/types/components/OwpTreeGrid/OwpTreeGrid.d.ts +3 -1
- package/dist/types/components/OwpTreeGrid/{OwpTreeGridLoadingOverlay.d.ts → internal/OwpTreeGridLoadingOverlay.d.ts} +1 -1
- package/dist/types/components/OwpTreeGrid/{OwpTreeGridNoDataOverlay.d.ts → internal/OwpTreeGridNoDataOverlay.d.ts} +1 -1
- package/dist/types/components/OwpTreeGrid/{utils/index.d.ts → internal/treeGridLayout.d.ts} +0 -2
- package/dist/types/components/OwpTreeGrid/internal/treeGridRuntime.d.ts +75 -0
- package/dist/types/index.d.ts +2 -4
- package/dist/types/store/navigationSlice.d.ts +1 -0
- package/dist/types/types/OwpNavigationTypes.d.ts +14 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/navigationUtils.d.ts +6 -2
- package/dist/types/utils/normalizeTimeToHourMinute.d.ts +11 -0
- package/dist/utils/navigationUtils.js.map +1 -1
- package/dist/utils/normalizeTimeToHourMinute.js +34 -0
- package/dist/utils/normalizeTimeToHourMinute.js.map +1 -0
- package/dist/utils/treeGridUtil.js +1 -1
- package/dist/utils/treeGridUtil.js.map +1 -1
- package/dist/utils.js +78 -75
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/OwpMrtTable/OwpMrtTableNoDataOverlay.js.map +0 -1
- package/dist/components/OwpMrtTable/OwpMrtTableTopToolbar.js.map +0 -1
- package/dist/components/OwpPageCarded/OwpPageCardedHeader.js.map +0 -1
- package/dist/components/OwpPageCarded/OwpPageCardedSidebar.js.map +0 -1
- package/dist/components/OwpPageCarded/OwpPageCardedSidebarContent.js.map +0 -1
- package/dist/components/OwpPicker/AnimatedCalendarContainer.js.map +0 -1
- package/dist/components/OwpPicker/CalendarContainer.js.map +0 -1
- package/dist/components/OwpPicker/DatePickerInput.js.map +0 -1
- package/dist/components/OwpPicker/constants.js.map +0 -1
- package/dist/components/OwpTreeGrid/OwpTreeGridLoadingOverlay.js.map +0 -1
- package/dist/components/OwpTreeGrid/OwpTreeGridNoDataOverlay.js.map +0 -1
- package/dist/components/OwpTreeGrid/perf.js.map +0 -1
- package/dist/components/OwpTreeGrid/utils/index.js.map +0 -1
- package/dist/components/OwpZoomImageSlider/ZoomImage.js.map +0 -1
- package/dist/node_modules/.pnpm/react-datepicker@8.7.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-datepicker/dist/react-datepicker.css +0 -1
- /package/dist/components/OwpTreeGrid/{perf.js → utils/perf.js} +0 -0
- /package/dist/types/components/OwpMrtTable/{OwpMrtTableNoDataOverlay.d.ts → internal/OwpMrtTableNoDataOverlay.d.ts} +0 -0
- /package/dist/types/components/OwpMrtTable/{OwpMrtTableTopToolbar.d.ts → internal/OwpMrtTableTopToolbar.d.ts} +0 -0
- /package/dist/types/components/OwpPageCarded/{OwpPageCardedHeader.d.ts → internal/OwpPageCardedHeader.d.ts} +0 -0
- /package/dist/types/components/OwpPageCarded/{OwpPageCardedSidebar.d.ts → internal/OwpPageCardedSidebar.d.ts} +0 -0
- /package/dist/types/components/OwpPageCarded/{OwpPageCardedSidebarContent.d.ts → internal/OwpPageCardedSidebarContent.d.ts} +0 -0
- /package/dist/types/components/OwpPicker/{constants.d.ts → constants/index.d.ts} +0 -0
- /package/dist/types/components/OwpPicker/{AnimatedCalendarContainer.d.ts → internal/AnimatedCalendarContainer.d.ts} +0 -0
- /package/dist/types/components/OwpPicker/{CalendarContainer.d.ts → internal/CalendarContainer.d.ts} +0 -0
- /package/dist/types/components/OwpPicker/{DatePickerInput.d.ts → internal/DatePickerInput.d.ts} +0 -0
- /package/dist/types/components/OwpTreeGrid/{perf.d.ts → utils/perf.d.ts} +0 -0
- /package/dist/types/components/OwpZoomImageSlider/{ZoomImage.d.ts → internal/ZoomImage.d.ts} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var l = (t, o) =>
|
|
3
|
-
import { jsxs as f, jsx as e, Fragment as
|
|
4
|
-
import { Typography as
|
|
5
|
-
import { clsx as
|
|
1
|
+
var F = Object.defineProperty;
|
|
2
|
+
var l = (t, o) => F(t, "name", { value: o, configurable: !0 });
|
|
3
|
+
import { jsxs as f, jsx as e, Fragment as y } 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 { Typography as v, styled as R, Divider as L } from "@mui/material";
|
|
5
|
+
import { clsx as C } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
6
6
|
import $ from "@mui/material/GlobalStyles";
|
|
7
7
|
import M from "@mui/material/Paper";
|
|
8
8
|
import D from "@mui/material/Table";
|
|
@@ -11,11 +11,11 @@ import h from "@mui/material/TableCell";
|
|
|
11
11
|
import O from "@mui/material/TableContainer";
|
|
12
12
|
import j from "@mui/material/TableHead";
|
|
13
13
|
import z from "@mui/material/TableRow";
|
|
14
|
-
import { useMemo as
|
|
14
|
+
import { useMemo as u } from "react";
|
|
15
15
|
import { isNumber as B } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isNumber.js";
|
|
16
16
|
import { isArray as c } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isArray.js";
|
|
17
17
|
import { isEmpty as W } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js";
|
|
18
|
-
const
|
|
18
|
+
const x = /* @__PURE__ */ l((t) => t ? Object.keys(t).filter((o) => !o.includes("Span")) : [], "getTableColumnKeys"), g = /* @__PURE__ */ l((t, o) => t[`${o}Sx`] ?? {}, "getTableCellSx"), w = /* @__PURE__ */ l((t, o, r) => t[`${o}${r}`] ?? void 0, "getTableCellSpan"), A = /* @__PURE__ */ l((...t) => t.reduce((o, r) => r ? [...o, ...c(r) ? r : [r]] : o, []), "mergeSx"), H = {
|
|
19
19
|
border: 0,
|
|
20
20
|
borderRadius: 0,
|
|
21
21
|
overflow: "visible"
|
|
@@ -32,27 +32,27 @@ const g = /* @__PURE__ */ l((t) => t ? Object.keys(t).filter((o) => !o.includes(
|
|
|
32
32
|
fontWeight: "normal",
|
|
33
33
|
lineHeight: "16px"
|
|
34
34
|
};
|
|
35
|
-
function
|
|
36
|
-
return /* @__PURE__ */ f(
|
|
35
|
+
function I({ totalCount: t }) {
|
|
36
|
+
return /* @__PURE__ */ f(y, { children: [
|
|
37
37
|
/* @__PURE__ */ e(L, {}),
|
|
38
|
-
/* @__PURE__ */ f(
|
|
38
|
+
/* @__PURE__ */ f(v, { className: "h-[30px] w-full pr-12 my-8", align: "right", children: [
|
|
39
39
|
"전체: ",
|
|
40
40
|
B(t) ? t.toLocaleString() : 0,
|
|
41
41
|
" 건"
|
|
42
42
|
] })
|
|
43
43
|
] });
|
|
44
44
|
}
|
|
45
|
-
l(
|
|
46
|
-
const
|
|
45
|
+
l(I, "OwpTableTotalCount");
|
|
46
|
+
const N = /* @__PURE__ */ l(({
|
|
47
47
|
canBodyFullHeight: t,
|
|
48
48
|
canUseTreeGridStyle: o,
|
|
49
49
|
children: r,
|
|
50
50
|
className: a,
|
|
51
51
|
containerProps: n,
|
|
52
|
-
footerSlot:
|
|
53
|
-
tableLayout:
|
|
52
|
+
footerSlot: s,
|
|
53
|
+
tableLayout: b,
|
|
54
54
|
...i
|
|
55
|
-
}) => /* @__PURE__ */ f(
|
|
55
|
+
}) => /* @__PURE__ */ f(y, { children: [
|
|
56
56
|
o && /* @__PURE__ */ e($, { styles: K }),
|
|
57
57
|
/* @__PURE__ */ f(
|
|
58
58
|
O,
|
|
@@ -67,24 +67,24 @@ const I = /* @__PURE__ */ l(({
|
|
|
67
67
|
),
|
|
68
68
|
children: [
|
|
69
69
|
/* @__PURE__ */ e(
|
|
70
|
-
|
|
70
|
+
q,
|
|
71
71
|
{
|
|
72
72
|
...i,
|
|
73
73
|
canBodyFullHeight: t,
|
|
74
74
|
canUseTreeGridStyle: o,
|
|
75
|
-
className:
|
|
75
|
+
className: C(
|
|
76
76
|
t && "h-full",
|
|
77
|
-
|
|
77
|
+
b === "fixed" ? "table-fixed" : b === "auto" ? "table-auto" : "",
|
|
78
78
|
a
|
|
79
79
|
),
|
|
80
80
|
children: r
|
|
81
81
|
}
|
|
82
82
|
),
|
|
83
|
-
|
|
83
|
+
s
|
|
84
84
|
]
|
|
85
85
|
}
|
|
86
86
|
)
|
|
87
|
-
] }), "StyledTable"),
|
|
87
|
+
] }), "StyledTable"), q = R(D, {
|
|
88
88
|
shouldForwardProp: /* @__PURE__ */ l((t) => t !== "canBodyFullHeight" && t !== "canUseTreeGridStyle", "shouldForwardProp")
|
|
89
89
|
})(({ theme: t, canBodyFullHeight: o, canUseTreeGridStyle: r }) => ({
|
|
90
90
|
...o && {
|
|
@@ -108,13 +108,12 @@ const I = /* @__PURE__ */ l(({
|
|
|
108
108
|
} : {
|
|
109
109
|
fontSize: "1.7rem",
|
|
110
110
|
padding: "7px 10px",
|
|
111
|
-
borderLeft:
|
|
112
|
-
borderRight:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
borderRight: "none"
|
|
111
|
+
borderLeft: "none",
|
|
112
|
+
borderRight: "none"
|
|
113
|
+
},
|
|
114
|
+
...!r && {
|
|
115
|
+
"& .MuiTableRow-root > .MuiTableCell-root + .MuiTableCell-root": {
|
|
116
|
+
borderLeft: `1px solid ${t.palette.divider}`
|
|
118
117
|
}
|
|
119
118
|
},
|
|
120
119
|
"& th": r ? {
|
|
@@ -153,7 +152,7 @@ const I = /* @__PURE__ */ l(({
|
|
|
153
152
|
borderTopRightRadius: "inherit"
|
|
154
153
|
}
|
|
155
154
|
}
|
|
156
|
-
})),
|
|
155
|
+
})), T = R(z)`
|
|
157
156
|
/* &:last-child th,
|
|
158
157
|
&:last-child td {
|
|
159
158
|
border-bottom: 0;
|
|
@@ -166,44 +165,44 @@ function lo({
|
|
|
166
165
|
totalCount: a,
|
|
167
166
|
...n
|
|
168
167
|
}) {
|
|
169
|
-
const
|
|
168
|
+
const s = u(
|
|
170
169
|
() => c(o) ? o : W(o) ? [] : [o],
|
|
171
170
|
[o]
|
|
172
|
-
),
|
|
173
|
-
() =>
|
|
171
|
+
), b = u(
|
|
172
|
+
() => x(c(o) ? o[0] : o),
|
|
174
173
|
[o]
|
|
175
174
|
);
|
|
176
175
|
return /* @__PURE__ */ f(
|
|
177
|
-
|
|
176
|
+
N,
|
|
178
177
|
{
|
|
179
178
|
...n,
|
|
180
|
-
footerSlot: t ? /* @__PURE__ */ e(
|
|
181
|
-
className:
|
|
179
|
+
footerSlot: t ? /* @__PURE__ */ e(I, { totalCount: typeof a > "u" ? r.length : a }) : void 0,
|
|
180
|
+
className: C(n.tableLayout && "w-full", n.className),
|
|
182
181
|
children: [
|
|
183
|
-
/* @__PURE__ */ e(j, { children:
|
|
182
|
+
/* @__PURE__ */ e(j, { children: s.map((i, d) => /* @__PURE__ */ e(T, { children: x(i).map((p) => /* @__PURE__ */ e(
|
|
184
183
|
h,
|
|
185
184
|
{
|
|
186
185
|
className: "whitespace-pre-wrap",
|
|
187
|
-
sx:
|
|
188
|
-
colSpan: w(i,
|
|
189
|
-
rowSpan: w(i,
|
|
186
|
+
sx: g(i, p),
|
|
187
|
+
colSpan: w(i, p, "ColSpan"),
|
|
188
|
+
rowSpan: w(i, p, "RowSpan"),
|
|
190
189
|
align: "center",
|
|
191
|
-
children: i[
|
|
190
|
+
children: i[p]
|
|
192
191
|
},
|
|
193
|
-
`table-header-${
|
|
194
|
-
)) }, `table-header-${
|
|
195
|
-
/* @__PURE__ */ e(E, { children: r.map((i,
|
|
196
|
-
const
|
|
197
|
-
return /* @__PURE__ */ e(
|
|
192
|
+
`table-header-${d}-${p}`
|
|
193
|
+
)) }, `table-header-${d}`)) }),
|
|
194
|
+
/* @__PURE__ */ e(E, { children: r.map((i, d) => {
|
|
195
|
+
const p = i;
|
|
196
|
+
return /* @__PURE__ */ e(T, { children: b.map((m) => /* @__PURE__ */ e(
|
|
198
197
|
h,
|
|
199
198
|
{
|
|
200
199
|
className: "whitespace-pre-wrap h-64",
|
|
201
|
-
sx:
|
|
200
|
+
sx: g(p, m),
|
|
202
201
|
align: "center",
|
|
203
|
-
children:
|
|
202
|
+
children: p[m]
|
|
204
203
|
},
|
|
205
|
-
`table-row-cell-${
|
|
206
|
-
)) }, `table-row-${
|
|
204
|
+
`table-row-cell-${d}-${m}`
|
|
205
|
+
)) }, `table-row-${d}`);
|
|
207
206
|
}) })
|
|
208
207
|
]
|
|
209
208
|
}
|
|
@@ -212,8 +211,8 @@ function lo({
|
|
|
212
211
|
l(lo, "OwpTable");
|
|
213
212
|
export {
|
|
214
213
|
lo as OwpTable,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
214
|
+
I as OwpTableTotalCount,
|
|
215
|
+
N as StyledTable,
|
|
216
|
+
T as StyledTableRow
|
|
218
217
|
};
|
|
219
218
|
//# sourceMappingURL=OwpTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwpTable.js","sources":["../../../src/components/OwpTable/OwpTable.tsx"],"sourcesContent":["import { Divider, styled, Typography, type SxProps, type Theme } from '@mui/material';\nimport clsx from 'clsx';\nimport GlobalStyles from '@mui/material/GlobalStyles';\nimport Paper from '@mui/material/Paper';\nimport Table, { type TableProps } from '@mui/material/Table';\nimport TableBody from '@mui/material/TableBody';\nimport TableCell from '@mui/material/TableCell';\nimport TableContainer, { type TableContainerProps } from '@mui/material/TableContainer';\nimport TableHead from '@mui/material/TableHead';\nimport TableRow from '@mui/material/TableRow';\nimport { isArray, isEmpty, isNumber } from 'es-toolkit/compat';\nimport { type ReactNode, useMemo } from 'react';\n\ntype OwpTableCellValue = string | number;\ntype OwpTableHeaderRow = Record<string, OwpTableCellValue>;\ntype OwpTableRowData = Record<string, unknown>;\n\nconst getTableColumnKeys = (row?: Record<string, unknown>) => {\n if (!row) {\n return [];\n }\n\n return Object.keys(row).filter((keyName) => !keyName.includes('Span'));\n};\n\nconst getTableCellSx = (row: Record<string, unknown>, keyName: string) => {\n return (row[`${keyName}Sx`] as SxProps<Theme>) ?? {};\n};\n\nconst getTableCellSpan = (\n row: Record<string, unknown>,\n keyName: string,\n spanType: 'ColSpan' | 'RowSpan',\n) => {\n return (row[`${keyName}${spanType}`] as number | undefined) ?? undefined;\n};\n\nconst mergeSx = (...styles: Array<SxProps<Theme> | undefined | false>): SxProps<Theme> =>\n styles.reduce<Array<Exclude<SxProps<Theme>, readonly unknown[]>>>((acc, style) => {\n if (!style) {\n return acc;\n }\n\n return [...acc, ...(isArray(style) ? style : [style])];\n }, []) as SxProps<Theme>;\n\nconst treeGridContainerSx = {\n border: 0,\n borderRadius: 0,\n overflow: 'visible',\n} as const;\n\nconst treeGridFontFaceStyles = {\n '@font-face': {\n fontFamily: 'RobotoLight',\n fontStyle: 'normal',\n fontWeight: 'normal',\n src: \"url('/assets/vendors/Grid/Styles/Roboto-Light.ttf') format('truetype')\",\n },\n} as const;\n\nconst treeGridFontSx = {\n fontFamily: 'RobotoLight, sans-serif',\n fontSize: '14px',\n fontWeight: 'normal',\n lineHeight: '16px',\n} as const;\n\ninterface StyledTableProps extends TableProps {\n canBodyFullHeight?: boolean;\n canUseTreeGridStyle?: boolean;\n containerProps?: TableContainerProps;\n footerSlot?: ReactNode;\n tableLayout?: 'auto' | 'fixed';\n title?: string;\n children: ReactNode;\n}\n\ntype StyledTableInnerProps = Pick<StyledTableProps, 'canBodyFullHeight' | 'canUseTreeGridStyle'>;\n\n/**\n * 총 row 수 표시 영역\n * @param totalCount 전체 row 수\n */\nexport function OwpTableTotalCount({ totalCount }: { totalCount?: number }) {\n return (\n <>\n <Divider />\n <Typography className=\"h-[30px] w-full pr-12 my-8\" align=\"right\">\n 전체: {isNumber(totalCount) ? totalCount.toLocaleString() : 0} 건\n </Typography>\n </>\n );\n}\n\n/**\n * StyledTable 스타일 컴포넌트\n * @param canBodyFullHeight body full height 사용 여부\n * @param canUseTreeGridStyle TreeGrid 스타일 사용 여부\n * @param children 하위 콘텐츠\n * @param containerProps containerProps props\n * @param footerSlot footer 영역\n * @param tableLayout tableLayout 값\n */\nexport const StyledTable = ({\n canBodyFullHeight,\n canUseTreeGridStyle,\n children,\n className,\n containerProps,\n footerSlot,\n tableLayout,\n ...tableProps\n}: StyledTableProps) => {\n return (\n <>\n {canUseTreeGridStyle && <GlobalStyles styles={treeGridFontFaceStyles} />}\n <TableContainer\n component={Paper}\n variant=\"outlined\"\n {...containerProps}\n sx={mergeSx(\n canUseTreeGridStyle && treeGridContainerSx,\n canBodyFullHeight && { height: '100%' },\n containerProps?.sx,\n )}\n >\n <StyledTableInner\n {...tableProps}\n canBodyFullHeight={canBodyFullHeight}\n canUseTreeGridStyle={canUseTreeGridStyle}\n className={clsx(\n canBodyFullHeight && 'h-full',\n tableLayout === 'fixed' ? 'table-fixed' : tableLayout === 'auto' ? 'table-auto' : '',\n className,\n )}\n >\n {children}\n </StyledTableInner>\n {footerSlot}\n </TableContainer>\n </>\n );\n};\n\nconst StyledTableInner = styled(Table, {\n shouldForwardProp: (prop) => prop !== 'canBodyFullHeight' && prop !== 'canUseTreeGridStyle',\n})<StyledTableInnerProps>(({ theme, canBodyFullHeight, canUseTreeGridStyle }) => ({\n ...(canBodyFullHeight && {\n height: '100%',\n }),\n ...(canBodyFullHeight && {\n '& .MuiTableBody-root': {\n height: '100%',\n },\n '& .MuiTableBody-root > .MuiTableRow-root': {\n height: '100%',\n },\n }),\n '& .MuiTableCell-root': canUseTreeGridStyle\n ? {\n boxSizing: 'border-box',\n ...treeGridFontSx,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n verticalAlign: 'middle',\n whiteSpace: 'nowrap',\n }\n : {\n fontSize: '1.7rem',\n padding: '7px 10px',\n borderLeft: `1px solid ${theme.palette.divider}`,\n borderRight: `1px solid ${theme.palette.divider}`,\n '&:first-child': {\n borderLeft: 'none',\n },\n '&:last-child': {\n borderRight: 'none',\n },\n },\n '& th': canUseTreeGridStyle\n ? {\n ...treeGridFontSx,\n backgroundColor: '#586980',\n borderTop: '1px solid #6F7F94',\n borderBottom: '1px solid #6F7F94',\n borderLeft: 0,\n borderRight: '1px solid #6F7F94',\n color: 'white',\n height: 33,\n minHeight: 33,\n padding: '7px 2px 6px 10px',\n '&:first-of-type': {\n borderLeft: '1px solid #6F7F94',\n },\n }\n : {\n backgroundColor: theme.palette.grey[200],\n fontWeight: 600,\n },\n '& td': canUseTreeGridStyle\n ? {\n borderBottom: '1px solid #CDD8E4',\n borderLeft: 0,\n borderRight: '1px solid #CDD8E4',\n color: '#111112',\n padding: '7px 10px 6px',\n '&:first-of-type': {\n borderLeft: '1px solid #CDD8E4',\n },\n }\n : {},\n ...(canUseTreeGridStyle && {\n '& tbody > tr:first-of-type > th:first-of-type': {\n borderTopLeftRadius: 'inherit',\n },\n '& tbody > tr:first-of-type > td:last-of-type': {\n borderTopRightRadius: 'inherit',\n },\n }),\n}));\n\nexport const StyledTableRow = styled(TableRow)`\n /* &:last-child th,\n &:last-child td {\n border-bottom: 0;\n } */\n`;\n\ninterface OwpTableProps<T> extends Omit<StyledTableProps, 'children'> {\n canTotalCountRow?: boolean;\n headers: OwpTableHeaderRow | OwpTableHeaderRow[];\n rows: T[];\n totalCount?: number;\n}\n\n/**\n * OwpTable 컴포넌트\n * @param canTotalCountRow 전체 row 수 표시 여부\n * @param headers headers 값\n * @param rows 행 데이터 목록\n * @param totalCount 전체 row 수\n */\nexport function OwpTable<T>({\n canTotalCountRow = false,\n headers,\n rows,\n totalCount,\n ...restTableProps\n}: OwpTableProps<T>) {\n const resolvedHeaderRows = useMemo(\n () => (isArray(headers) ? headers : isEmpty(headers) ? [] : [headers]),\n [headers],\n );\n const commonKeyListData = useMemo(\n () => getTableColumnKeys(isArray(headers) ? headers[0] : headers),\n [headers],\n );\n\n return (\n <StyledTable\n {...restTableProps}\n footerSlot={\n canTotalCountRow ? (\n <OwpTableTotalCount totalCount={typeof totalCount === 'undefined' ? rows.length : totalCount} />\n ) : undefined\n }\n className={clsx(restTableProps.tableLayout && 'w-full', restTableProps.className)}\n >\n <TableHead>\n {resolvedHeaderRows.map((headerData, index) => (\n <StyledTableRow key={`table-header-${index}`}>\n {getTableColumnKeys(headerData).map((keyName) => (\n <TableCell\n key={`table-header-${index}-${keyName}`}\n className=\"whitespace-pre-wrap\"\n sx={getTableCellSx(headerData, keyName)}\n colSpan={getTableCellSpan(headerData, keyName, 'ColSpan')}\n rowSpan={getTableCellSpan(headerData, keyName, 'RowSpan')}\n align=\"center\"\n >\n {headerData[keyName]}\n </TableCell>\n ))}\n </StyledTableRow>\n ))}\n </TableHead>\n <TableBody>\n {rows.map((row, index) => {\n const currentRow = row as OwpTableRowData;\n\n return (\n <StyledTableRow key={`table-row-${index}`}>\n {commonKeyListData.map((keyName) => (\n <TableCell\n key={`table-row-cell-${index}-${keyName}`}\n className=\"whitespace-pre-wrap h-64\"\n sx={getTableCellSx(currentRow, keyName)}\n align=\"center\"\n >\n {currentRow[keyName] as ReactNode}\n </TableCell>\n ))}\n </StyledTableRow>\n );\n })}\n </TableBody>\n </StyledTable>\n );\n}\n"],"names":["getTableColumnKeys","__name","row","keyName","getTableCellSx","getTableCellSpan","spanType","mergeSx","styles","acc","style","isArray","treeGridContainerSx","treeGridFontFaceStyles","treeGridFontSx","OwpTableTotalCount","totalCount","jsxs","Fragment","jsx","Divider","Typography","isNumber","StyledTable","canBodyFullHeight","canUseTreeGridStyle","children","className","containerProps","footerSlot","tableLayout","tableProps","GlobalStyles","TableContainer","Paper","StyledTableInner","clsx","styled","Table","prop","theme","StyledTableRow","TableRow","OwpTable","canTotalCountRow","headers","rows","restTableProps","resolvedHeaderRows","useMemo","isEmpty","commonKeyListData","TableHead","header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,GAAA,EACE,UAAAU,EAAkB,IAAI,CAAChD,MACtB,gBAAAgB;AAAA,YAACoC;AAAA,YAAA;AAAA,cAEC,WAAU;AAAA,cACV,IAAInD,EAAeqD,GAAYtD,CAAO;AAAA,cACtC,OAAM;AAAA,cAEL,YAAWA,CAAO;AAAA,YAAA;AAAA,YALd,kBAAkBmD,CAAK,IAAInD,CAAO;AAAA,UAAA,CAO1C,KAVkB,aAAamD,CAAK,EAWvC;AAAA,QAEJ,CAAC,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAlEgBrD,EAAA0C,IAAA;"}
|
|
1
|
+
{"version":3,"file":"OwpTable.js","sources":["../../../src/components/OwpTable/OwpTable.tsx"],"sourcesContent":["import { Divider, styled, Typography, type SxProps, type Theme } from '@mui/material';\nimport clsx from 'clsx';\nimport GlobalStyles from '@mui/material/GlobalStyles';\nimport Paper from '@mui/material/Paper';\nimport Table, { type TableProps } from '@mui/material/Table';\nimport TableBody from '@mui/material/TableBody';\nimport TableCell from '@mui/material/TableCell';\nimport TableContainer, { type TableContainerProps } from '@mui/material/TableContainer';\nimport TableHead from '@mui/material/TableHead';\nimport TableRow from '@mui/material/TableRow';\nimport { isArray, isEmpty, isNumber } from 'es-toolkit/compat';\nimport { type ReactNode, useMemo } from 'react';\n\ntype OwpTableCellValue = string | number;\ntype OwpTableHeaderRow = Record<string, OwpTableCellValue>;\ntype OwpTableRowData = Record<string, unknown>;\n\nconst getTableColumnKeys = (row?: Record<string, unknown>) => {\n if (!row) {\n return [];\n }\n\n return Object.keys(row).filter((keyName) => !keyName.includes('Span'));\n};\n\nconst getTableCellSx = (row: Record<string, unknown>, keyName: string) => {\n return (row[`${keyName}Sx`] as SxProps<Theme>) ?? {};\n};\n\nconst getTableCellSpan = (\n row: Record<string, unknown>,\n keyName: string,\n spanType: 'ColSpan' | 'RowSpan',\n) => {\n return (row[`${keyName}${spanType}`] as number | undefined) ?? undefined;\n};\n\nconst mergeSx = (...styles: Array<SxProps<Theme> | undefined | false>): SxProps<Theme> =>\n styles.reduce<Array<Exclude<SxProps<Theme>, readonly unknown[]>>>((acc, style) => {\n if (!style) {\n return acc;\n }\n\n return [...acc, ...(isArray(style) ? style : [style])];\n }, []) as SxProps<Theme>;\n\nconst treeGridContainerSx = {\n border: 0,\n borderRadius: 0,\n overflow: 'visible',\n} as const;\n\nconst treeGridFontFaceStyles = {\n '@font-face': {\n fontFamily: 'RobotoLight',\n fontStyle: 'normal',\n fontWeight: 'normal',\n src: \"url('/assets/vendors/Grid/Styles/Roboto-Light.ttf') format('truetype')\",\n },\n} as const;\n\nconst treeGridFontSx = {\n fontFamily: 'RobotoLight, sans-serif',\n fontSize: '14px',\n fontWeight: 'normal',\n lineHeight: '16px',\n} as const;\n\ninterface StyledTableProps extends TableProps {\n canBodyFullHeight?: boolean;\n canUseTreeGridStyle?: boolean;\n containerProps?: TableContainerProps;\n footerSlot?: ReactNode;\n tableLayout?: 'auto' | 'fixed';\n title?: string;\n children: ReactNode;\n}\n\ntype StyledTableInnerProps = Pick<StyledTableProps, 'canBodyFullHeight' | 'canUseTreeGridStyle'>;\n\n/**\n * 총 row 수 표시 영역\n * @param totalCount 전체 row 수\n */\nexport function OwpTableTotalCount({ totalCount }: { totalCount?: number }) {\n return (\n <>\n <Divider />\n <Typography className=\"h-[30px] w-full pr-12 my-8\" align=\"right\">\n 전체: {isNumber(totalCount) ? totalCount.toLocaleString() : 0} 건\n </Typography>\n </>\n );\n}\n\n/**\n * StyledTable 스타일 컴포넌트\n * @param canBodyFullHeight body full height 사용 여부\n * @param canUseTreeGridStyle TreeGrid 스타일 사용 여부\n * @param children 하위 콘텐츠\n * @param containerProps containerProps props\n * @param footerSlot footer 영역\n * @param tableLayout tableLayout 값\n */\nexport const StyledTable = ({\n canBodyFullHeight,\n canUseTreeGridStyle,\n children,\n className,\n containerProps,\n footerSlot,\n tableLayout,\n ...tableProps\n}: StyledTableProps) => {\n return (\n <>\n {canUseTreeGridStyle && <GlobalStyles styles={treeGridFontFaceStyles} />}\n <TableContainer\n component={Paper}\n variant=\"outlined\"\n {...containerProps}\n sx={mergeSx(\n canUseTreeGridStyle && treeGridContainerSx,\n canBodyFullHeight && { height: '100%' },\n containerProps?.sx,\n )}\n >\n <StyledTableInner\n {...tableProps}\n canBodyFullHeight={canBodyFullHeight}\n canUseTreeGridStyle={canUseTreeGridStyle}\n className={clsx(\n canBodyFullHeight && 'h-full',\n tableLayout === 'fixed' ? 'table-fixed' : tableLayout === 'auto' ? 'table-auto' : '',\n className,\n )}\n >\n {children}\n </StyledTableInner>\n {footerSlot}\n </TableContainer>\n </>\n );\n};\n\nconst StyledTableInner = styled(Table, {\n shouldForwardProp: (prop) => prop !== 'canBodyFullHeight' && prop !== 'canUseTreeGridStyle',\n})<StyledTableInnerProps>(({ theme, canBodyFullHeight, canUseTreeGridStyle }) => ({\n ...(canBodyFullHeight && {\n height: '100%',\n }),\n ...(canBodyFullHeight && {\n '& .MuiTableBody-root': {\n height: '100%',\n },\n '& .MuiTableBody-root > .MuiTableRow-root': {\n height: '100%',\n },\n }),\n '& .MuiTableCell-root': canUseTreeGridStyle\n ? {\n boxSizing: 'border-box',\n ...treeGridFontSx,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n verticalAlign: 'middle',\n whiteSpace: 'nowrap',\n }\n : {\n fontSize: '1.7rem',\n padding: '7px 10px',\n borderLeft: 'none',\n borderRight: 'none',\n },\n ...(!canUseTreeGridStyle && {\n '& .MuiTableRow-root > .MuiTableCell-root + .MuiTableCell-root': {\n borderLeft: `1px solid ${theme.palette.divider}`,\n },\n }),\n '& th': canUseTreeGridStyle\n ? {\n ...treeGridFontSx,\n backgroundColor: '#586980',\n borderTop: '1px solid #6F7F94',\n borderBottom: '1px solid #6F7F94',\n borderLeft: 0,\n borderRight: '1px solid #6F7F94',\n color: 'white',\n height: 33,\n minHeight: 33,\n padding: '7px 2px 6px 10px',\n '&:first-of-type': {\n borderLeft: '1px solid #6F7F94',\n },\n }\n : {\n backgroundColor: theme.palette.grey[200],\n fontWeight: 600,\n },\n '& td': canUseTreeGridStyle\n ? {\n borderBottom: '1px solid #CDD8E4',\n borderLeft: 0,\n borderRight: '1px solid #CDD8E4',\n color: '#111112',\n padding: '7px 10px 6px',\n '&:first-of-type': {\n borderLeft: '1px solid #CDD8E4',\n },\n }\n : {},\n ...(canUseTreeGridStyle && {\n '& tbody > tr:first-of-type > th:first-of-type': {\n borderTopLeftRadius: 'inherit',\n },\n '& tbody > tr:first-of-type > td:last-of-type': {\n borderTopRightRadius: 'inherit',\n },\n }),\n}));\n\nexport const StyledTableRow = styled(TableRow)`\n /* &:last-child th,\n &:last-child td {\n border-bottom: 0;\n } */\n`;\n\ninterface OwpTableProps<T> extends Omit<StyledTableProps, 'children'> {\n canTotalCountRow?: boolean;\n headers: OwpTableHeaderRow | OwpTableHeaderRow[];\n rows: T[];\n totalCount?: number;\n}\n\n/**\n * OwpTable 컴포넌트\n * @param canTotalCountRow 전체 row 수 표시 여부\n * @param headers headers 값\n * @param rows 행 데이터 목록\n * @param totalCount 전체 row 수\n */\nexport function OwpTable<T>({\n canTotalCountRow = false,\n headers,\n rows,\n totalCount,\n ...restTableProps\n}: OwpTableProps<T>) {\n const resolvedHeaderRows = useMemo(\n () => (isArray(headers) ? headers : isEmpty(headers) ? [] : [headers]),\n [headers],\n );\n const commonKeyListData = useMemo(\n () => getTableColumnKeys(isArray(headers) ? headers[0] : headers),\n [headers],\n );\n\n return (\n <StyledTable\n {...restTableProps}\n footerSlot={\n canTotalCountRow ? (\n <OwpTableTotalCount totalCount={typeof totalCount === 'undefined' ? rows.length : totalCount} />\n ) : undefined\n }\n className={clsx(restTableProps.tableLayout && 'w-full', restTableProps.className)}\n >\n <TableHead>\n {resolvedHeaderRows.map((headerData, index) => (\n <StyledTableRow key={`table-header-${index}`}>\n {getTableColumnKeys(headerData).map((keyName) => (\n <TableCell\n key={`table-header-${index}-${keyName}`}\n className=\"whitespace-pre-wrap\"\n sx={getTableCellSx(headerData, keyName)}\n colSpan={getTableCellSpan(headerData, keyName, 'ColSpan')}\n rowSpan={getTableCellSpan(headerData, keyName, 'RowSpan')}\n align=\"center\"\n >\n {headerData[keyName]}\n </TableCell>\n ))}\n </StyledTableRow>\n ))}\n </TableHead>\n <TableBody>\n {rows.map((row, index) => {\n const currentRow = row as OwpTableRowData;\n\n return (\n <StyledTableRow key={`table-row-${index}`}>\n {commonKeyListData.map((keyName) => (\n <TableCell\n key={`table-row-cell-${index}-${keyName}`}\n className=\"whitespace-pre-wrap h-64\"\n sx={getTableCellSx(currentRow, keyName)}\n align=\"center\"\n >\n {currentRow[keyName] as ReactNode}\n </TableCell>\n ))}\n </StyledTableRow>\n );\n })}\n </TableBody>\n </StyledTable>\n );\n}\n"],"names":["getTableColumnKeys","__name","row","keyName","getTableCellSx","getTableCellSpan","spanType","mergeSx","styles","acc","style","isArray","treeGridContainerSx","treeGridFontFaceStyles","treeGridFontSx","OwpTableTotalCount","totalCount","jsxs","Fragment","jsx","Divider","Typography","isNumber","StyledTable","canBodyFullHeight","canUseTreeGridStyle","children","className","containerProps","footerSlot","tableLayout","tableProps","GlobalStyles","TableContainer","Paper","StyledTableInner","clsx","styled","Table","prop","theme","StyledTableRow","TableRow","OwpTable","canTotalCountRow","headers","rows","restTableProps","resolvedHeaderRows","useMemo","isEmpty","commonKeyListData","TableHead","headerData","index","TableCell","TableBody","currentRow"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAMA,IAAqB,gBAAAC,EAAA,CAACC,MACrBA,IAIE,OAAO,KAAKA,CAAG,EAAE,OAAO,CAACC,MAAY,CAACA,EAAQ,SAAS,MAAM,CAAC,IAH5D,CAAA,GAFgB,uBAQrBC,IAAiB,gBAAAH,EAAA,CAACC,GAA8BC,MAC5CD,EAAI,GAAGC,CAAO,IAAI,KAAwB,CAAA,GAD7B,mBAIjBE,IAAmB,gBAAAJ,EAAA,CACvBC,GACAC,GACAG,MAEQJ,EAAI,GAAGC,CAAO,GA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