@versini/ui-datagrid 0.3.6 → 0.3.8
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 +46 -48
- package/dist/DataGrid/DataGrid.js +7 -7
- package/dist/DataGrid/DataGridContext.js +1 -1
- package/dist/DataGrid/index.js +1 -1
- package/dist/DataGridAnimated/AnimatedWrapper.js +1 -1
- package/dist/DataGridAnimated/index.js +1 -1
- package/dist/DataGridAnimated/useAnimatedHeight.js +1 -1
- package/dist/DataGridBody/DataGridBody.js +13 -11
- package/dist/DataGridBody/index.js +1 -1
- package/dist/DataGridCell/DataGridCell.d.ts +1 -12
- package/dist/DataGridCell/DataGridCell.js +5 -57
- package/dist/DataGridCell/index.js +1 -1
- package/dist/DataGridCellSort/DataGridCellSort.js +3 -3
- package/dist/DataGridCellSort/index.js +1 -1
- package/dist/DataGridConstants/DataGridConstants.js +1 -1
- package/dist/DataGridConstants/index.js +1 -1
- package/dist/DataGridFooter/DataGridFooter.d.ts +0 -15
- package/dist/DataGridFooter/DataGridFooter.js +6 -42
- package/dist/DataGridFooter/index.js +1 -1
- package/dist/DataGridHeader/DataGridHeader.d.ts +0 -27
- package/dist/DataGridHeader/DataGridHeader.js +6 -54
- package/dist/DataGridHeader/index.js +1 -1
- package/dist/DataGridInfinite/InfiniteScrollMarker.js +1 -1
- package/dist/DataGridInfinite/index.js +1 -1
- package/dist/DataGridInfinite/useInfiniteScroll.js +1 -1
- package/dist/DataGridRow/DataGridRow.d.ts +1 -1
- package/dist/DataGridRow/DataGridRow.js +12 -34
- package/dist/DataGridRow/index.js +1 -1
- package/dist/DataGridSorting/index.js +1 -1
- package/dist/DataGridSorting/sortingUtils.js +1 -1
- package/dist/utilities/classes.d.ts +150 -0
- package/dist/utilities/classes.js +249 -0
- package/package.json +2 -2
- package/dist/DataGrid/utilities.d.ts +0 -44
- package/dist/DataGrid/utilities.js +0 -92
- package/dist/common/utilities.d.ts +0 -15
- package/dist/common/utilities.js +0 -48
package/README.md
CHANGED
|
@@ -107,11 +107,7 @@ function MyTable({ data }) {
|
|
|
107
107
|
Use the `columns` prop to define column widths with CSS Grid track sizes:
|
|
108
108
|
|
|
109
109
|
```tsx
|
|
110
|
-
<DataGrid
|
|
111
|
-
columns={["200px", "1fr", "auto"]}
|
|
112
|
-
maxHeight="400px"
|
|
113
|
-
stickyHeader
|
|
114
|
-
>
|
|
110
|
+
<DataGrid columns={["200px", "1fr", "auto"]} maxHeight="400px" stickyHeader>
|
|
115
111
|
<DataGridHeader caption="User List">
|
|
116
112
|
<DataGridRow>
|
|
117
113
|
<DataGridCell>Name</DataGridCell>
|
|
@@ -132,6 +128,7 @@ Use the `columns` prop to define column widths with CSS Grid track sizes:
|
|
|
132
128
|
```
|
|
133
129
|
|
|
134
130
|
Supported column values include:
|
|
131
|
+
|
|
135
132
|
- Fixed sizes: `"200px"`, `"10rem"`, `"5em"`
|
|
136
133
|
- Flexible sizes: `"1fr"`, `"2fr"`
|
|
137
134
|
- Auto sizing: `"auto"`, `"min-content"`, `"max-content"`
|
|
@@ -269,66 +266,67 @@ function MySortableTable({ data }) {
|
|
|
269
266
|
|
|
270
267
|
### DataGrid
|
|
271
268
|
|
|
272
|
-
| Prop | Type | Default | Description
|
|
273
|
-
| ------------------ | ----------------------------------------------- | ---------- |
|
|
274
|
-
| `mode` | `'dark' \| 'light' \| 'system' \| 'alt-system'` | `'system'` | Theme mode
|
|
275
|
-
| `compact` | `boolean` | `false` | Reduced padding
|
|
276
|
-
| `stickyHeader` | `boolean` | `false` | Fixed header while scrolling
|
|
277
|
-
| `stickyFooter` | `boolean` | `false` | Fixed footer while scrolling
|
|
278
|
-
| `blurEffect` | `'none' \| 'small' \| 'medium' \| 'large'` | `'none'` | Blur intensity for sticky elements
|
|
279
|
-
| `maxHeight` | `string` | - | Max height (required for sticky)
|
|
280
|
-
| `disabled` | `boolean` | `false` | Show loading overlay with spinner
|
|
281
|
-
| `columns` | `string[]` | - | CSS Grid track sizes for column widths
|
|
282
|
-
| `summary` | `string` | - | Alternative text for screen readers
|
|
283
|
-
| `className` | `string` | - | CSS class for the grid element
|
|
284
|
-
| `wrapperClassName` | `string` | - | CSS class for the wrapper container
|
|
269
|
+
| Prop | Type | Default | Description |
|
|
270
|
+
| ------------------ | ----------------------------------------------- | ---------- | -------------------------------------- |
|
|
271
|
+
| `mode` | `'dark' \| 'light' \| 'system' \| 'alt-system'` | `'system'` | Theme mode |
|
|
272
|
+
| `compact` | `boolean` | `false` | Reduced padding |
|
|
273
|
+
| `stickyHeader` | `boolean` | `false` | Fixed header while scrolling |
|
|
274
|
+
| `stickyFooter` | `boolean` | `false` | Fixed footer while scrolling |
|
|
275
|
+
| `blurEffect` | `'none' \| 'small' \| 'medium' \| 'large'` | `'none'` | Blur intensity for sticky elements |
|
|
276
|
+
| `maxHeight` | `string` | - | Max height (required for sticky) |
|
|
277
|
+
| `disabled` | `boolean` | `false` | Show loading overlay with spinner |
|
|
278
|
+
| `columns` | `string[]` | - | CSS Grid track sizes for column widths |
|
|
279
|
+
| `summary` | `string` | - | Alternative text for screen readers |
|
|
280
|
+
| `className` | `string` | - | CSS class for the grid element |
|
|
281
|
+
| `wrapperClassName` | `string` | - | CSS class for the wrapper container |
|
|
285
282
|
|
|
286
283
|
### DataGridHeader
|
|
287
284
|
|
|
288
|
-
| Prop | Type | Default | Description
|
|
289
|
-
| ------------------ | ----------- | ------- |
|
|
285
|
+
| Prop | Type | Default | Description |
|
|
286
|
+
| ------------------ | ----------- | ------- | ---------------------------------------- |
|
|
290
287
|
| `caption` | `ReactNode` | - | Caption/title displayed above header row |
|
|
291
|
-
| `captionClassName` | `string` | - | CSS class for the caption element
|
|
292
|
-
| `className` | `string` | - | CSS class for the header
|
|
288
|
+
| `captionClassName` | `string` | - | CSS class for the caption element |
|
|
289
|
+
| `className` | `string` | - | CSS class for the header |
|
|
293
290
|
|
|
294
291
|
### DataGridBody / DataGridFooter
|
|
295
292
|
|
|
296
|
-
| Prop | Type | Default | Description
|
|
297
|
-
| ----------- | -------- | ------- |
|
|
293
|
+
| Prop | Type | Default | Description |
|
|
294
|
+
| ----------- | -------- | ------- | ------------------------- |
|
|
298
295
|
| `className` | `string` | - | CSS class for the element |
|
|
299
296
|
|
|
300
297
|
### DataGridRow
|
|
301
298
|
|
|
302
|
-
| Prop | Type | Default | Description
|
|
303
|
-
| ----------- | --------- | ------- |
|
|
304
|
-
| `active` | `boolean` | `false` | Show left border indicator
|
|
305
|
-
| `className` | `string` | - | CSS class for the row
|
|
299
|
+
| Prop | Type | Default | Description |
|
|
300
|
+
| ----------- | --------- | ------- | ------------------------------------------------------- |
|
|
301
|
+
| `active` | `boolean` | `false` | Show left border indicator on the first cell of the row |
|
|
302
|
+
| `className` | `string` | - | CSS class for the row |
|
|
306
303
|
|
|
307
304
|
### DataGridCell
|
|
308
305
|
|
|
309
|
-
| Prop
|
|
310
|
-
|
|
|
311
|
-
| `align`
|
|
312
|
-
| `colSpan`
|
|
313
|
-
| `
|
|
314
|
-
| `
|
|
306
|
+
| Prop | Type | Default | Description |
|
|
307
|
+
| ------------- | ------------------------------- | -------- | --------------------------------- |
|
|
308
|
+
| `align` | `'left' \| 'center' \| 'right'` | `'left'` | Horizontal alignment |
|
|
309
|
+
| `colSpan` | `number` | `1` | Number of columns to span |
|
|
310
|
+
| `borderLeft` | `boolean` | `false` | Add vertical border on left side |
|
|
311
|
+
| `borderRight` | `boolean` | `false` | Add vertical border on right side |
|
|
312
|
+
| `className` | `string` | - | CSS class for the cell |
|
|
315
313
|
|
|
316
314
|
### DataGridCellSort
|
|
317
315
|
|
|
318
|
-
| Prop | Type | Default | Description
|
|
319
|
-
| ----------------- | ----------------------------------------------- | -------------- |
|
|
320
|
-
| `cellId` | `string` | **required** | Unique identifier for the column
|
|
321
|
-
| `children` | `string` | **required** | Label text for the column header
|
|
322
|
-
| `onSort` | `(cellId, direction?) => void` | - | Handler when sort button is clicked
|
|
323
|
-
| `sortDirection` | `'asc' \| 'desc' \| false` | **required** | Current sort direction
|
|
324
|
-
| `sortedCell` | `string` | **required** | ID of the currently sorted column
|
|
325
|
-
| `align` | `'left' \| 'center' \| 'right'` | `'left'` | Horizontal alignment
|
|
326
|
-
| `mode` | `'dark' \| 'light' \| 'system' \| 'alt-system'` | `'alt-system'` | Theme mode for sort button
|
|
327
|
-
| `focusMode` | `'dark' \| 'light' \| 'system' \| 'alt-system'` | `'alt-system'` | Focus mode for sort button
|
|
328
|
-
| `slotLeft` | `ReactNode` | - | Content to display left of label
|
|
329
|
-
| `slotRight` | `ReactNode` | - | Content to display right of label
|
|
330
|
-
| `className` | `string` | - | CSS class for the cell
|
|
331
|
-
| `buttonClassName` | `string` | - | CSS class for the sort button
|
|
316
|
+
| Prop | Type | Default | Description |
|
|
317
|
+
| ----------------- | ----------------------------------------------- | -------------- | ----------------------------------- |
|
|
318
|
+
| `cellId` | `string` | **required** | Unique identifier for the column |
|
|
319
|
+
| `children` | `string` | **required** | Label text for the column header |
|
|
320
|
+
| `onSort` | `(cellId, direction?) => void` | - | Handler when sort button is clicked |
|
|
321
|
+
| `sortDirection` | `'asc' \| 'desc' \| false` | **required** | Current sort direction |
|
|
322
|
+
| `sortedCell` | `string` | **required** | ID of the currently sorted column |
|
|
323
|
+
| `align` | `'left' \| 'center' \| 'right'` | `'left'` | Horizontal alignment |
|
|
324
|
+
| `mode` | `'dark' \| 'light' \| 'system' \| 'alt-system'` | `'alt-system'` | Theme mode for sort button |
|
|
325
|
+
| `focusMode` | `'dark' \| 'light' \| 'system' \| 'alt-system'` | `'alt-system'` | Focus mode for sort button |
|
|
326
|
+
| `slotLeft` | `ReactNode` | - | Content to display left of label |
|
|
327
|
+
| `slotRight` | `ReactNode` | - | Content to display right of label |
|
|
328
|
+
| `className` | `string` | - | CSS class for the cell |
|
|
329
|
+
| `buttonClassName` | `string` | - | CSS class for the sort button |
|
|
332
330
|
|
|
333
331
|
### useInfiniteScroll
|
|
334
332
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v0.3.
|
|
2
|
+
@versini/ui-datagrid v0.3.8
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { useCallback, useMemo, useState } from "react";
|
|
8
8
|
import { BlurEffects } from "../DataGridConstants/DataGridConstants.js";
|
|
9
|
+
import { getDataGridClasses } from "../utilities/classes.js";
|
|
9
10
|
import { DataGridContext } from "./DataGridContext.js";
|
|
10
|
-
import { getDataGridClasses } from "./utilities.js";
|
|
11
11
|
|
|
12
12
|
;// CONCATENATED MODULE: external "react/jsx-runtime"
|
|
13
13
|
|
|
@@ -15,9 +15,9 @@ import { getDataGridClasses } from "./utilities.js";
|
|
|
15
15
|
|
|
16
16
|
;// CONCATENATED MODULE: external "../DataGridConstants/DataGridConstants.js"
|
|
17
17
|
|
|
18
|
-
;// CONCATENATED MODULE: external "
|
|
18
|
+
;// CONCATENATED MODULE: external "../utilities/classes.js"
|
|
19
19
|
|
|
20
|
-
;// CONCATENATED MODULE: external "./
|
|
20
|
+
;// CONCATENATED MODULE: external "./DataGridContext.js"
|
|
21
21
|
|
|
22
22
|
;// CONCATENATED MODULE: ./src/DataGrid/DataGrid.tsx
|
|
23
23
|
|
|
@@ -42,9 +42,9 @@ import { getDataGridClasses } from "./utilities.js";
|
|
|
42
42
|
*/ const [headerHeight, setHeaderHeight] = useState(0);
|
|
43
43
|
const [footerHeight, setFooterHeight] = useState(0);
|
|
44
44
|
/**
|
|
45
|
-
* Track measured column widths from the body. Used by sticky header/footer
|
|
46
|
-
*
|
|
47
|
-
*
|
|
45
|
+
* Track measured column widths from the body. Used by sticky header/footer to
|
|
46
|
+
* sync column widths since absolutely positioned elements can't use CSS
|
|
47
|
+
* subgrid.
|
|
48
48
|
*/ const [measuredColumnWidths, setMeasuredColumnWidths] = useState([]);
|
|
49
49
|
/**
|
|
50
50
|
* Registration callbacks with stable references. Called by
|
package/dist/DataGrid/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v0.3.
|
|
2
|
+
@versini/ui-datagrid v0.3.8
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -32,17 +32,19 @@ import { CellWrapper } from "../DataGridConstants/index.js";
|
|
|
32
32
|
const bodyRef = useRef(null);
|
|
33
33
|
/**
|
|
34
34
|
* Measure column widths from the first body row's cells. This is needed
|
|
35
|
-
* because sticky header/footer are absolutely positioned and can't use
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* because sticky header/footer are absolutely positioned and can't use CSS
|
|
36
|
+
* subgrid. We measure the body cells (which ARE in the grid flow) and report
|
|
37
|
+
* the widths so header/footer can use the same pixel values.
|
|
38
38
|
*/ useLayoutEffect(()=>{
|
|
39
39
|
const element = bodyRef.current;
|
|
40
40
|
const needsMeasurement = ctx.columns && (ctx.stickyHeader || ctx.stickyFooter);
|
|
41
41
|
if (!element || !needsMeasurement || !ctx.setMeasuredColumnWidths) {
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Find the first row and its cells once, reuse for both measurement and
|
|
46
|
+
* observation.
|
|
47
|
+
*/ const firstRow = element.querySelector('[role="row"]');
|
|
46
48
|
if (!firstRow) {
|
|
47
49
|
return;
|
|
48
50
|
}
|
|
@@ -51,19 +53,19 @@ import { CellWrapper } from "../DataGridConstants/index.js";
|
|
|
51
53
|
return;
|
|
52
54
|
}
|
|
53
55
|
const measureColumns = ()=>{
|
|
54
|
-
// Measure each cell's width
|
|
56
|
+
// Measure each cell's width.
|
|
55
57
|
const widths = Array.from(cells).map((cell)=>cell.getBoundingClientRect().width);
|
|
56
58
|
ctx.setMeasuredColumnWidths?.(widths);
|
|
57
59
|
};
|
|
58
|
-
// Initial measurement
|
|
60
|
+
// Initial measurement.
|
|
59
61
|
measureColumns();
|
|
60
|
-
// Set up ResizeObserver to re-measure when cells resize
|
|
62
|
+
// Set up ResizeObserver to re-measure when cells resize.
|
|
61
63
|
const observer = new ResizeObserver(()=>{
|
|
62
64
|
measureColumns();
|
|
63
65
|
});
|
|
64
|
-
// Observe the body element for any size changes
|
|
66
|
+
// Observe the body element for any size changes.
|
|
65
67
|
observer.observe(element);
|
|
66
|
-
// Also observe the first row's cells directly for more accurate updates
|
|
68
|
+
// Also observe the first row's cells directly for more accurate updates.
|
|
67
69
|
for (const cell of cells){
|
|
68
70
|
observer.observe(cell);
|
|
69
71
|
}
|
|
@@ -1,13 +1,2 @@
|
|
|
1
1
|
import type { DataGridCellProps } from "../DataGrid/DataGridTypes";
|
|
2
|
-
|
|
3
|
-
export declare const getCellClasses: ({ cellWrapper, className, compact, align, active, mode, borderLeft, borderRight, }: {
|
|
4
|
-
cellWrapper?: CellWrapperType;
|
|
5
|
-
className?: string;
|
|
6
|
-
mode?: ThemeMode;
|
|
7
|
-
compact?: boolean;
|
|
8
|
-
align?: "left" | "center" | "right";
|
|
9
|
-
active?: boolean;
|
|
10
|
-
borderLeft?: boolean;
|
|
11
|
-
borderRight?: boolean;
|
|
12
|
-
}) => string;
|
|
13
|
-
export declare const DataGridCell: ({ className, children, align, active, borderLeft, borderRight, colSpan, style, ...rest }: DataGridCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const DataGridCell: ({ className, children, align, borderLeft, borderRight, colSpan, style, ...rest }: DataGridCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,76 +1,25 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v0.3.
|
|
2
|
+
@versini/ui-datagrid v0.3.8
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
import { clsx } from "clsx";
|
|
8
7
|
import { DataGridContext } from "../DataGrid/DataGridContext.js";
|
|
9
|
-
import {
|
|
8
|
+
import { getCellClasses, getCellRole } from "../utilities/classes.js";
|
|
10
9
|
|
|
11
10
|
;// CONCATENATED MODULE: external "react/jsx-runtime"
|
|
12
11
|
|
|
13
|
-
;// CONCATENATED MODULE: external "clsx"
|
|
14
|
-
|
|
15
12
|
;// CONCATENATED MODULE: external "../DataGrid/DataGridContext.js"
|
|
16
13
|
|
|
17
|
-
;// CONCATENATED MODULE: external "../
|
|
14
|
+
;// CONCATENATED MODULE: external "../utilities/classes.js"
|
|
18
15
|
|
|
19
16
|
;// CONCATENATED MODULE: ./src/DataGridCell/DataGridCell.tsx
|
|
20
17
|
|
|
21
18
|
|
|
22
19
|
|
|
23
|
-
|
|
24
|
-
const getCellClasses = ({ cellWrapper, className, compact, align, active, mode, borderLeft, borderRight })=>{
|
|
25
|
-
const isHeader = cellWrapper === CellWrapper.HEADER;
|
|
26
|
-
const mainClasses = clsx(// Base padding.
|
|
27
|
-
{
|
|
28
|
-
"px-2 py-1": compact,
|
|
29
|
-
"px-4 py-3": !compact
|
|
30
|
-
}, // Text alignment.
|
|
31
|
-
{
|
|
32
|
-
"text-left justify-start": align === "left" || !align,
|
|
33
|
-
"text-center justify-center": align === "center",
|
|
34
|
-
"text-right justify-end": align === "right"
|
|
35
|
-
}, // Header/footer specific styles.
|
|
36
|
-
{
|
|
37
|
-
"font-semibold": isHeader
|
|
38
|
-
}, // Active row indicator (left border on first cell).
|
|
39
|
-
{
|
|
40
|
-
"relative before:absolute before:left-0 before:top-0 before:bottom-0 before:w-1": active,
|
|
41
|
-
"before:bg-table-active-dark": active && mode === "dark",
|
|
42
|
-
"before:bg-table-active-light": active && mode === "light",
|
|
43
|
-
"before:bg-table-active-dark dark:before:bg-table-active-light": active && mode === "system",
|
|
44
|
-
"before:bg-table-active-light dark:before:bg-table-active-dark": active && mode === "alt-system"
|
|
45
|
-
}, /**
|
|
46
|
-
* Vertical borders and active indicator. self-stretch ensures border spans
|
|
47
|
-
* full row height in grid layout. When stretching, use flex + items-center
|
|
48
|
-
* to maintain vertical centering of content.
|
|
49
|
-
*/ {
|
|
50
|
-
"self-stretch flex items-center": borderLeft || borderRight || active,
|
|
51
|
-
"border-l border-l-table-dark": borderLeft && mode === "dark",
|
|
52
|
-
"border-l border-l-table-light": borderLeft && mode === "light",
|
|
53
|
-
"border-l border-l-table-dark dark:border-l-table-light": borderLeft && mode === "system",
|
|
54
|
-
"border-l border-l-table-light dark:border-l-table-dark": borderLeft && mode === "alt-system",
|
|
55
|
-
"border-r border-r-table-dark": borderRight && mode === "dark",
|
|
56
|
-
"border-r border-r-table-light": borderRight && mode === "light",
|
|
57
|
-
"border-r border-r-table-dark dark:border-r-table-light": borderRight && mode === "system",
|
|
58
|
-
"border-r border-r-table-light dark:border-r-table-dark": borderRight && mode === "alt-system"
|
|
59
|
-
}, className);
|
|
60
|
-
return mainClasses;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Returns the appropriate ARIA role for the cell based on the cell wrapper
|
|
64
|
-
* type.
|
|
65
|
-
*/ const getCellRole = (cellWrapper)=>{
|
|
66
|
-
if (cellWrapper === CellWrapper.HEADER) {
|
|
67
|
-
return "columnheader";
|
|
68
|
-
}
|
|
69
|
-
return "gridcell";
|
|
70
|
-
};
|
|
71
20
|
/* =============================================================================
|
|
72
21
|
* DataGridCell
|
|
73
|
-
* ========================================================================== */ const DataGridCell = ({ className, children, align,
|
|
22
|
+
* ========================================================================== */ const DataGridCell = ({ className, children, align, borderLeft, borderRight, colSpan, style, ...rest })=>{
|
|
74
23
|
return /*#__PURE__*/ jsx(DataGridContext.Consumer, {
|
|
75
24
|
children: ({ mode, compact, cellWrapper })=>{
|
|
76
25
|
const mainClasses = getCellClasses({
|
|
@@ -79,7 +28,6 @@ const getCellClasses = ({ cellWrapper, className, compact, align, active, mode,
|
|
|
79
28
|
mode,
|
|
80
29
|
compact,
|
|
81
30
|
align,
|
|
82
|
-
active,
|
|
83
31
|
borderLeft,
|
|
84
32
|
borderRight
|
|
85
33
|
});
|
|
@@ -100,4 +48,4 @@ const getCellClasses = ({ cellWrapper, className, compact, align, active, mode,
|
|
|
100
48
|
});
|
|
101
49
|
};
|
|
102
50
|
|
|
103
|
-
export { DataGridCell
|
|
51
|
+
export { DataGridCell };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v0.3.
|
|
2
|
+
@versini/ui-datagrid v0.3.8
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@ import { ButtonSort_private } from "@versini/ui-button/private";
|
|
|
8
8
|
import { IconSort, IconSortDown, IconSortUp } from "@versini/ui-icons";
|
|
9
9
|
import clsx from "clsx";
|
|
10
10
|
import { DataGridContext } from "../DataGrid/DataGridContext.js";
|
|
11
|
-
import { getCellClasses } from "../
|
|
11
|
+
import { getCellClasses } from "../utilities/classes.js";
|
|
12
12
|
|
|
13
13
|
;// CONCATENATED MODULE: external "react/jsx-runtime"
|
|
14
14
|
|
|
@@ -20,7 +20,7 @@ import { getCellClasses } from "../DataGridCell/DataGridCell.js";
|
|
|
20
20
|
|
|
21
21
|
;// CONCATENATED MODULE: external "../DataGrid/DataGridContext.js"
|
|
22
22
|
|
|
23
|
-
;// CONCATENATED MODULE: external "../
|
|
23
|
+
;// CONCATENATED MODULE: external "../utilities/classes.js"
|
|
24
24
|
|
|
25
25
|
;// CONCATENATED MODULE: ./src/DataGridCellSort/DataGridCellSort.tsx
|
|
26
26
|
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
import type { DataGridFooterProps } from "../DataGrid/DataGridTypes";
|
|
2
|
-
import { type BlurEffect, type ThemeMode } from "../DataGridConstants/DataGridConstants";
|
|
3
|
-
/**
|
|
4
|
-
* Generates classes for the DataGridFooter.
|
|
5
|
-
*
|
|
6
|
-
* When columns are provided (subgrid mode), uses display:contents so the footer
|
|
7
|
-
* doesn't break the parent grid flow.
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
export declare const getFooterClasses: ({ className, stickyFooter, mode, blurEffect, hasColumns, }: {
|
|
11
|
-
mode: ThemeMode;
|
|
12
|
-
blurEffect?: BlurEffect;
|
|
13
|
-
className?: string;
|
|
14
|
-
hasColumns?: boolean;
|
|
15
|
-
stickyFooter?: boolean;
|
|
16
|
-
}) => string;
|
|
17
2
|
export declare const DataGridFooter: {
|
|
18
3
|
({ className, children, ...rest }: DataGridFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
19
4
|
displayName: string;
|
|
@@ -1,66 +1,30 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v0.3.
|
|
2
|
+
@versini/ui-datagrid v0.3.8
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
import clsx from "clsx";
|
|
8
7
|
import { useEffect, useLayoutEffect, useRef } from "react";
|
|
9
|
-
import { getHeaderFooterBackgroundClasses, getStickyBlurClasses } from "../common/utilities.js";
|
|
10
8
|
import { DataGridContext } from "../DataGrid/DataGridContext.js";
|
|
11
|
-
import {
|
|
9
|
+
import { CellWrapper } from "../DataGridConstants/DataGridConstants.js";
|
|
10
|
+
import { getFooterClasses } from "../utilities/classes.js";
|
|
12
11
|
|
|
13
12
|
;// CONCATENATED MODULE: external "react/jsx-runtime"
|
|
14
13
|
|
|
15
|
-
;// CONCATENATED MODULE: external "clsx"
|
|
16
|
-
|
|
17
14
|
;// CONCATENATED MODULE: external "react"
|
|
18
15
|
|
|
19
|
-
;// CONCATENATED MODULE: external "../common/utilities.js"
|
|
20
|
-
|
|
21
16
|
;// CONCATENATED MODULE: external "../DataGrid/DataGridContext.js"
|
|
22
17
|
|
|
23
18
|
;// CONCATENATED MODULE: external "../DataGridConstants/DataGridConstants.js"
|
|
24
19
|
|
|
25
|
-
;// CONCATENATED MODULE:
|
|
20
|
+
;// CONCATENATED MODULE: external "../utilities/classes.js"
|
|
26
21
|
|
|
22
|
+
;// CONCATENATED MODULE: ./src/DataGridFooter/DataGridFooter.tsx
|
|
27
23
|
|
|
28
24
|
|
|
29
25
|
|
|
30
26
|
|
|
31
27
|
|
|
32
|
-
/**
|
|
33
|
-
* Generates classes for the DataGridFooter.
|
|
34
|
-
*
|
|
35
|
-
* When columns are provided (subgrid mode), uses display:contents so the footer
|
|
36
|
-
* doesn't break the parent grid flow.
|
|
37
|
-
*
|
|
38
|
-
*/ const getFooterClasses = ({ className, stickyFooter, mode, blurEffect, hasColumns })=>{
|
|
39
|
-
/**
|
|
40
|
-
* When columns are provided and not sticky, use display:contents so the
|
|
41
|
-
* rowgroup doesn't interfere with the grid flow. The rows will use subgrid.
|
|
42
|
-
*/ if (hasColumns && !stickyFooter) {
|
|
43
|
-
return clsx("contents", className);
|
|
44
|
-
}
|
|
45
|
-
const hasBlur = Boolean(blurEffect && blurEffect !== BlurEffects.NONE);
|
|
46
|
-
return clsx("flex flex-col", {
|
|
47
|
-
/**
|
|
48
|
-
* Absolute positioning like Panel's footer: absolute left-0 right-0 z-20
|
|
49
|
-
* bottom-0 rounded-b-lg to match the wrapper's rounded-lg corners.
|
|
50
|
-
*/ "absolute left-0 right-0 z-20 bottom-0 rounded-b-lg": stickyFooter,
|
|
51
|
-
// Shadow for visual depth (upward glow).
|
|
52
|
-
"shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem]": stickyFooter && mode === "dark",
|
|
53
|
-
"shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem] dark:shadow-[rgb(65_65_65_/30%)_0_-0.5rem_1rem]": stickyFooter && mode === "system",
|
|
54
|
-
"shadow-[rgb(65_65_65_/30%)_0_-0.5rem_1rem]": stickyFooter && mode === "light",
|
|
55
|
-
"shadow-[rgb(65_65_65_/30%)_0_-0.5rem_1rem] dark:shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem]": stickyFooter && mode === "alt-system"
|
|
56
|
-
}, getHeaderFooterBackgroundClasses({
|
|
57
|
-
mode,
|
|
58
|
-
hasBlur,
|
|
59
|
-
sticky: Boolean(stickyFooter)
|
|
60
|
-
}), stickyFooter && getStickyBlurClasses({
|
|
61
|
-
blurEffect
|
|
62
|
-
}), className);
|
|
63
|
-
};
|
|
64
28
|
/* =============================================================================
|
|
65
29
|
* DataGridFooter
|
|
66
30
|
* ========================================================================== */ const DataGridFooter = ({ className, children, ...rest })=>{
|
|
@@ -133,4 +97,4 @@ DataGridFooter.displayName = "DataGridFooter";
|
|
|
133
97
|
});
|
|
134
98
|
};
|
|
135
99
|
|
|
136
|
-
export { DataGridFooter
|
|
100
|
+
export { DataGridFooter };
|
|
@@ -1,31 +1,4 @@
|
|
|
1
1
|
import type { DataGridHeaderProps } from "../DataGrid/DataGridTypes";
|
|
2
|
-
import { type BlurEffect, type ThemeMode } from "../DataGridConstants/DataGridConstants";
|
|
3
|
-
/**
|
|
4
|
-
* Generates classes for the DataGridHeader wrapper.
|
|
5
|
-
*
|
|
6
|
-
* When stickyHeader is true, uses position:absolute so the header overlays the
|
|
7
|
-
* scrollbar area. The parent DataGrid auto-detects caption presence and applies
|
|
8
|
-
* appropriate padding to the scrollable content.
|
|
9
|
-
*
|
|
10
|
-
* When columns are provided (subgrid mode) and not sticky, uses
|
|
11
|
-
* display:contents so the header doesn't break the parent grid flow.
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
export declare const getHeaderClasses: ({ className, stickyHeader, mode, blurEffect, hasColumns, }: {
|
|
15
|
-
mode: ThemeMode;
|
|
16
|
-
blurEffect?: BlurEffect;
|
|
17
|
-
className?: string;
|
|
18
|
-
hasColumns?: boolean;
|
|
19
|
-
stickyHeader?: boolean;
|
|
20
|
-
}) => string;
|
|
21
|
-
/**
|
|
22
|
-
* Generates classes for the caption element inside DataGridHeader. When
|
|
23
|
-
* hasColumns is true (subgrid mode), adds col-span-full to span all columns.
|
|
24
|
-
*/
|
|
25
|
-
export declare const getCaptionClasses: ({ captionClassName, hasColumns, }: {
|
|
26
|
-
captionClassName?: string;
|
|
27
|
-
hasColumns?: boolean;
|
|
28
|
-
}) => string;
|
|
29
2
|
export declare const DataGridHeader: {
|
|
30
3
|
({ caption, captionClassName, className, children, ...rest }: DataGridHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
31
4
|
displayName: string;
|