@alexgorbatchev/shadcn 0.0.33 → 0.0.35
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 +1 -1
- package/dist/{chunk-2dxa9enk.js → chunk-efs4bk5b.js} +2 -1
- package/dist/{chunk-yfr9syen.js → chunk-h5kjmt32.js} +4 -3
- package/dist/components/data-grid/DataGrid.d.ts +5 -0
- package/dist/components/data-grid/index.js +1 -1
- package/dist/components/virtual-data-grid/index.js +2 -2
- package/dist/components/virtual-table/index.js +1 -1
- package/llms/components/data-display/DataGrid.md +8 -0
- package/llms/components/data-display/VirtualDataGrid.md +6 -0
- package/llms/setup.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -304,7 +304,7 @@ Compose `QuestionnaireItem`, `QuestionnaireTitle`, and answer controls inside `Q
|
|
|
304
304
|
|
|
305
305
|
`VirtualTable` renders a bounded, dynamically measured set of native table rows using TanStack Virtual. Supply `items`, stable `getItemKey`, `header`, `label`, and `renderRow`; spread the supplied measurement props onto each native row. Optional `columns` accepts a `TableColumnGroup`; responsive columns keep their widths aligned with cells that share their `visibleFrom`. `maxHeight` defaults to `65vh`, `estimateRowHeight` to 80 pixels, and `overscan` to five rows. `retainedKeys` keeps editing rows mounted; the focused row is retained automatically. Filtering and selection belong to the consumer.
|
|
306
306
|
|
|
307
|
-
`VirtualDataGrid` renders a TanStack Table instance built with `dataGridFeatures` through `VirtualTable`: every filtered and sorted row, without pagination, in a fixed-layout table. Column `meta` sets `label`, `textAlign`, `truncate`, `visibleFrom`, and `
|
|
307
|
+
`VirtualDataGrid` renders a TanStack Table instance built with `dataGridFeatures` through `VirtualTable`: every filtered and sorted row, without pagination, in a fixed-layout table. Column `meta` sets `label`, `textAlign`, `truncate`, `visibleFrom`, `fill`, and `sortColumnIds`; a `fill` column takes the width the sized columns leave, and `sortColumnIds` names other columns the header sorts with its own buttons so its `aria-sort` reports them. Other resizable columns get a window-splitter handle that resizes by dragging, by the arrow keys, Home, and End, and resets on double-click. Set `columnResizeMode: "onChange"` so columns follow the pointer while dragging; TanStack's default `"onEnd"` resizes only on release. Widths change through CSS variables, so a `useTable` selector can omit `columnSizing` and `columnResizing` to keep resizing from rendering rows. `renderRow` receives each row and its measurement props; spread the props onto a `TableRow` and render `DataGridCells` inside it to wrap rows in menus or drag sources. `retainedRowIds` keeps rows mounted while they hold editors. `DataGridColumnOptions` shows, hides, and reorders the columns that allow hiding; its reset restores the table's initial visibility, order, and sizes.
|
|
308
308
|
|
|
309
309
|
`StarRating` takes a controlled numeric `value` from 0 to 5, `onValueChange`, and an accessible `label`. Its native radio buttons support keyboard selection and an Unrated option to clear the rating. Set `disabled` while saving. `Avatar shape="square"` displays square artwork with matching image, fallback, and border corners.
|
|
310
310
|
|
|
@@ -38,7 +38,8 @@ function VirtualTable2({
|
|
|
38
38
|
getItemKey: itemKey,
|
|
39
39
|
estimateSize: () => estimateRowHeight,
|
|
40
40
|
overscan,
|
|
41
|
-
rangeExtractor
|
|
41
|
+
rangeExtractor,
|
|
42
|
+
useAnimationFrameWithResizeObserver: true
|
|
42
43
|
});
|
|
43
44
|
const rows = virtualizer.getVirtualItems();
|
|
44
45
|
const last = rows.at(-1);
|
|
@@ -118,9 +118,10 @@ function getDataGridColumnLabel(column) {
|
|
|
118
118
|
return column.columnDef.meta?.label ?? (typeof header === "string" ? header : column.id);
|
|
119
119
|
}
|
|
120
120
|
function getAriaSort(column) {
|
|
121
|
-
|
|
121
|
+
const sortable = [column.id, ...column.columnDef.meta?.sortColumnIds ?? []].map((id) => column.table.getColumn(id)).filter((candidate) => candidate?.getCanSort());
|
|
122
|
+
if (sortable.length === 0)
|
|
122
123
|
return;
|
|
123
|
-
const sorted =
|
|
124
|
+
const sorted = sortable.map((candidate) => candidate?.getIsSorted()).find(Boolean);
|
|
124
125
|
return sorted === "asc" ? "ascending" : sorted === "desc" ? "descending" : "none";
|
|
125
126
|
}
|
|
126
127
|
function DataGridHeaderCell({ header, isResizable }) {
|
|
@@ -267,7 +268,7 @@ function DataGridColumnHeader2({
|
|
|
267
268
|
return column.getCanSort() ? /* @__PURE__ */ jsxs(Button2, {
|
|
268
269
|
type: "button",
|
|
269
270
|
variant: "ghost",
|
|
270
|
-
size: "
|
|
271
|
+
size: "inline",
|
|
271
272
|
onClick: column.getToggleSortingHandler(),
|
|
272
273
|
children: [
|
|
273
274
|
children,
|
|
@@ -12,6 +12,11 @@ interface IDataGridColumnMeta {
|
|
|
12
12
|
visibleFrom?: TableVisibility;
|
|
13
13
|
/** Takes the width the sized columns leave, so it has no fixed size of its own. */
|
|
14
14
|
fill?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Other columns this header sorts with its own controls, such as a hidden column behind a second sort button. The
|
|
17
|
+
* header's `aria-sort` reports whichever of them, or the column itself, is sorted.
|
|
18
|
+
*/
|
|
19
|
+
sortColumnIds?: readonly string[];
|
|
15
20
|
}
|
|
16
21
|
declare const dataGridFeatures: {
|
|
17
22
|
columnFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
DataGridHeaderRows,
|
|
11
11
|
DataGridCells2,
|
|
12
12
|
DataGridColumns
|
|
13
|
-
} from "../../chunk-
|
|
13
|
+
} from "../../chunk-h5kjmt32.js";
|
|
14
14
|
import {
|
|
15
15
|
VirtualTable2
|
|
16
|
-
} from "../../chunk-
|
|
16
|
+
} from "../../chunk-efs4bk5b.js";
|
|
17
17
|
|
|
18
18
|
// src/components/virtual-data-grid/VirtualDataGrid.tsx
|
|
19
19
|
import { useRef } from "react";
|
package/llms/setup.md
CHANGED
|
@@ -304,7 +304,7 @@ Compose `QuestionnaireItem`, `QuestionnaireTitle`, and answer controls inside `Q
|
|
|
304
304
|
|
|
305
305
|
`VirtualTable` renders a bounded, dynamically measured set of native table rows using TanStack Virtual. Supply `items`, stable `getItemKey`, `header`, `label`, and `renderRow`; spread the supplied measurement props onto each native row. Optional `columns` accepts a `TableColumnGroup`; responsive columns keep their widths aligned with cells that share their `visibleFrom`. `maxHeight` defaults to `65vh`, `estimateRowHeight` to 80 pixels, and `overscan` to five rows. `retainedKeys` keeps editing rows mounted; the focused row is retained automatically. Filtering and selection belong to the consumer.
|
|
306
306
|
|
|
307
|
-
`VirtualDataGrid` renders a TanStack Table instance built with `dataGridFeatures` through `VirtualTable`: every filtered and sorted row, without pagination, in a fixed-layout table. Column `meta` sets `label`, `textAlign`, `truncate`, `visibleFrom`, and `
|
|
307
|
+
`VirtualDataGrid` renders a TanStack Table instance built with `dataGridFeatures` through `VirtualTable`: every filtered and sorted row, without pagination, in a fixed-layout table. Column `meta` sets `label`, `textAlign`, `truncate`, `visibleFrom`, `fill`, and `sortColumnIds`; a `fill` column takes the width the sized columns leave, and `sortColumnIds` names other columns the header sorts with its own buttons so its `aria-sort` reports them. Other resizable columns get a window-splitter handle that resizes by dragging, by the arrow keys, Home, and End, and resets on double-click. Set `columnResizeMode: "onChange"` so columns follow the pointer while dragging; TanStack's default `"onEnd"` resizes only on release. Widths change through CSS variables, so a `useTable` selector can omit `columnSizing` and `columnResizing` to keep resizing from rendering rows. `renderRow` receives each row and its measurement props; spread the props onto a `TableRow` and render `DataGridCells` inside it to wrap rows in menus or drag sources. `retainedRowIds` keeps rows mounted while they hold editors. `DataGridColumnOptions` shows, hides, and reorders the columns that allow hiding; its reset restores the table's initial visibility, order, and sizes.
|
|
308
308
|
|
|
309
309
|
`StarRating` takes a controlled numeric `value` from 0 to 5, `onValueChange`, and an accessible `label`. Its native radio buttons support keyboard selection and an Unrated option to clear the rating. Set `disabled` while saving. `Avatar shape="square"` displays square artwork with matching image, fallback, and border corners.
|
|
310
310
|
|