@owp/core 2.5.3 → 2.5.5

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 (188) hide show
  1. package/dist/_virtual/index10.js +2 -2
  2. package/dist/_virtual/index12.js +2 -2
  3. package/dist/_virtual/index13.js +2 -2
  4. package/dist/_virtual/index14.js +2 -2
  5. package/dist/_virtual/index15.js +2 -2
  6. package/dist/_virtual/index16.js +4 -4
  7. package/dist/_virtual/index17.js +4 -4
  8. package/dist/_virtual/index18.js +4 -4
  9. package/dist/_virtual/index19.js +4 -4
  10. package/dist/_virtual/index5.js +2 -2
  11. package/dist/components/OwpMrtTable/OwpMrtTable.js +250 -258
  12. package/dist/components/OwpMrtTable/OwpMrtTable.js.map +1 -1
  13. package/dist/components/OwpPageSkeleton/OwpPageSkeleton.js +4 -4
  14. package/dist/components/OwpSnackbarContent/OwpSnackbarContent.js +166 -0
  15. package/dist/components/OwpSnackbarContent/OwpSnackbarContent.js.map +1 -0
  16. package/dist/components/OwpTable/OwpDataTable.js +321 -327
  17. package/dist/components/OwpTable/OwpDataTable.js.map +1 -1
  18. package/dist/components/OwpTable/OwpFieldTable.js +102 -58
  19. package/dist/components/OwpTable/OwpFieldTable.js.map +1 -1
  20. package/dist/components/OwpTable/OwpTable.js +158 -174
  21. package/dist/components/OwpTable/OwpTable.js.map +1 -1
  22. package/dist/components/OwpTable/internal/defaultTableStyle.js +50 -0
  23. package/dist/components/OwpTable/internal/defaultTableStyle.js.map +1 -0
  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 +200 -253
  27. package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
  28. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +183 -124
  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/configs/defaultConfig.js +67 -44
  33. package/dist/configs/defaultConfig.js.map +1 -1
  34. package/dist/constants/gridTheme.js +60 -10
  35. package/dist/constants/gridTheme.js.map +1 -1
  36. package/dist/constants/tableTheme.js +16 -0
  37. package/dist/constants/tableTheme.js.map +1 -0
  38. package/dist/constants/treeGrid.js +44 -26
  39. package/dist/constants/treeGrid.js.map +1 -1
  40. package/dist/constants.js +21 -20
  41. package/dist/contexts/OwpAppProvider.js.map +1 -1
  42. package/dist/contexts/OwpUiProvider.js +59 -38
  43. package/dist/contexts/OwpUiProvider.js.map +1 -1
  44. package/dist/features/themePreview/components/ThemePreviewCanvas.js +492 -0
  45. package/dist/features/themePreview/components/ThemePreviewCanvas.js.map +1 -0
  46. package/dist/features/themePreview/components/ThemePreviewCanvasSections.js +678 -0
  47. package/dist/features/themePreview/components/ThemePreviewCanvasSections.js.map +1 -0
  48. package/dist/features/themePreview/components/ThemePreviewColorField.js +301 -0
  49. package/dist/features/themePreview/components/ThemePreviewColorField.js.map +1 -0
  50. package/dist/features/themePreview/components/ThemePreviewControls.js +306 -0
  51. package/dist/features/themePreview/components/ThemePreviewControls.js.map +1 -0
  52. package/dist/features/themePreview/components/themePreviewCanvas.icons.js +17 -0
  53. package/dist/features/themePreview/components/themePreviewCanvas.icons.js.map +1 -0
  54. package/dist/features/themePreview/components/themePreviewCanvas.shared.js +296 -0
  55. package/dist/features/themePreview/components/themePreviewCanvas.shared.js.map +1 -0
  56. package/dist/features/themePreview/configs/grid.js +45 -0
  57. package/dist/features/themePreview/configs/grid.js.map +1 -0
  58. package/dist/features/themePreview/configs/presets.js +1106 -0
  59. package/dist/features/themePreview/configs/presets.js.map +1 -0
  60. package/dist/features/themePreview/configs/previewStorage.js +93 -0
  61. package/dist/features/themePreview/configs/previewStorage.js.map +1 -0
  62. package/dist/features/themePreview/configs/settings.js +148 -0
  63. package/dist/features/themePreview/configs/settings.js.map +1 -0
  64. package/dist/features/themePreview/configs/snackbar.js +39 -0
  65. package/dist/features/themePreview/configs/snackbar.js.map +1 -0
  66. package/dist/features/themePreview/configs/surface.js +10 -0
  67. package/dist/features/themePreview/configs/surface.js.map +1 -0
  68. package/dist/features/themePreview/configs/table.js +30 -0
  69. package/dist/features/themePreview/configs/table.js.map +1 -0
  70. package/dist/features/themePreview/defs/ThemePreviewGridDef.xml.js +43 -0
  71. package/dist/features/themePreview/defs/ThemePreviewGridDef.xml.js.map +1 -0
  72. package/dist/features/themePreview/defs/ThemePreviewReadonlyGridDef.xml.js +43 -0
  73. package/dist/features/themePreview/defs/ThemePreviewReadonlyGridDef.xml.js.map +1 -0
  74. package/dist/features/themePreview/dialogs/ThemePreviewDialog.js +429 -0
  75. package/dist/features/themePreview/dialogs/ThemePreviewDialog.js.map +1 -0
  76. package/dist/features/themePreview/hooks/useThemePreview.js +235 -0
  77. package/dist/features/themePreview/hooks/useThemePreview.js.map +1 -0
  78. package/dist/features/themePreview/utils/color.js +79 -0
  79. package/dist/features/themePreview/utils/color.js.map +1 -0
  80. package/dist/features/themePreview/utils/themePreviewDefinitions.js +526 -0
  81. package/dist/features/themePreview/utils/themePreviewDefinitions.js.map +1 -0
  82. package/dist/features/themePreview/utils/themePreviewExport.js +111 -0
  83. package/dist/features/themePreview/utils/themePreviewExport.js.map +1 -0
  84. package/dist/features/themePreview/utils/themePreviewSettings.js +211 -0
  85. package/dist/features/themePreview/utils/themePreviewSettings.js.map +1 -0
  86. package/dist/features/themePreview.js +75 -0
  87. package/dist/features/themePreview.js.map +1 -0
  88. package/dist/index.js +111 -110
  89. package/dist/layout/components/logo/Logo.js +49 -45
  90. package/dist/layout/components/logo/Logo.js.map +1 -1
  91. package/dist/layout/components/toggles/NavigationSearchToggle.js +3 -3
  92. package/dist/layout/components/toggles/ThemePreviewToggle.js +51 -0
  93. package/dist/layout/components/toggles/ThemePreviewToggle.js.map +1 -0
  94. package/dist/layout/components/toolbar/ToolbarLayout.js +13 -10
  95. package/dist/layout/components/toolbar/ToolbarLayout.js.map +1 -1
  96. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/CheckCircleOutline.js +9 -0
  97. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/CheckCircleOutline.js.map +1 -0
  98. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/DownloadOutlined.js +9 -0
  99. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/DownloadOutlined.js.map +1 -0
  100. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/ErrorOutline.js +9 -0
  101. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/ErrorOutline.js.map +1 -0
  102. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/InfoOutlined.js +9 -0
  103. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/InfoOutlined.js.map +1 -0
  104. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/KeyboardArrowUpRounded.js +9 -0
  105. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/KeyboardArrowUpRounded.js.map +1 -0
  106. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/MenuRounded.js +9 -0
  107. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/MenuRounded.js.map +1 -0
  108. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/NotificationsNoneOutlined.js +9 -0
  109. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/NotificationsNoneOutlined.js.map +1 -0
  110. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/PaletteOutlined.js +25 -0
  111. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/PaletteOutlined.js.map +1 -0
  112. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/RestoreOutlined.js +9 -0
  113. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/RestoreOutlined.js.map +1 -0
  114. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/SaveOutlined.js +9 -0
  115. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/SaveOutlined.js.map +1 -0
  116. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/SpaceDashboardOutlined.js +9 -0
  117. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/SpaceDashboardOutlined.js.map +1 -0
  118. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/UploadFileOutlined.js +9 -0
  119. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/UploadFileOutlined.js.map +1 -0
  120. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/WarningAmberRounded.js +9 -0
  121. package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/WarningAmberRounded.js.map +1 -0
  122. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
  123. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/index.js +1 -1
  124. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE39/index.js +1 -1
  125. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/index.js +1 -1
  126. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/index.js +1 -1
  127. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/GenericBarcode/index.js +1 -1
  128. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/constants.js +1 -1
  129. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/index.js +1 -1
  130. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/MSI/index.js +1 -1
  131. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/codabar/index.js +1 -1
  132. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/pharmacode/index.js +1 -1
  133. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/renderers/index.js +1 -1
  134. package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +1 -1
  135. 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
  136. package/dist/owp-app.css +1 -1
  137. package/dist/types/components/OwpSnackbarContent/OwpSnackbarContent.d.ts +2 -0
  138. package/dist/types/components/OwpTable/OwpTable.d.ts +3 -1
  139. package/dist/types/components/OwpTable/internal/defaultTableStyle.d.ts +49 -0
  140. package/dist/types/components/OwpTable/internal/treeGridTableStyle.d.ts +105 -0
  141. package/dist/types/components/OwpTreeGrid/OwpTreeGrid.d.ts +2 -1
  142. package/dist/types/components/OwpTreeGrid/internal/treeGridRuntime.d.ts +11 -2
  143. package/dist/types/components/OwpTreeGrid/internal/treeGridTheme.d.ts +20 -0
  144. package/dist/types/configs/defaultConfig.d.ts +22 -0
  145. package/dist/types/constants/gridTheme.d.ts +58 -0
  146. package/dist/types/constants/tableTheme.d.ts +18 -0
  147. package/dist/types/constants/treeGrid.d.ts +5 -0
  148. package/dist/types/contexts/OwpAppProvider.d.ts +2 -0
  149. package/dist/types/features/themePreview/components/ThemePreviewCanvas.d.ts +8 -0
  150. package/dist/types/features/themePreview/components/ThemePreviewCanvasSections.d.ts +82 -0
  151. package/dist/types/features/themePreview/components/ThemePreviewColorField.d.ts +10 -0
  152. package/dist/types/features/themePreview/components/ThemePreviewControls.d.ts +18 -0
  153. package/dist/types/features/themePreview/components/index.d.ts +3 -0
  154. package/dist/types/features/themePreview/components/themePreviewCanvas.icons.d.ts +3 -0
  155. package/dist/types/features/themePreview/components/themePreviewCanvas.shared.d.ts +121 -0
  156. package/dist/types/features/themePreview/configs/grid.d.ts +41 -0
  157. package/dist/types/features/themePreview/configs/index.d.ts +7 -0
  158. package/dist/types/features/themePreview/configs/presets.d.ts +1153 -0
  159. package/dist/types/features/themePreview/configs/previewStorage.d.ts +34 -0
  160. package/dist/types/features/themePreview/configs/settings.d.ts +271 -0
  161. package/dist/types/features/themePreview/configs/snackbar.d.ts +43 -0
  162. package/dist/types/features/themePreview/configs/surface.d.ts +6 -0
  163. package/dist/types/features/themePreview/configs/table.d.ts +47 -0
  164. package/dist/types/features/themePreview/dialogs/ThemePreviewDialog.d.ts +3 -0
  165. package/dist/types/features/themePreview/dialogs/index.d.ts +1 -0
  166. package/dist/types/features/themePreview/hooks/index.d.ts +1 -0
  167. package/dist/types/features/themePreview/hooks/useThemePreview.d.ts +60 -0
  168. package/dist/types/features/themePreview/index.d.ts +6 -0
  169. package/dist/types/features/themePreview/types/index.d.ts +1 -0
  170. package/dist/types/features/themePreview/types/themePreview.d.ts +44 -0
  171. package/dist/types/features/themePreview/utils/color.d.ts +14 -0
  172. package/dist/types/features/themePreview/utils/index.d.ts +4 -0
  173. package/dist/types/features/themePreview/utils/themePreviewDefinitions.d.ts +10 -0
  174. package/dist/types/features/themePreview/utils/themePreviewExport.d.ts +1091 -0
  175. package/dist/types/features/themePreview/utils/themePreviewSettings.d.ts +54 -0
  176. package/dist/types/layout/components/toggles/ThemePreviewToggle.d.ts +5 -0
  177. package/dist/types/types/OwpGridThemeTypes.d.ts +34 -0
  178. package/dist/types/types/OwpSettingsTypes.d.ts +9 -0
  179. package/dist/types/types/OwpTableThemeTypes.d.ts +16 -0
  180. package/dist/types/types/index.d.ts +3 -2
  181. package/dist/types/utils/treeGridUtil.d.ts +1 -0
  182. package/dist/utils/exceljsBrowser.js +45 -48
  183. package/dist/utils/exceljsBrowser.js.map +1 -1
  184. package/dist/utils/treeGridUtil.js +66 -66
  185. package/dist/utils/treeGridUtil.js.map +1 -1
  186. package/features/themePreview.d.ts +3 -0
  187. package/features/themePreview.js +1 -0
  188. package/package.json +2 -1
@@ -1,233 +1,217 @@
1
1
  var L = Object.defineProperty;
2
- var i = (o, e) => L(o, "name", { value: e, configurable: !0 });
3
- import { jsxs as f, jsx as d, 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 { resolveOwpGridTheme as R } from "../../constants/gridTheme.js";
5
- import { getTreeGridFontFaceStyles as $, TREEGRID_FONT_FAMILY_STACK as M } from "../../constants/treeGrid.js";
6
- import { useGetCurrentSettings as z } from "../../hooks/useOwpSettings.js";
7
- import { Typography as E, styled as y, Divider as G } from "@mui/material";
8
- import { clsx as v } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
9
- import O from "@mui/material/GlobalStyles";
10
- import D from "@mui/material/Paper";
11
- import A from "@mui/material/Table";
12
- import B from "@mui/material/TableBody";
13
- import u from "@mui/material/TableCell";
14
- import j from "@mui/material/TableContainer";
15
- import I from "@mui/material/TableHead";
16
- import K from "@mui/material/TableRow";
17
- import { useMemo as h } from "react";
18
- import { isNumber as _ } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isNumber.js";
19
- import { isArray as c } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isArray.js";
20
- import { isEmpty as H } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js";
21
- const x = /* @__PURE__ */ i((o) => o ? Object.keys(o).filter((e) => !e.includes("Span")) : [], "getTableColumnKeys"), T = /* @__PURE__ */ i((o, e) => o[`${e}Sx`] ?? {}, "getTableCellSx"), w = /* @__PURE__ */ i((o, e, r) => o[`${e}${r}`] ?? void 0, "getTableCellSpan"), N = /* @__PURE__ */ i((...o) => o.reduce((e, r) => r ? [...e, ...c(r) ? r : [r]] : e, []), "mergeSx"), W = {
2
+ var a = (t, e) => L(t, "name", { value: e, configurable: !0 });
3
+ import { jsxs as u, 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 D } 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";
11
+ import j from "@mui/material/Paper";
12
+ import H from "@mui/material/Table";
13
+ import I from "@mui/material/TableBody";
14
+ import R from "@mui/material/TableCell";
15
+ import F from "@mui/material/TableContainer";
16
+ import K from "@mui/material/TableHead";
17
+ import N from "@mui/material/TableRow";
18
+ import { useMemo as c } from "react";
19
+ import { getTreeGridContainerSx as Y, getTreeGridBodyRowSx as q, TREEGRID_TABLE_BODY_BORDER_COLOR as z, getTreeGridBodyCellSx as J, TREEGRID_TABLE_HEADER_BORDER_COLOR as Q, getTreeGridHeaderCellSx as V, getTreeGridCellBaseSx as W } from "./internal/treeGridTableStyle.js";
20
+ import { getDefaultTableHeaderCellSx as X, getDefaultTableCellSx as Z, defaultStyledTableTheme as $ } from "./internal/defaultTableStyle.js";
21
+ import { isNumber as k } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isNumber.js";
22
+ import { isArray as h } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isArray.js";
23
+ import { isEmpty as P } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js";
24
+ const g = /* @__PURE__ */ a((t) => t ? Object.keys(t).filter((e) => !e.includes("Span")) : [], "getTableColumnKeys"), w = /* @__PURE__ */ a((t, e) => t[`${e}Sx`] ?? {}, "getTableCellSx"), x = /* @__PURE__ */ a((t, e, o) => t[`${e}${o}`] ?? void 0, "getTableCellSpan"), U = /* @__PURE__ */ a((...t) => t.reduce((e, o) => o ? [...e, ...h(o) ? o : [o]] : e, []), "mergeSx"), ee = {
22
25
  border: 0,
23
26
  borderRadius: 0,
24
27
  overflow: "visible"
25
- }, F = /* @__PURE__ */ i((o, e = "normal") => ({
26
- fontFamily: M,
27
- fontSize: o,
28
- fontWeight: e,
29
- lineHeight: "16px"
30
- }), "getTreeGridTypographySx"), Y = /* @__PURE__ */ i((o) => ({
31
- ...F(o.cell.fontSize),
32
- boxSizing: "border-box",
33
- overflow: "hidden",
34
- textOverflow: "ellipsis",
35
- verticalAlign: "middle",
36
- whiteSpace: "nowrap"
37
- }), "getTreeGridCellBaseSx");
38
- function q({ totalCount: o }) {
39
- return /* @__PURE__ */ f(C, { children: [
40
- /* @__PURE__ */ d(G, {}),
41
- /* @__PURE__ */ f(E, { className: "w-full py-8 pr-12", align: "right", children: [
28
+ };
29
+ function te({ totalCount: t }) {
30
+ return /* @__PURE__ */ u(S, { children: [
31
+ /* @__PURE__ */ m(D, {}),
32
+ /* @__PURE__ */ u(_, { className: "w-full py-8 pr-12", align: "right", children: [
42
33
  "전체: ",
43
- _(o) ? o.toLocaleString() : 0,
34
+ k(t) ? t.toLocaleString() : 0,
44
35
  " 건"
45
36
  ] })
46
37
  ] });
47
38
  }
48
- i(q, "OwpTableTotalCount");
49
- const J = /* @__PURE__ */ i(({
50
- canBodyFullHeight: o,
39
+ a(te, "OwpTableTotalCount");
40
+ const oe = /* @__PURE__ */ a(({
41
+ canBodyFullHeight: t,
51
42
  canUseTreeGridStyle: e,
52
- children: r,
53
- className: a,
54
- containerProps: t,
55
- footerSlot: s,
56
- tableLayout: b,
57
- ...p
43
+ children: o,
44
+ className: b,
45
+ containerProps: l,
46
+ footerSlot: d,
47
+ tableTheme: f,
48
+ tableLayout: i,
49
+ ...n
58
50
  }) => {
59
- const l = z(), n = h(
51
+ const r = G(), p = c(
52
+ () => {
53
+ var s, T;
54
+ return y((T = (s = r == null ? void 0 : r.theme) == null ? void 0 : s.main) == null ? void 0 : T.grid);
55
+ },
56
+ [r]
57
+ ), E = c(
60
58
  () => {
61
- var m, g;
62
- return R((g = (m = l == null ? void 0 : l.theme) == null ? void 0 : m.main) == null ? void 0 : g.grid);
59
+ var s, T;
60
+ return f ?? B((T = (s = r == null ? void 0 : r.theme) == null ? void 0 : s.main) == null ? void 0 : T.table, $);
63
61
  },
64
- [l]
62
+ [r, f]
65
63
  );
66
- return /* @__PURE__ */ f(C, { children: [
67
- e && /* @__PURE__ */ d(O, { styles: $() }),
68
- /* @__PURE__ */ f(
69
- j,
64
+ return /* @__PURE__ */ u(S, { children: [
65
+ e && /* @__PURE__ */ m(A, { styles: M() }),
66
+ /* @__PURE__ */ u(
67
+ F,
70
68
  {
71
- component: D,
69
+ component: j,
72
70
  variant: "outlined",
73
- ...t,
74
- sx: N(
75
- e && W,
76
- o && { height: "100%" },
77
- t == null ? void 0 : t.sx
71
+ ...l,
72
+ sx: U(
73
+ e && ee,
74
+ e && Y(p),
75
+ t && { height: "100%" },
76
+ l == null ? void 0 : l.sx
78
77
  ),
79
78
  children: [
80
- /* @__PURE__ */ d(
81
- Q,
79
+ /* @__PURE__ */ m(
80
+ re,
82
81
  {
83
- ...p,
84
- canBodyFullHeight: o,
82
+ ...n,
83
+ canBodyFullHeight: t,
85
84
  canUseTreeGridStyle: e,
86
- treeGridTheme: n,
87
- className: v(
88
- o && "h-full",
89
- b === "fixed" ? "table-fixed" : b === "auto" ? "table-auto" : "",
90
- a
85
+ tableTheme: E,
86
+ treeGridTheme: p,
87
+ className: O(
88
+ t && "h-full",
89
+ i === "fixed" ? "table-fixed" : i === "auto" ? "table-auto" : "",
90
+ b
91
91
  ),
92
- children: r
92
+ children: o
93
93
  }
94
94
  ),
95
- s
95
+ d
96
96
  ]
97
97
  }
98
98
  )
99
99
  ] });
100
- }, "StyledTable"), Q = y(A, {
101
- shouldForwardProp: /* @__PURE__ */ i((o) => o !== "canBodyFullHeight" && o !== "canUseTreeGridStyle" && o !== "treeGridTheme", "shouldForwardProp")
102
- })(({ theme: o, canBodyFullHeight: e, canUseTreeGridStyle: r, treeGridTheme: a }) => {
103
- const t = a ?? R();
104
- return {
105
- ...e && {
106
- height: "100%"
107
- },
108
- ...e && {
109
- "& .MuiTableBody-root": {
100
+ }, "StyledTable"), re = v(H, {
101
+ shouldForwardProp: /* @__PURE__ */ a((t) => t !== "canBodyFullHeight" && t !== "canUseTreeGridStyle" && t !== "tableTheme" && t !== "treeGridTheme", "shouldForwardProp")
102
+ })(
103
+ ({ theme: t, canBodyFullHeight: e, canUseTreeGridStyle: o, tableTheme: b, treeGridTheme: l }) => {
104
+ const d = l ?? y(), f = b ?? $;
105
+ return {
106
+ ...e && {
110
107
  height: "100%"
111
108
  },
112
- "& .MuiTableBody-root > .MuiTableRow-root": {
113
- height: "100%"
114
- }
115
- },
116
- "& .MuiTableCell-root": r ? {
117
- ...Y(t)
118
- } : {
119
- fontSize: "1.7rem",
120
- padding: "7px 10px",
121
- borderLeft: "none",
122
- borderRight: "none"
123
- },
124
- ...!r && {
125
- "& .MuiTableRow-root > .MuiTableCell-root + .MuiTableCell-root": {
126
- borderLeft: `1px solid ${o.palette.divider}`
127
- }
128
- },
129
- "& th": r ? {
130
- ...F(
131
- t.header.fontSize,
132
- t.header.fontWeight
133
- ),
134
- backgroundColor: t.header.backgroundColor,
135
- borderTop: "1px solid #6F7F94",
136
- borderBottom: "1px solid #6F7F94",
137
- borderLeft: 0,
138
- borderRight: "1px solid #6F7F94",
139
- color: t.header.color,
140
- height: t.header.height,
141
- minHeight: t.header.height,
142
- padding: "7px 2px 6px 10px",
143
- "&:first-of-type": {
144
- borderLeft: "1px solid #6F7F94"
145
- }
146
- } : {
147
- backgroundColor: o.palette.grey[200],
148
- fontWeight: 600
149
- },
150
- "& td": r ? {
151
- borderBottom: "1px solid #CDD8E4",
152
- borderLeft: 0,
153
- borderRight: "1px solid #CDD8E4",
154
- color: "#111112",
155
- fontSize: t.cell.fontSize,
156
- padding: "7px 10px 6px",
157
- "&:first-of-type": {
158
- borderLeft: "1px solid #CDD8E4"
159
- }
160
- } : {},
161
- ...r && {
162
- "& tbody > tr:first-of-type > th:first-of-type": {
163
- borderTopLeftRadius: "inherit"
109
+ ...e && {
110
+ "& .MuiTableBody-root": {
111
+ height: "100%"
112
+ },
113
+ "& .MuiTableBody-root > .MuiTableRow-root": {
114
+ height: "100%"
115
+ }
116
+ },
117
+ "& .MuiTableCell-root": o ? {
118
+ ...W(d)
119
+ } : {
120
+ ...Z(f)
164
121
  },
165
- "& tbody > tr:first-of-type > td:last-of-type": {
166
- borderTopRightRadius: "inherit"
122
+ ...!o && {
123
+ "& .MuiTableRow-root > .MuiTableCell-root + .MuiTableCell-root": {
124
+ borderLeft: `1px solid ${t.palette.divider}`
125
+ }
126
+ },
127
+ "& th": o ? {
128
+ ...V(d),
129
+ "&:first-of-type": {
130
+ borderLeft: `1px solid ${Q}`
131
+ }
132
+ } : {
133
+ ...X(f, t.palette.grey[200])
134
+ },
135
+ "& td": o ? {
136
+ ...J(d),
137
+ "&:first-of-type": {
138
+ borderLeft: `1px solid ${z}`
139
+ }
140
+ } : {},
141
+ ...o && {
142
+ "& tbody > .MuiTableRow-root": q(d)
143
+ },
144
+ ...o && {
145
+ "& tbody > tr:first-of-type > th:first-of-type": {
146
+ borderTopLeftRadius: "inherit"
147
+ },
148
+ "& tbody > tr:first-of-type > td:last-of-type": {
149
+ borderTopRightRadius: "inherit"
150
+ }
167
151
  }
168
- }
169
- };
170
- }), S = y(K)`
152
+ };
153
+ }
154
+ ), C = v(N)`
171
155
  /* &:last-child th,
172
156
  &:last-child td {
173
157
  border-bottom: 0;
174
158
  } */
175
159
  `;
176
- function ho({
177
- canTotalCountRow: o = !1,
160
+ function Oe({
161
+ canTotalCountRow: t = !1,
178
162
  headers: e,
179
- rows: r,
180
- totalCount: a,
181
- ...t
163
+ rows: o,
164
+ totalCount: b,
165
+ ...l
182
166
  }) {
183
- const s = h(
184
- () => c(e) ? e : H(e) ? [] : [e],
167
+ const d = c(
168
+ () => h(e) ? e : P(e) ? [] : [e],
185
169
  [e]
186
- ), b = h(
187
- () => x(c(e) ? e[0] : e),
170
+ ), f = c(
171
+ () => g(h(e) ? e[0] : e),
188
172
  [e]
189
173
  );
190
- return /* @__PURE__ */ f(
191
- J,
174
+ return /* @__PURE__ */ u(
175
+ oe,
192
176
  {
193
- ...t,
194
- footerSlot: o ? /* @__PURE__ */ d(q, { totalCount: typeof a > "u" ? r.length : a }) : void 0,
195
- className: v(t.tableLayout && "w-full", t.className),
177
+ ...l,
178
+ footerSlot: t ? /* @__PURE__ */ m(te, { totalCount: typeof b > "u" ? o.length : b }) : void 0,
179
+ className: O(l.tableLayout && "w-full", l.className),
196
180
  children: [
197
- /* @__PURE__ */ d(I, { children: s.map((p, l) => /* @__PURE__ */ d(S, { children: x(p).map((n) => /* @__PURE__ */ d(
198
- u,
181
+ /* @__PURE__ */ m(K, { children: d.map((i, n) => /* @__PURE__ */ m(C, { children: g(i).map((r) => /* @__PURE__ */ m(
182
+ R,
199
183
  {
200
184
  className: "whitespace-pre-wrap",
201
- sx: T(p, n),
202
- colSpan: w(p, n, "ColSpan"),
203
- rowSpan: w(p, n, "RowSpan"),
185
+ sx: w(i, r),
186
+ colSpan: x(i, r, "ColSpan"),
187
+ rowSpan: x(i, r, "RowSpan"),
204
188
  align: "center",
205
- children: p[n]
189
+ children: i[r]
206
190
  },
207
- `table-header-${l}-${n}`
208
- )) }, `table-header-${l}`)) }),
209
- /* @__PURE__ */ d(B, { children: r.map((p, l) => {
210
- const n = p;
211
- return /* @__PURE__ */ d(S, { children: b.map((m) => /* @__PURE__ */ d(
212
- u,
191
+ `table-header-${n}-${r}`
192
+ )) }, `table-header-${n}`)) }),
193
+ /* @__PURE__ */ m(I, { children: o.map((i, n) => {
194
+ const r = i;
195
+ return /* @__PURE__ */ m(C, { children: f.map((p) => /* @__PURE__ */ m(
196
+ R,
213
197
  {
214
198
  className: "whitespace-pre-wrap h-64",
215
- sx: T(n, m),
199
+ sx: w(r, p),
216
200
  align: "center",
217
- children: n[m]
201
+ children: r[p]
218
202
  },
219
- `table-row-cell-${l}-${m}`
220
- )) }, `table-row-${l}`);
203
+ `table-row-cell-${n}-${p}`
204
+ )) }, `table-row-${n}`);
221
205
  }) })
222
206
  ]
223
207
  }
224
208
  );
225
209
  }
226
- i(ho, "OwpTable");
210
+ a(Oe, "OwpTable");
227
211
  export {
228
- ho as OwpTable,
229
- q as OwpTableTotalCount,
230
- J as StyledTable,
231
- S as StyledTableRow
212
+ Oe as OwpTable,
213
+ te as OwpTableTotalCount,
214
+ oe as StyledTable,
215
+ C as StyledTableRow
232
216
  };
233
217
  //# sourceMappingURL=OwpTable.js.map
@@ -1 +1 @@
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 getTreeGridFontFaceStyles,\n TREEGRID_FONT_FAMILY_STACK,\n} 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';\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 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\nconst 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\ninterface StyledTableProps extends TableProps {\n canBodyFullHeight?: boolean;\n canUseTreeGridStyle?: boolean;\n containerProps?: TableContainerProps;\n footerSlot?: ReactNode;\n tableLayout?: 'auto' | 'fixed';\n treeGridTheme?: OwpResolvedGridThemeConfigType;\n title?: string;\n children: ReactNode;\n}\n\ntype StyledTableInnerProps = Pick<\n StyledTableProps,\n 'canBodyFullHeight' | 'canUseTreeGridStyle' | '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 tableLayout,\n ...tableProps\n}: StyledTableProps) => {\n const currentSettings = useGetCurrentSettings();\n const treeGridTheme = useMemo(\n () => resolveOwpGridTheme(currentSettings?.theme?.main?.grid),\n [currentSettings],\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 canBodyFullHeight && { height: '100%' },\n containerProps?.sx,\n )}\n >\n <StyledTableInner\n {...tableProps}\n canBodyFullHeight={canBodyFullHeight}\n canUseTreeGridStyle={canUseTreeGridStyle}\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' && prop !== 'canUseTreeGridStyle' && prop !== 'treeGridTheme',\n})<StyledTableInnerProps>(({ theme, canBodyFullHeight, canUseTreeGridStyle, treeGridTheme }) => {\n const resolvedTreeGridTheme = treeGridTheme ?? resolveOwpGridTheme();\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: '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 ...getTreeGridTypographySx(\n resolvedTreeGridTheme.header.fontSize,\n resolvedTreeGridTheme.header.fontWeight,\n ),\n backgroundColor: resolvedTreeGridTheme.header.backgroundColor,\n borderTop: '1px solid #6F7F94',\n borderBottom: '1px solid #6F7F94',\n borderLeft: 0,\n borderRight: '1px solid #6F7F94',\n color: resolvedTreeGridTheme.header.color,\n height: resolvedTreeGridTheme.header.height,\n minHeight: resolvedTreeGridTheme.header.height,\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 fontSize: resolvedTreeGridTheme.cell.fontSize,\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});\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","getTreeGridTypographySx","fontSize","fontWeight","TREEGRID_FONT_FAMILY_STACK","getTreeGridCellBaseSx","treeGridTheme","OwpTableTotalCount","totalCount","jsxs","Fragment","jsx","Divider","Typography","isNumber","StyledTable","canBodyFullHeight","canUseTreeGridStyle","children","className","containerProps","footerSlot","tableLayout","tableProps","currentSettings","useGetCurrentSettings","useMemo","resolveOwpGridTheme","_b","_a","GlobalStyles","getTreeGridFontFaceStyles","TableContainer","Paper","StyledTableInner","clsx","styled","Table","prop","theme","resolvedTreeGridTheme","StyledTableRow","TableRow","OwpTable","canTotalCountRow","headers","rows","restTableProps","resolvedHeaderRows","isEmpty","commonKeyListData","TableHead","headerData","index","TableCell","TableBody","currentRow"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0BA,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,CAAK,CAAE,IAH5CD,GAIR,EAAE,GAPS,YASVG,IAAsB;AAAA,EAC1B,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,UAAU;AACZ,GAEMC,IAA0B,gBAAAZ,EAAA,CAC9Ba,GACAC,IAA8B,cAC1B;AAAA,EACJ,YAAYC;AAAA,EACZ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CAAO;AAAA,YAAA;AAAA,YALd,kBAAkB8D,CAAK,IAAI9D,CAAO;AAAA,UAAA,CAO1C,KAVkB,aAAa8D,CAAK,EAWvC;AAAA,QAEJ,CAAC,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAlEgBhE,EAAAsD,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';\nimport {\n defaultStyledTableTheme,\n getDefaultTableCellSx,\n getDefaultTableHeaderCellSx,\n} from './internal/defaultTableStyle';\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\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 ...getDefaultTableCellSx(resolvedTableTheme),\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 ...getDefaultTableHeaderCellSx(resolvedTableTheme, theme.palette.grey[200]),\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","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","defaultStyledTableTheme","GlobalStyles","getTreeGridFontFaceStyles","TableContainer","Paper","getTreeGridContainerSx","StyledTableInner","clsx","styled","Table","prop","theme","resolvedTreeGridTheme","resolvedTableTheme","getTreeGridCellBaseSx","getDefaultTableCellSx","getTreeGridHeaderCellSx","TREEGRID_TABLE_HEADER_BORDER_COLOR","getDefaultTableHeaderCellSx","getTreeGridBodyCellSx","TREEGRID_TABLE_BODY_BORDER_COLOR","getTreeGridBodyRowSx","StyledTableRow","TableRow","OwpTable","canTotalCountRow","headers","rows","restTableProps","resolvedHeaderRows","isEmpty","commonKeyListData","TableHead","headerData","index","TableCell","TableBody","currentRow"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyCA,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,CAAK,CAAE,IAH5CD,GAIR,EAAE,GAPS,YASVG,KAAsB;AAAA,EAC1B,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,UAAU;AACZ;AAuBO,SAASC,GAAmB,EAAE,YAAAC,KAAuC;AAC1E,SACE,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAQ;AAAA,IACT,gBAAAH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A,CAAY,IAC5F;AAAA,MAEN,WAAWiC,EAAKqB,EAAe,eAAe,UAAUA,EAAe,SAAS;AAAA,MAEhF,UAAA;AAAA,QAAA,gBAAAnD,EAACuD,GAAA,EACE,UAAAH,EAAmB,IAAI,CAACI,GAAYC,MACnC,gBAAAzD,EAAC6C,GAAA,EACE,UAAA9D,EAAmByE,CAAU,EAAE,IAAI,CAACtE,MACnC,gBAAAc;AAAA,UAAC0D;AAAA,UAAA;AAAA,YAEC,WAAU;AAAA,YACV,IAAIvE,EAAeqE,GAAYtE,CAAO;AAAA,YACtC,SAASE,EAAiBoE,GAAYtE,GAAS,SAAS;AAAA,YACxD,SAASE,EAAiBoE,GAAYtE,GAAS,SAAS;AAAA,YACxD,OAAM;AAAA,YAEL,YAAWA,CAAO;AAAA,UAAA;AAAA,UAPd,gBAAgBuE,CAAK,IAAIvE,CAAO;AAAA,QAAA,CASxC,EAAA,GAZkB,gBAAgBuE,CAAK,EAa1C,CACD,EAAA,CACH;AAAA,0BACCE,GAAA,EACE,UAAAT,EAAK,IAAI,CAACjE,GAAKwE,MAAU;AACxB,gBAAMG,IAAa3E;AAEnB,iBACE,gBAAAe,EAAC6C,GAAA,EACE,UAAAS,EAAkB,IAAI,CAACpE,MACtB,gBAAAc;AAAA,YAAC0D;AAAA,YAAA;AAAA,cAEC,WAAU;AAAA,cACV,IAAIvE,EAAeyE,GAAY1E,CAAO;AAAA,cACtC,OAAM;AAAA,cAEL,YAAWA,CAAO;AAAA,YAAA;AAAA,YALd,kBAAkBuE,CAAK,IAAIvE,CAAO;AAAA,UAAA,CAO1C,KAVkB,aAAauE,CAAK,EAWvC;AAAA,QAEJ,CAAC,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAlEgBzE,EAAA+D,IAAA;"}
@@ -0,0 +1,50 @@
1
+ var t = Object.defineProperty;
2
+ var e = (o, r) => t(o, "name", { value: r, configurable: !0 });
3
+ import { grey as l } from "@mui/material/colors";
4
+ const n = "7px 10px", d = {
5
+ header: {
6
+ backgroundColor: "",
7
+ color: "inherit",
8
+ fontSize: "1.7rem",
9
+ fontWeight: 600
10
+ },
11
+ cell: {
12
+ fontSize: "1.7rem"
13
+ }
14
+ }, i = /* @__PURE__ */ e((o) => ({
15
+ fontSize: o.cell.fontSize,
16
+ padding: n,
17
+ borderLeft: "none",
18
+ borderRight: "none"
19
+ }), "getDefaultTableCellSx"), f = /* @__PURE__ */ e((o, r = l[200]) => ({
20
+ ...i(o),
21
+ backgroundColor: o.header.backgroundColor || r,
22
+ color: o.header.color,
23
+ fontSize: o.header.fontSize,
24
+ fontWeight: o.header.fontWeight
25
+ }), "getDefaultTableHeaderCellSx"), S = /* @__PURE__ */ e((o) => ({
26
+ color: o.header.color,
27
+ fontSize: o.header.fontSize,
28
+ fontWeight: o.header.fontWeight
29
+ }), "getDefaultTableHeaderLabelSx"), g = {
30
+ "&.MuiTableSortLabel-root": {
31
+ color: "inherit"
32
+ },
33
+ "&.MuiTableSortLabel-root:hover": {
34
+ color: "inherit"
35
+ },
36
+ "&.Mui-active": {
37
+ color: "inherit"
38
+ },
39
+ "& .MuiTableSortLabel-icon": {
40
+ color: "currentColor !important"
41
+ }
42
+ };
43
+ export {
44
+ d as defaultStyledTableTheme,
45
+ g as defaultTableSortLabelSx,
46
+ i as getDefaultTableCellSx,
47
+ f as getDefaultTableHeaderCellSx,
48
+ S as getDefaultTableHeaderLabelSx
49
+ };
50
+ //# sourceMappingURL=defaultTableStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultTableStyle.js","sources":["../../../../src/components/OwpTable/internal/defaultTableStyle.ts"],"sourcesContent":["import type { OwpResolvedTableThemeConfigType } from '@/constants/tableTheme';\nimport { grey } from '@mui/material/colors';\n\nconst DEFAULT_TABLE_CELL_PADDING = '7px 10px';\n\nexport const 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\n/** 기본 table cell sx */\nexport const getDefaultTableCellSx = (tableTheme: OwpResolvedTableThemeConfigType) =>\n ({\n fontSize: tableTheme.cell.fontSize,\n padding: DEFAULT_TABLE_CELL_PADDING,\n borderLeft: 'none',\n borderRight: 'none',\n }) as const;\n\n/** 기본 table header cell sx */\nexport const getDefaultTableHeaderCellSx = (\n tableTheme: OwpResolvedTableThemeConfigType,\n fallbackBackgroundColor: string = grey[200],\n) =>\n ({\n ...getDefaultTableCellSx(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","defaultStyledTableTheme","getDefaultTableCellSx","__name","tableTheme","getDefaultTableHeaderCellSx","fallbackBackgroundColor","grey","getDefaultTableHeaderLabelSx","defaultTableSortLabelSx"],"mappings":";;;AAGA,MAAMA,IAA6B,YAEtBC,IAA0B;AAAA,EACrC,QAAQ;AAAA,IACN,iBAAiB;AAAA,IACjB,OAAO;AAAA,IACP,UAAU;AAAA,IACV,YAAY;AAAA,EAAA;AAAA,EAEd,MAAM;AAAA,IACJ,UAAU;AAAA,EAAA;AAEd,GAGaC,IAAwB,gBAAAC,EAAA,CAACC,OACnC;AAAA,EACC,UAAUA,EAAW,KAAK;AAAA,EAC1B,SAASJ;AAAA,EACT,YAAY;AAAA,EACZ,aAAa;AACf,IANmC,0BASxBK,IAA8B,gBAAAF,EAAA,CACzCC,GACAE,IAAkCC,EAAK,GAAG,OAEzC;AAAA,EACC,GAAGL,EAAsBE,CAAU;AAAA,EACnC,iBAAiBA,EAAW,OAAO,mBAAmBE;AAAA,EACtD,OAAOF,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;"}
@@ -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;AACd,IAPqC,0BAaxBM,IAA0B,gBAAAP,EAAA,CACrCC,OACI;AAAA,EACJ,GAAGC;AAAA,IACDD,EAAc,OAAO;AAAA,IACrBA,EAAc,OAAO;AAAA,EAAA;AAAA,EAEvB,iBAAiBA,EAAc,OAAO;AAAA,EACtC,WAAW,aAAaJ,CAAkC;AAAA,EAC1D,cAAc,aAAaA,CAAkC;AAAA,EAC7D,YAAY;AAAA,EACZ,aAAa,aAAaA,CAAkC;AAAA,EAC5D,OAAOI,EAAc,OAAO;AAAA,EAC5B,QAAQA,EAAc,OAAO;AAAA,EAC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