@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.
- package/dist/_virtual/index11.js +2 -2
- package/dist/_virtual/index12.js +2 -2
- package/dist/_virtual/index13.js +2 -2
- package/dist/_virtual/index14.js +2 -2
- package/dist/_virtual/index16.js +5 -2
- package/dist/_virtual/index16.js.map +1 -1
- package/dist/_virtual/index17.js +2 -2
- package/dist/_virtual/index5.js +2 -5
- package/dist/_virtual/index5.js.map +1 -1
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/OwpDialog/OwpDialog.js +48 -46
- package/dist/components/OwpDialog/OwpDialog.js.map +1 -1
- package/dist/components/OwpErrorStatusPage/OwpErrorStatusPage.js +24 -24
- package/dist/components/OwpErrorStatusPage/OwpErrorStatusPage.js.map +1 -1
- package/dist/components/OwpLayout/OwpLayout.js +29 -30
- package/dist/components/OwpLayout/OwpLayout.js.map +1 -1
- package/dist/components/OwpMrtTable/OwpMrtTable.js +2 -2
- package/dist/components/OwpMrtTable/OwpMrtTable.js.map +1 -1
- package/dist/components/OwpMrtTable/{OwpMrtTableNoDataOverlay.js → internal/OwpMrtTableNoDataOverlay.js} +1 -1
- package/dist/components/OwpMrtTable/internal/OwpMrtTableNoDataOverlay.js.map +1 -0
- package/dist/components/OwpMrtTable/{OwpMrtTableTopToolbar.js → internal/OwpMrtTableTopToolbar.js} +3 -3
- package/dist/components/OwpMrtTable/internal/OwpMrtTableTopToolbar.js.map +1 -0
- package/dist/components/OwpPageCarded/OwpPageCarded.js +81 -77
- package/dist/components/OwpPageCarded/OwpPageCarded.js.map +1 -1
- package/dist/components/OwpPageCarded/{OwpPageCardedHeader.js → internal/OwpPageCardedHeader.js} +2 -2
- package/dist/components/OwpPageCarded/internal/OwpPageCardedHeader.js.map +1 -0
- package/dist/components/OwpPageCarded/{OwpPageCardedSidebar.js → internal/OwpPageCardedSidebar.js} +3 -3
- package/dist/components/OwpPageCarded/internal/OwpPageCardedSidebar.js.map +1 -0
- package/dist/components/OwpPageCarded/{OwpPageCardedSidebarContent.js → internal/OwpPageCardedSidebarContent.js} +2 -2
- package/dist/components/OwpPageCarded/internal/OwpPageCardedSidebarContent.js.map +1 -0
- package/dist/components/OwpPicker/OwpDatePicker.js +90 -83
- package/dist/components/OwpPicker/OwpDatePicker.js.map +1 -1
- package/dist/components/OwpPicker/OwpDateRangePicker.js +57 -50
- package/dist/components/OwpPicker/OwpDateRangePicker.js.map +1 -1
- package/dist/components/OwpPicker/OwpTimePicker.js +65 -61
- package/dist/components/OwpPicker/OwpTimePicker.js.map +1 -1
- package/dist/components/OwpPicker/OwpWeekDatePicker.js +58 -52
- package/dist/components/OwpPicker/OwpWeekDatePicker.js.map +1 -1
- package/dist/components/OwpPicker/OwpYearRangePicker.js +68 -62
- package/dist/components/OwpPicker/OwpYearRangePicker.js.map +1 -1
- package/dist/components/OwpPicker/{constants.js → constants/index.js} +1 -1
- package/dist/components/OwpPicker/constants/index.js.map +1 -0
- package/dist/components/OwpPicker/{AnimatedCalendarContainer.js → internal/AnimatedCalendarContainer.js} +2 -2
- package/dist/components/OwpPicker/internal/AnimatedCalendarContainer.js.map +1 -0
- package/dist/components/OwpPicker/{CalendarContainer.js → internal/CalendarContainer.js} +2 -2
- package/dist/components/OwpPicker/internal/CalendarContainer.js.map +1 -0
- package/dist/components/OwpPicker/{DatePickerInput.js → internal/DatePickerInput.js} +4 -4
- package/dist/components/OwpPicker/internal/DatePickerInput.js.map +1 -0
- package/dist/components/OwpQuerySelector/OwpQuerySelector.js +205 -171
- package/dist/components/OwpQuerySelector/OwpQuerySelector.js.map +1 -1
- package/dist/components/OwpScrollbars/OwpScrollbars.js +16 -17
- package/dist/components/OwpScrollbars/OwpScrollbars.js.map +1 -1
- package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js +112 -103
- package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js.map +1 -1
- package/dist/components/OwpStyleProvider/OwpStyleProvider.js +86 -39
- package/dist/components/OwpStyleProvider/OwpStyleProvider.js.map +1 -1
- package/dist/components/OwpSuspense/OwpSuspense.js.map +1 -1
- package/dist/components/OwpTable/OwpTable.js +50 -51
- package/dist/components/OwpTable/OwpTable.js.map +1 -1
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js +163 -308
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
- package/dist/components/OwpTreeGrid/hooks/useOwpTreeGridOverlayFrame.js +1 -1
- package/dist/components/OwpTreeGrid/hooks/useOwpTreeGridOverlayFrame.js.map +1 -1
- package/dist/components/OwpTreeGrid/{OwpTreeGridLoadingOverlay.js → internal/OwpTreeGridLoadingOverlay.js} +2 -2
- package/dist/components/OwpTreeGrid/internal/OwpTreeGridLoadingOverlay.js.map +1 -0
- package/dist/components/OwpTreeGrid/{OwpTreeGridNoDataOverlay.js → internal/OwpTreeGridNoDataOverlay.js} +2 -2
- package/dist/components/OwpTreeGrid/internal/OwpTreeGridNoDataOverlay.js.map +1 -0
- package/dist/components/OwpTreeGrid/{utils/index.js → internal/treeGridLayout.js} +1 -1
- package/dist/components/OwpTreeGrid/internal/treeGridLayout.js.map +1 -0
- package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +182 -0
- package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -0
- package/dist/components/OwpTreeGrid/utils/perf.js.map +1 -0
- package/dist/components/OwpZoomImageSlider/OwpZoomImageSlider.js +1 -1
- package/dist/components/OwpZoomImageSlider/OwpZoomImageSlider.js.map +1 -1
- package/dist/components/OwpZoomImageSlider/{ZoomImage.js → internal/ZoomImage.js} +1 -1
- package/dist/components/OwpZoomImageSlider/internal/ZoomImage.js.map +1 -0
- package/dist/contexts/OwpCoreProvider.js +22 -36
- package/dist/contexts/OwpCoreProvider.js.map +1 -1
- package/dist/contexts/OwpStoreProvider.js +9 -9
- package/dist/contexts/OwpStoreProvider.js.map +1 -1
- package/dist/hooks/useNavbar.js +24 -0
- package/dist/hooks/useNavbar.js.map +1 -0
- package/dist/hooks/useOwpSettings.js +21 -0
- package/dist/hooks/useOwpSettings.js.map +1 -0
- package/dist/hooks.js +75 -62
- package/dist/hooks.js.map +1 -1
- package/dist/index.js +98 -104
- package/dist/index.js.map +1 -1
- package/dist/layout/Layout.js +28 -29
- package/dist/layout/Layout.js.map +1 -1
- package/dist/layout/components/layouts/FooterLayout.js +15 -16
- package/dist/layout/components/layouts/FooterLayout.js.map +1 -1
- package/dist/layout/components/layouts/NavbarToggleFabLayout.js +21 -18
- package/dist/layout/components/layouts/NavbarToggleFabLayout.js.map +1 -1
- package/dist/layout/components/layouts/NavbarWrapperLayout.js +20 -21
- package/dist/layout/components/layouts/NavbarWrapperLayout.js.map +1 -1
- package/dist/layout/components/navbar/NavbarPinToggleButton.js +10 -11
- package/dist/layout/components/navbar/NavbarPinToggleButton.js.map +1 -1
- package/dist/layout/components/navbar/NavbarToggleButton.js +31 -32
- package/dist/layout/components/navbar/NavbarToggleButton.js.map +1 -1
- package/dist/layout/components/navbar/style/NavbarStyle.js +36 -37
- package/dist/layout/components/navbar/style/NavbarStyle.js.map +1 -1
- package/dist/layout/components/navbar/style/NavbarStyleContent.js +29 -30
- package/dist/layout/components/navbar/style/NavbarStyleContent.js.map +1 -1
- package/dist/layout/components/navigation/Navigation.js +18 -22
- package/dist/layout/components/navigation/Navigation.js.map +1 -1
- package/dist/layout/components/toggles/NavigationSearchToggle.js +55 -60
- package/dist/layout/components/toggles/NavigationSearchToggle.js.map +1 -1
- package/dist/layout/components/toggles/NavigationShortcutsToggle.js +44 -49
- package/dist/layout/components/toggles/NavigationShortcutsToggle.js.map +1 -1
- package/dist/layout/components/toolbar/ToolbarLayout.js +26 -27
- package/dist/layout/components/toolbar/ToolbarLayout.js.map +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE39/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/constants.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/constants.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/GenericBarcode/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/constants.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/MSI/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/codabar/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/pharmacode/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/renderers/index.js +1 -1
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +1 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +1 -1
- package/dist/node_modules/.pnpm/react-imask@7.6.1_react@19.2.4/node_modules/react-imask/esm/mixin.js +1 -1
- package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/.pnpm/react-overlays@5.2.1_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-overlays/esm/Portal.js +1 -1
- package/dist/owp-app.css +1 -1
- package/dist/store/atoms/navbarAtoms.js +84 -0
- package/dist/store/atoms/navbarAtoms.js.map +1 -0
- package/dist/store/atoms/owpSettingsAtoms.js +140 -0
- package/dist/store/atoms/owpSettingsAtoms.js.map +1 -0
- package/dist/store/atoms/owpStore.js +29 -0
- package/dist/store/atoms/owpStore.js.map +1 -0
- package/dist/store.js +44 -39
- package/dist/store.js.map +1 -1
- package/dist/types/components/OwpPageCarded/OwpPageCarded.d.ts +12 -41
- package/dist/types/components/OwpPageSkeleton/index.d.ts +1 -0
- package/dist/types/components/OwpPicker/OwpWeekDatePicker.d.ts +0 -1
- package/dist/types/components/OwpPicker/OwpYearRangePicker.d.ts +0 -1
- package/dist/types/components/OwpPicker/{DatePickerInput.d.ts → internal/DatePickerInput.d.ts} +1 -1
- package/dist/types/components/OwpQuerySelector/OwpQuerySelector.d.ts +1 -1
- package/dist/types/components/OwpQuerySelector/types/types.d.ts +2 -0
- package/dist/types/components/OwpTable/OwpTable.d.ts +1 -1
- package/dist/types/components/OwpTabs/OwpTab.d.ts +1 -1
- package/dist/types/components/OwpTabs/OwpTabs.d.ts +1 -1
- package/dist/types/components/OwpTreeGrid/OwpTreeGrid.d.ts +3 -1
- package/dist/types/components/OwpTreeGrid/{OwpTreeGridLoadingOverlay.d.ts → internal/OwpTreeGridLoadingOverlay.d.ts} +1 -1
- package/dist/types/components/OwpTreeGrid/{OwpTreeGridNoDataOverlay.d.ts → internal/OwpTreeGridNoDataOverlay.d.ts} +1 -1
- package/dist/types/components/OwpTreeGrid/{utils/index.d.ts → internal/treeGridLayout.d.ts} +0 -2
- package/dist/types/components/OwpTreeGrid/internal/treeGridRuntime.d.ts +75 -0
- package/dist/types/contexts/OwpCoreProvider.d.ts +2 -2
- package/dist/types/contexts/OwpStoreProvider.d.ts +4 -4
- package/dist/types/hooks/index.d.ts +2 -1
- package/dist/types/hooks/useNavbar.d.ts +19 -0
- package/dist/types/hooks/useOwpSettings.d.ts +79 -0
- package/dist/types/index.d.ts +1 -4
- package/dist/types/layout/components/navigation/Navigation.d.ts +6 -2
- package/dist/types/layout/components/toggles/NavigationSearchToggle.d.ts +5 -2
- package/dist/types/layout/components/toggles/NavigationShortcutsToggle.d.ts +5 -2
- package/dist/types/store/atoms/index.d.ts +3 -0
- package/dist/types/store/atoms/internal/types.d.ts +29 -0
- package/dist/types/store/atoms/navbarAtoms.d.ts +48 -0
- package/dist/types/store/atoms/owpSettingsAtoms.d.ts +89 -0
- package/dist/types/store/atoms/owpStore.d.ts +13 -0
- package/dist/types/store/index.d.ts +1 -3
- package/dist/types/types/OwpNavigationTypes.d.ts +14 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/navigationUtils.d.ts +6 -2
- package/dist/types/utils/normalizeTimeToHourMinute.d.ts +11 -0
- package/dist/utils/navigationUtils.js.map +1 -1
- package/dist/utils/normalizeTimeToHourMinute.js +34 -0
- package/dist/utils/normalizeTimeToHourMinute.js.map +1 -0
- package/dist/utils/treeGridUtil.js +1 -1
- package/dist/utils/treeGridUtil.js.map +1 -1
- package/dist/utils.js +78 -75
- package/dist/utils.js.map +1 -1
- package/package.json +2 -6
- package/dist/components/OwpMrtTable/OwpMrtTableNoDataOverlay.js.map +0 -1
- package/dist/components/OwpMrtTable/OwpMrtTableTopToolbar.js.map +0 -1
- package/dist/components/OwpPageCarded/OwpPageCardedHeader.js.map +0 -1
- package/dist/components/OwpPageCarded/OwpPageCardedSidebar.js.map +0 -1
- package/dist/components/OwpPageCarded/OwpPageCardedSidebarContent.js.map +0 -1
- package/dist/components/OwpPicker/AnimatedCalendarContainer.js.map +0 -1
- package/dist/components/OwpPicker/CalendarContainer.js.map +0 -1
- package/dist/components/OwpPicker/DatePickerInput.js.map +0 -1
- package/dist/components/OwpPicker/constants.js.map +0 -1
- package/dist/components/OwpTreeGrid/OwpTreeGridLoadingOverlay.js.map +0 -1
- package/dist/components/OwpTreeGrid/OwpTreeGridNoDataOverlay.js.map +0 -1
- package/dist/components/OwpTreeGrid/perf.js.map +0 -1
- package/dist/components/OwpTreeGrid/utils/index.js.map +0 -1
- package/dist/components/OwpZoomImageSlider/ZoomImage.js.map +0 -1
- package/dist/hooks/useAppStore.js +0 -8
- package/dist/hooks/useAppStore.js.map +0 -1
- package/dist/node_modules/.pnpm/react-datepicker@8.7.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-datepicker/dist/react-datepicker.css +0 -1
- package/dist/store/generateReducersFromSlices.js +0 -18
- package/dist/store/generateReducersFromSlices.js.map +0 -1
- package/dist/store/lazyLoadedSlices.js +0 -16
- package/dist/store/lazyLoadedSlices.js.map +0 -1
- package/dist/store/middleware.js +0 -9
- package/dist/store/middleware.js.map +0 -1
- package/dist/store/navbarSlice.js +0 -71
- package/dist/store/navbarSlice.js.map +0 -1
- package/dist/store/navigationSlice.js +0 -46
- package/dist/store/navigationSlice.js.map +0 -1
- package/dist/store/owpSettingsSlice.js +0 -195
- package/dist/store/owpSettingsSlice.js.map +0 -1
- package/dist/store/store.js +0 -17
- package/dist/store/store.js.map +0 -1
- package/dist/store/withSlices.js +0 -27
- package/dist/store/withSlices.js.map +0 -1
- package/dist/types/hooks/useAppStore.d.ts +0 -7
- package/dist/types/store/generateReducersFromSlices.d.ts +0 -6
- package/dist/types/store/lazyLoadedSlices.d.ts +0 -9
- package/dist/types/store/middleware.d.ts +0 -17
- package/dist/types/store/navbarSlice.d.ts +0 -22
- package/dist/types/store/navigationSlice.d.ts +0 -92
- package/dist/types/store/owpSettingsSlice.d.ts +0 -112
- package/dist/types/store/store.d.ts +0 -13
- package/dist/types/store/withSlices.d.ts +0 -11
- /package/dist/components/OwpTreeGrid/{perf.js → utils/perf.js} +0 -0
- /package/dist/types/components/OwpMrtTable/{OwpMrtTableNoDataOverlay.d.ts → internal/OwpMrtTableNoDataOverlay.d.ts} +0 -0
- /package/dist/types/components/OwpMrtTable/{OwpMrtTableTopToolbar.d.ts → internal/OwpMrtTableTopToolbar.d.ts} +0 -0
- /package/dist/types/components/OwpPageCarded/{OwpPageCardedHeader.d.ts → internal/OwpPageCardedHeader.d.ts} +0 -0
- /package/dist/types/components/OwpPageCarded/{OwpPageCardedSidebar.d.ts → internal/OwpPageCardedSidebar.d.ts} +0 -0
- /package/dist/types/components/OwpPageCarded/{OwpPageCardedSidebarContent.d.ts → internal/OwpPageCardedSidebarContent.d.ts} +0 -0
- /package/dist/types/components/OwpPicker/{constants.d.ts → constants/index.d.ts} +0 -0
- /package/dist/types/components/OwpPicker/{AnimatedCalendarContainer.d.ts → internal/AnimatedCalendarContainer.d.ts} +0 -0
- /package/dist/types/components/OwpPicker/{CalendarContainer.d.ts → internal/CalendarContainer.d.ts} +0 -0
- /package/dist/types/components/OwpTreeGrid/{perf.d.ts → utils/perf.d.ts} +0 -0
- /package/dist/types/components/OwpZoomImageSlider/{ZoomImage.d.ts → internal/ZoomImage.d.ts} +0 -0
|
@@ -1 +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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E,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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
|
|
2
|
-
var
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { useOwpTranslation as
|
|
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
|
|
7
|
-
import { getTreeGridPerfTimestamp as
|
|
8
|
-
import { useRef as
|
|
9
|
-
import { useOwpTreeGridOverlayFrame as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
useDataUrl:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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:
|
|
194
|
-
onSelect:
|
|
195
|
-
onRowClick:
|
|
196
|
-
onRowAdd:
|
|
197
|
-
onRowDelete:
|
|
198
|
-
onRowUndelete:
|
|
199
|
-
onRowChange:
|
|
200
|
-
onClickButton:
|
|
201
|
-
onSave:
|
|
202
|
-
onReady:
|
|
203
|
-
onAfterValueChanged:
|
|
204
|
-
}),
|
|
205
|
-
|
|
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
|
-
|
|
208
|
-
onSelect:
|
|
209
|
-
onRowClick:
|
|
210
|
-
onRowAdd:
|
|
211
|
-
onRowDelete:
|
|
212
|
-
onRowUndelete:
|
|
213
|
-
onRowChange:
|
|
214
|
-
onClickButton:
|
|
215
|
-
onSave:
|
|
216
|
-
onReady:
|
|
217
|
-
onAfterValueChanged:
|
|
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
|
|
220
|
-
visible:
|
|
221
|
-
containerRef:
|
|
222
|
-
treeGridInstanceRef:
|
|
223
|
-
debugId:
|
|
224
|
-
}),
|
|
225
|
-
|
|
226
|
-
}, "clearBindingLoadingHideTimeout"),
|
|
227
|
-
|
|
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
|
|
231
|
-
var
|
|
232
|
-
((
|
|
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(
|
|
235
|
-
window.removeEventListener(
|
|
87
|
+
return window.addEventListener(pe, t), () => {
|
|
88
|
+
window.removeEventListener(pe, t);
|
|
236
89
|
};
|
|
237
|
-
}, [
|
|
238
|
-
|
|
239
|
-
}, [
|
|
240
|
-
var
|
|
241
|
-
if (
|
|
242
|
-
return
|
|
243
|
-
id:
|
|
244
|
-
latestEventHandlersRef:
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
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:
|
|
253
|
-
}),
|
|
254
|
-
useDataUrl: !!
|
|
255
|
-
bodyRowCount:
|
|
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
|
-
|
|
258
|
-
id:
|
|
259
|
-
layoutUrl:
|
|
260
|
-
dataUrl:
|
|
261
|
-
bodyData:
|
|
262
|
-
useDataUrl:
|
|
263
|
-
width:
|
|
264
|
-
height:
|
|
265
|
-
languageId:
|
|
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
|
-
|
|
268
|
-
|
|
122
|
+
r,
|
|
123
|
+
r
|
|
269
124
|
), () => {
|
|
270
|
-
|
|
271
|
-
var
|
|
272
|
-
(
|
|
125
|
+
ze(() => {
|
|
126
|
+
var s;
|
|
127
|
+
(s = i.current) == null || s.Dispose();
|
|
273
128
|
}, 200);
|
|
274
129
|
};
|
|
275
|
-
}, []),
|
|
276
|
-
const
|
|
277
|
-
if (
|
|
130
|
+
}, []), xe(() => {
|
|
131
|
+
const t = i.current, s = O.current, R = te.current;
|
|
132
|
+
if (E(t) || !A)
|
|
278
133
|
return;
|
|
279
|
-
const
|
|
280
|
-
if (!(!
|
|
281
|
-
if (
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
disableBodyReload: !!
|
|
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 (
|
|
288
|
-
const
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
bodyRowCount:
|
|
292
|
-
}),
|
|
293
|
-
if (
|
|
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
|
-
|
|
296
|
-
bodyRowCount:
|
|
297
|
-
}),
|
|
298
|
-
const
|
|
299
|
-
if (!
|
|
300
|
-
|
|
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
|
|
158
|
+
const fe = Math.max(
|
|
304
159
|
0,
|
|
305
|
-
qe - (Date.now() -
|
|
160
|
+
qe - (Date.now() - le)
|
|
306
161
|
);
|
|
307
|
-
if (
|
|
308
|
-
|
|
162
|
+
if (g(), fe === 0) {
|
|
163
|
+
c.current = null, y(!1);
|
|
309
164
|
return;
|
|
310
165
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
},
|
|
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
|
-
|
|
317
|
-
|
|
318
|
-
}, 0)) :
|
|
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
|
-
}, [
|
|
322
|
-
|
|
176
|
+
}, [A, w, n, o, r]), I(() => () => {
|
|
177
|
+
V(), g();
|
|
323
178
|
}, []);
|
|
324
|
-
const
|
|
325
|
-
height:
|
|
326
|
-
width:
|
|
327
|
-
...
|
|
179
|
+
const x = {
|
|
180
|
+
height: q,
|
|
181
|
+
width: j,
|
|
182
|
+
...u
|
|
328
183
|
};
|
|
329
|
-
return (
|
|
330
|
-
/* @__PURE__ */
|
|
331
|
-
/* @__PURE__ */
|
|
332
|
-
|
|
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:
|
|
335
|
-
message:
|
|
336
|
-
overlayFrame:
|
|
189
|
+
visible: P,
|
|
190
|
+
message: Ie("Message.조회된 결과가 없습니다."),
|
|
191
|
+
overlayFrame: ce
|
|
337
192
|
}
|
|
338
193
|
),
|
|
339
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ H(Fe, { visible: N, overlayFrame: ce })
|
|
340
195
|
] });
|
|
341
196
|
}, "OwpTreeGrid");
|
|
342
197
|
export {
|
|
343
|
-
|
|
198
|
+
cr as OwpTreeGrid
|
|
344
199
|
};
|
|
345
200
|
//# sourceMappingURL=OwpTreeGrid.js.map
|