gm-datagrid 0.1.13 → 0.1.14
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 +37 -2
- package/dist/features/useExport.d.ts +9 -7
- package/dist/gm-datagrid.js +2510 -2292
- package/dist/gm-datagrid.umd.cjs +21 -19
- package/dist/index.d.ts +1 -0
- package/dist/lib/i18n.d.ts +4 -0
- package/dist/toolbar/GridToolbar.d.ts +5 -2
- package/dist/toolbar/MobileToolbar.d.ts +5 -2
- package/dist/toolbar/ToolbarButtons.d.ts +11 -3
- package/dist/types/index.d.ts +8 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export type { GMGridContainerRef } from './GMGridContainer';
|
|
|
4
4
|
export { useGMGrid } from './context/GridContext';
|
|
5
5
|
export type { GMDatagridProps, GMDatagridRef, ColumnDef, Row, CellRange, CellCoord, FilterGroup, FilterCondition, SortKey, ApiContext, DensityMode, MuiChipColor, StatusMapEntry, CellRenderParams, CellEditParams, } from './types';
|
|
6
6
|
export { ColumnDataTypesEnum } from './types';
|
|
7
|
+
export type { ExportFormat } from './types';
|
package/dist/lib/i18n.d.ts
CHANGED
|
@@ -26,6 +26,10 @@ export interface GridLabels {
|
|
|
26
26
|
max: string;
|
|
27
27
|
/** Group-by picker: no-grouping option */
|
|
28
28
|
noGroup: string;
|
|
29
|
+
/** Export button tooltip */
|
|
30
|
+
export: string;
|
|
31
|
+
/** Export format menu item labels keyed by ExportFormat */
|
|
32
|
+
exportFormats: Record<string, string>;
|
|
29
33
|
/** Date operator dropdown labels keyed by DateFilterOp */
|
|
30
34
|
dateOps: Record<string, string>;
|
|
31
35
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { DensityMode } from '../types';
|
|
2
|
+
import { DensityMode, ExportFormat } from '../types';
|
|
3
3
|
import { GridLabels } from '../lib/i18n';
|
|
4
4
|
interface GridToolbarProps {
|
|
5
5
|
title: string;
|
|
@@ -7,7 +7,10 @@ interface GridToolbarProps {
|
|
|
7
7
|
quickFilter: boolean;
|
|
8
8
|
quickFilterPlaceholder?: string;
|
|
9
9
|
onQuickFilterChange: (text: string) => void;
|
|
10
|
-
|
|
10
|
+
/** Available export formats — passed through to ToolbarButtons. */
|
|
11
|
+
exportFormats?: ExportFormat[];
|
|
12
|
+
/** Called when user picks an export format. */
|
|
13
|
+
onExportFormat?: (format: ExportFormat) => void;
|
|
11
14
|
onRefresh: () => void;
|
|
12
15
|
density: DensityMode;
|
|
13
16
|
onToggleDensity: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { DensityMode } from '../types';
|
|
2
|
+
import { DensityMode, ExportFormat } from '../types';
|
|
3
3
|
import { GridLabels } from '../lib/i18n';
|
|
4
4
|
interface MobileToolbarProps {
|
|
5
5
|
title: string;
|
|
@@ -7,7 +7,10 @@ interface MobileToolbarProps {
|
|
|
7
7
|
quickFilter: boolean;
|
|
8
8
|
quickFilterPlaceholder?: string;
|
|
9
9
|
onQuickFilterChange: (text: string) => void;
|
|
10
|
-
|
|
10
|
+
/** Available export formats — passed through to ToolbarButtons. */
|
|
11
|
+
exportFormats?: ExportFormat[];
|
|
12
|
+
/** Called when user picks an export format. */
|
|
13
|
+
onExportFormat?: (format: ExportFormat) => void;
|
|
11
14
|
onRefresh: () => void;
|
|
12
15
|
density: DensityMode;
|
|
13
16
|
onToggleDensity: () => void;
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { DensityMode } from '../types';
|
|
2
|
+
import { DensityMode, ExportFormat } from '../types';
|
|
3
3
|
interface ToolbarButtonsProps {
|
|
4
|
-
|
|
4
|
+
/** Available export formats. When provided + non-empty, the export button opens a menu. */
|
|
5
|
+
exportFormats?: ExportFormat[];
|
|
6
|
+
/** Called when the user selects an export format. */
|
|
7
|
+
onExportFormat?: (format: ExportFormat) => void;
|
|
5
8
|
onRefresh: () => void;
|
|
6
9
|
onToggleDensity: () => void;
|
|
7
10
|
density: DensityMode;
|
|
8
11
|
loading?: boolean;
|
|
12
|
+
/** Export button tooltip label */
|
|
13
|
+
exportLabel?: string;
|
|
14
|
+
/** Per-format menu item labels */
|
|
15
|
+
exportFormatLabels?: Record<string, string>;
|
|
9
16
|
}
|
|
10
17
|
/**
|
|
11
|
-
* Shared toolbar action buttons: Export (optional), Refresh, Density toggle.
|
|
18
|
+
* Shared toolbar action buttons: Export (optional, menu-based), Refresh, Density toggle.
|
|
19
|
+
* Compatible with MUI DataGrid toolbar export pattern.
|
|
12
20
|
*/
|
|
13
21
|
declare const ToolbarButtons: React.NamedExoticComponent<ToolbarButtonsProps>;
|
|
14
22
|
export default ToolbarButtons;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ export declare enum ColumnDataTypesEnum {
|
|
|
24
24
|
}
|
|
25
25
|
export type MuiChipColor = ChipProps['color'];
|
|
26
26
|
export type DensityMode = 'compact' | 'standard' | 'comfortable';
|
|
27
|
+
/** Supported export formats. xlsx is generated by the Wasm engine; others are built client-side. */
|
|
28
|
+
export type ExportFormat = 'xlsx' | 'csv' | 'txt' | 'json';
|
|
27
29
|
export interface StatusMapEntry {
|
|
28
30
|
label: string;
|
|
29
31
|
color: MuiChipColor;
|
|
@@ -231,6 +233,12 @@ export interface GMDatagridProps {
|
|
|
231
233
|
* @default true
|
|
232
234
|
*/
|
|
233
235
|
exportable?: boolean;
|
|
236
|
+
/**
|
|
237
|
+
* Which export formats to show in the export menu.
|
|
238
|
+
* Supported: 'xlsx' | 'csv' | 'txt' | 'json'
|
|
239
|
+
* @default ['xlsx', 'csv']
|
|
240
|
+
*/
|
|
241
|
+
exportFormats?: ExportFormat[];
|
|
234
242
|
/**
|
|
235
243
|
* Whitelist of column `field` names that may be exported.
|
|
236
244
|
* When omitted (or empty) all visible columns are exported.
|