@gridui/table 3.2.0 → 4.0.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/README.md +16 -4
- package/dist/data-table/table-types.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/dist/styles.css +23 -21
- package/dist/styles.local.css +4 -7
- package/docs/catalog.json +1 -1
- package/docs/reference/data-table-placeholder.md +4 -4
- package/docs/reference/data-table.md +3 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ for static HTML loading, SSR limits, and avoiding duplicate CSS.
|
|
|
22
22
|
Related families and their ownership are listed in the
|
|
23
23
|
[component ownership map](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/component-ownership.md).
|
|
24
24
|
|
|
25
|
-
`@gridui/table` owns DataTable and geometry-preserving table placeholders. Metric and data cells have their own Data families. Loading surfaces
|
|
25
|
+
`@gridui/table` owns DataTable and geometry-preserving table placeholders. Metric and data cells have their own Data families. Loading surfaces and notices belong to Feedback; RailProfile belongs to Data.
|
|
26
26
|
DataTable provides a named,
|
|
27
27
|
keyboard-focusable horizontal scroll region, scoped column headers, optional
|
|
28
28
|
initial rows, and a stable tbody ID. Each `DataTableColumn` defines its `label`,
|
|
@@ -32,7 +32,7 @@ sizing props. `rowHeader` makes the first body cell a scoped row header.
|
|
|
32
32
|
`minWidth` controls the whole table; column sizing applies only to leaf headers
|
|
33
33
|
and body cells, never to grouped headers. DataTable retains both `editorial` (default) and `structured` variants. Both use
|
|
34
34
|
square cells with continuous horizontal and vertical grid boundaries. Editorial
|
|
35
|
-
rows
|
|
35
|
+
rows emphasize editorial presentation; structured rows emphasize row
|
|
36
36
|
headers. Optional `columnGroups` use labeled positive integer spans that must
|
|
37
37
|
cover all columns. Native colgroups and scoped group headers preserve the table
|
|
38
38
|
relationships; mixed numeric alignment never applies to group headings.
|
|
@@ -63,7 +63,7 @@ monospace identifiers. DataBadge retains caller-supplied status text with neutra
|
|
|
63
63
|
or accent tone. DataBar adds a decorative, bounded relative-volume mark without
|
|
64
64
|
replacing the displayed value; partial periods use a dashed fill and still need
|
|
65
65
|
a visible caller-owned coverage label. Source information uses the shared
|
|
66
|
-
[Disclosure](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
66
|
+
[Disclosure](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-controls/disclosure/README.md); applications own
|
|
67
67
|
its source content and compact cell spacing. These
|
|
68
68
|
components use shared semantic theme tokens, so site brand colors and appearance
|
|
69
69
|
changes update both table variants together. They contain no domain copy, source
|
|
@@ -94,7 +94,8 @@ and `aria-controls`, stable row keys, and the expanded detail content.
|
|
|
94
94
|
Optional rowLines and columnLines control internal separators independently.
|
|
95
95
|
Header/body and footer boundaries remain structural separators. density accepts
|
|
96
96
|
compact or comfortable; headerSurface and rowHeaderSurface accept plain or muted.
|
|
97
|
-
|
|
97
|
+
Appearance does not choose density. Density defaults to comfortable for both variants;
|
|
98
|
+
other explicit options override the corresponding appearance default.
|
|
98
99
|
striped tracks records rather than physical rows, so expanded details retain the
|
|
99
100
|
owner's stripe. rows may carry selected for presentation; callers own controls
|
|
100
101
|
and selection semantics. Selected and striped surfaces also cover sticky cells.
|
|
@@ -103,3 +104,14 @@ footerRows supplies keyed cell arrays for a native tfoot. Footer cells follow
|
|
|
103
104
|
column order, numeric alignment, sizing, sticky offsets and external-edge rules.
|
|
104
105
|
No aggregation is performed. Footer keys must be unique and every footer row
|
|
105
106
|
must match the columns. DataTablePlaceholder accepts the same presentation props.
|
|
107
|
+
|
|
108
|
+
## Sizing and density
|
|
109
|
+
|
|
110
|
+
density compact/comfortable is independent of editorial/structured appearance and defaults to comfortable. Cell block padding is 0.5rem/1rem respectively, and headers/body/footer/placeholders follow the selected setting. Embedded controls choose their own size and can grow a row beyond its density minimum.
|
|
111
|
+
|
|
112
|
+
See the [shared sizing contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/sizing.md)
|
|
113
|
+
for native attributes, scope precedence, tokens and target behavior.
|
|
114
|
+
|
|
115
|
+
The --gridui-table-cell-padding-inline token customizes cell inline padding.
|
|
116
|
+
DataExplorer uses it with the selected control role when reserving its fixed
|
|
117
|
+
selection column, so enlarged text and pointer targets fit without squeezing.
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @namespace DataTable
|
|
5
5
|
* @description Table Types
|
|
6
6
|
*/
|
|
7
|
+
import type { Density } from "@gridui/theme";
|
|
7
8
|
import type { Responsive } from "@gridui/style-utils/responsive";
|
|
8
9
|
import type { ComponentPropsWithRef, CSSProperties, Key, ReactNode } from "react";
|
|
9
10
|
export type DataTableVariant = "editorial" | "structured";
|
|
@@ -35,7 +36,7 @@ export type DataTableRow = {
|
|
|
35
36
|
export type DataTablePresentation = {
|
|
36
37
|
readonly rowLines?: boolean;
|
|
37
38
|
readonly columnLines?: boolean;
|
|
38
|
-
readonly density?:
|
|
39
|
+
readonly density?: Density | undefined;
|
|
39
40
|
readonly headerSurface?: "plain" | "muted";
|
|
40
41
|
readonly rowHeaderSurface?: "plain" | "muted";
|
|
41
42
|
readonly striped?: boolean;
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/data-table/style.ts", "../src/data-table/data-table.tsx", "../src/data-table-placeholder/style.ts", "../src/data-table-placeholder/data-table-placeholder.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * @author WMXPY\n * @package Table\n * @namespace DataTable\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const tableScrollStyles = cva(cn(\n \"gridui-table-scroll\",\n \"gridui-u-table--min-w-0 gridui-u-table--max-w-full gridui-u-table--overflow-x-auto\",\n));\n\nexport const tableStyles = cva(cn(\n \"gridui-table\",\n \"gridui-u-table--w-full gridui-u-table--border-collapse gridui-u-table--type-data gridui-u-table--text-left gridui-u-table--text-foreground gridui-u-table--bg-background\",\n \"gridui-u-table--[&>thead>tr>th]:text-left gridui-u-table--[&>thead>tr>th]:text-muted gridui-u-table--[&>thead>tr>th]:font-medium\",\n \"gridui-u-table--[&>:is(thead,tbody,tfoot)>tr>:is(th,td)]:align-middle gridui-u-table--[&>:is(thead,tbody,tfoot)>tr>:is(th,td)]:wrap-anywhere\",\n \"gridui-u-table--[&>tbody>tr>th]:text-left gridui-u-table--[&>tbody>tr>th]:font-normal\",\n \"gridui-u-table--[&>thead>.gridui-table-groups>th]:text-left gridui-u-table--[&>thead>.gridui-table-groups>th]:text-foreground gridui-u-table--[&>thead>.gridui-table-groups>th]:type-eyebrow\",\n \"gridui-u-table--[&>:is(thead,tbody,tfoot)>tr>.gridui-table-numeric]:text-right gridui-u-table--[&>:is(thead,tbody,tfoot)>tr>.gridui-table-numeric]:tabular-nums\",\n));\n\nexport const tableCellStyles = cva(\"\", {\n variants: {\n numeric: {\n false: null,\n true: \"gridui-table-numeric\",\n },\n sticky: {\n start: \"gridui-u-table--[--gridui-table-cell-position:sticky] gridui-u-table--[--gridui-table-cell-start:var(--gridui-table-cell-offset)]\",\n end: \"gridui-u-table--[--gridui-table-cell-position:sticky] gridui-u-table--[--gridui-table-cell-end:var(--gridui-table-cell-offset)]\",\n },\n },\n defaultVariants: { numeric: false },\n});\n\nexport const tableEditorialStyles = cva(cn(\"gridui-table-editorial\"));\n\nexport const tableStructuredStyles = cva(cn(\"gridui-table-structured\"));\n\nexport const tableVariants = cva(tableStyles(), {\n variants: {\n variant: {\n editorial: tableEditorialStyles(),\n structured: tableStructuredStyles(),\n },\n },\n defaultVariants: {\n variant: \"editorial\",\n },\n});\n", "/**\n * @author WMXPY\n * @package Table\n * @namespace DataTable\n * @description Data Table\n */\n\nimport { tableCellStyles, tableScrollStyles, tableVariants } from \"./style\";\nimport type { DataTableColumn, DataTableOptions } from \"./table-types\";\nimport { useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { resolveResponsive } from \"@gridui/style-utils/responsive\";\nimport { type CSSProperties, type FC, Fragment } from \"react\";\n\nexport type DataTableProps = DataTableOptions;\n\nexport const DataTable: FC<DataTableProps> = (props: DataTableProps) => {\n const {\n label,\n columns,\n columnGroups,\n variant = \"editorial\",\n bodyId,\n rows = [],\n rowHeader = false,\n footerRows = [],\n rowLines,\n columnLines,\n density,\n headerSurface,\n rowHeaderSurface,\n striped = false,\n minWidth,\n inlineEdges = \"both\",\n blockEdges = \"both\",\n className,\n style,\n ...restProps\n } = props;\n const scrollbarRef = useScrollbars<HTMLDivElement>();\n const ref = useInteractionOutline({ ref: scrollbarRef });\n const block = resolveResponsive(blockEdges);\n const edges = resolveResponsive(inlineEdges);\n const rowKeys = rows.map((row, index) => {\n return row.key === undefined ? `position:${index}` : `key:${String(row.key)}`;\n });\n if (new Set(rowKeys).size !== rowKeys.length) {\n throw new Error(\"DataTable row keys must be unique.\");\n }\n if ([\n ...rows,\n ...footerRows,\n ].some((row) => {\n return row.cells.length !== columns.length;\n })) {\n throw new RangeError(\"DataTable rows must match the declared columns.\");\n }\n if (columnGroups && (columnGroups.some((group) => {\n return !Number.isInteger(group.span) || group.span < 1;\n }) || columnGroups.reduce((total, group) => {\n return total + group.span;\n }, 0) !== columns.length)) {\n throw new Error(\"DataTable column groups must cover every column with positive integer spans.\");\n }\n const footerKeys = footerRows.map((row, index) => {\n return row.key === undefined ? `position:${index}` : `key:${String(row.key)}`;\n });\n if (new Set(footerKeys).size !== footerKeys.length) {\n throw new Error(\"DataTable footer row keys must be unique.\");\n }\n const detailIds = rows.flatMap(row => {\n return row.detail ? [row.detail.id] : [];\n });\n if (detailIds.length > 0 && columns.length === 0) {\n throw new RangeError(\"DataTable details need at least one column.\");\n }\n if (detailIds.some(id => {\n return !id;\n }) || new Set(detailIds).size !== detailIds.length) {\n throw new Error(\"DataTable detail IDs must be nonempty and unique.\");\n }\n const columnKeys = columns.map((column, index) => {\n return column.key === undefined ? `position:${index}` : `key:${String(column.key)}`;\n });\n if (new Set(columnKeys).size !== columnKeys.length) {\n throw new Error(\"DataTable column keys must be unique.\");\n }\n const columnStyle = (column: DataTableColumn | undefined): (CSSProperties & {\n \"--gridui-table-cell-offset\"?: string;\n }) | undefined => {\n if (!column?.sticky) {\n return column?.sizing;\n }\n const offset = column.stickyOffset ?? 0;\n if (!Number.isFinite(offset) || offset < 0) {\n throw new RangeError(\"Sticky column offsets must be finite and nonnegative.\");\n }\n return {\n ...column.sizing,\n \"--gridui-table-cell-offset\": `${offset}px`,\n position: \"var(--gridui-table-cell-position)\" as CSSProperties[\"position\"],\n ...(column.sticky === \"start\" ? {\n insetInlineStart: \"var(--gridui-table-cell-start)\",\n } : {\n insetInlineEnd: \"var(--gridui-table-cell-end)\",\n }),\n };\n };\n return (<div\n ref={ref}\n className={cn(tableScrollStyles())}\n role=\"region\"\n aria-label={label}\n tabIndex={0}\n >\n <table\n {...restProps}\n aria-label={label}\n data-row-lines={rowLines}\n data-column-lines={columnLines}\n data-density={density}\n data-header-surface={headerSurface}\n data-row-header-surface={rowHeaderSurface}\n data-block-edges={block.base}\n data-block-edges-sm={block.sm}\n data-block-edges-md={block.md}\n data-block-edges-lg={block.lg}\n data-inline-edges={edges.base}\n data-inline-edges-sm={edges.sm}\n data-inline-edges-md={edges.md}\n data-inline-edges-lg={edges.lg}\n style={{\n minWidth,\n ...style,\n }}\n className={cn(tableVariants({\n variant,\n }), className)}\n >\n {columnGroups?.map((group, index) => {\n return (<colgroup\n key={index}\n span={group.span}\n />);\n })}\n <thead>\n {columnGroups && (<tr\n className=\"gridui-table-groups\"\n >\n {columnGroups.map((group, index) => {\n return (<th\n key={index}\n scope=\"colgroup\"\n colSpan={group.span}\n >\n {group.label}\n </th>);\n })}\n </tr>)}\n <tr>\n {columns.map((column, index) => {\n return (<th\n key={columnKeys[index]}\n scope=\"col\"\n style={columnStyle(column)}\n data-sticky={column.sticky}\n className={tableCellStyles({\n numeric: column.numeric,\n sticky: column.sticky,\n }) || undefined}\n >\n {column.header ?? column.label}\n </th>);\n })}\n </tr>\n </thead>\n <tbody\n id={bodyId}\n >\n {rows.map((row, index) => {\n const { cells, detail } = row;\n return (<Fragment\n key={rowKeys[index]}\n >\n <tr\n data-selected={row.selected || undefined}\n data-striped={striped && index % 2 === 1 || undefined}\n >\n {cells.map((cell, cellIndex) => {\n const Cell = rowHeader && cellIndex === 0 ? \"th\" : \"td\";\n return (<Cell\n key={columnKeys[cellIndex]}\n scope={Cell === \"th\" ? \"row\" : undefined}\n style={columnStyle(columns[cellIndex])}\n data-sticky={columns[cellIndex]?.sticky}\n className={tableCellStyles({\n numeric: columns[cellIndex]?.numeric,\n sticky: columns[cellIndex]?.sticky,\n }) || undefined}\n >\n {cell}\n </Cell>);\n })}\n </tr>\n {detail && (<tr\n id={detail.id}\n data-selected={row.selected || undefined}\n data-striped={striped && index % 2 === 1 || undefined}\n className=\"gridui-table-detail\"\n >\n <td\n colSpan={columns.length}\n >\n {detail.content}\n </td>\n </tr>)}\n </Fragment>);\n })}\n </tbody>\n {footerRows.length > 0 && (<tfoot>\n {footerRows.map((row, index) => {\n return (<tr\n key={footerKeys[index]}\n >\n {row.cells.map((cell, cellIndex) => {\n const Cell = cellIndex === 0 ? \"th\" : \"td\";\n return (<Cell\n key={columnKeys[cellIndex]}\n scope={cellIndex === 0 ? \"row\" : undefined}\n style={columnStyle(columns[cellIndex])}\n data-sticky={columns[cellIndex]?.sticky}\n className={tableCellStyles({\n numeric: columns[cellIndex]?.numeric,\n sticky: columns[cellIndex]?.sticky,\n }) || undefined}\n >\n {cell}\n </Cell>);\n })}\n </tr>);\n })}\n </tfoot>)}\n </table>\n </div>);\n};\n", "/**\n * @author WMXPY\n * @package Table\n * @namespace DataTablePlaceholder\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const tablePlaceholderStyles = cva(cn(\n \"gridui-table-placeholder\",\n \"gridui-u-table--pointer-events-none\",\n));\n", "/**\n * @author WMXPY\n * @package Table\n * @namespace DataTablePlaceholder\n * @description Data Table Placeholder\n */\n\nimport { DataTable } from \"../data-table/data-table\";\nimport type { DataTableOptions } from \"../data-table/table-types\";\nimport { tablePlaceholderStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC } from \"react\";\n\nexport type DataTablePlaceholderProps = Omit<DataTableOptions, \"rows\"> & {\n readonly rowCount?: number;\n};\n\nexport const DataTablePlaceholder: FC<DataTablePlaceholderProps> = (props: DataTablePlaceholderProps) => {\n const { rowCount = 5, ...restProps } = props;\n return (<div\n className={cn(tablePlaceholderStyles())}\n aria-hidden=\"true\"\n inert\n >\n <DataTable\n {...restProps}\n rows={Array.from({ length: rowCount }, () => {\n return {\n cells: restProps.columns.map(() => {\n return \"\u2014\";\n }),\n };\n })}\n />\n </div>);\n};\n"],
|
|
5
|
-
"mappings": ";AAOA,SAAS,UAAU;AACnB,SAAS,WAAW;AAEb,IAAM,oBAAoB,IAAI;AAAA,EACjC;AAAA,EACA;AACJ,CAAC;AAEM,IAAM,cAAc,IAAI;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,CAAC;AAEM,IAAM,kBAAkB,IAAI,IAAI;AAAA,EACnC,UAAU;AAAA,IACN,SAAS;AAAA,MACL,OAAO;AAAA,MACP,MAAM;AAAA,IACV;AAAA,IACA,QAAQ;AAAA,MACJ,OAAO;AAAA,MACP,KAAK;AAAA,IACT;AAAA,EACJ;AAAA,EACA,iBAAiB,EAAE,SAAS,MAAM;AACtC,CAAC;AAEM,IAAM,uBAAuB,IAAI,GAAG,wBAAwB,CAAC;AAE7D,IAAM,wBAAwB,IAAI,GAAG,yBAAyB,CAAC;AAE/D,IAAM,gBAAgB,IAAI,YAAY,GAAG;AAAA,EAC5C,UAAU;AAAA,IACN,SAAS;AAAA,MACL,WAAW,qBAAqB;AAAA,MAChC,YAAY,sBAAsB;AAAA,IACtC;AAAA,EACJ;AAAA,EACA,iBAAiB;AAAA,IACb,SAAS;AAAA,EACb;AACJ,CAAC;;;AC5CD,SAAS,uBAAuB,qBAAqB;AACrD,SAAS,MAAAA,WAAU;AACnB,SAAS,yBAAyB;AAClC,SAAsC,gBAAgB;AAgI9B,cAKZ,YALY;AA5HjB,IAAM,YAAgC,CAAC,UAA0B;AACpE,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,OAAO,CAAC;AAAA,IACR,YAAY;AAAA,IACZ,aAAa,CAAC;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Table\n * @namespace DataTable\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const tableScrollStyles = cva(cn(\n \"gridui-table-scroll\",\n \"gridui-u-table--min-w-0 gridui-u-table--max-w-full gridui-u-table--overflow-x-auto\",\n));\n\nexport const tableStyles = cva(cn(\n \"gridui-table\",\n \"gridui-u-table--w-full gridui-u-table--border-collapse gridui-u-table--type-data gridui-u-table--text-left gridui-u-table--text-foreground gridui-u-table--bg-background\",\n \"gridui-u-table--[&>thead>tr>th]:text-left gridui-u-table--[&>thead>tr>th]:text-muted gridui-u-table--[&>thead>tr>th]:font-medium\",\n \"gridui-u-table--[&>:is(thead,tbody,tfoot)>tr>:is(th,td)]:align-middle gridui-u-table--[&>:is(thead,tbody,tfoot)>tr>:is(th,td)]:wrap-anywhere\",\n \"gridui-u-table--[&>tbody>tr>th]:text-left gridui-u-table--[&>tbody>tr>th]:font-normal\",\n \"gridui-u-table--[&>thead>.gridui-table-groups>th]:text-left gridui-u-table--[&>thead>.gridui-table-groups>th]:text-foreground gridui-u-table--[&>thead>.gridui-table-groups>th]:type-eyebrow\",\n \"gridui-u-table--[&>:is(thead,tbody,tfoot)>tr>.gridui-table-numeric]:text-right gridui-u-table--[&>:is(thead,tbody,tfoot)>tr>.gridui-table-numeric]:tabular-nums\",\n));\n\nexport const tableCellStyles = cva(\"\", {\n variants: {\n numeric: {\n false: null,\n true: \"gridui-table-numeric\",\n },\n sticky: {\n start: \"gridui-u-table--[--gridui-table-cell-position:sticky] gridui-u-table--[--gridui-table-cell-start:var(--gridui-table-cell-offset)]\",\n end: \"gridui-u-table--[--gridui-table-cell-position:sticky] gridui-u-table--[--gridui-table-cell-end:var(--gridui-table-cell-offset)]\",\n },\n },\n defaultVariants: { numeric: false },\n});\n\nexport const tableEditorialStyles = cva(cn(\"gridui-table-editorial\"));\n\nexport const tableStructuredStyles = cva(cn(\"gridui-table-structured\"));\n\nexport const tableVariants = cva(tableStyles(), {\n variants: {\n variant: {\n editorial: tableEditorialStyles(),\n structured: tableStructuredStyles(),\n },\n },\n defaultVariants: {\n variant: \"editorial\",\n },\n});\n", "/**\n * @author WMXPY\n * @package Table\n * @namespace DataTable\n * @description Data Table\n */\n\nimport { tableCellStyles, tableScrollStyles, tableVariants } from \"./style\";\nimport type { DataTableColumn, DataTableOptions } from \"./table-types\";\nimport { useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { resolveResponsive } from \"@gridui/style-utils/responsive\";\nimport { type CSSProperties, type FC, Fragment } from \"react\";\n\nexport type DataTableProps = DataTableOptions;\n\nexport const DataTable: FC<DataTableProps> = (props: DataTableProps) => {\n const {\n label,\n columns,\n columnGroups,\n variant = \"editorial\",\n bodyId,\n rows = [],\n rowHeader = false,\n footerRows = [],\n rowLines,\n columnLines,\n density = \"comfortable\",\n headerSurface,\n rowHeaderSurface,\n striped = false,\n minWidth,\n inlineEdges = \"both\",\n blockEdges = \"both\",\n className,\n style,\n ...restProps\n } = props;\n const scrollbarRef = useScrollbars<HTMLDivElement>();\n const ref = useInteractionOutline({ ref: scrollbarRef });\n const block = resolveResponsive(blockEdges);\n const edges = resolveResponsive(inlineEdges);\n const rowKeys = rows.map((row, index) => {\n return row.key === undefined ? `position:${index}` : `key:${String(row.key)}`;\n });\n if (new Set(rowKeys).size !== rowKeys.length) {\n throw new Error(\"DataTable row keys must be unique.\");\n }\n if ([\n ...rows,\n ...footerRows,\n ].some((row) => {\n return row.cells.length !== columns.length;\n })) {\n throw new RangeError(\"DataTable rows must match the declared columns.\");\n }\n if (columnGroups && (columnGroups.some((group) => {\n return !Number.isInteger(group.span) || group.span < 1;\n }) || columnGroups.reduce((total, group) => {\n return total + group.span;\n }, 0) !== columns.length)) {\n throw new Error(\"DataTable column groups must cover every column with positive integer spans.\");\n }\n const footerKeys = footerRows.map((row, index) => {\n return row.key === undefined ? `position:${index}` : `key:${String(row.key)}`;\n });\n if (new Set(footerKeys).size !== footerKeys.length) {\n throw new Error(\"DataTable footer row keys must be unique.\");\n }\n const detailIds = rows.flatMap(row => {\n return row.detail ? [row.detail.id] : [];\n });\n if (detailIds.length > 0 && columns.length === 0) {\n throw new RangeError(\"DataTable details need at least one column.\");\n }\n if (detailIds.some(id => {\n return !id;\n }) || new Set(detailIds).size !== detailIds.length) {\n throw new Error(\"DataTable detail IDs must be nonempty and unique.\");\n }\n const columnKeys = columns.map((column, index) => {\n return column.key === undefined ? `position:${index}` : `key:${String(column.key)}`;\n });\n if (new Set(columnKeys).size !== columnKeys.length) {\n throw new Error(\"DataTable column keys must be unique.\");\n }\n const columnStyle = (column: DataTableColumn | undefined): (CSSProperties & {\n \"--gridui-table-cell-offset\"?: string;\n }) | undefined => {\n if (!column?.sticky) {\n return column?.sizing;\n }\n const offset = column.stickyOffset ?? 0;\n if (!Number.isFinite(offset) || offset < 0) {\n throw new RangeError(\"Sticky column offsets must be finite and nonnegative.\");\n }\n return {\n ...column.sizing,\n \"--gridui-table-cell-offset\": `${offset}px`,\n position: \"var(--gridui-table-cell-position)\" as CSSProperties[\"position\"],\n ...(column.sticky === \"start\" ? {\n insetInlineStart: \"var(--gridui-table-cell-start)\",\n } : {\n insetInlineEnd: \"var(--gridui-table-cell-end)\",\n }),\n };\n };\n return (<div\n ref={ref}\n className={cn(tableScrollStyles())}\n role=\"region\"\n aria-label={label}\n tabIndex={0}\n >\n <table\n {...restProps}\n aria-label={label}\n data-row-lines={rowLines}\n data-column-lines={columnLines}\n data-density={density}\n data-header-surface={headerSurface}\n data-row-header-surface={rowHeaderSurface}\n data-block-edges={block.base}\n data-block-edges-sm={block.sm}\n data-block-edges-md={block.md}\n data-block-edges-lg={block.lg}\n data-inline-edges={edges.base}\n data-inline-edges-sm={edges.sm}\n data-inline-edges-md={edges.md}\n data-inline-edges-lg={edges.lg}\n style={{\n minWidth,\n ...style,\n }}\n className={cn(tableVariants({\n variant,\n }), className)}\n >\n {columnGroups?.map((group, index) => {\n return (<colgroup\n key={index}\n span={group.span}\n />);\n })}\n <thead>\n {columnGroups && (<tr\n className=\"gridui-table-groups\"\n >\n {columnGroups.map((group, index) => {\n return (<th\n key={index}\n scope=\"colgroup\"\n colSpan={group.span}\n >\n {group.label}\n </th>);\n })}\n </tr>)}\n <tr>\n {columns.map((column, index) => {\n return (<th\n key={columnKeys[index]}\n scope=\"col\"\n style={columnStyle(column)}\n data-sticky={column.sticky}\n className={tableCellStyles({\n numeric: column.numeric,\n sticky: column.sticky,\n }) || undefined}\n >\n {column.header ?? column.label}\n </th>);\n })}\n </tr>\n </thead>\n <tbody\n id={bodyId}\n >\n {rows.map((row, index) => {\n const { cells, detail } = row;\n return (<Fragment\n key={rowKeys[index]}\n >\n <tr\n data-selected={row.selected || undefined}\n data-striped={striped && index % 2 === 1 || undefined}\n >\n {cells.map((cell, cellIndex) => {\n const Cell = rowHeader && cellIndex === 0 ? \"th\" : \"td\";\n return (<Cell\n key={columnKeys[cellIndex]}\n scope={Cell === \"th\" ? \"row\" : undefined}\n style={columnStyle(columns[cellIndex])}\n data-sticky={columns[cellIndex]?.sticky}\n className={tableCellStyles({\n numeric: columns[cellIndex]?.numeric,\n sticky: columns[cellIndex]?.sticky,\n }) || undefined}\n >\n {cell}\n </Cell>);\n })}\n </tr>\n {detail && (<tr\n id={detail.id}\n data-selected={row.selected || undefined}\n data-striped={striped && index % 2 === 1 || undefined}\n className=\"gridui-table-detail\"\n >\n <td\n colSpan={columns.length}\n >\n {detail.content}\n </td>\n </tr>)}\n </Fragment>);\n })}\n </tbody>\n {footerRows.length > 0 && (<tfoot>\n {footerRows.map((row, index) => {\n return (<tr\n key={footerKeys[index]}\n >\n {row.cells.map((cell, cellIndex) => {\n const Cell = cellIndex === 0 ? \"th\" : \"td\";\n return (<Cell\n key={columnKeys[cellIndex]}\n scope={cellIndex === 0 ? \"row\" : undefined}\n style={columnStyle(columns[cellIndex])}\n data-sticky={columns[cellIndex]?.sticky}\n className={tableCellStyles({\n numeric: columns[cellIndex]?.numeric,\n sticky: columns[cellIndex]?.sticky,\n }) || undefined}\n >\n {cell}\n </Cell>);\n })}\n </tr>);\n })}\n </tfoot>)}\n </table>\n </div>);\n};\n", "/**\n * @author WMXPY\n * @package Table\n * @namespace DataTablePlaceholder\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const tablePlaceholderStyles = cva(cn(\n \"gridui-table-placeholder\",\n \"gridui-u-table--pointer-events-none\",\n));\n", "/**\n * @author WMXPY\n * @package Table\n * @namespace DataTablePlaceholder\n * @description Data Table Placeholder\n */\n\nimport { DataTable } from \"../data-table/data-table\";\nimport type { DataTableOptions } from \"../data-table/table-types\";\nimport { tablePlaceholderStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC } from \"react\";\n\nexport type DataTablePlaceholderProps = Omit<DataTableOptions, \"rows\"> & {\n readonly rowCount?: number;\n};\n\nexport const DataTablePlaceholder: FC<DataTablePlaceholderProps> = (props: DataTablePlaceholderProps) => {\n const { rowCount = 5, ...restProps } = props;\n return (<div\n className={cn(tablePlaceholderStyles())}\n aria-hidden=\"true\"\n inert\n >\n <DataTable\n {...restProps}\n rows={Array.from({ length: rowCount }, () => {\n return {\n cells: restProps.columns.map(() => {\n return \"\u2014\";\n }),\n };\n })}\n />\n </div>);\n};\n"],
|
|
5
|
+
"mappings": ";AAOA,SAAS,UAAU;AACnB,SAAS,WAAW;AAEb,IAAM,oBAAoB,IAAI;AAAA,EACjC;AAAA,EACA;AACJ,CAAC;AAEM,IAAM,cAAc,IAAI;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,CAAC;AAEM,IAAM,kBAAkB,IAAI,IAAI;AAAA,EACnC,UAAU;AAAA,IACN,SAAS;AAAA,MACL,OAAO;AAAA,MACP,MAAM;AAAA,IACV;AAAA,IACA,QAAQ;AAAA,MACJ,OAAO;AAAA,MACP,KAAK;AAAA,IACT;AAAA,EACJ;AAAA,EACA,iBAAiB,EAAE,SAAS,MAAM;AACtC,CAAC;AAEM,IAAM,uBAAuB,IAAI,GAAG,wBAAwB,CAAC;AAE7D,IAAM,wBAAwB,IAAI,GAAG,yBAAyB,CAAC;AAE/D,IAAM,gBAAgB,IAAI,YAAY,GAAG;AAAA,EAC5C,UAAU;AAAA,IACN,SAAS;AAAA,MACL,WAAW,qBAAqB;AAAA,MAChC,YAAY,sBAAsB;AAAA,IACtC;AAAA,EACJ;AAAA,EACA,iBAAiB;AAAA,IACb,SAAS;AAAA,EACb;AACJ,CAAC;;;AC5CD,SAAS,uBAAuB,qBAAqB;AACrD,SAAS,MAAAA,WAAU;AACnB,SAAS,yBAAyB;AAClC,SAAsC,gBAAgB;AAgI9B,cAKZ,YALY;AA5HjB,IAAM,YAAgC,CAAC,UAA0B;AACpE,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,OAAO,CAAC;AAAA,IACR,YAAY;AAAA,IACZ,aAAa,CAAC;AAAA,IACd;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IAC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AAA;AAAA,EACJ;AACJ;",
|
|
6
6
|
"names": ["cn", "cn", "cva", "cn", "jsx"]
|
|
7
7
|
}
|
package/dist/styles.css
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties;
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
|
-
@layer theme {
|
|
5
|
-
:root, :host {
|
|
6
|
-
--spacing: 0.25rem;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
4
|
@layer utilities {
|
|
10
5
|
.gridui-u-overlay--z-\(--gridui-z-popover\) {
|
|
11
6
|
z-index: var(--gridui-z-popover);
|
|
@@ -20,9 +15,6 @@
|
|
|
20
15
|
width: var(--gridui-space-16);
|
|
21
16
|
height: var(--gridui-space-16);
|
|
22
17
|
}
|
|
23
|
-
.gridui-u-overlay--min-h-10 {
|
|
24
|
-
min-height: calc(var(--spacing) * 10);
|
|
25
|
-
}
|
|
26
18
|
.gridui-u-overlay--min-w-0 {
|
|
27
19
|
min-width: 0px;
|
|
28
20
|
}
|
|
@@ -61,15 +53,9 @@
|
|
|
61
53
|
.gridui-u-overlay--p-0 {
|
|
62
54
|
padding: 0px;
|
|
63
55
|
}
|
|
64
|
-
.gridui-u-overlay--p-gridui-8 {
|
|
65
|
-
padding: var(--gridui-space-8);
|
|
66
|
-
}
|
|
67
56
|
.gridui-u-overlay--px-gridui-8 {
|
|
68
57
|
padding-inline: var(--gridui-space-8);
|
|
69
58
|
}
|
|
70
|
-
.gridui-u-overlay--py-gridui-8 {
|
|
71
|
-
padding-block: var(--gridui-space-8);
|
|
72
|
-
}
|
|
73
59
|
.gridui-u-overlay--type-data {
|
|
74
60
|
font: var(--gridui-type-data);
|
|
75
61
|
font-family: var(--gridui-font-body);
|
|
@@ -176,6 +162,25 @@
|
|
|
176
162
|
animation: none;
|
|
177
163
|
}
|
|
178
164
|
}
|
|
165
|
+
.gridui-overlay-list {
|
|
166
|
+
--gridui-overlay-row-min: var(--gridui-control-min-height-medium);
|
|
167
|
+
--gridui-overlay-row-padding: var(--gridui-space-8);
|
|
168
|
+
}
|
|
169
|
+
.gridui-overlay-density-compact {
|
|
170
|
+
--gridui-overlay-row-min: var(--gridui-control-min-height-small);
|
|
171
|
+
--gridui-overlay-row-padding: var(--gridui-space-4);
|
|
172
|
+
}
|
|
173
|
+
.gridui-overlay-density-comfortable {
|
|
174
|
+
--gridui-overlay-row-min: var(--gridui-control-min-height-medium);
|
|
175
|
+
--gridui-overlay-row-padding: var(--gridui-space-8);
|
|
176
|
+
}
|
|
177
|
+
.gridui-overlay-list-item {
|
|
178
|
+
min-block-size: max(var(--gridui-overlay-row-min, var(--gridui-control-min-height-medium)), var(--gridui-target-min-size));
|
|
179
|
+
padding-block: var(--gridui-overlay-row-padding, var(--gridui-space-8));
|
|
180
|
+
}
|
|
181
|
+
.gridui-overlay-list-label {
|
|
182
|
+
padding-block: var(--gridui-overlay-row-padding, var(--gridui-space-8));
|
|
183
|
+
}
|
|
179
184
|
}
|
|
180
185
|
@property --tw-border-style {
|
|
181
186
|
syntax: "*";
|
|
@@ -286,7 +291,7 @@
|
|
|
286
291
|
}
|
|
287
292
|
@layer components {
|
|
288
293
|
.gridui-table > :is(thead, tbody, tfoot) > tr > :is(th, td) {
|
|
289
|
-
padding: 1rem;
|
|
294
|
+
padding: 1rem var(--gridui-table-cell-padding-inline, var(--gridui-space-16));
|
|
290
295
|
border: 1px solid var(--gridui-border);
|
|
291
296
|
}
|
|
292
297
|
.gridui-table > :is(thead, tbody, tfoot) > tr > :is(th, td):first-child {
|
|
@@ -298,14 +303,11 @@
|
|
|
298
303
|
.gridui-table > thead > tr > th {
|
|
299
304
|
background: var(--gridui-surface);
|
|
300
305
|
}
|
|
301
|
-
.gridui-table-editorial > tbody > tr > :is(th, td) {
|
|
302
|
-
padding-block: 1.5rem;
|
|
303
|
-
}
|
|
304
306
|
.gridui-table-structured > tbody > tr > th, .gridui-table > tbody > tr:hover > :is(th, td) {
|
|
305
307
|
background: var(--gridui-surface);
|
|
306
308
|
}
|
|
307
309
|
.gridui-table > thead > .gridui-table-groups > th {
|
|
308
|
-
padding-block:
|
|
310
|
+
padding-block: var(--gridui-space-8);
|
|
309
311
|
background: var(--gridui-selection-background);
|
|
310
312
|
}
|
|
311
313
|
.gridui-table > thead > tr:first-child > th {
|
|
@@ -386,10 +388,10 @@
|
|
|
386
388
|
z-index: 2;
|
|
387
389
|
}
|
|
388
390
|
.gridui-table[data-density="compact"] > :is(thead, tbody, tfoot) > tr > :is(th, td) {
|
|
389
|
-
padding-block:
|
|
391
|
+
padding-block: var(--gridui-space-8);
|
|
390
392
|
}
|
|
391
393
|
.gridui-table[data-density="comfortable"] > :is(thead, tbody, tfoot) > tr > :is(th, td) {
|
|
392
|
-
padding-block:
|
|
394
|
+
padding-block: var(--gridui-space-16);
|
|
393
395
|
}
|
|
394
396
|
.gridui-table[data-row-lines="false"] > tbody > tr:not(:last-child) > :is(th, td) {
|
|
395
397
|
border-block-end-width: 0;
|
package/dist/styles.local.css
CHANGED
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
}
|
|
95
95
|
@layer components {
|
|
96
96
|
.gridui-table > :is(thead, tbody, tfoot) > tr > :is(th, td) {
|
|
97
|
-
padding: 1rem;
|
|
97
|
+
padding: 1rem var(--gridui-table-cell-padding-inline, var(--gridui-space-16));
|
|
98
98
|
border: 1px solid var(--gridui-border);
|
|
99
99
|
}
|
|
100
100
|
.gridui-table > :is(thead, tbody, tfoot) > tr > :is(th, td):first-child {
|
|
@@ -106,14 +106,11 @@
|
|
|
106
106
|
.gridui-table > thead > tr > th {
|
|
107
107
|
background: var(--gridui-surface);
|
|
108
108
|
}
|
|
109
|
-
.gridui-table-editorial > tbody > tr > :is(th, td) {
|
|
110
|
-
padding-block: 1.5rem;
|
|
111
|
-
}
|
|
112
109
|
.gridui-table-structured > tbody > tr > th, .gridui-table > tbody > tr:hover > :is(th, td) {
|
|
113
110
|
background: var(--gridui-surface);
|
|
114
111
|
}
|
|
115
112
|
.gridui-table > thead > .gridui-table-groups > th {
|
|
116
|
-
padding-block:
|
|
113
|
+
padding-block: var(--gridui-space-8);
|
|
117
114
|
background: var(--gridui-selection-background);
|
|
118
115
|
}
|
|
119
116
|
.gridui-table > thead > tr:first-child > th {
|
|
@@ -194,10 +191,10 @@
|
|
|
194
191
|
z-index: 2;
|
|
195
192
|
}
|
|
196
193
|
.gridui-table[data-density="compact"] > :is(thead, tbody, tfoot) > tr > :is(th, td) {
|
|
197
|
-
padding-block:
|
|
194
|
+
padding-block: var(--gridui-space-8);
|
|
198
195
|
}
|
|
199
196
|
.gridui-table[data-density="comfortable"] > :is(thead, tbody, tfoot) > tr > :is(th, td) {
|
|
200
|
-
padding-block:
|
|
197
|
+
padding-block: var(--gridui-space-16);
|
|
201
198
|
}
|
|
202
199
|
.gridui-table[data-row-lines="false"] > tbody > tr:not(:last-child) > :is(th, td) {
|
|
203
200
|
border-block-end-width: 0;
|
package/docs/catalog.json
CHANGED
|
@@ -59,6 +59,10 @@ Called when the corresponding interaction occurs; inspect the arguments in Actio
|
|
|
59
59
|
|
|
60
60
|
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
61
61
|
|
|
62
|
+
### density
|
|
63
|
+
|
|
64
|
+
``Density | undefined`` · Optional
|
|
65
|
+
|
|
62
66
|
### minWidth
|
|
63
67
|
|
|
64
68
|
``Property.MinWidth<string | number> | undefined`` · Optional
|
|
@@ -75,10 +79,6 @@ Called when the corresponding interaction occurs; inspect the arguments in Actio
|
|
|
75
79
|
|
|
76
80
|
``boolean | undefined`` · Optional
|
|
77
81
|
|
|
78
|
-
### density
|
|
79
|
-
|
|
80
|
-
``"compact" | "comfortable" | undefined`` · Optional
|
|
81
|
-
|
|
82
82
|
### headerSurface
|
|
83
83
|
|
|
84
84
|
``"plain" | "muted" | undefined`` · Optional
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/table",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "GridUI React table",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -32,15 +32,15 @@
|
|
|
32
32
|
"react-dom": "^19.2.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@gridui/overlay": "^2.
|
|
36
|
-
"@gridui/style-utils": "^4.
|
|
37
|
-
"@gridui/theme": "^
|
|
35
|
+
"@gridui/overlay": "^2.5.0",
|
|
36
|
+
"@gridui/style-utils": "^4.1.0",
|
|
37
|
+
"@gridui/theme": "^5.0.0",
|
|
38
38
|
"class-variance-authority": "0.7.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@gridui-internal/configuration": "0.0.0-internal",
|
|
42
|
-
"@gridui/data-cell": "1.
|
|
43
|
-
"@gridui/loading-surface": "1.3.
|
|
42
|
+
"@gridui/data-cell": "1.3.0",
|
|
43
|
+
"@gridui/loading-surface": "1.3.1",
|
|
44
44
|
"@jest/globals": "30.5.2",
|
|
45
45
|
"@storybook/react-vite": "10.6.7",
|
|
46
46
|
"@types/jest": "30.0.0",
|