@owp/core 2.5.21 → 2.5.23

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 (87) hide show
  1. package/dayjs.d.ts +4 -0
  2. package/dayjs.js +2 -0
  3. package/dist/_virtual/isBetween.js +8 -0
  4. package/dist/_virtual/isBetween.js.map +1 -0
  5. package/dist/_virtual/isBetween2.js +5 -0
  6. package/dist/_virtual/isBetween2.js.map +1 -0
  7. package/dist/components/OwpMrtTable/OwpMrtTable.js +21 -21
  8. package/dist/components/OwpMrtTable/OwpMrtTable.js.map +1 -1
  9. package/dist/components/OwpPageContent/OwpPageContent.js +20 -19
  10. package/dist/components/OwpPageContent/OwpPageContent.js.map +1 -1
  11. package/dist/components/OwpPicker/OwpDatePicker.js +31 -32
  12. package/dist/components/OwpPicker/OwpDatePicker.js.map +1 -1
  13. package/dist/components/OwpPicker/OwpDateRangePicker.js +21 -21
  14. package/dist/components/OwpPicker/OwpDateRangePicker.js.map +1 -1
  15. package/dist/components/OwpPicker/OwpTimePicker.js +29 -30
  16. package/dist/components/OwpPicker/OwpTimePicker.js.map +1 -1
  17. package/dist/components/OwpPicker/OwpWeekDatePicker.js +28 -29
  18. package/dist/components/OwpPicker/OwpWeekDatePicker.js.map +1 -1
  19. package/dist/components/OwpPicker/OwpYearRangePicker.js +1 -1
  20. package/dist/components/OwpPicker/OwpYearRangePicker.js.map +1 -1
  21. package/dist/components/OwpPicker/internal/DatePickerInput.js +5 -5
  22. package/dist/components/OwpPicker/internal/DatePickerInput.js.map +1 -1
  23. package/dist/components/OwpSection/OwpSection.js +118 -111
  24. package/dist/components/OwpSection/OwpSection.js.map +1 -1
  25. package/dist/components/OwpTable/OwpDataTable.js +13 -12
  26. package/dist/components/OwpTable/OwpDataTable.js.map +1 -1
  27. package/dist/components/OwpTable/OwpFieldTable.js +82 -99
  28. package/dist/components/OwpTable/OwpFieldTable.js.map +1 -1
  29. package/dist/components/OwpTable/OwpTable.js +56 -55
  30. package/dist/components/OwpTable/OwpTable.js.map +1 -1
  31. package/dist/components/OwpTable/internal/OwpTableBase.js +84 -58
  32. package/dist/components/OwpTable/internal/OwpTableBase.js.map +1 -1
  33. package/dist/components/OwpTable/internal/defaultTableStyle.js +6 -7
  34. package/dist/components/OwpTable/internal/defaultTableStyle.js.map +1 -1
  35. package/dist/components/OwpTable/utils/tableSx.js +16 -6
  36. package/dist/components/OwpTable/utils/tableSx.js.map +1 -1
  37. package/dist/components/OwpTreeGrid/OwpTreeGrid.js +104 -103
  38. package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
  39. package/dist/components/OwpTreeGrid/internal/hooks/useOwpTreeGridDatePickerEditor.js +21 -22
  40. package/dist/components/OwpTreeGrid/internal/hooks/useOwpTreeGridDatePickerEditor.js.map +1 -1
  41. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js +253 -252
  42. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js.map +1 -1
  43. package/dist/constants/table.js +5 -0
  44. package/dist/constants/table.js.map +1 -0
  45. package/dist/constants.js +25 -23
  46. package/dist/constants.js.map +1 -1
  47. package/dist/dayjs.js +18 -0
  48. package/dist/dayjs.js.map +1 -0
  49. package/dist/features/themePreview/components/ThemePreviewCanvas.js +22 -22
  50. package/dist/features/themePreview/components/ThemePreviewCanvas.js.map +1 -1
  51. package/dist/features/themePreview/hooks/useThemePreview.js +16 -16
  52. package/dist/features/themePreview/hooks/useThemePreview.js.map +1 -1
  53. package/dist/hooks/{useInitCommonCodes.js → internal/useInitCommonCodes.js} +6 -6
  54. package/dist/hooks/internal/useInitCommonCodes.js.map +1 -0
  55. package/dist/hooks/internal/useMinimumVisibleState.js +31 -0
  56. package/dist/hooks/internal/useMinimumVisibleState.js.map +1 -0
  57. package/dist/hooks/useInitApp.js +17 -14
  58. package/dist/hooks/useInitApp.js.map +1 -1
  59. package/dist/hooks.js +49 -51
  60. package/dist/hooks.js.map +1 -1
  61. package/dist/node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/plugin/isBetween.js +23 -0
  62. package/dist/node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/plugin/isBetween.js.map +1 -0
  63. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/constants.js +1 -1
  64. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/constants.js +1 -1
  65. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/constants.js +1 -1
  66. package/dist/types/components/OwpPicker/OwpTimePicker.d.ts +1 -1
  67. package/dist/types/components/OwpSection/OwpSection.d.ts +9 -3
  68. package/dist/types/components/OwpTable/internal/defaultTableStyle.d.ts +0 -1
  69. package/dist/types/components/OwpTable/utils/tableSx.d.ts +15 -0
  70. package/dist/types/constants/index.d.ts +1 -0
  71. package/dist/types/constants/table.d.ts +1 -0
  72. package/dist/types/dayjs.d.ts +18 -0
  73. package/dist/types/hooks/index.d.ts +0 -1
  74. package/dist/types/hooks/internal/useMinimumVisibleState.d.ts +7 -0
  75. package/dist/types/utils/dayjsBrowser.d.ts +1 -7
  76. package/dist/types/utils/formatDateToYmd.d.ts +1 -1
  77. package/dist/utils/formatDateToYmd.js +3 -3
  78. package/dist/utils/formatDateToYmd.js.map +1 -1
  79. package/dist/utils/treeGridExportExcelUtil.js +1 -1
  80. package/dist/utils/treeGridExportExcelUtil.js.map +1 -1
  81. package/dist/utils/zipUtil.js +3 -3
  82. package/dist/utils/zipUtil.js.map +1 -1
  83. package/package.json +3 -1
  84. package/dist/hooks/useInitCommonCodes.js.map +0 -1
  85. package/dist/utils/dayjsBrowser.js +0 -16
  86. package/dist/utils/dayjsBrowser.js.map +0 -1
  87. /package/dist/types/hooks/{useInitCommonCodes.d.ts → internal/useInitCommonCodes.d.ts} +0 -0
@@ -1,102 +1,103 @@
1
- var M = Object.defineProperty;
2
- var i = (e, o) => M(e, "name", { value: o, configurable: !0 });
3
- import { jsxs as U, jsx as n } 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 { resolveOwpTableTheme as k } from "../../constants/tableTheme.js";
5
- import { useGetCurrentSettings as A } from "../../hooks/useOwpSettings.js";
6
- import { clsx as E } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
7
- import q from "@mui/material/TableBody";
8
- import B from "@mui/material/TableCell";
9
- import z from "@mui/material/TableHead";
10
- import { useMemo as b } from "react";
11
- import { getDefaultTableHeaderCellSx as F, defaultStyledTableTheme as I } from "./internal/defaultTableStyle.js";
12
- import { OwpTableBaseRow as y, OwpTableBase as J } from "./internal/OwpTableBase.js";
13
- import { OwpTableTotalCount as Q } from "./internal/OwpTableTotalCount.js";
14
- import { mergeSx as O } from "./utils/tableSx.js";
15
- import { isArray as v } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isArray.js";
1
+ var G = Object.defineProperty;
2
+ var c = (e, o) => G(e, "name", { value: o, configurable: !0 });
3
+ import { jsxs as M, jsx as m } 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 { resolveOwpTableTheme as K } from "../../constants/tableTheme.js";
5
+ import { useGetCurrentSettings as N } from "../../hooks/useOwpSettings.js";
6
+ import { clsx as U } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
7
+ import k from "@mui/material/Box";
8
+ import W from "@mui/material/TableBody";
9
+ import $ from "@mui/material/TableCell";
10
+ import q from "@mui/material/TableHead";
11
+ import { useMemo as f } from "react";
12
+ import { getDefaultTableHeaderCellSx as z, defaultStyledTableTheme as F } from "./internal/defaultTableStyle.js";
13
+ import { OwpTableBaseRow as O, OwpTableBase as I } from "./internal/OwpTableBase.js";
14
+ import { OwpTableTotalCount as J } from "./internal/OwpTableTotalCount.js";
15
+ import { mergeSx as y, getTableHelperTextRowSx as Q } from "./utils/tableSx.js";
16
+ import { isArray as L } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isArray.js";
16
17
  import { isEmpty as V } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js";
17
- const R = /* @__PURE__ */ i((e) => e ? Object.keys(e).filter((o) => !o.includes("Span")) : [], "getTableColumnKeys"), j = /* @__PURE__ */ i((e, o) => e[`${o}Sx`] ?? {}, "getTableCellSx"), G = /* @__PURE__ */ i((e, o, c) => e[`${o}${c}`] ?? void 0, "getTableCellSpan"), H = {
18
+ const R = /* @__PURE__ */ c((e) => e ? Object.keys(e).filter((o) => !o.includes("Span")) : [], "getTableColumnKeys"), E = /* @__PURE__ */ c((e, o) => e[`${o}Sx`] ?? {}, "getTableCellSx"), _ = /* @__PURE__ */ c((e, o, i) => e[`${o}${i}`] ?? void 0, "getTableCellSpan"), v = {
18
19
  dark: "rgba(241,245,249,.12)",
19
20
  light: "#e2e8f0"
20
- };
21
- function no({
21
+ }, A = "owp-table-cell-content", X = Q(A);
22
+ function fo({
22
23
  canTotalCountRow: e = !1,
23
24
  headers: o,
24
- rows: c,
25
+ rows: i,
25
26
  totalCount: d,
26
27
  ...t
27
28
  }) {
28
- var w, C, T, h, g, x, S, $;
29
- const l = A(), s = ((T = (C = (w = l == null ? void 0 : l.theme) == null ? void 0 : w.main) == null ? void 0 : C.palette) == null ? void 0 : T.mode) === "dark" ? H.dark : H.light, p = b(
29
+ var u, w, C, x, S, h, g, B;
30
+ const l = N(), s = ((C = (w = (u = l == null ? void 0 : l.theme) == null ? void 0 : u.main) == null ? void 0 : w.palette) == null ? void 0 : C.mode) === "dark" ? v.dark : v.light, p = f(
30
31
  () => {
31
32
  var r, a;
32
- return t.tableTheme ?? k((a = (r = l == null ? void 0 : l.theme) == null ? void 0 : r.main) == null ? void 0 : a.table, {
33
- ...I,
33
+ return t.tableTheme ?? K((a = (r = l == null ? void 0 : l.theme) == null ? void 0 : r.main) == null ? void 0 : a.table, {
34
+ ...F,
34
35
  borderColor: s
35
36
  });
36
37
  },
37
38
  [l, s, t.tableTheme]
38
- ), K = b(
39
- () => v(o) ? o : V(o) ? [] : [o],
39
+ ), H = f(
40
+ () => L(o) ? o : V(o) ? [] : [o],
40
41
  [o]
41
- ), L = b(
42
- () => R(v(o) ? o[0] : o),
42
+ ), j = f(
43
+ () => R(L(o) ? o[0] : o),
43
44
  [o]
44
- ), u = (S = (x = (g = (h = l == null ? void 0 : l.theme) == null ? void 0 : h.main) == null ? void 0 : g.table) == null ? void 0 : x.row) == null ? void 0 : S.backgroundColor;
45
- return /* @__PURE__ */ U(
46
- J,
45
+ ), T = (g = (h = (S = (x = l == null ? void 0 : l.theme) == null ? void 0 : x.main) == null ? void 0 : S.table) == null ? void 0 : h.row) == null ? void 0 : g.backgroundColor;
46
+ return /* @__PURE__ */ M(
47
+ I,
47
48
  {
48
49
  ...t,
49
50
  containerProps: {
50
51
  ...t.containerProps,
51
- sx: O(
52
- !t.canUseTreeGridStyle && u && { backgroundColor: u },
53
- ($ = t.containerProps) == null ? void 0 : $.sx
52
+ sx: y(
53
+ !t.canUseTreeGridStyle && T && { backgroundColor: T },
54
+ (B = t.containerProps) == null ? void 0 : B.sx
54
55
  )
55
56
  },
56
- footerSlot: e ? /* @__PURE__ */ n(
57
- Q,
57
+ footerSlot: e ? /* @__PURE__ */ m(
58
+ J,
58
59
  {
59
60
  borderColor: p.borderColor,
60
- totalCount: typeof d > "u" ? c.length : d
61
+ totalCount: typeof d > "u" ? i.length : d
61
62
  }
62
63
  ) : void 0,
63
- className: E(t.tableLayout && "w-full", t.className),
64
+ className: U(t.tableLayout && "w-full", t.className),
64
65
  tableTheme: p,
65
66
  children: [
66
- /* @__PURE__ */ n(z, { children: K.map((r, a) => /* @__PURE__ */ n(y, { children: R(r).map((m) => /* @__PURE__ */ n(
67
- B,
67
+ /* @__PURE__ */ m(q, { children: H.map((r, a) => /* @__PURE__ */ m(O, { children: R(r).map((n) => /* @__PURE__ */ m(
68
+ $,
68
69
  {
69
70
  className: "whitespace-pre-wrap",
70
- sx: O(
71
- !t.canUseTreeGridStyle && F(p),
72
- j(r, m)
71
+ sx: y(
72
+ !t.canUseTreeGridStyle && z(p),
73
+ E(r, n)
73
74
  ),
74
- colSpan: G(r, m, "ColSpan"),
75
- rowSpan: G(r, m, "RowSpan"),
75
+ colSpan: _(r, n, "ColSpan"),
76
+ rowSpan: _(r, n, "RowSpan"),
76
77
  align: "center",
77
- children: r[m]
78
+ children: r[n]
78
79
  },
79
- `table-header-${a}-${m}`
80
+ `table-header-${a}-${n}`
80
81
  )) }, `table-header-${a}`)) }),
81
- /* @__PURE__ */ n(q, { children: c.map((r, a) => {
82
- const m = r;
83
- return /* @__PURE__ */ n(y, { children: L.map((f) => /* @__PURE__ */ n(
84
- B,
82
+ /* @__PURE__ */ m(W, { children: i.map((r, a) => {
83
+ const n = r;
84
+ return /* @__PURE__ */ m(O, { sx: X, children: j.map((b) => /* @__PURE__ */ m(
85
+ $,
85
86
  {
86
87
  className: "whitespace-pre-wrap h-64",
87
- sx: j(m, f),
88
+ sx: E(n, b),
88
89
  align: "center",
89
- children: m[f]
90
+ children: /* @__PURE__ */ m(k, { className: A, children: n[b] })
90
91
  },
91
- `table-row-cell-${a}-${f}`
92
+ `table-row-cell-${a}-${b}`
92
93
  )) }, `table-row-${a}`);
93
94
  }) })
94
95
  ]
95
96
  }
96
97
  );
97
98
  }
98
- i(no, "OwpTable");
99
+ c(fo, "OwpTable");
99
100
  export {
100
- no as OwpTable
101
+ fo as OwpTable
101
102
  };
102
103
  //# sourceMappingURL=OwpTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OwpTable.js","sources":["../../../src/components/OwpTable/OwpTable.tsx"],"sourcesContent":["import { resolveOwpTableTheme } from '@/constants/tableTheme';\nimport { useGetCurrentSettings } from '@/hooks/useOwpSettings';\nimport type { SxProps, Theme } from '@mui/material';\nimport clsx from 'clsx';\nimport TableBody from '@mui/material/TableBody';\nimport TableCell from '@mui/material/TableCell';\nimport TableHead from '@mui/material/TableHead';\nimport { isArray, isEmpty } from 'es-toolkit/compat';\nimport { type ReactNode, useMemo } from 'react';\nimport {\n defaultStyledTableTheme,\n getDefaultTableHeaderCellSx,\n} from './internal/defaultTableStyle';\nimport {\n OwpTableBase,\n type OwpTableBaseProps,\n OwpTableBaseRow,\n} from './internal/OwpTableBase';\nimport { OwpTableTotalCount } from './internal/OwpTableTotalCount';\nimport { mergeSx } from './utils/tableSx';\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 defaultTableBorderColorByMode = {\n dark: 'rgba(241,245,249,.12)',\n light: '#e2e8f0',\n} as const;\n\ninterface OwpTableProps<T> extends Omit<OwpTableBaseProps, '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 canTableRadiusZero 테이블 radius 0 사용 여부\n * @param canUseTableRadius 테이블 radius 사용 여부\n * @param canUseTreeGridStyle TreeGrid 스타일 사용 여부\n * @param headers headers 값\n * @param rows 행 데이터 목록\n * @param tableBorderRadius 테이블 radius 값\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 currentSettings = useGetCurrentSettings();\n const defaultTableBorderColor =\n currentSettings?.theme?.main?.palette?.mode === 'dark'\n ? defaultTableBorderColorByMode.dark\n : defaultTableBorderColorByMode.light;\n const tableTheme = useMemo(\n () =>\n restTableProps.tableTheme ??\n resolveOwpTableTheme(currentSettings?.theme?.main?.table, {\n ...defaultStyledTableTheme,\n borderColor: defaultTableBorderColor,\n }),\n [currentSettings, defaultTableBorderColor, restTableProps.tableTheme],\n );\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 const tableBackgroundColor = currentSettings?.theme?.main?.table?.row?.backgroundColor;\n\n return (\n <OwpTableBase\n {...restTableProps}\n containerProps={{\n ...restTableProps.containerProps,\n sx: mergeSx(\n !restTableProps.canUseTreeGridStyle &&\n tableBackgroundColor && { backgroundColor: tableBackgroundColor },\n restTableProps.containerProps?.sx,\n ),\n }}\n footerSlot={\n canTotalCountRow ? (\n <OwpTableTotalCount\n borderColor={tableTheme.borderColor}\n totalCount={typeof totalCount === 'undefined' ? rows.length : totalCount}\n />\n ) : undefined\n }\n className={clsx(restTableProps.tableLayout && 'w-full', restTableProps.className)}\n tableTheme={tableTheme}\n >\n <TableHead>\n {resolvedHeaderRows.map((headerData, index) => (\n <OwpTableBaseRow key={`table-header-${index}`}>\n {getTableColumnKeys(headerData).map((keyName) => (\n <TableCell\n key={`table-header-${index}-${keyName}`}\n className=\"whitespace-pre-wrap\"\n sx={mergeSx(\n !restTableProps.canUseTreeGridStyle && getDefaultTableHeaderCellSx(tableTheme),\n getTableCellSx(headerData, keyName),\n )}\n colSpan={getTableCellSpan(headerData, keyName, 'ColSpan')}\n rowSpan={getTableCellSpan(headerData, keyName, 'RowSpan')}\n align=\"center\"\n >\n {headerData[keyName]}\n </TableCell>\n ))}\n </OwpTableBaseRow>\n ))}\n </TableHead>\n <TableBody>\n {rows.map((row, index) => {\n const currentRow = row as OwpTableRowData;\n\n return (\n <OwpTableBaseRow 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 </OwpTableBaseRow>\n );\n })}\n </TableBody>\n </OwpTableBase>\n );\n}\n"],"names":["getTableColumnKeys","__name","row","keyName","getTableCellSx","getTableCellSpan","spanType","defaultTableBorderColorByMode","OwpTable","canTotalCountRow","headers","rows","totalCount","restTableProps","currentSettings","useGetCurrentSettings","defaultTableBorderColor","_c","_b","_a","tableTheme","useMemo","resolveOwpTableTheme","defaultStyledTableTheme","resolvedHeaderRows","isArray","isEmpty","commonKeyListData","tableBackgroundColor","_g","_f","_e","_d","jsxs","OwpTableBase","mergeSx","_h","jsx","OwpTableTotalCount","clsx","TableHead","headerData","index","OwpTableBaseRow","TableCell","getDefaultTableHeaderCellSx","TableBody","currentRow"],"mappings":";;;;;;;;;;;;;;;;AAyBA,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,qBA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,cACtC,OAAM;AAAA,cAEL,YAAWA,CAAO;AAAA,YAAA;AAAA,YALd,kBAAkBuC,CAAK,IAAIvC,CAAO;AAAA,UAAA,CAO1C,KAVmB,aAAauC,CAAK,EAWxC;AAAA,QAEJ,CAAC,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAhGgBzC,EAAAO,IAAA;"}
1
+ {"version":3,"file":"OwpTable.js","sources":["../../../src/components/OwpTable/OwpTable.tsx"],"sourcesContent":["import { resolveOwpTableTheme } from '@/constants/tableTheme';\nimport { useGetCurrentSettings } from '@/hooks/useOwpSettings';\nimport type { SxProps, Theme } from '@mui/material';\nimport clsx from 'clsx';\nimport Box from '@mui/material/Box';\nimport TableBody from '@mui/material/TableBody';\nimport TableCell from '@mui/material/TableCell';\nimport TableHead from '@mui/material/TableHead';\nimport { isArray, isEmpty } from 'es-toolkit/compat';\nimport { type ReactNode, useMemo } from 'react';\nimport { defaultStyledTableTheme, getDefaultTableHeaderCellSx } from './internal/defaultTableStyle';\nimport { OwpTableBase, type OwpTableBaseProps, OwpTableBaseRow } from './internal/OwpTableBase';\nimport { OwpTableTotalCount } from './internal/OwpTableTotalCount';\nimport { getTableHelperTextRowSx, mergeSx } from './utils/tableSx';\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 defaultTableBorderColorByMode = {\n dark: 'rgba(241,245,249,.12)',\n light: '#e2e8f0',\n} as const;\n\nconst OWP_TABLE_CELL_CONTENT_CLASS_NAME = 'owp-table-cell-content';\nconst tableRowSx = getTableHelperTextRowSx(OWP_TABLE_CELL_CONTENT_CLASS_NAME);\n\ninterface OwpTableProps<T> extends Omit<OwpTableBaseProps, '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 canTableRadiusZero 테이블 radius 0 사용 여부\n * @param canUseTableRadius 테이블 radius 사용 여부\n * @param canUseTreeGridStyle TreeGrid 스타일 사용 여부\n * @param headers headers 값\n * @param rows 행 데이터 목록\n * @param tableBorderRadius 테이블 radius 값\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 currentSettings = useGetCurrentSettings();\n const defaultTableBorderColor =\n currentSettings?.theme?.main?.palette?.mode === 'dark'\n ? defaultTableBorderColorByMode.dark\n : defaultTableBorderColorByMode.light;\n const tableTheme = useMemo(\n () =>\n restTableProps.tableTheme ??\n resolveOwpTableTheme(currentSettings?.theme?.main?.table, {\n ...defaultStyledTableTheme,\n borderColor: defaultTableBorderColor,\n }),\n [currentSettings, defaultTableBorderColor, restTableProps.tableTheme],\n );\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 const tableBackgroundColor = currentSettings?.theme?.main?.table?.row?.backgroundColor;\n\n return (\n <OwpTableBase\n {...restTableProps}\n containerProps={{\n ...restTableProps.containerProps,\n sx: mergeSx(\n !restTableProps.canUseTreeGridStyle &&\n tableBackgroundColor && { backgroundColor: tableBackgroundColor },\n restTableProps.containerProps?.sx,\n ),\n }}\n footerSlot={\n canTotalCountRow ? (\n <OwpTableTotalCount\n borderColor={tableTheme.borderColor}\n totalCount={typeof totalCount === 'undefined' ? rows.length : totalCount}\n />\n ) : undefined\n }\n className={clsx(restTableProps.tableLayout && 'w-full', restTableProps.className)}\n tableTheme={tableTheme}\n >\n <TableHead>\n {resolvedHeaderRows.map((headerData, index) => (\n <OwpTableBaseRow key={`table-header-${index}`}>\n {getTableColumnKeys(headerData).map((keyName) => (\n <TableCell\n key={`table-header-${index}-${keyName}`}\n className=\"whitespace-pre-wrap\"\n sx={mergeSx(\n !restTableProps.canUseTreeGridStyle && getDefaultTableHeaderCellSx(tableTheme),\n getTableCellSx(headerData, keyName),\n )}\n colSpan={getTableCellSpan(headerData, keyName, 'ColSpan')}\n rowSpan={getTableCellSpan(headerData, keyName, 'RowSpan')}\n align=\"center\"\n >\n {headerData[keyName]}\n </TableCell>\n ))}\n </OwpTableBaseRow>\n ))}\n </TableHead>\n <TableBody>\n {rows.map((row, index) => {\n const currentRow = row as OwpTableRowData;\n\n return (\n <OwpTableBaseRow key={`table-row-${index}`} sx={tableRowSx}>\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 <Box className={OWP_TABLE_CELL_CONTENT_CLASS_NAME}>\n {currentRow[keyName] as ReactNode}\n </Box>\n </TableCell>\n ))}\n </OwpTableBaseRow>\n );\n })}\n </TableBody>\n </OwpTableBase>\n );\n}\n"],"names":["getTableColumnKeys","__name","row","keyName","getTableCellSx","getTableCellSpan","spanType","defaultTableBorderColorByMode","OWP_TABLE_CELL_CONTENT_CLASS_NAME","tableRowSx","getTableHelperTextRowSx","OwpTable","canTotalCountRow","headers","rows","totalCount","restTableProps","currentSettings","useGetCurrentSettings","defaultTableBorderColor","_c","_b","_a","tableTheme","useMemo","resolveOwpTableTheme","defaultStyledTableTheme","resolvedHeaderRows","isArray","isEmpty","commonKeyListData","tableBackgroundColor","_g","_f","_e","_d","jsxs","OwpTableBase","mergeSx","_h","jsx","OwpTableTotalCount","clsx","TableHead","headerData","index","OwpTableBaseRow","TableCell","getDefaultTableHeaderCellSx","TableBody","currentRow","Box"],"mappings":";;;;;;;;;;;;;;;;;AAmBA,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,IAAgC;AAAA,EACpC,MAAM;AAAA,EACN,OAAO;AACT,GAEMC,IAAoC,0BACpCC,IAAaC,EAAwBF,CAAiC;AAoBrE,SAASG,GAAY;AAAA,EAC1B,kBAAAC,IAAmB;AAAA,EACnB,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,GAAqB;;AACnB,QAAMC,IAAkBC,EAAA,GAClBC,MACJC,KAAAC,KAAAC,IAAAL,KAAA,gBAAAA,EAAiB,UAAjB,gBAAAK,EAAwB,SAAxB,gBAAAD,EAA8B,YAA9B,gBAAAD,EAAuC,UAAS,SAC5Cb,EAA8B,OAC9BA,EAA8B,OAC9BgB,IAAaC;AAAA,IACjB,MAAA;;AACE,aAAAR,EAAe,cACfS,GAAqBJ,KAAAC,IAAAL,KAAA,gBAAAA,EAAiB,UAAjB,gBAAAK,EAAwB,SAAxB,gBAAAD,EAA8B,OAAO;AAAA,QACxD,GAAGK;AAAA,QACH,aAAaP;AAAA,MAAA,CACd;AAAA;AAAA,IACH,CAACF,GAAiBE,GA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Ae,uBAAuBgC,EAA4BzB,CAAU;AAAA,cAC7EnB,EAAewC,GAAYzC,CAAO;AAAA,YAAA;AAAA,YAEpC,SAASE,EAAiBuC,GAAYzC,GAAS,SAAS;AAAA,YACxD,SAASE,EAAiBuC,GAAYzC,GAAS,SAAS;AAAA,YACxD,OAAM;AAAA,YAEL,YAAWA,CAAO;AAAA,UAAA;AAAA,UAVd,gBAAgB0C,CAAK,IAAI1C,CAAO;AAAA,QAAA,CAYxC,EAAA,GAfmB,gBAAgB0C,CAAK,EAgB3C,CACD,EAAA,CACH;AAAA,0BACCI,GAAA,EACE,UAAAnC,EAAK,IAAI,CAACZ,GAAK2C,MAAU;AACxB,gBAAMK,IAAahD;AAEnB,mCACG4C,GAAA,EAA2C,IAAIrC,GAC7C,UAAAqB,EAAkB,IAAI,CAAC3B,MACtB,gBAAAqC;AAAA,YAACO;AAAA,YAAA;AAAA,cAEC,WAAU;AAAA,cACV,IAAI3C,EAAe8C,GAAY/C,CAAO;AAAA,cACtC,OAAM;AAAA,cAEN,4BAACgD,GAAA,EAAI,WAAW3C,GACb,UAAA0C,EAAW/C,CAAO,EAAA,CACrB;AAAA,YAAA;AAAA,YAPK,kBAAkB0C,CAAK,IAAI1C,CAAO;AAAA,UAAA,CAS1C,KAZmB,aAAa0C,CAAK,EAaxC;AAAA,QAEJ,CAAC,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAlGgB5C,EAAAU,IAAA;"}
@@ -1,78 +1,80 @@
1
- var y = Object.defineProperty;
2
- var f = (o, r) => y(o, "name", { value: r, configurable: !0 });
3
- import { jsxs as B, jsx as w, Fragment as G } 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";
1
+ var G = Object.defineProperty;
2
+ var s = (o, a) => G(o, "name", { value: a, configurable: !0 });
3
+ import { jsxs as B, jsx as w, Fragment as F } 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 { resolveOwpGridTheme as g } from "../../../constants/gridTheme.js";
5
- import { resolveOwpTableTheme as F } from "../../../constants/tableTheme.js";
6
- import { getTreeGridFontFaceStyles as I } from "../../../constants/treeGrid.js";
5
+ import { resolveOwpTableTheme as I } from "../../../constants/tableTheme.js";
6
+ import { DEFAULT_TABLE_RADIUS as O } from "../../../constants/table.js";
7
+ import { getTreeGridFontFaceStyles as $ } from "../../../constants/treeGrid.js";
7
8
  import { useGetCurrentSettings as k } from "../../../hooks/useOwpSettings.js";
8
9
  import { styled as n } from "@mui/material";
9
- import { clsx as $ } from "../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
10
+ import { clsx as H } from "../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
10
11
  import j from "@mui/material/GlobalStyles";
11
- import H from "@mui/material/Paper";
12
- import N from "@mui/material/Table";
12
+ import N from "@mui/material/Paper";
13
+ import K from "@mui/material/Table";
13
14
  import S from "@mui/material/TableContainer";
14
- import K from "@mui/material/TableRow";
15
- import { useMemo as E } from "react";
16
- import { getTreeGridContainerSx as V, getTreeGridBodyRowSx as Y, TREEGRID_TABLE_BODY_BORDER_COLOR as Z, getTreeGridBodyCellSx as q, TREEGRID_TABLE_HEADER_BORDER_COLOR as z, getTreeGridHeaderCellSx as J, getTreeGridCellBaseSx as Q } from "./treeGridTableStyle.js";
17
- import { defaultStyledTableTheme as M, DEFAULT_TABLE_RADIUS as _, getDefaultTableCellSx as W, getDefaultTableHeaderCellSx as X, DEFAULT_TABLE_HEADER_BACKGROUND_COLOR as c } from "./defaultTableStyle.js";
15
+ import V from "@mui/material/TableRow";
16
+ import { useMemo as y } from "react";
17
+ import { TREEGRID_TABLE_BODY_BORDER_COLOR as _, getTreeGridContainerSx as Y, getTreeGridBodyRowSx as Z, getTreeGridBodyCellSx as q, TREEGRID_TABLE_HEADER_BORDER_COLOR as z, getTreeGridHeaderCellSx as J, getTreeGridCellBaseSx as Q } from "./treeGridTableStyle.js";
18
+ import { defaultStyledTableTheme as D, getDefaultTableCellSx as W, getDefaultTableHeaderCellSx as X, DEFAULT_TABLE_HEADER_BACKGROUND_COLOR as c } from "./defaultTableStyle.js";
18
19
  import { mergeSx as P, toTableRadiusCssValue as U } from "../utils/tableSx.js";
19
20
  const oo = {
20
21
  border: 0,
21
22
  borderRadius: 0,
22
23
  overflow: "visible"
23
24
  }, eo = {
24
- borderRadius: _
25
+ borderRadius: O
25
26
  }, ro = {
26
27
  borderRadius: 0
27
- }, O = {
28
+ }, E = {
28
29
  dark: "rgba(241,245,249,.12)",
29
30
  light: "#e2e8f0"
30
- }, Oo = /* @__PURE__ */ f(({
31
+ }, Eo = /* @__PURE__ */ s(({
31
32
  canBodyFullHeight: o,
32
- canTableRadiusZero: r = !1,
33
- canUseTableRadius: m = !1,
33
+ canTableRadiusZero: a = !1,
34
+ canUseTableRadius: r = !1,
34
35
  canUseTreeGridStyle: t,
35
- children: d,
36
- className: a,
36
+ children: m,
37
+ className: i,
37
38
  containerProps: l,
38
- footerSlot: D,
39
- tableTheme: s,
40
- tableLayout: T,
41
- tableBorderRadius: L = _,
39
+ footerSlot: f,
40
+ tableTheme: T,
41
+ tableLayout: u,
42
+ tableBorderRadius: L = O,
42
43
  ...v
43
44
  }) => {
44
- var p, C, x;
45
- const e = k(), R = ((x = (C = (p = e == null ? void 0 : e.theme) == null ? void 0 : p.main) == null ? void 0 : C.palette) == null ? void 0 : x.mode) === "dark" ? O.dark : O.light, u = E(
45
+ var C, M, x;
46
+ const e = k(), R = ((x = (M = (C = e == null ? void 0 : e.theme) == null ? void 0 : C.main) == null ? void 0 : M.palette) == null ? void 0 : x.mode) === "dark" ? E.dark : E.light, p = y(
46
47
  () => {
47
- var i, b;
48
- return g((b = (i = e == null ? void 0 : e.theme) == null ? void 0 : i.main) == null ? void 0 : b.grid);
48
+ var d, b;
49
+ return g((b = (d = e == null ? void 0 : e.theme) == null ? void 0 : d.main) == null ? void 0 : b.grid);
49
50
  },
50
51
  [e]
51
- ), h = E(
52
+ ), h = y(
52
53
  () => {
53
- var i, b;
54
- return s ?? F((b = (i = e == null ? void 0 : e.theme) == null ? void 0 : i.main) == null ? void 0 : b.table, {
55
- ...M,
54
+ var d, b;
55
+ return T ?? I((b = (d = e == null ? void 0 : e.theme) == null ? void 0 : d.main) == null ? void 0 : b.table, {
56
+ ...D,
56
57
  borderColor: R
57
58
  });
58
59
  },
59
- [e, R, s]
60
- ), A = r ? ro : t && m ? {
60
+ [e, R, T]
61
+ ), A = a ? ro : t && r ? {
62
+ border: `1px solid ${_}`,
61
63
  borderRadius: U(L),
62
64
  overflow: "hidden"
63
65
  } : t ? void 0 : eo;
64
- return /* @__PURE__ */ B(G, { children: [
65
- t && /* @__PURE__ */ w(j, { styles: I() }),
66
+ return /* @__PURE__ */ B(F, { children: [
67
+ t && /* @__PURE__ */ w(j, { styles: $() }),
66
68
  /* @__PURE__ */ B(
67
69
  S,
68
70
  {
69
- component: H,
71
+ component: N,
70
72
  variant: "outlined",
71
73
  ...l,
72
74
  sx: P(
73
75
  !t && { borderColor: h.borderColor },
74
76
  t && oo,
75
- t && V(u),
77
+ t && Y(p),
76
78
  A,
77
79
  o && { height: "100%" },
78
80
  l == null ? void 0 : l.sx
@@ -83,27 +85,34 @@ const oo = {
83
85
  {
84
86
  ...v,
85
87
  canBodyFullHeight: o,
88
+ canUseTableRadius: r,
86
89
  canUseTreeGridStyle: t,
87
90
  tableTheme: h,
88
- treeGridTheme: u,
89
- className: $(
91
+ treeGridTheme: p,
92
+ className: H(
90
93
  o && "h-full",
91
- T === "fixed" ? "table-fixed" : T === "auto" ? "table-auto" : "",
92
- a
94
+ u === "fixed" ? "table-fixed" : u === "auto" ? "table-auto" : "",
95
+ i
93
96
  ),
94
- children: d
97
+ children: m
95
98
  }
96
99
  ),
97
- D
100
+ f
98
101
  ]
99
102
  }
100
103
  )
101
104
  ] });
102
- }, "OwpTableBase"), to = n(N, {
103
- shouldForwardProp: /* @__PURE__ */ f((o) => o !== "canBodyFullHeight" && o !== "canUseTreeGridStyle" && o !== "tableTheme" && o !== "treeGridTheme", "shouldForwardProp")
105
+ }, "OwpTableBase"), to = n(K, {
106
+ shouldForwardProp: /* @__PURE__ */ s((o) => o !== "canBodyFullHeight" && o !== "canUseTableRadius" && o !== "canUseTreeGridStyle" && o !== "tableTheme" && o !== "treeGridTheme", "shouldForwardProp")
104
107
  })(
105
- ({ canBodyFullHeight: o, canUseTreeGridStyle: r, tableTheme: m, treeGridTheme: t }) => {
106
- const d = t ?? g(), a = m ?? M, l = `1px solid ${a.borderColor}`;
108
+ ({
109
+ canBodyFullHeight: o,
110
+ canUseTableRadius: a,
111
+ canUseTreeGridStyle: r,
112
+ tableTheme: t,
113
+ treeGridTheme: m
114
+ }) => {
115
+ const i = m ?? g(), l = t ?? D, f = `1px solid ${l.borderColor}`, T = r && a;
107
116
  return {
108
117
  ...o && {
109
118
  height: "100%"
@@ -117,40 +126,40 @@ const oo = {
117
126
  }
118
127
  },
119
128
  "& .MuiTableCell-root": r ? {
120
- ...Q(d)
129
+ ...Q(i)
121
130
  } : void 0,
122
131
  ...!r && {
123
132
  "& .MuiTableRow-root > .MuiTableCell-root + .MuiTableCell-root": {
124
- borderLeft: l
133
+ borderLeft: f
125
134
  },
126
135
  "& .MuiTableRow-root > .MuiTableCell-root:not(:last-of-type)": {
127
- borderRight: l
136
+ borderRight: f
128
137
  },
129
138
  "& tbody > .MuiTableRow-root:last-of-type > .MuiTableCell-root": {
130
139
  borderBottom: "none"
131
140
  }
132
141
  },
133
142
  "& th": r ? {
134
- ...J(d),
143
+ ...J(i),
135
144
  "&:first-of-type": {
136
145
  borderLeft: `1px solid ${z}`
137
146
  }
138
147
  } : {
139
148
  ...X(
140
- a,
149
+ l,
141
150
  c
142
151
  )
143
152
  },
144
153
  "& td": r ? {
145
- ...q(d),
154
+ ...q(i),
146
155
  "&:first-of-type": {
147
- borderLeft: `1px solid ${Z}`
156
+ borderLeft: `1px solid ${_}`
148
157
  }
149
158
  } : {
150
- ...W(a)
159
+ ...W(l)
151
160
  },
152
161
  ...r && {
153
- "& tbody > .MuiTableRow-root": Y(d)
162
+ "& tbody > .MuiTableRow-root": Z(i)
154
163
  },
155
164
  ...r && {
156
165
  "& tbody > tr:first-of-type > th:first-of-type": {
@@ -159,12 +168,29 @@ const oo = {
159
168
  "& tbody > tr:first-of-type > td:last-of-type": {
160
169
  borderTopRightRadius: "inherit"
161
170
  }
171
+ },
172
+ ...T && {
173
+ "& .MuiTableHead-root:first-of-type > .MuiTableRow-root:first-of-type > .MuiTableCell-root": {
174
+ borderTop: 0
175
+ },
176
+ "& .MuiTableBody-root:first-of-type > .MuiTableRow-root:first-of-type > .MuiTableCell-root": {
177
+ borderTop: 0
178
+ },
179
+ "& .MuiTableRow-root > .MuiTableCell-root:first-of-type": {
180
+ borderLeft: 0
181
+ },
182
+ "& .MuiTableRow-root > .MuiTableCell-root:last-of-type": {
183
+ borderRight: 0
184
+ },
185
+ "& .MuiTableBody-root > .MuiTableRow-root:last-of-type > .MuiTableCell-root": {
186
+ borderBottom: 0
187
+ }
162
188
  }
163
189
  };
164
190
  }
165
- ), go = n(K)({});
191
+ ), go = n(V)({});
166
192
  export {
167
- Oo as OwpTableBase,
193
+ Eo as OwpTableBase,
168
194
  go as OwpTableBaseRow
169
195
  };
170
196
  //# sourceMappingURL=OwpTableBase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OwpTableBase.js","sources":["../../../../src/components/OwpTable/internal/OwpTableBase.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 { styled } 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 TableContainer, { type TableContainerProps } from '@mui/material/TableContainer';\nimport TableRow from '@mui/material/TableRow';\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 './treeGridTableStyle';\nimport {\n DEFAULT_TABLE_HEADER_BACKGROUND_COLOR,\n DEFAULT_TABLE_RADIUS,\n defaultStyledTableTheme,\n getDefaultTableCellSx,\n getDefaultTableHeaderCellSx,\n} from './defaultTableStyle';\nimport { mergeSx, toTableRadiusCssValue } from '../utils/tableSx';\n\nconst treeGridContainerSx = {\n border: 0,\n borderRadius: 0,\n overflow: 'visible',\n} as const;\nconst defaultTableRadiusSx = {\n borderRadius: DEFAULT_TABLE_RADIUS,\n} as const;\nconst tableRadiusZeroSx = {\n borderRadius: 0,\n} as const;\nconst defaultTableBorderColorByMode = {\n dark: 'rgba(241,245,249,.12)',\n light: '#e2e8f0',\n} as const;\n\nexport interface OwpTableBaseProps extends TableProps {\n canBodyFullHeight?: boolean;\n canTableRadiusZero?: boolean;\n canUseTableRadius?: boolean;\n canUseTreeGridStyle?: boolean;\n containerProps?: TableContainerProps;\n footerSlot?: ReactNode;\n tableTheme?: OwpResolvedTableThemeConfigType;\n tableLayout?: 'auto' | 'fixed';\n tableBorderRadius?: string | number;\n treeGridTheme?: OwpResolvedGridThemeConfigType;\n title?: string;\n children: ReactNode;\n}\n\ntype OwpTableBaseInnerProps = Pick<\n OwpTableBaseProps,\n 'canBodyFullHeight' | 'canUseTreeGridStyle' | 'tableTheme' | 'treeGridTheme'\n>;\n\n/**\n * OWP Table 기반 컨테이너\n * @param canBodyFullHeight body full height 사용 여부\n * @param canTableRadiusZero 테이블 radius 0 사용 여부\n * @param canUseTableRadius 테이블 radius 사용 여부\n * @param canUseTreeGridStyle TreeGrid 스타일 사용 여부\n * @param children 하위 콘텐츠\n * @param containerProps containerProps props\n * @param footerSlot footer 영역\n * @param tableLayout tableLayout 값\n * @param tableBorderRadius 테이블 radius 값\n */\nexport const OwpTableBase = ({\n canBodyFullHeight,\n canTableRadiusZero = false,\n canUseTableRadius = false,\n canUseTreeGridStyle,\n children,\n className,\n containerProps,\n footerSlot,\n tableTheme: tableThemeProp,\n tableLayout,\n tableBorderRadius = DEFAULT_TABLE_RADIUS,\n ...tableProps\n}: OwpTableBaseProps) => {\n const currentSettings = useGetCurrentSettings();\n const defaultTableBorderColor =\n currentSettings?.theme?.main?.palette?.mode === 'dark'\n ? defaultTableBorderColorByMode.dark\n : defaultTableBorderColorByMode.light;\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, {\n ...defaultStyledTableTheme,\n borderColor: defaultTableBorderColor,\n }),\n [currentSettings, defaultTableBorderColor, tableThemeProp],\n );\n const tableContainerRadiusSx = canTableRadiusZero\n ? tableRadiusZeroSx\n : canUseTreeGridStyle && canUseTableRadius\n ? {\n borderRadius: toTableRadiusCssValue(tableBorderRadius),\n overflow: 'hidden',\n }\n : !canUseTreeGridStyle\n ? defaultTableRadiusSx\n : undefined;\n\n return (\n <>\n {canUseTreeGridStyle && <GlobalStyles styles={getTreeGridFontFaceStyles()} />}\n <TableContainer\n component={Paper}\n variant=\"outlined\"\n {...containerProps}\n sx={mergeSx(\n !canUseTreeGridStyle && { borderColor: tableTheme.borderColor },\n canUseTreeGridStyle && treeGridContainerSx,\n canUseTreeGridStyle && getTreeGridContainerSx(treeGridTheme),\n tableContainerRadiusSx,\n canBodyFullHeight && { height: '100%' },\n containerProps?.sx,\n )}\n >\n <OwpTableBaseInner\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 </OwpTableBaseInner>\n {footerSlot}\n </TableContainer>\n </>\n );\n};\n\n/** OWP Table 기반 table element */\nconst OwpTableBaseInner = styled(Table, {\n shouldForwardProp: (prop) =>\n prop !== 'canBodyFullHeight' &&\n prop !== 'canUseTreeGridStyle' &&\n prop !== 'tableTheme' &&\n prop !== 'treeGridTheme',\n})<OwpTableBaseInnerProps>(\n ({ canBodyFullHeight, canUseTreeGridStyle, tableTheme, treeGridTheme }) => {\n const resolvedTreeGridTheme = treeGridTheme ?? resolveOwpGridTheme();\n const resolvedTableTheme = tableTheme ?? defaultStyledTableTheme;\n const defaultTableBorder = `1px solid ${resolvedTableTheme.borderColor}`;\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 : undefined,\n ...(!canUseTreeGridStyle && {\n '& .MuiTableRow-root > .MuiTableCell-root + .MuiTableCell-root': {\n borderLeft: defaultTableBorder,\n },\n '& .MuiTableRow-root > .MuiTableCell-root:not(:last-of-type)': {\n borderRight: defaultTableBorder,\n },\n '& tbody > .MuiTableRow-root:last-of-type > .MuiTableCell-root': {\n borderBottom: 'none',\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 ...getDefaultTableHeaderCellSx(\n resolvedTableTheme,\n DEFAULT_TABLE_HEADER_BACKGROUND_COLOR,\n ),\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 ...getDefaultTableCellSx(resolvedTableTheme),\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\n/** OWP Table 기반 row */\nexport const OwpTableBaseRow = styled(TableRow)({});\n"],"names":["treeGridContainerSx","defaultTableRadiusSx","DEFAULT_TABLE_RADIUS","tableRadiusZeroSx","defaultTableBorderColorByMode","OwpTableBase","__name","canBodyFullHeight","canTableRadiusZero","canUseTableRadius","canUseTreeGridStyle","children","className","containerProps","footerSlot","tableThemeProp","tableLayout","tableBorderRadius","tableProps","currentSettings","useGetCurrentSettings","defaultTableBorderColor","_c","_b","_a","treeGridTheme","useMemo","resolveOwpGridTheme","tableTheme","resolveOwpTableTheme","defaultStyledTableTheme","tableContainerRadiusSx","toTableRadiusCssValue","jsxs","Fragment","jsx","GlobalStyles","getTreeGridFontFaceStyles","TableContainer","Paper","mergeSx","getTreeGridContainerSx","OwpTableBaseInner","clsx","styled","Table","prop","resolvedTreeGridTheme","resolvedTableTheme","defaultTableBorder","getTreeGridCellBaseSx","getTreeGridHeaderCellSx","TREEGRID_TABLE_HEADER_BORDER_COLOR","getDefaultTableHeaderCellSx","DEFAULT_TABLE_HEADER_BAC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AAA;AAAA,QAEvB,gDAAgD;AAAA,UAC9C,sBAAsB;AAAA,QAAA;AAAA,MACxB;AAAA,IACF;AAAA,EAEJ;AACF,GAGaiD,KAAkBf,EAAOgB,CAAQ,EAAE,CAAA,CAAE;"}
1
+ {"version":3,"file":"OwpTableBase.js","sources":["../../../../src/components/OwpTable/internal/OwpTableBase.tsx"],"sourcesContent":["import {\n resolveOwpGridTheme,\n type OwpResolvedGridThemeConfigType,\n} from '@/constants/gridTheme';\nimport {\n resolveOwpTableTheme,\n type OwpResolvedTableThemeConfigType,\n} from '@/constants/tableTheme';\nimport { DEFAULT_TABLE_RADIUS } from '@/constants/table';\nimport { getTreeGridFontFaceStyles } from '@/constants/treeGrid';\nimport { useGetCurrentSettings } from '@/hooks/useOwpSettings';\nimport { styled } 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 TableContainer, { type TableContainerProps } from '@mui/material/TableContainer';\nimport TableRow from '@mui/material/TableRow';\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 './treeGridTableStyle';\nimport {\n DEFAULT_TABLE_HEADER_BACKGROUND_COLOR,\n defaultStyledTableTheme,\n getDefaultTableCellSx,\n getDefaultTableHeaderCellSx,\n} from './defaultTableStyle';\nimport { mergeSx, toTableRadiusCssValue } from '../utils/tableSx';\n\nconst treeGridContainerSx = {\n border: 0,\n borderRadius: 0,\n overflow: 'visible',\n} as const;\nconst defaultTableRadiusSx = {\n borderRadius: DEFAULT_TABLE_RADIUS,\n} as const;\nconst tableRadiusZeroSx = {\n borderRadius: 0,\n} as const;\nconst defaultTableBorderColorByMode = {\n dark: 'rgba(241,245,249,.12)',\n light: '#e2e8f0',\n} as const;\n\nexport interface OwpTableBaseProps extends TableProps {\n canBodyFullHeight?: boolean;\n canTableRadiusZero?: boolean;\n canUseTableRadius?: boolean;\n canUseTreeGridStyle?: boolean;\n containerProps?: TableContainerProps;\n footerSlot?: ReactNode;\n tableTheme?: OwpResolvedTableThemeConfigType;\n tableLayout?: 'auto' | 'fixed';\n tableBorderRadius?: string | number;\n treeGridTheme?: OwpResolvedGridThemeConfigType;\n title?: string;\n children: ReactNode;\n}\n\ntype OwpTableBaseInnerProps = Pick<\n OwpTableBaseProps,\n | 'canBodyFullHeight'\n | 'canUseTableRadius'\n | 'canUseTreeGridStyle'\n | 'tableTheme'\n | 'treeGridTheme'\n>;\n\n/**\n * OWP Table 기반 컨테이너\n * @param canBodyFullHeight body full height 사용 여부\n * @param canTableRadiusZero 테이블 radius 0 사용 여부\n * @param canUseTableRadius 테이블 radius 사용 여부\n * @param canUseTreeGridStyle TreeGrid 스타일 사용 여부\n * @param children 하위 콘텐츠\n * @param containerProps containerProps props\n * @param footerSlot footer 영역\n * @param tableLayout tableLayout 값\n * @param tableBorderRadius 테이블 radius 값\n */\nexport const OwpTableBase = ({\n canBodyFullHeight,\n canTableRadiusZero = false,\n canUseTableRadius = false,\n canUseTreeGridStyle,\n children,\n className,\n containerProps,\n footerSlot,\n tableTheme: tableThemeProp,\n tableLayout,\n tableBorderRadius = DEFAULT_TABLE_RADIUS,\n ...tableProps\n}: OwpTableBaseProps) => {\n const currentSettings = useGetCurrentSettings();\n const defaultTableBorderColor =\n currentSettings?.theme?.main?.palette?.mode === 'dark'\n ? defaultTableBorderColorByMode.dark\n : defaultTableBorderColorByMode.light;\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, {\n ...defaultStyledTableTheme,\n borderColor: defaultTableBorderColor,\n }),\n [currentSettings, defaultTableBorderColor, tableThemeProp],\n );\n const tableContainerRadiusSx = canTableRadiusZero\n ? tableRadiusZeroSx\n : canUseTreeGridStyle && canUseTableRadius\n ? {\n border: `1px solid ${TREEGRID_TABLE_BODY_BORDER_COLOR}`,\n borderRadius: toTableRadiusCssValue(tableBorderRadius),\n overflow: 'hidden',\n }\n : !canUseTreeGridStyle\n ? defaultTableRadiusSx\n : undefined;\n\n return (\n <>\n {canUseTreeGridStyle && <GlobalStyles styles={getTreeGridFontFaceStyles()} />}\n <TableContainer\n component={Paper}\n variant=\"outlined\"\n {...containerProps}\n sx={mergeSx(\n !canUseTreeGridStyle && { borderColor: tableTheme.borderColor },\n canUseTreeGridStyle && treeGridContainerSx,\n canUseTreeGridStyle && getTreeGridContainerSx(treeGridTheme),\n tableContainerRadiusSx,\n canBodyFullHeight && { height: '100%' },\n containerProps?.sx,\n )}\n >\n <OwpTableBaseInner\n {...tableProps}\n canBodyFullHeight={canBodyFullHeight}\n canUseTableRadius={canUseTableRadius}\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 </OwpTableBaseInner>\n {footerSlot}\n </TableContainer>\n </>\n );\n};\n\n/** OWP Table 기반 table element */\nconst OwpTableBaseInner = styled(Table, {\n shouldForwardProp: (prop) =>\n prop !== 'canBodyFullHeight' &&\n prop !== 'canUseTableRadius' &&\n prop !== 'canUseTreeGridStyle' &&\n prop !== 'tableTheme' &&\n prop !== 'treeGridTheme',\n})<OwpTableBaseInnerProps>(\n ({\n canBodyFullHeight,\n canUseTableRadius,\n canUseTreeGridStyle,\n tableTheme,\n treeGridTheme,\n }) => {\n const resolvedTreeGridTheme = treeGridTheme ?? resolveOwpGridTheme();\n const resolvedTableTheme = tableTheme ?? defaultStyledTableTheme;\n const defaultTableBorder = `1px solid ${resolvedTableTheme.borderColor}`;\n const shouldUseTreeGridRadius = canUseTreeGridStyle && canUseTableRadius;\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 : undefined,\n ...(!canUseTreeGridStyle && {\n '& .MuiTableRow-root > .MuiTableCell-root + .MuiTableCell-root': {\n borderLeft: defaultTableBorder,\n },\n '& .MuiTableRow-root > .MuiTableCell-root:not(:last-of-type)': {\n borderRight: defaultTableBorder,\n },\n '& tbody > .MuiTableRow-root:last-of-type > .MuiTableCell-root': {\n borderBottom: 'none',\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 ...getDefaultTableHeaderCellSx(\n resolvedTableTheme,\n DEFAULT_TABLE_HEADER_BACKGROUND_COLOR,\n ),\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 ...getDefaultTableCellSx(resolvedTableTheme),\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 ...(shouldUseTreeGridRadius && {\n '& .MuiTableHead-root:first-of-type > .MuiTableRow-root:first-of-type > .MuiTableCell-root':\n {\n borderTop: 0,\n },\n '& .MuiTableBody-root:first-of-type > .MuiTableRow-root:first-of-type > .MuiTableCell-root':\n {\n borderTop: 0,\n },\n '& .MuiTableRow-root > .MuiTableCell-root:first-of-type': {\n borderLeft: 0,\n },\n '& .MuiTableRow-root > .MuiTableCell-root:last-of-type': {\n borderRight: 0,\n },\n '& .MuiTableBody-root > .MuiTableRow-root:last-of-type > .MuiTableCell-root': {\n borderBottom: 0,\n },\n }),\n };\n },\n);\n\n/** OWP Table 기반 row */\nexport const OwpTableBaseRow = styled(TableRow)({});\n"],"names":["treeGridContainerSx","defaultTableRadiusSx","DEFAULT_TABLE_RADIUS","tableRadiusZeroSx","defaultTableBorderColorByMode","OwpTableBase","__name","canBodyFullHeight","canTableRadiusZero","canUseTableRadius","canUseTreeGridStyle","children","className","containerProps","footerSlot","tableThemeProp","tableLayout","tableBorderRadius","tableProps","currentSettings","useGetCurrentSettings","defaultTableBorderColor","_c","_b","_a","treeGridTheme","useMemo","resolveOwpGridTheme","tableTheme","resolveOwpTableTheme","defaultStyledTableTheme","tableContainerRadiusSx","TREEGRID_TABLE_BODY_BORDER_COLOR","toTableRadiusCssValue","jsxs","Fragment","jsx","GlobalStyles","getTreeGridFontFaceStyles","TableContainer","Paper","mergeSx","getTreeGridContainerSx","OwpTableBaseInner","clsx","styled","Table","prop","resolvedTreeGridTheme","resolvedTableTheme","defaultTableBorder","shouldUseTreeGridRadius","getTreeGridCellBaseSx","getTreeGridHeaderCellSx","TREEGRID_TABLE_HEADER_BORDER_COLOR","getDefaultTableHeaderCellSx","DEFAULT_TABLE_HEADER_BACKGROUND_COLOR","getTreeGridBodyCellSx","getDefaultTableCellSx","getTreeGridBodyRowSx","OwpTableBaseRow","TableRow"],"mappings":";;;;;;;;;;;;;;;;;;;AAoCA,MAAMA,KAAsB;AAAA,EAC1B,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,UAAU;AACZ,GACMC,KAAuB;A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AAA,QAC7B,6FACE;AAAA,UACE,WAAW;AAAA,QAAA;AAAA,QAEf,6FACE;AAAA,UACE,WAAW;AAAA,QAAA;AAAA,QAEf,0DAA0D;AAAA,UACxD,YAAY;AAAA,QAAA;AAAA,QAEd,yDAAyD;AAAA,UACvD,aAAa;AAAA,QAAA;AAAA,QAEf,8EAA8E;AAAA,UAC5E,cAAc;AAAA,QAAA;AAAA,MAChB;AAAA,IACF;AAAA,EAEJ;AACF,GAGaS,KAAkBf,EAAOgB,CAAQ,EAAE,CAAA,CAAE;"}
@@ -1,6 +1,6 @@
1
1
  var l = Object.defineProperty;
2
2
  var r = (o, e) => l(o, "name", { value: e, configurable: !0 });
3
- const n = "7px 10px", i = ".8rem", a = "#f5f5f5", d = {
3
+ const n = "7px 10px", a = "#f5f5f5", i = {
4
4
  borderColor: "#e2e8f0",
5
5
  header: {
6
6
  backgroundColor: "",
@@ -17,13 +17,13 @@ const n = "7px 10px", i = ".8rem", a = "#f5f5f5", d = {
17
17
  borderBottom: `1px solid ${o.borderColor}`,
18
18
  borderLeft: "none",
19
19
  borderRight: "none"
20
- }), "getDefaultTableCellBaseSx"), f = /* @__PURE__ */ r((o) => ({
20
+ }), "getDefaultTableCellBaseSx"), d = /* @__PURE__ */ r((o) => ({
21
21
  ...t(o),
22
22
  ...o.cell.backgroundColor && {
23
23
  backgroundColor: o.cell.backgroundColor
24
24
  },
25
25
  fontSize: o.cell.fontSize
26
- }), "getDefaultTableCellSx"), S = /* @__PURE__ */ r((o, e = a) => ({
26
+ }), "getDefaultTableCellSx"), f = /* @__PURE__ */ r((o, e = a) => ({
27
27
  ...t(o),
28
28
  backgroundColor: o.header.backgroundColor || e,
29
29
  color: o.header.color,
@@ -49,11 +49,10 @@ const n = "7px 10px", i = ".8rem", a = "#f5f5f5", d = {
49
49
  };
50
50
  export {
51
51
  a as DEFAULT_TABLE_HEADER_BACKGROUND_COLOR,
52
- i as DEFAULT_TABLE_RADIUS,
53
- d as defaultStyledTableTheme,
52
+ i as defaultStyledTableTheme,
54
53
  u as defaultTableSortLabelSx,
55
- f as getDefaultTableCellSx,
56
- S as getDefaultTableHeaderCellSx,
54
+ d as getDefaultTableCellSx,
55
+ f as getDefaultTableHeaderCellSx,
57
56
  g as getDefaultTableHeaderLabelSx
58
57
  };
59
58
  //# sourceMappingURL=defaultTableStyle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaultTableStyle.js","sources":["../../../../src/components/OwpTable/internal/defaultTableStyle.ts"],"sourcesContent":["import type { OwpResolvedTableThemeConfigType } from '@/constants/tableTheme';\n\nconst DEFAULT_TABLE_CELL_PADDING = '7px 10px';\n\nexport const DEFAULT_TABLE_RADIUS = '.8rem';\nexport const DEFAULT_TABLE_HEADER_BACKGROUND_COLOR = '#f5f5f5';\n\nexport const defaultStyledTableTheme = {\n borderColor: '#e2e8f0',\n header: {\n backgroundColor: '',\n color: 'inherit',\n fontSize: '1.7rem',\n fontWeight: 600,\n },\n cell: {\n backgroundColor: '',\n fontSize: '1.7rem',\n },\n} satisfies OwpResolvedTableThemeConfigType;\n\n/** 기본 table cell 공통 sx */\nconst getDefaultTableCellBaseSx = (tableTheme: OwpResolvedTableThemeConfigType) =>\n ({\n padding: DEFAULT_TABLE_CELL_PADDING,\n borderBottom: `1px solid ${tableTheme.borderColor}`,\n borderLeft: 'none',\n borderRight: 'none',\n }) as const;\n\n/** 기본 table cell sx */\nexport const getDefaultTableCellSx = (tableTheme: OwpResolvedTableThemeConfigType) =>\n ({\n ...getDefaultTableCellBaseSx(tableTheme),\n ...(tableTheme.cell.backgroundColor && {\n backgroundColor: tableTheme.cell.backgroundColor,\n }),\n fontSize: tableTheme.cell.fontSize,\n }) as const;\n\n/** 기본 table header cell sx */\nexport const getDefaultTableHeaderCellSx = (\n tableTheme: OwpResolvedTableThemeConfigType,\n fallbackBackgroundColor: string = DEFAULT_TABLE_HEADER_BACKGROUND_COLOR,\n) =>\n ({\n ...getDefaultTableCellBaseSx(tableTheme),\n backgroundColor: tableTheme.header.backgroundColor || fallbackBackgroundColor,\n color: tableTheme.header.color,\n fontSize: tableTheme.header.fontSize,\n fontWeight: tableTheme.header.fontWeight,\n }) as const;\n\n/** 기본 table header label sx */\nexport const getDefaultTableHeaderLabelSx = (tableTheme: OwpResolvedTableThemeConfigType) =>\n ({\n color: tableTheme.header.color,\n fontSize: tableTheme.header.fontSize,\n fontWeight: tableTheme.header.fontWeight,\n }) as const;\n\nexport const defaultTableSortLabelSx = {\n '&.MuiTableSortLabel-root': {\n color: 'inherit',\n },\n '&.MuiTableSortLabel-root:hover': {\n color: 'inherit',\n },\n '&.Mui-active': {\n color: 'inherit',\n },\n '& .MuiTableSortLabel-icon': {\n color: 'currentColor !important',\n },\n} as const;\n"],"names":["DEFAULT_TABLE_CELL_PADDING","DEFAULT_TABLE_RADIUS","DEFAULT_TABLE_HEADER_BACKGROUND_COLOR","defaultStyledTableTheme","getDefaultTableCellBaseSx","__name","tableTheme","getDefaultTableCellSx","getDefaultTableHeaderCellSx","fallbackBackgroundColor","getDefaultTableHeaderLabelSx","defaultTableSortLabelSx"],"mappings":";;AAEA,MAAMA,IAA6B,YAEtBC,IAAuB,SACvBC,IAAwC,WAExCC,IAA0B;AAAA,EACrC,aAAa;AAAA,EACb,QAAQ;AAAA,IACN,iBAAiB;AAAA,IACjB,OAAO;AAAA,IACP,UAAU;AAAA,IACV,YAAY;AAAA,EAAA;AAAA,EAEd,MAAM;AAAA,IACJ,iBAAiB;AAAA,IACjB,UAAU;AAAA,EAAA;AAEd,GAGMC,IAA4B,gBAAAC,EAAA,CAACC,OAChC;AAAA,EACC,SAASN;AAAA,EACT,cAAc,aAAaM,EAAW,WAAW;AAAA,EACjD,YAAY;AAAA,EACZ,aAAa;AACf,IANgC,8BASrBC,IAAwB,gBAAAF,EAAA,CAACC,OACnC;AAAA,EACC,GAAGF,EAA0BE,CAAU;AAAA,EACvC,GAAIA,EAAW,KAAK,mBAAmB;AAAA,IACrC,iBAAiBA,EAAW,KAAK;AAAA,EAAA;AAAA,EAEnC,UAAUA,EAAW,KAAK;AAC5B,IAPmC,0BAUxBE,IAA8B,gBAAAH,EAAA,CACzCC,GACAG,IAAkCP,OAEjC;AAAA,EACC,GAAGE,EAA0BE,CAAU;AAAA,EACvC,iBAAiBA,EAAW,OAAO,mBAAmBG;AAAA,EACtD,OAAOH,EAAW,OAAO;AAAA,EACzB,UAAUA,EAAW,OAAO;AAAA,EAC5B,YAAYA,EAAW,OAAO;AAChC,IAVyC,gCAa9BI,IAA+B,gBAAAL,EAAA,CAACC,OAC1C;AAAA,EACC,OAAOA,EAAW,OAAO;AAAA,EACzB,UAAUA,EAAW,OAAO;AAAA,EAC5B,YAAYA,EAAW,OAAO;AAChC,IAL0C,iCAO/BK,IAA0B;AAAA,EACrC,4BAA4B;AAAA,IAC1B,OAAO;AAAA,EAAA;AAAA,EAET,kCAAkC;AAAA,IAChC,OAAO;AAAA,EAAA;AAAA,EAET,gBAAgB;AAAA,IACd,OAAO;AAAA,EAAA;AAAA,EAET,6BAA6B;AAAA,IAC3B,OAAO;AAAA,EAAA;AAEX;"}
1
+ {"version":3,"file":"defaultTableStyle.js","sources":["../../../../src/components/OwpTable/internal/defaultTableStyle.ts"],"sourcesContent":["import type { OwpResolvedTableThemeConfigType } from '@/constants/tableTheme';\n\nconst DEFAULT_TABLE_CELL_PADDING = '7px 10px';\n\nexport const DEFAULT_TABLE_HEADER_BACKGROUND_COLOR = '#f5f5f5';\n\nexport const defaultStyledTableTheme = {\n borderColor: '#e2e8f0',\n header: {\n backgroundColor: '',\n color: 'inherit',\n fontSize: '1.7rem',\n fontWeight: 600,\n },\n cell: {\n backgroundColor: '',\n fontSize: '1.7rem',\n },\n} satisfies OwpResolvedTableThemeConfigType;\n\n/** 기본 table cell 공통 sx */\nconst getDefaultTableCellBaseSx = (tableTheme: OwpResolvedTableThemeConfigType) =>\n ({\n padding: DEFAULT_TABLE_CELL_PADDING,\n borderBottom: `1px solid ${tableTheme.borderColor}`,\n borderLeft: 'none',\n borderRight: 'none',\n }) as const;\n\n/** 기본 table cell sx */\nexport const getDefaultTableCellSx = (tableTheme: OwpResolvedTableThemeConfigType) =>\n ({\n ...getDefaultTableCellBaseSx(tableTheme),\n ...(tableTheme.cell.backgroundColor && {\n backgroundColor: tableTheme.cell.backgroundColor,\n }),\n fontSize: tableTheme.cell.fontSize,\n }) as const;\n\n/** 기본 table header cell sx */\nexport const getDefaultTableHeaderCellSx = (\n tableTheme: OwpResolvedTableThemeConfigType,\n fallbackBackgroundColor: string = DEFAULT_TABLE_HEADER_BACKGROUND_COLOR,\n) =>\n ({\n ...getDefaultTableCellBaseSx(tableTheme),\n backgroundColor: tableTheme.header.backgroundColor || fallbackBackgroundColor,\n color: tableTheme.header.color,\n fontSize: tableTheme.header.fontSize,\n fontWeight: tableTheme.header.fontWeight,\n }) as const;\n\n/** 기본 table header label sx */\nexport const getDefaultTableHeaderLabelSx = (tableTheme: OwpResolvedTableThemeConfigType) =>\n ({\n color: tableTheme.header.color,\n fontSize: tableTheme.header.fontSize,\n fontWeight: tableTheme.header.fontWeight,\n }) as const;\n\nexport const defaultTableSortLabelSx = {\n '&.MuiTableSortLabel-root': {\n color: 'inherit',\n },\n '&.MuiTableSortLabel-root:hover': {\n color: 'inherit',\n },\n '&.Mui-active': {\n color: 'inherit',\n },\n '& .MuiTableSortLabel-icon': {\n color: 'currentColor !important',\n },\n} as const;\n"],"names":["DEFAULT_TABLE_CELL_PADDING","DEFAULT_TABLE_HEADER_BACKGROUND_COLOR","defaultStyledTableTheme","getDefaultTableCellBaseSx","__name","tableTheme","getDefaultTableCellSx","getDefaultTableHeaderCellSx","fallbackBackgroundColor","getDefaultTableHeaderLabelSx","defaultTableSortLabelSx"],"mappings":";;AAEA,MAAMA,IAA6B,YAEtBC,IAAwC,WAExCC,IAA0B;AAAA,EACrC,aAAa;AAAA,EACb,QAAQ;AAAA,IACN,iBAAiB;AAAA,IACjB,OAAO;AAAA,IACP,UAAU;AAAA,IACV,YAAY;AAAA,EAAA;AAAA,EAEd,MAAM;AAAA,IACJ,iBAAiB;AAAA,IACjB,UAAU;AAAA,EAAA;AAEd,GAGMC,IAA4B,gBAAAC,EAAA,CAACC,OAChC;AAAA,EACC,SAASL;AAAA,EACT,cAAc,aAAaK,EAAW,WAAW;AAAA,EACjD,YAAY;AAAA,EACZ,aAAa;AACf,IANgC,8BASrBC,IAAwB,gBAAAF,EAAA,CAACC,OACnC;AAAA,EACC,GAAGF,EAA0BE,CAAU;AAAA,EACvC,GAAIA,EAAW,KAAK,mBAAmB;AAAA,IACrC,iBAAiBA,EAAW,KAAK;AAAA,EAAA;AAAA,EAEnC,UAAUA,EAAW,KAAK;AAC5B,IAPmC,0BAUxBE,IAA8B,gBAAAH,EAAA,CACzCC,GACAG,IAAkCP,OAEjC;AAAA,EACC,GAAGE,EAA0BE,CAAU;AAAA,EACvC,iBAAiBA,EAAW,OAAO,mBAAmBG;AAAA,EACtD,OAAOH,EAAW,OAAO;AAAA,EACzB,UAAUA,EAAW,OAAO;AAAA,EAC5B,YAAYA,EAAW,OAAO;AAChC,IAVyC,gCAa9BI,IAA+B,gBAAAL,EAAA,CAACC,OAC1C;AAAA,EACC,OAAOA,EAAW,OAAO;AAAA,EACzB,UAAUA,EAAW,OAAO;AAAA,EAC5B,YAAYA,EAAW,OAAO;AAChC,IAL0C,iCAO/BK,IAA0B;AAAA,EACrC,4BAA4B;AAAA,IAC1B,OAAO;AAAA,EAAA;AAAA,EAET,kCAAkC;AAAA,IAChC,OAAO;AAAA,EAAA;AAAA,EAET,gBAAgB;AAAA,IACd,OAAO;AAAA,EAAA;AAAA,EAET,6BAA6B;AAAA,IAC3B,OAAO;AAAA,EAAA;AAEX;"}
@@ -1,9 +1,19 @@
1
- var t = Object.defineProperty;
2
- var n = (r, e) => t(r, "name", { value: e, configurable: !0 });
3
- import { isArray as u } from "../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isArray.js";
4
- const p = /* @__PURE__ */ n((...r) => r.reduce((e, o) => o ? [...e, ...u(o) ? o : [o]] : e, []), "mergeSx"), f = /* @__PURE__ */ n((r) => typeof r == "number" ? `${r}px` : r, "toTableRadiusCssValue");
1
+ var p = Object.defineProperty;
2
+ var t = (r, e) => p(r, "name", { value: e, configurable: !0 });
3
+ import { isArray as i } from "../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isArray.js";
4
+ const n = "calc(0.75rem * 1.66 + 3px)", a = /* @__PURE__ */ t((...r) => r.reduce((e, o) => o ? [...e, ...i(o) ? o : [o]] : e, []), "mergeSx"), s = /* @__PURE__ */ t((r) => typeof r == "number" ? `${r}px` : r, "toTableRadiusCssValue"), u = /* @__PURE__ */ t((r) => ({
5
+ [`&:has(.MuiFormHelperText-root) .${r}::after`]: {
6
+ content: '""',
7
+ display: "block",
8
+ height: n
9
+ },
10
+ [`&:has(.MuiFormHelperText-root) .${r}:has(.MuiFormHelperText-root)::after`]: {
11
+ display: "none"
12
+ }
13
+ }), "getTableHelperTextRowSx");
5
14
  export {
6
- p as mergeSx,
7
- f as toTableRadiusCssValue
15
+ u as getTableHelperTextRowSx,
16
+ a as mergeSx,
17
+ s as toTableRadiusCssValue
8
18
  };
9
19
  //# sourceMappingURL=tableSx.js.map