gm-datagrid 0.1.25 → 0.1.27
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 +6 -0
- package/dist/components/GMGridLoadingSkeleton.d.ts +13 -0
- package/dist/components/GridConfirmDialog.d.ts +10 -0
- package/dist/context/ConfirmContext.d.ts +7 -0
- package/dist/features/useGridContentWidth.d.ts +11 -0
- package/dist/features/useVirtualization.d.ts +1 -2
- package/dist/gm-datagrid.js +7309 -6879
- package/dist/gm-datagrid.umd.cjs +49 -49
- package/dist/lib/i18n.d.ts +6 -0
- package/dist/types/index.d.ts +14 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -92,6 +92,12 @@ export default function ProductsPage() {
|
|
|
92
92
|
| `slotProps` | `GridToolbarSlotProps` | — | Props merged into each slot component |
|
|
93
93
|
| `statusSwitch` | `StatusSwitchConfig` | — | Grid defaults for inline STATUS toggles (see `docs/STATUS_SWITCH.md`) |
|
|
94
94
|
| `autoCheckboxSelection` | `boolean` | `true` | Enable checkboxes when `slot.bulkAction` is set |
|
|
95
|
+
| `minHeight` | `number \| string` | `360` | Minimum height of the grid root |
|
|
96
|
+
| `bodyMinHeight` | `number \| string` | — | Minimum height of the scrollable body |
|
|
97
|
+
| `showRowNumber` | `boolean` | `true` | Leading/trailing row index column (`Nº`) |
|
|
98
|
+
| `rowNumberPosition` | `'first' \| 'last'` | `'first'` | Row number column position |
|
|
99
|
+
| `loadingRowCount` | `number` | `8` | Skeleton placeholder rows while loading |
|
|
100
|
+
| `confirmPrompt` | `(message) => Promise<boolean>` | — | Override built-in confirm dialog |
|
|
95
101
|
| `locale` | `'es' \| 'en'` | `'es'` | Built-in UI language. See [Internationalisation](#internationalisation-locale) |
|
|
96
102
|
|
|
97
103
|
### Pagination props
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ColumnDef } from '../types';
|
|
3
|
+
interface GMGridLoadingSkeletonProps {
|
|
4
|
+
columns: ColumnDef[];
|
|
5
|
+
widths: Record<string, number>;
|
|
6
|
+
rowCount?: number;
|
|
7
|
+
rowHeight: number;
|
|
8
|
+
contentMinWidth: number;
|
|
9
|
+
checkboxSelection?: boolean;
|
|
10
|
+
showRowNumber?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const GMGridLoadingSkeleton: React.NamedExoticComponent<GMGridLoadingSkeletonProps>;
|
|
13
|
+
export default GMGridLoadingSkeleton;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GridLocale } from '../lib/i18n';
|
|
2
|
+
interface GridConfirmDialogProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
message: string;
|
|
5
|
+
locale?: GridLocale;
|
|
6
|
+
title?: string;
|
|
7
|
+
onClose: (accepted: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
export default function GridConfirmDialog({ open, message, locale, title, onClose, }: GridConfirmDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare function ConfirmProvider({ children, locale, confirmPrompt, }: {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
locale?: 'es' | 'en';
|
|
5
|
+
confirmPrompt?: (message: string) => Promise<boolean>;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function useGridConfirm(): (message: string) => Promise<boolean>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ColumnDef } from '../types';
|
|
2
|
+
export declare const GM_GRID_CB_WIDTH = 40;
|
|
3
|
+
export declare const GM_GRID_ROW_NUMBER_WIDTH = 52;
|
|
4
|
+
export interface GridContentWidthOptions {
|
|
5
|
+
columns: ColumnDef[];
|
|
6
|
+
widths: Record<string, number>;
|
|
7
|
+
checkboxSelection?: boolean;
|
|
8
|
+
showRowNumber?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function computeGridContentWidth({ columns, widths, checkboxSelection, showRowNumber, }: GridContentWidthOptions): number;
|
|
11
|
+
export declare function useGridContentWidth(options: GridContentWidthOptions): number;
|
|
@@ -13,8 +13,7 @@ interface VirtualizationState {
|
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Computes which rows are visible in the viewport.
|
|
16
|
-
*
|
|
17
|
-
* Always cancels the loop on unmount to prevent memory leaks.
|
|
16
|
+
* Updates on scroll/resize — no perpetual rAF setState loop.
|
|
18
17
|
*/
|
|
19
18
|
export declare function useVirtualization({ rows, containerRef, density, overscan, }: UseVirtualizationProps): VirtualizationState;
|
|
20
19
|
export {};
|