@versini/ui-datagrid 1.2.0 → 1.3.1
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 +11 -1
- package/dist/{926.js → 415.js} +2 -3
- package/dist/{298.js → 76.js} +4 -3
- package/dist/{131.js → 763.js} +6 -3
- package/dist/{46.js → 772.js} +1 -1
- package/dist/DataGrid/DataGridTypes.d.ts +5 -0
- package/dist/DataGrid/index.js +9 -6
- package/dist/DataGridAnimated/index.js +5 -2
- package/dist/DataGridBody/DataGridBody.d.ts +1 -1
- package/dist/DataGridBody/index.js +10 -7
- package/dist/DataGridCell/index.js +5 -4
- package/dist/DataGridCellSort/index.js +10 -5
- package/dist/DataGridConstants/index.js +2 -2
- package/dist/DataGridFooter/index.js +8 -5
- package/dist/DataGridHeader/index.js +8 -5
- package/dist/DataGridInfinite/DataGridInfiniteBody.d.ts +4 -4
- package/dist/DataGridInfinite/index.js +10 -7
- package/dist/DataGridRow/index.js +8 -5
- package/dist/DataGridSorting/index.js +3 -3
- package/package.json +4 -4
- package/dist/511.js +0 -9
package/README.md
CHANGED
|
@@ -355,7 +355,15 @@ function MySortableTable({ data }) {
|
|
|
355
355
|
| `captionClassName` | `string` | - | CSS class for the caption element |
|
|
356
356
|
| `className` | `string` | - | CSS class for the header |
|
|
357
357
|
|
|
358
|
-
### DataGridBody
|
|
358
|
+
### DataGridBody
|
|
359
|
+
|
|
360
|
+
| Prop | Type | Default | Description |
|
|
361
|
+
| ------------ | --------- | ------- | -------------------------------------------------- |
|
|
362
|
+
| `noData` | `boolean` | `false` | Display empty state instead of children |
|
|
363
|
+
| `noDataText` | `string` | `'No Data'` | Custom text for the empty state |
|
|
364
|
+
| `className` | `string` | - | CSS class for the element |
|
|
365
|
+
|
|
366
|
+
### DataGridFooter
|
|
359
367
|
|
|
360
368
|
| Prop | Type | Default | Description |
|
|
361
369
|
| ----------- | -------- | ------- | ------------------------- |
|
|
@@ -405,6 +413,8 @@ function MySortableTable({ data }) {
|
|
|
405
413
|
| `threshold` | `number` | `5` | Items before marker to allow seamless scrolling |
|
|
406
414
|
| `rootMargin` | `string` | `'20px'`| IntersectionObserver margin |
|
|
407
415
|
| `onVisibleCountChange` | `(visibleCount: number, total: number) => void` | - | Callback when visible count changes |
|
|
416
|
+
| `noData` | `boolean` | `false` | Display empty state instead of infinite scroll |
|
|
417
|
+
| `noDataText` | `string` | `'No Data'` | Custom text for the empty state |
|
|
408
418
|
| `className` | `string` | - | CSS class for the body element |
|
|
409
419
|
| `ref` | `React.Ref<DataGridInfiniteBodyRef>` | - | Ref to access imperative methods |
|
|
410
420
|
|
package/dist/{926.js → 415.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v1.
|
|
2
|
+
@versini/ui-datagrid v1.3.1
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { createContext } from "
|
|
6
|
+
import { createContext } from "react";
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -12,4 +12,3 @@ const DataGridContext = createContext({
|
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
export { DataGridContext };
|
|
15
|
-
export { default as clsx } from "clsx";
|
package/dist/{298.js → 76.js}
RENAMED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v1.
|
|
2
|
+
@versini/ui-datagrid v1.3.1
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import { BlurEffects, CellWrapper } from "./
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import { BlurEffects, CellWrapper } from "./772.js";
|
|
8
|
+
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
|
package/dist/{131.js → 763.js}
RENAMED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v1.
|
|
2
|
+
@versini/ui-datagrid v1.3.1
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import { useContext, useLayoutEffect, useRef } from "react";
|
|
8
|
+
import { DataGridContext } from "./415.js";
|
|
9
|
+
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
/**
|
|
@@ -19,6 +21,7 @@ import { useRef, useContext, useLayoutEffect } from "./511.js";
|
|
|
19
21
|
|
|
20
22
|
|
|
21
23
|
|
|
24
|
+
|
|
22
25
|
/**
|
|
23
26
|
* Snap a CSS pixel value to the nearest device pixel.
|
|
24
27
|
*
|
package/dist/{46.js → 772.js}
RENAMED
|
@@ -109,6 +109,10 @@ export type DataGridBodyProps = ({
|
|
|
109
109
|
* The content of the body (DataGridRow elements).
|
|
110
110
|
*/
|
|
111
111
|
children?: React.ReactNode;
|
|
112
|
+
/**
|
|
113
|
+
* Custom text to display in the empty state. Defaults to "No Data".
|
|
114
|
+
*/
|
|
115
|
+
noDataText?: string;
|
|
112
116
|
} | {
|
|
113
117
|
/**
|
|
114
118
|
* If true, applies styles for an empty state (e.g. removing extra row borders).
|
|
@@ -120,6 +124,7 @@ export type DataGridBodyProps = ({
|
|
|
120
124
|
* The content of the body (DataGridRow elements).
|
|
121
125
|
*/
|
|
122
126
|
children: React.ReactNode;
|
|
127
|
+
noDataText?: never;
|
|
123
128
|
}) & {
|
|
124
129
|
/**
|
|
125
130
|
* CSS class to apply to the body.
|
package/dist/DataGrid/index.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v1.
|
|
2
|
+
@versini/ui-datagrid v1.3.1
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { useCallback, useMemo, useState } from "react";
|
|
8
|
+
import { BlurEffects } from "../772.js";
|
|
9
|
+
import { getDataGridClasses } from "../76.js";
|
|
10
|
+
import { DataGridContext } from "../415.js";
|
|
11
|
+
|
|
12
|
+
|
|
10
13
|
|
|
11
14
|
|
|
12
15
|
|
|
@@ -172,4 +175,4 @@ import { DataGridContext } from "../926.js";
|
|
|
172
175
|
|
|
173
176
|
|
|
174
177
|
export { DataGrid };
|
|
175
|
-
export { DataGridContext } from "../
|
|
178
|
+
export { DataGridContext } from "../415.js";
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v1.
|
|
2
|
+
@versini/ui-datagrid v1.3.1
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
8
|
+
|
|
9
|
+
|
|
7
10
|
|
|
8
11
|
|
|
9
12
|
const DEFAULT_ANIMATION_DURATION = 300;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { DataGridBodyProps } from "../DataGrid/DataGridTypes";
|
|
2
|
-
export declare const DataGridBody: ({ className, children, noData, ...rest }: DataGridBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const DataGridBody: ({ className, children, noData, noDataText, ...rest }: DataGridBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v1.
|
|
2
|
+
@versini/ui-datagrid v1.3.1
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { useContext, useRef } from "react";
|
|
8
|
+
import { DataGridContext } from "../415.js";
|
|
9
|
+
import { getBodyClass, useColumnMeasurement } from "../763.js";
|
|
10
|
+
import { CellWrapper } from "../772.js";
|
|
11
|
+
|
|
12
|
+
|
|
10
13
|
|
|
11
14
|
|
|
12
15
|
|
|
@@ -16,7 +19,7 @@ import { CellWrapper } from "../46.js";
|
|
|
16
19
|
|
|
17
20
|
/* =============================================================================
|
|
18
21
|
* DataGridBody
|
|
19
|
-
* ========================================================================== */ const DataGridBody = ({ className, children, noData = false, ...rest })=>{
|
|
22
|
+
* ========================================================================== */ const DataGridBody = ({ className, children, noData = false, noDataText, ...rest })=>{
|
|
20
23
|
const ctx = useContext(DataGridContext);
|
|
21
24
|
const bodyRef = useRef(null);
|
|
22
25
|
// Measure column widths for sticky header/footer sync.
|
|
@@ -43,7 +46,7 @@ import { CellWrapper } from "../46.js";
|
|
|
43
46
|
textAlign: "center",
|
|
44
47
|
width: "100%"
|
|
45
48
|
},
|
|
46
|
-
children:
|
|
49
|
+
children: noDataText ?? "No Data"
|
|
47
50
|
})
|
|
48
51
|
}) : children
|
|
49
52
|
})
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v1.
|
|
2
|
+
@versini/ui-datagrid v1.3.1
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { jsx } from "
|
|
7
|
-
import { DataGridContext } from "../
|
|
8
|
-
import { getCellRole, getCellClasses } from "../
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { DataGridContext } from "../415.js";
|
|
8
|
+
import { getCellRole, getCellClasses } from "../76.js";
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v1.
|
|
2
|
+
@versini/ui-datagrid v1.3.1
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { IconSort, IconSortDown, IconSortUp } from "@versini/ui-icons";
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import clsx from "clsx";
|
|
9
|
+
import { BlurEffects } from "../772.js";
|
|
10
|
+
import { getCellClasses, getTextColorClassesForHeaderFooter } from "../76.js";
|
|
11
|
+
import { DataGridContext } from "../415.js";
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
11
16
|
|
|
12
17
|
|
|
13
18
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v1.
|
|
2
|
+
@versini/ui-datagrid v1.3.1
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
export { BlurEffects, CellWrapper, SortDirections, ThemeModes } from "../
|
|
9
|
+
export { BlurEffects, CellWrapper, SortDirections, ThemeModes } from "../772.js";
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v1.
|
|
2
|
+
@versini/ui-datagrid v1.3.1
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { useEffect, useLayoutEffect, useRef } from "react";
|
|
8
|
+
import { DataGridContext } from "../415.js";
|
|
9
|
+
import { CellWrapper } from "../772.js";
|
|
10
|
+
import { getFooterClasses } from "../76.js";
|
|
11
|
+
|
|
12
|
+
|
|
10
13
|
|
|
11
14
|
|
|
12
15
|
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v1.
|
|
2
|
+
@versini/ui-datagrid v1.3.1
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { useEffect, useId, useLayoutEffect, useRef } from "react";
|
|
8
|
+
import { DataGridContext } from "../415.js";
|
|
9
|
+
import { CellWrapper } from "../772.js";
|
|
10
|
+
import { getCaptionClasses, getHeaderClasses } from "../76.js";
|
|
11
|
+
|
|
12
|
+
|
|
10
13
|
|
|
11
14
|
|
|
12
15
|
|
|
@@ -14,9 +14,9 @@ export type DataGridInfiniteBodyProps<T> = ({
|
|
|
14
14
|
*/
|
|
15
15
|
children?: (item: T, index: number) => React.ReactNode;
|
|
16
16
|
/**
|
|
17
|
-
* Custom
|
|
17
|
+
* Custom text to display in the empty state. Defaults to "No Data".
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
noDataText?: string;
|
|
20
20
|
} | {
|
|
21
21
|
/**
|
|
22
22
|
* If true, displays an empty state instead of infinite scroll content.
|
|
@@ -32,7 +32,7 @@ export type DataGridInfiniteBodyProps<T> = ({
|
|
|
32
32
|
* consumer is responsible for providing the key prop on the returned element.
|
|
33
33
|
*/
|
|
34
34
|
children: (item: T, index: number) => React.ReactNode;
|
|
35
|
-
|
|
35
|
+
noDataText?: never;
|
|
36
36
|
}) & {
|
|
37
37
|
/**
|
|
38
38
|
* Number of items to show initially and to add on each scroll.
|
|
@@ -113,6 +113,6 @@ export type DataGridInfiniteBodyRef = {
|
|
|
113
113
|
* ```
|
|
114
114
|
*
|
|
115
115
|
*/
|
|
116
|
-
export declare function DataGridInfiniteBody<T>({ data, children: renderRow, batchSize, threshold, rootMargin, onVisibleCountChange, className, noData,
|
|
116
|
+
export declare function DataGridInfiniteBody<T>({ data, children: renderRow, batchSize, threshold, rootMargin, onVisibleCountChange, className, noData, noDataText, ref, }: DataGridInfiniteBodyProps<T> & {
|
|
117
117
|
ref?: React.Ref<DataGridInfiniteBodyRef>;
|
|
118
118
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v1.
|
|
2
|
+
@versini/ui-datagrid v1.3.1
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
8
|
+
import { DataGridContext } from "../415.js";
|
|
9
|
+
import { CellWrapper } from "../772.js";
|
|
10
|
+
import { getBodyClass, useColumnMeasurement } from "../763.js";
|
|
11
|
+
|
|
12
|
+
|
|
10
13
|
|
|
11
14
|
|
|
12
15
|
|
|
@@ -75,7 +78,7 @@ const ROW_INDEX_DATA_ATTR = "data-row-index";
|
|
|
75
78
|
* </DataGrid>
|
|
76
79
|
* ```
|
|
77
80
|
*
|
|
78
|
-
*/ function DataGridInfiniteBody({ data = [], children: renderRow, batchSize = DEFAULT_BATCH_SIZE, threshold = DEFAULT_THRESHOLD, rootMargin = DEFAULT_ROOT_MARGIN, onVisibleCountChange, className, noData = false,
|
|
81
|
+
*/ function DataGridInfiniteBody({ data = [], children: renderRow, batchSize = DEFAULT_BATCH_SIZE, threshold = DEFAULT_THRESHOLD, rootMargin = DEFAULT_ROOT_MARGIN, onVisibleCountChange, className, noData = false, noDataText, ref }) {
|
|
79
82
|
const ctx = useContext(DataGridContext);
|
|
80
83
|
const bodyRef = useRef(null);
|
|
81
84
|
const observerRef = useRef(null);
|
|
@@ -319,7 +322,7 @@ const ROW_INDEX_DATA_ATTR = "data-row-index";
|
|
|
319
322
|
textAlign: "center",
|
|
320
323
|
width: "100%"
|
|
321
324
|
},
|
|
322
|
-
children:
|
|
325
|
+
children: noDataText ?? "No Data"
|
|
323
326
|
})
|
|
324
327
|
}) : renderedContent
|
|
325
328
|
})
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v1.
|
|
2
|
+
@versini/ui-datagrid v1.3.1
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import react from "react";
|
|
8
|
+
import { DataGridContext } from "../415.js";
|
|
9
|
+
import { CellWrapper } from "../772.js";
|
|
10
|
+
import { getRowClasses } from "../76.js";
|
|
11
|
+
|
|
12
|
+
|
|
10
13
|
|
|
11
14
|
|
|
12
15
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v1.
|
|
2
|
+
@versini/ui-datagrid v1.3.1
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { SortDirections } from "../
|
|
6
|
+
import { SortDirections } from "../772.js";
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -233,4 +233,4 @@ import { SortDirections } from "../46.js";
|
|
|
233
233
|
|
|
234
234
|
|
|
235
235
|
export { getNextSortConfig, getOppositeSortDirection, sortByBoolean, sortByDate, sortByNumber, sortByString, sortItems, toggleSortDirection };
|
|
236
|
-
export { SortDirections } from "../
|
|
236
|
+
export { SortDirections } from "../772.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-datagrid",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -87,16 +87,16 @@
|
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@testing-library/jest-dom": "6.9.1",
|
|
90
|
-
"@versini/ui-button": "12.0.
|
|
90
|
+
"@versini/ui-button": "12.0.4",
|
|
91
91
|
"@versini/ui-types": "8.3.0"
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
|
-
"@versini/ui-icons": "4.19.
|
|
94
|
+
"@versini/ui-icons": "4.19.2",
|
|
95
95
|
"clsx": "2.1.1",
|
|
96
96
|
"tailwindcss": "4.2.1"
|
|
97
97
|
},
|
|
98
98
|
"sideEffects": [
|
|
99
99
|
"**/*.css"
|
|
100
100
|
],
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "6b50d466dbc1261a8539f469016ab438e4e8e51c"
|
|
102
102
|
}
|
package/dist/511.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
@versini/ui-datagrid v1.2.0
|
|
3
|
-
© 2026 gizmette.com
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
export { createContext, default as react, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
|