@owp/core 2.5.2 → 2.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/_virtual/index11.js +2 -2
  2. package/dist/_virtual/index13.js +2 -2
  3. package/dist/_virtual/index14.js +2 -2
  4. package/dist/_virtual/index15.js +2 -2
  5. package/dist/_virtual/index16.js +4 -4
  6. package/dist/_virtual/index17.js +4 -4
  7. package/dist/_virtual/index18.js +4 -4
  8. package/dist/_virtual/index19.js +4 -4
  9. package/dist/components/{OwpFileUploadButton/OwpFileUploadButton.js → OwpFilePickerButton/OwpFilePickerButton.js} +15 -15
  10. package/dist/components/OwpFilePickerButton/OwpFilePickerButton.js.map +1 -0
  11. package/dist/components/OwpLanguageSwitcherSelect/OwpLanguageSwitcherSelect.js.map +1 -1
  12. package/dist/components/OwpMoreActionsButton/OwpMoreActionsButton.js +27 -27
  13. package/dist/components/OwpMoreActionsButton/OwpMoreActionsButton.js.map +1 -1
  14. package/dist/components/OwpMrtTable/OwpMrtTable.js +346 -336
  15. package/dist/components/OwpMrtTable/OwpMrtTable.js.map +1 -1
  16. package/dist/components/OwpSnackbarContent/OwpSnackbarContent.js +166 -0
  17. package/dist/components/OwpSnackbarContent/OwpSnackbarContent.js.map +1 -0
  18. package/dist/components/OwpTable/OwpDataTable.js +333 -283
  19. package/dist/components/OwpTable/OwpDataTable.js.map +1 -1
  20. package/dist/components/OwpTable/OwpFieldTable.js +102 -58
  21. package/dist/components/OwpTable/OwpFieldTable.js.map +1 -1
  22. package/dist/components/OwpTable/OwpTable.js +192 -172
  23. package/dist/components/OwpTable/OwpTable.js.map +1 -1
  24. package/dist/components/OwpTable/internal/treeGridTableStyle.js +77 -0
  25. package/dist/components/OwpTable/internal/treeGridTableStyle.js.map +1 -0
  26. package/dist/components/OwpTreeGrid/OwpTreeGrid.js +199 -171
  27. package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
  28. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +172 -131
  29. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -1
  30. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js +462 -0
  31. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js.map +1 -0
  32. package/dist/components/{OwpTreeGridExcelButton/OwpTreeGridExcelButton.js → OwpTreeGridExportExcelButton/OwpTreeGridExportExcelButton.js} +7 -7
  33. package/dist/components/OwpTreeGridExportExcelButton/OwpTreeGridExportExcelButton.js.map +1 -0
  34. package/dist/configs/defaultConfig.js +67 -44
  35. package/dist/configs/defaultConfig.js.map +1 -1
  36. package/dist/constants/gridTheme.js +78 -0
  37. package/dist/constants/gridTheme.js.map +1 -0
  38. package/dist/constants/tableTheme.js +16 -0
  39. package/dist/constants/tableTheme.js.map +1 -0
  40. package/dist/constants/treeGrid.js +44 -26
  41. package/dist/constants/treeGrid.js.map +1 -1
  42. package/dist/constants.js +21 -20
  43. package/dist/contexts/OwpUiProvider.js +59 -38
  44. package/dist/contexts/OwpUiProvider.js.map +1 -1
  45. package/dist/hooks/useFormDataUploadMutation.js.map +1 -1
  46. package/dist/index.js +105 -104
  47. package/dist/layout/components/toggles/NavigationSearchToggle.js +3 -3
  48. package/dist/layout/components/toolbar/ToolbarLayout.js +5 -4
  49. package/dist/layout/components/toolbar/ToolbarLayout.js.map +1 -1
  50. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
  51. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/index.js +1 -1
  52. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE39/index.js +1 -1
  53. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/index.js +1 -1
  54. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/constants.js +1 -1
  55. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/index.js +1 -1
  56. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/GenericBarcode/index.js +1 -1
  57. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/constants.js +1 -1
  58. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/index.js +1 -1
  59. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/MSI/index.js +1 -1
  60. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/codabar/index.js +1 -1
  61. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/pharmacode/index.js +1 -1
  62. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/renderers/index.js +1 -1
  63. 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
  64. package/dist/types/components/{OwpFileUploadButton/OwpFileUploadButton.d.ts → OwpFilePickerButton/OwpFilePickerButton.d.ts} +4 -4
  65. package/dist/types/components/OwpFilePickerButton/index.d.ts +1 -0
  66. package/dist/types/components/OwpLanguageSwitcherSelect/OwpLanguageSwitcherSelect.d.ts +1 -1
  67. package/dist/types/components/OwpMoreActionsButton/OwpMoreActionsButton.d.ts +4 -4
  68. package/dist/types/components/OwpSnackbarContent/OwpSnackbarContent.d.ts +2 -0
  69. package/dist/types/components/OwpTable/OwpTable.d.ts +5 -1
  70. package/dist/types/components/OwpTable/internal/treeGridTableStyle.d.ts +105 -0
  71. package/dist/types/components/OwpTreeGrid/internal/treeGridRuntime.d.ts +5 -1
  72. package/dist/types/components/OwpTreeGrid/internal/treeGridTheme.d.ts +20 -0
  73. package/dist/types/components/OwpTreeGridExportExcelButton/OwpTreeGridExportExcelButton.d.ts +12 -0
  74. package/dist/types/components/OwpTreeGridExportExcelButton/index.d.ts +1 -0
  75. package/dist/types/configs/defaultConfig.d.ts +22 -0
  76. package/dist/types/constants/gridTheme.d.ts +88 -0
  77. package/dist/types/constants/tableTheme.d.ts +18 -0
  78. package/dist/types/constants/treeGrid.d.ts +5 -0
  79. package/dist/types/hooks/useFormDataUploadMutation.d.ts +4 -3
  80. package/dist/types/index.d.ts +2 -2
  81. package/dist/types/types/OwpGridThemeTypes.d.ts +48 -0
  82. package/dist/types/types/OwpSettingsTypes.d.ts +11 -0
  83. package/dist/types/types/OwpTableThemeTypes.d.ts +16 -0
  84. package/dist/types/types/index.d.ts +3 -1
  85. package/dist/types/utils/treeGridUtil.d.ts +1 -0
  86. package/dist/utils/createFormDataBody.js +19 -14
  87. package/dist/utils/createFormDataBody.js.map +1 -1
  88. package/dist/utils/exceljsBrowser.js +45 -48
  89. package/dist/utils/exceljsBrowser.js.map +1 -1
  90. package/dist/utils/treeGridUtil.js +66 -66
  91. package/dist/utils/treeGridUtil.js.map +1 -1
  92. package/package.json +1 -1
  93. package/dist/components/OwpFileUploadButton/OwpFileUploadButton.js.map +0 -1
  94. package/dist/components/OwpTreeGridExcelButton/OwpTreeGridExcelButton.js.map +0 -1
  95. package/dist/types/components/OwpFileUploadButton/index.d.ts +0 -1
  96. package/dist/types/components/OwpTreeGridExcelButton/OwpTreeGridExcelButton.d.ts +0 -12
  97. package/dist/types/components/OwpTreeGridExcelButton/index.d.ts +0 -1
@@ -1,212 +1,232 @@
1
- var y = Object.defineProperty;
2
- var l = (t, o) => y(t, "name", { value: o, configurable: !0 });
3
- import { jsxs as f, jsx as e, Fragment as C } 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 { getTreeGridFontFaceStyles as v, TREEGRID_FONT_FAMILY_STACK as L } from "../../constants/treeGrid.js";
5
- import { Typography as $, styled as R, Divider as M } from "@mui/material";
6
- import { clsx as F } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
7
- import E from "@mui/material/GlobalStyles";
1
+ var L = Object.defineProperty;
2
+ var d = (o, e) => L(o, "name", { value: e, configurable: !0 });
3
+ import { jsxs as c, jsx as m, Fragment as S } 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 { resolveOwpGridTheme as y } from "../../constants/gridTheme.js";
5
+ import { resolveOwpTableTheme as B } from "../../constants/tableTheme.js";
6
+ import { getTreeGridFontFaceStyles as M } from "../../constants/treeGrid.js";
7
+ import { useGetCurrentSettings as G } from "../../hooks/useOwpSettings.js";
8
+ import { Typography as _, styled as v, Divider as z } from "@mui/material";
9
+ import { clsx as O } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
10
+ import A from "@mui/material/GlobalStyles";
8
11
  import D from "@mui/material/Paper";
9
- import O from "@mui/material/Table";
10
- import A from "@mui/material/TableBody";
11
- import u from "@mui/material/TableCell";
12
- import j from "@mui/material/TableContainer";
13
- import z from "@mui/material/TableHead";
14
- import B from "@mui/material/TableRow";
15
- import { useMemo as x } from "react";
16
- import { isNumber as I } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isNumber.js";
17
- import { isArray as c } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isArray.js";
18
- import { isEmpty as K } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js";
19
- const h = /* @__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"), _ = /* @__PURE__ */ l((...t) => t.reduce((o, r) => r ? [...o, ...c(r) ? r : [r]] : o, []), "mergeSx"), H = {
12
+ import j from "@mui/material/Table";
13
+ import I from "@mui/material/TableBody";
14
+ import g from "@mui/material/TableCell";
15
+ import W from "@mui/material/TableContainer";
16
+ import F from "@mui/material/TableHead";
17
+ import H from "@mui/material/TableRow";
18
+ import { useMemo as T } from "react";
19
+ import { getTreeGridContainerSx as K, getTreeGridBodyRowSx as N, TREEGRID_TABLE_BODY_BORDER_COLOR as Y, getTreeGridBodyCellSx as q, TREEGRID_TABLE_HEADER_BORDER_COLOR as J, getTreeGridHeaderCellSx as Q, getTreeGridCellBaseSx as V } from "./internal/treeGridTableStyle.js";
20
+ import { isNumber as X } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isNumber.js";
21
+ import { isArray as u } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isArray.js";
22
+ import { isEmpty as Z } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js";
23
+ const R = /* @__PURE__ */ d((o) => o ? Object.keys(o).filter((e) => !e.includes("Span")) : [], "getTableColumnKeys"), w = /* @__PURE__ */ d((o, e) => o[`${e}Sx`] ?? {}, "getTableCellSx"), x = /* @__PURE__ */ d((o, e, r) => o[`${e}${r}`] ?? void 0, "getTableCellSpan"), k = /* @__PURE__ */ d((...o) => o.reduce((e, r) => r ? [...e, ...u(r) ? r : [r]] : e, []), "mergeSx"), P = {
20
24
  border: 0,
21
25
  borderRadius: 0,
22
26
  overflow: "visible"
23
- }, T = {
24
- fontFamily: L,
25
- fontSize: "14px",
26
- fontWeight: "normal",
27
- lineHeight: "16px"
27
+ }, $ = {
28
+ header: {
29
+ backgroundColor: "",
30
+ color: "inherit",
31
+ fontSize: "1.7rem",
32
+ fontWeight: 600
33
+ },
34
+ cell: {
35
+ fontSize: "1.7rem"
36
+ }
28
37
  };
29
- function N({ totalCount: t }) {
30
- return /* @__PURE__ */ f(C, { children: [
31
- /* @__PURE__ */ e(M, {}),
32
- /* @__PURE__ */ f($, { className: "w-full py-8 pr-12", align: "right", children: [
38
+ function U({ totalCount: o }) {
39
+ return /* @__PURE__ */ c(S, { children: [
40
+ /* @__PURE__ */ m(z, {}),
41
+ /* @__PURE__ */ c(_, { className: "w-full py-8 pr-12", align: "right", children: [
33
42
  "전체: ",
34
- I(t) ? t.toLocaleString() : 0,
43
+ X(o) ? o.toLocaleString() : 0,
35
44
  " 건"
36
45
  ] })
37
46
  ] });
38
47
  }
39
- l(N, "OwpTableTotalCount");
40
- const W = /* @__PURE__ */ l(({
41
- canBodyFullHeight: t,
42
- canUseTreeGridStyle: o,
48
+ d(U, "OwpTableTotalCount");
49
+ const ee = /* @__PURE__ */ d(({
50
+ canBodyFullHeight: o,
51
+ canUseTreeGridStyle: e,
43
52
  children: r,
44
- className: a,
45
- containerProps: n,
46
- footerSlot: m,
47
- tableLayout: b,
48
- ...i
49
- }) => /* @__PURE__ */ f(C, { children: [
50
- o && /* @__PURE__ */ e(E, { styles: v() }),
51
- /* @__PURE__ */ f(
52
- j,
53
- {
54
- component: D,
55
- variant: "outlined",
56
- ...n,
57
- sx: _(
58
- o && H,
59
- t && { height: "100%" },
60
- n == null ? void 0 : n.sx
61
- ),
62
- children: [
63
- /* @__PURE__ */ e(
64
- Y,
65
- {
66
- ...i,
67
- canBodyFullHeight: t,
68
- canUseTreeGridStyle: o,
69
- className: F(
70
- t && "h-full",
71
- b === "fixed" ? "table-fixed" : b === "auto" ? "table-auto" : "",
72
- a
73
- ),
74
- children: r
75
- }
76
- ),
77
- m
78
- ]
79
- }
80
- )
81
- ] }), "StyledTable"), Y = R(O, {
82
- shouldForwardProp: /* @__PURE__ */ l((t) => t !== "canBodyFullHeight" && t !== "canUseTreeGridStyle", "shouldForwardProp")
83
- })(({ theme: t, canBodyFullHeight: o, canUseTreeGridStyle: r }) => ({
84
- ...o && {
85
- height: "100%"
86
- },
87
- ...o && {
88
- "& .MuiTableBody-root": {
89
- height: "100%"
53
+ className: b,
54
+ containerProps: l,
55
+ footerSlot: a,
56
+ tableTheme: i,
57
+ tableLayout: n,
58
+ ...f
59
+ }) => {
60
+ const t = G(), p = T(
61
+ () => {
62
+ var s, h;
63
+ return y((h = (s = t == null ? void 0 : t.theme) == null ? void 0 : s.main) == null ? void 0 : h.grid);
90
64
  },
91
- "& .MuiTableBody-root > .MuiTableRow-root": {
92
- height: "100%"
93
- }
94
- },
95
- "& .MuiTableCell-root": r ? {
96
- boxSizing: "border-box",
97
- ...T,
98
- overflow: "hidden",
99
- textOverflow: "ellipsis",
100
- verticalAlign: "middle",
101
- whiteSpace: "nowrap"
102
- } : {
103
- fontSize: "1.7rem",
104
- padding: "7px 10px",
105
- borderLeft: "none",
106
- borderRight: "none"
107
- },
108
- ...!r && {
109
- "& .MuiTableRow-root > .MuiTableCell-root + .MuiTableCell-root": {
110
- borderLeft: `1px solid ${t.palette.divider}`
111
- }
112
- },
113
- "& th": r ? {
114
- ...T,
115
- backgroundColor: "#586980",
116
- borderTop: "1px solid #6F7F94",
117
- borderBottom: "1px solid #6F7F94",
118
- borderLeft: 0,
119
- borderRight: "1px solid #6F7F94",
120
- color: "white",
121
- height: 33,
122
- minHeight: 33,
123
- padding: "7px 2px 6px 10px",
124
- "&:first-of-type": {
125
- borderLeft: "1px solid #6F7F94"
126
- }
127
- } : {
128
- backgroundColor: t.palette.grey[200],
129
- fontWeight: 600
130
- },
131
- "& td": r ? {
132
- borderBottom: "1px solid #CDD8E4",
133
- borderLeft: 0,
134
- borderRight: "1px solid #CDD8E4",
135
- color: "#111112",
136
- padding: "7px 10px 6px",
137
- "&:first-of-type": {
138
- borderLeft: "1px solid #CDD8E4"
139
- }
140
- } : {},
141
- ...r && {
142
- "& tbody > tr:first-of-type > th:first-of-type": {
143
- borderTopLeftRadius: "inherit"
65
+ [t]
66
+ ), E = T(
67
+ () => {
68
+ var s, h;
69
+ return i ?? B((h = (s = t == null ? void 0 : t.theme) == null ? void 0 : s.main) == null ? void 0 : h.table, $);
144
70
  },
145
- "& tbody > tr:first-of-type > td:last-of-type": {
146
- borderTopRightRadius: "inherit"
147
- }
71
+ [t, i]
72
+ );
73
+ return /* @__PURE__ */ c(S, { children: [
74
+ e && /* @__PURE__ */ m(A, { styles: M() }),
75
+ /* @__PURE__ */ c(
76
+ W,
77
+ {
78
+ component: D,
79
+ variant: "outlined",
80
+ ...l,
81
+ sx: k(
82
+ e && P,
83
+ e && K(p),
84
+ o && { height: "100%" },
85
+ l == null ? void 0 : l.sx
86
+ ),
87
+ children: [
88
+ /* @__PURE__ */ m(
89
+ oe,
90
+ {
91
+ ...f,
92
+ canBodyFullHeight: o,
93
+ canUseTreeGridStyle: e,
94
+ tableTheme: E,
95
+ treeGridTheme: p,
96
+ className: O(
97
+ o && "h-full",
98
+ n === "fixed" ? "table-fixed" : n === "auto" ? "table-auto" : "",
99
+ b
100
+ ),
101
+ children: r
102
+ }
103
+ ),
104
+ a
105
+ ]
106
+ }
107
+ )
108
+ ] });
109
+ }, "StyledTable"), oe = v(j, {
110
+ shouldForwardProp: /* @__PURE__ */ d((o) => o !== "canBodyFullHeight" && o !== "canUseTreeGridStyle" && o !== "tableTheme" && o !== "treeGridTheme", "shouldForwardProp")
111
+ })(
112
+ ({ theme: o, canBodyFullHeight: e, canUseTreeGridStyle: r, tableTheme: b, treeGridTheme: l }) => {
113
+ const a = l ?? y(), i = b ?? $;
114
+ return {
115
+ ...e && {
116
+ height: "100%"
117
+ },
118
+ ...e && {
119
+ "& .MuiTableBody-root": {
120
+ height: "100%"
121
+ },
122
+ "& .MuiTableBody-root > .MuiTableRow-root": {
123
+ height: "100%"
124
+ }
125
+ },
126
+ "& .MuiTableCell-root": r ? {
127
+ ...V(a)
128
+ } : {
129
+ fontSize: i.cell.fontSize,
130
+ padding: "7px 10px",
131
+ borderLeft: "none",
132
+ borderRight: "none"
133
+ },
134
+ ...!r && {
135
+ "& .MuiTableRow-root > .MuiTableCell-root + .MuiTableCell-root": {
136
+ borderLeft: `1px solid ${o.palette.divider}`
137
+ }
138
+ },
139
+ "& th": r ? {
140
+ ...Q(a),
141
+ "&:first-of-type": {
142
+ borderLeft: `1px solid ${J}`
143
+ }
144
+ } : {
145
+ backgroundColor: i.header.backgroundColor || o.palette.grey[200],
146
+ color: i.header.color,
147
+ fontSize: i.header.fontSize,
148
+ fontWeight: i.header.fontWeight
149
+ },
150
+ "& td": r ? {
151
+ ...q(a),
152
+ "&:first-of-type": {
153
+ borderLeft: `1px solid ${Y}`
154
+ }
155
+ } : {},
156
+ ...r && {
157
+ "& tbody > .MuiTableRow-root": N(a)
158
+ },
159
+ ...r && {
160
+ "& tbody > tr:first-of-type > th:first-of-type": {
161
+ borderTopLeftRadius: "inherit"
162
+ },
163
+ "& tbody > tr:first-of-type > td:last-of-type": {
164
+ borderTopRightRadius: "inherit"
165
+ }
166
+ }
167
+ };
148
168
  }
149
- })), S = R(B)`
169
+ ), C = v(H)`
150
170
  /* &:last-child th,
151
171
  &:last-child td {
152
172
  border-bottom: 0;
153
173
  } */
154
174
  `;
155
- function po({
156
- canTotalCountRow: t = !1,
157
- headers: o,
175
+ function Se({
176
+ canTotalCountRow: o = !1,
177
+ headers: e,
158
178
  rows: r,
159
- totalCount: a,
160
- ...n
179
+ totalCount: b,
180
+ ...l
161
181
  }) {
162
- const m = x(
163
- () => c(o) ? o : K(o) ? [] : [o],
164
- [o]
165
- ), b = x(
166
- () => h(c(o) ? o[0] : o),
167
- [o]
182
+ const a = T(
183
+ () => u(e) ? e : Z(e) ? [] : [e],
184
+ [e]
185
+ ), i = T(
186
+ () => R(u(e) ? e[0] : e),
187
+ [e]
168
188
  );
169
- return /* @__PURE__ */ f(
170
- W,
189
+ return /* @__PURE__ */ c(
190
+ ee,
171
191
  {
172
- ...n,
173
- footerSlot: t ? /* @__PURE__ */ e(N, { totalCount: typeof a > "u" ? r.length : a }) : void 0,
174
- className: F(n.tableLayout && "w-full", n.className),
192
+ ...l,
193
+ footerSlot: o ? /* @__PURE__ */ m(U, { totalCount: typeof b > "u" ? r.length : b }) : void 0,
194
+ className: O(l.tableLayout && "w-full", l.className),
175
195
  children: [
176
- /* @__PURE__ */ e(z, { children: m.map((i, d) => /* @__PURE__ */ e(S, { children: h(i).map((p) => /* @__PURE__ */ e(
177
- u,
196
+ /* @__PURE__ */ m(F, { children: a.map((n, f) => /* @__PURE__ */ m(C, { children: R(n).map((t) => /* @__PURE__ */ m(
197
+ g,
178
198
  {
179
199
  className: "whitespace-pre-wrap",
180
- sx: g(i, p),
181
- colSpan: w(i, p, "ColSpan"),
182
- rowSpan: w(i, p, "RowSpan"),
200
+ sx: w(n, t),
201
+ colSpan: x(n, t, "ColSpan"),
202
+ rowSpan: x(n, t, "RowSpan"),
183
203
  align: "center",
184
- children: i[p]
204
+ children: n[t]
185
205
  },
186
- `table-header-${d}-${p}`
187
- )) }, `table-header-${d}`)) }),
188
- /* @__PURE__ */ e(A, { children: r.map((i, d) => {
189
- const p = i;
190
- return /* @__PURE__ */ e(S, { children: b.map((s) => /* @__PURE__ */ e(
191
- u,
206
+ `table-header-${f}-${t}`
207
+ )) }, `table-header-${f}`)) }),
208
+ /* @__PURE__ */ m(I, { children: r.map((n, f) => {
209
+ const t = n;
210
+ return /* @__PURE__ */ m(C, { children: i.map((p) => /* @__PURE__ */ m(
211
+ g,
192
212
  {
193
213
  className: "whitespace-pre-wrap h-64",
194
- sx: g(p, s),
214
+ sx: w(t, p),
195
215
  align: "center",
196
- children: p[s]
216
+ children: t[p]
197
217
  },
198
- `table-row-cell-${d}-${s}`
199
- )) }, `table-row-${d}`);
218
+ `table-row-cell-${f}-${p}`
219
+ )) }, `table-row-${f}`);
200
220
  }) })
201
221
  ]
202
222
  }
203
223
  );
204
224
  }
205
- l(po, "OwpTable");
225
+ d(Se, "OwpTable");
206
226
  export {
207
- po as OwpTable,
208
- N as OwpTableTotalCount,
209
- W as StyledTable,
210
- S as StyledTableRow
227
+ Se as OwpTable,
228
+ U as OwpTableTotalCount,
229
+ ee as StyledTable,
230
+ C as StyledTableRow
211
231
  };
212
232
  //# sourceMappingURL=OwpTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OwpTable.js","sources":["../../../src/components/OwpTable/OwpTable.tsx"],"sourcesContent":["import {\n getTreeGridFontFaceStyles,\n TREEGRID_FONT_FAMILY_STACK,\n} from '@/constants/treeGrid';\nimport { 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 treeGridFontSx = {\n fontFamily: TREEGRID_FONT_FAMILY_STACK,\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=\"w-full py-8 pr-12\" 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={getTreeGridFontFaceStyles()} />}\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","treeGridFontSx","TREEGRID_FONT_FAMILY_STACK","OwpTableTotalCount","totalCount","jsxs","Fragment","jsx","Divider","Typography","isNumber","StyledTable","canBodyFullHeight","canUseTreeGridStyle","children","className","containerProps","footerSlot","tableLayout","tableProps","GlobalStyles","getTreeGridFontFaceStyles","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":";;;;;;;;;;;;;;;;;;AAqBA,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,GAAGG,CAAQ,EAAE,KAA4B,QALxC,qBAQnBC,IAAU,gBAAAN,EAAA,IAAIO,MAClBA,EAAO,OAA2D,CAACC,GAAKC,MACjEA,IAIE,CAAC,GAAGD,GAAK,GAAIE,EAAQD,CAAK,IAAIA,IAAQ,CAACA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AA,EACE,UAAA1C,EAAmBsD,CAAU,EAAE,IAAI,CAACnD,MACnC,gBAAAgB;AAAA,UAACqC;AAAA,UAAA;AAAA,YAEC,WAAU;AAAA,YACV,IAAIpD,EAAekD,GAAYnD,CAAO;AAAA,YACtC,SAASE,EAAiBiD,GAAYnD,GAAS,SAAS;AAAA,YACxD,SAASE,EAAiBiD,GAAYnD,GAAS,SAAS;AAAA,YACxD,OAAM;AAAA,YAEL,YAAWA,CAAO;AAAA,UAAA;AAAA,UAPd,gBAAgBoD,CAAK,IAAIpD,CAAO;AAAA,QAAA,CASxC,EAAA,GAZkB,gBAAgBoD,CAAK,EAa1C,CACD,EAAA,CACH;AAAA,0BACCE,GAAA,EACE,UAAAV,EAAK,IAAI,CAAC7C,GAAKqD,MAAU;AACxB,gBAAMG,IAAaxD;AAEnB,iBACE,gBAAAiB,EAACuB,GAAA,EACE,UAAAU,EAAkB,IAAI,CAACjD,MACtB,gBAAAgB;AAAA,YAACqC;AAAA,YAAA;AAAA,cAEC,WAAU;AAAA,cACV,IAAIpD,EAAesD,GAAYvD,CAAO;AAAA,cACtC,OAAM;AAAA,cAEL,YAAWA,CAAO;AAAA,YAAA;AAAA,YALd,kBAAkBoD,CAAK,IAAIpD,CAAO;AAAA,UAAA,CAO1C,KAVkB,aAAaoD,CAAK,EAWvC;AAAA,QAEJ,CAAC,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAlEgBtD,EAAA2C,IAAA;"}
1
+ {"version":3,"file":"OwpTable.js","sources":["../../../src/components/OwpTable/OwpTable.tsx"],"sourcesContent":["import {\n resolveOwpGridTheme,\n type OwpResolvedGridThemeConfigType,\n} from '@/constants/gridTheme';\nimport {\n resolveOwpTableTheme,\n type OwpResolvedTableThemeConfigType,\n} from '@/constants/tableTheme';\nimport { getTreeGridFontFaceStyles } from '@/constants/treeGrid';\nimport { useGetCurrentSettings } from '@/hooks/useOwpSettings';\nimport { 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';\nimport {\n getTreeGridBodyCellSx,\n getTreeGridBodyRowSx,\n getTreeGridCellBaseSx,\n getTreeGridContainerSx,\n getTreeGridHeaderCellSx,\n TREEGRID_TABLE_BODY_BORDER_COLOR,\n TREEGRID_TABLE_HEADER_BORDER_COLOR,\n} from './internal/treeGridTableStyle';\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 defaultStyledTableTheme = {\n header: {\n backgroundColor: '',\n color: 'inherit',\n fontSize: '1.7rem',\n fontWeight: 600,\n },\n cell: {\n fontSize: '1.7rem',\n },\n} satisfies OwpResolvedTableThemeConfigType;\n\ninterface StyledTableProps extends TableProps {\n canBodyFullHeight?: boolean;\n canUseTreeGridStyle?: boolean;\n containerProps?: TableContainerProps;\n footerSlot?: ReactNode;\n tableTheme?: OwpResolvedTableThemeConfigType;\n tableLayout?: 'auto' | 'fixed';\n treeGridTheme?: OwpResolvedGridThemeConfigType;\n title?: string;\n children: ReactNode;\n}\n\ntype StyledTableInnerProps = Pick<\n StyledTableProps,\n 'canBodyFullHeight' | 'canUseTreeGridStyle' | 'tableTheme' | 'treeGridTheme'\n>;\n\n/**\n * 총 row 수 표시 영역\n * @param totalCount 전체 row 수\n */\nexport function OwpTableTotalCount({ totalCount }: { totalCount?: number }) {\n return (\n <>\n <Divider />\n <Typography className=\"w-full py-8 pr-12\" 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 tableTheme: tableThemeProp,\n tableLayout,\n ...tableProps\n}: StyledTableProps) => {\n const currentSettings = useGetCurrentSettings();\n const treeGridTheme = useMemo(\n () => resolveOwpGridTheme(currentSettings?.theme?.main?.grid),\n [currentSettings],\n );\n const tableTheme = useMemo(\n () =>\n tableThemeProp ??\n resolveOwpTableTheme(currentSettings?.theme?.main?.table, defaultStyledTableTheme),\n [currentSettings, tableThemeProp],\n );\n\n return (\n <>\n {canUseTreeGridStyle && <GlobalStyles styles={getTreeGridFontFaceStyles()} />}\n <TableContainer\n component={Paper}\n variant=\"outlined\"\n {...containerProps}\n sx={mergeSx(\n canUseTreeGridStyle && treeGridContainerSx,\n canUseTreeGridStyle && getTreeGridContainerSx(treeGridTheme),\n canBodyFullHeight && { height: '100%' },\n containerProps?.sx,\n )}\n >\n <StyledTableInner\n {...tableProps}\n canBodyFullHeight={canBodyFullHeight}\n canUseTreeGridStyle={canUseTreeGridStyle}\n tableTheme={tableTheme}\n treeGridTheme={treeGridTheme}\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) =>\n prop !== 'canBodyFullHeight' &&\n prop !== 'canUseTreeGridStyle' &&\n prop !== 'tableTheme' &&\n prop !== 'treeGridTheme',\n})<StyledTableInnerProps>(\n ({ theme, canBodyFullHeight, canUseTreeGridStyle, tableTheme, treeGridTheme }) => {\n const resolvedTreeGridTheme = treeGridTheme ?? resolveOwpGridTheme();\n const resolvedTableTheme = tableTheme ?? defaultStyledTableTheme;\n\n return {\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 ...getTreeGridCellBaseSx(resolvedTreeGridTheme),\n }\n : {\n fontSize: resolvedTableTheme.cell.fontSize,\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 ...getTreeGridHeaderCellSx(resolvedTreeGridTheme),\n '&:first-of-type': {\n borderLeft: `1px solid ${TREEGRID_TABLE_HEADER_BORDER_COLOR}`,\n },\n }\n : {\n backgroundColor: resolvedTableTheme.header.backgroundColor || theme.palette.grey[200],\n color: resolvedTableTheme.header.color,\n fontSize: resolvedTableTheme.header.fontSize,\n fontWeight: resolvedTableTheme.header.fontWeight,\n },\n '& td': canUseTreeGridStyle\n ? {\n ...getTreeGridBodyCellSx(resolvedTreeGridTheme),\n '&:first-of-type': {\n borderLeft: `1px solid ${TREEGRID_TABLE_BODY_BORDER_COLOR}`,\n },\n }\n : {},\n ...(canUseTreeGridStyle && {\n '& tbody > .MuiTableRow-root': getTreeGridBodyRowSx(resolvedTreeGridTheme),\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 },\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","defaultStyledTableTheme","OwpTableTotalCount","totalCount","jsxs","Fragment","jsx","Divider","Typography","isNumber","StyledTable","canBodyFullHeight","canUseTreeGridStyle","children","className","containerProps","footerSlot","tableThemeProp","tableLayout","tableProps","currentSettings","useGetCurrentSettings","treeGridTheme","useMemo","resolveOwpGridTheme","_b","_a","tableTheme","resolveOwpTableTheme","GlobalStyles","getTreeGridFontFaceStyles","TableContainer","Paper","getTreeGridContainerSx","StyledTableInner","clsx","styled","Table","prop","theme","resolvedTreeGridTheme","resolvedTableTheme","getTreeGridCellBaseSx","getTreeGridHeaderCellSx","TREEGRID_TABLE_HEADER_BORDER_COLOR","getTreeGridBodyCellSx","TREEGRID_TABLE_BODY_BORDER_COLOR","getTreeGridBodyRowSx","StyledTableRow","TableRow","OwpTable","canTotalCountRow","headers","rows","restTableProps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e,eAAe,UAAUA,EAAe,SAAS;AAAA,MAEhF,UAAA;AAAA,QAAA,gBAAAhD,EAACoD,GAAA,EACE,UAAAH,EAAmB,IAAI,CAACI,GAAYC,MACnC,gBAAAtD,EAAC0C,GAAA,EACE,UAAA5D,EAAmBuE,CAAU,EAAE,IAAI,CAACpE,MACnC,gBAAAe;AAAA,UAACuD;AAAA,UAAA;AAAA,YAEC,WAAU;AAAA,YACV,IAAIrE,EAAemE,GAAYpE,CAAO;AAAA,YACtC,SAASE,EAAiBkE,GAAYpE,GAAS,SAAS;AAAA,YACxD,SAASE,EAAiBkE,GAAYpE,GAAS,SAAS;AAAA,YACxD,OAAM;AAAA,YAEL,YAAWA,CAAO;AAAA,UAAA;AAAA,UAPd,gBAAgBqE,CAAK,IAAIrE,CAAO;AAAA,QAAA,CASxC,EAAA,GAZkB,gBAAgBqE,CAAK,EAa1C,CACD,EAAA,CACH;AAAA,0BACCE,GAAA,EACE,UAAAT,EAAK,IAAI,CAAC/D,GAAKsE,MAAU;AACxB,gBAAMG,IAAazE;AAEnB,iBACE,gBAAAgB,EAAC0C,GAAA,EACE,UAAAS,EAAkB,IAAI,CAAClE,MACtB,gBAAAe;AAAA,YAACuD;AAAA,YAAA;AAAA,cAEC,WAAU;AAAA,cACV,IAAIrE,EAAeuE,GAAYxE,CAAO;AAAA,cACtC,OAAM;AAAA,cAEL,YAAWA,CAAO;AAAA,YAAA;AAAA,YALd,kBAAkBqE,CAAK,IAAIrE,CAAO;AAAA,UAAA,CAO1C,KAVkB,aAAaqE,CAAK,EAWvC;AAAA,QAEJ,CAAC,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAlEgBvE,EAAA6D,IAAA;"}
@@ -0,0 +1,77 @@
1
+ var g = Object.defineProperty;
2
+ var l = (o, r) => g(o, "name", { value: r, configurable: !0 });
3
+ import { TREEGRID_FONT_FAMILY_STACK as n } from "../../../constants/treeGrid.js";
4
+ const d = "#6F7F94", c = "#CDD8E4", s = /* @__PURE__ */ l((o) => ({
5
+ backgroundColor: o.body.backgroundColor,
6
+ color: o.body.color
7
+ }), "getTreeGridContainerSx"), a = /* @__PURE__ */ l((o, r = "normal") => ({
8
+ fontFamily: n,
9
+ fontSize: o,
10
+ fontWeight: r,
11
+ lineHeight: "16px"
12
+ }), "getTreeGridTypographySx"), C = /* @__PURE__ */ l((o) => ({
13
+ ...a(o.cell.fontSize),
14
+ boxSizing: "border-box",
15
+ overflow: "hidden",
16
+ textOverflow: "ellipsis",
17
+ verticalAlign: "middle",
18
+ whiteSpace: "nowrap"
19
+ }), "getTreeGridCellBaseSx"), x = /* @__PURE__ */ l((o) => ({
20
+ ...a(
21
+ o.header.fontSize,
22
+ o.header.fontWeight
23
+ ),
24
+ backgroundColor: o.header.backgroundColor,
25
+ borderTop: `1px solid ${d}`,
26
+ borderBottom: `1px solid ${d}`,
27
+ borderLeft: 0,
28
+ borderRight: `1px solid ${d}`,
29
+ color: o.header.color,
30
+ height: o.header.height,
31
+ minHeight: o.header.height,
32
+ padding: "7px 2px 6px 10px"
33
+ }), "getTreeGridHeaderCellSx"), k = /* @__PURE__ */ l((o) => ({
34
+ ...C(o),
35
+ backgroundColor: o.row.backgroundColor,
36
+ borderBottom: `1px solid ${c}`,
37
+ borderLeft: 0,
38
+ borderRight: `1px solid ${c}`,
39
+ color: o.body.color,
40
+ fontSize: o.cell.fontSize,
41
+ padding: "7px 10px 6px"
42
+ }), "getTreeGridBodyCellSx"), R = /* @__PURE__ */ l((o, r) => {
43
+ const e = r != null && r.selected ? o.state.selectedRowBackgroundColor : o.row.backgroundColor, t = r != null && r.selected ? o.state.selectedRowBackgroundColor : o.state.hoverRowBackgroundColor;
44
+ return {
45
+ "& > td": {
46
+ backgroundColor: e
47
+ },
48
+ ...(r == null ? void 0 : r.canHover) && {
49
+ "&:hover > td": {
50
+ backgroundColor: t
51
+ }
52
+ },
53
+ "&.Mui-selected > td": {
54
+ backgroundColor: o.state.selectedRowBackgroundColor
55
+ },
56
+ "&.Mui-selected:hover > td": {
57
+ backgroundColor: o.state.selectedRowBackgroundColor
58
+ },
59
+ "&:focus-within > td": {
60
+ backgroundColor: o.state.focusedRowBackgroundColor
61
+ },
62
+ "& > td:focus-within": {
63
+ backgroundColor: o.state.focusedCellBackgroundColor
64
+ }
65
+ };
66
+ }, "getTreeGridBodyRowSx");
67
+ export {
68
+ c as TREEGRID_TABLE_BODY_BORDER_COLOR,
69
+ d as TREEGRID_TABLE_HEADER_BORDER_COLOR,
70
+ k as getTreeGridBodyCellSx,
71
+ R as getTreeGridBodyRowSx,
72
+ C as getTreeGridCellBaseSx,
73
+ s as getTreeGridContainerSx,
74
+ x as getTreeGridHeaderCellSx,
75
+ a as getTreeGridTypographySx
76
+ };
77
+ //# sourceMappingURL=treeGridTableStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"treeGridTableStyle.js","sources":["../../../../src/components/OwpTable/internal/treeGridTableStyle.ts"],"sourcesContent":["import type { OwpResolvedGridThemeConfigType } from '@/constants/gridTheme';\nimport { TREEGRID_FONT_FAMILY_STACK } from '@/constants/treeGrid';\n\nexport const TREEGRID_TABLE_HEADER_BORDER_COLOR = '#6F7F94';\nexport const TREEGRID_TABLE_BODY_BORDER_COLOR = '#CDD8E4';\n\n/**\n * TreeGrid 컨테이너 색상 매핑\n * @param treeGridTheme Grid theme 값\n */\nexport const getTreeGridContainerSx = (\n treeGridTheme: OwpResolvedGridThemeConfigType,\n) => ({\n backgroundColor: treeGridTheme.body.backgroundColor,\n color: treeGridTheme.body.color,\n});\n\n/**\n * TreeGrid 타이포그래피 매핑\n * @param fontSize 폰트 크기\n * @param fontWeight 폰트 두께\n */\nexport const getTreeGridTypographySx = (\n fontSize: number | string,\n fontWeight: number | string = 'normal',\n) => ({\n fontFamily: TREEGRID_FONT_FAMILY_STACK,\n fontSize,\n fontWeight,\n lineHeight: '16px',\n});\n\n/**\n * TreeGrid 공통 셀 스타일 매핑\n * @param treeGridTheme Grid theme 값\n */\nexport const getTreeGridCellBaseSx = (treeGridTheme: OwpResolvedGridThemeConfigType) => ({\n ...getTreeGridTypographySx(treeGridTheme.cell.fontSize),\n boxSizing: 'border-box',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n verticalAlign: 'middle',\n whiteSpace: 'nowrap',\n});\n\n/**\n * TreeGrid header 셀 스타일 매핑\n * @param treeGridTheme Grid theme 값\n */\nexport const getTreeGridHeaderCellSx = (\n treeGridTheme: OwpResolvedGridThemeConfigType,\n) => ({\n ...getTreeGridTypographySx(\n treeGridTheme.header.fontSize,\n treeGridTheme.header.fontWeight,\n ),\n backgroundColor: treeGridTheme.header.backgroundColor,\n borderTop: `1px solid ${TREEGRID_TABLE_HEADER_BORDER_COLOR}`,\n borderBottom: `1px solid ${TREEGRID_TABLE_HEADER_BORDER_COLOR}`,\n borderLeft: 0,\n borderRight: `1px solid ${TREEGRID_TABLE_HEADER_BORDER_COLOR}`,\n color: treeGridTheme.header.color,\n height: treeGridTheme.header.height,\n minHeight: treeGridTheme.header.height,\n padding: '7px 2px 6px 10px',\n});\n\n/**\n * TreeGrid body 셀 스타일 매핑\n * @param treeGridTheme Grid theme 값\n */\nexport const getTreeGridBodyCellSx = (\n treeGridTheme: OwpResolvedGridThemeConfigType,\n) => ({\n ...getTreeGridCellBaseSx(treeGridTheme),\n backgroundColor: treeGridTheme.row.backgroundColor,\n borderBottom: `1px solid ${TREEGRID_TABLE_BODY_BORDER_COLOR}`,\n borderLeft: 0,\n borderRight: `1px solid ${TREEGRID_TABLE_BODY_BORDER_COLOR}`,\n color: treeGridTheme.body.color,\n fontSize: treeGridTheme.cell.fontSize,\n padding: '7px 10px 6px',\n});\n\n/**\n * TreeGrid body row 상태 스타일 매핑\n * @param treeGridTheme Grid theme 값\n * @param options hover, selected 여부\n */\nexport const getTreeGridBodyRowSx = (\n treeGridTheme: OwpResolvedGridThemeConfigType,\n options?: {\n canHover?: boolean;\n selected?: boolean;\n },\n) => {\n const defaultBackgroundColor = options?.selected\n ? treeGridTheme.state.selectedRowBackgroundColor\n : treeGridTheme.row.backgroundColor;\n const hoverBackgroundColor = options?.selected\n ? treeGridTheme.state.selectedRowBackgroundColor\n : treeGridTheme.state.hoverRowBackgroundColor;\n\n return {\n '& > td': {\n backgroundColor: defaultBackgroundColor,\n },\n ...(options?.canHover && {\n '&:hover > td': {\n backgroundColor: hoverBackgroundColor,\n },\n }),\n '&.Mui-selected > td': {\n backgroundColor: treeGridTheme.state.selectedRowBackgroundColor,\n },\n '&.Mui-selected:hover > td': {\n backgroundColor: treeGridTheme.state.selectedRowBackgroundColor,\n },\n '&:focus-within > td': {\n backgroundColor: treeGridTheme.state.focusedRowBackgroundColor,\n },\n '& > td:focus-within': {\n backgroundColor: treeGridTheme.state.focusedCellBackgroundColor,\n },\n };\n};\n"],"names":["TREEGRID_TABLE_HEADER_BORDER_COLOR","TREEGRID_TABLE_BODY_BORDER_COLOR","getTreeGridContainerSx","__name","treeGridTheme","getTreeGridTypographySx","fontSize","fontWeight","TREEGRID_FONT_FAMILY_STACK","getTreeGridCellBaseSx","getTreeGridHeaderCellSx","getTreeGridBodyCellSx","getTreeGridBodyRowSx","options","defaultBackgroundColor","hoverBackgroundColor"],"mappings":";;;AAGO,MAAMA,IAAqC,WACrCC,IAAmC,WAMnCC,IAAyB,gBAAAC,EAAA,CACpCC,OACI;AAAA,EACJ,iBAAiBA,EAAc,KAAK;AAAA,EACpC,OAAOA,EAAc,KAAK;AAC5B,IALsC,2BAYzBC,IAA0B,gBAAAF,EAAA,CACrCG,GACAC,IAA8B,cAC1B;AAAA,EACJ,YAAYC;AAAA,EACZ,UAAAF;AAAA,EACA,YAAAC;AAAA,EACA,YAAY;AACd,IARuC,4BAc1BE,IAAwB,gBAAAN,EAAA,CAACC,OAAmD;AAAA,EACvF,GAAGC,EAAwBD,EAAc,KAAK,QAAQ;AAAA,EACtD,WAAW;AAAA,EACX,UAAU;AAAA,EACV,cAAc;AAAA,EACd,eAAe;AAAA,EACf,YAAY;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