quality / commitlint (push) Skipped
quality / changes (push) Successful in 9s
quality / docker-check (push) Skipped
quality / openapi (push) Successful in 39s
quality / web (push) Successful in 1m29s
quality / go (push) Successful in 1m3s
quality / bird2 (push) Successful in 15s
CD / quality (push) Successful in 3m43s
CD / publish (push) Failing after 8m29s
Единый kitDataGridTableLayout и ResourcePage/FrameDataGrid на всех списках. Календарь задач переведён на EventCalendar, lookup — на cascader, у операций появился вид доски. Удалены settings-7 и самописные DataGridSection/toolbar. Co-authored-by: Cursor <[email protected]>
54 lines
1.6 KiB
TypeScript
54 lines
1.6 KiB
TypeScript
"use client"
|
|
|
|
import type { ReactElement } from "react"
|
|
import { getColumnHeaderLabel } from "@/components/reui/data-grid/data-grid"
|
|
import type { DataGridFeatures } from "@/components/reui/data-grid/data-grid"
|
|
import type { Table } from "@tanstack/react-table"
|
|
|
|
import {
|
|
DropdownMenu,
|
|
DropdownMenuCheckboxItem,
|
|
DropdownMenuContent,
|
|
DropdownMenuGroup,
|
|
DropdownMenuLabel,
|
|
DropdownMenuTrigger,
|
|
} from "@evobgp/ui/components/dropdown-menu"
|
|
|
|
function DataGridColumnVisibility<TData extends object>({
|
|
table,
|
|
trigger,
|
|
}: {
|
|
table: Table<DataGridFeatures, TData>
|
|
trigger: ReactElement<Record<string, unknown>>
|
|
}) {
|
|
return (
|
|
<DropdownMenu>
|
|
<DropdownMenuTrigger render={trigger} />
|
|
<DropdownMenuContent align="end" className="min-w-[150px]">
|
|
<DropdownMenuGroup>
|
|
<DropdownMenuLabel className="font-medium">
|
|
Toggle Columns
|
|
</DropdownMenuLabel>
|
|
{table
|
|
.getAllColumns()
|
|
.filter((column) => column.getCanHide())
|
|
.map((column) => {
|
|
return (
|
|
<DropdownMenuCheckboxItem
|
|
key={column.id}
|
|
className="capitalize"
|
|
checked={column.getIsVisible()}
|
|
onSelect={(event) => event.preventDefault()}
|
|
onCheckedChange={(value) => column.toggleVisibility(!!value)}
|
|
>
|
|
{getColumnHeaderLabel(column)}
|
|
</DropdownMenuCheckboxItem>
|
|
)
|
|
})}
|
|
</DropdownMenuGroup>
|
|
</DropdownMenuContent>
|
|
</DropdownMenu>
|
|
)
|
|
}
|
|
|
|
export { DataGridColumnVisibility } |