@seanyeh77/ui 0.49.0 → 0.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +18 -18
- package/dist/components/CodeView/CodeView.js +6 -5
- package/dist/components/CodeView/CodeView.js.map +1 -1
- package/dist/components/ConsoleLayout/ConsoleLayout.d.ts +11 -5
- package/dist/components/ConsoleLayout/ConsoleLayout.js +73 -10
- package/dist/components/ConsoleLayout/ConsoleLayout.js.map +1 -1
- package/dist/components/DataTable/DataTable.js +2 -2
- package/dist/components/DataTable/DataTable.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.js +2 -2
- package/dist/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/components/FloorPlan/FloorPlan.js +27 -19
- package/dist/components/FloorPlan/FloorPlan.js.map +1 -1
- package/dist/components/Markdown/Markdown.js +3 -3
- package/dist/components/Markdown/Markdown.js.map +1 -1
- package/dist/components/SideNav/SideNav.js +2 -2
- package/dist/components/SideNav/SideNav.js.map +1 -1
- package/dist/components/SplitPane/SplitPane.js +2 -2
- package/dist/components/SplitPane/SplitPane.js.map +1 -1
- package/dist/css/ConsoleLayout.css +43 -5
- package/dist/css/FloorPlan.css +3 -0
- package/dist/css/KpiCard.css +5 -4
- package/dist/internal/chart.js +2 -2
- package/dist/internal/chart.js.map +1 -1
- package/dist/internal/util.js +8 -1
- package/dist/internal/util.js.map +1 -1
- package/dist/styles.css +51 -9
- package/docs/ConsoleLayout.md +23 -7
- package/docs/agents.md +5 -5
- package/docs/monitoring.md +2 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.js","names":["phCaretRight","phCheck","phX"],"sources":["../../../src/components/DataTable/DataTable.tsx"],"sourcesContent":["import * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { Button } from '../Button/Button';\nimport { SearchField } from '../SearchField/SearchField';\nimport { Tabs } from '../Tabs/Tabs';\nimport { format } from '../../format';\nimport { tr, unitFor, type CountUnit } from '../../i18n';\nimport { Icon, type CustomIcon } from '../../icons/Icon';\nimport { TOUCH_ONLY, copyText, cx, idPart, monoNums, reduced, resizeObserver, seenOnly, useMedia, useNarrow } from '../../internal/util';\nimport { Tooltip } from '../Tooltip/Tooltip';\nimport { Skeleton } from '../Skeleton/Skeleton';\nimport { RelativeTime } from '../RelativeTime/RelativeTime';\nimport { DEV, devWarn } from '../../internal/dev';\nimport { useStored } from '../../internal/stored';\nimport { CheckMark } from '../../internal/Field';\nimport { announce } from '../../announce';\nimport { ScrollHint, useScrollHint } from '../../internal/scrollHint';\nimport { ColResize, MIN_COL, TableDialog, markdownTable } from '../../internal/tableTools';\nimport { asDate, cellText, isActive, isDateCol, matches, readSort, readUrl, resolveFilters, searchHit, writeSort, writeUrl, type SortLevel } from './filters';\nimport { FilterButton, FilterChips, FullText, LongText, MoreMenu, markMatch, type FilterChip } from './parts';\nimport { SortButton, dirWord, sortSentence } from './SortButton';\nimport type { DataTableColumn, DataTableFilter, DataTableView, FilterOption, FilterValue, ResolvedFilter, Row, RowKey, Total } from './types';\nimport { includeIcons } from '../../icons/store';\nimport phCaretRight from '../../icons/ph/caret-right';\nimport phCheck from '../../icons/ph/check';\nimport phX from '../../icons/ph/x';\n\nincludeIcons(phCaretRight, phCheck, phX);\n\n// The checkbox column (px): the 22 px box with 9 px on each side.\nconst SEL = 40;\n\nexport type { DataTableColumn, DataTableFilter, DataTableView, FilterOption, FilterValue, RangeValue, Row, RowKey, Total } from './types';\n\nexport interface DataTableProps<R extends Row = Record<string, unknown>> {\n /** The columns, in order; key names a field of the row (checked by TypeScript). */\n columns: DataTableColumn<R>[];\n /** Give each row an `id` so selection and animations follow the row, not its position. */\n rows: R[];\n /** Title above the table, also its accessible name. */\n caption?: string;\n /** Segmented summary above the table: 「全部」 plus one tab per status with its count; picking one filters the rows.\n * `unit` follows every count; default 「筆」. A function gets the count, for plurals in other languages. */\n summary?: { key: RowKey<R>; items: { value: string; label: string }[]; label?: string; unit?: CountUnit };\n /** aria-label when there is no caption. */\n label?: string;\n /** What one row is, after every count (the summary, 「24 筆」, the pages, 「已選 2 筆」): 「個」, 「件」. A function gets\n * the count, for plurals in other languages. Default summary.unit, else 「筆」. */\n unit?: CountUnit;\n /** Data is still loading: the toolbar and header stay, and loadingRows skeleton rows of the columns' shape take the\n * rows' place. Default false. */\n loading?: boolean;\n /** How many skeleton rows loading shows. Default pageSize, at most 10. */\n loadingRows?: number;\n /** Rows per page. Default 10. */\n pageSize?: number;\n /** Change it when the rows become a different data set: search, filters, sort, page, selection and summary reset. */\n resetKey?: string | number;\n /** The page's primary action, one primary Button (「新增」): at the right end of the toolbar, on one row with the\n * summary tabs and the search field when they fit. Use it instead of a Card head that holds only this button. */\n action?: React.ReactNode;\n /** Checkboxes appear when a row is hovered, and on every row once any row is selected; the header's is always shown. */\n selectable?: boolean;\n /** Buttons for the bar that replaces the header while rows are selected. */\n bulkActions?: (ids: string[], clear: () => void) => React.ReactNode;\n /** IconButtons over the row's right end, shown while the row is hovered or has keyboard focus (always on touch\n * screens and phone cards). They take no column of their own. */\n rowActions?: (row: R) => React.ReactNode;\n /** px kept free at the end of each row's last cell for the row actions, so they never cover its content. Default:\n * the width the actions take, measured. */\n actionsWidth?: number;\n /** false: no toolbar row at all (no search, 「篩選」, 「排序」, 「⋯」 or count), for a small table of a few rows that\n * needs none of them. Headings still sort on click. Default true. */\n toolbar?: boolean;\n /** Search box (default on; false hides it). Searches every column unless keys is given. */\n search?: false | { placeholder?: string; keys?: RowKey<R>[] };\n /** Filters in the 「篩選」 popover. */\n filters?: DataTableFilter<R>[];\n /** @deprecated use filters. */\n filter?: { key: RowKey<R>; label?: string; options: FilterOption[] };\n /** 「/」 focuses this table's search field when focus is not in a text field (no Ctrl, Alt or ⌘). Only the first\n * table on the page with a search field takes it; it shows a small 「/」 in the empty field on desktop. Default true. */\n searchShortcut?: boolean;\n /** Each row's page: the first cell's text becomes a link to it, and a click anywhere else on the row (not on its own\n * links, buttons or checkbox, nor a click that ends a text selection) opens it. Like a link, Ctrl, ⌘ or Shift + click\n * and a middle click open it in a new tab. */\n rowHref?: (row: R) => string;\n /** With rowHref: called instead of following the link on a plain click (on the row or its first cell's link), so an\n * app router can push the route. Ctrl, ⌘, Shift and middle clicks still open the href in a new tab. */\n onRowOpen?: (row: R, event: React.MouseEvent) => void;\n /** Write search and filters into the URL. Default true. */\n urlSync?: boolean;\n /** Prefix of the URL parameters when a page has several tables. */\n urlKey?: string;\n /** The sort before anyone changes it, first level first, e.g. [{ key: 'prog' }, { key: 'dt', dir: 'desc' }]. A level\n * without dir starts like a click on its heading: numbers from the largest, text from A. Default: the rows' order. */\n defaultSort?: readonly { key: RowKey<R>; dir?: 'asc' | 'desc' }[];\n /** How many columns can sort at once (the 「排序」 panel, Shift + click on a heading). Default: no limit, every sortable\n * column. */\n maxSort?: number;\n /** Saved views shown as tabs above the table. */\n views?: DataTableView<R>[];\n /** Totals row: 'sum', 'avg' or a function per column key. */\n totals?: Partial<Record<string, Total<R>>>;\n /** Keep the first column visible while scrolling sideways. */\n stickyFirst?: boolean;\n /** 「欄位」 in the 「⋯」 menu, to hide columns. Default true. */\n columnMenu?: boolean;\n /** Remembers the column widths readers drag (the borders in the header) and the columns they hide or show, in\n * localStorage under this name (ui-dt-width:<storageKey>, ui-dt-cols:<storageKey>). Without it they go back to the\n * defaults when the page reloads. resetKey does not clear them: they are the reader's own; 「欄位」 → 「還原預設」 does. */\n storageKey?: string;\n /** @deprecated Renamed `storageKey`, like every other component that remembers a choice; the stored values carry over. */\n widthKey?: string;\n /** 「放大表格」 in the 「⋯」 menu: the whole table, with its search, filters, sort and pages, in a dialog up to\n * 1200 px wide. A click on a link inside closes the dialog. Not on phones. Default true. */\n zoom?: boolean;\n /** 「複製成 Markdown」 in the 「⋯」 menu: every row the search and filters keep (all pages), in the shown columns and\n * order; each cell is the column's fullText, else its searchText, else its value. Default true. */\n copy?: boolean;\n /** Your own text for 「複製成 Markdown」, from the same rows (all pages, sorted). */\n copyText?: (rows: R[]) => string;\n /** Copying failed (the browser does not allow the clipboard): say so, for example in a Toast. */\n onCopyError?: () => void;\n /** Default 「沒有符合的資料」. */\n emptyText?: string;\n /** Extra class on the root element. */\n className?: string;\n}\n\nconst MOVE = { dur: 320, stagger: 25, ease: 'cubic-bezier(.2,.8,.2,1)' };\nconst ARROWS: Record<'asc' | 'desc' | 'none', CustomIcon> = { asc: 'M12 19V5M6 11l6-6 6 6', desc: 'M12 5v14M6 13l6 6 6-6', none: 'M8 9l4-4 4 4M8 15l4 4 4-4' };\n\nconst get = (row: Row, key: string): unknown => (row as Record<string, unknown>)[key];\n// Stored column choices and widths (storageKey): an object, else the default.\nconst NO_TOGGLED: Record<string, boolean> = {};\nconst parseObject = (raw: string) => {\n const v: unknown = JSON.parse(raw);\n if (!v || typeof v !== 'object') throw new Error('not an object');\n return v;\n};\nconst parseToggled = (raw: string) => parseObject(raw) as Record<string, boolean>;\nconst parseWidths = (raw: string) => parseObject(raw) as Record<string, number>;\nconst isNum = (c: DataTableColumn<never>) => c.numeric || c.format === 'money' || c.format === 'percent' || c.format === 'duration';\n// Short by what it holds: numbers, units, dates, durations and status. It hugs its content instead of taking the room\n// left (see widths below). A width is only a least width: it never makes a column short.\nconst isShort = (c: DataTableColumn<never>) => isNum(c) || !!c.unit || isDateCol(c) || c.mobile === 'status';\n// A plain text column that is not the main one hugs its content up to this width (px); longer text wraps.\nconst TEXT_HUG_MAX = 280;\n// Columns sized by props only, before the first measure (px).\nconst HUG_START = 96;\n// A plain text column that hugs its content is at least this wide (px, 8 em), so a short name does not look cramped.\nconst TEXT_HUG_MIN = 128;\n// What the main column and long columns ask for before the room left is shared (px): their content on one line, up\n// to these. They get it only while every column fits; otherwise they share what is left and long text is cut.\nconst MAIN_WANT_MAX = 320;\nconst LONG_WANT_MAX = 512;\n// The summary tabs, the search field (at least this wide, px) and the buttons share one row when all fit.\nconst SEARCH_MIN = 240;\nconst TOOL_GAP = 8;\n// <time dateTime>: a date alone for 'date', the moment for the others.\nconst isoOf = (d: Date, dateOnly: boolean) =>\n dateOnly ? `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}` : d.toISOString();\n\n/** The width of what an element holds (its text and children, not absolutely placed parts such as the column border).\n * Null where text cannot be measured (jsdom has no Range#getBoundingClientRect): the column keeps its default width. */\nfunction contentWidth(el: Element): number | null {\n let left = Infinity;\n let right = -Infinity;\n const range = document.createRange();\n if (typeof range.getBoundingClientRect !== 'function') return null;\n for (const n of el.childNodes) {\n let r: DOMRect | null = null;\n if (n instanceof HTMLElement) {\n if (n.classList.contains('ui-col-resize') || getComputedStyle(n).position === 'absolute') continue;\n r = n.getBoundingClientRect();\n } else if (n.nodeType === Node.TEXT_NODE && n.textContent?.trim()) {\n range.selectNodeContents(n);\n r = range.getBoundingClientRect();\n }\n if (r && r.width) {\n left = Math.min(left, r.left);\n right = Math.max(right, r.right);\n }\n }\n return right > left ? right - left : 0;\n}\n\n// 「/」 focuses the search field of the first table on the page that has one (in page order) and that is shown: a table\n// in a hidden tab panel, a closed drawer or behind a modal does not take it. One listener for all.\nconst shortcutTables = new Set<HTMLElement>();\nconst shortcutListeners = new Set<() => void>();\n// Tables hidden or shown later (a tab panel switched, a drawer opened) change size, so the 「/」 hint moves with them.\nlet shortcutSizes: ResizeObserver | null = null;\nconst notifyShortcut = () => shortcutListeners.forEach((f) => f());\ntype Visible = { checkVisibility?: (o?: Record<string, boolean>) => boolean };\n/** Rendered and not hidden: not display: none (itself or an ancestor), not visibility: hidden, not inert or aria-hidden. */\nfunction isShown(el: HTMLElement): boolean {\n if (!el.isConnected || el.closest('[inert], [aria-hidden=\"true\"]')) return false;\n const check = (el as HTMLElement & Visible).checkVisibility;\n if (typeof check === 'function') return check.call(el, { checkVisibilityCSS: true, visibilityProperty: true });\n return el.getClientRects().length > 0 && getComputedStyle(el).visibility !== 'hidden';\n}\nconst shortcutInput = (el: HTMLElement) => el.querySelector<HTMLInputElement>(':scope > .ui-dt-tools .ui-dt-search input');\nconst firstShortcutTable = (): HTMLElement | null =>\n [...shortcutTables]\n .filter((el) => isShown(el) && !!shortcutInput(el))\n .sort((a, b) => (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1))[0] ?? null;\n// Where 「/」 is typed text or a key of the widget itself: fields, lists, grids, menus and dialogs keep it.\nconst SLASH_OWNERS =\n 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"]), [role=\"textbox\"], [role=\"searchbox\"], [role=\"combobox\"], [role=\"listbox\"], [role=\"grid\"], [role=\"treegrid\"], [role=\"tree\"], [role=\"menu\"], [role=\"menubar\"], [role=\"dialog\"], [role=\"alertdialog\"], dialog';\nfunction onSlash(e: KeyboardEvent) {\n if (e.key !== '/' || e.ctrlKey || e.metaKey || e.altKey || e.defaultPrevented || e.isComposing) return;\n const t = e.target instanceof Element ? e.target : null;\n if (t?.closest(SLASH_OWNERS)) return;\n const table = firstShortcutTable();\n const input = table ? shortcutInput(table) : null;\n if (!input) return;\n input.focus();\n // Only when the field took the focus: otherwise the key does what it would have done.\n if (document.activeElement === input) e.preventDefault();\n}\nfunction registerShortcut(el: HTMLElement, changed: () => void): () => void {\n if (!shortcutTables.size) document.addEventListener('keydown', onSlash);\n if (!shortcutSizes && typeof ResizeObserver !== 'undefined') shortcutSizes = new ResizeObserver(notifyShortcut);\n shortcutTables.add(el);\n shortcutListeners.add(changed);\n shortcutSizes?.observe(el);\n notifyShortcut();\n return () => {\n shortcutTables.delete(el);\n shortcutListeners.delete(changed);\n shortcutSizes?.unobserve(el);\n if (!shortcutTables.size) {\n document.removeEventListener('keydown', onSlash);\n shortcutSizes?.disconnect();\n shortcutSizes = null;\n }\n notifyShortcut();\n };\n}\n\n// Ctrl, ⌘, Shift or the middle button: a link opens in a new tab or window.\nconst newTab = (e: React.MouseEvent) => e.ctrlKey || e.metaKey || e.shiftKey || e.button === 1;\n\n// What a row click leaves alone: links, buttons, fields, checkboxes and anything else that acts on its own.\nconst ROW_CONTROLS = 'a, button, input, select, textarea, label, [role=\"checkbox\"], [role=\"button\"], [role=\"menuitem\"], [role=\"link\"], [contenteditable]';\n\nfunction RowCheck({ v, label, onClick }: { v: boolean | 'mixed'; label: string; onClick: (e: React.MouseEvent) => void }) {\n return (\n <button\n type=\"button\"\n role=\"checkbox\"\n aria-checked={v}\n aria-label={label}\n className={cx('ui-check-box', 'ui-dt-check', v && 'is-on')}\n // Shift + click picks a range: no text selection from it.\n onMouseDown={(e) => e.shiftKey && e.preventDefault()}\n onClick={(e) => {\n e.stopPropagation();\n onClick(e);\n }}\n >\n <CheckMark v={v} />\n </button>\n );\n}\n\ninterface Measured {\n fit: Record<string, number>;\n clipped: boolean | null;\n want: Record<string, number>;\n roomy: boolean;\n actsW: number | null;\n onerow: boolean;\n}\nconst UNMEASURED: Measured = { fit: {}, clipped: null, want: {}, roomy: false, actsW: null, onerow: false };\n\n/** A date with its time, 「2026/11/18(三)04:51」: the date and the time each stay whole, and a phone card that has no\n * room for both breaks the line between them only. Text without 「)」 (other locales, 「2 小時前」) as it is. */\nfunction dateParts(text: string, mark: string): React.ReactNode {\n const i = text.indexOf(')');\n if (i < 0 || i === text.length - 1) return markMatch(text, mark);\n return (\n <>\n <span className=\"ui-dt-nowrap\">{markMatch(text.slice(0, i + 1), mark)}</span>\n <wbr />\n <span className=\"ui-dt-nowrap\">{markMatch(text.slice(i + 1), mark)}</span>\n </>\n );\n}\n\n/** The value from the render where sig last changed: a new array that says the same thing keeps the old one, so memos\n * that depend on it do not run again. */\nfunction useSameWhile<T>(value: T, sig: string): T {\n const [kept, setKept] = React.useState({ value, sig });\n if (kept.sig !== sig) {\n setKept({ value, sig });\n return value;\n }\n return kept.value;\n}\n\n/** What the columns say, as text: changes when a key, label or format changes, not when the array is rebuilt. */\nfunction columnsSig(cols: readonly DataTableColumn<never>[]): string {\n return cols\n .map((c) =>\n [c.key, c.label, c.format, c.numeric, c.mono, c.unit, c.currency, c.decimals, c.sortable, !!c.sortValue, !!c.searchText, !!c.render].join('\\u0002'),\n )\n .join('\\u0001');\n}\n/** The same for the filters: keys, labels, types and options; a match function counts only by being there. */\nfunction filtersSigOf(fs: readonly DataTableFilter<never>[] | undefined, f: { key: string; label?: string; options: FilterOption[] } | undefined): string {\n return JSON.stringify([fs?.map((x) => [x.key, x.label, x.type, x.multiple, x.scale, x.unitLabel, x.options, !!x.match]), f]);\n}\n\ninterface Snapshot {\n kind: 'sort' | 'next' | 'prev';\n rows: Record<string, { top: number; bg: string; node: HTMLElement }>;\n order: string[];\n}\n\n/** The table for records: sort, search, filters, page numbers, selection with a bulk bar, row actions; cards on phones. */\nexport function DataTable<R extends Row = Record<string, unknown>>(p: DataTableProps<R>) {\n const { columns: cols, rows, pageSize = 10, urlSync = true, urlKey, search = {}, selectable = false, stickyFirst: sticky = false } = p;\n // Columns, filters and views are often written inline (a new array every render): the memos below follow what they\n // say (keys, formats, options), read through refs, not the arrays' identity, so a render does not sort and filter again.\n const memoCols = useSameWhile(cols, columnsSig(cols));\n const given = useSameWhile({ filters: p.filters, filter: p.filter }, filtersSigOf(p.filters, p.filter));\n const filters: ResolvedFilter<R>[] = React.useMemo(() => {\n const list = given.filters ? [...given.filters] : [];\n const f = given.filter;\n if (f && !list.length) list.push({ key: f.key, label: f.label || memoCols.find((c) => c.key === f.key)?.label || f.key, options: f.options });\n return resolveFilters(list, rows);\n }, [given, memoCols, rows]);\n const countUnit: CountUnit = p.unit ?? p.summary?.unit ?? '筆';\n const unitOf = (n: number) => unitFor(countUnit, n);\n const fromUrl = () => (urlSync && typeof location !== 'undefined' ? readUrl(urlKey, filters) : { q: '', values: {} });\n const maxSort = Math.max(1, p.maxSort ?? Infinity);\n const sortCols = cols.filter((c) => c.sortable !== false).map((c) => ({ key: c.key, label: c.label, numeric: isNum(c) }));\n const firstDir = (key: string): SortLevel['dir'] => (sortCols.find((c) => c.key === key)?.numeric ? 'desc' : 'asc');\n // Only sortable columns, each once, at most maxSort.\n const validSort = (l: readonly { key: string; dir?: SortLevel['dir'] }[]): SortLevel[] =>\n l\n .filter((x, i) => sortCols.some((c) => c.key === x.key) && l.findIndex((y) => y.key === x.key) === i)\n .slice(0, maxSort)\n .map((x) => ({ key: x.key, dir: x.dir ?? firstDir(x.key) }));\n const initialSort = validSort(p.defaultSort ?? []);\n const [sort, setSort] = React.useState<SortLevel[]>(() => validSort((urlSync && typeof location !== 'undefined' ? readSort(urlKey) : null) ?? initialSort));\n const [page, setPage] = React.useState(0);\n const [q, setQ] = React.useState(() => fromUrl().q);\n const [values, setValues] = React.useState<Record<string, FilterValue>>(() => fromUrl().values);\n const [view, setView] = React.useState(p.views?.[0]?.id ?? null);\n // Columns people turned on or off in the 「欄位」 menu; the others follow their own `hidden`. Remembered under storageKey.\n const storageKey = p.storageKey ?? p.widthKey;\n const colsKey = storageKey ? 'ui-dt-cols:' + storageKey : null;\n // None on the server and the first browser render, then the stored choice (useStored); an empty choice is removed.\n const [toggled, setToggled] = useStored<Record<string, boolean>>(colsKey ?? undefined, parseToggled, NO_TOGGLED, (t) =>\n Object.keys(t).length ? JSON.stringify(t) : null,\n );\n // Rows opened with the caret on the left: their long columns in full, below the row.\n const [opened, setOpened] = React.useState<Record<string, boolean>>({});\n const narrow = useNarrow();\n const touch = useMedia(TOUCH_ONLY);\n const uid = React.useId();\n const rootRef = React.useRef<HTMLDivElement>(null);\n const [sel, setSel] = React.useState<Record<string, boolean>>({});\n const [sumVal, setSumVal] = React.useState('all');\n // What the measuring effect reads from the drawn table, in one state so one measure is one render (see below).\n const [measured, setMeasured] = React.useState<Measured>(UNMEASURED);\n // fit: widths (px) that columns grew to so content that cannot wrap is not cut. clipped: whether a long cell on the\n // page is cut at its column's edge (desktop; null until measured). want, roomy: what the main and long columns ask for\n // (px), and whether every column gets it. actsW: the row actions' width (px), kept free at the end of the last cell.\n // onerow: the summary tabs, the search field and the buttons fit on one row.\n const { fit, clipped, want, roomy, actsW, onerow: onerowState } = measured;\n const wantRef = React.useRef(want);\n // A2: widths readers dragged (px per column key); null = width and grow decide. Remembered under storageKey.\n const [widths, setWidths] = useStored<Record<string, number> | null>(storageKey ? 'ui-dt-width:' + storageKey : undefined, parseWidths, null);\n // In the 「放大表格」 dialog: open, and the widths dragged there (not kept; the page's widths stay).\n const [zoomed, setZoomed] = React.useState(false);\n const [zoomWidths, setZoomWidths] = React.useState<Record<string, number> | null>(null);\n const zoomRef = React.useRef<HTMLDivElement>(null);\n // Without a search field, a table right under a Card's title puts its tools in that title row instead of a row of\n // their own: the Card's head element, found after the first render.\n const [headSlot, setHeadSlot] = React.useState<HTMLElement | null>(null);\n const noSearch = search === false && !p.caption;\n React.useLayoutEffect(() => {\n const prev = noSearch ? rootRef.current?.previousElementSibling : null;\n setHeadSlot(prev instanceof HTMLElement && prev.classList.contains('ui-card-head') && prev.parentElement?.classList.contains('ui-card') ? prev : null);\n }, [noSearch]);\n // A Card head with only buttons above the table (the old way to place 「新增」) leaves a row of its own for one button.\n React.useEffect(() => {\n const prev = rootRef.current?.previousElementSibling;\n devWarn(\n prev?.classList.contains('ui-card-head') && !prev.querySelector('.ui-card-title') && prev.querySelector('.ui-card-actions'),\n 'DataTable',\n \"the Card around this table has actions but no title, so its one button takes a row of its own above the table. Pass the page's primary action to DataTable's action instead: it goes at the right end of the toolbar.\",\n );\n }, []);\n const [resetKey, setResetKey] = React.useState(p.resetKey);\n const resetting = resetKey !== p.resetKey;\n if (resetting) {\n setResetKey(p.resetKey);\n setQ('');\n setValues({});\n setPage(0);\n setSel({});\n setSumVal('all');\n setSort(initialSort);\n // Remembered columns (storageKey) are the reader's own, like the widths: a new data set keeps them.\n if (!colsKey) setToggled({});\n setOpened({});\n setMeasured((m) => ({ ...m, fit: {}, want: {}, clipped: null }));\n }\n const valuesKey = JSON.stringify(values);\n const sortKey = JSON.stringify(sort);\n React.useEffect(() => {\n if (urlSync && typeof location !== 'undefined') writeSort(urlKey, sort, initialSort);\n // eslint-disable-next-line react-hooks/exhaustive-deps -- written when the sort changes\n }, [sortKey]);\n React.useEffect(() => {\n if (urlSync && filters.length) writeUrl(urlKey, filters, values, q);\n // eslint-disable-next-line react-hooks/exhaustive-deps -- written when the conditions change, not when the filter list is rebuilt\n }, [valuesKey, q]);\n devWarn(\n p.widthKey !== undefined,\n 'DataTable',\n '`widthKey` is deprecated: rename it to `storageKey`, as in every other component that remembers a choice. The stored widths and columns carry over.',\n );\n devWarn(\n () => cols.some((c) => c.format === 'percent' && !c.unit),\n 'DataTable',\n \"format: 'percent' sets 1 decimal and shows no % sign; add unit: '%' to that column.\",\n );\n devWarn(\n () => rows.length > 1 && rows.every((r) => get(r, 'id') == null) && selectable,\n 'DataTable',\n 'rows have no id, so a selection follows the position, not the row. Add an id to each row.',\n );\n\n devWarn(\n () => cols.some((c) => c.format === 'datetime'),\n 'DataTable',\n \"format: 'datetime' is the old spelling, kept for now. Write format: 'dateTime', as format.dateTime().\",\n );\n devWarn(!!cols[0]?.hidden, 'DataTable', 'the first column is always shown, so its hidden: true does nothing. Move the column, or drop hidden.');\n devWarn(\n () => (p.columnMenu === false || cols.length <= 2) && cols.some((c, i) => i > 0 && c.hidden),\n 'DataTable',\n 'a column has hidden: true but there is no 「欄位」 menu (columnMenu is false, or the table has 2 columns or fewer), so nobody can turn it on. Turn the menu on, or leave the column out.',\n );\n // One condition in one place: a status the summary tabs pick should not be a filter or a view as well.\n const sumKey = p.summary?.key;\n if (DEV) {\n const twiceFilter = sumKey ? filters.find((f) => f.key === sumKey) : undefined;\n devWarn(\n twiceFilter,\n 'DataTable',\n `the filter 「${twiceFilter?.label}」 filters ${String(sumKey)}, which the summary tabs already filter, so the same condition is in two places. Drop it from filters (or drop summary).`,\n );\n // A view filters the same key when the rows it keeps are exactly the rows of one summary value.\n const twiceView =\n sumKey && rows.length\n ? p.views?.find((v) => {\n if (!v.filter) return false;\n const kept = rows.filter((r) => v.filter?.(r));\n if (!kept.length || kept.length === rows.length) return false;\n const val = String(get(kept[0], sumKey));\n return kept.every((r) => String(get(r, sumKey)) === val) && rows.filter((r) => String(get(r, sumKey)) === val).length === kept.length;\n })\n : undefined;\n devWarn(\n twiceView,\n 'DataTable',\n `the view 「${twiceView?.label}」 keeps exactly the rows of one ${String(sumKey)} value, which a summary tab already picks, so the same condition is in two places. Drop the view (or drop summary).`,\n );\n // A number with its unit baked into a string cannot be formatted, aligned or sorted as a number.\n for (const c of cols) {\n if (!c.unit && !c.numeric) continue;\n const bad = rows\n .map((r) => get(r, c.key))\n .find((v) => typeof v === 'string' && /\\d/.test(v) && (c.unit ? v.includes(c.unit) : !/^\\s*-?[\\d,]*\\.?\\d+\\s*$/.test(v)));\n devWarn(\n bad !== undefined,\n 'DataTable',\n `column 「${c.label}」 got the string 「${String(bad)}」. Pass a number${c.unit ? '' : ' and the unit in unit'} (e.g. { numeric: true, unit: '${c.unit || 'items'}' } with 1234), so it is formatted, right-aligned and sorted as a number.`,\n );\n }\n }\n const hidden: Record<string, boolean> = {};\n cols.forEach((c, i) => (hidden[c.key] = i > 0 && (toggled[c.key] ?? !!c.hidden)));\n const shownCols = cols.filter((c) => !hidden[c.key]);\n const { ref: scrollRef, more: scrollMore, overflows, scrolled, onScroll } = useScrollHint();\n const bodyRef = React.useRef<HTMLDivElement>(null);\n const rowEls = React.useRef<Record<string, HTMLDivElement | null>>({});\n const snap = React.useRef<Snapshot | null>(null);\n\n const summary = p.summary;\n const searching = search !== false && !!q;\n const searchKeys = search ? search.keys : undefined;\n // Read by the memo below as a string, so a new keys array with the same keys does not search again.\n const searchKeysKey = searchKeys ? searchKeys.join('\\u0001') : null;\n const passes = (r: R, skip?: string) =>\n (!searching || searchHit(r, cols, filters, q, searchKeys)) && filters.every((f) => f.key === skip || matches(f, r, values[f.key]));\n // View, summary, search, filters and sort run again only when one of them or the rows change, not on every render\n // (a hover, a selection, a measured width).\n const views = useSameWhile(p.views, p.views ? p.views.map((v) => v.id + '\\u0002' + !!v.filter).join('\\u0001') : '');\n const { all, sumAll, list } = React.useMemo(() => {\n const cols = memoCols;\n let all = rows.map((r, i) => ({ r, i }));\n const viewObj = views?.find((v) => v.id === view);\n if (viewObj?.filter) all = all.filter((x) => viewObj.filter?.(x.r));\n const sumAll = all;\n if (sumKey && sumVal !== 'all') all = all.filter((x) => String(get(x.r, sumKey)) === sumVal);\n const keys = searchKeysKey === null ? undefined : (searchKeysKey.split('\\u0001') as RowKey<R>[]);\n const hit = (r: R) => (!searching || searchHit(r, cols, filters, q, keys)) && filters.every((f) => matches(f, r, values[f.key]));\n let list = all.filter((x) => hit(x.r));\n if (sort.length) {\n // The first level decides; the next only between rows the first finds equal; then the rows' own order.\n const by = sort.map((l) => {\n const col = cols.find((c) => c.key === l.key);\n // Dates by time (an ISO string or a Date), not by their text.\n const val = (r: R): unknown => {\n if (col?.sortValue) return col.sortValue(r);\n const v = get(r, l.key);\n if (v instanceof Date || (col && isDateCol(col))) return asDate(v)?.getTime() ?? -Infinity;\n return v;\n };\n return { val, d: l.dir === 'asc' ? 1 : -1 };\n });\n list = [...list].sort((a, b) => {\n for (const { val, d } of by) {\n const x = val(a.r);\n const y = val(b.r);\n const c = typeof x === 'number' && typeof y === 'number' ? x - y : String(x).localeCompare(String(y), 'zh-Hant');\n if (c) return c * d;\n }\n return a.i - b.i;\n });\n }\n return { all, sumAll, list };\n }, [rows, memoCols, filters, values, q, searching, searchKeysKey, sort, view, views, sumKey, sumVal]);\n const baseCount = all.length;\n const activeN = filters.filter((f) => isActive(values[f.key])).length;\n // After the search, a filter, the summary or the view changes (not on first render): 「顯示 6 筆」.\n const shownKey = `${q}|${valuesKey}|${sumVal}|${view}`;\n const firstKey = React.useRef(shownKey);\n const shownN = list.length;\n const shownText = tr('顯示 {n} {unit}', { n: format.number(shownN), unit: unitOf(shownN) });\n React.useEffect(() => {\n if (shownKey === firstKey.current) return;\n firstKey.current = '';\n const t = setTimeout(() => announce(shownText), 400);\n return () => clearTimeout(t);\n }, [shownKey, shownText]);\n const pages = Math.max(1, Math.ceil(list.length / pageSize));\n const pageNow = Math.min(page, pages - 1);\n const start = pageNow * pageSize;\n const vis = React.useMemo(() => list.slice(start, start + pageSize), [list, start, pageSize]);\n const idOf = (x: { r: R; i: number }) => {\n const id = get(x.r, 'id');\n return id != null ? String(id) : String(x.i);\n };\n // Only rows the filters, search, view and summary still show (any page) stay selected: rows filtered out or\n // deleted are unchecked, so bulkActions acts only on what the person can see.\n const present = new Set(list.map(idOf));\n const selIds = Object.keys(sel).filter((k) => sel[k] && present.has(k));\n // Skipped while resetting: the reset above already cleared the selection, and this call would win over it.\n if (!resetting && Object.keys(sel).some((k) => sel[k] && !present.has(k))) setSel(Object.fromEntries(selIds.map((k) => [k, true])));\n const visIds = vis.map(idOf);\n const selVis = visIds.filter((id) => sel[id]).length;\n const allOn = visIds.length > 0 && selVis === visIds.length;\n const mixed = selVis > 0 && !allOn;\n\n // Remember where every row is; the layout effect then animates from there (FLIP).\n const capture = (kind: Snapshot['kind']) => {\n const body = bodyRef.current;\n if (!body) return;\n const top0 = body.getBoundingClientRect().top;\n const snapRows: Snapshot['rows'] = {};\n const order: string[] = [];\n for (const id of visIds) {\n const el = rowEls.current[id];\n if (!el) continue;\n snapRows[id] = { top: el.getBoundingClientRect().top - top0, bg: getComputedStyle(el).backgroundColor, node: el };\n order.push(id);\n }\n snap.current = { kind, rows: snapRows, order };\n };\n React.useLayoutEffect(() => {\n const sn = snap.current;\n snap.current = null;\n const body = bodyRef.current;\n if (!sn || !body || reduced() || typeof Element.prototype.animate !== 'function') return;\n const top0 = body.getBoundingClientRect().top;\n const n = Math.max(sn.order.length, visIds.length);\n let k = 0;\n let rh = 48;\n visIds.forEach((id, i) => {\n const el = rowEls.current[id];\n if (!el) return;\n const r = el.getBoundingClientRect();\n rh = r.height || rh;\n const old = sn.rows[id];\n const timing = { duration: MOVE.dur, delay: i * MOVE.stagger, easing: MOVE.ease, fill: 'backwards' as const };\n if (old) {\n const from = old.top - (r.top - top0);\n el.animate(\n [\n { transform: `translateY(${from}px)`, backgroundColor: old.bg },\n { transform: 'none', backgroundColor: getComputedStyle(el).backgroundColor },\n ],\n timing,\n );\n } else {\n const off = sn.kind === 'next' ? n : sn.kind === 'prev' ? -n : n + k - i;\n k++;\n el.animate(\n [\n { transform: `translateY(${off * rh}px)`, opacity: 0 },\n { transform: 'none', opacity: 1 },\n ],\n timing,\n );\n }\n });\n // Rows that left the page: animate a copy out.\n sn.order.forEach((id, j) => {\n if (visIds.includes(id)) return;\n const o = sn.rows[id];\n const ghost = o.node.cloneNode(true) as HTMLElement;\n ghost.removeAttribute('data-rid');\n ghost.setAttribute('aria-hidden', 'true');\n // A picture of the leaving row only: nothing in it takes focus or repeats an id of the live table.\n ghost.inert = true;\n for (const el of ghost.querySelectorAll<HTMLElement>('a[href], button, input, select, textarea, [tabindex]')) el.tabIndex = -1;\n for (const el of [ghost, ...ghost.querySelectorAll<HTMLElement>('[id]')]) el.removeAttribute('id');\n ghost.classList.add('ui-dt-ghost');\n ghost.style.top = o.top + 'px';\n ghost.style.backgroundColor = o.bg;\n body.appendChild(ghost);\n const to = sn.kind === 'next' ? -n : sn.kind === 'prev' ? n : n + 1 - j;\n // Clipped to the table body while copies leave (is-leaving): they never draw below the table or its Card.\n body.classList.add('is-leaving');\n ghost.animate(\n [\n { transform: 'none', opacity: 1 },\n { transform: `translateY(${to * rh}px)`, opacity: 0 },\n ],\n { duration: MOVE.dur, easing: MOVE.ease, fill: 'forwards' },\n ).onfinish = () => {\n ghost.remove();\n if (!body.querySelector(':scope > .ui-dt-ghost')) body.classList.remove('is-leaving');\n };\n });\n });\n\n const changeSort = (next: SortLevel[]) => {\n capture('sort');\n setSort(next);\n announce(sortSentence(next, sortCols));\n };\n // A click sorts by this column alone: first click from A (numbers from the largest), second reversed, third back\n // to the rows' order. Shift + click (add) makes it the next level instead: added, reversed, removed.\n const sortBy = (c: DataTableColumn<R>, add = false) => {\n if (c.sortable === false) return;\n const first = firstDir(c.key);\n const flip = first === 'asc' ? 'desc' : 'asc';\n const i = sort.findIndex((l) => l.key === c.key);\n if (add) {\n if (i < 0) {\n if (sort.length < maxSort) changeSort([...sort, { key: c.key, dir: first }]);\n else announce(tr('最多 {n} 層排序。', { n: maxSort }));\n } else if (sort[i].dir === first) changeSort(sort.map((l, j) => (j === i ? { key: l.key, dir: flip } : l)));\n else changeSort(sort.filter((_, j) => j !== i));\n return;\n }\n if (sort.length !== 1 || i !== 0) changeSort([{ key: c.key, dir: first }]);\n else if (sort[0].dir === first) changeSort([{ key: c.key, dir: flip }]);\n else changeSort([]);\n };\n const goPage = (n: number) => {\n if (n === pageNow || n < 0 || n >= pages) return;\n capture(n > pageNow ? 'next' : 'prev');\n setPage(n);\n };\n const toggle = (ids: string[], v: boolean) => setSel({ ...sel, ...Object.fromEntries(ids.map((id) => [id, v])) });\n const clear = () => setSel({});\n // Shift + click on a row's checkbox: every row from the last one clicked to this one (in the shown order, any page)\n // takes this one's new state. Only rows the search, filters, view and summary keep, in the current sort.\n const lastPick = React.useRef<string | null>(null);\n // A new search, filter, summary tab, view, sort or page size changes which rows lie between two clicks: the range\n // starts again from the next click.\n const anchorKey = `${shownKey}|${sortKey}|${pageSize}`;\n React.useEffect(() => {\n lastPick.current = null;\n }, [anchorKey]);\n const pickRow = (id: string, on: boolean, shift: boolean) => {\n const ids = list.map(idOf);\n const from = shift && lastPick.current ? ids.indexOf(lastPick.current) : -1;\n const to = ids.indexOf(id);\n lastPick.current = id;\n if (from < 0 || to < 0 || from === to) return toggle([id], !on);\n const next = { ...sel, ...Object.fromEntries(ids.slice(Math.min(from, to), Math.max(from, to) + 1).map((k) => [k, !on])) };\n setSel(next);\n const n = ids.filter((k) => next[k]).length;\n announce(tr('已選 {n} {unit}', { n, unit: unitOf(n) }));\n };\n const clearFilters = () => {\n setValues({});\n setQ('');\n setPage(0);\n };\n\n const hasAct = !!p.rowActions;\n const onerow = onerowState && !narrow;\n const hasTitle = shownCols.some((c) => c.mobile === 'title');\n const mobileClass = (c: DataTableColumn<R>, ci: number) => {\n const m = c.mobile || (ci === titleIdx() ? 'title' : null);\n return m ? 'is-m-' + m : null;\n };\n // A caret on the left of each row when there are long columns (desktop; phone cards have 「顯示全部」).\n // Columns whose whole text the row's details show: long ones, and short ones with fullText.\n const longCols = shownCols.filter((c) => c.long || c.fullText);\n // A long column only needs the caret while a cell on the page is cut (measured below; null until measured, and where\n // layout cannot be measured). fullText always says more than the cell, so it keeps the caret. An open row keeps it.\n const expander = longCols.length > 0 && !narrow && (clipped !== false || longCols.some((c) => c.fullText) || visIds.some((id) => opened[id]));\n const EXP = 40;\n // Widths by default. The main column (the first text column) and long ones take the room left; the others hug their\n // content: numbers, units, dates, durations, status Badges and other short text. A width is a least width for any\n // column and never decides which column is the main one. A grow prop wins either way. Hugging columns are measured below (their heading and every cell on the page, widest wins).\n // A mono column (an ID, a hash) is never the main one: without another text column, none takes the room left.\n const mainKey = shownCols.find((c) => !isShort(c) && !c.long && !c.mono && c.grow !== 0)?.key;\n // The phone card's title: the first column; when that is a mono ID and the table has a main column (a text column\n // that is not mono, long or short), the main column, and the ID becomes a field of the card.\n const titleIdx = () => {\n if (hasTitle) return -1;\n if (!shownCols[0]?.mono) return 0;\n const main = shownCols.findIndex((c) => c.key === mainKey && !c.mobile);\n return main < 0 ? 0 : main;\n };\n const grows = (c: DataTableColumn<R>) => (c.grow != null ? c.grow > 0 : c.long || c.key === mainKey);\n // A column is at least as wide as content that cannot wrap (a code chip, a link with a path): measured below.\n const minOf = (c: DataTableColumn<R>) => {\n if (grows(c)) return Math.max(c.width || (isNum(c) ? 96 : 120), fit[c.key] || 0, roomy ? want[c.key] || 0 : 0);\n const text = c.width == null && !isShort(c);\n const cap = text ? TEXT_HUG_MAX : Infinity;\n return Math.max(c.width || 0, MIN_COL, text ? TEXT_HUG_MIN : 0, Math.min(fit[c.key] ?? c.width ?? HUG_START, cap));\n };\n // Dragged widths (A2) fix every shown column in px; a column shown later starts at its least width.\n const layout = (w: Record<string, number> | null) => {\n const colW = (c: DataTableColumn<R>) => (w ? `${w[c.key] ?? minOf(c)}px` : grows(c) ? `minmax(${minOf(c)}px, ${c.grow || 1}fr)` : `${minOf(c)}px`);\n // Row actions take no column: they show over the row's end (see .ui-dt-acts). On touch screens, where they always\n // show, the rows keep --dt-acts-w free at their end instead.\n const template = [expander ? EXP + 'px' : null, selectable ? SEL + 'px' : null, ...shownCols.map(colW)].filter(Boolean).join(' ');\n const minW = (expander ? EXP : 0) + (selectable ? SEL : 0) + shownCols.reduce((a, c) => a + (w ? (w[c.key] ?? minOf(c)) : minOf(c)), 0);\n return { gridTemplateColumns: template, minWidth: minW };\n };\n const pageGrid = layout(widths);\n const zoomGrid = layout(zoomWidths);\n // The drawn width of each shown column (px), read from its header cell: where a first drag starts.\n const drawn = (root: HTMLElement | null) => {\n const out: Record<string, number> = {};\n for (const c of shownCols) {\n const el = root?.querySelector<HTMLElement>(`.ui-dt-head [data-col=\"${CSS.escape(c.key)}\"]`);\n out[c.key] = el ? Math.ceil(el.getBoundingClientRect().width) : minOf(c);\n }\n return out;\n };\n // A column is never narrower than its heading and sort arrow (headings do not wrap), nor than 48 px.\n const headMin = (root: HTMLElement | null, key: string) => {\n const el = root?.querySelector<HTMLElement>(`.ui-dt-head [data-col=\"${CSS.escape(key)}\"] > :first-child`);\n return Math.max(MIN_COL, el ? Math.ceil(el.getBoundingClientRect().width) + 24 : MIN_COL);\n };\n // Desktop rows: a cell whose content cannot wrap and is wider than the cell (InlineCode, a path) widens its column\n // instead of being cut. Long columns truncate on purpose and are left alone. Widths only grow, until resetKey.\n // Hugging columns take the widest of their heading, every cell on the page and the totals row, each read on one line\n // from its content's own boxes (not scrollWidth, which misses text that overflows to the left of a right-aligned cell).\n // Measured on mount, then at most once a frame when the shown rows or columns change, rows are added or removed, or\n // web fonts load; not on every render or text change. The state changes only when a column has to grow.\n const measureRef = React.useRef<() => void>(() => {});\n React.useLayoutEffect(() => {\n const root = rootRef.current;\n if (!root || narrow) return;\n // A new resetKey (or the table back from phone cards): what the columns ask for is measured afresh.\n wantRef.current = {};\n const measure = () => {\n const need: Record<string, number> = {};\n for (const el of root.querySelectorAll<HTMLElement>(':scope > .ui-dt-scroller .ui-dt-body .ui-dt-cell[data-col]:not(.is-long):not(.is-hug)')) {\n const over = el.scrollWidth - el.clientWidth;\n const key = el.dataset.col;\n if (over > 1 && key) need[key] = Math.max(need[key] ?? 0, Math.ceil(el.getBoundingClientRect().width + over));\n }\n // Hugging columns: the widest of their heading, cells and total on one line (is-measuring keeps every one\n // unwrapped for this read; the class is gone before the browser paints).\n // Each cell's own padding counts: the last one keeps the row actions' width free at its end.\n const pad = (el: HTMLElement) => {\n const st = getComputedStyle(el);\n return (parseFloat(st.paddingLeft) || 0) + (parseFloat(st.paddingRight) || 0) + (parseFloat(st.borderRightWidth) || 0);\n };\n const hugs = root.querySelectorAll<HTMLElement>(':scope > .ui-dt-scroller .ui-dt-cell.is-hug[data-col]');\n // The main and long columns: their content on one line too, what they ask for before the room is shared.\n const growCells = root.querySelectorAll<HTMLElement>(':scope > .ui-dt-scroller .ui-dt-cell.is-grow[data-col]');\n const asks: Record<string, number> = {};\n if (hugs.length || growCells.length) {\n root.classList.add('is-measuring');\n for (const el of hugs) {\n const key = el.dataset.col;\n const inner = el.querySelector(':scope > .ui-dt-stack > .ui-dt-main') ?? el;\n const w = contentWidth(inner);\n if (key && w !== null) need[key] = Math.max(need[key] ?? 0, Math.ceil(w + pad(el)));\n }\n for (const el of growCells) {\n const key = el.dataset.col;\n const long = el.querySelector<HTMLElement>('.ui-dt-long-text');\n const w = long ? long.getBoundingClientRect().width : contentWidth(el.querySelector(':scope > .ui-dt-stack > .ui-dt-main') ?? el);\n if (!key || w === null || !w) continue;\n const max = el.classList.contains('is-long') ? LONG_WANT_MAX : MAIN_WANT_MAX;\n asks[key] = Math.max(asks[key] ?? 0, Math.min(max, Math.ceil(w + pad(el))));\n }\n root.classList.remove('is-measuring');\n }\n // Everything read in this pass goes into one state update (one render), and none when nothing changed.\n const next: Partial<Measured> = {};\n const head = root.querySelector<HTMLElement>(':scope > .ui-dt-scroller .ui-dt-head');\n const scroll = root.querySelector<HTMLElement>(':scope > .ui-dt-scroller .ui-dt-scroll');\n if (head && scroll && scroll.clientWidth > 0) {\n // Only grows, like fit, until resetKey: paging back and forth does not make columns jump.\n const before = wantRef.current;\n const more = Object.entries(asks).filter(([k, w]) => w > (before[k] ?? 0));\n const merged = more.length ? { ...before, ...Object.fromEntries(more) } : before;\n wantRef.current = merged;\n if (more.length) next.want = merged;\n // Every column gets what it asks for when the hugging columns, the checkbox column and every main or long\n // column's ask fit in the box (the caret column is left out: it goes when nothing is cut).\n let used = 0;\n for (const el of head.children as HTMLCollectionOf<HTMLElement>) {\n if (el.classList.contains('ui-dt-exp')) continue;\n const key = el.dataset.col;\n used += key && el.classList.contains('is-grow') ? Math.max(asks[key] ?? 0, merged[key] ?? 0, 48) : el.getBoundingClientRect().width;\n }\n next.roomy = used <= scroll.clientWidth;\n }\n // The row actions' width: the widest set of buttons over a row end.\n let aw = 0;\n for (const el of root.querySelectorAll<HTMLElement>(':scope > .ui-dt-scroller .ui-dt-body .ui-dt-acts')) {\n if (el.childElementCount) aw = Math.max(aw, Math.ceil(el.getBoundingClientRect().width));\n }\n if (root.querySelector(':scope > .ui-dt-scroller .ui-dt-body .ui-dt-acts')) next.actsW = aw;\n // One toolbar row when the summary tabs, the search field at its least width and the buttons fit.\n const tools = root.querySelector<HTMLElement>(':scope > .ui-dt-tools.has-summary');\n if (tools && tools.clientWidth > 0) {\n const tabs = tools.querySelector<HTMLElement>('.ui-dt-summary');\n const actions = tools.querySelector<HTMLElement>(':scope > .ui-dt-actions');\n let need2 = (tabs?.scrollWidth ?? 0) + (tools.querySelector(':scope > .ui-dt-search') ? SEARCH_MIN + 2 * TOOL_GAP : TOOL_GAP);\n const parts = actions ? [...(actions.children as HTMLCollectionOf<HTMLElement>)].filter((e) => getComputedStyle(e).position !== 'absolute') : [];\n for (const e of parts) {\n const text = e.querySelector<HTMLElement>('.ui-dt-sortbtn-text');\n need2 += e.getBoundingClientRect().width + (text ? Math.max(0, text.scrollWidth - text.clientWidth) : 0);\n }\n need2 += Math.max(0, parts.length - 1) * TOOL_GAP;\n next.onerow = need2 <= tools.clientWidth;\n }\n // A long cell cut at its column's edge: the caret column is needed. Only where layout is real (not jsdom).\n const scroller = root.querySelector<HTMLElement>(':scope > .ui-dt-scroller .ui-dt-scroll');\n if (scroller && scroller.clientWidth > 0) {\n const cut = [...root.querySelectorAll<HTMLElement>(':scope > .ui-dt-scroller .ui-dt-body .ui-dt-long')].some(\n (el) => el.scrollWidth > el.clientWidth + 1,\n );\n next.clipped = cut;\n }\n setMeasured((m) => {\n const grow = Object.entries(need).filter(([k, w]) => w > (m.fit[k] ?? 0));\n if (grow.length) next.fit = { ...m.fit, ...Object.fromEntries(grow) };\n const aw2 = next.actsW;\n const actsSame = aw2 == null || (m.actsW !== null && Math.abs(m.actsW - aw2) <= 1);\n const same =\n !next.fit &&\n !next.want &&\n (next.roomy === undefined || next.roomy === m.roomy) &&\n actsSame &&\n (next.onerow === undefined || next.onerow === m.onerow) &&\n (next.clipped === undefined || next.clipped === m.clipped);\n if (same) return m;\n return { ...m, ...next, actsW: actsSame ? m.actsW : (next.actsW ?? m.actsW) };\n });\n };\n let frame = 0;\n const later = () => {\n if (frame) return;\n frame = requestAnimationFrame(() => {\n frame = 0;\n measure();\n });\n };\n measureRef.current = later;\n measure();\n // Rows added or removed (a page, a filter, new data) and the header or totals row swapped: the child lists of the\n // table and its body only, not every text change inside a cell.\n const mo = new MutationObserver(later);\n for (const el of root.querySelectorAll(':scope > .ui-dt-scroller .ui-dt-table, :scope > .ui-dt-scroller .ui-dt-body')) mo.observe(el, { childList: true });\n document.fonts?.ready.then(later).catch(() => {});\n // A wider or narrower table cuts long cells differently: the caret column follows. Only the width: a row growing\n // taller is not a reason to measure.\n let lastW = -1;\n const ro = resizeObserver((entries) => {\n const w = Math.round(entries[0]?.contentRect.width ?? 0);\n if (w !== lastW && lastW >= 0) later();\n lastW = w;\n });\n ro?.observe(root);\n // The text's own size: a font that loads late, a zoom of the text only, or reader styles that add letter, word or\n // line spacing (WCAG 1.4.12) change how wide a cell's content is, though the table's width stays.\n const probe = root.querySelector<HTMLElement>(':scope > .ui-dt-probe');\n let probeSize = '';\n const po = probe\n ? resizeObserver(() => {\n const r = probe.getBoundingClientRect();\n const size = `${Math.round(r.width)}x${Math.round(r.height)}`;\n if (probeSize && size !== probeSize) later();\n probeSize = size;\n })\n : null;\n if (probe) po?.observe(probe);\n return () => {\n mo.disconnect();\n ro?.disconnect();\n po?.disconnect();\n cancelAnimationFrame(frame);\n measureRef.current = () => {};\n };\n // resetKey clears the widths: measured again even when the rows look the same.\n }, [narrow, resetKey]);\n // A new width for the row actions changes the last cell's padding: measured again.\n React.useLayoutEffect(() => {\n measureRef.current();\n }, [actsW]);\n // The same rows with new content (rows replaced by the app, a search marking text, totals recomputed): once a frame.\n const contentKey = `${visIds.join('\\u0001')}|${shownCols.map((c) => c.key).join(',')}|${list.length}|${q}|${!!p.totals}`;\n React.useLayoutEffect(() => {\n measureRef.current();\n }, [contentKey, rows]);\n const stickyStyle = (ci: number) => (ci === 0 && sticky ? { left: (expander ? EXP : 0) + (selectable ? SEL : 0) } : undefined);\n const cellClass = (c: DataTableColumn<R>, ci: number, ...more: unknown[]) =>\n cx(\n 'ui-dt-cell',\n isNum(c) && 'is-num',\n c.mono && 'is-mono',\n grows(c) ? 'is-grow' : 'is-hug',\n ci === 0 && sticky && 'is-sticky is-sticky-end',\n ci === shownCols.length - 1 && 'is-lastcol',\n ...more,\n );\n // stickyFirst: the caret and checkbox columns before the first column stay too, so nothing scrolls under them.\n const lead = (what: 'exp' | 'sel') =>\n sticky ? { className: 'is-sticky', style: { left: what === 'sel' && expander ? EXP : 0 } } : { className: undefined, style: undefined };\n\n const headOf = (inZoom: boolean) => {\n const gridStyle = inZoom ? zoomGrid : pageGrid;\n const w = inZoom ? zoomWidths : widths;\n const setW = inZoom ? setZoomWidths : setWidths;\n const root = () => (inZoom ? zoomRef.current : rootRef.current);\n return (\n <div className=\"ui-dt-row ui-dt-head\" role=\"row\" style={gridStyle}>\n {expander ? (\n <div className={cx('ui-dt-cell ui-dt-exp', lead('exp').className)} style={lead('exp').style} role=\"columnheader\">\n <span className=\"ui-visually-hidden\">{tr('展開')}</span>\n </div>\n ) : null}\n {selectable ? (\n <div className={cx('ui-dt-cell ui-dt-sel', lead('sel').className)} style={lead('sel').style} role=\"columnheader\">\n <RowCheck v={allOn ? true : mixed ? 'mixed' : false} label={tr('全選')} onClick={() => toggle(visIds, !allOn)} />\n </div>\n ) : null}\n {shownCols.map((c, ci) => {\n const at = sort.findIndex((l) => l.key === c.key);\n const cur = at >= 0;\n const many = sort.length > 1;\n return (\n <div\n key={c.key}\n role=\"columnheader\"\n // ARIA allows aria-sort on one column: the first level. The others say their place in the button's name.\n aria-sort={at === 0 ? (sort[0].dir === 'asc' ? 'ascending' : 'descending') : 'none'}\n className={cellClass(c, ci)}\n style={stickyStyle(ci)}\n data-col={c.key}\n >\n {c.sortable === false ? (\n c.label\n ) : (\n <button\n type=\"button\"\n className={cx('ui-dt-sort', cur && 'is-on')}\n aria-label={cur && many ? tr('{name},第 {n} 排序,{dir}', { name: c.label, n: at + 1, dir: dirWord(sort[at].dir) }) : undefined}\n aria-keyshortcuts=\"Shift+Enter\"\n onClick={(e) => sortBy(c, e.shiftKey)}\n onKeyDown={(e) => {\n if (e.shiftKey && (e.key === 'Enter' || e.key === ' ')) {\n e.preventDefault();\n sortBy(c, true);\n }\n }}\n >\n <span>{c.label}</span>\n <Icon d={ARROWS[cur ? sort[at].dir : 'none']} size={14} className=\"ui-dt-arrow\" />\n {cur && many ? (\n <span className=\"ui-dt-sortpri\" aria-hidden=\"true\">\n {at + 1}\n </span>\n ) : null}\n </button>\n )}\n {narrow ? null : (\n <ColResize\n name={c.label}\n width={w?.[c.key] ?? minOf(c)}\n start={() => (w ?? drawn(root()))[c.key] ?? minOf(c)}\n onWidth={(px) => setW({ ...(w ?? drawn(root())), [c.key]: Math.max(headMin(root(), c.key), px) })}\n onReset={() => setW(null)}\n />\n )}\n </div>\n );\n })}\n </div>\n );\n };\n\n const mark = searching ? q : '';\n // A relative date's full date and time: in a Tooltip on hover and as the cell's description (no extra tab stop).\n const absDate = (r: R, c: DataTableColumn<R>) => {\n if (c.format !== 'relative' || c.render) return '';\n const d = asDate(get(r, c.key));\n const abs = d ? format.dateTime(d) : '';\n return abs && abs !== format.relative(d) ? abs : '';\n };\n const cellInner = (r: R, c: DataTableColumn<R>) => {\n const raw = get(r, c.key);\n let v: React.ReactNode;\n if (c.render) v = c.render(r);\n else if (isDateCol(c) && asDate(raw)) {\n const d = asDate(raw) as Date;\n const abs = absDate(r, c);\n // Relative times stay current (one shared minute timer) and render the same on the server and at hydration.\n const t =\n c.format === 'relative' ? (\n <RelativeTime className=\"ui-dt-time\" value={d}>\n {(text) => dateParts(text, mark)}\n </RelativeTime>\n ) : (\n <time className=\"ui-dt-time\" dateTime={isoOf(d, c.format === 'date')}>\n {dateParts(String(cellText(c, raw) ?? ''), mark)}\n </time>\n );\n v = abs ? (\n <Tooltip label={abs} describe={false} disabled={touch}>\n {t}\n </Tooltip>\n ) : (\n t\n );\n } else if (c.unit && raw !== null && raw !== undefined && raw !== '')\n // One inline element: the cell is a flex box, which drops a bare space between the number and the unit.\n v = (\n <span className=\"ui-dt-qty\">\n {markMatch(cellText({ ...c, unit: undefined }, raw), mark)} <span className=\"ui-unit\">{c.unit}</span>\n </span>\n );\n else if (raw === null || raw === undefined || raw === '')\n // Nothing to show: a quiet dash, so an empty cell does not read as content.\n v = <span className=\"ui-dt-none\">{cellText(c, raw)}</span>;\n else v = markMatch(cellText(c, raw), mark);\n return v;\n };\n // A click on the row itself: not on one of its own controls, and not the end of a text selection.\n const rowClick = (e: React.MouseEvent<HTMLElement>) => {\n const t = e.target as Element;\n const ctl = t.closest(ROW_CONTROLS);\n if (ctl && ctl !== e.currentTarget) return false;\n const s = window.getSelection();\n return !(s && !s.isCollapsed && String(s).trim());\n };\n const openRow = (r: R, e: React.MouseEvent<HTMLElement>) => {\n const href = p.rowHref?.(r);\n if (href == null) return;\n if (newTab(e)) {\n e.preventDefault();\n window.open(href, '_blank', 'noopener');\n } else if (p.onRowOpen) p.onRowOpen(r, e);\n else e.currentTarget.querySelector<HTMLAnchorElement>('a.ui-dt-rowlink')?.click();\n };\n const cell = (r: R, c: DataTableColumn<R>, ci: number) => {\n let v = c.long ? <LongText>{cellInner(r, c)}</LongText> : cellInner(r, c);\n if (c.fullText) v = <FullText text={c.fullText(r)}>{v}</FullText>;\n if (ci === 0 && p.rowHref)\n v = (\n <a\n className=\"ui-dt-rowlink\"\n href={p.rowHref(r)}\n onClick={\n p.onRowOpen\n ? (e) => {\n if (newTab(e)) return;\n e.preventDefault();\n p.onRowOpen?.(r, e);\n }\n : undefined\n }\n >\n {v}\n </a>\n );\n const sub = c.secondary?.(r);\n if (sub == null || sub === '' || sub === false) return v;\n return (\n <span className=\"ui-dt-stack\">\n <span className=\"ui-dt-main\">{v}</span>\n <span className=\"ui-dt-sub\">{sub}</span>\n </span>\n );\n };\n const total = (c: DataTableColumn<R>, ci: number): React.ReactNode => {\n const how = p.totals?.[c.key];\n const rowsAll = list.map((x) => x.r);\n // Numbers in Geist Mono, the words (「合計」「平均」「筆」) and the unit in the text font.\n if (ci === 0 && !how)\n return (\n <span className=\"ui-dt-qty\">{monoNums(tr('合計 {n} {unit}', { n: '\\u0001', unit: unitOf(rowsAll.length) }), [format.number(rowsAll.length)])}</span>\n );\n if (typeof how === 'function') return how(rowsAll);\n if (how === 'sum' || how === 'avg') {\n const sum = rowsAll.reduce((a, r) => a + (Number(get(r, c.key)) || 0), 0);\n const val = how === 'sum' ? sum : sum / (rowsAll.length || 1);\n const num = cellText({ ...(how === 'avg' && !c.format ? { ...c, decimals: 1 } : c), unit: undefined }, val);\n return (\n <span className=\"ui-dt-qty\">\n {how === 'avg' ? <span className=\"ui-unit\">{tr('平均')} </span> : null}\n {num}\n {c.unit ? (\n <>\n {' '}\n <span className=\"ui-unit\">{c.unit}</span>\n </>\n ) : null}\n </span>\n );\n }\n return '';\n };\n\n // C2: every row the search and filters keep (all pages, in the current order), as a Markdown table.\n const copyMarkdown = () => {\n const all = list.map((x) => x.r);\n if (p.copyText) return p.copyText(all);\n return markdownTable(\n shownCols.map((c) => c.label),\n all.map((r) => shownCols.map((c) => String(c.fullText?.(r) ?? c.searchText?.(r) ?? cellText(c, get(r, c.key)) ?? ''))),\n );\n };\n // The toolbar, the table and the page numbers: on the page, and again in the 「放大表格」 dialog with the same state.\n // One row of tools: search, filter, count, copy, sort, columns, zoom. Without a search field the title goes on the\n // same row: the caption in front of the tools, or, when the table sits under a Card's title, the tools move into\n // that title row (inHead). How it wraps depends on the table's own width (container query in styles.css).\n // 「複製成 Markdown」 from the 「⋯」 menu: the menu closes, so a small 「已複製」 shows under it for 2 s and is announced.\n const [copied, setCopied] = React.useState(false);\n const copiedTimer = React.useRef<ReturnType<typeof setTimeout>>(undefined);\n React.useEffect(() => () => clearTimeout(copiedTimer.current), []);\n const doCopy = () =>\n copyText(copyMarkdown()).then(\n () => {\n setCopied(true);\n announce(tr('已複製'));\n clearTimeout(copiedTimer.current);\n copiedTimer.current = setTimeout(() => setCopied(false), 2000);\n },\n () => p.onCopyError?.(),\n );\n // 「/」 focuses the search field of the first table on the page that has one; that table shows the 「/」 hint.\n const slash = search !== false && p.toolbar !== false && p.searchShortcut !== false;\n const [slashOwner, setSlashOwner] = React.useState(false);\n React.useEffect(() => {\n const el = rootRef.current;\n if (!slash || !el) return;\n const changed = () => setSlashOwner(firstShortcutTable() === el);\n const off = registerShortcut(el, changed);\n return () => {\n off();\n setSlashOwner(false);\n };\n }, [slash]);\n const [searchFocus, setSearchFocus] = React.useState(false);\n // The applied conditions as removable chips under the toolbar: 「狀態:失敗 ×」, one per picked option or range.\n const setFilter = (key: string, v: FilterValue | undefined) => {\n setValues(v === undefined ? Object.fromEntries(Object.entries(values).filter(([k]) => k !== key)) : { ...values, [key]: v });\n setPage(0);\n };\n const chips: FilterChip[] = [];\n for (const f of filters) {\n const v = values[f.key];\n if (!v || !isActive(v)) continue;\n if (Array.isArray(v))\n for (const val of v)\n chips.push({\n id: f.key + '=' + val,\n text: tr('{name}:{value}', { name: f.label, value: f.options.find((o) => String(o.value) === val)?.label ?? val }),\n remove: () =>\n setFilter(\n f.key,\n v.filter((x) => x !== val),\n ),\n });\n else {\n const range = v.min && v.max ? `${v.min}–${v.max}` : v.min ? `≥ ${v.min}` : `≤ ${v.max}`;\n chips.push({ id: f.key, text: tr('{name}:{value}', { name: f.label, value: range }), remove: () => setFilter(f.key, undefined) });\n }\n }\n const chipsView = (inZoom: boolean) => (\n <FilterChips\n chips={chips}\n onClear={() => {\n setValues({});\n setPage(0);\n }}\n filterButton={() => (inZoom ? zoomRef : rootRef).current?.querySelector<HTMLElement>('.ui-dt-filterbtn') ?? null}\n />\n );\n // The toolbar, the table and the page numbers: on the page, and again in the 「放大表格」 dialog with the same state.\n // One row of tools: search, 「篩選」, the count, 「排序」 and 「⋯」 (欄位, 複製成 Markdown, 放大表格), every one 40 px tall.\n // Without a search field the title goes on the same row: the caption in front of the tools, or, when the table sits\n // under a Card's title, the tools move into that title row (inHead). How it wraps depends on the table's own width\n // (container query in styles.css).\n // The summary tabs: the first part of the toolbar (on the same row as the search and buttons when they all fit, see\n // onerow), or above it when the tools moved into a Card's title row.\n const summaryView = summary ? (\n <Tabs\n className=\"ui-dt-summary\"\n label={summary.label || tr('依狀態篩選')}\n unit={countUnit}\n value={sumVal}\n onChange={(v) => {\n capture('sort');\n setSumVal(v);\n setPage(0);\n }}\n items={[\n // No counts while loading: 「全部 0」 would be wrong.\n { id: 'all', label: tr('全部'), count: p.loading ? undefined : sumAll.length },\n ...summary.items.map((it) => ({\n id: String(it.value),\n label: it.label,\n count: p.loading ? undefined : sumAll.filter((x) => String(get(x.r, summary.key)) === String(it.value)).length,\n })),\n ]}\n hideUnit\n />\n ) : null;\n // With summary tabs: 「6 / 24 筆」 only while a search or filter keeps fewer rows (「全部 24」 already says how many).\n // Without them: 「24 筆」 on one page, 「6 / 24 筆」 after a search or filter; with pages the range under the table says\n // it. Screen readers always have the count (countText), shown or not.\n const filtered = list.length !== baseCount;\n const showCount = filtered || (!summary && pages <= 1 && !p.loading);\n const countText = p.loading\n ? tr('載入中')\n : filtered\n ? format.fractionLabel(list.length, baseCount, unitOf(baseCount))\n : `${format.number(list.length)} ${unitOf(list.length)}`;\n const toolsView = (inZoom: boolean, inHead = false) => (\n <div className={cx('ui-dt-tools', inHead && 'is-inhead', summaryView && !inZoom && !inHead && 'has-summary', onerow && !inZoom && !inHead && 'is-onerow')}>\n {summaryView && !inZoom && !inHead ? <div className=\"ui-dt-sumwrap\">{summaryView}</div> : null}\n {search === false && p.caption && !inZoom && !inHead ? <div className=\"ui-dt-caption\">{p.caption}</div> : null}\n {search !== false ? (\n <div className=\"ui-dt-search\" onFocus={() => setSearchFocus(true)} onBlur={() => setSearchFocus(false)}>\n <SearchField\n value={q}\n onChange={(v) => {\n setQ(v);\n setPage(0);\n }}\n placeholder={search.placeholder || tr('搜尋')}\n label={search.placeholder || tr('搜尋')}\n aria-keyshortcuts={slashOwner && !inZoom ? '/' : undefined}\n className=\"ui-dt-searchfield\"\n />\n {slashOwner && !inZoom && !narrow && !q && !searchFocus ? (\n <kbd className=\"ui-dt-kbd\" aria-hidden=\"true\">\n /\n </kbd>\n ) : null}\n </div>\n ) : null}\n <div className=\"ui-dt-actions\">\n {filters.length ? (\n <FilterButton\n boundary={inZoom ? zoomRef : rootRef}\n filters={filters}\n values={values}\n activeCount={activeN}\n count={(f, v) => all.filter((x) => passes(x.r, f.key) && matches(f, x.r, f.type === 'list' ? [v] : undefined)).length}\n onChange={(key, v) => setFilter(key, v)}\n onClear={() => {\n setValues({});\n setPage(0);\n }}\n />\n ) : null}\n {showCount ? (\n <span className=\"ui-dt-result\">\n {/* Shown 「6 / 24 筆」; read 「24 筆中的 6 筆」, not 「6 斜線 24 筆」. The shown one is drawn by CSS, so the page's\n text has only the readable one (no 「6 / 24 筆24 筆中的 6 筆」 when copied or read by a tool). */}\n <span aria-hidden=\"true\">\n {filtered\n ? seenOnly(tr('{n} / {total} {unit}', { n: '\\u0001', total: '\\u0002', unit: unitOf(baseCount) }), [\n format.number(list.length),\n format.number(baseCount),\n ])\n : seenOnly(tr('{n} {unit}', { n: '\\u0001', unit: unitOf(list.length) }), [format.number(list.length)])}\n </span>\n <span className=\"ui-visually-hidden\">{countText}</span>\n </span>\n ) : null}\n {sortCols.length ? <SortButton cols={sortCols} levels={sort} max={maxSort} onChange={changeSort} boundary={inZoom ? zoomRef : rootRef} /> : null}\n {narrow ? null : (\n <MoreMenu\n columns={\n p.columnMenu !== false && cols.length > 2\n ? {\n cols,\n hidden,\n onToggle: (k) => setToggled({ ...toggled, [k]: !hidden[k] }),\n onReset: () => {\n setToggled({});\n setWidths(null);\n setZoomWidths(null);\n announce(tr('已還原預設的欄位與欄寬'));\n },\n }\n : undefined\n }\n onCopy={p.copy !== false ? doCopy : undefined}\n onZoom={p.zoom !== false && !inZoom ? () => setZoomed(true) : undefined}\n />\n )}\n {p.action && !inZoom ? <div className=\"ui-dt-primary\">{p.action}</div> : null}\n {copied && !narrow ? (\n <span className=\"ui-dt-copied\" aria-hidden=\"true\">\n <Icon name=\"check\" size={16} />\n {tr('已複製')}\n </span>\n ) : null}\n </div>\n </div>\n );\n // While rows are selected: the count, the bulk actions and 「取消選取」 in a toolbar above the table (not a row of the\n // table: the header row and its column headers stay).\n const bulkView =\n selectable && selIds.length && p.bulkActions ? (\n <div className=\"ui-dt-bulk\" role=\"toolbar\" aria-label={tr('已選 {n} {unit}', { n: selIds.length, unit: unitOf(selIds.length) })}>\n <span className=\"ui-dt-bulk-lead\">\n {/* Phone cards hide the header row and its 「全選」: the bar carries it, in the rows' checkbox column. */}\n {narrow ? <RowCheck v={allOn ? true : mixed ? 'mixed' : false} label={tr('全選')} onClick={() => toggle(visIds, !allOn)} /> : null}\n <span className=\"ui-dt-bulk-count\">\n {monoNums(tr('已選 {n} {unit}', { n: '\\u0001', unit: unitOf(selIds.length) }), [format.number(selIds.length)])}\n </span>\n </span>\n <span className=\"ui-dt-bulk-actions\">{p.bulkActions(selIds, clear)}</span>\n <button type=\"button\" className=\"ui-dt-bulk-close\" aria-label={tr('取消選取')} onClick={clear}>\n <Icon name=\"x\" size={16} />\n </button>\n </div>\n ) : null;\n // loading: rows of the columns' shape, each cell a bar as wide as what it will hold. One row says 「載入中」 to screen\n // readers; the bars are hidden from them.\n const skeletonRows = (grid: React.CSSProperties) => {\n const n = Math.max(1, p.loadingRows ?? Math.min(pageSize, 10));\n const MAIN = ['72%', '56%', '64%', '48%'];\n // Bars as wide as typical content (px), so the hugging columns are measured as when loaded and nothing jumps.\n // relative: as wide as dateTime, since format.relative shows a full date and time from 7 days back.\n const TYPICAL: Record<string, number> = { date: 128, dateTime: 184, datetime: 184, relative: 184, duration: 64, money: 96, percent: 56 };\n const widthOf = (c: DataTableColumn<R>, i: number) =>\n c.key === mainKey\n ? MAIN[i % MAIN.length]\n : c.mobile === 'status'\n ? 64\n : (TYPICAL[c.format ?? ''] ?? (isNum(c) ? 56 : c.mono ? 112 : c.long ? '80%' : '60%'));\n return [\n <div key=\"busy\" role=\"row\" className=\"ui-visually-hidden\">\n <div role=\"cell\">{tr('載入中')}</div>\n </div>,\n ...Array.from({ length: n }, (_, i) => (\n <div key={'skel' + i} aria-hidden=\"true\" className={cx('ui-dt-row ui-dt-skelrow', i % 2 && 'is-even')} style={grid}>\n {expander ? <div className={cx('ui-dt-cell ui-dt-exp', lead('exp').className)} style={lead('exp').style} /> : null}\n {selectable ? <div className={cx('ui-dt-cell ui-dt-sel', lead('sel').className)} style={lead('sel').style} /> : null}\n {shownCols.map((c, ci) => (\n <div key={c.key} data-label={c.label} data-col={c.key} className={cellClass(c, ci, mobileClass(c, ci))} style={stickyStyle(ci)}>\n <Skeleton width={widthOf(c, i)} />\n </div>\n ))}\n </div>\n )),\n ];\n };\n const tableView = (inZoom: boolean) => {\n const grid = inZoom ? zoomGrid : pageGrid;\n const pfx = inZoom ? uid + 'z' : uid;\n return (\n <div className={cx('ui-dt-scroller', scrollMore && !inZoom && 'has-more')}>\n <div className={cx('ui-dt-scroll', pages > 1 && 'is-paged')} ref={inZoom ? undefined : scrollRef} onScroll={inZoom ? undefined : onScroll}>\n <div className=\"ui-dt-table\" role=\"table\" aria-label={p.label || p.caption} aria-busy={p.loading || undefined}>\n {headOf(inZoom)}\n <div ref={inZoom ? undefined : bodyRef} className=\"ui-dt-body\" role=\"rowgroup\">\n {p.loading ? (\n skeletonRows(grid)\n ) : vis.length ? (\n vis.map((x, i) => {\n const id = visIds[i];\n const on = !!sel[id];\n const open = expander && !!opened[id];\n const detailId = `${pfx}-d-${idPart(id)}`;\n const rowName = shownCols[0] ? String(cellText(shownCols[0], get(x.r, shownCols[0].key)) ?? '') : '';\n return (\n <React.Fragment key={id}>\n <div\n data-rid={id}\n ref={\n inZoom\n ? undefined\n : (el) => {\n rowEls.current[id] = el;\n }\n }\n role=\"row\"\n // Named by its first cell (the function name, say), not by every cell and the caret's 「展開 …」.\n aria-labelledby={shownCols.length ? `${pfx}-n-${start + i}` : undefined}\n className={cx(\n 'ui-dt-row',\n i % 2 && 'is-even',\n hasAct && 'has-acts',\n on && 'is-selected',\n selectable && 'has-sel',\n expander && !p.rowHref && 'has-exp',\n p.rowHref && 'has-href',\n )}\n style={grid}\n // EC: a click anywhere on the row opens or closes its details, except on its own controls\n // and when the click ends a text selection. Keyboard users have the caret button. With rowHref\n // the click opens the row's page instead (its first cell's link, or onRowOpen); Ctrl, ⌘,\n // Shift and the middle button open it in a new tab, as on a link.\n onClick={\n expander || p.rowHref\n ? (e) => {\n if (!rowClick(e)) return;\n if (p.rowHref) return openRow(x.r, e);\n setOpened({ ...opened, [id]: !open });\n }\n : undefined\n }\n // Shift + click would select text up to here and the middle button would start autoscroll:\n // neither, so those clicks open the row like a link.\n onMouseDown={\n p.rowHref\n ? (e) => {\n if ((e.shiftKey || e.button === 1) && !(e.target as Element).closest(ROW_CONTROLS)) e.preventDefault();\n }\n : undefined\n }\n onAuxClick={\n p.rowHref\n ? (e) => {\n if (e.button === 1 && rowClick(e)) openRow(x.r, e);\n }\n : undefined\n }\n >\n {expander ? (\n <div className={cx('ui-dt-cell ui-dt-exp', lead('exp').className)} style={lead('exp').style} role=\"cell\">\n <button\n type=\"button\"\n className={cx('ui-dt-exp-btn', open && 'is-open')}\n aria-expanded={open}\n aria-controls={open ? detailId : undefined}\n aria-label={tr(open ? '收合 {name}' : '展開 {name}', { name: rowName })}\n onClick={() => setOpened({ ...opened, [id]: !open })}\n >\n <Icon name=\"caret-right\" size={16} />\n </button>\n </div>\n ) : null}\n {selectable ? (\n <div className={cx('ui-dt-cell ui-dt-sel', lead('sel').className)} style={lead('sel').style} role=\"cell\">\n <RowCheck v={on} label={tr('選取第 {n} 筆', { n: start + i + 1 })} onClick={(e) => pickRow(id, on, e.shiftKey)} />\n </div>\n ) : null}\n {shownCols.map((c, ci) => (\n <div\n key={c.key}\n role=\"cell\"\n id={ci === 0 ? `${pfx}-n-${start + i}` : undefined}\n // fullText: the whole text as the cell's description, not hidden text beside the short one\n // (that put 「ucp.c:62,src/…/ucp.c:62」 in the page's text and the phone card).\n aria-description={[c.fullText?.(x.r), absDate(x.r, c)].filter(Boolean).join(tr(',')) || undefined}\n data-label={c.label}\n data-col={c.key}\n className={cellClass(c, ci, c.long && 'is-long', mobileClass(c, ci))}\n style={stickyStyle(ci)}\n >\n {cell(x.r, c, ci)}\n </div>\n ))}\n {hasAct ? (\n <div className=\"ui-dt-cell ui-dt-acts\" role=\"cell\">\n {p.rowActions?.(x.r)}\n </div>\n ) : null}\n </div>\n {open ? (\n <div id={detailId} role=\"row\" className={cx('ui-dt-detail', i % 2 && 'is-even')} style={{ minWidth: grid.minWidth }}>\n <div role=\"cell\" className=\"ui-dt-detail-cell\" style={{ paddingLeft: EXP + (selectable ? SEL : 0) + 12 }}>\n {longCols.map((c) => (\n <div key={c.key} className=\"ui-dt-detail-item\">\n <div className=\"ui-dt-detail-label\">{c.label}</div>\n <div className=\"ui-dt-detail-text\">{c.fullText ? c.fullText(x.r) : cellInner(x.r, c)}</div>\n </div>\n ))}\n </div>\n </div>\n ) : null}\n </React.Fragment>\n );\n })\n ) : (\n // A row with one cell, so the table keeps the rows its role needs (ARIA table > rowgroup > row).\n <div className=\"ui-dt-emptyrow\" role=\"row\">\n <div className=\"ui-dt-empty\" role=\"cell\">\n {p.emptyText || tr('沒有符合的資料')}\n {q || activeN ? (\n <div>\n <Button onClick={clearFilters}>{tr('清除篩選')}</Button>\n </div>\n ) : null}\n </div>\n </div>\n )}\n </div>\n {p.totals && list.length ? (\n <div className=\"ui-dt-row ui-dt-total\" role=\"row\" style={grid}>\n {expander ? <div className={cx('ui-dt-cell ui-dt-exp', lead('exp').className)} style={lead('exp').style} role=\"cell\" /> : null}\n {selectable ? <div className={cx('ui-dt-cell ui-dt-sel', lead('sel').className)} style={lead('sel').style} role=\"cell\" /> : null}\n {shownCols.map((c, ci) => (\n <div\n key={c.key}\n role=\"cell\"\n className={cellClass(c, ci)}\n style={stickyStyle(ci)}\n data-col={c.key}\n // On a phone the totals row is a summary under the cards: each total as 「label value」.\n data-label={ci > 0 && p.totals?.[c.key] ? c.label : undefined}\n >\n {total(c, ci)}\n </div>\n ))}\n </div>\n ) : null}\n </div>\n </div>\n </div>\n );\n };\n const footView = (\n <>\n {/* One page: the count above the table already says how many rows there are, so no range and no page numbers. */}\n {/* While loading the count is not known yet: no range from the rows of before. */}\n {pages > 1 && !p.loading ? (\n <div className=\"ui-dt-foot\">\n <span className=\"ui-dt-range\">\n {monoNums(tr('第 {a}–{b} {unit},共 {n} {unit}', { a: '\\u0001', b: '\\u0002', n: '\\u0003', unit: unitOf(list.length) }), [\n start + 1,\n Math.min(list.length, start + pageSize),\n format.number(list.length),\n ])}\n </span>\n <nav className=\"ui-dt-pages\" aria-label={tr('分頁')}>\n <button type=\"button\" className=\"ui-dt-page\" aria-label={tr('上一頁')} disabled={pageNow === 0} onClick={() => goPage(pageNow - 1)}>\n ‹\n </button>\n {Array.from({ length: pages }, (_, i) => (\n <button\n key={i}\n type=\"button\"\n className={cx('ui-dt-page', i === pageNow && 'is-on')}\n aria-current={i === pageNow ? 'page' : undefined}\n onClick={() => goPage(i)}\n >\n {String(i + 1)}\n </button>\n ))}\n <button type=\"button\" className=\"ui-dt-page\" aria-label={tr('下一頁')} disabled={pageNow >= pages - 1} onClick={() => goPage(pageNow + 1)}>\n ›\n </button>\n </nav>\n </div>\n ) : null}\n </>\n );\n\n return (\n <div\n ref={rootRef}\n className={cx('ui-dt', search === false && 'is-nosearch', selIds.length && 'has-sel', hasAct && 'has-acts', p.className)}\n style={hasAct ? ({ '--dt-acts-w': (p.actionsWidth ?? actsW ?? 72) + 'px' } as React.CSSProperties) : undefined}\n >\n {p.caption && search !== false ? <div className=\"ui-dt-caption\">{p.caption}</div> : null}\n {p.views ? (\n <div className=\"ui-dt-views\" role=\"tablist\" aria-label={tr('檢視')}>\n {p.views.map((v) => {\n const on = v.id === view;\n const vn = rows.filter((r) => !v.filter || v.filter(r)).length;\n return (\n <button\n key={v.id}\n type=\"button\"\n role=\"tab\"\n aria-selected={on}\n className={cx('ui-dt-view', on && 'is-on')}\n onClick={() => {\n setView(v.id);\n setPage(0);\n }}\n >\n {v.label}{' '}\n <span className=\"ui-dt-view-n\">\n {format.number(vn)}\n <span className=\"ui-visually-hidden\"> {unitOf(vn)}</span>\n </span>\n </button>\n );\n })}\n </div>\n ) : null}\n {/* Measures the text's size (see the measuring effect): its text is drawn by CSS, so it is not in the page's text. */}\n <span className=\"ui-dt-probe\" aria-hidden=\"true\" />\n {summaryView && (headSlot || p.toolbar === false) ? <div className=\"ui-dt-top\">{summaryView}</div> : null}\n {p.toolbar === false ? null : headSlot ? createPortal(toolsView(false, true), headSlot) : toolsView(false)}\n {chipsView(false)}\n {/* The count for screen readers when it is not shown (summary tabs or the page range say it on screen). */}\n {showCount && p.toolbar !== false ? null : <span className=\"ui-visually-hidden\">{countText}</span>}\n {bulkView}\n {tableView(false)}\n <ScrollHint show={overflows} done={scrolled} />\n {footView}\n <TableDialog open={zoomed} onClose={() => setZoomed(false)} title={p.caption || p.label}>\n <div ref={zoomRef} className=\"ui-dt ui-dt-zoomed\">\n {p.toolbar === false ? null : toolsView(true)}\n {chipsView(true)}\n {bulkView}\n {tableView(true)}\n {footView}\n </div>\n </TableDialog>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,aAAaA,qBAAcC,eAASC,SAAG;AAGvC,MAAM,MAAM;AAoGZ,MAAM,OAAO;CAAE,KAAK;CAAK,SAAS;CAAI,MAAM;AAA2B;AACvE,MAAM,SAAsD;CAAE,KAAK;CAAyB,MAAM;CAAyB,MAAM;AAA4B;AAE7J,MAAM,OAAO,KAAU,QAA0B,IAAgC;AAEjF,MAAM,aAAsC,CAAC;AAC7C,MAAM,eAAe,QAAgB;CACnC,MAAM,IAAa,KAAK,MAAM,GAAG;CACjC,IAAI,CAAC,KAAK,OAAO,MAAM,UAAU,MAAM,IAAI,MAAM,eAAe;CAChE,OAAO;AACT;AACA,MAAM,gBAAgB,QAAgB,YAAY,GAAG;AACrD,MAAM,eAAe,QAAgB,YAAY,GAAG;AACpD,MAAM,SAAS,MAA8B,EAAE,WAAW,EAAE,WAAW,WAAW,EAAE,WAAW,aAAa,EAAE,WAAW;AAGzH,MAAM,WAAW,MAA8B,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,UAAU,CAAC,KAAK,EAAE,WAAW;AAEpG,MAAM,eAAe;AAErB,MAAM,YAAY;AAElB,MAAM,eAAe;AAGrB,MAAM,gBAAgB;AACtB,MAAM,gBAAgB;AAGtB,MAAM,WAAW;AAEjB,MAAM,SAAS,GAAS,aACtB,WAAW,GAAG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OAAO,EAAE,WAAW,EAAE;IAChF,UAAA,qBAAC,OAAD;KAAK,KAAK;KAAS,WAAU;KAA7B,UAAA;MACG,EAAE,YAAY,QAAQ,OAAO,UAAU,IAAI;MAC3C,UAAU,IAAI;MACd;MACA,UAAU,IAAI;MACd;KACE;;GACM,CAAA;EACV;;AAET"}
|
|
1
|
+
{"version":3,"file":"DataTable.js","names":["phCaretRight","phCheck","phX"],"sources":["../../../src/components/DataTable/DataTable.tsx"],"sourcesContent":["import * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { Button } from '../Button/Button';\nimport { SearchField } from '../SearchField/SearchField';\nimport { Tabs } from '../Tabs/Tabs';\nimport { format } from '../../format';\nimport { tr, unitFor, type CountUnit } from '../../i18n';\nimport { Icon, type CustomIcon } from '../../icons/Icon';\nimport { TOUCH_ONLY, copyText, cssZoom, cx, idPart, monoNums, reduced, resizeObserver, seenOnly, useMedia, useNarrow } from '../../internal/util';\nimport { Tooltip } from '../Tooltip/Tooltip';\nimport { Skeleton } from '../Skeleton/Skeleton';\nimport { RelativeTime } from '../RelativeTime/RelativeTime';\nimport { DEV, devWarn } from '../../internal/dev';\nimport { useStored } from '../../internal/stored';\nimport { CheckMark } from '../../internal/Field';\nimport { announce } from '../../announce';\nimport { ScrollHint, useScrollHint } from '../../internal/scrollHint';\nimport { ColResize, MIN_COL, TableDialog, markdownTable } from '../../internal/tableTools';\nimport { asDate, cellText, isActive, isDateCol, matches, readSort, readUrl, resolveFilters, searchHit, writeSort, writeUrl, type SortLevel } from './filters';\nimport { FilterButton, FilterChips, FullText, LongText, MoreMenu, markMatch, type FilterChip } from './parts';\nimport { SortButton, dirWord, sortSentence } from './SortButton';\nimport type { DataTableColumn, DataTableFilter, DataTableView, FilterOption, FilterValue, ResolvedFilter, Row, RowKey, Total } from './types';\nimport { includeIcons } from '../../icons/store';\nimport phCaretRight from '../../icons/ph/caret-right';\nimport phCheck from '../../icons/ph/check';\nimport phX from '../../icons/ph/x';\n\nincludeIcons(phCaretRight, phCheck, phX);\n\n// The checkbox column (px): the 22 px box with 9 px on each side.\nconst SEL = 40;\n\nexport type { DataTableColumn, DataTableFilter, DataTableView, FilterOption, FilterValue, RangeValue, Row, RowKey, Total } from './types';\n\nexport interface DataTableProps<R extends Row = Record<string, unknown>> {\n /** The columns, in order; key names a field of the row (checked by TypeScript). */\n columns: DataTableColumn<R>[];\n /** Give each row an `id` so selection and animations follow the row, not its position. */\n rows: R[];\n /** Title above the table, also its accessible name. */\n caption?: string;\n /** Segmented summary above the table: 「全部」 plus one tab per status with its count; picking one filters the rows.\n * `unit` follows every count; default 「筆」. A function gets the count, for plurals in other languages. */\n summary?: { key: RowKey<R>; items: { value: string; label: string }[]; label?: string; unit?: CountUnit };\n /** aria-label when there is no caption. */\n label?: string;\n /** What one row is, after every count (the summary, 「24 筆」, the pages, 「已選 2 筆」): 「個」, 「件」. A function gets\n * the count, for plurals in other languages. Default summary.unit, else 「筆」. */\n unit?: CountUnit;\n /** Data is still loading: the toolbar and header stay, and loadingRows skeleton rows of the columns' shape take the\n * rows' place. Default false. */\n loading?: boolean;\n /** How many skeleton rows loading shows. Default pageSize, at most 10. */\n loadingRows?: number;\n /** Rows per page. Default 10. */\n pageSize?: number;\n /** Change it when the rows become a different data set: search, filters, sort, page, selection and summary reset. */\n resetKey?: string | number;\n /** The page's primary action, one primary Button (「新增」): at the right end of the toolbar, on one row with the\n * summary tabs and the search field when they fit. Use it instead of a Card head that holds only this button. */\n action?: React.ReactNode;\n /** Checkboxes appear when a row is hovered, and on every row once any row is selected; the header's is always shown. */\n selectable?: boolean;\n /** Buttons for the bar that replaces the header while rows are selected. */\n bulkActions?: (ids: string[], clear: () => void) => React.ReactNode;\n /** IconButtons over the row's right end, shown while the row is hovered or has keyboard focus (always on touch\n * screens and phone cards). They take no column of their own. */\n rowActions?: (row: R) => React.ReactNode;\n /** px kept free at the end of each row's last cell for the row actions, so they never cover its content. Default:\n * the width the actions take, measured. */\n actionsWidth?: number;\n /** false: no toolbar row at all (no search, 「篩選」, 「排序」, 「⋯」 or count), for a small table of a few rows that\n * needs none of them. Headings still sort on click. Default true. */\n toolbar?: boolean;\n /** Search box (default on; false hides it). Searches every column unless keys is given. */\n search?: false | { placeholder?: string; keys?: RowKey<R>[] };\n /** Filters in the 「篩選」 popover. */\n filters?: DataTableFilter<R>[];\n /** @deprecated use filters. */\n filter?: { key: RowKey<R>; label?: string; options: FilterOption[] };\n /** 「/」 focuses this table's search field when focus is not in a text field (no Ctrl, Alt or ⌘). Only the first\n * table on the page with a search field takes it; it shows a small 「/」 in the empty field on desktop. Default true. */\n searchShortcut?: boolean;\n /** Each row's page: the first cell's text becomes a link to it, and a click anywhere else on the row (not on its own\n * links, buttons or checkbox, nor a click that ends a text selection) opens it. Like a link, Ctrl, ⌘ or Shift + click\n * and a middle click open it in a new tab. */\n rowHref?: (row: R) => string;\n /** With rowHref: called instead of following the link on a plain click (on the row or its first cell's link), so an\n * app router can push the route. Ctrl, ⌘, Shift and middle clicks still open the href in a new tab. */\n onRowOpen?: (row: R, event: React.MouseEvent) => void;\n /** Write search and filters into the URL. Default true. */\n urlSync?: boolean;\n /** Prefix of the URL parameters when a page has several tables. */\n urlKey?: string;\n /** The sort before anyone changes it, first level first, e.g. [{ key: 'prog' }, { key: 'dt', dir: 'desc' }]. A level\n * without dir starts like a click on its heading: numbers from the largest, text from A. Default: the rows' order. */\n defaultSort?: readonly { key: RowKey<R>; dir?: 'asc' | 'desc' }[];\n /** How many columns can sort at once (the 「排序」 panel, Shift + click on a heading). Default: no limit, every sortable\n * column. */\n maxSort?: number;\n /** Saved views shown as tabs above the table. */\n views?: DataTableView<R>[];\n /** Totals row: 'sum', 'avg' or a function per column key. */\n totals?: Partial<Record<string, Total<R>>>;\n /** Keep the first column visible while scrolling sideways. */\n stickyFirst?: boolean;\n /** 「欄位」 in the 「⋯」 menu, to hide columns. Default true. */\n columnMenu?: boolean;\n /** Remembers the column widths readers drag (the borders in the header) and the columns they hide or show, in\n * localStorage under this name (ui-dt-width:<storageKey>, ui-dt-cols:<storageKey>). Without it they go back to the\n * defaults when the page reloads. resetKey does not clear them: they are the reader's own; 「欄位」 → 「還原預設」 does. */\n storageKey?: string;\n /** @deprecated Renamed `storageKey`, like every other component that remembers a choice; the stored values carry over. */\n widthKey?: string;\n /** 「放大表格」 in the 「⋯」 menu: the whole table, with its search, filters, sort and pages, in a dialog up to\n * 1200 px wide. A click on a link inside closes the dialog. Not on phones. Default true. */\n zoom?: boolean;\n /** 「複製成 Markdown」 in the 「⋯」 menu: every row the search and filters keep (all pages), in the shown columns and\n * order; each cell is the column's fullText, else its searchText, else its value. Default true. */\n copy?: boolean;\n /** Your own text for 「複製成 Markdown」, from the same rows (all pages, sorted). */\n copyText?: (rows: R[]) => string;\n /** Copying failed (the browser does not allow the clipboard): say so, for example in a Toast. */\n onCopyError?: () => void;\n /** Default 「沒有符合的資料」. */\n emptyText?: string;\n /** Extra class on the root element. */\n className?: string;\n}\n\nconst MOVE = { dur: 320, stagger: 25, ease: 'cubic-bezier(.2,.8,.2,1)' };\nconst ARROWS: Record<'asc' | 'desc' | 'none', CustomIcon> = { asc: 'M12 19V5M6 11l6-6 6 6', desc: 'M12 5v14M6 13l6 6 6-6', none: 'M8 9l4-4 4 4M8 15l4 4 4-4' };\n\nconst get = (row: Row, key: string): unknown => (row as Record<string, unknown>)[key];\n// Stored column choices and widths (storageKey): an object, else the default.\nconst NO_TOGGLED: Record<string, boolean> = {};\nconst parseObject = (raw: string) => {\n const v: unknown = JSON.parse(raw);\n if (!v || typeof v !== 'object') throw new Error('not an object');\n return v;\n};\nconst parseToggled = (raw: string) => parseObject(raw) as Record<string, boolean>;\nconst parseWidths = (raw: string) => parseObject(raw) as Record<string, number>;\nconst isNum = (c: DataTableColumn<never>) => c.numeric || c.format === 'money' || c.format === 'percent' || c.format === 'duration';\n// Short by what it holds: numbers, units, dates, durations and status. It hugs its content instead of taking the room\n// left (see widths below). A width is only a least width: it never makes a column short.\nconst isShort = (c: DataTableColumn<never>) => isNum(c) || !!c.unit || isDateCol(c) || c.mobile === 'status';\n// A plain text column that is not the main one hugs its content up to this width (px); longer text wraps.\nconst TEXT_HUG_MAX = 280;\n// Columns sized by props only, before the first measure (px).\nconst HUG_START = 96;\n// A plain text column that hugs its content is at least this wide (px, 8 em), so a short name does not look cramped.\nconst TEXT_HUG_MIN = 128;\n// What the main column and long columns ask for before the room left is shared (px): their content on one line, up\n// to these. They get it only while every column fits; otherwise they share what is left and long text is cut.\nconst MAIN_WANT_MAX = 320;\nconst LONG_WANT_MAX = 512;\n// The summary tabs, the search field (at least this wide, px) and the buttons share one row when all fit.\nconst SEARCH_MIN = 240;\nconst TOOL_GAP = 8;\n// <time dateTime>: a date alone for 'date', the moment for the others.\nconst isoOf = (d: Date, dateOnly: boolean) =>\n dateOnly ? `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}` : d.toISOString();\n\n/** The width of what an element holds (its text and children, not absolutely placed parts such as the column border).\n * Null where text cannot be measured (jsdom has no Range#getBoundingClientRect): the column keeps its default width. */\nfunction contentWidth(el: Element): number | null {\n let left = Infinity;\n let right = -Infinity;\n const range = document.createRange();\n if (typeof range.getBoundingClientRect !== 'function') return null;\n for (const n of el.childNodes) {\n let r: DOMRect | null = null;\n if (n instanceof HTMLElement) {\n if (n.classList.contains('ui-col-resize') || getComputedStyle(n).position === 'absolute') continue;\n r = n.getBoundingClientRect();\n } else if (n.nodeType === Node.TEXT_NODE && n.textContent?.trim()) {\n range.selectNodeContents(n);\n r = range.getBoundingClientRect();\n }\n if (r && r.width) {\n left = Math.min(left, r.left);\n right = Math.max(right, r.right);\n }\n }\n return right > left ? (right - left) / cssZoom(el) : 0;\n}\n\n// 「/」 focuses the search field of the first table on the page that has one (in page order) and that is shown: a table\n// in a hidden tab panel, a closed drawer or behind a modal does not take it. One listener for all.\nconst shortcutTables = new Set<HTMLElement>();\nconst shortcutListeners = new Set<() => void>();\n// Tables hidden or shown later (a tab panel switched, a drawer opened) change size, so the 「/」 hint moves with them.\nlet shortcutSizes: ResizeObserver | null = null;\nconst notifyShortcut = () => shortcutListeners.forEach((f) => f());\ntype Visible = { checkVisibility?: (o?: Record<string, boolean>) => boolean };\n/** Rendered and not hidden: not display: none (itself or an ancestor), not visibility: hidden, not inert or aria-hidden. */\nfunction isShown(el: HTMLElement): boolean {\n if (!el.isConnected || el.closest('[inert], [aria-hidden=\"true\"]')) return false;\n const check = (el as HTMLElement & Visible).checkVisibility;\n if (typeof check === 'function') return check.call(el, { checkVisibilityCSS: true, visibilityProperty: true });\n return el.getClientRects().length > 0 && getComputedStyle(el).visibility !== 'hidden';\n}\nconst shortcutInput = (el: HTMLElement) => el.querySelector<HTMLInputElement>(':scope > .ui-dt-tools .ui-dt-search input');\nconst firstShortcutTable = (): HTMLElement | null =>\n [...shortcutTables]\n .filter((el) => isShown(el) && !!shortcutInput(el))\n .sort((a, b) => (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1))[0] ?? null;\n// Where 「/」 is typed text or a key of the widget itself: fields, lists, grids, menus and dialogs keep it.\nconst SLASH_OWNERS =\n 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"]), [role=\"textbox\"], [role=\"searchbox\"], [role=\"combobox\"], [role=\"listbox\"], [role=\"grid\"], [role=\"treegrid\"], [role=\"tree\"], [role=\"menu\"], [role=\"menubar\"], [role=\"dialog\"], [role=\"alertdialog\"], dialog';\nfunction onSlash(e: KeyboardEvent) {\n if (e.key !== '/' || e.ctrlKey || e.metaKey || e.altKey || e.defaultPrevented || e.isComposing) return;\n const t = e.target instanceof Element ? e.target : null;\n if (t?.closest(SLASH_OWNERS)) return;\n const table = firstShortcutTable();\n const input = table ? shortcutInput(table) : null;\n if (!input) return;\n input.focus();\n // Only when the field took the focus: otherwise the key does what it would have done.\n if (document.activeElement === input) e.preventDefault();\n}\nfunction registerShortcut(el: HTMLElement, changed: () => void): () => void {\n if (!shortcutTables.size) document.addEventListener('keydown', onSlash);\n if (!shortcutSizes && typeof ResizeObserver !== 'undefined') shortcutSizes = new ResizeObserver(notifyShortcut);\n shortcutTables.add(el);\n shortcutListeners.add(changed);\n shortcutSizes?.observe(el);\n notifyShortcut();\n return () => {\n shortcutTables.delete(el);\n shortcutListeners.delete(changed);\n shortcutSizes?.unobserve(el);\n if (!shortcutTables.size) {\n document.removeEventListener('keydown', onSlash);\n shortcutSizes?.disconnect();\n shortcutSizes = null;\n }\n notifyShortcut();\n };\n}\n\n// Ctrl, ⌘, Shift or the middle button: a link opens in a new tab or window.\nconst newTab = (e: React.MouseEvent) => e.ctrlKey || e.metaKey || e.shiftKey || e.button === 1;\n\n// What a row click leaves alone: links, buttons, fields, checkboxes and anything else that acts on its own.\nconst ROW_CONTROLS = 'a, button, input, select, textarea, label, [role=\"checkbox\"], [role=\"button\"], [role=\"menuitem\"], [role=\"link\"], [contenteditable]';\n\nfunction RowCheck({ v, label, onClick }: { v: boolean | 'mixed'; label: string; onClick: (e: React.MouseEvent) => void }) {\n return (\n <button\n type=\"button\"\n role=\"checkbox\"\n aria-checked={v}\n aria-label={label}\n className={cx('ui-check-box', 'ui-dt-check', v && 'is-on')}\n // Shift + click picks a range: no text selection from it.\n onMouseDown={(e) => e.shiftKey && e.preventDefault()}\n onClick={(e) => {\n e.stopPropagation();\n onClick(e);\n }}\n >\n <CheckMark v={v} />\n </button>\n );\n}\n\ninterface Measured {\n fit: Record<string, number>;\n clipped: boolean | null;\n want: Record<string, number>;\n roomy: boolean;\n actsW: number | null;\n onerow: boolean;\n}\nconst UNMEASURED: Measured = { fit: {}, clipped: null, want: {}, roomy: false, actsW: null, onerow: false };\n\n/** A date with its time, 「2026/11/18(三)04:51」: the date and the time each stay whole, and a phone card that has no\n * room for both breaks the line between them only. Text without 「)」 (other locales, 「2 小時前」) as it is. */\nfunction dateParts(text: string, mark: string): React.ReactNode {\n const i = text.indexOf(')');\n if (i < 0 || i === text.length - 1) return markMatch(text, mark);\n return (\n <>\n <span className=\"ui-dt-nowrap\">{markMatch(text.slice(0, i + 1), mark)}</span>\n <wbr />\n <span className=\"ui-dt-nowrap\">{markMatch(text.slice(i + 1), mark)}</span>\n </>\n );\n}\n\n/** The value from the render where sig last changed: a new array that says the same thing keeps the old one, so memos\n * that depend on it do not run again. */\nfunction useSameWhile<T>(value: T, sig: string): T {\n const [kept, setKept] = React.useState({ value, sig });\n if (kept.sig !== sig) {\n setKept({ value, sig });\n return value;\n }\n return kept.value;\n}\n\n/** What the columns say, as text: changes when a key, label or format changes, not when the array is rebuilt. */\nfunction columnsSig(cols: readonly DataTableColumn<never>[]): string {\n return cols\n .map((c) =>\n [c.key, c.label, c.format, c.numeric, c.mono, c.unit, c.currency, c.decimals, c.sortable, !!c.sortValue, !!c.searchText, !!c.render].join('\\u0002'),\n )\n .join('\\u0001');\n}\n/** The same for the filters: keys, labels, types and options; a match function counts only by being there. */\nfunction filtersSigOf(fs: readonly DataTableFilter<never>[] | undefined, f: { key: string; label?: string; options: FilterOption[] } | undefined): string {\n return JSON.stringify([fs?.map((x) => [x.key, x.label, x.type, x.multiple, x.scale, x.unitLabel, x.options, !!x.match]), f]);\n}\n\ninterface Snapshot {\n kind: 'sort' | 'next' | 'prev';\n rows: Record<string, { top: number; bg: string; node: HTMLElement }>;\n order: string[];\n}\n\n/** The table for records: sort, search, filters, page numbers, selection with a bulk bar, row actions; cards on phones. */\nexport function DataTable<R extends Row = Record<string, unknown>>(p: DataTableProps<R>) {\n const { columns: cols, rows, pageSize = 10, urlSync = true, urlKey, search = {}, selectable = false, stickyFirst: sticky = false } = p;\n // Columns, filters and views are often written inline (a new array every render): the memos below follow what they\n // say (keys, formats, options), read through refs, not the arrays' identity, so a render does not sort and filter again.\n const memoCols = useSameWhile(cols, columnsSig(cols));\n const given = useSameWhile({ filters: p.filters, filter: p.filter }, filtersSigOf(p.filters, p.filter));\n const filters: ResolvedFilter<R>[] = React.useMemo(() => {\n const list = given.filters ? [...given.filters] : [];\n const f = given.filter;\n if (f && !list.length) list.push({ key: f.key, label: f.label || memoCols.find((c) => c.key === f.key)?.label || f.key, options: f.options });\n return resolveFilters(list, rows);\n }, [given, memoCols, rows]);\n const countUnit: CountUnit = p.unit ?? p.summary?.unit ?? '筆';\n const unitOf = (n: number) => unitFor(countUnit, n);\n const fromUrl = () => (urlSync && typeof location !== 'undefined' ? readUrl(urlKey, filters) : { q: '', values: {} });\n const maxSort = Math.max(1, p.maxSort ?? Infinity);\n const sortCols = cols.filter((c) => c.sortable !== false).map((c) => ({ key: c.key, label: c.label, numeric: isNum(c) }));\n const firstDir = (key: string): SortLevel['dir'] => (sortCols.find((c) => c.key === key)?.numeric ? 'desc' : 'asc');\n // Only sortable columns, each once, at most maxSort.\n const validSort = (l: readonly { key: string; dir?: SortLevel['dir'] }[]): SortLevel[] =>\n l\n .filter((x, i) => sortCols.some((c) => c.key === x.key) && l.findIndex((y) => y.key === x.key) === i)\n .slice(0, maxSort)\n .map((x) => ({ key: x.key, dir: x.dir ?? firstDir(x.key) }));\n const initialSort = validSort(p.defaultSort ?? []);\n const [sort, setSort] = React.useState<SortLevel[]>(() => validSort((urlSync && typeof location !== 'undefined' ? readSort(urlKey) : null) ?? initialSort));\n const [page, setPage] = React.useState(0);\n const [q, setQ] = React.useState(() => fromUrl().q);\n const [values, setValues] = React.useState<Record<string, FilterValue>>(() => fromUrl().values);\n const [view, setView] = React.useState(p.views?.[0]?.id ?? null);\n // Columns people turned on or off in the 「欄位」 menu; the others follow their own `hidden`. Remembered under storageKey.\n const storageKey = p.storageKey ?? p.widthKey;\n const colsKey = storageKey ? 'ui-dt-cols:' + storageKey : null;\n // None on the server and the first browser render, then the stored choice (useStored); an empty choice is removed.\n const [toggled, setToggled] = useStored<Record<string, boolean>>(colsKey ?? undefined, parseToggled, NO_TOGGLED, (t) =>\n Object.keys(t).length ? JSON.stringify(t) : null,\n );\n // Rows opened with the caret on the left: their long columns in full, below the row.\n const [opened, setOpened] = React.useState<Record<string, boolean>>({});\n const narrow = useNarrow();\n const touch = useMedia(TOUCH_ONLY);\n const uid = React.useId();\n const rootRef = React.useRef<HTMLDivElement>(null);\n const [sel, setSel] = React.useState<Record<string, boolean>>({});\n const [sumVal, setSumVal] = React.useState('all');\n // What the measuring effect reads from the drawn table, in one state so one measure is one render (see below).\n const [measured, setMeasured] = React.useState<Measured>(UNMEASURED);\n // fit: widths (px) that columns grew to so content that cannot wrap is not cut. clipped: whether a long cell on the\n // page is cut at its column's edge (desktop; null until measured). want, roomy: what the main and long columns ask for\n // (px), and whether every column gets it. actsW: the row actions' width (px), kept free at the end of the last cell.\n // onerow: the summary tabs, the search field and the buttons fit on one row.\n const { fit, clipped, want, roomy, actsW, onerow: onerowState } = measured;\n const wantRef = React.useRef(want);\n // A2: widths readers dragged (px per column key); null = width and grow decide. Remembered under storageKey.\n const [widths, setWidths] = useStored<Record<string, number> | null>(storageKey ? 'ui-dt-width:' + storageKey : undefined, parseWidths, null);\n // In the 「放大表格」 dialog: open, and the widths dragged there (not kept; the page's widths stay).\n const [zoomed, setZoomed] = React.useState(false);\n const [zoomWidths, setZoomWidths] = React.useState<Record<string, number> | null>(null);\n const zoomRef = React.useRef<HTMLDivElement>(null);\n // Without a search field, a table right under a Card's title puts its tools in that title row instead of a row of\n // their own: the Card's head element, found after the first render.\n const [headSlot, setHeadSlot] = React.useState<HTMLElement | null>(null);\n const noSearch = search === false && !p.caption;\n React.useLayoutEffect(() => {\n const prev = noSearch ? rootRef.current?.previousElementSibling : null;\n setHeadSlot(prev instanceof HTMLElement && prev.classList.contains('ui-card-head') && prev.parentElement?.classList.contains('ui-card') ? prev : null);\n }, [noSearch]);\n // A Card head with only buttons above the table (the old way to place 「新增」) leaves a row of its own for one button.\n React.useEffect(() => {\n const prev = rootRef.current?.previousElementSibling;\n devWarn(\n prev?.classList.contains('ui-card-head') && !prev.querySelector('.ui-card-title') && prev.querySelector('.ui-card-actions'),\n 'DataTable',\n \"the Card around this table has actions but no title, so its one button takes a row of its own above the table. Pass the page's primary action to DataTable's action instead: it goes at the right end of the toolbar.\",\n );\n }, []);\n const [resetKey, setResetKey] = React.useState(p.resetKey);\n const resetting = resetKey !== p.resetKey;\n if (resetting) {\n setResetKey(p.resetKey);\n setQ('');\n setValues({});\n setPage(0);\n setSel({});\n setSumVal('all');\n setSort(initialSort);\n // Remembered columns (storageKey) are the reader's own, like the widths: a new data set keeps them.\n if (!colsKey) setToggled({});\n setOpened({});\n setMeasured((m) => ({ ...m, fit: {}, want: {}, clipped: null }));\n }\n const valuesKey = JSON.stringify(values);\n const sortKey = JSON.stringify(sort);\n React.useEffect(() => {\n if (urlSync && typeof location !== 'undefined') writeSort(urlKey, sort, initialSort);\n // eslint-disable-next-line react-hooks/exhaustive-deps -- written when the sort changes\n }, [sortKey]);\n React.useEffect(() => {\n if (urlSync && filters.length) writeUrl(urlKey, filters, values, q);\n // eslint-disable-next-line react-hooks/exhaustive-deps -- written when the conditions change, not when the filter list is rebuilt\n }, [valuesKey, q]);\n devWarn(\n p.widthKey !== undefined,\n 'DataTable',\n '`widthKey` is deprecated: rename it to `storageKey`, as in every other component that remembers a choice. The stored widths and columns carry over.',\n );\n devWarn(\n () => cols.some((c) => c.format === 'percent' && !c.unit),\n 'DataTable',\n \"format: 'percent' sets 1 decimal and shows no % sign; add unit: '%' to that column.\",\n );\n devWarn(\n () => rows.length > 1 && rows.every((r) => get(r, 'id') == null) && selectable,\n 'DataTable',\n 'rows have no id, so a selection follows the position, not the row. Add an id to each row.',\n );\n\n devWarn(\n () => cols.some((c) => c.format === 'datetime'),\n 'DataTable',\n \"format: 'datetime' is the old spelling, kept for now. Write format: 'dateTime', as format.dateTime().\",\n );\n devWarn(!!cols[0]?.hidden, 'DataTable', 'the first column is always shown, so its hidden: true does nothing. Move the column, or drop hidden.');\n devWarn(\n () => (p.columnMenu === false || cols.length <= 2) && cols.some((c, i) => i > 0 && c.hidden),\n 'DataTable',\n 'a column has hidden: true but there is no 「欄位」 menu (columnMenu is false, or the table has 2 columns or fewer), so nobody can turn it on. Turn the menu on, or leave the column out.',\n );\n // One condition in one place: a status the summary tabs pick should not be a filter or a view as well.\n const sumKey = p.summary?.key;\n if (DEV) {\n const twiceFilter = sumKey ? filters.find((f) => f.key === sumKey) : undefined;\n devWarn(\n twiceFilter,\n 'DataTable',\n `the filter 「${twiceFilter?.label}」 filters ${String(sumKey)}, which the summary tabs already filter, so the same condition is in two places. Drop it from filters (or drop summary).`,\n );\n // A view filters the same key when the rows it keeps are exactly the rows of one summary value.\n const twiceView =\n sumKey && rows.length\n ? p.views?.find((v) => {\n if (!v.filter) return false;\n const kept = rows.filter((r) => v.filter?.(r));\n if (!kept.length || kept.length === rows.length) return false;\n const val = String(get(kept[0], sumKey));\n return kept.every((r) => String(get(r, sumKey)) === val) && rows.filter((r) => String(get(r, sumKey)) === val).length === kept.length;\n })\n : undefined;\n devWarn(\n twiceView,\n 'DataTable',\n `the view 「${twiceView?.label}」 keeps exactly the rows of one ${String(sumKey)} value, which a summary tab already picks, so the same condition is in two places. Drop the view (or drop summary).`,\n );\n // A number with its unit baked into a string cannot be formatted, aligned or sorted as a number.\n for (const c of cols) {\n if (!c.unit && !c.numeric) continue;\n const bad = rows\n .map((r) => get(r, c.key))\n .find((v) => typeof v === 'string' && /\\d/.test(v) && (c.unit ? v.includes(c.unit) : !/^\\s*-?[\\d,]*\\.?\\d+\\s*$/.test(v)));\n devWarn(\n bad !== undefined,\n 'DataTable',\n `column 「${c.label}」 got the string 「${String(bad)}」. Pass a number${c.unit ? '' : ' and the unit in unit'} (e.g. { numeric: true, unit: '${c.unit || 'items'}' } with 1234), so it is formatted, right-aligned and sorted as a number.`,\n );\n }\n }\n const hidden: Record<string, boolean> = {};\n cols.forEach((c, i) => (hidden[c.key] = i > 0 && (toggled[c.key] ?? !!c.hidden)));\n const shownCols = cols.filter((c) => !hidden[c.key]);\n const { ref: scrollRef, more: scrollMore, overflows, scrolled, onScroll } = useScrollHint();\n const bodyRef = React.useRef<HTMLDivElement>(null);\n const rowEls = React.useRef<Record<string, HTMLDivElement | null>>({});\n const snap = React.useRef<Snapshot | null>(null);\n\n const summary = p.summary;\n const searching = search !== false && !!q;\n const searchKeys = search ? search.keys : undefined;\n // Read by the memo below as a string, so a new keys array with the same keys does not search again.\n const searchKeysKey = searchKeys ? searchKeys.join('\\u0001') : null;\n const passes = (r: R, skip?: string) =>\n (!searching || searchHit(r, cols, filters, q, searchKeys)) && filters.every((f) => f.key === skip || matches(f, r, values[f.key]));\n // View, summary, search, filters and sort run again only when one of them or the rows change, not on every render\n // (a hover, a selection, a measured width).\n const views = useSameWhile(p.views, p.views ? p.views.map((v) => v.id + '\\u0002' + !!v.filter).join('\\u0001') : '');\n const { all, sumAll, list } = React.useMemo(() => {\n const cols = memoCols;\n let all = rows.map((r, i) => ({ r, i }));\n const viewObj = views?.find((v) => v.id === view);\n if (viewObj?.filter) all = all.filter((x) => viewObj.filter?.(x.r));\n const sumAll = all;\n if (sumKey && sumVal !== 'all') all = all.filter((x) => String(get(x.r, sumKey)) === sumVal);\n const keys = searchKeysKey === null ? undefined : (searchKeysKey.split('\\u0001') as RowKey<R>[]);\n const hit = (r: R) => (!searching || searchHit(r, cols, filters, q, keys)) && filters.every((f) => matches(f, r, values[f.key]));\n let list = all.filter((x) => hit(x.r));\n if (sort.length) {\n // The first level decides; the next only between rows the first finds equal; then the rows' own order.\n const by = sort.map((l) => {\n const col = cols.find((c) => c.key === l.key);\n // Dates by time (an ISO string or a Date), not by their text.\n const val = (r: R): unknown => {\n if (col?.sortValue) return col.sortValue(r);\n const v = get(r, l.key);\n if (v instanceof Date || (col && isDateCol(col))) return asDate(v)?.getTime() ?? -Infinity;\n return v;\n };\n return { val, d: l.dir === 'asc' ? 1 : -1 };\n });\n list = [...list].sort((a, b) => {\n for (const { val, d } of by) {\n const x = val(a.r);\n const y = val(b.r);\n const c = typeof x === 'number' && typeof y === 'number' ? x - y : String(x).localeCompare(String(y), 'zh-Hant');\n if (c) return c * d;\n }\n return a.i - b.i;\n });\n }\n return { all, sumAll, list };\n }, [rows, memoCols, filters, values, q, searching, searchKeysKey, sort, view, views, sumKey, sumVal]);\n const baseCount = all.length;\n const activeN = filters.filter((f) => isActive(values[f.key])).length;\n // After the search, a filter, the summary or the view changes (not on first render): 「顯示 6 筆」.\n const shownKey = `${q}|${valuesKey}|${sumVal}|${view}`;\n const firstKey = React.useRef(shownKey);\n const shownN = list.length;\n const shownText = tr('顯示 {n} {unit}', { n: format.number(shownN), unit: unitOf(shownN) });\n React.useEffect(() => {\n if (shownKey === firstKey.current) return;\n firstKey.current = '';\n const t = setTimeout(() => announce(shownText), 400);\n return () => clearTimeout(t);\n }, [shownKey, shownText]);\n const pages = Math.max(1, Math.ceil(list.length / pageSize));\n const pageNow = Math.min(page, pages - 1);\n const start = pageNow * pageSize;\n const vis = React.useMemo(() => list.slice(start, start + pageSize), [list, start, pageSize]);\n const idOf = (x: { r: R; i: number }) => {\n const id = get(x.r, 'id');\n return id != null ? String(id) : String(x.i);\n };\n // Only rows the filters, search, view and summary still show (any page) stay selected: rows filtered out or\n // deleted are unchecked, so bulkActions acts only on what the person can see.\n const present = new Set(list.map(idOf));\n const selIds = Object.keys(sel).filter((k) => sel[k] && present.has(k));\n // Skipped while resetting: the reset above already cleared the selection, and this call would win over it.\n if (!resetting && Object.keys(sel).some((k) => sel[k] && !present.has(k))) setSel(Object.fromEntries(selIds.map((k) => [k, true])));\n const visIds = vis.map(idOf);\n const selVis = visIds.filter((id) => sel[id]).length;\n const allOn = visIds.length > 0 && selVis === visIds.length;\n const mixed = selVis > 0 && !allOn;\n\n // Remember where every row is; the layout effect then animates from there (FLIP).\n const capture = (kind: Snapshot['kind']) => {\n const body = bodyRef.current;\n if (!body) return;\n const top0 = body.getBoundingClientRect().top;\n const snapRows: Snapshot['rows'] = {};\n const order: string[] = [];\n for (const id of visIds) {\n const el = rowEls.current[id];\n if (!el) continue;\n snapRows[id] = { top: el.getBoundingClientRect().top - top0, bg: getComputedStyle(el).backgroundColor, node: el };\n order.push(id);\n }\n snap.current = { kind, rows: snapRows, order };\n };\n React.useLayoutEffect(() => {\n const sn = snap.current;\n snap.current = null;\n const body = bodyRef.current;\n if (!sn || !body || reduced() || typeof Element.prototype.animate !== 'function') return;\n const top0 = body.getBoundingClientRect().top;\n const n = Math.max(sn.order.length, visIds.length);\n let k = 0;\n let rh = 48;\n visIds.forEach((id, i) => {\n const el = rowEls.current[id];\n if (!el) return;\n const r = el.getBoundingClientRect();\n rh = r.height || rh;\n const old = sn.rows[id];\n const timing = { duration: MOVE.dur, delay: i * MOVE.stagger, easing: MOVE.ease, fill: 'backwards' as const };\n if (old) {\n const from = old.top - (r.top - top0);\n el.animate(\n [\n { transform: `translateY(${from}px)`, backgroundColor: old.bg },\n { transform: 'none', backgroundColor: getComputedStyle(el).backgroundColor },\n ],\n timing,\n );\n } else {\n const off = sn.kind === 'next' ? n : sn.kind === 'prev' ? -n : n + k - i;\n k++;\n el.animate(\n [\n { transform: `translateY(${off * rh}px)`, opacity: 0 },\n { transform: 'none', opacity: 1 },\n ],\n timing,\n );\n }\n });\n // Rows that left the page: animate a copy out.\n sn.order.forEach((id, j) => {\n if (visIds.includes(id)) return;\n const o = sn.rows[id];\n const ghost = o.node.cloneNode(true) as HTMLElement;\n ghost.removeAttribute('data-rid');\n ghost.setAttribute('aria-hidden', 'true');\n // A picture of the leaving row only: nothing in it takes focus or repeats an id of the live table.\n ghost.inert = true;\n for (const el of ghost.querySelectorAll<HTMLElement>('a[href], button, input, select, textarea, [tabindex]')) el.tabIndex = -1;\n for (const el of [ghost, ...ghost.querySelectorAll<HTMLElement>('[id]')]) el.removeAttribute('id');\n ghost.classList.add('ui-dt-ghost');\n ghost.style.top = o.top + 'px';\n ghost.style.backgroundColor = o.bg;\n body.appendChild(ghost);\n const to = sn.kind === 'next' ? -n : sn.kind === 'prev' ? n : n + 1 - j;\n // Clipped to the table body while copies leave (is-leaving): they never draw below the table or its Card.\n body.classList.add('is-leaving');\n ghost.animate(\n [\n { transform: 'none', opacity: 1 },\n { transform: `translateY(${to * rh}px)`, opacity: 0 },\n ],\n { duration: MOVE.dur, easing: MOVE.ease, fill: 'forwards' },\n ).onfinish = () => {\n ghost.remove();\n if (!body.querySelector(':scope > .ui-dt-ghost')) body.classList.remove('is-leaving');\n };\n });\n });\n\n const changeSort = (next: SortLevel[]) => {\n capture('sort');\n setSort(next);\n announce(sortSentence(next, sortCols));\n };\n // A click sorts by this column alone: first click from A (numbers from the largest), second reversed, third back\n // to the rows' order. Shift + click (add) makes it the next level instead: added, reversed, removed.\n const sortBy = (c: DataTableColumn<R>, add = false) => {\n if (c.sortable === false) return;\n const first = firstDir(c.key);\n const flip = first === 'asc' ? 'desc' : 'asc';\n const i = sort.findIndex((l) => l.key === c.key);\n if (add) {\n if (i < 0) {\n if (sort.length < maxSort) changeSort([...sort, { key: c.key, dir: first }]);\n else announce(tr('最多 {n} 層排序。', { n: maxSort }));\n } else if (sort[i].dir === first) changeSort(sort.map((l, j) => (j === i ? { key: l.key, dir: flip } : l)));\n else changeSort(sort.filter((_, j) => j !== i));\n return;\n }\n if (sort.length !== 1 || i !== 0) changeSort([{ key: c.key, dir: first }]);\n else if (sort[0].dir === first) changeSort([{ key: c.key, dir: flip }]);\n else changeSort([]);\n };\n const goPage = (n: number) => {\n if (n === pageNow || n < 0 || n >= pages) return;\n capture(n > pageNow ? 'next' : 'prev');\n setPage(n);\n };\n const toggle = (ids: string[], v: boolean) => setSel({ ...sel, ...Object.fromEntries(ids.map((id) => [id, v])) });\n const clear = () => setSel({});\n // Shift + click on a row's checkbox: every row from the last one clicked to this one (in the shown order, any page)\n // takes this one's new state. Only rows the search, filters, view and summary keep, in the current sort.\n const lastPick = React.useRef<string | null>(null);\n // A new search, filter, summary tab, view, sort or page size changes which rows lie between two clicks: the range\n // starts again from the next click.\n const anchorKey = `${shownKey}|${sortKey}|${pageSize}`;\n React.useEffect(() => {\n lastPick.current = null;\n }, [anchorKey]);\n const pickRow = (id: string, on: boolean, shift: boolean) => {\n const ids = list.map(idOf);\n const from = shift && lastPick.current ? ids.indexOf(lastPick.current) : -1;\n const to = ids.indexOf(id);\n lastPick.current = id;\n if (from < 0 || to < 0 || from === to) return toggle([id], !on);\n const next = { ...sel, ...Object.fromEntries(ids.slice(Math.min(from, to), Math.max(from, to) + 1).map((k) => [k, !on])) };\n setSel(next);\n const n = ids.filter((k) => next[k]).length;\n announce(tr('已選 {n} {unit}', { n, unit: unitOf(n) }));\n };\n const clearFilters = () => {\n setValues({});\n setQ('');\n setPage(0);\n };\n\n const hasAct = !!p.rowActions;\n const onerow = onerowState && !narrow;\n const hasTitle = shownCols.some((c) => c.mobile === 'title');\n const mobileClass = (c: DataTableColumn<R>, ci: number) => {\n const m = c.mobile || (ci === titleIdx() ? 'title' : null);\n return m ? 'is-m-' + m : null;\n };\n // A caret on the left of each row when there are long columns (desktop; phone cards have 「顯示全部」).\n // Columns whose whole text the row's details show: long ones, and short ones with fullText.\n const longCols = shownCols.filter((c) => c.long || c.fullText);\n // A long column only needs the caret while a cell on the page is cut (measured below; null until measured, and where\n // layout cannot be measured). fullText always says more than the cell, so it keeps the caret. An open row keeps it.\n const expander = longCols.length > 0 && !narrow && (clipped !== false || longCols.some((c) => c.fullText) || visIds.some((id) => opened[id]));\n const EXP = 40;\n // Widths by default. The main column (the first text column) and long ones take the room left; the others hug their\n // content: numbers, units, dates, durations, status Badges and other short text. A width is a least width for any\n // column and never decides which column is the main one. A grow prop wins either way. Hugging columns are measured below (their heading and every cell on the page, widest wins).\n // A mono column (an ID, a hash) is never the main one: without another text column, none takes the room left.\n const mainKey = shownCols.find((c) => !isShort(c) && !c.long && !c.mono && c.grow !== 0)?.key;\n // The phone card's title: the first column; when that is a mono ID and the table has a main column (a text column\n // that is not mono, long or short), the main column, and the ID becomes a field of the card.\n const titleIdx = () => {\n if (hasTitle) return -1;\n if (!shownCols[0]?.mono) return 0;\n const main = shownCols.findIndex((c) => c.key === mainKey && !c.mobile);\n return main < 0 ? 0 : main;\n };\n const grows = (c: DataTableColumn<R>) => (c.grow != null ? c.grow > 0 : c.long || c.key === mainKey);\n // A column is at least as wide as content that cannot wrap (a code chip, a link with a path): measured below.\n const minOf = (c: DataTableColumn<R>) => {\n if (grows(c)) return Math.max(c.width || (isNum(c) ? 96 : 120), fit[c.key] || 0, roomy ? want[c.key] || 0 : 0);\n const text = c.width == null && !isShort(c);\n const cap = text ? TEXT_HUG_MAX : Infinity;\n return Math.max(c.width || 0, MIN_COL, text ? TEXT_HUG_MIN : 0, Math.min(fit[c.key] ?? c.width ?? HUG_START, cap));\n };\n // Dragged widths (A2) fix every shown column in px; a column shown later starts at its least width.\n const layout = (w: Record<string, number> | null) => {\n const colW = (c: DataTableColumn<R>) => (w ? `${w[c.key] ?? minOf(c)}px` : grows(c) ? `minmax(${minOf(c)}px, ${c.grow || 1}fr)` : `${minOf(c)}px`);\n // Row actions take no column: they show over the row's end (see .ui-dt-acts). On touch screens, where they always\n // show, the rows keep --dt-acts-w free at their end instead.\n const template = [expander ? EXP + 'px' : null, selectable ? SEL + 'px' : null, ...shownCols.map(colW)].filter(Boolean).join(' ');\n const minW = (expander ? EXP : 0) + (selectable ? SEL : 0) + shownCols.reduce((a, c) => a + (w ? (w[c.key] ?? minOf(c)) : minOf(c)), 0);\n return { gridTemplateColumns: template, minWidth: minW };\n };\n const pageGrid = layout(widths);\n const zoomGrid = layout(zoomWidths);\n // The drawn width of each shown column (px), read from its header cell: where a first drag starts.\n const drawn = (root: HTMLElement | null) => {\n const out: Record<string, number> = {};\n for (const c of shownCols) {\n const el = root?.querySelector<HTMLElement>(`.ui-dt-head [data-col=\"${CSS.escape(c.key)}\"]`);\n out[c.key] = el ? Math.ceil(el.getBoundingClientRect().width) : minOf(c);\n }\n return out;\n };\n // A column is never narrower than its heading and sort arrow (headings do not wrap), nor than 48 px.\n const headMin = (root: HTMLElement | null, key: string) => {\n const el = root?.querySelector<HTMLElement>(`.ui-dt-head [data-col=\"${CSS.escape(key)}\"] > :first-child`);\n return Math.max(MIN_COL, el ? Math.ceil(el.getBoundingClientRect().width) + 24 : MIN_COL);\n };\n // Desktop rows: a cell whose content cannot wrap and is wider than the cell (InlineCode, a path) widens its column\n // instead of being cut. Long columns truncate on purpose and are left alone. Widths only grow, until resetKey.\n // Hugging columns take the widest of their heading, every cell on the page and the totals row, each read on one line\n // from its content's own boxes (not scrollWidth, which misses text that overflows to the left of a right-aligned cell).\n // Measured on mount, then at most once a frame when the shown rows or columns change, rows are added or removed, or\n // web fonts load; not on every render or text change. The state changes only when a column has to grow.\n const measureRef = React.useRef<() => void>(() => {});\n React.useLayoutEffect(() => {\n const root = rootRef.current;\n if (!root || narrow) return;\n // A new resetKey (or the table back from phone cards): what the columns ask for is measured afresh.\n wantRef.current = {};\n const measure = () => {\n const need: Record<string, number> = {};\n for (const el of root.querySelectorAll<HTMLElement>(':scope > .ui-dt-scroller .ui-dt-body .ui-dt-cell[data-col]:not(.is-long):not(.is-hug)')) {\n const over = el.scrollWidth - el.clientWidth;\n const key = el.dataset.col;\n if (over > 1 && key) need[key] = Math.max(need[key] ?? 0, Math.ceil(el.getBoundingClientRect().width + over));\n }\n // Hugging columns: the widest of their heading, cells and total on one line (is-measuring keeps every one\n // unwrapped for this read; the class is gone before the browser paints).\n // Each cell's own padding counts: the last one keeps the row actions' width free at its end.\n const pad = (el: HTMLElement) => {\n const st = getComputedStyle(el);\n return (parseFloat(st.paddingLeft) || 0) + (parseFloat(st.paddingRight) || 0) + (parseFloat(st.borderRightWidth) || 0);\n };\n const hugs = root.querySelectorAll<HTMLElement>(':scope > .ui-dt-scroller .ui-dt-cell.is-hug[data-col]');\n // The main and long columns: their content on one line too, what they ask for before the room is shared.\n const growCells = root.querySelectorAll<HTMLElement>(':scope > .ui-dt-scroller .ui-dt-cell.is-grow[data-col]');\n const asks: Record<string, number> = {};\n if (hugs.length || growCells.length) {\n root.classList.add('is-measuring');\n for (const el of hugs) {\n const key = el.dataset.col;\n const inner = el.querySelector(':scope > .ui-dt-stack > .ui-dt-main') ?? el;\n const w = contentWidth(inner);\n if (key && w !== null) need[key] = Math.max(need[key] ?? 0, Math.ceil(w + pad(el)));\n }\n for (const el of growCells) {\n const key = el.dataset.col;\n const long = el.querySelector<HTMLElement>('.ui-dt-long-text');\n const w = long ? long.getBoundingClientRect().width : contentWidth(el.querySelector(':scope > .ui-dt-stack > .ui-dt-main') ?? el);\n if (!key || w === null || !w) continue;\n const max = el.classList.contains('is-long') ? LONG_WANT_MAX : MAIN_WANT_MAX;\n asks[key] = Math.max(asks[key] ?? 0, Math.min(max, Math.ceil(w + pad(el))));\n }\n root.classList.remove('is-measuring');\n }\n // Everything read in this pass goes into one state update (one render), and none when nothing changed.\n const next: Partial<Measured> = {};\n const head = root.querySelector<HTMLElement>(':scope > .ui-dt-scroller .ui-dt-head');\n const scroll = root.querySelector<HTMLElement>(':scope > .ui-dt-scroller .ui-dt-scroll');\n if (head && scroll && scroll.clientWidth > 0) {\n // Only grows, like fit, until resetKey: paging back and forth does not make columns jump.\n const before = wantRef.current;\n const more = Object.entries(asks).filter(([k, w]) => w > (before[k] ?? 0));\n const merged = more.length ? { ...before, ...Object.fromEntries(more) } : before;\n wantRef.current = merged;\n if (more.length) next.want = merged;\n // Every column gets what it asks for when the hugging columns, the checkbox column and every main or long\n // column's ask fit in the box (the caret column is left out: it goes when nothing is cut).\n let used = 0;\n for (const el of head.children as HTMLCollectionOf<HTMLElement>) {\n if (el.classList.contains('ui-dt-exp')) continue;\n const key = el.dataset.col;\n used += key && el.classList.contains('is-grow') ? Math.max(asks[key] ?? 0, merged[key] ?? 0, 48) : el.getBoundingClientRect().width;\n }\n next.roomy = used <= scroll.clientWidth;\n }\n // The row actions' width: the widest set of buttons over a row end.\n let aw = 0;\n for (const el of root.querySelectorAll<HTMLElement>(':scope > .ui-dt-scroller .ui-dt-body .ui-dt-acts')) {\n if (el.childElementCount) aw = Math.max(aw, Math.ceil(el.getBoundingClientRect().width));\n }\n if (root.querySelector(':scope > .ui-dt-scroller .ui-dt-body .ui-dt-acts')) next.actsW = aw;\n // One toolbar row when the summary tabs, the search field at its least width and the buttons fit.\n const tools = root.querySelector<HTMLElement>(':scope > .ui-dt-tools.has-summary');\n if (tools && tools.clientWidth > 0) {\n const tabs = tools.querySelector<HTMLElement>('.ui-dt-summary');\n const actions = tools.querySelector<HTMLElement>(':scope > .ui-dt-actions');\n let need2 = (tabs?.scrollWidth ?? 0) + (tools.querySelector(':scope > .ui-dt-search') ? SEARCH_MIN + 2 * TOOL_GAP : TOOL_GAP);\n const parts = actions ? [...(actions.children as HTMLCollectionOf<HTMLElement>)].filter((e) => getComputedStyle(e).position !== 'absolute') : [];\n for (const e of parts) {\n const text = e.querySelector<HTMLElement>('.ui-dt-sortbtn-text');\n need2 += e.getBoundingClientRect().width + (text ? Math.max(0, text.scrollWidth - text.clientWidth) : 0);\n }\n need2 += Math.max(0, parts.length - 1) * TOOL_GAP;\n next.onerow = need2 <= tools.clientWidth;\n }\n // A long cell cut at its column's edge: the caret column is needed. Only where layout is real (not jsdom).\n const scroller = root.querySelector<HTMLElement>(':scope > .ui-dt-scroller .ui-dt-scroll');\n if (scroller && scroller.clientWidth > 0) {\n const cut = [...root.querySelectorAll<HTMLElement>(':scope > .ui-dt-scroller .ui-dt-body .ui-dt-long')].some(\n (el) => el.scrollWidth > el.clientWidth + 1,\n );\n next.clipped = cut;\n }\n setMeasured((m) => {\n const grow = Object.entries(need).filter(([k, w]) => w > (m.fit[k] ?? 0));\n if (grow.length) next.fit = { ...m.fit, ...Object.fromEntries(grow) };\n const aw2 = next.actsW;\n const actsSame = aw2 == null || (m.actsW !== null && Math.abs(m.actsW - aw2) <= 1);\n const same =\n !next.fit &&\n !next.want &&\n (next.roomy === undefined || next.roomy === m.roomy) &&\n actsSame &&\n (next.onerow === undefined || next.onerow === m.onerow) &&\n (next.clipped === undefined || next.clipped === m.clipped);\n if (same) return m;\n return { ...m, ...next, actsW: actsSame ? m.actsW : (next.actsW ?? m.actsW) };\n });\n };\n let frame = 0;\n const later = () => {\n if (frame) return;\n frame = requestAnimationFrame(() => {\n frame = 0;\n measure();\n });\n };\n measureRef.current = later;\n measure();\n // Rows added or removed (a page, a filter, new data) and the header or totals row swapped: the child lists of the\n // table and its body only, not every text change inside a cell.\n const mo = new MutationObserver(later);\n for (const el of root.querySelectorAll(':scope > .ui-dt-scroller .ui-dt-table, :scope > .ui-dt-scroller .ui-dt-body')) mo.observe(el, { childList: true });\n document.fonts?.ready.then(later).catch(() => {});\n // A wider or narrower table cuts long cells differently: the caret column follows. Only the width: a row growing\n // taller is not a reason to measure.\n let lastW = -1;\n const ro = resizeObserver((entries) => {\n const w = Math.round(entries[0]?.contentRect.width ?? 0);\n if (w !== lastW && lastW >= 0) later();\n lastW = w;\n });\n ro?.observe(root);\n // The text's own size: a font that loads late, a zoom of the text only, or reader styles that add letter, word or\n // line spacing (WCAG 1.4.12) change how wide a cell's content is, though the table's width stays.\n const probe = root.querySelector<HTMLElement>(':scope > .ui-dt-probe');\n let probeSize = '';\n const po = probe\n ? resizeObserver(() => {\n const r = probe.getBoundingClientRect();\n const size = `${Math.round(r.width)}x${Math.round(r.height)}`;\n if (probeSize && size !== probeSize) later();\n probeSize = size;\n })\n : null;\n if (probe) po?.observe(probe);\n return () => {\n mo.disconnect();\n ro?.disconnect();\n po?.disconnect();\n cancelAnimationFrame(frame);\n measureRef.current = () => {};\n };\n // resetKey clears the widths: measured again even when the rows look the same.\n }, [narrow, resetKey]);\n // A new width for the row actions changes the last cell's padding: measured again.\n React.useLayoutEffect(() => {\n measureRef.current();\n }, [actsW]);\n // The same rows with new content (rows replaced by the app, a search marking text, totals recomputed): once a frame.\n const contentKey = `${visIds.join('\\u0001')}|${shownCols.map((c) => c.key).join(',')}|${list.length}|${q}|${!!p.totals}`;\n React.useLayoutEffect(() => {\n measureRef.current();\n }, [contentKey, rows]);\n const stickyStyle = (ci: number) => (ci === 0 && sticky ? { left: (expander ? EXP : 0) + (selectable ? SEL : 0) } : undefined);\n const cellClass = (c: DataTableColumn<R>, ci: number, ...more: unknown[]) =>\n cx(\n 'ui-dt-cell',\n isNum(c) && 'is-num',\n c.mono && 'is-mono',\n grows(c) ? 'is-grow' : 'is-hug',\n ci === 0 && sticky && 'is-sticky is-sticky-end',\n ci === shownCols.length - 1 && 'is-lastcol',\n ...more,\n );\n // stickyFirst: the caret and checkbox columns before the first column stay too, so nothing scrolls under them.\n const lead = (what: 'exp' | 'sel') =>\n sticky ? { className: 'is-sticky', style: { left: what === 'sel' && expander ? EXP : 0 } } : { className: undefined, style: undefined };\n\n const headOf = (inZoom: boolean) => {\n const gridStyle = inZoom ? zoomGrid : pageGrid;\n const w = inZoom ? zoomWidths : widths;\n const setW = inZoom ? setZoomWidths : setWidths;\n const root = () => (inZoom ? zoomRef.current : rootRef.current);\n return (\n <div className=\"ui-dt-row ui-dt-head\" role=\"row\" style={gridStyle}>\n {expander ? (\n <div className={cx('ui-dt-cell ui-dt-exp', lead('exp').className)} style={lead('exp').style} role=\"columnheader\">\n <span className=\"ui-visually-hidden\">{tr('展開')}</span>\n </div>\n ) : null}\n {selectable ? (\n <div className={cx('ui-dt-cell ui-dt-sel', lead('sel').className)} style={lead('sel').style} role=\"columnheader\">\n <RowCheck v={allOn ? true : mixed ? 'mixed' : false} label={tr('全選')} onClick={() => toggle(visIds, !allOn)} />\n </div>\n ) : null}\n {shownCols.map((c, ci) => {\n const at = sort.findIndex((l) => l.key === c.key);\n const cur = at >= 0;\n const many = sort.length > 1;\n return (\n <div\n key={c.key}\n role=\"columnheader\"\n // ARIA allows aria-sort on one column: the first level. The others say their place in the button's name.\n aria-sort={at === 0 ? (sort[0].dir === 'asc' ? 'ascending' : 'descending') : 'none'}\n className={cellClass(c, ci)}\n style={stickyStyle(ci)}\n data-col={c.key}\n >\n {c.sortable === false ? (\n c.label\n ) : (\n <button\n type=\"button\"\n className={cx('ui-dt-sort', cur && 'is-on')}\n aria-label={cur && many ? tr('{name},第 {n} 排序,{dir}', { name: c.label, n: at + 1, dir: dirWord(sort[at].dir) }) : undefined}\n aria-keyshortcuts=\"Shift+Enter\"\n onClick={(e) => sortBy(c, e.shiftKey)}\n onKeyDown={(e) => {\n if (e.shiftKey && (e.key === 'Enter' || e.key === ' ')) {\n e.preventDefault();\n sortBy(c, true);\n }\n }}\n >\n <span>{c.label}</span>\n <Icon d={ARROWS[cur ? sort[at].dir : 'none']} size={14} className=\"ui-dt-arrow\" />\n {cur && many ? (\n <span className=\"ui-dt-sortpri\" aria-hidden=\"true\">\n {at + 1}\n </span>\n ) : null}\n </button>\n )}\n {narrow ? null : (\n <ColResize\n name={c.label}\n width={w?.[c.key] ?? minOf(c)}\n start={() => (w ?? drawn(root()))[c.key] ?? minOf(c)}\n onWidth={(px) => setW({ ...(w ?? drawn(root())), [c.key]: Math.max(headMin(root(), c.key), px) })}\n onReset={() => setW(null)}\n />\n )}\n </div>\n );\n })}\n </div>\n );\n };\n\n const mark = searching ? q : '';\n // A relative date's full date and time: in a Tooltip on hover and as the cell's description (no extra tab stop).\n const absDate = (r: R, c: DataTableColumn<R>) => {\n if (c.format !== 'relative' || c.render) return '';\n const d = asDate(get(r, c.key));\n const abs = d ? format.dateTime(d) : '';\n return abs && abs !== format.relative(d) ? abs : '';\n };\n const cellInner = (r: R, c: DataTableColumn<R>) => {\n const raw = get(r, c.key);\n let v: React.ReactNode;\n if (c.render) v = c.render(r);\n else if (isDateCol(c) && asDate(raw)) {\n const d = asDate(raw) as Date;\n const abs = absDate(r, c);\n // Relative times stay current (one shared minute timer) and render the same on the server and at hydration.\n const t =\n c.format === 'relative' ? (\n <RelativeTime className=\"ui-dt-time\" value={d}>\n {(text) => dateParts(text, mark)}\n </RelativeTime>\n ) : (\n <time className=\"ui-dt-time\" dateTime={isoOf(d, c.format === 'date')}>\n {dateParts(String(cellText(c, raw) ?? ''), mark)}\n </time>\n );\n v = abs ? (\n <Tooltip label={abs} describe={false} disabled={touch}>\n {t}\n </Tooltip>\n ) : (\n t\n );\n } else if (c.unit && raw !== null && raw !== undefined && raw !== '')\n // One inline element: the cell is a flex box, which drops a bare space between the number and the unit.\n v = (\n <span className=\"ui-dt-qty\">\n {markMatch(cellText({ ...c, unit: undefined }, raw), mark)} <span className=\"ui-unit\">{c.unit}</span>\n </span>\n );\n else if (raw === null || raw === undefined || raw === '')\n // Nothing to show: a quiet dash, so an empty cell does not read as content.\n v = <span className=\"ui-dt-none\">{cellText(c, raw)}</span>;\n else v = markMatch(cellText(c, raw), mark);\n return v;\n };\n // A click on the row itself: not on one of its own controls, and not the end of a text selection.\n const rowClick = (e: React.MouseEvent<HTMLElement>) => {\n const t = e.target as Element;\n const ctl = t.closest(ROW_CONTROLS);\n if (ctl && ctl !== e.currentTarget) return false;\n const s = window.getSelection();\n return !(s && !s.isCollapsed && String(s).trim());\n };\n const openRow = (r: R, e: React.MouseEvent<HTMLElement>) => {\n const href = p.rowHref?.(r);\n if (href == null) return;\n if (newTab(e)) {\n e.preventDefault();\n window.open(href, '_blank', 'noopener');\n } else if (p.onRowOpen) p.onRowOpen(r, e);\n else e.currentTarget.querySelector<HTMLAnchorElement>('a.ui-dt-rowlink')?.click();\n };\n const cell = (r: R, c: DataTableColumn<R>, ci: number) => {\n let v = c.long ? <LongText>{cellInner(r, c)}</LongText> : cellInner(r, c);\n if (c.fullText) v = <FullText text={c.fullText(r)}>{v}</FullText>;\n if (ci === 0 && p.rowHref)\n v = (\n <a\n className=\"ui-dt-rowlink\"\n href={p.rowHref(r)}\n onClick={\n p.onRowOpen\n ? (e) => {\n if (newTab(e)) return;\n e.preventDefault();\n p.onRowOpen?.(r, e);\n }\n : undefined\n }\n >\n {v}\n </a>\n );\n const sub = c.secondary?.(r);\n if (sub == null || sub === '' || sub === false) return v;\n return (\n <span className=\"ui-dt-stack\">\n <span className=\"ui-dt-main\">{v}</span>\n <span className=\"ui-dt-sub\">{sub}</span>\n </span>\n );\n };\n const total = (c: DataTableColumn<R>, ci: number): React.ReactNode => {\n const how = p.totals?.[c.key];\n const rowsAll = list.map((x) => x.r);\n // Numbers in Geist Mono, the words (「合計」「平均」「筆」) and the unit in the text font.\n if (ci === 0 && !how)\n return (\n <span className=\"ui-dt-qty\">{monoNums(tr('合計 {n} {unit}', { n: '\\u0001', unit: unitOf(rowsAll.length) }), [format.number(rowsAll.length)])}</span>\n );\n if (typeof how === 'function') return how(rowsAll);\n if (how === 'sum' || how === 'avg') {\n const sum = rowsAll.reduce((a, r) => a + (Number(get(r, c.key)) || 0), 0);\n const val = how === 'sum' ? sum : sum / (rowsAll.length || 1);\n const num = cellText({ ...(how === 'avg' && !c.format ? { ...c, decimals: 1 } : c), unit: undefined }, val);\n return (\n <span className=\"ui-dt-qty\">\n {how === 'avg' ? <span className=\"ui-unit\">{tr('平均')} </span> : null}\n {num}\n {c.unit ? (\n <>\n {' '}\n <span className=\"ui-unit\">{c.unit}</span>\n </>\n ) : null}\n </span>\n );\n }\n return '';\n };\n\n // C2: every row the search and filters keep (all pages, in the current order), as a Markdown table.\n const copyMarkdown = () => {\n const all = list.map((x) => x.r);\n if (p.copyText) return p.copyText(all);\n return markdownTable(\n shownCols.map((c) => c.label),\n all.map((r) => shownCols.map((c) => String(c.fullText?.(r) ?? c.searchText?.(r) ?? cellText(c, get(r, c.key)) ?? ''))),\n );\n };\n // The toolbar, the table and the page numbers: on the page, and again in the 「放大表格」 dialog with the same state.\n // One row of tools: search, filter, count, copy, sort, columns, zoom. Without a search field the title goes on the\n // same row: the caption in front of the tools, or, when the table sits under a Card's title, the tools move into\n // that title row (inHead). How it wraps depends on the table's own width (container query in styles.css).\n // 「複製成 Markdown」 from the 「⋯」 menu: the menu closes, so a small 「已複製」 shows under it for 2 s and is announced.\n const [copied, setCopied] = React.useState(false);\n const copiedTimer = React.useRef<ReturnType<typeof setTimeout>>(undefined);\n React.useEffect(() => () => clearTimeout(copiedTimer.current), []);\n const doCopy = () =>\n copyText(copyMarkdown()).then(\n () => {\n setCopied(true);\n announce(tr('已複製'));\n clearTimeout(copiedTimer.current);\n copiedTimer.current = setTimeout(() => setCopied(false), 2000);\n },\n () => p.onCopyError?.(),\n );\n // 「/」 focuses the search field of the first table on the page that has one; that table shows the 「/」 hint.\n const slash = search !== false && p.toolbar !== false && p.searchShortcut !== false;\n const [slashOwner, setSlashOwner] = React.useState(false);\n React.useEffect(() => {\n const el = rootRef.current;\n if (!slash || !el) return;\n const changed = () => setSlashOwner(firstShortcutTable() === el);\n const off = registerShortcut(el, changed);\n return () => {\n off();\n setSlashOwner(false);\n };\n }, [slash]);\n const [searchFocus, setSearchFocus] = React.useState(false);\n // The applied conditions as removable chips under the toolbar: 「狀態:失敗 ×」, one per picked option or range.\n const setFilter = (key: string, v: FilterValue | undefined) => {\n setValues(v === undefined ? Object.fromEntries(Object.entries(values).filter(([k]) => k !== key)) : { ...values, [key]: v });\n setPage(0);\n };\n const chips: FilterChip[] = [];\n for (const f of filters) {\n const v = values[f.key];\n if (!v || !isActive(v)) continue;\n if (Array.isArray(v))\n for (const val of v)\n chips.push({\n id: f.key + '=' + val,\n text: tr('{name}:{value}', { name: f.label, value: f.options.find((o) => String(o.value) === val)?.label ?? val }),\n remove: () =>\n setFilter(\n f.key,\n v.filter((x) => x !== val),\n ),\n });\n else {\n const range = v.min && v.max ? `${v.min}–${v.max}` : v.min ? `≥ ${v.min}` : `≤ ${v.max}`;\n chips.push({ id: f.key, text: tr('{name}:{value}', { name: f.label, value: range }), remove: () => setFilter(f.key, undefined) });\n }\n }\n const chipsView = (inZoom: boolean) => (\n <FilterChips\n chips={chips}\n onClear={() => {\n setValues({});\n setPage(0);\n }}\n filterButton={() => (inZoom ? zoomRef : rootRef).current?.querySelector<HTMLElement>('.ui-dt-filterbtn') ?? null}\n />\n );\n // The toolbar, the table and the page numbers: on the page, and again in the 「放大表格」 dialog with the same state.\n // One row of tools: search, 「篩選」, the count, 「排序」 and 「⋯」 (欄位, 複製成 Markdown, 放大表格), every one 40 px tall.\n // Without a search field the title goes on the same row: the caption in front of the tools, or, when the table sits\n // under a Card's title, the tools move into that title row (inHead). How it wraps depends on the table's own width\n // (container query in styles.css).\n // The summary tabs: the first part of the toolbar (on the same row as the search and buttons when they all fit, see\n // onerow), or above it when the tools moved into a Card's title row.\n const summaryView = summary ? (\n <Tabs\n className=\"ui-dt-summary\"\n label={summary.label || tr('依狀態篩選')}\n unit={countUnit}\n value={sumVal}\n onChange={(v) => {\n capture('sort');\n setSumVal(v);\n setPage(0);\n }}\n items={[\n // No counts while loading: 「全部 0」 would be wrong.\n { id: 'all', label: tr('全部'), count: p.loading ? undefined : sumAll.length },\n ...summary.items.map((it) => ({\n id: String(it.value),\n label: it.label,\n count: p.loading ? undefined : sumAll.filter((x) => String(get(x.r, summary.key)) === String(it.value)).length,\n })),\n ]}\n hideUnit\n />\n ) : null;\n // With summary tabs: 「6 / 24 筆」 only while a search or filter keeps fewer rows (「全部 24」 already says how many).\n // Without them: 「24 筆」 on one page, 「6 / 24 筆」 after a search or filter; with pages the range under the table says\n // it. Screen readers always have the count (countText), shown or not.\n const filtered = list.length !== baseCount;\n const showCount = filtered || (!summary && pages <= 1 && !p.loading);\n const countText = p.loading\n ? tr('載入中')\n : filtered\n ? format.fractionLabel(list.length, baseCount, unitOf(baseCount))\n : `${format.number(list.length)} ${unitOf(list.length)}`;\n const toolsView = (inZoom: boolean, inHead = false) => (\n <div className={cx('ui-dt-tools', inHead && 'is-inhead', summaryView && !inZoom && !inHead && 'has-summary', onerow && !inZoom && !inHead && 'is-onerow')}>\n {summaryView && !inZoom && !inHead ? <div className=\"ui-dt-sumwrap\">{summaryView}</div> : null}\n {search === false && p.caption && !inZoom && !inHead ? <div className=\"ui-dt-caption\">{p.caption}</div> : null}\n {search !== false ? (\n <div className=\"ui-dt-search\" onFocus={() => setSearchFocus(true)} onBlur={() => setSearchFocus(false)}>\n <SearchField\n value={q}\n onChange={(v) => {\n setQ(v);\n setPage(0);\n }}\n placeholder={search.placeholder || tr('搜尋')}\n label={search.placeholder || tr('搜尋')}\n aria-keyshortcuts={slashOwner && !inZoom ? '/' : undefined}\n className=\"ui-dt-searchfield\"\n />\n {slashOwner && !inZoom && !narrow && !q && !searchFocus ? (\n <kbd className=\"ui-dt-kbd\" aria-hidden=\"true\">\n /\n </kbd>\n ) : null}\n </div>\n ) : null}\n <div className=\"ui-dt-actions\">\n {filters.length ? (\n <FilterButton\n boundary={inZoom ? zoomRef : rootRef}\n filters={filters}\n values={values}\n activeCount={activeN}\n count={(f, v) => all.filter((x) => passes(x.r, f.key) && matches(f, x.r, f.type === 'list' ? [v] : undefined)).length}\n onChange={(key, v) => setFilter(key, v)}\n onClear={() => {\n setValues({});\n setPage(0);\n }}\n />\n ) : null}\n {showCount ? (\n <span className=\"ui-dt-result\">\n {/* Shown 「6 / 24 筆」; read 「24 筆中的 6 筆」, not 「6 斜線 24 筆」. The shown one is drawn by CSS, so the page's\n text has only the readable one (no 「6 / 24 筆24 筆中的 6 筆」 when copied or read by a tool). */}\n <span aria-hidden=\"true\">\n {filtered\n ? seenOnly(tr('{n} / {total} {unit}', { n: '\\u0001', total: '\\u0002', unit: unitOf(baseCount) }), [\n format.number(list.length),\n format.number(baseCount),\n ])\n : seenOnly(tr('{n} {unit}', { n: '\\u0001', unit: unitOf(list.length) }), [format.number(list.length)])}\n </span>\n <span className=\"ui-visually-hidden\">{countText}</span>\n </span>\n ) : null}\n {sortCols.length ? <SortButton cols={sortCols} levels={sort} max={maxSort} onChange={changeSort} boundary={inZoom ? zoomRef : rootRef} /> : null}\n {narrow ? null : (\n <MoreMenu\n columns={\n p.columnMenu !== false && cols.length > 2\n ? {\n cols,\n hidden,\n onToggle: (k) => setToggled({ ...toggled, [k]: !hidden[k] }),\n onReset: () => {\n setToggled({});\n setWidths(null);\n setZoomWidths(null);\n announce(tr('已還原預設的欄位與欄寬'));\n },\n }\n : undefined\n }\n onCopy={p.copy !== false ? doCopy : undefined}\n onZoom={p.zoom !== false && !inZoom ? () => setZoomed(true) : undefined}\n />\n )}\n {p.action && !inZoom ? <div className=\"ui-dt-primary\">{p.action}</div> : null}\n {copied && !narrow ? (\n <span className=\"ui-dt-copied\" aria-hidden=\"true\">\n <Icon name=\"check\" size={16} />\n {tr('已複製')}\n </span>\n ) : null}\n </div>\n </div>\n );\n // While rows are selected: the count, the bulk actions and 「取消選取」 in a toolbar above the table (not a row of the\n // table: the header row and its column headers stay).\n const bulkView =\n selectable && selIds.length && p.bulkActions ? (\n <div className=\"ui-dt-bulk\" role=\"toolbar\" aria-label={tr('已選 {n} {unit}', { n: selIds.length, unit: unitOf(selIds.length) })}>\n <span className=\"ui-dt-bulk-lead\">\n {/* Phone cards hide the header row and its 「全選」: the bar carries it, in the rows' checkbox column. */}\n {narrow ? <RowCheck v={allOn ? true : mixed ? 'mixed' : false} label={tr('全選')} onClick={() => toggle(visIds, !allOn)} /> : null}\n <span className=\"ui-dt-bulk-count\">\n {monoNums(tr('已選 {n} {unit}', { n: '\\u0001', unit: unitOf(selIds.length) }), [format.number(selIds.length)])}\n </span>\n </span>\n <span className=\"ui-dt-bulk-actions\">{p.bulkActions(selIds, clear)}</span>\n <button type=\"button\" className=\"ui-dt-bulk-close\" aria-label={tr('取消選取')} onClick={clear}>\n <Icon name=\"x\" size={16} />\n </button>\n </div>\n ) : null;\n // loading: rows of the columns' shape, each cell a bar as wide as what it will hold. One row says 「載入中」 to screen\n // readers; the bars are hidden from them.\n const skeletonRows = (grid: React.CSSProperties) => {\n const n = Math.max(1, p.loadingRows ?? Math.min(pageSize, 10));\n const MAIN = ['72%', '56%', '64%', '48%'];\n // Bars as wide as typical content (px), so the hugging columns are measured as when loaded and nothing jumps.\n // relative: as wide as dateTime, since format.relative shows a full date and time from 7 days back.\n const TYPICAL: Record<string, number> = { date: 128, dateTime: 184, datetime: 184, relative: 184, duration: 64, money: 96, percent: 56 };\n const widthOf = (c: DataTableColumn<R>, i: number) =>\n c.key === mainKey\n ? MAIN[i % MAIN.length]\n : c.mobile === 'status'\n ? 64\n : (TYPICAL[c.format ?? ''] ?? (isNum(c) ? 56 : c.mono ? 112 : c.long ? '80%' : '60%'));\n return [\n <div key=\"busy\" role=\"row\" className=\"ui-visually-hidden\">\n <div role=\"cell\">{tr('載入中')}</div>\n </div>,\n ...Array.from({ length: n }, (_, i) => (\n <div key={'skel' + i} aria-hidden=\"true\" className={cx('ui-dt-row ui-dt-skelrow', i % 2 && 'is-even')} style={grid}>\n {expander ? <div className={cx('ui-dt-cell ui-dt-exp', lead('exp').className)} style={lead('exp').style} /> : null}\n {selectable ? <div className={cx('ui-dt-cell ui-dt-sel', lead('sel').className)} style={lead('sel').style} /> : null}\n {shownCols.map((c, ci) => (\n <div key={c.key} data-label={c.label} data-col={c.key} className={cellClass(c, ci, mobileClass(c, ci))} style={stickyStyle(ci)}>\n <Skeleton width={widthOf(c, i)} />\n </div>\n ))}\n </div>\n )),\n ];\n };\n const tableView = (inZoom: boolean) => {\n const grid = inZoom ? zoomGrid : pageGrid;\n const pfx = inZoom ? uid + 'z' : uid;\n return (\n <div className={cx('ui-dt-scroller', scrollMore && !inZoom && 'has-more')}>\n <div className={cx('ui-dt-scroll', pages > 1 && 'is-paged')} ref={inZoom ? undefined : scrollRef} onScroll={inZoom ? undefined : onScroll}>\n <div className=\"ui-dt-table\" role=\"table\" aria-label={p.label || p.caption} aria-busy={p.loading || undefined}>\n {headOf(inZoom)}\n <div ref={inZoom ? undefined : bodyRef} className=\"ui-dt-body\" role=\"rowgroup\">\n {p.loading ? (\n skeletonRows(grid)\n ) : vis.length ? (\n vis.map((x, i) => {\n const id = visIds[i];\n const on = !!sel[id];\n const open = expander && !!opened[id];\n const detailId = `${pfx}-d-${idPart(id)}`;\n const rowName = shownCols[0] ? String(cellText(shownCols[0], get(x.r, shownCols[0].key)) ?? '') : '';\n return (\n <React.Fragment key={id}>\n <div\n data-rid={id}\n ref={\n inZoom\n ? undefined\n : (el) => {\n rowEls.current[id] = el;\n }\n }\n role=\"row\"\n // Named by its first cell (the function name, say), not by every cell and the caret's 「展開 …」.\n aria-labelledby={shownCols.length ? `${pfx}-n-${start + i}` : undefined}\n className={cx(\n 'ui-dt-row',\n i % 2 && 'is-even',\n hasAct && 'has-acts',\n on && 'is-selected',\n selectable && 'has-sel',\n expander && !p.rowHref && 'has-exp',\n p.rowHref && 'has-href',\n )}\n style={grid}\n // EC: a click anywhere on the row opens or closes its details, except on its own controls\n // and when the click ends a text selection. Keyboard users have the caret button. With rowHref\n // the click opens the row's page instead (its first cell's link, or onRowOpen); Ctrl, ⌘,\n // Shift and the middle button open it in a new tab, as on a link.\n onClick={\n expander || p.rowHref\n ? (e) => {\n if (!rowClick(e)) return;\n if (p.rowHref) return openRow(x.r, e);\n setOpened({ ...opened, [id]: !open });\n }\n : undefined\n }\n // Shift + click would select text up to here and the middle button would start autoscroll:\n // neither, so those clicks open the row like a link.\n onMouseDown={\n p.rowHref\n ? (e) => {\n if ((e.shiftKey || e.button === 1) && !(e.target as Element).closest(ROW_CONTROLS)) e.preventDefault();\n }\n : undefined\n }\n onAuxClick={\n p.rowHref\n ? (e) => {\n if (e.button === 1 && rowClick(e)) openRow(x.r, e);\n }\n : undefined\n }\n >\n {expander ? (\n <div className={cx('ui-dt-cell ui-dt-exp', lead('exp').className)} style={lead('exp').style} role=\"cell\">\n <button\n type=\"button\"\n className={cx('ui-dt-exp-btn', open && 'is-open')}\n aria-expanded={open}\n aria-controls={open ? detailId : undefined}\n aria-label={tr(open ? '收合 {name}' : '展開 {name}', { name: rowName })}\n onClick={() => setOpened({ ...opened, [id]: !open })}\n >\n <Icon name=\"caret-right\" size={16} />\n </button>\n </div>\n ) : null}\n {selectable ? (\n <div className={cx('ui-dt-cell ui-dt-sel', lead('sel').className)} style={lead('sel').style} role=\"cell\">\n <RowCheck v={on} label={tr('選取第 {n} 筆', { n: start + i + 1 })} onClick={(e) => pickRow(id, on, e.shiftKey)} />\n </div>\n ) : null}\n {shownCols.map((c, ci) => (\n <div\n key={c.key}\n role=\"cell\"\n id={ci === 0 ? `${pfx}-n-${start + i}` : undefined}\n // fullText: the whole text as the cell's description, not hidden text beside the short one\n // (that put 「ucp.c:62,src/…/ucp.c:62」 in the page's text and the phone card).\n aria-description={[c.fullText?.(x.r), absDate(x.r, c)].filter(Boolean).join(tr(',')) || undefined}\n data-label={c.label}\n data-col={c.key}\n className={cellClass(c, ci, c.long && 'is-long', mobileClass(c, ci))}\n style={stickyStyle(ci)}\n >\n {cell(x.r, c, ci)}\n </div>\n ))}\n {hasAct ? (\n <div className=\"ui-dt-cell ui-dt-acts\" role=\"cell\">\n {p.rowActions?.(x.r)}\n </div>\n ) : null}\n </div>\n {open ? (\n <div id={detailId} role=\"row\" className={cx('ui-dt-detail', i % 2 && 'is-even')} style={{ minWidth: grid.minWidth }}>\n <div role=\"cell\" className=\"ui-dt-detail-cell\" style={{ paddingLeft: EXP + (selectable ? SEL : 0) + 12 }}>\n {longCols.map((c) => (\n <div key={c.key} className=\"ui-dt-detail-item\">\n <div className=\"ui-dt-detail-label\">{c.label}</div>\n <div className=\"ui-dt-detail-text\">{c.fullText ? c.fullText(x.r) : cellInner(x.r, c)}</div>\n </div>\n ))}\n </div>\n </div>\n ) : null}\n </React.Fragment>\n );\n })\n ) : (\n // A row with one cell, so the table keeps the rows its role needs (ARIA table > rowgroup > row).\n <div className=\"ui-dt-emptyrow\" role=\"row\">\n <div className=\"ui-dt-empty\" role=\"cell\">\n {p.emptyText || tr('沒有符合的資料')}\n {q || activeN ? (\n <div>\n <Button onClick={clearFilters}>{tr('清除篩選')}</Button>\n </div>\n ) : null}\n </div>\n </div>\n )}\n </div>\n {p.totals && list.length ? (\n <div className=\"ui-dt-row ui-dt-total\" role=\"row\" style={grid}>\n {expander ? <div className={cx('ui-dt-cell ui-dt-exp', lead('exp').className)} style={lead('exp').style} role=\"cell\" /> : null}\n {selectable ? <div className={cx('ui-dt-cell ui-dt-sel', lead('sel').className)} style={lead('sel').style} role=\"cell\" /> : null}\n {shownCols.map((c, ci) => (\n <div\n key={c.key}\n role=\"cell\"\n className={cellClass(c, ci)}\n style={stickyStyle(ci)}\n data-col={c.key}\n // On a phone the totals row is a summary under the cards: each total as 「label value」.\n data-label={ci > 0 && p.totals?.[c.key] ? c.label : undefined}\n >\n {total(c, ci)}\n </div>\n ))}\n </div>\n ) : null}\n </div>\n </div>\n </div>\n );\n };\n const footView = (\n <>\n {/* One page: the count above the table already says how many rows there are, so no range and no page numbers. */}\n {/* While loading the count is not known yet: no range from the rows of before. */}\n {pages > 1 && !p.loading ? (\n <div className=\"ui-dt-foot\">\n <span className=\"ui-dt-range\">\n {monoNums(tr('第 {a}–{b} {unit},共 {n} {unit}', { a: '\\u0001', b: '\\u0002', n: '\\u0003', unit: unitOf(list.length) }), [\n start + 1,\n Math.min(list.length, start + pageSize),\n format.number(list.length),\n ])}\n </span>\n <nav className=\"ui-dt-pages\" aria-label={tr('分頁')}>\n <button type=\"button\" className=\"ui-dt-page\" aria-label={tr('上一頁')} disabled={pageNow === 0} onClick={() => goPage(pageNow - 1)}>\n ‹\n </button>\n {Array.from({ length: pages }, (_, i) => (\n <button\n key={i}\n type=\"button\"\n className={cx('ui-dt-page', i === pageNow && 'is-on')}\n aria-current={i === pageNow ? 'page' : undefined}\n onClick={() => goPage(i)}\n >\n {String(i + 1)}\n </button>\n ))}\n <button type=\"button\" className=\"ui-dt-page\" aria-label={tr('下一頁')} disabled={pageNow >= pages - 1} onClick={() => goPage(pageNow + 1)}>\n ›\n </button>\n </nav>\n </div>\n ) : null}\n </>\n );\n\n return (\n <div\n ref={rootRef}\n className={cx('ui-dt', search === false && 'is-nosearch', selIds.length && 'has-sel', hasAct && 'has-acts', p.className)}\n style={hasAct ? ({ '--dt-acts-w': (p.actionsWidth ?? actsW ?? 72) + 'px' } as React.CSSProperties) : undefined}\n >\n {p.caption && search !== false ? <div className=\"ui-dt-caption\">{p.caption}</div> : null}\n {p.views ? (\n <div className=\"ui-dt-views\" role=\"tablist\" aria-label={tr('檢視')}>\n {p.views.map((v) => {\n const on = v.id === view;\n const vn = rows.filter((r) => !v.filter || v.filter(r)).length;\n return (\n <button\n key={v.id}\n type=\"button\"\n role=\"tab\"\n aria-selected={on}\n className={cx('ui-dt-view', on && 'is-on')}\n onClick={() => {\n setView(v.id);\n setPage(0);\n }}\n >\n {v.label}{' '}\n <span className=\"ui-dt-view-n\">\n {format.number(vn)}\n <span className=\"ui-visually-hidden\"> {unitOf(vn)}</span>\n </span>\n </button>\n );\n })}\n </div>\n ) : null}\n {/* Measures the text's size (see the measuring effect): its text is drawn by CSS, so it is not in the page's text. */}\n <span className=\"ui-dt-probe\" aria-hidden=\"true\" />\n {summaryView && (headSlot || p.toolbar === false) ? <div className=\"ui-dt-top\">{summaryView}</div> : null}\n {p.toolbar === false ? null : headSlot ? createPortal(toolsView(false, true), headSlot) : toolsView(false)}\n {chipsView(false)}\n {/* The count for screen readers when it is not shown (summary tabs or the page range say it on screen). */}\n {showCount && p.toolbar !== false ? null : <span className=\"ui-visually-hidden\">{countText}</span>}\n {bulkView}\n {tableView(false)}\n <ScrollHint show={overflows} done={scrolled} />\n {footView}\n <TableDialog open={zoomed} onClose={() => setZoomed(false)} title={p.caption || p.label}>\n <div ref={zoomRef} className=\"ui-dt ui-dt-zoomed\">\n {p.toolbar === false ? null : toolsView(true)}\n {chipsView(true)}\n {bulkView}\n {tableView(true)}\n {footView}\n </div>\n </TableDialog>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,aAAaA,qBAAcC,eAASC,SAAG;AAGvC,MAAM,MAAM;AAoGZ,MAAM,OAAO;CAAE,KAAK;CAAK,SAAS;CAAI,MAAM;AAA2B;AACvE,MAAM,SAAsD;CAAE,KAAK;CAAyB,MAAM;CAAyB,MAAM;AAA4B;AAE7J,MAAM,OAAO,KAAU,QAA0B,IAAgC;AAEjF,MAAM,aAAsC,CAAC;AAC7C,MAAM,eAAe,QAAgB;CACnC,MAAM,IAAa,KAAK,MAAM,GAAG;CACjC,IAAI,CAAC,KAAK,OAAO,MAAM,UAAU,MAAM,IAAI,MA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