@owp/core 2.2.5 → 2.3.0

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 (238) hide show
  1. package/dist/_virtual/index11.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/index16.js +5 -2
  6. package/dist/_virtual/index16.js.map +1 -1
  7. package/dist/_virtual/index17.js +2 -2
  8. package/dist/_virtual/index5.js +2 -5
  9. package/dist/_virtual/index5.js.map +1 -1
  10. package/dist/_virtual/index6.js +2 -2
  11. package/dist/_virtual/index7.js +2 -2
  12. package/dist/components/OwpDialog/OwpDialog.js +48 -46
  13. package/dist/components/OwpDialog/OwpDialog.js.map +1 -1
  14. package/dist/components/OwpErrorStatusPage/OwpErrorStatusPage.js +24 -24
  15. package/dist/components/OwpErrorStatusPage/OwpErrorStatusPage.js.map +1 -1
  16. package/dist/components/OwpLayout/OwpLayout.js +29 -30
  17. package/dist/components/OwpLayout/OwpLayout.js.map +1 -1
  18. package/dist/components/OwpMrtTable/OwpMrtTable.js +2 -2
  19. package/dist/components/OwpMrtTable/OwpMrtTable.js.map +1 -1
  20. package/dist/components/OwpMrtTable/{OwpMrtTableNoDataOverlay.js → internal/OwpMrtTableNoDataOverlay.js} +1 -1
  21. package/dist/components/OwpMrtTable/internal/OwpMrtTableNoDataOverlay.js.map +1 -0
  22. package/dist/components/OwpMrtTable/{OwpMrtTableTopToolbar.js → internal/OwpMrtTableTopToolbar.js} +3 -3
  23. package/dist/components/OwpMrtTable/internal/OwpMrtTableTopToolbar.js.map +1 -0
  24. package/dist/components/OwpPageCarded/OwpPageCarded.js +81 -77
  25. package/dist/components/OwpPageCarded/OwpPageCarded.js.map +1 -1
  26. package/dist/components/OwpPageCarded/{OwpPageCardedHeader.js → internal/OwpPageCardedHeader.js} +2 -2
  27. package/dist/components/OwpPageCarded/internal/OwpPageCardedHeader.js.map +1 -0
  28. package/dist/components/OwpPageCarded/{OwpPageCardedSidebar.js → internal/OwpPageCardedSidebar.js} +3 -3
  29. package/dist/components/OwpPageCarded/internal/OwpPageCardedSidebar.js.map +1 -0
  30. package/dist/components/OwpPageCarded/{OwpPageCardedSidebarContent.js → internal/OwpPageCardedSidebarContent.js} +2 -2
  31. package/dist/components/OwpPageCarded/internal/OwpPageCardedSidebarContent.js.map +1 -0
  32. package/dist/components/OwpPicker/OwpDatePicker.js +90 -83
  33. package/dist/components/OwpPicker/OwpDatePicker.js.map +1 -1
  34. package/dist/components/OwpPicker/OwpDateRangePicker.js +57 -50
  35. package/dist/components/OwpPicker/OwpDateRangePicker.js.map +1 -1
  36. package/dist/components/OwpPicker/OwpTimePicker.js +65 -61
  37. package/dist/components/OwpPicker/OwpTimePicker.js.map +1 -1
  38. package/dist/components/OwpPicker/OwpWeekDatePicker.js +58 -52
  39. package/dist/components/OwpPicker/OwpWeekDatePicker.js.map +1 -1
  40. package/dist/components/OwpPicker/OwpYearRangePicker.js +68 -62
  41. package/dist/components/OwpPicker/OwpYearRangePicker.js.map +1 -1
  42. package/dist/components/OwpPicker/{constants.js → constants/index.js} +1 -1
  43. package/dist/components/OwpPicker/constants/index.js.map +1 -0
  44. package/dist/components/OwpPicker/{AnimatedCalendarContainer.js → internal/AnimatedCalendarContainer.js} +2 -2
  45. package/dist/components/OwpPicker/internal/AnimatedCalendarContainer.js.map +1 -0
  46. package/dist/components/OwpPicker/{CalendarContainer.js → internal/CalendarContainer.js} +2 -2
  47. package/dist/components/OwpPicker/internal/CalendarContainer.js.map +1 -0
  48. package/dist/components/OwpPicker/{DatePickerInput.js → internal/DatePickerInput.js} +4 -4
  49. package/dist/components/OwpPicker/internal/DatePickerInput.js.map +1 -0
  50. package/dist/components/OwpQuerySelector/OwpQuerySelector.js +205 -171
  51. package/dist/components/OwpQuerySelector/OwpQuerySelector.js.map +1 -1
  52. package/dist/components/OwpScrollbars/OwpScrollbars.js +16 -17
  53. package/dist/components/OwpScrollbars/OwpScrollbars.js.map +1 -1
  54. package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js +112 -103
  55. package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js.map +1 -1
  56. package/dist/components/OwpStyleProvider/OwpStyleProvider.js +86 -39
  57. package/dist/components/OwpStyleProvider/OwpStyleProvider.js.map +1 -1
  58. package/dist/components/OwpSuspense/OwpSuspense.js.map +1 -1
  59. package/dist/components/OwpTable/OwpTable.js +50 -51
  60. package/dist/components/OwpTable/OwpTable.js.map +1 -1
  61. package/dist/components/OwpTreeGrid/OwpTreeGrid.js +163 -308
  62. package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
  63. package/dist/components/OwpTreeGrid/hooks/useOwpTreeGridOverlayFrame.js +1 -1
  64. package/dist/components/OwpTreeGrid/hooks/useOwpTreeGridOverlayFrame.js.map +1 -1
  65. package/dist/components/OwpTreeGrid/{OwpTreeGridLoadingOverlay.js → internal/OwpTreeGridLoadingOverlay.js} +2 -2
  66. package/dist/components/OwpTreeGrid/internal/OwpTreeGridLoadingOverlay.js.map +1 -0
  67. package/dist/components/OwpTreeGrid/{OwpTreeGridNoDataOverlay.js → internal/OwpTreeGridNoDataOverlay.js} +2 -2
  68. package/dist/components/OwpTreeGrid/internal/OwpTreeGridNoDataOverlay.js.map +1 -0
  69. package/dist/components/OwpTreeGrid/{utils/index.js → internal/treeGridLayout.js} +1 -1
  70. package/dist/components/OwpTreeGrid/internal/treeGridLayout.js.map +1 -0
  71. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +182 -0
  72. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -0
  73. package/dist/components/OwpTreeGrid/utils/perf.js.map +1 -0
  74. package/dist/components/OwpZoomImageSlider/OwpZoomImageSlider.js +1 -1
  75. package/dist/components/OwpZoomImageSlider/OwpZoomImageSlider.js.map +1 -1
  76. package/dist/components/OwpZoomImageSlider/{ZoomImage.js → internal/ZoomImage.js} +1 -1
  77. package/dist/components/OwpZoomImageSlider/internal/ZoomImage.js.map +1 -0
  78. package/dist/contexts/OwpCoreProvider.js +22 -36
  79. package/dist/contexts/OwpCoreProvider.js.map +1 -1
  80. package/dist/contexts/OwpStoreProvider.js +9 -9
  81. package/dist/contexts/OwpStoreProvider.js.map +1 -1
  82. package/dist/hooks/useNavbar.js +24 -0
  83. package/dist/hooks/useNavbar.js.map +1 -0
  84. package/dist/hooks/useOwpSettings.js +21 -0
  85. package/dist/hooks/useOwpSettings.js.map +1 -0
  86. package/dist/hooks.js +75 -62
  87. package/dist/hooks.js.map +1 -1
  88. package/dist/index.js +98 -104
  89. package/dist/index.js.map +1 -1
  90. package/dist/layout/Layout.js +28 -29
  91. package/dist/layout/Layout.js.map +1 -1
  92. package/dist/layout/components/layouts/FooterLayout.js +15 -16
  93. package/dist/layout/components/layouts/FooterLayout.js.map +1 -1
  94. package/dist/layout/components/layouts/NavbarToggleFabLayout.js +21 -18
  95. package/dist/layout/components/layouts/NavbarToggleFabLayout.js.map +1 -1
  96. package/dist/layout/components/layouts/NavbarWrapperLayout.js +20 -21
  97. package/dist/layout/components/layouts/NavbarWrapperLayout.js.map +1 -1
  98. package/dist/layout/components/navbar/NavbarPinToggleButton.js +10 -11
  99. package/dist/layout/components/navbar/NavbarPinToggleButton.js.map +1 -1
  100. package/dist/layout/components/navbar/NavbarToggleButton.js +31 -32
  101. package/dist/layout/components/navbar/NavbarToggleButton.js.map +1 -1
  102. package/dist/layout/components/navbar/style/NavbarStyle.js +36 -37
  103. package/dist/layout/components/navbar/style/NavbarStyle.js.map +1 -1
  104. package/dist/layout/components/navbar/style/NavbarStyleContent.js +29 -30
  105. package/dist/layout/components/navbar/style/NavbarStyleContent.js.map +1 -1
  106. package/dist/layout/components/navigation/Navigation.js +18 -22
  107. package/dist/layout/components/navigation/Navigation.js.map +1 -1
  108. package/dist/layout/components/toggles/NavigationSearchToggle.js +55 -60
  109. package/dist/layout/components/toggles/NavigationSearchToggle.js.map +1 -1
  110. package/dist/layout/components/toggles/NavigationShortcutsToggle.js +44 -49
  111. package/dist/layout/components/toggles/NavigationShortcutsToggle.js.map +1 -1
  112. package/dist/layout/components/toolbar/ToolbarLayout.js +26 -27
  113. package/dist/layout/components/toolbar/ToolbarLayout.js.map +1 -1
  114. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
  115. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/index.js +1 -1
  116. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE39/index.js +1 -1
  117. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/constants.js +1 -1
  118. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/index.js +1 -1
  119. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/constants.js +1 -1
  120. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/index.js +1 -1
  121. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/GenericBarcode/index.js +1 -1
  122. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/constants.js +1 -1
  123. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/index.js +1 -1
  124. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/MSI/index.js +1 -1
  125. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/codabar/index.js +1 -1
  126. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/pharmacode/index.js +1 -1
  127. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/renderers/index.js +1 -1
  128. package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +1 -1
  129. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +1 -1
  130. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +1 -1
  131. package/dist/node_modules/.pnpm/react-imask@7.6.1_react@19.2.4/node_modules/react-imask/esm/mixin.js +1 -1
  132. package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +1 -1
  133. 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
  134. package/dist/owp-app.css +1 -1
  135. package/dist/store/atoms/navbarAtoms.js +84 -0
  136. package/dist/store/atoms/navbarAtoms.js.map +1 -0
  137. package/dist/store/atoms/owpSettingsAtoms.js +140 -0
  138. package/dist/store/atoms/owpSettingsAtoms.js.map +1 -0
  139. package/dist/store/atoms/owpStore.js +29 -0
  140. package/dist/store/atoms/owpStore.js.map +1 -0
  141. package/dist/store.js +44 -39
  142. package/dist/store.js.map +1 -1
  143. package/dist/types/components/OwpPageCarded/OwpPageCarded.d.ts +12 -41
  144. package/dist/types/components/OwpPageSkeleton/index.d.ts +1 -0
  145. package/dist/types/components/OwpPicker/OwpWeekDatePicker.d.ts +0 -1
  146. package/dist/types/components/OwpPicker/OwpYearRangePicker.d.ts +0 -1
  147. package/dist/types/components/OwpPicker/{DatePickerInput.d.ts → internal/DatePickerInput.d.ts} +1 -1
  148. package/dist/types/components/OwpQuerySelector/OwpQuerySelector.d.ts +1 -1
  149. package/dist/types/components/OwpQuerySelector/types/types.d.ts +2 -0
  150. package/dist/types/components/OwpTable/OwpTable.d.ts +1 -1
  151. package/dist/types/components/OwpTabs/OwpTab.d.ts +1 -1
  152. package/dist/types/components/OwpTabs/OwpTabs.d.ts +1 -1
  153. package/dist/types/components/OwpTreeGrid/OwpTreeGrid.d.ts +3 -1
  154. package/dist/types/components/OwpTreeGrid/{OwpTreeGridLoadingOverlay.d.ts → internal/OwpTreeGridLoadingOverlay.d.ts} +1 -1
  155. package/dist/types/components/OwpTreeGrid/{OwpTreeGridNoDataOverlay.d.ts → internal/OwpTreeGridNoDataOverlay.d.ts} +1 -1
  156. package/dist/types/components/OwpTreeGrid/{utils/index.d.ts → internal/treeGridLayout.d.ts} +0 -2
  157. package/dist/types/components/OwpTreeGrid/internal/treeGridRuntime.d.ts +75 -0
  158. package/dist/types/contexts/OwpCoreProvider.d.ts +2 -2
  159. package/dist/types/contexts/OwpStoreProvider.d.ts +4 -4
  160. package/dist/types/hooks/index.d.ts +2 -1
  161. package/dist/types/hooks/useNavbar.d.ts +19 -0
  162. package/dist/types/hooks/useOwpSettings.d.ts +79 -0
  163. package/dist/types/index.d.ts +1 -4
  164. package/dist/types/layout/components/navigation/Navigation.d.ts +6 -2
  165. package/dist/types/layout/components/toggles/NavigationSearchToggle.d.ts +5 -2
  166. package/dist/types/layout/components/toggles/NavigationShortcutsToggle.d.ts +5 -2
  167. package/dist/types/store/atoms/index.d.ts +3 -0
  168. package/dist/types/store/atoms/internal/types.d.ts +29 -0
  169. package/dist/types/store/atoms/navbarAtoms.d.ts +48 -0
  170. package/dist/types/store/atoms/owpSettingsAtoms.d.ts +89 -0
  171. package/dist/types/store/atoms/owpStore.d.ts +13 -0
  172. package/dist/types/store/index.d.ts +1 -3
  173. package/dist/types/types/OwpNavigationTypes.d.ts +14 -0
  174. package/dist/types/types/index.d.ts +1 -1
  175. package/dist/types/utils/index.d.ts +1 -0
  176. package/dist/types/utils/navigationUtils.d.ts +6 -2
  177. package/dist/types/utils/normalizeTimeToHourMinute.d.ts +11 -0
  178. package/dist/utils/navigationUtils.js.map +1 -1
  179. package/dist/utils/normalizeTimeToHourMinute.js +34 -0
  180. package/dist/utils/normalizeTimeToHourMinute.js.map +1 -0
  181. package/dist/utils/treeGridUtil.js +1 -1
  182. package/dist/utils/treeGridUtil.js.map +1 -1
  183. package/dist/utils.js +78 -75
  184. package/dist/utils.js.map +1 -1
  185. package/package.json +2 -6
  186. package/dist/components/OwpMrtTable/OwpMrtTableNoDataOverlay.js.map +0 -1
  187. package/dist/components/OwpMrtTable/OwpMrtTableTopToolbar.js.map +0 -1
  188. package/dist/components/OwpPageCarded/OwpPageCardedHeader.js.map +0 -1
  189. package/dist/components/OwpPageCarded/OwpPageCardedSidebar.js.map +0 -1
  190. package/dist/components/OwpPageCarded/OwpPageCardedSidebarContent.js.map +0 -1
  191. package/dist/components/OwpPicker/AnimatedCalendarContainer.js.map +0 -1
  192. package/dist/components/OwpPicker/CalendarContainer.js.map +0 -1
  193. package/dist/components/OwpPicker/DatePickerInput.js.map +0 -1
  194. package/dist/components/OwpPicker/constants.js.map +0 -1
  195. package/dist/components/OwpTreeGrid/OwpTreeGridLoadingOverlay.js.map +0 -1
  196. package/dist/components/OwpTreeGrid/OwpTreeGridNoDataOverlay.js.map +0 -1
  197. package/dist/components/OwpTreeGrid/perf.js.map +0 -1
  198. package/dist/components/OwpTreeGrid/utils/index.js.map +0 -1
  199. package/dist/components/OwpZoomImageSlider/ZoomImage.js.map +0 -1
  200. package/dist/hooks/useAppStore.js +0 -8
  201. package/dist/hooks/useAppStore.js.map +0 -1
  202. package/dist/node_modules/.pnpm/react-datepicker@8.7.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-datepicker/dist/react-datepicker.css +0 -1
  203. package/dist/store/generateReducersFromSlices.js +0 -18
  204. package/dist/store/generateReducersFromSlices.js.map +0 -1
  205. package/dist/store/lazyLoadedSlices.js +0 -16
  206. package/dist/store/lazyLoadedSlices.js.map +0 -1
  207. package/dist/store/middleware.js +0 -9
  208. package/dist/store/middleware.js.map +0 -1
  209. package/dist/store/navbarSlice.js +0 -71
  210. package/dist/store/navbarSlice.js.map +0 -1
  211. package/dist/store/navigationSlice.js +0 -46
  212. package/dist/store/navigationSlice.js.map +0 -1
  213. package/dist/store/owpSettingsSlice.js +0 -195
  214. package/dist/store/owpSettingsSlice.js.map +0 -1
  215. package/dist/store/store.js +0 -17
  216. package/dist/store/store.js.map +0 -1
  217. package/dist/store/withSlices.js +0 -27
  218. package/dist/store/withSlices.js.map +0 -1
  219. package/dist/types/hooks/useAppStore.d.ts +0 -7
  220. package/dist/types/store/generateReducersFromSlices.d.ts +0 -6
  221. package/dist/types/store/lazyLoadedSlices.d.ts +0 -9
  222. package/dist/types/store/middleware.d.ts +0 -17
  223. package/dist/types/store/navbarSlice.d.ts +0 -22
  224. package/dist/types/store/navigationSlice.d.ts +0 -92
  225. package/dist/types/store/owpSettingsSlice.d.ts +0 -112
  226. package/dist/types/store/store.d.ts +0 -13
  227. package/dist/types/store/withSlices.d.ts +0 -11
  228. /package/dist/components/OwpTreeGrid/{perf.js → utils/perf.js} +0 -0
  229. /package/dist/types/components/OwpMrtTable/{OwpMrtTableNoDataOverlay.d.ts → internal/OwpMrtTableNoDataOverlay.d.ts} +0 -0
  230. /package/dist/types/components/OwpMrtTable/{OwpMrtTableTopToolbar.d.ts → internal/OwpMrtTableTopToolbar.d.ts} +0 -0
  231. /package/dist/types/components/OwpPageCarded/{OwpPageCardedHeader.d.ts → internal/OwpPageCardedHeader.d.ts} +0 -0
  232. /package/dist/types/components/OwpPageCarded/{OwpPageCardedSidebar.d.ts → internal/OwpPageCardedSidebar.d.ts} +0 -0
  233. /package/dist/types/components/OwpPageCarded/{OwpPageCardedSidebarContent.d.ts → internal/OwpPageCardedSidebarContent.d.ts} +0 -0
  234. /package/dist/types/components/OwpPicker/{constants.d.ts → constants/index.d.ts} +0 -0
  235. /package/dist/types/components/OwpPicker/{AnimatedCalendarContainer.d.ts → internal/AnimatedCalendarContainer.d.ts} +0 -0
  236. /package/dist/types/components/OwpPicker/{CalendarContainer.d.ts → internal/CalendarContainer.d.ts} +0 -0
  237. /package/dist/types/components/OwpTreeGrid/{perf.d.ts → utils/perf.d.ts} +0 -0
  238. /package/dist/types/components/OwpZoomImageSlider/{ZoomImage.d.ts → internal/ZoomImage.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"OwpTable.js","sources":["../../../src/components/OwpTable/OwpTable.tsx"],"sourcesContent":["import { Divider, styled, Typography, type SxProps, type Theme } from '@mui/material';\nimport clsx from 'clsx';\nimport GlobalStyles from '@mui/material/GlobalStyles';\nimport Paper from '@mui/material/Paper';\nimport Table, { type TableProps } from '@mui/material/Table';\nimport TableBody from '@mui/material/TableBody';\nimport TableCell from '@mui/material/TableCell';\nimport TableContainer, { type TableContainerProps } from '@mui/material/TableContainer';\nimport TableHead from '@mui/material/TableHead';\nimport TableRow from '@mui/material/TableRow';\nimport { isArray, isEmpty, isNumber } from 'es-toolkit/compat';\nimport { type ReactNode, useMemo } from 'react';\n\ntype OwpTableCellValue = string | number;\ntype OwpTableHeaderRow = Record<string, OwpTableCellValue>;\ntype OwpTableRowData = Record<string, unknown>;\n\nconst getTableColumnKeys = (row?: Record<string, unknown>) => {\n if (!row) {\n return [];\n }\n\n return Object.keys(row).filter((keyName) => !keyName.includes('Span'));\n};\n\nconst getTableCellSx = (row: Record<string, unknown>, keyName: string) => {\n return (row[`${keyName}Sx`] as SxProps<Theme>) ?? {};\n};\n\nconst getTableCellSpan = (\n row: Record<string, unknown>,\n keyName: string,\n spanType: 'ColSpan' | 'RowSpan',\n) => {\n return (row[`${keyName}${spanType}`] as number | undefined) ?? undefined;\n};\n\nconst mergeSx = (...styles: Array<SxProps<Theme> | undefined | false>): SxProps<Theme> =>\n styles.reduce<Array<Exclude<SxProps<Theme>, readonly unknown[]>>>((acc, style) => {\n if (!style) {\n return acc;\n }\n\n return [...acc, ...(isArray(style) ? style : [style])];\n }, []) as SxProps<Theme>;\n\nconst treeGridContainerSx = {\n border: 0,\n borderRadius: 0,\n overflow: 'visible',\n} as const;\n\nconst treeGridFontFaceStyles = {\n '@font-face': {\n fontFamily: 'RobotoLight',\n fontStyle: 'normal',\n fontWeight: 'normal',\n src: \"url('/assets/vendors/Grid/Styles/Roboto-Light.ttf') format('truetype')\",\n },\n} as const;\n\nconst treeGridFontSx = {\n fontFamily: 'RobotoLight, sans-serif',\n fontSize: '14px',\n fontWeight: 'normal',\n lineHeight: '16px',\n} as const;\n\ninterface StyledTableProps extends TableProps {\n canBodyFullHeight?: boolean;\n canUseTreeGridStyle?: boolean;\n containerProps?: TableContainerProps;\n footerSlot?: ReactNode;\n tableLayout?: 'auto' | 'fixed';\n title?: string;\n children: ReactNode;\n}\n\ntype StyledTableInnerProps = Pick<StyledTableProps, 'canBodyFullHeight' | 'canUseTreeGridStyle'>;\n\n/**\n * 총 row 수 표시 영역\n * @param totalCount 전체 row 수\n */\nexport function OwpTableTotalCount({ totalCount }: { totalCount?: number }) {\n return (\n <>\n <Divider />\n <Typography className=\"h-[30px] w-full pr-12 my-8\" align=\"right\">\n 전체: {isNumber(totalCount) ? totalCount.toLocaleString() : 0} 건\n </Typography>\n </>\n );\n}\n\n/**\n * StyledTable 스타일 컴포넌트\n * @param canBodyFullHeight body full height 사용 여부\n * @param canUseTreeGridStyle TreeGrid 스타일 사용 여부\n * @param children 하위 콘텐츠\n * @param containerProps containerProps props\n * @param footerSlot footer 영역\n * @param tableLayout tableLayout 값\n */\nexport const StyledTable = ({\n canBodyFullHeight,\n canUseTreeGridStyle,\n children,\n className,\n containerProps,\n footerSlot,\n tableLayout,\n ...tableProps\n}: StyledTableProps) => {\n return (\n <>\n {canUseTreeGridStyle && <GlobalStyles styles={treeGridFontFaceStyles} />}\n <TableContainer\n component={Paper}\n variant=\"outlined\"\n {...containerProps}\n sx={mergeSx(\n canUseTreeGridStyle && treeGridContainerSx,\n canBodyFullHeight && { height: '100%' },\n containerProps?.sx,\n )}\n >\n <StyledTableInner\n {...tableProps}\n canBodyFullHeight={canBodyFullHeight}\n canUseTreeGridStyle={canUseTreeGridStyle}\n className={clsx(\n canBodyFullHeight && 'h-full',\n tableLayout === 'fixed' ? 'table-fixed' : tableLayout === 'auto' ? 'table-auto' : '',\n className,\n )}\n >\n {children}\n </StyledTableInner>\n {footerSlot}\n </TableContainer>\n </>\n );\n};\n\nconst StyledTableInner = styled(Table, {\n shouldForwardProp: (prop) => prop !== 'canBodyFullHeight' && prop !== 'canUseTreeGridStyle',\n})<StyledTableInnerProps>(({ theme, canBodyFullHeight, canUseTreeGridStyle }) => ({\n ...(canBodyFullHeight && {\n height: '100%',\n }),\n ...(canBodyFullHeight && {\n '& .MuiTableBody-root': {\n height: '100%',\n },\n '& .MuiTableBody-root > .MuiTableRow-root': {\n height: '100%',\n },\n }),\n '& .MuiTableCell-root': canUseTreeGridStyle\n ? {\n boxSizing: 'border-box',\n ...treeGridFontSx,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n verticalAlign: 'middle',\n whiteSpace: 'nowrap',\n }\n : {\n fontSize: '1.7rem',\n padding: '7px 10px',\n borderLeft: `1px solid ${theme.palette.divider}`,\n borderRight: `1px solid ${theme.palette.divider}`,\n '&:first-child': {\n borderLeft: 'none',\n },\n '&:last-child': {\n borderRight: 'none',\n },\n },\n '& th': canUseTreeGridStyle\n ? {\n ...treeGridFontSx,\n backgroundColor: '#586980',\n borderTop: '1px solid #6F7F94',\n borderBottom: '1px solid #6F7F94',\n borderLeft: 0,\n borderRight: '1px solid #6F7F94',\n color: 'white',\n height: 33,\n minHeight: 33,\n padding: '7px 2px 6px 10px',\n '&:first-of-type': {\n borderLeft: '1px solid #6F7F94',\n },\n }\n : {\n backgroundColor: theme.palette.grey[200],\n fontWeight: 600,\n },\n '& td': canUseTreeGridStyle\n ? {\n borderBottom: '1px solid #CDD8E4',\n borderLeft: 0,\n borderRight: '1px solid #CDD8E4',\n color: '#111112',\n padding: '7px 10px 6px',\n '&:first-of-type': {\n borderLeft: '1px solid #CDD8E4',\n },\n }\n : {},\n ...(canUseTreeGridStyle && {\n '& tbody > tr:first-of-type > th:first-of-type': {\n borderTopLeftRadius: 'inherit',\n },\n '& tbody > tr:first-of-type > td:last-of-type': {\n borderTopRightRadius: 'inherit',\n },\n }),\n}));\n\nexport const StyledTableRow = styled(TableRow)`\n /* &:last-child th,\n &:last-child td {\n border-bottom: 0;\n } */\n`;\n\ninterface OwpTableProps<T> extends Omit<StyledTableProps, 'children'> {\n canTotalCountRow?: boolean;\n headers: OwpTableHeaderRow | OwpTableHeaderRow[];\n rows: T[];\n totalCount?: number;\n}\n\n/**\n * OwpTable 컴포넌트\n * @param canTotalCountRow 전체 row 수 표시 여부\n * @param headers headers 값\n * @param rows 행 데이터 목록\n * @param totalCount 전체 row 수\n */\nexport function OwpTable<T>({\n canTotalCountRow = false,\n headers,\n rows,\n totalCount,\n ...restTableProps\n}: OwpTableProps<T>) {\n const resolvedHeaderRows = useMemo(\n () => (isArray(headers) ? headers : isEmpty(headers) ? [] : [headers]),\n [headers],\n );\n const commonKeyListData = useMemo(\n () => getTableColumnKeys(isArray(headers) ? headers[0] : headers),\n [headers],\n );\n\n return (\n <StyledTable\n {...restTableProps}\n footerSlot={\n canTotalCountRow ? (\n <OwpTableTotalCount totalCount={typeof totalCount === 'undefined' ? rows.length : totalCount} />\n ) : undefined\n }\n className={clsx(restTableProps.tableLayout && 'w-full', restTableProps.className)}\n >\n <TableHead>\n {resolvedHeaderRows.map((headerData, index) => (\n <StyledTableRow key={`table-header-${index}`}>\n {getTableColumnKeys(headerData).map((keyName) => (\n <TableCell\n key={`table-header-${index}-${keyName}`}\n className=\"whitespace-pre-wrap\"\n sx={getTableCellSx(headerData, keyName)}\n colSpan={getTableCellSpan(headerData, keyName, 'ColSpan')}\n rowSpan={getTableCellSpan(headerData, keyName, 'RowSpan')}\n align=\"center\"\n >\n {headerData[keyName]}\n </TableCell>\n ))}\n </StyledTableRow>\n ))}\n </TableHead>\n <TableBody>\n {rows.map((row, index) => {\n const currentRow = row as OwpTableRowData;\n\n return (\n <StyledTableRow key={`table-row-${index}`}>\n {commonKeyListData.map((keyName) => (\n <TableCell\n key={`table-row-cell-${index}-${keyName}`}\n className=\"whitespace-pre-wrap h-64\"\n sx={getTableCellSx(currentRow, keyName)}\n align=\"center\"\n >\n {currentRow[keyName] as ReactNode}\n </TableCell>\n ))}\n </StyledTableRow>\n );\n })}\n </TableBody>\n </StyledTable>\n );\n}\n"],"names":["getTableColumnKeys","__name","row","keyName","getTableCellSx","getTableCellSpan","spanType","mergeSx","styles","acc","style","isArray","treeGridContainerSx","treeGridFontFaceStyles","treeGridFontSx","OwpTableTotalCount","totalCount","jsxs","Fragment","jsx","Divider","Typography","isNumber","StyledTable","canBodyFullHeight","canUseTreeGridStyle","children","className","containerProps","footerSlot","tableLayout","tableProps","GlobalStyles","TableContainer","Paper","StyledTableInner","clsx","styled","Table","prop","theme","StyledTableRow","TableRow","OwpTable","canTotalCountRow","headers","rows","restTableProps","resolvedHeaderRows","useMemo","isEmpty","commonKeyListData","TableHead","headerData","index","TableCell","TableBody","currentRow"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAMA,IAAqB,gBAAAC,EAAA,CAACC,MACrBA,IAIE,OAAO,KAAKA,CAAG,EAAE,OAAO,CAACC,MAAY,CAACA,EAAQ,SAAS,MAAM,CAAC,IAH5D,CAAA,GAFgB,uBAQrBC,IAAiB,gBAAAH,EAAA,CAACC,GAA8BC,MAC5CD,EAAI,GAAGC,CAAO,IAAI,KAAwB,CAAA,GAD7B,mBAIjBE,IAAmB,gBAAAJ,EAAA,CACvBC,GACAC,GACAG,MAEQJ,EAAI,GAAGC,CAAO,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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AYC,MACnC,gBAAAnC,EAACsB,GAAA,EACE,UAAAzC,EAAmBqD,CAAU,EAAE,IAAI,CAAClD,MACnC,gBAAAgB;AAAA,UAACoC;AAAA,UAAA;AAAA,YAEC,WAAU;AAAA,YACV,IAAInD,EAAeiD,GAAYlD,CAAO;AAAA,YACtC,SAASE,EAAiBgD,GAAYlD,GAAS,SAAS;AAAA,YACxD,SAASE,EAAiBgD,GAAYlD,GAAS,SAAS;AAAA,YACxD,OAAM;AAAA,YAEL,YAAWA,CAAO;AAAA,UAAA;AAAA,UAPd,gBAAgBmD,CAAK,IAAInD,CAAO;AAAA,QAAA,CASxC,EAAA,GAZkB,gBAAgBmD,CAAK,EAa1C,CACD,EAAA,CACH;AAAA,0BACCE,GAAA,EACE,UAAAV,EAAK,IAAI,CAAC5C,GAAKoD,MAAU;AACxB,gBAAMG,IAAavD;AAEnB,iBACE,gBAAAiB,EAACsB,GAAA,EACE,UAAAU,EAAkB,IAAI,CAAChD,MACtB,gBAAAgB;AAAA,YAACoC;AAAA,YAAA;AAAA,cAEC,WAAU;AAAA,cACV,IAAInD,EAAeqD,GAAYtD,CAAO;AAAA,cACtC,OAAM;AAAA,cAEL,YAAWA,CAAO;AAAA,YAAA;AAAA,YALd,kBAAkBmD,CAAK,IAAInD,CAAO;AAAA,UAAA,CAO1C,KAVkB,aAAamD,CAAK,EAWvC;AAAA,QAEJ,CAAC,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAlEgBrD,EAAA0C,IAAA;"}
1
+ {"version":3,"file":"OwpTable.js","sources":["../../../src/components/OwpTable/OwpTable.tsx"],"sourcesContent":["import { Divider, styled, Typography, type SxProps, type Theme } from '@mui/material';\nimport clsx from 'clsx';\nimport GlobalStyles from '@mui/material/GlobalStyles';\nimport Paper from '@mui/material/Paper';\nimport Table, { type TableProps } from '@mui/material/Table';\nimport TableBody from '@mui/material/TableBody';\nimport TableCell from '@mui/material/TableCell';\nimport TableContainer, { type TableContainerProps } from '@mui/material/TableContainer';\nimport TableHead from '@mui/material/TableHead';\nimport TableRow from '@mui/material/TableRow';\nimport { isArray, isEmpty, isNumber } from 'es-toolkit/compat';\nimport { type ReactNode, useMemo } from 'react';\n\ntype OwpTableCellValue = string | number;\ntype OwpTableHeaderRow = Record<string, OwpTableCellValue>;\ntype OwpTableRowData = Record<string, unknown>;\n\nconst getTableColumnKeys = (row?: Record<string, unknown>) => {\n if (!row) {\n return [];\n }\n\n return Object.keys(row).filter((keyName) => !keyName.includes('Span'));\n};\n\nconst getTableCellSx = (row: Record<string, unknown>, keyName: string) => {\n return (row[`${keyName}Sx`] as SxProps<Theme>) ?? {};\n};\n\nconst getTableCellSpan = (\n row: Record<string, unknown>,\n keyName: string,\n spanType: 'ColSpan' | 'RowSpan',\n) => {\n return (row[`${keyName}${spanType}`] as number | undefined) ?? undefined;\n};\n\nconst mergeSx = (...styles: Array<SxProps<Theme> | undefined | false>): SxProps<Theme> =>\n styles.reduce<Array<Exclude<SxProps<Theme>, readonly unknown[]>>>((acc, style) => {\n if (!style) {\n return acc;\n }\n\n return [...acc, ...(isArray(style) ? style : [style])];\n }, []) as SxProps<Theme>;\n\nconst treeGridContainerSx = {\n border: 0,\n borderRadius: 0,\n overflow: 'visible',\n} as const;\n\nconst treeGridFontFaceStyles = {\n '@font-face': {\n fontFamily: 'RobotoLight',\n fontStyle: 'normal',\n fontWeight: 'normal',\n src: \"url('/assets/vendors/Grid/Styles/Roboto-Light.ttf') format('truetype')\",\n },\n} as const;\n\nconst treeGridFontSx = {\n fontFamily: 'RobotoLight, sans-serif',\n fontSize: '14px',\n fontWeight: 'normal',\n lineHeight: '16px',\n} as const;\n\ninterface StyledTableProps extends TableProps {\n canBodyFullHeight?: boolean;\n canUseTreeGridStyle?: boolean;\n containerProps?: TableContainerProps;\n footerSlot?: ReactNode;\n tableLayout?: 'auto' | 'fixed';\n title?: string;\n children: ReactNode;\n}\n\ntype StyledTableInnerProps = Pick<StyledTableProps, 'canBodyFullHeight' | 'canUseTreeGridStyle'>;\n\n/**\n * 총 row 수 표시 영역\n * @param totalCount 전체 row 수\n */\nexport function OwpTableTotalCount({ totalCount }: { totalCount?: number }) {\n return (\n <>\n <Divider />\n <Typography className=\"h-[30px] w-full pr-12 my-8\" align=\"right\">\n 전체: {isNumber(totalCount) ? totalCount.toLocaleString() : 0} 건\n </Typography>\n </>\n );\n}\n\n/**\n * StyledTable 스타일 컴포넌트\n * @param canBodyFullHeight body full height 사용 여부\n * @param canUseTreeGridStyle TreeGrid 스타일 사용 여부\n * @param children 하위 콘텐츠\n * @param containerProps containerProps props\n * @param footerSlot footer 영역\n * @param tableLayout tableLayout 값\n */\nexport const StyledTable = ({\n canBodyFullHeight,\n canUseTreeGridStyle,\n children,\n className,\n containerProps,\n footerSlot,\n tableLayout,\n ...tableProps\n}: StyledTableProps) => {\n return (\n <>\n {canUseTreeGridStyle && <GlobalStyles styles={treeGridFontFaceStyles} />}\n <TableContainer\n component={Paper}\n variant=\"outlined\"\n {...containerProps}\n sx={mergeSx(\n canUseTreeGridStyle && treeGridContainerSx,\n canBodyFullHeight && { height: '100%' },\n containerProps?.sx,\n )}\n >\n <StyledTableInner\n {...tableProps}\n canBodyFullHeight={canBodyFullHeight}\n canUseTreeGridStyle={canUseTreeGridStyle}\n className={clsx(\n canBodyFullHeight && 'h-full',\n tableLayout === 'fixed' ? 'table-fixed' : tableLayout === 'auto' ? 'table-auto' : '',\n className,\n )}\n >\n {children}\n </StyledTableInner>\n {footerSlot}\n </TableContainer>\n </>\n );\n};\n\nconst StyledTableInner = styled(Table, {\n shouldForwardProp: (prop) => prop !== 'canBodyFullHeight' && prop !== 'canUseTreeGridStyle',\n})<StyledTableInnerProps>(({ theme, canBodyFullHeight, canUseTreeGridStyle }) => ({\n ...(canBodyFullHeight && {\n height: '100%',\n }),\n ...(canBodyFullHeight && {\n '& .MuiTableBody-root': {\n height: '100%',\n },\n '& .MuiTableBody-root > .MuiTableRow-root': {\n height: '100%',\n },\n }),\n '& .MuiTableCell-root': canUseTreeGridStyle\n ? {\n boxSizing: 'border-box',\n ...treeGridFontSx,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n verticalAlign: 'middle',\n whiteSpace: 'nowrap',\n }\n : {\n fontSize: '1.7rem',\n padding: '7px 10px',\n borderLeft: 'none',\n borderRight: 'none',\n },\n ...(!canUseTreeGridStyle && {\n '& .MuiTableRow-root > .MuiTableCell-root + .MuiTableCell-root': {\n borderLeft: `1px solid ${theme.palette.divider}`,\n },\n }),\n '& th': canUseTreeGridStyle\n ? {\n ...treeGridFontSx,\n backgroundColor: '#586980',\n borderTop: '1px solid #6F7F94',\n borderBottom: '1px solid #6F7F94',\n borderLeft: 0,\n borderRight: '1px solid #6F7F94',\n color: 'white',\n height: 33,\n minHeight: 33,\n padding: '7px 2px 6px 10px',\n '&:first-of-type': {\n borderLeft: '1px solid #6F7F94',\n },\n }\n : {\n backgroundColor: theme.palette.grey[200],\n fontWeight: 600,\n },\n '& td': canUseTreeGridStyle\n ? {\n borderBottom: '1px solid #CDD8E4',\n borderLeft: 0,\n borderRight: '1px solid #CDD8E4',\n color: '#111112',\n padding: '7px 10px 6px',\n '&:first-of-type': {\n borderLeft: '1px solid #CDD8E4',\n },\n }\n : {},\n ...(canUseTreeGridStyle && {\n '& tbody > tr:first-of-type > th:first-of-type': {\n borderTopLeftRadius: 'inherit',\n },\n '& tbody > tr:first-of-type > td:last-of-type': {\n borderTopRightRadius: 'inherit',\n },\n }),\n}));\n\nexport const StyledTableRow = styled(TableRow)`\n /* &:last-child th,\n &:last-child td {\n border-bottom: 0;\n } */\n`;\n\ninterface OwpTableProps<T> extends Omit<StyledTableProps, 'children'> {\n canTotalCountRow?: boolean;\n headers: OwpTableHeaderRow | OwpTableHeaderRow[];\n rows: T[];\n totalCount?: number;\n}\n\n/**\n * OwpTable 컴포넌트\n * @param canTotalCountRow 전체 row 수 표시 여부\n * @param headers headers 값\n * @param rows 행 데이터 목록\n * @param totalCount 전체 row 수\n */\nexport function OwpTable<T>({\n canTotalCountRow = false,\n headers,\n rows,\n totalCount,\n ...restTableProps\n}: OwpTableProps<T>) {\n const resolvedHeaderRows = useMemo(\n () => (isArray(headers) ? headers : isEmpty(headers) ? [] : [headers]),\n [headers],\n );\n const commonKeyListData = useMemo(\n () => getTableColumnKeys(isArray(headers) ? headers[0] : headers),\n [headers],\n );\n\n return (\n <StyledTable\n {...restTableProps}\n footerSlot={\n canTotalCountRow ? (\n <OwpTableTotalCount totalCount={typeof totalCount === 'undefined' ? rows.length : totalCount} />\n ) : undefined\n }\n className={clsx(restTableProps.tableLayout && 'w-full', restTableProps.className)}\n >\n <TableHead>\n {resolvedHeaderRows.map((headerData, index) => (\n <StyledTableRow key={`table-header-${index}`}>\n {getTableColumnKeys(headerData).map((keyName) => (\n <TableCell\n key={`table-header-${index}-${keyName}`}\n className=\"whitespace-pre-wrap\"\n sx={getTableCellSx(headerData, keyName)}\n colSpan={getTableCellSpan(headerData, keyName, 'ColSpan')}\n rowSpan={getTableCellSpan(headerData, keyName, 'RowSpan')}\n align=\"center\"\n >\n {headerData[keyName]}\n </TableCell>\n ))}\n </StyledTableRow>\n ))}\n </TableHead>\n <TableBody>\n {rows.map((row, index) => {\n const currentRow = row as OwpTableRowData;\n\n return (\n <StyledTableRow key={`table-row-${index}`}>\n {commonKeyListData.map((keyName) => (\n <TableCell\n key={`table-row-cell-${index}-${keyName}`}\n className=\"whitespace-pre-wrap h-64\"\n sx={getTableCellSx(currentRow, keyName)}\n align=\"center\"\n >\n {currentRow[keyName] as ReactNode}\n </TableCell>\n ))}\n </StyledTableRow>\n );\n })}\n </TableBody>\n </StyledTable>\n );\n}\n"],"names":["getTableColumnKeys","__name","row","keyName","getTableCellSx","getTableCellSpan","spanType","mergeSx","styles","acc","style","isArray","treeGridContainerSx","treeGridFontFaceStyles","treeGridFontSx","OwpTableTotalCount","totalCount","jsxs","Fragment","jsx","Divider","Typography","isNumber","StyledTable","canBodyFullHeight","canUseTreeGridStyle","children","className","containerProps","footerSlot","tableLayout","tableProps","GlobalStyles","TableContainer","Paper","StyledTableInner","clsx","styled","Table","prop","theme","StyledTableRow","TableRow","OwpTable","canTotalCountRow","headers","rows","restTableProps","resolvedHeaderRows","useMemo","isEmpty","commonKeyListData","TableHead","headerData","index","TableCell","TableBody","currentRow"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAMA,IAAqB,gBAAAC,EAAA,CAACC,MACrBA,IAIE,OAAO,KAAKA,CAAG,EAAE,OAAO,CAACC,MAAY,CAACA,EAAQ,SAAS,MAAM,CAAC,IAH5D,CAAA,GAFgB,uBAQrBC,IAAiB,gBAAAH,EAAA,CAACC,GAA8BC,MAC5CD,EAAI,GAAGC,CAAO,IAAI,KAAwB,CAAA,GAD7B,mBAIjBE,IAAmB,gBAAAJ,EAAA,CACvBC,GACAC,GACAG,MAEQJ,EAAI,GAAGC,CAAO,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,IAAyB;AAAA,EAC7B,cAAc;AAAA,IACZ,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,KAAK;AAAA,EAAA;AAET,GAEMC,IAAiB;AAAA,EACrB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,YAAY;AACd;AAkBO,SAASC,EAAmB,EAAE,YAAAC,KAAuC;AAC1E,SACE,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAQ;AAAA,IACT,gBAAAH,EAACI,GAAA,EAAW,WAAU,8BAA6B,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K,EAa1C,CACD,EAAA,CACH;AAAA,0BACCE,GAAA,EACE,UAAAV,EAAK,IAAI,CAAC5C,GAAKoD,MAAU;AACxB,gBAAMG,IAAavD;AAEnB,iBACE,gBAAAiB,EAACsB,GAAA,EACE,UAAAU,EAAkB,IAAI,CAAChD,MACtB,gBAAAgB;AAAA,YAACoC;AAAA,YAAA;AAAA,cAEC,WAAU;AAAA,cACV,IAAInD,EAAeqD,GAAYtD,CAAO;AAAA,cACtC,OAAM;AAAA,cAEL,YAAWA,CAAO;AAAA,YAAA;AAAA,YALd,kBAAkBmD,CAAK,IAAInD,CAAO;AAAA,UAAA,CAO1C,KAVkB,aAAamD,CAAK,EAWvC;AAAA,QAEJ,CAAC,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAlEgBrD,EAAA0C,IAAA;"}
@@ -1,345 +1,200 @@
1
- var _e = Object.defineProperty;
2
- var i = (e, t) => _e(e, "name", { value: t, configurable: !0 });
3
- import { jsxs as Ee, jsx as Z } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
4
- import { useOwpTranslation as Ne } from "../../hooks/useOwpTranslation.js";
1
+ var Ae = Object.defineProperty;
2
+ var a = (r, u) => Ae(r, "name", { value: u, configurable: !0 });
3
+ import { jsxs as Ne, jsx as H } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
4
+ import { useOwpTranslation as Pe } from "../../hooks/useOwpTranslation.js";
5
5
  import { useGetCurrentLanguage as Ve } from "../../hooks/useCurrentLanguage.js";
6
- import { TREE_GRID_BODY_ROWS_CHANGED_EVENT as ye } from "../../utils/treeGridBodyRowsEvent.js";
7
- import { getTreeGridPerfTimestamp as H, countTreeGridPerf as Ge, logTreeGridPerf as Re, measureTreeGridPerf as te } from "./perf.js";
8
- import { useRef as d, useState as ee, useEffect as $, useLayoutEffect as Pe } from "react";
9
- import { useOwpTreeGridOverlayFrame as he } from "./hooks/useOwpTreeGridOverlayFrame.js";
10
- import { OwpTreeGridLoadingOverlay as ke } from "./OwpTreeGridLoadingOverlay.js";
11
- import { OwpTreeGridNoDataOverlay as Fe } from "./OwpTreeGridNoDataOverlay.js";
12
- import { applyTreeGridLayoutToGrid as Be } from "./utils/index.js";
13
- import { isEmpty as V } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js";
14
- import { delay as Ue } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/function/delay.js";
15
- import { isEqual as $e } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/predicate/isEqual.js";
16
- import { omit as Me } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/object/omit.js";
17
- import { debounce as M } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/function/debounce.js";
18
- import { get as je } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/object/get.js";
19
- const qe = 300, we = {
20
- en: "/assets/vendors/Grid/TextEN.xml",
21
- kr: "/assets/vendors/Grid/TextKR.xml"
22
- }, Oe = /* @__PURE__ */ i((e) => `${e}?noCache=${Date.now()}`, "appendNoCacheQuery"), Ke = /* @__PURE__ */ i((e) => e === "kr" ? we.kr : we.en, "getTreeGridTextResourceUrl"), We = /* @__PURE__ */ i((e) => e != null && e.includes("assets") ? Oe(e) : (
23
- // @ts-expect-error - API base URL env is provided by host app
24
- `undefined/${e}?noCache=${Date.now()}`
25
- ), "resolveTreeGridDataUrl"), ze = /* @__PURE__ */ i((e, t, a) => e ? { Url: We(t) } : { Data: { Body: [V(a) ? [] : a] } }, "buildTreeGridDataSource"), Qe = /* @__PURE__ */ i(({
26
- id: e,
27
- layoutUrl: t,
28
- dataUrl: a,
29
- bodyData: G,
30
- useDataUrl: R,
31
- width: D,
32
- height: v,
33
- languageId: b
34
- }) => ({
35
- id: e,
36
- Layout: { Url: Oe(t ?? "") },
37
- Data: ze(R, a, G),
38
- Text: {
39
- Url: Ke(b)
40
- },
41
- width: D,
42
- height: v,
43
- Debug: "Error"
44
- }), "buildTreeGridInitializationOptions"), De = /* @__PURE__ */ i((e) => je(e, "Data.Data.Data.Body.0"), "getTreeGridBodyData"), j = /* @__PURE__ */ i((e) => Array.isArray(e) ? e.length : 0, "getTreeGridBodyDataCount"), Xe = /* @__PURE__ */ i((e) => {
45
- const t = e == null ? void 0 : e.Visible;
46
- return !!e && t !== 0 && t !== !1 && t !== "0";
47
- }, "isVisibleTreeGridRow"), Ye = /* @__PURE__ */ i((e) => {
48
- const t = e == null ? void 0 : e.Added;
49
- return !!e && t !== 0 && t !== !1 && t !== "0" && t !== void 0;
50
- }, "isAddedTreeGridRow"), ve = /* @__PURE__ */ i((e) => !e || e.Fixed === "Foot" || !Xe(e) ? !1 : e.Kind === "Data" || Ye(e), "isDisplayTreeGridRow"), be = /* @__PURE__ */ i((e) => {
51
- if (!e)
52
- return !1;
53
- if (typeof e.GetFirst == "function" && typeof e.GetNext == "function") {
54
- let t = e.GetFirst();
55
- for (; t; ) {
56
- if (ve(t))
57
- return !0;
58
- t = e.GetNext(t);
59
- }
60
- return !1;
61
- }
62
- return Object.values(e.Rows ?? {}).some((t) => ve(t));
63
- }, "hasTreeGridDisplayDataRows"), Je = /* @__PURE__ */ i((e, t, a) => {
64
- var R;
65
- const G = (R = e.Data) == null ? void 0 : R.Data;
66
- e.Data.Data = {
67
- ...G,
68
- Data: { Body: [t || []] },
69
- Url: ""
70
- }, e.ReloadBody(a);
71
- }, "replaceTreeGridBodyData"), Ze = /* @__PURE__ */ i(({
72
- id: e,
73
- latestEventHandlersRef: t,
74
- treeGridInstanceRef: a,
75
- treeGridInitStartedAtRef: G,
76
- latestLayoutOverridesRef: R,
77
- appliedLayoutOverridesRef: D,
78
- appliedBodyDataPropRef: v,
79
- hasAppliedInitialLayoutRef: b,
80
- syncHasDisplayDataRows: w,
81
- setIsTreeGridReady: S
82
- }) => {
83
- const r = t.current;
84
- window.TGSetEvent("OnRowAdd", e, (o, c) => {
85
- var n, u;
86
- c.CanEdit = 1, c.CanDelete = 1, (u = (n = t.current) == null ? void 0 : n.onRowAdd) == null || u.call(n, o, c);
87
- }), window.TGSetEvent("OnRowAdded", e, (o) => {
88
- w(o);
89
- }), typeof (r == null ? void 0 : r.onRowClick) == "function" && window.TGSetEvent(
90
- "OnClick",
91
- e,
92
- M((o, c, n, u, s, l) => {
93
- var p, C;
94
- (C = (p = t.current) == null ? void 0 : p.onRowClick) == null || C.call(
95
- p,
96
- o,
97
- c,
98
- n,
99
- u,
100
- s,
101
- l
102
- );
103
- }, 300)
104
- ), typeof (r == null ? void 0 : r.onClickButton) == "function" && window.TGSetEvent(
105
- "OnClickButton",
106
- e,
107
- M((o, c, n, u) => {
108
- var s, l;
109
- (l = (s = t.current) == null ? void 0 : s.onClickButton) == null || l.call(
110
- s,
111
- o,
112
- c,
113
- n,
114
- u
115
- );
116
- }, 300)
117
- ), typeof (r == null ? void 0 : r.onRowDelete) == "function" ? window.TGSetEvent("OnRowDelete", e, (o, c, n) => {
118
- var u, s;
119
- w(o), (s = (u = t.current) == null ? void 0 : u.onRowDelete) == null || s.call(
120
- u,
121
- o,
122
- c,
123
- n
124
- );
125
- }) : window.TGSetEvent("OnRowDelete", e, (o) => {
126
- w(o);
127
- }), typeof (r == null ? void 0 : r.onRowUndelete) == "function" ? window.TGSetEvent("OnRowUndelete", e, (o, c) => {
128
- var n, u;
129
- w(o), (u = (n = t.current) == null ? void 0 : n.onRowUndelete) == null || u.call(n, o, c);
130
- }) : window.TGSetEvent("OnRowUndelete", e, (o) => {
131
- w(o);
132
- }), (typeof (r == null ? void 0 : r.onAfterValueChanged) == "function" || typeof (r == null ? void 0 : r.onRowChange) == "function") && window.TGSetEvent("OnAfterValueChanged", e, (o, c, n, u) => {
133
- var l, p;
134
- const s = ((l = t.current) == null ? void 0 : l.onAfterValueChanged) ?? ((p = t.current) == null ? void 0 : p.onRowChange);
135
- s == null || s(o, c, n, u);
136
- }), typeof (r == null ? void 0 : r.onSelect) == "function" && window.TGSetEvent(
137
- "OnSelect",
138
- e,
139
- M((o) => {
140
- var n, u;
141
- const c = o.GetSelRows() ?? [];
142
- (u = (n = t.current) == null ? void 0 : n.onSelect) == null || u.call(n, c);
143
- }, 100)
144
- ), typeof (r == null ? void 0 : r.onSave) == "function" && window.TGSetEvent("OnSave", e, (o, c, n) => {
145
- var u, s;
146
- (s = (u = t.current) == null ? void 0 : u.onSave) == null || s.call(
147
- u,
148
- o,
149
- c,
150
- n
151
- );
152
- }), window.TGSetEvent(
153
- "OnReady",
154
- e,
155
- M((o) => {
156
- var c, n;
157
- if (!b.current) {
158
- const u = R.current;
159
- b.current = !0, Be(o, u), a.current = o, D.current = u, v.current = De(o), w(o), S(!0), te(e, "TreeGrid init ready", G.current, {
160
- bodyRowCount: j(
161
- De(o)
162
- )
163
- }), G.current = null, (n = (c = t.current) == null ? void 0 : c.onReady) == null || n.call(c, o);
164
- }
165
- }, 100)
166
- );
167
- }, "bindTreeGridEvents"), Gt = /* @__PURE__ */ i(({
168
- id: e = "treeGridWrapper",
169
- containerStyle: t,
170
- containerClassName: a,
171
- className: G,
172
- style: R,
173
- height: D = "100%",
174
- width: v = "100%",
175
- layoutUrl: b,
176
- dataUrl: w,
177
- layoutOverrides: S,
178
- data: r,
179
- useDataUrl: o,
180
- onSelect: c,
181
- onRowClick: n,
182
- onRowAdd: u,
183
- onRowDelete: s,
184
- onRowUndelete: l,
185
- onRowChange: p,
186
- onClickButton: C,
187
- onSave: re,
188
- onReady: oe,
189
- onAfterValueChanged: ne,
190
- loading: Se,
191
- showLoading: T = !0
6
+ import { TREE_GRID_BODY_ROWS_CHANGED_EVENT as pe } from "../../utils/treeGridBodyRowsEvent.js";
7
+ import { getTreeGridPerfTimestamp as C, countTreeGridPerf as me, logTreeGridPerf as ye, measureTreeGridPerf as Re } from "./utils/perf.js";
8
+ import { useRef as e, useState as S, useEffect as I, useLayoutEffect as xe } from "react";
9
+ import { useOwpTreeGridOverlayFrame as He } from "./hooks/useOwpTreeGridOverlayFrame.js";
10
+ import { bindTreeGridEvents as Ce, getTreeGridBodyDataCount as M, buildTreeGridInitializationOptions as Se, hasTreeGridDisplayDataRows as ve, replaceTreeGridBodyData as Me, TREE_GRID_BINDING_LOADING_MIN_VISIBLE_MS as qe } from "./internal/treeGridRuntime.js";
11
+ import { applyTreeGridLayoutToGrid as je } from "./internal/treeGridLayout.js";
12
+ import { OwpTreeGridLoadingOverlay as Fe } from "./internal/OwpTreeGridLoadingOverlay.js";
13
+ import { OwpTreeGridNoDataOverlay as We } from "./internal/OwpTreeGridNoDataOverlay.js";
14
+ import { isEmpty as E } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js";
15
+ import { delay as ze } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/function/delay.js";
16
+ import { isEqual as Ye } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/predicate/isEqual.js";
17
+ import { omit as he } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/object/omit.js";
18
+ const cr = /* @__PURE__ */ a(({
19
+ id: r = "treeGridWrapper",
20
+ containerStyle: u,
21
+ containerClassName: Te,
22
+ className: Ge,
23
+ style: De,
24
+ height: q = "100%",
25
+ width: j = "100%",
26
+ layoutUrl: be,
27
+ dataUrl: ge,
28
+ layoutOverrides: w,
29
+ data: n,
30
+ useDataUrl: F,
31
+ onSelect: W,
32
+ onRowClick: z,
33
+ onRowAdd: Y,
34
+ onRowDelete: h,
35
+ onRowUndelete: J,
36
+ onRowChange: K,
37
+ onClickButton: Q,
38
+ onSave: X,
39
+ onReady: Z,
40
+ onAfterValueChanged: $,
41
+ highlightEditableCells: U = !0,
42
+ highlightChangedCells: k = !0,
43
+ loading: Be,
44
+ showLoading: o = !0
192
45
  }) => {
193
- const { t: Ce } = Ne(), m = d(null), ue = d(null), ce = d(null), q = d(null), K = d(S), ie = d(r), se = d({
194
- onSelect: c,
195
- onRowClick: n,
196
- onRowAdd: u,
197
- onRowDelete: s,
198
- onRowUndelete: l,
199
- onRowChange: p,
200
- onClickButton: C,
201
- onSave: re,
202
- onReady: oe,
203
- onAfterValueChanged: ne
204
- }), g = d(void 0), W = d(!1), P = d(void 0), h = d(void 0), ge = d(!1), I = d(0), B = d(null), A = d(void 0), L = d(void 0), [z, Ie] = ee(!1), [Ae, x] = ee(!1), [Le, de] = ee(!1), k = Ve(), fe = d(k.id), xe = T && r !== void 0 && z && h.current !== r, Q = T && Se === !0 || T && (Ae || xe), X = !Q && r !== void 0 && V(r) && !Le, ae = /* @__PURE__ */ i((f) => {
205
- de(be(f));
46
+ const { t: Ie } = Pe(), i = e(null), ee = e(null), re = e(null), L = e(null), O = e(w), te = e(n), ne = e({
47
+ onSelect: W,
48
+ onRowClick: z,
49
+ onRowAdd: Y,
50
+ onRowDelete: h,
51
+ onRowUndelete: J,
52
+ onRowChange: K,
53
+ onClickButton: Q,
54
+ onSave: X,
55
+ onReady: Z,
56
+ onAfterValueChanged: $
57
+ }), l = e(void 0), _ = e(!1), G = e(void 0), D = e(void 0), Ee = e(!1), f = e(0), c = e(null), p = e(void 0), m = e(void 0), oe = e(U), ie = e(k), [A, we] = S(!1), [Le, y] = S(!1), [Oe, se] = S(!1), b = Ve(), ue = e(b.id), _e = o && n !== void 0 && A && D.current !== n, N = o && Be === !0 || o && (Le || _e), P = !N && n !== void 0 && E(n) && !Oe, ae = /* @__PURE__ */ a((t) => {
58
+ se(ve(t));
206
59
  }, "syncHasDisplayDataRows");
207
- K.current = S, ie.current = r, se.current = {
208
- onSelect: c,
209
- onRowClick: n,
210
- onRowAdd: u,
211
- onRowDelete: s,
212
- onRowUndelete: l,
213
- onRowChange: p,
214
- onClickButton: C,
215
- onSave: re,
216
- onReady: oe,
217
- onAfterValueChanged: ne
60
+ O.current = w, te.current = n, oe.current = U, ie.current = k, ne.current = {
61
+ onSelect: W,
62
+ onRowClick: z,
63
+ onRowAdd: Y,
64
+ onRowDelete: h,
65
+ onRowUndelete: J,
66
+ onRowChange: K,
67
+ onClickButton: Q,
68
+ onSave: X,
69
+ onReady: Z,
70
+ onAfterValueChanged: $
218
71
  };
219
- const le = he({
220
- visible: Q || X,
221
- containerRef: ue,
222
- treeGridInstanceRef: m,
223
- debugId: e
224
- }), F = /* @__PURE__ */ i(() => {
225
- A.current !== void 0 && (window.clearTimeout(A.current), A.current = void 0);
226
- }, "clearBindingLoadingHideTimeout"), Y = /* @__PURE__ */ i(() => {
227
- L.current !== void 0 && (window.clearTimeout(L.current), L.current = void 0);
72
+ const ce = He({
73
+ visible: N || P,
74
+ containerRef: ee,
75
+ treeGridInstanceRef: i,
76
+ debugId: r
77
+ }), g = /* @__PURE__ */ a(() => {
78
+ p.current !== void 0 && (window.clearTimeout(p.current), p.current = void 0);
79
+ }, "clearBindingLoadingHideTimeout"), V = /* @__PURE__ */ a(() => {
80
+ m.current !== void 0 && (window.clearTimeout(m.current), m.current = void 0);
228
81
  }, "clearBodyReloadStartTimeout");
229
- $(() => {
230
- const f = /* @__PURE__ */ i((y) => {
231
- var E;
232
- ((E = y.detail) == null ? void 0 : E.gridId) === e && de(be(m.current));
82
+ I(() => {
83
+ const t = /* @__PURE__ */ a((s) => {
84
+ var v;
85
+ ((v = s.detail) == null ? void 0 : v.gridId) === r && se(ve(i.current));
233
86
  }, "handleBodyRowsChanged");
234
- return window.addEventListener(ye, f), () => {
235
- window.removeEventListener(ye, f);
87
+ return window.addEventListener(pe, t), () => {
88
+ window.removeEventListener(pe, t);
236
89
  };
237
- }, [e]), $(() => {
238
- T || (Y(), F(), B.current = null, x(!1));
239
- }, [T]), $(() => {
240
- var f;
241
- if (k.id !== fe.current && !V(m.current) && ((f = m.current) == null || f.Dispose(), m.current = null, fe.current = k.id), !!V(m.current))
242
- return Ze({
243
- id: e,
244
- latestEventHandlersRef: se,
245
- treeGridInstanceRef: m,
246
- treeGridInitStartedAtRef: ce,
247
- latestLayoutOverridesRef: K,
248
- appliedLayoutOverridesRef: P,
249
- appliedBodyDataPropRef: h,
250
- hasAppliedInitialLayoutRef: ge,
90
+ }, [r]), I(() => {
91
+ o || (V(), g(), c.current = null, y(!1));
92
+ }, [o]), I(() => {
93
+ var t;
94
+ if (b.id !== ue.current && !E(i.current) && ((t = i.current) == null || t.Dispose(), i.current = null, ue.current = b.id), !!E(i.current))
95
+ return Ce({
96
+ id: r,
97
+ latestEventHandlersRef: ne,
98
+ highlightEditableCellsRef: oe,
99
+ highlightChangedCellsRef: ie,
100
+ treeGridInstanceRef: i,
101
+ treeGridInitStartedAtRef: re,
102
+ latestLayoutOverridesRef: O,
103
+ appliedLayoutOverridesRef: G,
104
+ appliedBodyDataPropRef: D,
105
+ hasAppliedInitialLayoutRef: Ee,
251
106
  syncHasDisplayDataRows: ae,
252
- setIsTreeGridReady: Ie
253
- }), ce.current = H(), Ge(e, "init"), Re(e, "TreeGrid init start", {
254
- useDataUrl: !!o,
255
- bodyRowCount: j(r)
107
+ setIsTreeGridReady: we
108
+ }), re.current = C(), me(r, "init"), ye(r, "TreeGrid init start", {
109
+ useDataUrl: !!F,
110
+ bodyRowCount: M(n)
256
111
  }), window.TreeGrid(
257
- Qe({
258
- id: e,
259
- layoutUrl: b,
260
- dataUrl: w,
261
- bodyData: r,
262
- useDataUrl: o,
263
- width: v,
264
- height: D,
265
- languageId: k.id
112
+ Se({
113
+ id: r,
114
+ layoutUrl: be,
115
+ dataUrl: ge,
116
+ bodyData: n,
117
+ useDataUrl: F,
118
+ width: j,
119
+ height: q,
120
+ languageId: b.id
266
121
  }),
267
- e,
268
- e
122
+ r,
123
+ r
269
124
  ), () => {
270
- Ue(() => {
271
- var y;
272
- (y = m.current) == null || y.Dispose();
125
+ ze(() => {
126
+ var s;
127
+ (s = i.current) == null || s.Dispose();
273
128
  }, 200);
274
129
  };
275
- }, []), Pe(() => {
276
- const f = m.current, y = K.current, _ = ie.current;
277
- if (V(f) || !z)
130
+ }, []), xe(() => {
131
+ const t = i.current, s = O.current, R = te.current;
132
+ if (E(t) || !A)
278
133
  return;
279
- const E = P.current !== y && !$e(P.current, y), U = h.current !== _ && (!W.current || g.current !== _);
280
- if (!(!E && !U)) {
281
- if (E) {
282
- const O = H();
283
- Be(f, y, U), P.current = y, te(e, "apply layout", O, {
284
- disableBodyReload: !!U
134
+ const v = G.current !== s && !Ye(G.current, s), B = D.current !== R && (!_.current || l.current !== R);
135
+ if (!(!v && !B)) {
136
+ if (v) {
137
+ const d = C();
138
+ je(t, s, B), G.current = s, Re(r, "apply layout", d, {
139
+ disableBodyReload: !!B
285
140
  });
286
141
  }
287
- if (U) {
288
- const O = I.current + 1, pe = /* @__PURE__ */ i(() => {
289
- const N = g.current;
290
- L.current = void 0, q.current = H(), Ge(e, "reload"), Re(e, "ReloadBody start", {
291
- bodyRowCount: j(N)
292
- }), Je(f, N, () => {
293
- if (I.current !== O)
142
+ if (B) {
143
+ const d = f.current + 1, de = /* @__PURE__ */ a(() => {
144
+ const T = l.current;
145
+ m.current = void 0, L.current = C(), me(r, "reload"), ye(r, "ReloadBody start", {
146
+ bodyRowCount: M(T)
147
+ }), Me(t, T, () => {
148
+ if (f.current !== d)
294
149
  return;
295
- h.current = N, ae(f), te(e, "ReloadBody end", q.current, {
296
- bodyRowCount: j(N)
297
- }), q.current = null, g.current === N && (g.current = void 0, W.current = !1);
298
- const Te = B.current;
299
- if (!T || Te === null) {
300
- B.current = null, x(!1);
150
+ D.current = T, ae(t), Re(r, "ReloadBody end", L.current, {
151
+ bodyRowCount: M(T)
152
+ }), L.current = null, l.current === T && (l.current = void 0, _.current = !1);
153
+ const le = c.current;
154
+ if (!o || le === null) {
155
+ c.current = null, y(!1);
301
156
  return;
302
157
  }
303
- const me = Math.max(
158
+ const fe = Math.max(
304
159
  0,
305
- qe - (Date.now() - Te)
160
+ qe - (Date.now() - le)
306
161
  );
307
- if (F(), me === 0) {
308
- B.current = null, x(!1);
162
+ if (g(), fe === 0) {
163
+ c.current = null, y(!1);
309
164
  return;
310
165
  }
311
- A.current = window.setTimeout(() => {
312
- I.current === O && (A.current = void 0, B.current = null, x(!1));
313
- }, me);
166
+ p.current = window.setTimeout(() => {
167
+ f.current === d && (p.current = void 0, c.current = null, y(!1));
168
+ }, fe);
314
169
  });
315
170
  }, "runBodyReload");
316
- I.current = O, g.current = _, W.current = !0, T && _ !== void 0 ? (Y(), F(), B.current = Date.now(), x(!0), L.current = window.setTimeout(() => {
317
- I.current === O && pe();
318
- }, 0)) : pe();
171
+ f.current = d, l.current = R, _.current = !0, o && R !== void 0 ? (V(), g(), c.current = Date.now(), y(!0), m.current = window.setTimeout(() => {
172
+ f.current === d && de();
173
+ }, 0)) : de();
319
174
  }
320
175
  }
321
- }, [z, S, r, T, e]), $(() => () => {
322
- Y(), F();
176
+ }, [A, w, n, o, r]), I(() => () => {
177
+ V(), g();
323
178
  }, []);
324
- const J = {
325
- height: D,
326
- width: v,
327
- ...t
179
+ const x = {
180
+ height: q,
181
+ width: j,
182
+ ...u
328
183
  };
329
- return (T || X) && (J.position = t != null && t.position && t.position !== "static" ? t.position : "relative", J.isolation = "isolate"), /* @__PURE__ */ Ee("div", { ref: ue, className: a, style: J, children: [
330
- /* @__PURE__ */ Z("div", { id: e, className: G, style: Me(R, ["height", "width"]) }),
331
- /* @__PURE__ */ Z(
332
- Fe,
184
+ return (o || P) && (x.position = u != null && u.position && u.position !== "static" ? u.position : "relative", x.isolation = "isolate"), /* @__PURE__ */ Ne("div", { ref: ee, className: Te, style: x, children: [
185
+ /* @__PURE__ */ H("div", { id: r, className: Ge, style: he(De, ["height", "width"]) }),
186
+ /* @__PURE__ */ H(
187
+ We,
333
188
  {
334
- visible: X,
335
- message: Ce("Message.조회된 결과가 없습니다."),
336
- overlayFrame: le
189
+ visible: P,
190
+ message: Ie("Message.조회된 결과가 없습니다."),
191
+ overlayFrame: ce
337
192
  }
338
193
  ),
339
- /* @__PURE__ */ Z(ke, { visible: Q, overlayFrame: le })
194
+ /* @__PURE__ */ H(Fe, { visible: N, overlayFrame: ce })
340
195
  ] });
341
196
  }, "OwpTreeGrid");
342
197
  export {
343
- Gt as OwpTreeGrid
198
+ cr as OwpTreeGrid
344
199
  };
345
200
  //# sourceMappingURL=OwpTreeGrid.js.map