@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
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { type ThemeMode } from "../DataGridConstants/DataGridConstants";
|
|
2
|
-
/**
|
|
3
|
-
* Generates classes for the main DataGrid wrapper and grid. When sticky
|
|
4
|
-
* header/footer is enabled:
|
|
5
|
-
* - Outer wrapper has overflow-hidden
|
|
6
|
-
* - Scrollable area is a separate inner container with dynamic padding
|
|
7
|
-
* - Header/footer use position:absolute to overlay scrollbar
|
|
8
|
-
* - Padding is dynamically set via inline styles based on measured heights
|
|
9
|
-
*
|
|
10
|
-
* When columns prop is provided, the grid uses CSS Grid layout with subgrid
|
|
11
|
-
* support for proper column alignment across all rows.
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
export declare const getDataGridClasses: ({ mode, className, wrapperClassName, stickyHeader, stickyFooter, disabled, hasColumns, }: {
|
|
15
|
-
mode: ThemeMode;
|
|
16
|
-
className?: string;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
hasColumns?: boolean;
|
|
19
|
-
stickyFooter?: boolean;
|
|
20
|
-
stickyHeader?: boolean;
|
|
21
|
-
wrapperClassName?: string;
|
|
22
|
-
}) => {
|
|
23
|
-
overlay: string;
|
|
24
|
-
inner: string;
|
|
25
|
-
spinnerWrapper: string;
|
|
26
|
-
spinner: string;
|
|
27
|
-
/**
|
|
28
|
-
* Outer wrapper - overflow-hidden when sticky, like Panel's outerWrapper.
|
|
29
|
-
* Uses flex layout when sticky to allow scrollableContent to respect
|
|
30
|
-
* max-height.
|
|
31
|
-
*/
|
|
32
|
-
wrapper: string;
|
|
33
|
-
/**
|
|
34
|
-
* Scrollable content area for absolute-positioned header/footer. Padding is
|
|
35
|
-
* applied via inline styles based on measured header/footer heights,
|
|
36
|
-
* eliminating the need for hard-coded values that break when styles change.
|
|
37
|
-
*/
|
|
38
|
-
scrollableContent: string;
|
|
39
|
-
/**
|
|
40
|
-
* When columns are provided, use CSS Grid so rows can use subgrid for
|
|
41
|
-
* consistent column alignment. Otherwise, use flexbox.
|
|
42
|
-
*/
|
|
43
|
-
grid: string;
|
|
44
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
@versini/ui-datagrid v0.3.6
|
|
3
|
-
© 2026 gizmette.com
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import clsx from "clsx";
|
|
7
|
-
|
|
8
|
-
;// CONCATENATED MODULE: external "clsx"
|
|
9
|
-
|
|
10
|
-
;// CONCATENATED MODULE: ./src/DataGrid/utilities.ts
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Generates classes for the loading spinner.
|
|
14
|
-
*/ const getSpinnerClasses = ({ mode })=>{
|
|
15
|
-
return clsx("size-8", "align-[-0.125em]", "border-4", "inline-block animate-spin rounded-full border-solid border-current border-r-transparent motion-reduce:animate-[spin_1.5s_linear_infinite]", {
|
|
16
|
-
"text-copy-dark": mode === "light",
|
|
17
|
-
"text-copy-light": mode === "dark",
|
|
18
|
-
"text-copy-dark dark:text-copy-light": mode === "alt-system",
|
|
19
|
-
"text-copy-light dark:text-copy-dark": mode === "system"
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Generates classes for the loading overlay.
|
|
24
|
-
*/ const getOverlayClasses = ({ mode })=>{
|
|
25
|
-
return {
|
|
26
|
-
inner: "relative",
|
|
27
|
-
overlay: clsx("absolute inset-0 z-20 cursor-not-allowed", "backdrop-blur-xs bg-white/30 dark:bg-black/30"),
|
|
28
|
-
spinnerWrapper: clsx("absolute z-30 top-0 left-0 right-0 h-[min(100%,100vh)]", "flex items-center justify-center", "pointer-events-none"),
|
|
29
|
-
spinner: getSpinnerClasses({
|
|
30
|
-
mode
|
|
31
|
-
})
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Generates classes for the main DataGrid wrapper and grid. When sticky
|
|
36
|
-
* header/footer is enabled:
|
|
37
|
-
* - Outer wrapper has overflow-hidden
|
|
38
|
-
* - Scrollable area is a separate inner container with dynamic padding
|
|
39
|
-
* - Header/footer use position:absolute to overlay scrollbar
|
|
40
|
-
* - Padding is dynamically set via inline styles based on measured heights
|
|
41
|
-
*
|
|
42
|
-
* When columns prop is provided, the grid uses CSS Grid layout with subgrid
|
|
43
|
-
* support for proper column alignment across all rows.
|
|
44
|
-
*
|
|
45
|
-
*/ const getDataGridClasses = ({ mode, className, wrapperClassName, stickyHeader, stickyFooter, disabled, hasColumns })=>{
|
|
46
|
-
const overlayClasses = disabled ? getOverlayClasses({
|
|
47
|
-
mode
|
|
48
|
-
}) : null;
|
|
49
|
-
const hasSticky = stickyHeader || stickyFooter;
|
|
50
|
-
return {
|
|
51
|
-
overlay: overlayClasses?.overlay ?? "",
|
|
52
|
-
inner: overlayClasses?.inner ?? "",
|
|
53
|
-
spinnerWrapper: overlayClasses?.spinnerWrapper ?? "",
|
|
54
|
-
spinner: overlayClasses?.spinner ?? "",
|
|
55
|
-
/**
|
|
56
|
-
* Outer wrapper - overflow-hidden when sticky, like Panel's outerWrapper.
|
|
57
|
-
* Uses flex layout when sticky to allow scrollableContent to respect
|
|
58
|
-
* max-height.
|
|
59
|
-
*/ wrapper: clsx("not-prose relative w-full rounded-lg shadow-md", {
|
|
60
|
-
"overflow-x-auto": !hasSticky && !disabled,
|
|
61
|
-
"overflow-hidden flex flex-col": hasSticky || disabled,
|
|
62
|
-
"bg-surface-darker": mode === "dark" || mode === "system",
|
|
63
|
-
"bg-surface-light": mode === "light" || mode === "alt-system",
|
|
64
|
-
"dark:bg-surface-light": mode === "system",
|
|
65
|
-
"dark:bg-surface-darker": mode === "alt-system",
|
|
66
|
-
"text-copy-light": mode === "dark",
|
|
67
|
-
"text-copy-dark": mode === "light",
|
|
68
|
-
"text-copy-light dark:text-copy-dark": mode === "system",
|
|
69
|
-
"text-copy-dark dark:text-copy-light": mode === "alt-system"
|
|
70
|
-
}, wrapperClassName),
|
|
71
|
-
/**
|
|
72
|
-
* Scrollable content area for absolute-positioned header/footer. Padding is
|
|
73
|
-
* applied via inline styles based on measured header/footer heights,
|
|
74
|
-
* eliminating the need for hard-coded values that break when styles change.
|
|
75
|
-
*/ scrollableContent: clsx(/**
|
|
76
|
-
* flex-1 + min-h-0 allows this to shrink within flex parent and enable
|
|
77
|
-
* scrolling. min-h-0 overrides the default min-height:auto that prevents
|
|
78
|
-
* flex items from shrinking.
|
|
79
|
-
*/ "overflow-y-auto overflow-x-hidden rounded-[inherit] flex-1 min-h-0"),
|
|
80
|
-
/**
|
|
81
|
-
* When columns are provided, use CSS Grid so rows can use subgrid for
|
|
82
|
-
* consistent column alignment. Otherwise, use flexbox.
|
|
83
|
-
*/ grid: clsx("my-0 w-full text-left text-sm", hasColumns ? "grid" : "flex flex-col", className, {
|
|
84
|
-
"text-copy-light": mode === "dark",
|
|
85
|
-
"text-copy-dark": mode === "light",
|
|
86
|
-
"text-copy-light dark:text-copy-dark": mode === "system",
|
|
87
|
-
"text-copy-dark dark:text-copy-light": mode === "alt-system"
|
|
88
|
-
})
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
export { getDataGridClasses };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type BlurEffect, type ThemeMode } from "../DataGridConstants/DataGridConstants";
|
|
2
|
-
export declare const getHeaderFooterBackgroundClasses: ({ mode, hasBlur, sticky, }: {
|
|
3
|
-
mode: ThemeMode;
|
|
4
|
-
hasBlur: boolean;
|
|
5
|
-
sticky: boolean;
|
|
6
|
-
}) => string;
|
|
7
|
-
export declare const getHeaderFooterCopyClasses: ({ mode }: {
|
|
8
|
-
mode: ThemeMode;
|
|
9
|
-
}) => string;
|
|
10
|
-
/**
|
|
11
|
-
* Common classes for sticky header/footer with optional blur effect.
|
|
12
|
-
*/
|
|
13
|
-
export declare const getStickyBlurClasses: ({ blurEffect, }: {
|
|
14
|
-
blurEffect?: BlurEffect;
|
|
15
|
-
}) => string;
|
package/dist/common/utilities.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
@versini/ui-datagrid v0.3.6
|
|
3
|
-
© 2026 gizmette.com
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import clsx from "clsx";
|
|
7
|
-
import { BlurEffects } from "../DataGridConstants/DataGridConstants.js";
|
|
8
|
-
|
|
9
|
-
;// CONCATENATED MODULE: external "clsx"
|
|
10
|
-
|
|
11
|
-
;// CONCATENATED MODULE: external "../DataGridConstants/DataGridConstants.js"
|
|
12
|
-
|
|
13
|
-
;// CONCATENATED MODULE: ./src/common/utilities.ts
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const getHeaderFooterBackgroundClasses = ({ mode, hasBlur, sticky })=>{
|
|
17
|
-
return clsx({
|
|
18
|
-
// Semi-transparent backgrounds for blur effect.
|
|
19
|
-
"bg-surface-darkest/50": hasBlur && sticky && (mode === "dark" || mode === "system"),
|
|
20
|
-
"bg-surface-light/50": hasBlur && sticky && (mode === "light" || mode === "alt-system"),
|
|
21
|
-
"dark:bg-surface-light/50": hasBlur && sticky && mode === "system",
|
|
22
|
-
"dark:bg-surface-darkest/50": hasBlur && sticky && mode === "alt-system",
|
|
23
|
-
// Solid backgrounds when no blur effect.
|
|
24
|
-
"bg-surface-darkest": !hasBlur && (mode === "dark" || mode === "system"),
|
|
25
|
-
"bg-surface-light": !hasBlur && (mode === "light" || mode === "alt-system"),
|
|
26
|
-
"dark:bg-surface-light": !hasBlur && mode === "system",
|
|
27
|
-
"dark:bg-surface-darkest": !hasBlur && mode === "alt-system"
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
const getHeaderFooterCopyClasses = ({ mode })=>{
|
|
31
|
-
return clsx({
|
|
32
|
-
"text-copy-light": mode === "dark",
|
|
33
|
-
"text-copy-dark": mode === "light",
|
|
34
|
-
"text-copy-light dark:text-copy-dark": mode === "system",
|
|
35
|
-
"text-copy-dark dark:text-copy-light": mode === "alt-system"
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Common classes for sticky header/footer with optional blur effect.
|
|
40
|
-
*/ const getStickyBlurClasses = ({ blurEffect })=>{
|
|
41
|
-
return clsx({
|
|
42
|
-
"backdrop-blur-sm": blurEffect === BlurEffects.SMALL,
|
|
43
|
-
"backdrop-blur-md": blurEffect === BlurEffects.MEDIUM,
|
|
44
|
-
"backdrop-blur-lg": blurEffect === BlurEffects.LARGE
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export { getHeaderFooterBackgroundClasses, getHeaderFooterCopyClasses, getStickyBlurClasses };
|