feat: Refactor table components for improved layout and usability
- Updated the BOM management page to streamline the layout by moving the edit button to the top right for better accessibility. - Enhanced the DataGrid and EDataTable components to support a no-wrapper option, allowing for sticky headers to function correctly with parent overflow settings. - Adjusted the Sales Order page to utilize the new noWrapper feature for the table, ensuring consistent styling and behavior. - Enabled sticky headers in the V2 table list definition for improved data visibility during scrolling. These changes aim to enhance the user experience by providing a more intuitive and organized interface for managing BOM and sales order data across multiple companies.
This commit is contained in:
@@ -502,8 +502,8 @@ export function DataGrid({
|
||||
<div className="flex flex-col h-full flex-1 min-h-0">
|
||||
<div className="flex-1 min-h-0 overflow-auto">
|
||||
<DndContext sensors={sensors} collisionDetection={closestCenter} onDragEnd={handleDragEnd}>
|
||||
<Table>
|
||||
<TableHeader className="sticky top-0 bg-background z-10 shadow-sm">
|
||||
<Table noWrapper>
|
||||
<TableHeader className="sticky top-0 bg-background z-10 shadow-[0_1px_0_0_hsl(var(--border))]">
|
||||
<SortableContext items={columns.map((c) => c.key)} strategy={horizontalListSortingStrategy}>
|
||||
<TableRow>
|
||||
{showCheckbox && (
|
||||
|
||||
@@ -610,8 +610,8 @@ export function EDataTable<T extends Record<string, any> = any>({
|
||||
<div className={cn("flex flex-col h-full flex-1 min-h-0", className)}>
|
||||
<div className="flex-1 min-h-0 overflow-auto">
|
||||
<DndContext sensors={sensors} collisionDetection={closestCenter} onDragEnd={handleDragEnd}>
|
||||
<Table className="min-w-max">
|
||||
<TableHeader className="sticky top-0 z-10">
|
||||
<Table noWrapper className="min-w-max">
|
||||
<TableHeader className="sticky top-0 z-10 bg-muted shadow-[0_1px_0_0_hsl(var(--border))]">
|
||||
<SortableContext items={columns.map((c) => c.key)} strategy={horizontalListSortingStrategy}>
|
||||
<TableRow className="bg-muted hover:bg-muted h-10">
|
||||
{/* 체크박스 */}
|
||||
|
||||
@@ -10,15 +10,9 @@ interface TableProps extends React.ComponentProps<"table"> {
|
||||
}
|
||||
|
||||
function Table({ className, noWrapper, divClassName, ...props }: TableProps) {
|
||||
if (noWrapper) {
|
||||
return <table data-slot="table" className={cn("w-full caption-bottom text-sm", className)} {...props} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div data-slot="table-container" className={cn("relative w-full overflow-x-auto", divClassName)}>
|
||||
<table data-slot="table" className={cn("w-full caption-bottom text-sm", className)} {...props} />
|
||||
</div>
|
||||
);
|
||||
// noWrapper 여부 관계없이 wrapper를 제거하여 sticky header가 부모 overflow-auto 기준으로 동작하도록 함
|
||||
// 가로 스크롤은 부모의 overflow-auto에서 처리
|
||||
return <table data-slot="table" className={cn("w-full caption-bottom text-sm", className)} {...props} />;
|
||||
}
|
||||
|
||||
function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
|
||||
|
||||
Reference in New Issue
Block a user