@versini/ui-datagrid 1.2.0 → 1.3.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 +11 -1
- package/dist/131.js +1 -1
- package/dist/298.js +1 -1
- package/dist/46.js +1 -1
- package/dist/511.js +1 -1
- package/dist/926.js +1 -1
- package/dist/DataGrid/DataGridTypes.d.ts +5 -0
- package/dist/DataGrid/index.js +1 -1
- package/dist/DataGridAnimated/index.js +1 -1
- package/dist/DataGridBody/DataGridBody.d.ts +1 -1
- package/dist/DataGridBody/index.js +3 -3
- package/dist/DataGridCell/index.js +1 -1
- package/dist/DataGridCellSort/index.js +1 -1
- package/dist/DataGridConstants/index.js +1 -1
- package/dist/DataGridFooter/index.js +1 -1
- package/dist/DataGridHeader/index.js +1 -1
- package/dist/DataGridInfinite/DataGridInfiniteBody.d.ts +4 -4
- package/dist/DataGridInfinite/index.js +3 -3
- package/dist/DataGridRow/index.js +1 -1
- package/dist/DataGridSorting/index.js +1 -1
- package/package.json +2 -2
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/131.js
CHANGED
package/dist/298.js
CHANGED
package/dist/46.js
CHANGED
package/dist/511.js
CHANGED
package/dist/926.js
CHANGED
|
@@ -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,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,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v1.
|
|
2
|
+
@versini/ui-datagrid v1.3.0
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -16,7 +16,7 @@ import { CellWrapper } from "../46.js";
|
|
|
16
16
|
|
|
17
17
|
/* =============================================================================
|
|
18
18
|
* DataGridBody
|
|
19
|
-
* ========================================================================== */ const DataGridBody = ({ className, children, noData = false, ...rest })=>{
|
|
19
|
+
* ========================================================================== */ const DataGridBody = ({ className, children, noData = false, noDataText, ...rest })=>{
|
|
20
20
|
const ctx = useContext(DataGridContext);
|
|
21
21
|
const bodyRef = useRef(null);
|
|
22
22
|
// Measure column widths for sticky header/footer sync.
|
|
@@ -43,7 +43,7 @@ import { CellWrapper } from "../46.js";
|
|
|
43
43
|
textAlign: "center",
|
|
44
44
|
width: "100%"
|
|
45
45
|
},
|
|
46
|
-
children:
|
|
46
|
+
children: noDataText ?? "No Data"
|
|
47
47
|
})
|
|
48
48
|
}) : children
|
|
49
49
|
})
|
|
@@ -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,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v1.
|
|
2
|
+
@versini/ui-datagrid v1.3.0
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -75,7 +75,7 @@ const ROW_INDEX_DATA_ATTR = "data-row-index";
|
|
|
75
75
|
* </DataGrid>
|
|
76
76
|
* ```
|
|
77
77
|
*
|
|
78
|
-
*/ function DataGridInfiniteBody({ data = [], children: renderRow, batchSize = DEFAULT_BATCH_SIZE, threshold = DEFAULT_THRESHOLD, rootMargin = DEFAULT_ROOT_MARGIN, onVisibleCountChange, className, noData = false,
|
|
78
|
+
*/ function DataGridInfiniteBody({ data = [], children: renderRow, batchSize = DEFAULT_BATCH_SIZE, threshold = DEFAULT_THRESHOLD, rootMargin = DEFAULT_ROOT_MARGIN, onVisibleCountChange, className, noData = false, noDataText, ref }) {
|
|
79
79
|
const ctx = useContext(DataGridContext);
|
|
80
80
|
const bodyRef = useRef(null);
|
|
81
81
|
const observerRef = useRef(null);
|
|
@@ -319,7 +319,7 @@ const ROW_INDEX_DATA_ATTR = "data-row-index";
|
|
|
319
319
|
textAlign: "center",
|
|
320
320
|
width: "100%"
|
|
321
321
|
},
|
|
322
|
-
children:
|
|
322
|
+
children: noDataText ?? "No Data"
|
|
323
323
|
})
|
|
324
324
|
}) : renderedContent
|
|
325
325
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-datagrid",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
"sideEffects": [
|
|
99
99
|
"**/*.css"
|
|
100
100
|
],
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "521cbb0ad888c8eb05e6f128d3d80c15e7806027"
|
|
102
102
|
}
|