@owp/core 2.5.4 → 2.5.6
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/configs/theme.d.ts +3 -0
- package/configs/theme.js +1 -0
- package/dist/_virtual/index11.js +2 -2
- package/dist/_virtual/index13.js +2 -2
- package/dist/_virtual/index14.js +2 -2
- package/dist/_virtual/index15.js +2 -2
- package/dist/_virtual/index16.js +4 -4
- package/dist/_virtual/index17.js +4 -4
- package/dist/_virtual/index18.js +4 -4
- package/dist/_virtual/index19.js +4 -4
- package/dist/components/OwpPageSkeleton/OwpPageSkeleton.js +4 -4
- package/dist/components/OwpTable/OwpDataTable.js +293 -327
- package/dist/components/OwpTable/OwpDataTable.js.map +1 -1
- package/dist/components/OwpTable/OwpTable.js +102 -117
- package/dist/components/OwpTable/OwpTable.js.map +1 -1
- package/dist/components/OwpTable/internal/defaultTableStyle.js +50 -0
- package/dist/components/OwpTable/internal/defaultTableStyle.js.map +1 -0
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js +47 -45
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
- package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +179 -161
- package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -1
- package/dist/configs/defaultConfig.js +1 -1
- package/dist/configs/theme.js +28 -0
- package/dist/configs/theme.js.map +1 -0
- package/dist/contexts/OwpAppProvider.js.map +1 -1
- package/dist/features/themePreview/components/ThemePreviewCanvas.js +492 -0
- package/dist/features/themePreview/components/ThemePreviewCanvas.js.map +1 -0
- package/dist/features/themePreview/components/ThemePreviewCanvasSections.js +678 -0
- package/dist/features/themePreview/components/ThemePreviewCanvasSections.js.map +1 -0
- package/dist/features/themePreview/components/ThemePreviewColorField.js +372 -0
- package/dist/features/themePreview/components/ThemePreviewColorField.js.map +1 -0
- package/dist/features/themePreview/components/ThemePreviewControls.js +306 -0
- package/dist/features/themePreview/components/ThemePreviewControls.js.map +1 -0
- package/dist/features/themePreview/components/themePreviewCanvas.icons.js +17 -0
- package/dist/features/themePreview/components/themePreviewCanvas.icons.js.map +1 -0
- package/dist/features/themePreview/components/themePreviewCanvas.shared.js +296 -0
- package/dist/features/themePreview/components/themePreviewCanvas.shared.js.map +1 -0
- package/dist/features/themePreview/configs/grid.js +45 -0
- package/dist/features/themePreview/configs/grid.js.map +1 -0
- package/dist/features/themePreview/configs/presets.js +1074 -0
- package/dist/features/themePreview/configs/presets.js.map +1 -0
- package/dist/features/themePreview/configs/previewStorage.js +94 -0
- package/dist/features/themePreview/configs/previewStorage.js.map +1 -0
- package/dist/features/themePreview/configs/settings.js +148 -0
- package/dist/features/themePreview/configs/settings.js.map +1 -0
- package/dist/features/themePreview/configs/snackbar.js +39 -0
- package/dist/features/themePreview/configs/snackbar.js.map +1 -0
- package/dist/features/themePreview/configs/surface.js +10 -0
- package/dist/features/themePreview/configs/surface.js.map +1 -0
- package/dist/features/themePreview/configs/table.js +30 -0
- package/dist/features/themePreview/configs/table.js.map +1 -0
- package/dist/features/themePreview/defs/ThemePreviewGridDef.xml.js +43 -0
- package/dist/features/themePreview/defs/ThemePreviewGridDef.xml.js.map +1 -0
- package/dist/features/themePreview/defs/ThemePreviewReadonlyGridDef.xml.js +43 -0
- package/dist/features/themePreview/defs/ThemePreviewReadonlyGridDef.xml.js.map +1 -0
- package/dist/features/themePreview/dialogs/ThemePreviewDialog.js +441 -0
- package/dist/features/themePreview/dialogs/ThemePreviewDialog.js.map +1 -0
- package/dist/features/themePreview/hooks/useThemePreview.js +280 -0
- package/dist/features/themePreview/hooks/useThemePreview.js.map +1 -0
- package/dist/features/themePreview/utils/color.js +79 -0
- package/dist/features/themePreview/utils/color.js.map +1 -0
- package/dist/features/themePreview/utils/themePreviewDefinitions.js +526 -0
- package/dist/features/themePreview/utils/themePreviewDefinitions.js.map +1 -0
- package/dist/features/themePreview/utils/themePreviewExport.js +320 -0
- package/dist/features/themePreview/utils/themePreviewExport.js.map +1 -0
- package/dist/features/themePreview/utils/themePreviewSettings.js +211 -0
- package/dist/features/themePreview/utils/themePreviewSettings.js.map +1 -0
- package/dist/features/themePreview.js +75 -0
- package/dist/features/themePreview.js.map +1 -0
- package/dist/layout/components/logo/Logo.js +49 -45
- package/dist/layout/components/logo/Logo.js.map +1 -1
- package/dist/layout/components/toggles/NavigationSearchToggle.js +3 -3
- package/dist/layout/components/toggles/ThemePreviewToggle.js +51 -0
- package/dist/layout/components/toggles/ThemePreviewToggle.js.map +1 -0
- package/dist/layout/components/toolbar/ToolbarLayout.js +8 -6
- package/dist/layout/components/toolbar/ToolbarLayout.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/CheckCircleOutline.js +9 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/CheckCircleOutline.js.map +1 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/DownloadOutlined.js +9 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/DownloadOutlined.js.map +1 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/ErrorOutline.js +9 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/ErrorOutline.js.map +1 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/InfoOutlined.js +9 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/InfoOutlined.js.map +1 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/KeyboardArrowUpRounded.js +9 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/KeyboardArrowUpRounded.js.map +1 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/MenuRounded.js +9 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/MenuRounded.js.map +1 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/NotificationsNoneOutlined.js +9 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/NotificationsNoneOutlined.js.map +1 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/PaletteOutlined.js +25 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/PaletteOutlined.js.map +1 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/RestoreOutlined.js +9 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/RestoreOutlined.js.map +1 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/SaveOutlined.js +9 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/SaveOutlined.js.map +1 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/SpaceDashboardOutlined.js +9 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/SpaceDashboardOutlined.js.map +1 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/UploadFileOutlined.js +9 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/UploadFileOutlined.js.map +1 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/WarningAmberRounded.js +9 -0
- package/dist/node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/WarningAmberRounded.js.map +1 -0
- 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/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/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/types/components/OwpTable/internal/defaultTableStyle.d.ts +49 -0
- package/dist/types/components/OwpTreeGrid/OwpTreeGrid.d.ts +2 -1
- package/dist/types/components/OwpTreeGrid/internal/treeGridRuntime.d.ts +6 -1
- package/dist/types/configs/theme/index.d.ts +6 -0
- package/dist/types/contexts/OwpAppProvider.d.ts +2 -0
- package/dist/types/features/themePreview/components/ThemePreviewCanvas.d.ts +8 -0
- package/dist/types/features/themePreview/components/ThemePreviewCanvasSections.d.ts +82 -0
- package/dist/types/features/themePreview/components/ThemePreviewColorField.d.ts +10 -0
- package/dist/types/features/themePreview/components/ThemePreviewControls.d.ts +18 -0
- package/dist/types/features/themePreview/components/index.d.ts +3 -0
- package/dist/types/features/themePreview/components/themePreviewCanvas.icons.d.ts +3 -0
- package/dist/types/features/themePreview/components/themePreviewCanvas.shared.d.ts +121 -0
- package/dist/types/features/themePreview/configs/grid.d.ts +41 -0
- package/dist/types/features/themePreview/configs/index.d.ts +7 -0
- package/dist/types/features/themePreview/configs/presets.d.ts +1152 -0
- package/dist/types/features/themePreview/configs/previewStorage.d.ts +35 -0
- package/dist/types/features/themePreview/configs/settings.d.ts +271 -0
- package/dist/types/features/themePreview/configs/snackbar.d.ts +43 -0
- package/dist/types/features/themePreview/configs/surface.d.ts +6 -0
- package/dist/types/features/themePreview/configs/table.d.ts +47 -0
- package/dist/types/features/themePreview/dialogs/ThemePreviewDialog.d.ts +3 -0
- package/dist/types/features/themePreview/dialogs/index.d.ts +1 -0
- package/dist/types/features/themePreview/hooks/index.d.ts +1 -0
- package/dist/types/features/themePreview/hooks/useThemePreview.d.ts +61 -0
- package/dist/types/features/themePreview/index.d.ts +6 -0
- package/dist/types/features/themePreview/types/index.d.ts +1 -0
- package/dist/types/features/themePreview/types/themePreview.d.ts +44 -0
- package/dist/types/features/themePreview/utils/color.d.ts +14 -0
- package/dist/types/features/themePreview/utils/index.d.ts +4 -0
- package/dist/types/features/themePreview/utils/themePreviewDefinitions.d.ts +10 -0
- package/dist/types/features/themePreview/utils/themePreviewExport.d.ts +46 -0
- package/dist/types/features/themePreview/utils/themePreviewSettings.d.ts +54 -0
- package/dist/types/layout/components/toggles/ThemePreviewToggle.d.ts +5 -0
- package/dist/types/utils/zipUtil.d.ts +1 -0
- package/dist/utils/zipUtil.js +38 -36
- package/dist/utils/zipUtil.js.map +1 -1
- package/features/themePreview.d.ts +3 -0
- package/features/themePreview.js +1 -0
- package/package.json +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwpTable.js","sources":["../../../src/components/OwpTable/OwpTable.tsx"],"sourcesContent":["import {\n resolveOwpGridTheme,\n type OwpResolvedGridThemeConfigType,\n} from '@/constants/gridTheme';\nimport {\n resolveOwpTableTheme,\n type OwpResolvedTableThemeConfigType,\n} from '@/constants/tableTheme';\nimport { getTreeGridFontFaceStyles } from '@/constants/treeGrid';\nimport { useGetCurrentSettings } from '@/hooks/useOwpSettings';\nimport { Divider, styled, Typography, type SxProps, type Theme } from '@mui/material';\nimport clsx from 'clsx';\nimport GlobalStyles from '@mui/material/GlobalStyles';\nimport Paper from '@mui/material/Paper';\nimport Table, { type TableProps } from '@mui/material/Table';\nimport TableBody from '@mui/material/TableBody';\nimport TableCell from '@mui/material/TableCell';\nimport TableContainer, { type TableContainerProps } from '@mui/material/TableContainer';\nimport TableHead from '@mui/material/TableHead';\nimport TableRow from '@mui/material/TableRow';\nimport { isArray, isEmpty, isNumber } from 'es-toolkit/compat';\nimport { type ReactNode, useMemo } from 'react';\nimport {\n getTreeGridBodyCellSx,\n getTreeGridBodyRowSx,\n getTreeGridCellBaseSx,\n getTreeGridContainerSx,\n getTreeGridHeaderCellSx,\n TREEGRID_TABLE_BODY_BORDER_COLOR,\n TREEGRID_TABLE_HEADER_BORDER_COLOR,\n} from './internal/treeGridTableStyle';\n\ntype OwpTableCellValue = string | number;\ntype OwpTableHeaderRow = Record<string, OwpTableCellValue>;\ntype OwpTableRowData = Record<string, unknown>;\n\nconst getTableColumnKeys = (row?: Record<string, unknown>) => {\n if (!row) {\n return [];\n }\n\n return Object.keys(row).filter((keyName) => !keyName.includes('Span'));\n};\n\nconst getTableCellSx = (row: Record<string, unknown>, keyName: string) => {\n return (row[`${keyName}Sx`] as SxProps<Theme>) ?? {};\n};\n\nconst getTableCellSpan = (\n row: Record<string, unknown>,\n keyName: string,\n spanType: 'ColSpan' | 'RowSpan',\n) => {\n return (row[`${keyName}${spanType}`] as number | undefined) ?? undefined;\n};\n\nconst mergeSx = (...styles: Array<SxProps<Theme> | undefined | false>): SxProps<Theme> =>\n styles.reduce<Array<Exclude<SxProps<Theme>, readonly unknown[]>>>((acc, style) => {\n if (!style) {\n return acc;\n }\n\n return [...acc, ...(isArray(style) ? style : [style])];\n }, []) as SxProps<Theme>;\n\nconst treeGridContainerSx = {\n border: 0,\n borderRadius: 0,\n overflow: 'visible',\n} as const;\n\nconst defaultStyledTableTheme = {\n header: {\n backgroundColor: '',\n color: 'inherit',\n fontSize: '1.7rem',\n fontWeight: 600,\n },\n cell: {\n fontSize: '1.7rem',\n },\n} satisfies OwpResolvedTableThemeConfigType;\n\ninterface StyledTableProps extends TableProps {\n canBodyFullHeight?: boolean;\n canUseTreeGridStyle?: boolean;\n containerProps?: TableContainerProps;\n footerSlot?: ReactNode;\n tableTheme?: OwpResolvedTableThemeConfigType;\n tableLayout?: 'auto' | 'fixed';\n treeGridTheme?: OwpResolvedGridThemeConfigType;\n title?: string;\n children: ReactNode;\n}\n\ntype StyledTableInnerProps = Pick<\n StyledTableProps,\n 'canBodyFullHeight' | 'canUseTreeGridStyle' | 'tableTheme' | 'treeGridTheme'\n>;\n\n/**\n * 총 row 수 표시 영역\n * @param totalCount 전체 row 수\n */\nexport function OwpTableTotalCount({ totalCount }: { totalCount?: number }) {\n return (\n <>\n <Divider />\n <Typography className=\"w-full py-8 pr-12\" align=\"right\">\n 전체: {isNumber(totalCount) ? totalCount.toLocaleString() : 0} 건\n </Typography>\n </>\n );\n}\n\n/**\n * StyledTable 스타일 컴포넌트\n * @param canBodyFullHeight body full height 사용 여부\n * @param canUseTreeGridStyle TreeGrid 스타일 사용 여부\n * @param children 하위 콘텐츠\n * @param containerProps containerProps props\n * @param footerSlot footer 영역\n * @param tableLayout tableLayout 값\n */\nexport const StyledTable = ({\n canBodyFullHeight,\n canUseTreeGridStyle,\n children,\n className,\n containerProps,\n footerSlot,\n tableTheme: tableThemeProp,\n tableLayout,\n ...tableProps\n}: StyledTableProps) => {\n const currentSettings = useGetCurrentSettings();\n const treeGridTheme = useMemo(\n () => resolveOwpGridTheme(currentSettings?.theme?.main?.grid),\n [currentSettings],\n );\n const tableTheme = useMemo(\n () =>\n tableThemeProp ??\n resolveOwpTableTheme(currentSettings?.theme?.main?.table, defaultStyledTableTheme),\n [currentSettings, tableThemeProp],\n );\n\n return (\n <>\n {canUseTreeGridStyle && <GlobalStyles styles={getTreeGridFontFaceStyles()} />}\n <TableContainer\n component={Paper}\n variant=\"outlined\"\n {...containerProps}\n sx={mergeSx(\n canUseTreeGridStyle && treeGridContainerSx,\n canUseTreeGridStyle && getTreeGridContainerSx(treeGridTheme),\n canBodyFullHeight && { height: '100%' },\n containerProps?.sx,\n )}\n >\n <StyledTableInner\n {...tableProps}\n canBodyFullHeight={canBodyFullHeight}\n canUseTreeGridStyle={canUseTreeGridStyle}\n tableTheme={tableTheme}\n treeGridTheme={treeGridTheme}\n className={clsx(\n canBodyFullHeight && 'h-full',\n tableLayout === 'fixed' ? 'table-fixed' : tableLayout === 'auto' ? 'table-auto' : '',\n className,\n )}\n >\n {children}\n </StyledTableInner>\n {footerSlot}\n </TableContainer>\n </>\n );\n};\n\nconst StyledTableInner = styled(Table, {\n shouldForwardProp: (prop) =>\n prop !== 'canBodyFullHeight' &&\n prop !== 'canUseTreeGridStyle' &&\n prop !== 'tableTheme' &&\n prop !== 'treeGridTheme',\n})<StyledTableInnerProps>(\n ({ theme, canBodyFullHeight, canUseTreeGridStyle, tableTheme, treeGridTheme }) => {\n const resolvedTreeGridTheme = treeGridTheme ?? resolveOwpGridTheme();\n const resolvedTableTheme = tableTheme ?? defaultStyledTableTheme;\n\n return {\n ...(canBodyFullHeight && {\n height: '100%',\n }),\n ...(canBodyFullHeight && {\n '& .MuiTableBody-root': {\n height: '100%',\n },\n '& .MuiTableBody-root > .MuiTableRow-root': {\n height: '100%',\n },\n }),\n '& .MuiTableCell-root': canUseTreeGridStyle\n ? {\n ...getTreeGridCellBaseSx(resolvedTreeGridTheme),\n }\n : {\n fontSize: resolvedTableTheme.cell.fontSize,\n padding: '7px 10px',\n borderLeft: 'none',\n borderRight: 'none',\n },\n ...(!canUseTreeGridStyle && {\n '& .MuiTableRow-root > .MuiTableCell-root + .MuiTableCell-root': {\n borderLeft: `1px solid ${theme.palette.divider}`,\n },\n }),\n '& th': canUseTreeGridStyle\n ? {\n ...getTreeGridHeaderCellSx(resolvedTreeGridTheme),\n '&:first-of-type': {\n borderLeft: `1px solid ${TREEGRID_TABLE_HEADER_BORDER_COLOR}`,\n },\n }\n : {\n backgroundColor: resolvedTableTheme.header.backgroundColor || theme.palette.grey[200],\n color: resolvedTableTheme.header.color,\n fontSize: resolvedTableTheme.header.fontSize,\n fontWeight: resolvedTableTheme.header.fontWeight,\n },\n '& td': canUseTreeGridStyle\n ? {\n ...getTreeGridBodyCellSx(resolvedTreeGridTheme),\n '&:first-of-type': {\n borderLeft: `1px solid ${TREEGRID_TABLE_BODY_BORDER_COLOR}`,\n },\n }\n : {},\n ...(canUseTreeGridStyle && {\n '& tbody > .MuiTableRow-root': getTreeGridBodyRowSx(resolvedTreeGridTheme),\n }),\n ...(canUseTreeGridStyle && {\n '& tbody > tr:first-of-type > th:first-of-type': {\n borderTopLeftRadius: 'inherit',\n },\n '& tbody > tr:first-of-type > td:last-of-type': {\n borderTopRightRadius: 'inherit',\n },\n }),\n };\n },\n);\n\nexport const StyledTableRow = styled(TableRow)`\n /* &:last-child th,\n &:last-child td {\n border-bottom: 0;\n } */\n`;\n\ninterface OwpTableProps<T> extends Omit<StyledTableProps, 'children'> {\n canTotalCountRow?: boolean;\n headers: OwpTableHeaderRow | OwpTableHeaderRow[];\n rows: T[];\n totalCount?: number;\n}\n\n/**\n * OwpTable 컴포넌트\n * @param canTotalCountRow 전체 row 수 표시 여부\n * @param headers headers 값\n * @param rows 행 데이터 목록\n * @param totalCount 전체 row 수\n */\nexport function OwpTable<T>({\n canTotalCountRow = false,\n headers,\n rows,\n totalCount,\n ...restTableProps\n}: OwpTableProps<T>) {\n const resolvedHeaderRows = useMemo(\n () => (isArray(headers) ? headers : isEmpty(headers) ? [] : [headers]),\n [headers],\n );\n const commonKeyListData = useMemo(\n () => getTableColumnKeys(isArray(headers) ? headers[0] : headers),\n [headers],\n );\n\n return (\n <StyledTable\n {...restTableProps}\n footerSlot={\n canTotalCountRow ? (\n <OwpTableTotalCount totalCount={typeof totalCount === 'undefined' ? rows.length : totalCount} />\n ) : undefined\n }\n className={clsx(restTableProps.tableLayout && 'w-full', restTableProps.className)}\n >\n <TableHead>\n {resolvedHeaderRows.map((headerData, index) => (\n <StyledTableRow key={`table-header-${index}`}>\n {getTableColumnKeys(headerData).map((keyName) => (\n <TableCell\n key={`table-header-${index}-${keyName}`}\n className=\"whitespace-pre-wrap\"\n sx={getTableCellSx(headerData, keyName)}\n colSpan={getTableCellSpan(headerData, keyName, 'ColSpan')}\n rowSpan={getTableCellSpan(headerData, keyName, 'RowSpan')}\n align=\"center\"\n >\n {headerData[keyName]}\n </TableCell>\n ))}\n </StyledTableRow>\n ))}\n </TableHead>\n <TableBody>\n {rows.map((row, index) => {\n const currentRow = row as OwpTableRowData;\n\n return (\n <StyledTableRow key={`table-row-${index}`}>\n {commonKeyListData.map((keyName) => (\n <TableCell\n key={`table-row-cell-${index}-${keyName}`}\n className=\"whitespace-pre-wrap h-64\"\n sx={getTableCellSx(currentRow, keyName)}\n align=\"center\"\n >\n {currentRow[keyName] as ReactNode}\n </TableCell>\n ))}\n </StyledTableRow>\n );\n })}\n </TableBody>\n </StyledTable>\n );\n}\n"],"names":["getTableColumnKeys","__name","row","keyName","getTableCellSx","getTableCellSpan","spanType","mergeSx","styles","acc","style","isArray","treeGridContainerSx","defaultStyledTableTheme","OwpTableTotalCount","totalCount","jsxs","Fragment","jsx","Divider","Typography","isNumber","StyledTable","canBodyFullHeight","canUseTreeGridStyle","children","className","containerProps","footerSlot","tableThemeProp","tableLayout","tableProps","currentSettings","useGetCurrentSettings","treeGridTheme","useMemo","resolveOwpGridTheme","_b","_a","tableTheme","resolveOwpTableTheme","GlobalStyles","getTreeGridFontFaceStyles","TableContainer","Paper","getTreeGridContainerSx","StyledTableInner","clsx","styled","Table","prop","theme","resolvedTreeGridTheme","resolvedTableTheme","getTreeGridCellBaseSx","getTreeGridHeaderCellSx","TREEGRID_TABLE_HEADER_BORDER_COLOR","getTreeGridBodyCellSx","TREEGRID_TABLE_BODY_BORDER_COLOR","getTreeGridBodyRowSx","StyledTableRow","TableRow","OwpTable","canTotalCountRow","headers","rows","restTableProps","resolvedHeaderRows","isEmpty","commonKeyListData","TableHead","headerData","index","TableCell","TableBody","currentRow"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAMA,IAAqB,gBAAAC,EAAA,CAACC,MACrBA,IAIE,OAAO,KAAKA,CAAG,EAAE,OAAO,CAACC,MAAY,CAACA,EAAQ,SAAS,MAAM,CAAC,IAH5D,CAAA,GAFgB,uBAQrBC,IAAiB,gB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,IAAIrE,EAAemE,GAAYpE,CAAO;AAAA,YACtC,SAASE,EAAiBkE,GAAYpE,GAAS,SAAS;AAAA,YACxD,SAASE,EAAiBkE,GAAYpE,GAAS,SAAS;AAAA,YACxD,OAAM;AAAA,YAEL,YAAWA,CAAO;AAAA,UAAA;AAAA,UAPd,gBAAgBqE,CAAK,IAAIrE,CAAO;AAAA,QAAA,CASxC,EAAA,GAZkB,gBAAgBqE,CAAK,EAa1C,CACD,EAAA,CACH;AAAA,0BACCE,GAAA,EACE,UAAAT,EAAK,IAAI,CAAC/D,GAAKsE,MAAU;AACxB,gBAAMG,IAAazE;AAEnB,iBACE,gBAAAgB,EAAC0C,GAAA,EACE,UAAAS,EAAkB,IAAI,CAAClE,MACtB,gBAAAe;AAAA,YAACuD;AAAA,YAAA;AAAA,cAEC,WAAU;AAAA,cACV,IAAIrE,EAAeuE,GAAYxE,CAAO;AAAA,cACtC,OAAM;AAAA,cAEL,YAAWA,CAAO;AAAA,YAAA;AAAA,YALd,kBAAkBqE,CAAK,IAAIrE,CAAO;AAAA,UAAA,CAO1C,KAVkB,aAAaqE,CAAK,EAWvC;AAAA,QAEJ,CAAC,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAlEgBvE,EAAA6D,IAAA;"}
|
|
1
|
+
{"version":3,"file":"OwpTable.js","sources":["../../../src/components/OwpTable/OwpTable.tsx"],"sourcesContent":["import {\n resolveOwpGridTheme,\n type OwpResolvedGridThemeConfigType,\n} from '@/constants/gridTheme';\nimport {\n resolveOwpTableTheme,\n type OwpResolvedTableThemeConfigType,\n} from '@/constants/tableTheme';\nimport { getTreeGridFontFaceStyles } from '@/constants/treeGrid';\nimport { useGetCurrentSettings } from '@/hooks/useOwpSettings';\nimport { Divider, styled, Typography, type SxProps, type Theme } from '@mui/material';\nimport clsx from 'clsx';\nimport GlobalStyles from '@mui/material/GlobalStyles';\nimport Paper from '@mui/material/Paper';\nimport Table, { type TableProps } from '@mui/material/Table';\nimport TableBody from '@mui/material/TableBody';\nimport TableCell from '@mui/material/TableCell';\nimport TableContainer, { type TableContainerProps } from '@mui/material/TableContainer';\nimport TableHead from '@mui/material/TableHead';\nimport TableRow from '@mui/material/TableRow';\nimport { isArray, isEmpty, isNumber } from 'es-toolkit/compat';\nimport { type ReactNode, useMemo } from 'react';\nimport {\n getTreeGridBodyCellSx,\n getTreeGridBodyRowSx,\n getTreeGridCellBaseSx,\n getTreeGridContainerSx,\n getTreeGridHeaderCellSx,\n TREEGRID_TABLE_BODY_BORDER_COLOR,\n TREEGRID_TABLE_HEADER_BORDER_COLOR,\n} from './internal/treeGridTableStyle';\nimport {\n defaultStyledTableTheme,\n getDefaultTableCellSx,\n getDefaultTableHeaderCellSx,\n} from './internal/defaultTableStyle';\n\ntype OwpTableCellValue = string | number;\ntype OwpTableHeaderRow = Record<string, OwpTableCellValue>;\ntype OwpTableRowData = Record<string, unknown>;\n\nconst getTableColumnKeys = (row?: Record<string, unknown>) => {\n if (!row) {\n return [];\n }\n\n return Object.keys(row).filter((keyName) => !keyName.includes('Span'));\n};\n\nconst getTableCellSx = (row: Record<string, unknown>, keyName: string) => {\n return (row[`${keyName}Sx`] as SxProps<Theme>) ?? {};\n};\n\nconst getTableCellSpan = (\n row: Record<string, unknown>,\n keyName: string,\n spanType: 'ColSpan' | 'RowSpan',\n) => {\n return (row[`${keyName}${spanType}`] as number | undefined) ?? undefined;\n};\n\nconst mergeSx = (...styles: Array<SxProps<Theme> | undefined | false>): SxProps<Theme> =>\n styles.reduce<Array<Exclude<SxProps<Theme>, readonly unknown[]>>>((acc, style) => {\n if (!style) {\n return acc;\n }\n\n return [...acc, ...(isArray(style) ? style : [style])];\n }, []) as SxProps<Theme>;\n\nconst treeGridContainerSx = {\n border: 0,\n borderRadius: 0,\n overflow: 'visible',\n} as const;\n\ninterface StyledTableProps extends TableProps {\n canBodyFullHeight?: boolean;\n canUseTreeGridStyle?: boolean;\n containerProps?: TableContainerProps;\n footerSlot?: ReactNode;\n tableTheme?: OwpResolvedTableThemeConfigType;\n tableLayout?: 'auto' | 'fixed';\n treeGridTheme?: OwpResolvedGridThemeConfigType;\n title?: string;\n children: ReactNode;\n}\n\ntype StyledTableInnerProps = Pick<\n StyledTableProps,\n 'canBodyFullHeight' | 'canUseTreeGridStyle' | 'tableTheme' | 'treeGridTheme'\n>;\n\n/**\n * 총 row 수 표시 영역\n * @param totalCount 전체 row 수\n */\nexport function OwpTableTotalCount({ totalCount }: { totalCount?: number }) {\n return (\n <>\n <Divider />\n <Typography className=\"w-full py-8 pr-12\" align=\"right\">\n 전체: {isNumber(totalCount) ? totalCount.toLocaleString() : 0} 건\n </Typography>\n </>\n );\n}\n\n/**\n * StyledTable 스타일 컴포넌트\n * @param canBodyFullHeight body full height 사용 여부\n * @param canUseTreeGridStyle TreeGrid 스타일 사용 여부\n * @param children 하위 콘텐츠\n * @param containerProps containerProps props\n * @param footerSlot footer 영역\n * @param tableLayout tableLayout 값\n */\nexport const StyledTable = ({\n canBodyFullHeight,\n canUseTreeGridStyle,\n children,\n className,\n containerProps,\n footerSlot,\n tableTheme: tableThemeProp,\n tableLayout,\n ...tableProps\n}: StyledTableProps) => {\n const currentSettings = useGetCurrentSettings();\n const treeGridTheme = useMemo(\n () => resolveOwpGridTheme(currentSettings?.theme?.main?.grid),\n [currentSettings],\n );\n const tableTheme = useMemo(\n () =>\n tableThemeProp ??\n resolveOwpTableTheme(currentSettings?.theme?.main?.table, defaultStyledTableTheme),\n [currentSettings, tableThemeProp],\n );\n\n return (\n <>\n {canUseTreeGridStyle && <GlobalStyles styles={getTreeGridFontFaceStyles()} />}\n <TableContainer\n component={Paper}\n variant=\"outlined\"\n {...containerProps}\n sx={mergeSx(\n canUseTreeGridStyle && treeGridContainerSx,\n canUseTreeGridStyle && getTreeGridContainerSx(treeGridTheme),\n canBodyFullHeight && { height: '100%' },\n containerProps?.sx,\n )}\n >\n <StyledTableInner\n {...tableProps}\n canBodyFullHeight={canBodyFullHeight}\n canUseTreeGridStyle={canUseTreeGridStyle}\n tableTheme={tableTheme}\n treeGridTheme={treeGridTheme}\n className={clsx(\n canBodyFullHeight && 'h-full',\n tableLayout === 'fixed' ? 'table-fixed' : tableLayout === 'auto' ? 'table-auto' : '',\n className,\n )}\n >\n {children}\n </StyledTableInner>\n {footerSlot}\n </TableContainer>\n </>\n );\n};\n\nconst StyledTableInner = styled(Table, {\n shouldForwardProp: (prop) =>\n prop !== 'canBodyFullHeight' &&\n prop !== 'canUseTreeGridStyle' &&\n prop !== 'tableTheme' &&\n prop !== 'treeGridTheme',\n})<StyledTableInnerProps>(\n ({ theme, canBodyFullHeight, canUseTreeGridStyle, tableTheme, treeGridTheme }) => {\n const resolvedTreeGridTheme = treeGridTheme ?? resolveOwpGridTheme();\n const resolvedTableTheme = tableTheme ?? defaultStyledTableTheme;\n\n return {\n ...(canBodyFullHeight && {\n height: '100%',\n }),\n ...(canBodyFullHeight && {\n '& .MuiTableBody-root': {\n height: '100%',\n },\n '& .MuiTableBody-root > .MuiTableRow-root': {\n height: '100%',\n },\n }),\n '& .MuiTableCell-root': canUseTreeGridStyle\n ? {\n ...getTreeGridCellBaseSx(resolvedTreeGridTheme),\n }\n : {\n ...getDefaultTableCellSx(resolvedTableTheme),\n },\n ...(!canUseTreeGridStyle && {\n '& .MuiTableRow-root > .MuiTableCell-root + .MuiTableCell-root': {\n borderLeft: `1px solid ${theme.palette.divider}`,\n },\n }),\n '& th': canUseTreeGridStyle\n ? {\n ...getTreeGridHeaderCellSx(resolvedTreeGridTheme),\n '&:first-of-type': {\n borderLeft: `1px solid ${TREEGRID_TABLE_HEADER_BORDER_COLOR}`,\n },\n }\n : {\n ...getDefaultTableHeaderCellSx(resolvedTableTheme, theme.palette.grey[200]),\n },\n '& td': canUseTreeGridStyle\n ? {\n ...getTreeGridBodyCellSx(resolvedTreeGridTheme),\n '&:first-of-type': {\n borderLeft: `1px solid ${TREEGRID_TABLE_BODY_BORDER_COLOR}`,\n },\n }\n : {},\n ...(canUseTreeGridStyle && {\n '& tbody > .MuiTableRow-root': getTreeGridBodyRowSx(resolvedTreeGridTheme),\n }),\n ...(canUseTreeGridStyle && {\n '& tbody > tr:first-of-type > th:first-of-type': {\n borderTopLeftRadius: 'inherit',\n },\n '& tbody > tr:first-of-type > td:last-of-type': {\n borderTopRightRadius: 'inherit',\n },\n }),\n };\n },\n);\n\nexport const StyledTableRow = styled(TableRow)`\n /* &:last-child th,\n &:last-child td {\n border-bottom: 0;\n } */\n`;\n\ninterface OwpTableProps<T> extends Omit<StyledTableProps, 'children'> {\n canTotalCountRow?: boolean;\n headers: OwpTableHeaderRow | OwpTableHeaderRow[];\n rows: T[];\n totalCount?: number;\n}\n\n/**\n * OwpTable 컴포넌트\n * @param canTotalCountRow 전체 row 수 표시 여부\n * @param headers headers 값\n * @param rows 행 데이터 목록\n * @param totalCount 전체 row 수\n */\nexport function OwpTable<T>({\n canTotalCountRow = false,\n headers,\n rows,\n totalCount,\n ...restTableProps\n}: OwpTableProps<T>) {\n const resolvedHeaderRows = useMemo(\n () => (isArray(headers) ? headers : isEmpty(headers) ? [] : [headers]),\n [headers],\n );\n const commonKeyListData = useMemo(\n () => getTableColumnKeys(isArray(headers) ? headers[0] : headers),\n [headers],\n );\n\n return (\n <StyledTable\n {...restTableProps}\n footerSlot={\n canTotalCountRow ? (\n <OwpTableTotalCount totalCount={typeof totalCount === 'undefined' ? rows.length : totalCount} />\n ) : undefined\n }\n className={clsx(restTableProps.tableLayout && 'w-full', restTableProps.className)}\n >\n <TableHead>\n {resolvedHeaderRows.map((headerData, index) => (\n <StyledTableRow key={`table-header-${index}`}>\n {getTableColumnKeys(headerData).map((keyName) => (\n <TableCell\n key={`table-header-${index}-${keyName}`}\n className=\"whitespace-pre-wrap\"\n sx={getTableCellSx(headerData, keyName)}\n colSpan={getTableCellSpan(headerData, keyName, 'ColSpan')}\n rowSpan={getTableCellSpan(headerData, keyName, 'RowSpan')}\n align=\"center\"\n >\n {headerData[keyName]}\n </TableCell>\n ))}\n </StyledTableRow>\n ))}\n </TableHead>\n <TableBody>\n {rows.map((row, index) => {\n const currentRow = row as OwpTableRowData;\n\n return (\n <StyledTableRow key={`table-row-${index}`}>\n {commonKeyListData.map((keyName) => (\n <TableCell\n key={`table-row-cell-${index}-${keyName}`}\n className=\"whitespace-pre-wrap h-64\"\n sx={getTableCellSx(currentRow, keyName)}\n align=\"center\"\n >\n {currentRow[keyName] as ReactNode}\n </TableCell>\n ))}\n </StyledTableRow>\n );\n })}\n </TableBody>\n </StyledTable>\n );\n}\n"],"names":["getTableColumnKeys","__name","row","keyName","getTableCellSx","getTableCellSpan","spanType","mergeSx","styles","acc","style","isArray","treeGridContainerSx","OwpTableTotalCount","totalCount","jsxs","Fragment","jsx","Divider","Typography","isNumber","StyledTable","canBodyFullHeight","canUseTreeGridStyle","children","className","containerProps","footerSlot","tableThemeProp","tableLayout","tableProps","currentSettings","useGetCurrentSettings","treeGridTheme","useMemo","resolveOwpGridTheme","_b","_a","tableTheme","resolveOwpTableTheme","defaultStyledTableTheme","GlobalStyles","getTreeGridFontFaceStyles","TableContainer","Paper","getTreeGridContainerSx","StyledTableInner","clsx","styled","Table","prop","theme","resolvedTreeGridTheme","resolvedTableTheme","getTreeGridCellBaseSx","getDefaultTableCellSx","getTreeGridHeaderCellSx","TREEGRID_TABLE_HEADER_BORDER_COLOR","getDefaultTableHeaderCellSx","getTreeGridBodyCellSx","TREEGRID_TABLE_BODY_BORDER_COLOR","getTreeGridBodyRowSx","StyledTableRow","TableRow","OwpTable","canTotalCountRow","headers","rows","restTableProps","resolvedHeaderRows","isEmpty","commonKeyListData","TableHead","headerData","index","TableCell","TableBody","currentRow"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAMA,IAAqB,gBAAAC,EAAA,CAACC,MACrBA,IAIE,OAAO,KAAKA,CAAG,EAAE,OAAO,CAACC,MAAY,CAACA,EAAQ,SAAS,MAAM,CAAC,IAH5D,CAAA,GAFgB,uBAQrBC,IAA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ACE,UAAAT,EAAK,IAAI,CAACjE,GAAKwE,MAAU;AACxB,gBAAMG,IAAa3E;AAEnB,iBACE,gBAAAe,EAAC6C,GAAA,EACE,UAAAS,EAAkB,IAAI,CAACpE,MACtB,gBAAAc;AAAA,YAAC0D;AAAA,YAAA;AAAA,cAEC,WAAU;AAAA,cACV,IAAIvE,EAAeyE,GAAY1E,CAAO;AAAA,cACtC,OAAM;AAAA,cAEL,YAAWA,CAAO;AAAA,YAAA;AAAA,YALd,kBAAkBuE,CAAK,IAAIvE,CAAO;AAAA,UAAA,CAO1C,KAVkB,aAAauE,CAAK,EAWvC;AAAA,QAEJ,CAAC,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAlEgBzE,EAAA+D,IAAA;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var t = Object.defineProperty;
|
|
2
|
+
var e = (o, r) => t(o, "name", { value: r, configurable: !0 });
|
|
3
|
+
import { grey as l } from "@mui/material/colors";
|
|
4
|
+
const n = "7px 10px", d = {
|
|
5
|
+
header: {
|
|
6
|
+
backgroundColor: "",
|
|
7
|
+
color: "inherit",
|
|
8
|
+
fontSize: "1.7rem",
|
|
9
|
+
fontWeight: 600
|
|
10
|
+
},
|
|
11
|
+
cell: {
|
|
12
|
+
fontSize: "1.7rem"
|
|
13
|
+
}
|
|
14
|
+
}, i = /* @__PURE__ */ e((o) => ({
|
|
15
|
+
fontSize: o.cell.fontSize,
|
|
16
|
+
padding: n,
|
|
17
|
+
borderLeft: "none",
|
|
18
|
+
borderRight: "none"
|
|
19
|
+
}), "getDefaultTableCellSx"), f = /* @__PURE__ */ e((o, r = l[200]) => ({
|
|
20
|
+
...i(o),
|
|
21
|
+
backgroundColor: o.header.backgroundColor || r,
|
|
22
|
+
color: o.header.color,
|
|
23
|
+
fontSize: o.header.fontSize,
|
|
24
|
+
fontWeight: o.header.fontWeight
|
|
25
|
+
}), "getDefaultTableHeaderCellSx"), S = /* @__PURE__ */ e((o) => ({
|
|
26
|
+
color: o.header.color,
|
|
27
|
+
fontSize: o.header.fontSize,
|
|
28
|
+
fontWeight: o.header.fontWeight
|
|
29
|
+
}), "getDefaultTableHeaderLabelSx"), g = {
|
|
30
|
+
"&.MuiTableSortLabel-root": {
|
|
31
|
+
color: "inherit"
|
|
32
|
+
},
|
|
33
|
+
"&.MuiTableSortLabel-root:hover": {
|
|
34
|
+
color: "inherit"
|
|
35
|
+
},
|
|
36
|
+
"&.Mui-active": {
|
|
37
|
+
color: "inherit"
|
|
38
|
+
},
|
|
39
|
+
"& .MuiTableSortLabel-icon": {
|
|
40
|
+
color: "currentColor !important"
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
d as defaultStyledTableTheme,
|
|
45
|
+
g as defaultTableSortLabelSx,
|
|
46
|
+
i as getDefaultTableCellSx,
|
|
47
|
+
f as getDefaultTableHeaderCellSx,
|
|
48
|
+
S as getDefaultTableHeaderLabelSx
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=defaultTableStyle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultTableStyle.js","sources":["../../../../src/components/OwpTable/internal/defaultTableStyle.ts"],"sourcesContent":["import type { OwpResolvedTableThemeConfigType } from '@/constants/tableTheme';\nimport { grey } from '@mui/material/colors';\n\nconst DEFAULT_TABLE_CELL_PADDING = '7px 10px';\n\nexport const defaultStyledTableTheme = {\n header: {\n backgroundColor: '',\n color: 'inherit',\n fontSize: '1.7rem',\n fontWeight: 600,\n },\n cell: {\n fontSize: '1.7rem',\n },\n} satisfies OwpResolvedTableThemeConfigType;\n\n/** 기본 table cell sx */\nexport const getDefaultTableCellSx = (tableTheme: OwpResolvedTableThemeConfigType) =>\n ({\n fontSize: tableTheme.cell.fontSize,\n padding: DEFAULT_TABLE_CELL_PADDING,\n borderLeft: 'none',\n borderRight: 'none',\n }) as const;\n\n/** 기본 table header cell sx */\nexport const getDefaultTableHeaderCellSx = (\n tableTheme: OwpResolvedTableThemeConfigType,\n fallbackBackgroundColor: string = grey[200],\n) =>\n ({\n ...getDefaultTableCellSx(tableTheme),\n backgroundColor: tableTheme.header.backgroundColor || fallbackBackgroundColor,\n color: tableTheme.header.color,\n fontSize: tableTheme.header.fontSize,\n fontWeight: tableTheme.header.fontWeight,\n }) as const;\n\n/** 기본 table header label sx */\nexport const getDefaultTableHeaderLabelSx = (tableTheme: OwpResolvedTableThemeConfigType) =>\n ({\n color: tableTheme.header.color,\n fontSize: tableTheme.header.fontSize,\n fontWeight: tableTheme.header.fontWeight,\n }) as const;\n\nexport const defaultTableSortLabelSx = {\n '&.MuiTableSortLabel-root': {\n color: 'inherit',\n },\n '&.MuiTableSortLabel-root:hover': {\n color: 'inherit',\n },\n '&.Mui-active': {\n color: 'inherit',\n },\n '& .MuiTableSortLabel-icon': {\n color: 'currentColor !important',\n },\n} as const;\n"],"names":["DEFAULT_TABLE_CELL_PADDING","defaultStyledTableTheme","getDefaultTableCellSx","__name","tableTheme","getDefaultTableHeaderCellSx","fallbackBackgroundColor","grey","getDefaultTableHeaderLabelSx","defaultTableSortLabelSx"],"mappings":";;;AAGA,MAAMA,IAA6B,YAEtBC,IAA0B;AAAA,EACrC,QAAQ;AAAA,IACN,iBAAiB;AAAA,IACjB,OAAO;AAAA,IACP,UAAU;AAAA,IACV,YAAY;AAAA,EAAA;AAAA,EAEd,MAAM;AAAA,IACJ,UAAU;AAAA,EAAA;AAEd,GAGaC,IAAwB,gBAAAC,EAAA,CAACC,OACnC;AAAA,EACC,UAAUA,EAAW,KAAK;AAAA,EAC1B,SAASJ;AAAA,EACT,YAAY;AAAA,EACZ,aAAa;AACf,IANmC,0BASxBK,IAA8B,gBAAAF,EAAA,CACzCC,GACAE,IAAkCC,EAAK,GAAG,OAEzC;AAAA,EACC,GAAGL,EAAsBE,CAAU;AAAA,EACnC,iBAAiBA,EAAW,OAAO,mBAAmBE;AAAA,EACtD,OAAOF,EAAW,OAAO;AAAA,EACzB,UAAUA,EAAW,OAAO;AAAA,EAC5B,YAAYA,EAAW,OAAO;AAChC,IAVyC,gCAa9BI,IAA+B,gBAAAL,EAAA,CAACC,OAC1C;AAAA,EACC,OAAOA,EAAW,OAAO;AAAA,EACzB,UAAUA,EAAW,OAAO;AAAA,EAC5B,YAAYA,EAAW,OAAO;AAChC,IAL0C,iCAO/BK,IAA0B;AAAA,EACrC,4BAA4B;AAAA,IAC1B,OAAO;AAAA,EAAA;AAAA,EAET,kCAAkC;AAAA,IAChC,OAAO;AAAA,EAAA;AAAA,EAET,gBAAgB;AAAA,IACd,OAAO;AAAA,EAAA;AAAA,EAET,6BAA6B;AAAA,IAC3B,OAAO;AAAA,EAAA;AAEX;"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
var
|
|
2
|
-
var a = (r, l) =>
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { resolveOwpGridTheme as
|
|
1
|
+
var Ze = Object.defineProperty;
|
|
2
|
+
var a = (r, l) => Ze(r, "name", { value: l, configurable: !0 });
|
|
3
|
+
import { jsxs as $e, jsx as L } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
|
|
4
|
+
import { resolveOwpGridTheme as er } from "../../constants/gridTheme.js";
|
|
5
5
|
import { resolveTreeGridColorNumber as _, TREEGRID_INPUT_CELL_COLOR as he, TREEGRID_CELL_HIGHLIGHT_COLOR as He } from "../../constants/treeGrid.js";
|
|
6
|
-
import { useGetCurrentSettings as
|
|
7
|
-
import { useOwpTranslation as
|
|
8
|
-
import { useGetCurrentLanguage as
|
|
6
|
+
import { useGetCurrentSettings as rr } from "../../hooks/useOwpSettings.js";
|
|
7
|
+
import { useOwpTranslation as tr } from "../../hooks/useOwpTranslation.js";
|
|
8
|
+
import { useGetCurrentLanguage as or } from "../../hooks/useCurrentLanguage.js";
|
|
9
9
|
import { TREE_GRID_BODY_ROWS_CHANGED_EVENT as Ae } from "../../utils/treeGridBodyRowsEvent.js";
|
|
10
10
|
import { getTreeGridPerfTimestamp as z, countTreeGridPerf as ke, logTreeGridPerf as Pe, measureTreeGridPerf as Se } from "./internal/utils/perf.js";
|
|
11
|
-
import { useRef as e, useState as Y, useMemo as
|
|
12
|
-
import
|
|
13
|
-
import { useOwpTreeGridOverlayFrame as
|
|
14
|
-
import { bindTreeGridEvents as
|
|
15
|
-
import { applyTreeGridLayoutToGrid as
|
|
16
|
-
import { OwpTreeGridLoadingOverlay as
|
|
17
|
-
import { OwpTreeGridNoDataOverlay as
|
|
18
|
-
import { resolveTreeGridColumnEditRuleLookup as Me, createTreeGridColumnEditRulesState as
|
|
19
|
-
import { createTreeGridThemeContainerStyle as
|
|
11
|
+
import { useRef as e, useState as Y, useMemo as nr, useEffect as O, useLayoutEffect as ir } from "react";
|
|
12
|
+
import sr from "@mui/material/GlobalStyles";
|
|
13
|
+
import { useOwpTreeGridOverlayFrame as ur } from "./internal/hooks/useOwpTreeGridOverlayFrame.js";
|
|
14
|
+
import { bindTreeGridEvents as lr, getTreeGridBodyDataCount as J, buildTreeGridInitializationOptions as ar, hasTreeGridDisplayDataRows as Ne, replaceTreeGridBodyData as cr, TREE_GRID_BINDING_LOADING_MIN_VISIBLE_MS as dr } from "./internal/treeGridRuntime.js";
|
|
15
|
+
import { applyTreeGridLayoutToGrid as fr } from "./internal/treeGridLayout.js";
|
|
16
|
+
import { OwpTreeGridLoadingOverlay as mr } from "./internal/OwpTreeGridLoadingOverlay.js";
|
|
17
|
+
import { OwpTreeGridNoDataOverlay as pr } from "./internal/OwpTreeGridNoDataOverlay.js";
|
|
18
|
+
import { resolveTreeGridColumnEditRuleLookup as Me, createTreeGridColumnEditRulesState as Rr, syncTreeGridColumnEditRules as Tr } from "./internal/treeGridColumnEditRules.js";
|
|
19
|
+
import { createTreeGridThemeContainerStyle as yr, TREE_GRID_THEME_WRAPPER_CLASS as Gr, treeGridThemeStyles as gr } from "./internal/treeGridTheme.js";
|
|
20
20
|
import { isEmpty as w } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js";
|
|
21
|
-
import { delay as
|
|
21
|
+
import { delay as vr } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/function/delay.js";
|
|
22
22
|
import { isEqual as xe } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/predicate/isEqual.js";
|
|
23
|
-
import { omit as
|
|
24
|
-
const
|
|
23
|
+
import { omit as Cr } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/object/omit.js";
|
|
24
|
+
const zr = /* @__PURE__ */ a(({
|
|
25
25
|
id: r = "treeGridWrapper",
|
|
26
26
|
containerStyle: l,
|
|
27
27
|
containerClassName: Ve,
|
|
@@ -30,7 +30,8 @@ const Fr = /* @__PURE__ */ a(({
|
|
|
30
30
|
height: K = "100%",
|
|
31
31
|
width: Q = "100%",
|
|
32
32
|
layoutUrl: We,
|
|
33
|
-
|
|
33
|
+
layoutData: Fe,
|
|
34
|
+
dataUrl: ze,
|
|
34
35
|
layoutOverrides: h,
|
|
35
36
|
data: o,
|
|
36
37
|
useDataUrl: U,
|
|
@@ -47,11 +48,11 @@ const Fr = /* @__PURE__ */ a(({
|
|
|
47
48
|
columnEditRules: m,
|
|
48
49
|
highlightEditableCells: ue = !0,
|
|
49
50
|
highlightChangedCells: le = !0,
|
|
50
|
-
loading:
|
|
51
|
+
loading: Ye,
|
|
51
52
|
showLoading: n = !0
|
|
52
53
|
}) => {
|
|
53
54
|
var De, Be;
|
|
54
|
-
const { t: H } =
|
|
55
|
+
const { t: H } = tr(), A = rr(), k = (Be = (De = A == null ? void 0 : A.theme) == null ? void 0 : De.main) == null ? void 0 : Be.grid, i = e(null), ae = e(null), ce = e(null), P = e(null), S = e(h), de = e(o), N = e(
|
|
55
56
|
m
|
|
56
57
|
), M = e(
|
|
57
58
|
Me(m, {
|
|
@@ -70,14 +71,14 @@ const Fr = /* @__PURE__ */ a(({
|
|
|
70
71
|
onAfterValueChanged: se
|
|
71
72
|
}), p = e(void 0), x = e(!1), C = e(void 0), E = e(void 0), b = e(
|
|
72
73
|
void 0
|
|
73
|
-
), me = e(
|
|
74
|
-
() =>
|
|
74
|
+
), me = e(Rr()), Je = e(!1), R = e(0), c = e(null), T = e(void 0), y = e(void 0), pe = e(ue), Re = e(le), [V, Ke] = Y(!1), [Qe, G] = Y(!1), [Ue, Te] = Y(!1), D = or(), s = nr(
|
|
75
|
+
() => er(k),
|
|
75
76
|
[k]
|
|
76
77
|
), ye = e(
|
|
77
78
|
_(s.editable.backgroundColor) ?? _(he)
|
|
78
79
|
), Ge = e(
|
|
79
80
|
s.changed.backgroundColor ?? He
|
|
80
|
-
), ge = e(s.state.selectedCellBackgroundColor), ve = e(s.state.hoverCellBackgroundColor), Ce = e(D.id),
|
|
81
|
+
), ge = e(s.state.selectedCellBackgroundColor), ve = e(s.state.hoverCellBackgroundColor), Ce = e(D.id), Xe = n && o !== void 0 && V && E.current !== o, j = n && Ye === !0 || n && (Qe || Xe), q = !j && o !== void 0 && w(o) && !Ue, Ee = /* @__PURE__ */ a((t) => {
|
|
81
82
|
Te(Ne(t));
|
|
82
83
|
}, "syncHasDisplayDataRows");
|
|
83
84
|
S.current = h, de.current = o, N.current = m, M.current = Me(m, {
|
|
@@ -94,7 +95,7 @@ const Fr = /* @__PURE__ */ a(({
|
|
|
94
95
|
onReady: ie,
|
|
95
96
|
onAfterValueChanged: se
|
|
96
97
|
};
|
|
97
|
-
const be =
|
|
98
|
+
const be = ur({
|
|
98
99
|
visible: j || q,
|
|
99
100
|
containerRef: ae,
|
|
100
101
|
treeGridInstanceRef: i,
|
|
@@ -117,7 +118,7 @@ const Fr = /* @__PURE__ */ a(({
|
|
|
117
118
|
}, [n]), O(() => {
|
|
118
119
|
var t;
|
|
119
120
|
if (D.id !== Ce.current && !w(i.current) && ((t = i.current) == null || t.Dispose(), i.current = null, Ce.current = D.id), !!w(i.current))
|
|
120
|
-
return
|
|
121
|
+
return lr({
|
|
121
122
|
id: r,
|
|
122
123
|
latestEventHandlersRef: fe,
|
|
123
124
|
highlightEditableCellsRef: pe,
|
|
@@ -135,17 +136,18 @@ const Fr = /* @__PURE__ */ a(({
|
|
|
135
136
|
latestColumnEditRuleLookupRef: M,
|
|
136
137
|
appliedColumnEditRulesRef: b,
|
|
137
138
|
columnEditRulesStateRef: me,
|
|
138
|
-
hasAppliedInitialLayoutRef:
|
|
139
|
+
hasAppliedInitialLayoutRef: Je,
|
|
139
140
|
syncHasDisplayDataRows: Ee,
|
|
140
|
-
setIsTreeGridReady:
|
|
141
|
+
setIsTreeGridReady: Ke
|
|
141
142
|
}), ce.current = z(), ke(r, "init"), Pe(r, "TreeGrid init start", {
|
|
142
143
|
useDataUrl: !!U,
|
|
143
144
|
bodyRowCount: J(o)
|
|
144
145
|
}), window.TreeGrid(
|
|
145
|
-
|
|
146
|
+
ar({
|
|
146
147
|
id: r,
|
|
147
148
|
layoutUrl: We,
|
|
148
|
-
|
|
149
|
+
layoutData: Fe,
|
|
150
|
+
dataUrl: ze,
|
|
149
151
|
bodyData: o,
|
|
150
152
|
useDataUrl: U,
|
|
151
153
|
width: Q,
|
|
@@ -155,12 +157,12 @@ const Fr = /* @__PURE__ */ a(({
|
|
|
155
157
|
r,
|
|
156
158
|
r
|
|
157
159
|
), () => {
|
|
158
|
-
|
|
160
|
+
vr(() => {
|
|
159
161
|
var u;
|
|
160
162
|
(u = i.current) == null || u.Dispose();
|
|
161
163
|
}, 200);
|
|
162
164
|
};
|
|
163
|
-
}, []),
|
|
165
|
+
}, []), ir(() => {
|
|
164
166
|
const t = i.current, u = S.current, g = de.current, d = N.current;
|
|
165
167
|
if (w(t) || !V)
|
|
166
168
|
return;
|
|
@@ -168,7 +170,7 @@ const Fr = /* @__PURE__ */ a(({
|
|
|
168
170
|
if (!(!Ie && !I && !Le)) {
|
|
169
171
|
if (Ie) {
|
|
170
172
|
const f = z();
|
|
171
|
-
|
|
173
|
+
fr(t, u, I), C.current = u, Se(r, "apply layout", f, {
|
|
172
174
|
disableBodyReload: !!I
|
|
173
175
|
});
|
|
174
176
|
}
|
|
@@ -177,7 +179,7 @@ const Fr = /* @__PURE__ */ a(({
|
|
|
177
179
|
const v = p.current;
|
|
178
180
|
y.current = void 0, P.current = z(), ke(r, "reload"), Pe(r, "ReloadBody start", {
|
|
179
181
|
bodyRowCount: J(v)
|
|
180
|
-
}),
|
|
182
|
+
}), cr(t, v, () => {
|
|
181
183
|
if (R.current !== f)
|
|
182
184
|
return;
|
|
183
185
|
E.current = v, Ee(t), Se(r, "ReloadBody end", P.current, {
|
|
@@ -190,7 +192,7 @@ const Fr = /* @__PURE__ */ a(({
|
|
|
190
192
|
}
|
|
191
193
|
const we = Math.max(
|
|
192
194
|
0,
|
|
193
|
-
|
|
195
|
+
dr - (Date.now() - Oe)
|
|
194
196
|
);
|
|
195
197
|
if (B(), we === 0) {
|
|
196
198
|
c.current = null, G(!1);
|
|
@@ -205,7 +207,7 @@ const Fr = /* @__PURE__ */ a(({
|
|
|
205
207
|
R.current === f && _e();
|
|
206
208
|
}, 0)) : _e();
|
|
207
209
|
}
|
|
208
|
-
Le && (
|
|
210
|
+
Le && (Tr(
|
|
209
211
|
t,
|
|
210
212
|
M.current,
|
|
211
213
|
me.current
|
|
@@ -214,36 +216,36 @@ const Fr = /* @__PURE__ */ a(({
|
|
|
214
216
|
}, [V, h, o, m, n, r]), O(() => () => {
|
|
215
217
|
W(), B();
|
|
216
218
|
}, []);
|
|
217
|
-
const F =
|
|
219
|
+
const F = yr({
|
|
218
220
|
width: Q,
|
|
219
221
|
height: K,
|
|
220
222
|
treeGridTheme: s,
|
|
221
223
|
gridThemeConfig: k,
|
|
222
224
|
containerStyle: l
|
|
223
225
|
});
|
|
224
|
-
return (n || q) && (F.position = l != null && l.position && l.position !== "static" ? l.position : "relative", F.isolation = "isolate"), /* @__PURE__ */
|
|
226
|
+
return (n || q) && (F.position = l != null && l.position && l.position !== "static" ? l.position : "relative", F.isolation = "isolate"), /* @__PURE__ */ $e(
|
|
225
227
|
"div",
|
|
226
228
|
{
|
|
227
229
|
ref: ae,
|
|
228
|
-
className: [
|
|
230
|
+
className: [Gr, Ve].filter(Boolean).join(" "),
|
|
229
231
|
style: F,
|
|
230
232
|
children: [
|
|
231
|
-
/* @__PURE__ */ L(
|
|
232
|
-
/* @__PURE__ */ L("div", { id: r, className: je, style:
|
|
233
|
+
/* @__PURE__ */ L(sr, { styles: gr }),
|
|
234
|
+
/* @__PURE__ */ L("div", { id: r, className: je, style: Cr(qe, ["height", "width"]) }),
|
|
233
235
|
/* @__PURE__ */ L(
|
|
234
|
-
|
|
236
|
+
pr,
|
|
235
237
|
{
|
|
236
238
|
visible: q,
|
|
237
239
|
message: H("Message.조회된 결과가 없습니다."),
|
|
238
240
|
overlayFrame: be
|
|
239
241
|
}
|
|
240
242
|
),
|
|
241
|
-
/* @__PURE__ */ L(
|
|
243
|
+
/* @__PURE__ */ L(mr, { visible: j, overlayFrame: be })
|
|
242
244
|
]
|
|
243
245
|
}
|
|
244
246
|
);
|
|
245
247
|
}, "OwpTreeGrid");
|
|
246
248
|
export {
|
|
247
|
-
|
|
249
|
+
zr as OwpTreeGrid
|
|
248
250
|
};
|
|
249
251
|
//# sourceMappingURL=OwpTreeGrid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwpTreeGrid.js","sources":["../../../src/components/OwpTreeGrid/OwpTreeGrid.tsx"],"sourcesContent":["import { resolveOwpGridTheme } from '@/constants/gridTheme';\nimport {\n resolveTreeGridColorNumber,\n TREEGRID_CELL_HIGHLIGHT_COLOR,\n TREEGRID_INPUT_CELL_COLOR,\n} from '@/constants/treeGrid';\nimport { useGetCurrentSettings } from '@/hooks/useOwpSettings';\nimport { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport { useGetCurrentLanguage } from '@/hooks/useCurrentLanguage';\nimport {\n TREE_GRID_BODY_ROWS_CHANGED_EVENT,\n type TreeGridBodyRowsChangedEventDetail,\n} from '@/utils/treeGridBodyRowsEvent';\nimport { delay, isEmpty, isEqual, omit } from 'es-toolkit/compat';\n// Temporary TreeGrid perf instrumentation import. Remove with ./internal/utils/perf after profiling is finished.\nimport {\n countTreeGridPerf,\n getTreeGridPerfTimestamp,\n logTreeGridPerf,\n measureTreeGridPerf,\n} from './internal/utils/perf';\nimport {\n type CSSProperties,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport GlobalStyles from '@mui/material/GlobalStyles';\nimport { useOwpTreeGridOverlayFrame } from './internal/hooks/useOwpTreeGridOverlayFrame';\nimport {\n bindTreeGridEvents,\n buildTreeGridInitializationOptions,\n getTreeGridBodyDataCount,\n hasTreeGridDisplayDataRows,\n replaceTreeGridBodyData,\n TREE_GRID_BINDING_LOADING_MIN_VISIBLE_MS,\n type TreeGridEventHandlers,\n} from './internal/treeGridRuntime';\nimport { applyTreeGridLayoutToGrid } from './internal/treeGridLayout';\nimport { OwpTreeGridLoadingOverlay } from './internal/OwpTreeGridLoadingOverlay';\nimport { OwpTreeGridNoDataOverlay } from './internal/OwpTreeGridNoDataOverlay';\nimport {\n createTreeGridColumnEditRulesState,\n resolveTreeGridColumnEditRuleLookup,\n syncTreeGridColumnEditRules,\n} from './internal/treeGridColumnEditRules';\nimport {\n createTreeGridThemeContainerStyle,\n TREE_GRID_THEME_WRAPPER_CLASS,\n treeGridThemeStyles,\n type TreeGridThemeContainerStyle,\n} from './internal/treeGridTheme';\n\ntype TreeGridLayoutScalarValue = string | number;\ntype TreeGridNestedLayoutFields = Record<string, TreeGridLayoutScalarValue>;\ntype TreeGridLayoutFields = Record<string, TreeGridLayoutScalarValue | TreeGridNestedLayoutFields>;\ntype TreeGridSectionFields = Record<string, TreeGridLayoutScalarValue>;\n\nexport interface OwpTreeGridLayout {\n Header?: TreeGridLayoutFields;\n Toolbar?: TreeGridSectionFields;\n Foot?: TreeGridSectionFields;\n}\n\nexport type OwpTreeGridLayoutConfig = OwpTreeGridLayout;\nexport type THeader = OwpTreeGridLayoutConfig;\nexport type OwpTreeGridBodyData<T> = Record<string, never> | [] | undefined | T[];\nexport type OwpTreeGridData<T> = OwpTreeGridBodyData<T>;\nexport type TData<T> = OwpTreeGridBodyData<T>;\nexport type OwpTreeGridRowModel<T> = TRow & T;\nexport type OwpTreeGridSelectedRows<T> = OwpTreeGridRowModel<T>[];\nexport type OwpTreeGridColumnEditPreset = 'hourMinute';\n\nexport interface OwpTreeGridColumnEditRule {\n columns: readonly string[];\n preset: OwpTreeGridColumnEditPreset;\n}\n\ntype OwpTreeGridSelectHandler<T> = (selectedRows: OwpTreeGridSelectedRows<T>) => void;\ntype OwpTreeGridRowAddHandler<T> = (grid: TGrid, row: OwpTreeGridRowModel<T>) => void;\ntype OwpTreeGridRowDeleteHandler<T> = (\n grid: TGrid,\n row: OwpTreeGridRowModel<T>,\n deleteType: number,\n) => void;\ntype OwpTreeGridRowUndeleteHandler<T> = (grid: TGrid, row: OwpTreeGridRowModel<T>) => void;\ntype OwpTreeGridButtonClickHandler<T> = (\n grid: TGrid,\n row: OwpTreeGridRowModel<T>,\n col: string,\n event: Event,\n) => void;\ntype OwpTreeGridRowClickHandler<T> = (\n grid: TGrid,\n row: OwpTreeGridRowModel<T>,\n col: string,\n x: number,\n y: number,\n event: Event,\n) => void;\ntype OwpTreeGridSaveHandler<T> = (\n grid: TGrid,\n row: OwpTreeGridRowModel<T>,\n autoupdate: boolean | number,\n) => void;\ntype OwpTreeGridCellValue = unknown;\ntype OwpTreeGridAfterValueChangedHandler<T> = (\n grid: TGrid,\n row: OwpTreeGridRowModel<T>,\n col: string,\n value: OwpTreeGridCellValue,\n) => void;\n\nexport interface OwpTreeGridProps<T> {\n id: string;\n className?: string;\n containerStyle?: CSSProperties;\n containerClassName?: string;\n layoutUrl?: string;\n dataUrl?: string;\n layoutOverrides?: OwpTreeGridLayoutConfig;\n data?: OwpTreeGridBodyData<T>;\n style?: CSSProperties;\n height?: string | number;\n width?: string | number;\n useDataUrl?: boolean;\n onSelect?: OwpTreeGridSelectHandler<T>;\n onRowAdd?: OwpTreeGridRowAddHandler<T>;\n onRowDelete?: OwpTreeGridRowDeleteHandler<T>;\n onRowUndelete?: OwpTreeGridRowUndeleteHandler<T>;\n onRowChange?: OwpTreeGridAfterValueChangedHandler<T>;\n onClickButton?: OwpTreeGridButtonClickHandler<T>;\n onReady?: (grid: TGrid) => void;\n onRowClick?: OwpTreeGridRowClickHandler<T>;\n onSave?: OwpTreeGridSaveHandler<T>;\n onAfterValueChanged?: OwpTreeGridAfterValueChangedHandler<T>;\n columnEditRules?: readonly OwpTreeGridColumnEditRule[];\n highlightEditableCells?: boolean;\n highlightChangedCells?: boolean;\n loading?: boolean;\n showLoading?: boolean;\n}\n\n/**\n * OwpTreeGrid 컴포넌트\n * @param id 식별자\n * @param containerStyle containerStyle 값\n * @param containerClassName containerClassName 값\n * @param className CSS 클래스명\n * @param style 스타일 객체\n * @param height height 값\n */\nconst OwpTreeGrid = <T,>({\n id = 'treeGridWrapper',\n containerStyle,\n containerClassName,\n className,\n style,\n height = '100%',\n width = '100%',\n layoutUrl,\n dataUrl,\n layoutOverrides,\n data,\n useDataUrl,\n onSelect,\n onRowClick,\n onRowAdd,\n onRowDelete,\n onRowUndelete,\n onRowChange,\n onClickButton,\n onSave,\n onReady,\n onAfterValueChanged,\n columnEditRules,\n highlightEditableCells = true,\n highlightChangedCells = true,\n loading,\n showLoading = true,\n}: OwpTreeGridProps<T>) => {\n const { t } = useOwpTranslation();\n const currentSettings = useGetCurrentSettings();\n const currentGridThemeConfig = currentSettings?.theme?.main?.grid;\n const treeGridInstanceRef = useRef<TGrid>(null);\n const treeGridContainerRef = useRef<HTMLDivElement | null>(null);\n const treeGridInitStartedAtRef = useRef<number | null>(null);\n const bodyReloadStartedAtRef = useRef<number | null>(null);\n const latestLayoutOverridesRef = useRef<OwpTreeGridLayoutConfig | undefined>(layoutOverrides);\n const latestBodyDataPropRef = useRef<OwpTreeGridBodyData<T>>(data);\n const latestColumnEditRulesRef = useRef<readonly OwpTreeGridColumnEditRule[] | undefined>(\n columnEditRules,\n );\n const latestColumnEditRuleLookupRef = useRef(\n resolveTreeGridColumnEditRuleLookup(columnEditRules, {\n hourMinuteInvalidText: t('Message.시간은 HH:mm 형식으로 입력해주세요.'),\n }),\n );\n const latestEventHandlersRef = useRef<TreeGridEventHandlers<T>>({\n onSelect,\n onRowClick,\n onRowAdd,\n onRowDelete,\n onRowUndelete,\n onRowChange,\n onClickButton,\n onSave,\n onReady,\n onAfterValueChanged,\n });\n const stagedBodyDataPropRef = useRef<OwpTreeGridBodyData<T>>(undefined);\n const hasStagedBodyDataPropRef = useRef(false);\n const appliedLayoutOverridesRef = useRef<OwpTreeGridLayoutConfig | undefined>(undefined);\n const appliedBodyDataPropRef = useRef<OwpTreeGridBodyData<T>>(undefined);\n const appliedColumnEditRulesRef = useRef<readonly OwpTreeGridColumnEditRule[] | undefined>(\n undefined,\n );\n const columnEditRulesStateRef = useRef(createTreeGridColumnEditRulesState());\n const hasAppliedInitialLayoutRef = useRef(false);\n const bodyReloadSequenceRef = useRef(0);\n const bindingLoadingStartedAtRef = useRef<number | null>(null);\n const bindingLoadingHideTimeoutRef = useRef<number | undefined>(undefined);\n const bodyReloadStartTimeoutRef = useRef<number | undefined>(undefined);\n const highlightEditableCellsRef = useRef(highlightEditableCells);\n const highlightChangedCellsRef = useRef(highlightChangedCells);\n const [isTreeGridReady, setIsTreeGridReady] = useState(false);\n const [isBindingLoadingVisible, setIsBindingLoadingVisible] = useState(false);\n const [hasDisplayDataRows, setHasDisplayDataRows] = useState(false);\n const currentLanguage = useGetCurrentLanguage();\n const treeGridTheme = useMemo(\n () => resolveOwpGridTheme(currentGridThemeConfig),\n [currentGridThemeConfig],\n );\n const editableCellBackgroundColorValueRef = useRef(\n resolveTreeGridColorNumber(treeGridTheme.editable.backgroundColor) ??\n resolveTreeGridColorNumber(TREEGRID_INPUT_CELL_COLOR),\n );\n const changedCellBackgroundColorRef = useRef(\n treeGridTheme.changed.backgroundColor ?? TREEGRID_CELL_HIGHLIGHT_COLOR,\n );\n const selectedCellBackgroundColorRef = useRef(treeGridTheme.state.selectedCellBackgroundColor);\n const hoverCellBackgroundColorRef = useRef(treeGridTheme.state.hoverCellBackgroundColor);\n const currentLanguageIdRef = useRef(currentLanguage.id);\n const isPendingBodyReload =\n showLoading &&\n data !== undefined &&\n isTreeGridReady &&\n appliedBodyDataPropRef.current !== data;\n const isInternalLoadingVisible = showLoading && (isBindingLoadingVisible || isPendingBodyReload);\n const isLoadingOverlayVisible = (showLoading && loading === true) || isInternalLoadingVisible;\n const isNoDataVisible =\n !isLoadingOverlayVisible && data !== undefined && isEmpty(data) && !hasDisplayDataRows;\n\n const syncHasDisplayDataRows = (grid: TGrid | null) => {\n setHasDisplayDataRows(hasTreeGridDisplayDataRows(grid));\n };\n\n latestLayoutOverridesRef.current = layoutOverrides;\n latestBodyDataPropRef.current = data;\n latestColumnEditRulesRef.current = columnEditRules;\n latestColumnEditRuleLookupRef.current = resolveTreeGridColumnEditRuleLookup(columnEditRules, {\n hourMinuteInvalidText: t('Message.시간은 HH:mm 형식으로 입력해주세요.'),\n });\n highlightEditableCellsRef.current = highlightEditableCells;\n highlightChangedCellsRef.current = highlightChangedCells;\n editableCellBackgroundColorValueRef.current =\n resolveTreeGridColorNumber(treeGridTheme.editable.backgroundColor) ??\n resolveTreeGridColorNumber(TREEGRID_INPUT_CELL_COLOR);\n changedCellBackgroundColorRef.current =\n treeGridTheme.changed.backgroundColor ?? TREEGRID_CELL_HIGHLIGHT_COLOR;\n selectedCellBackgroundColorRef.current = treeGridTheme.state.selectedCellBackgroundColor;\n hoverCellBackgroundColorRef.current = treeGridTheme.state.hoverCellBackgroundColor;\n latestEventHandlersRef.current = {\n onSelect,\n onRowClick,\n onRowAdd,\n onRowDelete,\n onRowUndelete,\n onRowChange,\n onClickButton,\n onSave,\n onReady,\n onAfterValueChanged,\n };\n\n const overlayFrame = useOwpTreeGridOverlayFrame({\n visible: isLoadingOverlayVisible || isNoDataVisible,\n containerRef: treeGridContainerRef,\n treeGridInstanceRef,\n debugId: id,\n });\n\n const clearBindingLoadingHideTimeout = () => {\n if (bindingLoadingHideTimeoutRef.current !== undefined) {\n window.clearTimeout(bindingLoadingHideTimeoutRef.current);\n bindingLoadingHideTimeoutRef.current = undefined;\n }\n };\n\n const clearBodyReloadStartTimeout = () => {\n if (bodyReloadStartTimeoutRef.current !== undefined) {\n window.clearTimeout(bodyReloadStartTimeoutRef.current);\n bodyReloadStartTimeoutRef.current = undefined;\n }\n };\n\n useEffect(() => {\n const handleBodyRowsChanged = (event: Event) => {\n const customEvent = event as CustomEvent<TreeGridBodyRowsChangedEventDetail>;\n\n if (customEvent.detail?.gridId !== id) {\n return;\n }\n\n setHasDisplayDataRows(hasTreeGridDisplayDataRows(treeGridInstanceRef.current));\n };\n\n window.addEventListener(TREE_GRID_BODY_ROWS_CHANGED_EVENT, handleBodyRowsChanged);\n\n return () => {\n window.removeEventListener(TREE_GRID_BODY_ROWS_CHANGED_EVENT, handleBodyRowsChanged);\n };\n }, [id]);\n\n useEffect(() => {\n if (!showLoading) {\n clearBodyReloadStartTimeout();\n clearBindingLoadingHideTimeout();\n bindingLoadingStartedAtRef.current = null;\n setIsBindingLoadingVisible(false);\n }\n }, [showLoading]);\n\n useEffect(() => {\n if (\n currentLanguage.id !== currentLanguageIdRef.current &&\n !isEmpty(treeGridInstanceRef.current)\n ) {\n treeGridInstanceRef.current?.Dispose();\n treeGridInstanceRef.current = null;\n currentLanguageIdRef.current = currentLanguage.id;\n }\n\n if (!isEmpty(treeGridInstanceRef.current)) {\n return;\n }\n\n bindTreeGridEvents({\n id,\n latestEventHandlersRef,\n highlightEditableCellsRef,\n highlightChangedCellsRef,\n editableCellBackgroundColorValueRef,\n changedCellBackgroundColorRef,\n selectedCellBackgroundColorRef,\n hoverCellBackgroundColorRef,\n treeGridInstanceRef,\n treeGridInitStartedAtRef,\n latestLayoutOverridesRef,\n appliedLayoutOverridesRef,\n appliedBodyDataPropRef,\n latestColumnEditRulesRef,\n latestColumnEditRuleLookupRef,\n appliedColumnEditRulesRef,\n columnEditRulesStateRef,\n hasAppliedInitialLayoutRef,\n syncHasDisplayDataRows,\n setIsTreeGridReady,\n });\n\n treeGridInitStartedAtRef.current = getTreeGridPerfTimestamp();\n countTreeGridPerf(id, 'init');\n logTreeGridPerf(id, 'TreeGrid init start', {\n useDataUrl: Boolean(useDataUrl),\n bodyRowCount: getTreeGridBodyDataCount(data),\n });\n\n window.TreeGrid(\n buildTreeGridInitializationOptions({\n id,\n layoutUrl,\n dataUrl,\n bodyData: data,\n useDataUrl,\n width,\n height,\n languageId: currentLanguage.id,\n }),\n id,\n id,\n );\n\n return () => {\n delay(() => {\n treeGridInstanceRef.current?.Dispose();\n }, 200);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useLayoutEffect(() => {\n const treeGrid = treeGridInstanceRef.current;\n const nextLayoutOverrides = latestLayoutOverridesRef.current;\n const nextBodyData = latestBodyDataPropRef.current;\n const nextColumnEditRules = latestColumnEditRulesRef.current;\n\n if (isEmpty(treeGrid) || !isTreeGridReady) {\n return;\n }\n\n const shouldApplyLayoutOverrides =\n appliedLayoutOverridesRef.current !== nextLayoutOverrides &&\n !isEqual(appliedLayoutOverridesRef.current, nextLayoutOverrides);\n const shouldApplyBodyData =\n appliedBodyDataPropRef.current !== nextBodyData &&\n (!hasStagedBodyDataPropRef.current || stagedBodyDataPropRef.current !== nextBodyData);\n const shouldApplyColumnEditRules =\n appliedColumnEditRulesRef.current !== nextColumnEditRules &&\n !isEqual(appliedColumnEditRulesRef.current, nextColumnEditRules);\n\n if (!shouldApplyLayoutOverrides && !shouldApplyBodyData && !shouldApplyColumnEditRules) {\n return;\n }\n\n if (shouldApplyLayoutOverrides) {\n const layoutApplyStartedAt = getTreeGridPerfTimestamp();\n\n applyTreeGridLayoutToGrid(treeGrid, nextLayoutOverrides, shouldApplyBodyData);\n appliedLayoutOverridesRef.current = nextLayoutOverrides;\n measureTreeGridPerf(id, 'apply layout', layoutApplyStartedAt, {\n disableBodyReload: Boolean(shouldApplyBodyData),\n });\n }\n\n if (shouldApplyBodyData) {\n const reloadSequence = bodyReloadSequenceRef.current + 1;\n const runBodyReload = () => {\n const bodyDataToApply = stagedBodyDataPropRef.current;\n\n bodyReloadStartTimeoutRef.current = undefined;\n bodyReloadStartedAtRef.current = getTreeGridPerfTimestamp();\n countTreeGridPerf(id, 'reload');\n logTreeGridPerf(id, 'ReloadBody start', {\n bodyRowCount: getTreeGridBodyDataCount(bodyDataToApply),\n });\n\n replaceTreeGridBodyData(treeGrid, bodyDataToApply, () => {\n if (bodyReloadSequenceRef.current !== reloadSequence) {\n return;\n }\n\n appliedBodyDataPropRef.current = bodyDataToApply;\n syncHasDisplayDataRows(treeGrid);\n measureTreeGridPerf(id, 'ReloadBody end', bodyReloadStartedAtRef.current, {\n bodyRowCount: getTreeGridBodyDataCount(bodyDataToApply),\n });\n bodyReloadStartedAtRef.current = null;\n\n if (stagedBodyDataPropRef.current === bodyDataToApply) {\n stagedBodyDataPropRef.current = undefined;\n hasStagedBodyDataPropRef.current = false;\n }\n\n const startedAt = bindingLoadingStartedAtRef.current;\n\n if (!showLoading || startedAt === null) {\n bindingLoadingStartedAtRef.current = null;\n setIsBindingLoadingVisible(false);\n return;\n }\n\n const remainingVisibleTime = Math.max(\n 0,\n TREE_GRID_BINDING_LOADING_MIN_VISIBLE_MS - (Date.now() - startedAt),\n );\n\n clearBindingLoadingHideTimeout();\n\n if (remainingVisibleTime === 0) {\n bindingLoadingStartedAtRef.current = null;\n setIsBindingLoadingVisible(false);\n return;\n }\n\n bindingLoadingHideTimeoutRef.current = window.setTimeout(() => {\n if (bodyReloadSequenceRef.current !== reloadSequence) {\n return;\n }\n\n bindingLoadingHideTimeoutRef.current = undefined;\n bindingLoadingStartedAtRef.current = null;\n setIsBindingLoadingVisible(false);\n }, remainingVisibleTime);\n });\n };\n\n bodyReloadSequenceRef.current = reloadSequence;\n stagedBodyDataPropRef.current = nextBodyData;\n hasStagedBodyDataPropRef.current = true;\n\n if (showLoading && nextBodyData !== undefined) {\n clearBodyReloadStartTimeout();\n clearBindingLoadingHideTimeout();\n bindingLoadingStartedAtRef.current = Date.now();\n setIsBindingLoadingVisible(true);\n bodyReloadStartTimeoutRef.current = window.setTimeout(() => {\n if (bodyReloadSequenceRef.current !== reloadSequence) {\n return;\n }\n\n runBodyReload();\n }, 0);\n } else {\n runBodyReload();\n }\n }\n\n if (shouldApplyColumnEditRules) {\n syncTreeGridColumnEditRules(\n treeGrid,\n latestColumnEditRuleLookupRef.current,\n columnEditRulesStateRef.current,\n );\n appliedColumnEditRulesRef.current = nextColumnEditRules;\n }\n }, [isTreeGridReady, layoutOverrides, data, columnEditRules, showLoading, id]);\n\n useEffect(() => {\n return () => {\n clearBodyReloadStartTimeout();\n clearBindingLoadingHideTimeout();\n };\n }, []);\n\n const resolvedContainerStyle: TreeGridThemeContainerStyle = createTreeGridThemeContainerStyle({\n width,\n height,\n treeGridTheme,\n gridThemeConfig: currentGridThemeConfig,\n containerStyle,\n });\n\n if (showLoading || isNoDataVisible) {\n resolvedContainerStyle.position =\n containerStyle?.position && containerStyle.position !== 'static'\n ? containerStyle.position\n : 'relative';\n resolvedContainerStyle.isolation = 'isolate';\n }\n\n return (\n <div\n ref={treeGridContainerRef}\n className={[TREE_GRID_THEME_WRAPPER_CLASS, containerClassName].filter(Boolean).join(' ')}\n style={resolvedContainerStyle}\n >\n <GlobalStyles styles={treeGridThemeStyles} />\n <div id={id} className={className} style={omit(style, ['height', 'width'])} />\n <OwpTreeGridNoDataOverlay\n visible={isNoDataVisible}\n message={t('Message.조회된 결과가 없습니다.')}\n overlayFrame={overlayFrame}\n />\n <OwpTreeGridLoadingOverlay visible={isLoadingOverlayVisible} overlayFrame={overlayFrame} />\n </div>\n );\n};\n\nexport { OwpTreeGrid };\n"],"names":["OwpTreeGrid","__name","id","containerStyle","containerClassName","className","style","height","width","layoutUrl","dataUrl","layoutOverrides","data","useDataUrl","onSelect","onRowClick","onRowAdd","onRowDelete","onRowUndelete","onRowChange","onClickButton","onSave","onReady","onAfterValueChanged","columnEditRules","highlightEditableCells","highlightChangedCells","loading","showLoading","t","useOwpTranslation","currentSettings","useGetCurrentSettings","currentGridThemeConfig","_b","_a","treeGridInstanceRef","useRef","treeGridContainerRef","treeGridInitStartedAtRef","bodyReloadStartedAtRef","latestLayoutOverridesRef","latestBodyDataPropRef","latestColumnEditRulesRef","latestColumnEditRuleLookupRef","resolveTreeGridColumnEditRuleLookup","latestEventHandlersRef","stagedBodyDataPropRef","hasStagedBodyDataPropRef","appliedLayoutOverridesRef","appliedBodyDataPropRef","appliedColumnEditRulesRef","columnEditRulesStateRef","createTreeGridColumnEditRulesState","hasAppliedInitialLayoutRef","bodyReloadSequenceRef","bindingLoadingStartedAtRef","bindingLoadingHideTimeoutRef","bodyReloadStartTimeoutRef","highlightEditableCellsRef","highlightChangedCellsRef","isTreeGridReady","setIsTreeGridReady","useState","isBindingLoadingVisible","setIsBindingLoadingVisible","hasDisplayDataRows","setHasDisplayDataRows","currentLanguage","useGetCurrentLanguage","treeGridTheme","useMemo","resolveOwpGridTheme","editableCellBackgroundColorValueRef","resolveTreeGridColorNumber","TREEGRID_INPUT_CELL_COLOR","changedCellBackgroundColorRef","TREEGRID_CELL_HIGHLIGHT_COLOR","selectedCellBackgroundColorRef","hoverCellBackgroundColorRef","currentLanguageIdRef","isPendingBodyReload","isLoadingOverlayVisible","isNoDataVisible","isEmpty","syncHasDisplayDataRows","grid","hasTreeGridDisplayDataRows","overlayFrame","useOwpTreeGridOverlayFrame","clearBindingLoadingHideTimeout","clearBodyReloadStartTimeout","useEffect","handleBodyRowsChanged","event","TREE_GRID_BODY_ROWS_CHANGED_EVENT","bindTreeGridEvents","getTreeGridPerfTimestamp","countTreeGridPerf","logTreeGridPerf","getTreeGridBodyDataCount","buildTreeGridInitializationOptions","delay","useLayoutEffect","treeGrid","nextLayoutOverrides","nextBodyData","nextColumnEditRules","shouldApplyLayoutOverrides","isEqual","shouldApplyBodyData","shouldApplyColumnEditRules","layoutApplyStartedAt","applyTreeGridLayoutToGrid","measureTreeGridPerf","reloadSequence","runBodyReload","bodyDataToApply","replaceTreeGridBodyData","startedAt","remainingVisibleTime","TREE_GRID_BINDING_LOADING_MIN_VISIBLE_MS","syncTreeGridColumnEditRules","resolvedContainerStyle","createTreeGridThemeContainerStyle","jsxs","TREE_GRID_THEME_WRAPPER_CLASS","jsx","GlobalStyles","treeGridThemeStyles","omit","OwpTreeGridNoDataOverlay","OwpTreeGridLoadingOverlay"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0JA,MAAMA,KAAc,gBAAAC,EAAA,CAAK;AAAA,EACvB,IAAAC,IAAK;AAAA,EACL,gBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,OAAAC,IAAQ;AAAA,EACR,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,MAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,wBAAAC,KAAyB;AAAA,EACzB,uBAAAC,KAAwB;AAAA,EACxB,SAAAC;AAAA,EACA,aAAAC,IAAc;AAChB,MAA2B;;AACzB,QAAM,EAAE,GAAAC,EAAA,IAAMC,GAAA,GACRC,IAAkBC,GAAA,GAClBC,KAAyBC,MAAAC,KAAAJ,KAAA,gBAAA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AA,MACC,KAAKvF;AAAA,MACL,WAAW,CAACwF,IAA+B1H,EAAkB,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,MACvF,OAAOuH;AAAA,MAEP,UAAA;AAAA,QAAA,gBAAAI,EAACC,IAAA,EAAa,QAAQC,GAAA,CAAqB;AAAA,QAC3C,gBAAAF,EAAC,OAAA,EAAI,IAAA7H,GAAQ,WAAAG,IAAsB,OAAO6H,GAAK5H,IAAO,CAAC,UAAU,OAAO,CAAC,EAAA,CAAG;AAAA,QAC5E,gBAAAyH;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,SAAShD;AAAA,YACT,SAAStD,EAAE,uBAAuB;AAAA,YAClC,cAAA2D;AAAA,UAAA;AAAA,QAAA;AAAA,QAEF,gBAAAuC,EAACK,IAAA,EAA0B,SAASlD,GAAyB,cAAAM,GAAA,CAA4B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG/F,GA9ZoB;"}
|
|
1
|
+
{"version":3,"file":"OwpTreeGrid.js","sources":["../../../src/components/OwpTreeGrid/OwpTreeGrid.tsx"],"sourcesContent":["import { resolveOwpGridTheme } from '@/constants/gridTheme';\nimport {\n resolveTreeGridColorNumber,\n TREEGRID_CELL_HIGHLIGHT_COLOR,\n TREEGRID_INPUT_CELL_COLOR,\n} from '@/constants/treeGrid';\nimport { useGetCurrentSettings } from '@/hooks/useOwpSettings';\nimport { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport { useGetCurrentLanguage } from '@/hooks/useCurrentLanguage';\nimport {\n TREE_GRID_BODY_ROWS_CHANGED_EVENT,\n type TreeGridBodyRowsChangedEventDetail,\n} from '@/utils/treeGridBodyRowsEvent';\nimport { delay, isEmpty, isEqual, omit } from 'es-toolkit/compat';\n// Temporary TreeGrid perf instrumentation import. Remove with ./internal/utils/perf after profiling is finished.\nimport {\n countTreeGridPerf,\n getTreeGridPerfTimestamp,\n logTreeGridPerf,\n measureTreeGridPerf,\n} from './internal/utils/perf';\nimport {\n type CSSProperties,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport GlobalStyles from '@mui/material/GlobalStyles';\nimport { useOwpTreeGridOverlayFrame } from './internal/hooks/useOwpTreeGridOverlayFrame';\nimport {\n bindTreeGridEvents,\n buildTreeGridInitializationOptions,\n getTreeGridBodyDataCount,\n hasTreeGridDisplayDataRows,\n replaceTreeGridBodyData,\n TREE_GRID_BINDING_LOADING_MIN_VISIBLE_MS,\n type TreeGridEventHandlers,\n} from './internal/treeGridRuntime';\nimport { applyTreeGridLayoutToGrid } from './internal/treeGridLayout';\nimport { OwpTreeGridLoadingOverlay } from './internal/OwpTreeGridLoadingOverlay';\nimport { OwpTreeGridNoDataOverlay } from './internal/OwpTreeGridNoDataOverlay';\nimport {\n createTreeGridColumnEditRulesState,\n resolveTreeGridColumnEditRuleLookup,\n syncTreeGridColumnEditRules,\n} from './internal/treeGridColumnEditRules';\nimport {\n createTreeGridThemeContainerStyle,\n TREE_GRID_THEME_WRAPPER_CLASS,\n treeGridThemeStyles,\n type TreeGridThemeContainerStyle,\n} from './internal/treeGridTheme';\n\ntype TreeGridLayoutScalarValue = string | number;\ntype TreeGridNestedLayoutFields = Record<string, TreeGridLayoutScalarValue>;\ntype TreeGridLayoutFields = Record<string, TreeGridLayoutScalarValue | TreeGridNestedLayoutFields>;\ntype TreeGridSectionFields = Record<string, TreeGridLayoutScalarValue>;\n\nexport interface OwpTreeGridLayout {\n Header?: TreeGridLayoutFields;\n Toolbar?: TreeGridSectionFields;\n Foot?: TreeGridSectionFields;\n}\n\nexport type OwpTreeGridLayoutConfig = OwpTreeGridLayout;\nexport type THeader = OwpTreeGridLayoutConfig;\nexport type OwpTreeGridBodyData<T> = Record<string, never> | [] | undefined | T[];\nexport type OwpTreeGridData<T> = OwpTreeGridBodyData<T>;\nexport type TData<T> = OwpTreeGridBodyData<T>;\nexport type OwpTreeGridRowModel<T> = TRow & T;\nexport type OwpTreeGridSelectedRows<T> = OwpTreeGridRowModel<T>[];\nexport type OwpTreeGridColumnEditPreset = 'hourMinute';\n\nexport interface OwpTreeGridColumnEditRule {\n columns: readonly string[];\n preset: OwpTreeGridColumnEditPreset;\n}\n\ntype OwpTreeGridSelectHandler<T> = (selectedRows: OwpTreeGridSelectedRows<T>) => void;\ntype OwpTreeGridRowAddHandler<T> = (grid: TGrid, row: OwpTreeGridRowModel<T>) => void;\ntype OwpTreeGridRowDeleteHandler<T> = (\n grid: TGrid,\n row: OwpTreeGridRowModel<T>,\n deleteType: number,\n) => void;\ntype OwpTreeGridRowUndeleteHandler<T> = (grid: TGrid, row: OwpTreeGridRowModel<T>) => void;\ntype OwpTreeGridButtonClickHandler<T> = (\n grid: TGrid,\n row: OwpTreeGridRowModel<T>,\n col: string,\n event: Event,\n) => void;\ntype OwpTreeGridRowClickHandler<T> = (\n grid: TGrid,\n row: OwpTreeGridRowModel<T>,\n col: string,\n x: number,\n y: number,\n event: Event,\n) => void;\ntype OwpTreeGridSaveHandler<T> = (\n grid: TGrid,\n row: OwpTreeGridRowModel<T>,\n autoupdate: boolean | number,\n) => void;\ntype OwpTreeGridCellValue = unknown;\ntype OwpTreeGridAfterValueChangedHandler<T> = (\n grid: TGrid,\n row: OwpTreeGridRowModel<T>,\n col: string,\n value: OwpTreeGridCellValue,\n) => void;\n\nexport interface OwpTreeGridProps<T> {\n id: string;\n className?: string;\n containerStyle?: CSSProperties;\n containerClassName?: string;\n layoutUrl?: string;\n layoutData?: string;\n dataUrl?: string;\n layoutOverrides?: OwpTreeGridLayoutConfig;\n data?: OwpTreeGridBodyData<T>;\n style?: CSSProperties;\n height?: string | number;\n width?: string | number;\n useDataUrl?: boolean;\n onSelect?: OwpTreeGridSelectHandler<T>;\n onRowAdd?: OwpTreeGridRowAddHandler<T>;\n onRowDelete?: OwpTreeGridRowDeleteHandler<T>;\n onRowUndelete?: OwpTreeGridRowUndeleteHandler<T>;\n onRowChange?: OwpTreeGridAfterValueChangedHandler<T>;\n onClickButton?: OwpTreeGridButtonClickHandler<T>;\n onReady?: (grid: TGrid) => void;\n onRowClick?: OwpTreeGridRowClickHandler<T>;\n onSave?: OwpTreeGridSaveHandler<T>;\n onAfterValueChanged?: OwpTreeGridAfterValueChangedHandler<T>;\n columnEditRules?: readonly OwpTreeGridColumnEditRule[];\n highlightEditableCells?: boolean;\n highlightChangedCells?: boolean;\n loading?: boolean;\n showLoading?: boolean;\n}\n\n/**\n * OwpTreeGrid 컴포넌트\n * @param id 식별자\n * @param containerStyle containerStyle 값\n * @param containerClassName containerClassName 값\n * @param className CSS 클래스명\n * @param style 스타일 객체\n * @param height height 값\n */\nconst OwpTreeGrid = <T,>({\n id = 'treeGridWrapper',\n containerStyle,\n containerClassName,\n className,\n style,\n height = '100%',\n width = '100%',\n layoutUrl,\n layoutData,\n dataUrl,\n layoutOverrides,\n data,\n useDataUrl,\n onSelect,\n onRowClick,\n onRowAdd,\n onRowDelete,\n onRowUndelete,\n onRowChange,\n onClickButton,\n onSave,\n onReady,\n onAfterValueChanged,\n columnEditRules,\n highlightEditableCells = true,\n highlightChangedCells = true,\n loading,\n showLoading = true,\n}: OwpTreeGridProps<T>) => {\n const { t } = useOwpTranslation();\n const currentSettings = useGetCurrentSettings();\n const currentGridThemeConfig = currentSettings?.theme?.main?.grid;\n const treeGridInstanceRef = useRef<TGrid>(null);\n const treeGridContainerRef = useRef<HTMLDivElement | null>(null);\n const treeGridInitStartedAtRef = useRef<number | null>(null);\n const bodyReloadStartedAtRef = useRef<number | null>(null);\n const latestLayoutOverridesRef = useRef<OwpTreeGridLayoutConfig | undefined>(layoutOverrides);\n const latestBodyDataPropRef = useRef<OwpTreeGridBodyData<T>>(data);\n const latestColumnEditRulesRef = useRef<readonly OwpTreeGridColumnEditRule[] | undefined>(\n columnEditRules,\n );\n const latestColumnEditRuleLookupRef = useRef(\n resolveTreeGridColumnEditRuleLookup(columnEditRules, {\n hourMinuteInvalidText: t('Message.시간은 HH:mm 형식으로 입력해주세요.'),\n }),\n );\n const latestEventHandlersRef = useRef<TreeGridEventHandlers<T>>({\n onSelect,\n onRowClick,\n onRowAdd,\n onRowDelete,\n onRowUndelete,\n onRowChange,\n onClickButton,\n onSave,\n onReady,\n onAfterValueChanged,\n });\n const stagedBodyDataPropRef = useRef<OwpTreeGridBodyData<T>>(undefined);\n const hasStagedBodyDataPropRef = useRef(false);\n const appliedLayoutOverridesRef = useRef<OwpTreeGridLayoutConfig | undefined>(undefined);\n const appliedBodyDataPropRef = useRef<OwpTreeGridBodyData<T>>(undefined);\n const appliedColumnEditRulesRef = useRef<readonly OwpTreeGridColumnEditRule[] | undefined>(\n undefined,\n );\n const columnEditRulesStateRef = useRef(createTreeGridColumnEditRulesState());\n const hasAppliedInitialLayoutRef = useRef(false);\n const bodyReloadSequenceRef = useRef(0);\n const bindingLoadingStartedAtRef = useRef<number | null>(null);\n const bindingLoadingHideTimeoutRef = useRef<number | undefined>(undefined);\n const bodyReloadStartTimeoutRef = useRef<number | undefined>(undefined);\n const highlightEditableCellsRef = useRef(highlightEditableCells);\n const highlightChangedCellsRef = useRef(highlightChangedCells);\n const [isTreeGridReady, setIsTreeGridReady] = useState(false);\n const [isBindingLoadingVisible, setIsBindingLoadingVisible] = useState(false);\n const [hasDisplayDataRows, setHasDisplayDataRows] = useState(false);\n const currentLanguage = useGetCurrentLanguage();\n const treeGridTheme = useMemo(\n () => resolveOwpGridTheme(currentGridThemeConfig),\n [currentGridThemeConfig],\n );\n const editableCellBackgroundColorValueRef = useRef(\n resolveTreeGridColorNumber(treeGridTheme.editable.backgroundColor) ??\n resolveTreeGridColorNumber(TREEGRID_INPUT_CELL_COLOR),\n );\n const changedCellBackgroundColorRef = useRef(\n treeGridTheme.changed.backgroundColor ?? TREEGRID_CELL_HIGHLIGHT_COLOR,\n );\n const selectedCellBackgroundColorRef = useRef(treeGridTheme.state.selectedCellBackgroundColor);\n const hoverCellBackgroundColorRef = useRef(treeGridTheme.state.hoverCellBackgroundColor);\n const currentLanguageIdRef = useRef(currentLanguage.id);\n const isPendingBodyReload =\n showLoading &&\n data !== undefined &&\n isTreeGridReady &&\n appliedBodyDataPropRef.current !== data;\n const isInternalLoadingVisible = showLoading && (isBindingLoadingVisible || isPendingBodyReload);\n const isLoadingOverlayVisible = (showLoading && loading === true) || isInternalLoadingVisible;\n const isNoDataVisible =\n !isLoadingOverlayVisible && data !== undefined && isEmpty(data) && !hasDisplayDataRows;\n\n const syncHasDisplayDataRows = (grid: TGrid | null) => {\n setHasDisplayDataRows(hasTreeGridDisplayDataRows(grid));\n };\n\n latestLayoutOverridesRef.current = layoutOverrides;\n latestBodyDataPropRef.current = data;\n latestColumnEditRulesRef.current = columnEditRules;\n latestColumnEditRuleLookupRef.current = resolveTreeGridColumnEditRuleLookup(columnEditRules, {\n hourMinuteInvalidText: t('Message.시간은 HH:mm 형식으로 입력해주세요.'),\n });\n highlightEditableCellsRef.current = highlightEditableCells;\n highlightChangedCellsRef.current = highlightChangedCells;\n editableCellBackgroundColorValueRef.current =\n resolveTreeGridColorNumber(treeGridTheme.editable.backgroundColor) ??\n resolveTreeGridColorNumber(TREEGRID_INPUT_CELL_COLOR);\n changedCellBackgroundColorRef.current =\n treeGridTheme.changed.backgroundColor ?? TREEGRID_CELL_HIGHLIGHT_COLOR;\n selectedCellBackgroundColorRef.current = treeGridTheme.state.selectedCellBackgroundColor;\n hoverCellBackgroundColorRef.current = treeGridTheme.state.hoverCellBackgroundColor;\n latestEventHandlersRef.current = {\n onSelect,\n onRowClick,\n onRowAdd,\n onRowDelete,\n onRowUndelete,\n onRowChange,\n onClickButton,\n onSave,\n onReady,\n onAfterValueChanged,\n };\n\n const overlayFrame = useOwpTreeGridOverlayFrame({\n visible: isLoadingOverlayVisible || isNoDataVisible,\n containerRef: treeGridContainerRef,\n treeGridInstanceRef,\n debugId: id,\n });\n\n const clearBindingLoadingHideTimeout = () => {\n if (bindingLoadingHideTimeoutRef.current !== undefined) {\n window.clearTimeout(bindingLoadingHideTimeoutRef.current);\n bindingLoadingHideTimeoutRef.current = undefined;\n }\n };\n\n const clearBodyReloadStartTimeout = () => {\n if (bodyReloadStartTimeoutRef.current !== undefined) {\n window.clearTimeout(bodyReloadStartTimeoutRef.current);\n bodyReloadStartTimeoutRef.current = undefined;\n }\n };\n\n useEffect(() => {\n const handleBodyRowsChanged = (event: Event) => {\n const customEvent = event as CustomEvent<TreeGridBodyRowsChangedEventDetail>;\n\n if (customEvent.detail?.gridId !== id) {\n return;\n }\n\n setHasDisplayDataRows(hasTreeGridDisplayDataRows(treeGridInstanceRef.current));\n };\n\n window.addEventListener(TREE_GRID_BODY_ROWS_CHANGED_EVENT, handleBodyRowsChanged);\n\n return () => {\n window.removeEventListener(TREE_GRID_BODY_ROWS_CHANGED_EVENT, handleBodyRowsChanged);\n };\n }, [id]);\n\n useEffect(() => {\n if (!showLoading) {\n clearBodyReloadStartTimeout();\n clearBindingLoadingHideTimeout();\n bindingLoadingStartedAtRef.current = null;\n setIsBindingLoadingVisible(false);\n }\n }, [showLoading]);\n\n useEffect(() => {\n if (\n currentLanguage.id !== currentLanguageIdRef.current &&\n !isEmpty(treeGridInstanceRef.current)\n ) {\n treeGridInstanceRef.current?.Dispose();\n treeGridInstanceRef.current = null;\n currentLanguageIdRef.current = currentLanguage.id;\n }\n\n if (!isEmpty(treeGridInstanceRef.current)) {\n return;\n }\n\n bindTreeGridEvents({\n id,\n latestEventHandlersRef,\n highlightEditableCellsRef,\n highlightChangedCellsRef,\n editableCellBackgroundColorValueRef,\n changedCellBackgroundColorRef,\n selectedCellBackgroundColorRef,\n hoverCellBackgroundColorRef,\n treeGridInstanceRef,\n treeGridInitStartedAtRef,\n latestLayoutOverridesRef,\n appliedLayoutOverridesRef,\n appliedBodyDataPropRef,\n latestColumnEditRulesRef,\n latestColumnEditRuleLookupRef,\n appliedColumnEditRulesRef,\n columnEditRulesStateRef,\n hasAppliedInitialLayoutRef,\n syncHasDisplayDataRows,\n setIsTreeGridReady,\n });\n\n treeGridInitStartedAtRef.current = getTreeGridPerfTimestamp();\n countTreeGridPerf(id, 'init');\n logTreeGridPerf(id, 'TreeGrid init start', {\n useDataUrl: Boolean(useDataUrl),\n bodyRowCount: getTreeGridBodyDataCount(data),\n });\n\n window.TreeGrid(\n buildTreeGridInitializationOptions({\n id,\n layoutUrl,\n layoutData,\n dataUrl,\n bodyData: data,\n useDataUrl,\n width,\n height,\n languageId: currentLanguage.id,\n }),\n id,\n id,\n );\n\n return () => {\n delay(() => {\n treeGridInstanceRef.current?.Dispose();\n }, 200);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useLayoutEffect(() => {\n const treeGrid = treeGridInstanceRef.current;\n const nextLayoutOverrides = latestLayoutOverridesRef.current;\n const nextBodyData = latestBodyDataPropRef.current;\n const nextColumnEditRules = latestColumnEditRulesRef.current;\n\n if (isEmpty(treeGrid) || !isTreeGridReady) {\n return;\n }\n\n const shouldApplyLayoutOverrides =\n appliedLayoutOverridesRef.current !== nextLayoutOverrides &&\n !isEqual(appliedLayoutOverridesRef.current, nextLayoutOverrides);\n const shouldApplyBodyData =\n appliedBodyDataPropRef.current !== nextBodyData &&\n (!hasStagedBodyDataPropRef.current || stagedBodyDataPropRef.current !== nextBodyData);\n const shouldApplyColumnEditRules =\n appliedColumnEditRulesRef.current !== nextColumnEditRules &&\n !isEqual(appliedColumnEditRulesRef.current, nextColumnEditRules);\n\n if (!shouldApplyLayoutOverrides && !shouldApplyBodyData && !shouldApplyColumnEditRules) {\n return;\n }\n\n if (shouldApplyLayoutOverrides) {\n const layoutApplyStartedAt = getTreeGridPerfTimestamp();\n\n applyTreeGridLayoutToGrid(treeGrid, nextLayoutOverrides, shouldApplyBodyData);\n appliedLayoutOverridesRef.current = nextLayoutOverrides;\n measureTreeGridPerf(id, 'apply layout', layoutApplyStartedAt, {\n disableBodyReload: Boolean(shouldApplyBodyData),\n });\n }\n\n if (shouldApplyBodyData) {\n const reloadSequence = bodyReloadSequenceRef.current + 1;\n const runBodyReload = () => {\n const bodyDataToApply = stagedBodyDataPropRef.current;\n\n bodyReloadStartTimeoutRef.current = undefined;\n bodyReloadStartedAtRef.current = getTreeGridPerfTimestamp();\n countTreeGridPerf(id, 'reload');\n logTreeGridPerf(id, 'ReloadBody start', {\n bodyRowCount: getTreeGridBodyDataCount(bodyDataToApply),\n });\n\n replaceTreeGridBodyData(treeGrid, bodyDataToApply, () => {\n if (bodyReloadSequenceRef.current !== reloadSequence) {\n return;\n }\n\n appliedBodyDataPropRef.current = bodyDataToApply;\n syncHasDisplayDataRows(treeGrid);\n measureTreeGridPerf(id, 'ReloadBody end', bodyReloadStartedAtRef.current, {\n bodyRowCount: getTreeGridBodyDataCount(bodyDataToApply),\n });\n bodyReloadStartedAtRef.current = null;\n\n if (stagedBodyDataPropRef.current === bodyDataToApply) {\n stagedBodyDataPropRef.current = undefined;\n hasStagedBodyDataPropRef.current = false;\n }\n\n const startedAt = bindingLoadingStartedAtRef.current;\n\n if (!showLoading || startedAt === null) {\n bindingLoadingStartedAtRef.current = null;\n setIsBindingLoadingVisible(false);\n return;\n }\n\n const remainingVisibleTime = Math.max(\n 0,\n TREE_GRID_BINDING_LOADING_MIN_VISIBLE_MS - (Date.now() - startedAt),\n );\n\n clearBindingLoadingHideTimeout();\n\n if (remainingVisibleTime === 0) {\n bindingLoadingStartedAtRef.current = null;\n setIsBindingLoadingVisible(false);\n return;\n }\n\n bindingLoadingHideTimeoutRef.current = window.setTimeout(() => {\n if (bodyReloadSequenceRef.current !== reloadSequence) {\n return;\n }\n\n bindingLoadingHideTimeoutRef.current = undefined;\n bindingLoadingStartedAtRef.current = null;\n setIsBindingLoadingVisible(false);\n }, remainingVisibleTime);\n });\n };\n\n bodyReloadSequenceRef.current = reloadSequence;\n stagedBodyDataPropRef.current = nextBodyData;\n hasStagedBodyDataPropRef.current = true;\n\n if (showLoading && nextBodyData !== undefined) {\n clearBodyReloadStartTimeout();\n clearBindingLoadingHideTimeout();\n bindingLoadingStartedAtRef.current = Date.now();\n setIsBindingLoadingVisible(true);\n bodyReloadStartTimeoutRef.current = window.setTimeout(() => {\n if (bodyReloadSequenceRef.current !== reloadSequence) {\n return;\n }\n\n runBodyReload();\n }, 0);\n } else {\n runBodyReload();\n }\n }\n\n if (shouldApplyColumnEditRules) {\n syncTreeGridColumnEditRules(\n treeGrid,\n latestColumnEditRuleLookupRef.current,\n columnEditRulesStateRef.current,\n );\n appliedColumnEditRulesRef.current = nextColumnEditRules;\n }\n }, [isTreeGridReady, layoutOverrides, data, columnEditRules, showLoading, id]);\n\n useEffect(() => {\n return () => {\n clearBodyReloadStartTimeout();\n clearBindingLoadingHideTimeout();\n };\n }, []);\n\n const resolvedContainerStyle: TreeGridThemeContainerStyle = createTreeGridThemeContainerStyle({\n width,\n height,\n treeGridTheme,\n gridThemeConfig: currentGridThemeConfig,\n containerStyle,\n });\n\n if (showLoading || isNoDataVisible) {\n resolvedContainerStyle.position =\n containerStyle?.position && containerStyle.position !== 'static'\n ? containerStyle.position\n : 'relative';\n resolvedContainerStyle.isolation = 'isolate';\n }\n\n return (\n <div\n ref={treeGridContainerRef}\n className={[TREE_GRID_THEME_WRAPPER_CLASS, containerClassName].filter(Boolean).join(' ')}\n style={resolvedContainerStyle}\n >\n <GlobalStyles styles={treeGridThemeStyles} />\n <div id={id} className={className} style={omit(style, ['height', 'width'])} />\n <OwpTreeGridNoDataOverlay\n visible={isNoDataVisible}\n message={t('Message.조회된 결과가 없습니다.')}\n overlayFrame={overlayFrame}\n />\n <OwpTreeGridLoadingOverlay visible={isLoadingOverlayVisible} overlayFrame={overlayFrame} />\n </div>\n );\n};\n\nexport { OwpTreeGrid };\n"],"names":["OwpTreeGrid","__name","id","containerStyle","containerClassName","className","style","height","width","layoutUrl","layoutData","dataUrl","layoutOverrides","data","useDataUrl","onSelect","onRowClick","onRowAdd","onRowDelete","onRowUndelete","onRowChange","onClickButton","onSave","onReady","onAfterValueChanged","columnEditRules","highlightEditableCells","highlightChangedCells","loading","showLoading","t","useOwpTranslation","currentSettings","useGetCurrentSettings","currentGridThemeConfig","_b","_a","treeGridInstanceRef","useRef","treeGridContainerRef","treeGridInitStartedAtRef","bodyReloadStartedAtRef","latestLayoutOverridesRef","latestBodyDataPropRef","latestColumnEditRulesRef","latestColumnEditRuleLookupRef","resolveTreeGridColumnEditRuleLookup","latestEventHandlersRef","stagedBodyDataPropRef","hasStagedBodyDataPropRef","appliedLayoutOverridesRef","appliedBodyDataPropRef","appliedColumnEditRulesRef","columnEditRulesStateRef","createTreeGridColumnEditRulesState","hasAppliedInitialLayoutRef","bodyReloadSequenceRef","bindingLoadingStartedAtRef","bindingLoadingHideTimeoutRef","bodyReloadStartTimeoutRef","highlightEditableCellsRef","highlightChangedCellsRef","isTreeGridReady","setIsTreeGridReady","useState","isBindingLoadingVisible","setIsBindingLoadingVisible","hasDisplayDataRows","setHasDisplayDataRows","currentLanguage","useGetCurrentLanguage","treeGridTheme","useMemo","resolveOwpGridTheme","editableCellBackgroundColorValueRef","resolveTreeGridColorNumber","TREEGRID_INPUT_CELL_COLOR","changedCellBackgroundColorRef","TREEGRID_CELL_HIGHLIGHT_COLOR","selectedCellBackgroundColorRef","hoverCellBackgroundColorRef","currentLanguageIdRef","isPendingBodyReload","isLoadingOverlayVisible","isNoDataVisible","isEmpty","syncHasDisplayDataRows","grid","hasTreeGridDisplayDataRows","overlayFrame","useOwpTreeGridOverlayFrame","clearBindingLoadingHideTimeout","clearBodyReloadStartTimeout","useEffect","handleBodyRowsChanged","event","TREE_GRID_BODY_ROWS_CHANGED_EVENT","bindTreeGridEvents","getTreeGridPerfTimestamp","countTreeGridPerf","logTreeGridPerf","getTreeGridBodyDataCount","buildTreeGridInitializationOptions","delay","useLayoutEffect","treeGrid","nextLayoutOverrides","nextBodyData","nextColumnEditRules","shouldApplyLayoutOverrides","isEqual","shouldApplyBodyData","shouldApplyColumnEditRules","layoutApplyStartedAt","applyTreeGridLayoutToGrid","measureTreeGridPerf","reloadSequence","runBodyReload","bodyDataToApply","replaceTreeGridBodyData","startedAt","remainingVisibleTime","TREE_GRID_BINDING_LOADING_MIN_VISIBLE_MS","syncTreeGridColumnEditRules","resolvedContainerStyle","createTreeGridThemeContainerStyle","jsxs","TREE_GRID_THEME_WRAPPER_CLASS","jsx","GlobalStyles","treeGridThemeStyles","omit","OwpTreeGridNoDataOverlay","OwpTreeGridLoadingOverlay"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA2JA,MAAMA,KAAc,gBAAAC,EAAA,CAAK;AAAA,EACvB,IAAAC,IAAK;AAAA,EACL,gBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,OAAAC,IAAQ;AAAA,EACR,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,MAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,wBAAAC,KAAyB;AAAA,EACzB,uBAAAC,KAAwB;AAAA,EACxB,SAAAC;AAAA,EACA,aAAAC,IAAc;AAChB,MAA2B;;AACzB,QAAM,EAAE,GAAAC,EAAA,IAAMC,GAAA,GACRC,IAAkBC,GAAA,GAClBC,KAAyBC,MAAAC,KAAAJ,KAAA,gBAAAA,EAAiB,UAAjB,gBAAAI,GAAwB,SAAxB,gBAAAD,GAA8B,MACvDE,IAAsBC,EAAc,IAAI,GACxCC,KAAuBD,EAA8B,IAAI,GACzDE,KAA2BF,EAAsB,IAAI,GACrDG,IAAyBH,EAAsB,IAAI,GACnDI,IAA2BJ,EAA4C1B,CAAe,GACtF+B,KAAwBL,EAA+BzB,CAAI,GAC3D+B,IAA2BN;AAAA,IA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