このコミットが含まれているのは:
@@ -8,6 +8,7 @@ import { useUITranslation } from '@/lib/useUITranslation'
|
||||
|
||||
import type { ClipboardEvent, ReactNode } from 'react'
|
||||
|
||||
import type { CountsClipboardTable } from '@/lib/countsClipboard'
|
||||
import type { CountsMenuAction } from '@/components/counts/CountsCellMenu'
|
||||
|
||||
type Point = { row: number; column: number }
|
||||
@@ -20,13 +21,14 @@ const cellAt = (table: HTMLTableElement, point: Point) =>
|
||||
|
||||
|
||||
const CountsSelectableTable = (
|
||||
{ family, columns, identity, children, className, name }: {
|
||||
{ family, columns, identity, children, className, name, copyTable }: {
|
||||
family: string
|
||||
columns: string[]
|
||||
identity: string
|
||||
children: ReactNode
|
||||
className?: string
|
||||
name?: { text: string; language: string } },
|
||||
name?: { text: string; language: string }
|
||||
copyTable?: () => CountsClipboardTable },
|
||||
) => {
|
||||
const id = useId ()
|
||||
const root = useRef<HTMLTableElement> (null)
|
||||
@@ -103,6 +105,14 @@ const CountsSelectableTable = (
|
||||
}
|
||||
const clipboard = (headers = false) => {
|
||||
if (bounds == null || root.current == null) return null
|
||||
if (copyTable != null)
|
||||
{
|
||||
const table = copyTable ()
|
||||
return countsClipboard ({
|
||||
columns: table.columns.slice (bounds.left, bounds.right + 1),
|
||||
rows: table.rows.slice (bounds.top, bounds.bottom + 1)
|
||||
.map (row => row.slice (bounds.left, bounds.right + 1)) }, headers)
|
||||
}
|
||||
const rows: string[][] = []
|
||||
for (let row = bounds.top; row <= bounds.bottom; ++row)
|
||||
{
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする