@ishibashi0112/spreadsheet-grid 0.6.0 → 0.7.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 +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +869 -809
- package/dist/logic/exportData.d.ts +8 -0
- package/dist/model/gridTypes.d.ts +15 -0
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GridColumn, GridExportData } from '../model/gridTypes';
|
|
2
|
+
export type BuildGridExportDataParams<T> = {
|
|
3
|
+
getRow: (viewIndex: number) => T;
|
|
4
|
+
startRow: number;
|
|
5
|
+
endRow: number;
|
|
6
|
+
columns: GridColumn<T>[];
|
|
7
|
+
};
|
|
8
|
+
export declare const buildGridExportData: <T>({ getRow, startRow, endRow, columns, }: BuildGridExportDataParams<T>) => GridExportData;
|
|
@@ -253,6 +253,20 @@ export type CsvExportOptions = {
|
|
|
253
253
|
delimiter?: string;
|
|
254
254
|
bom?: boolean;
|
|
255
255
|
};
|
|
256
|
+
export type GridExportOptions = {
|
|
257
|
+
scope?: CsvExportScope;
|
|
258
|
+
};
|
|
259
|
+
export type GridExportCell = {
|
|
260
|
+
value: unknown;
|
|
261
|
+
text: string;
|
|
262
|
+
};
|
|
263
|
+
export type GridExportData = {
|
|
264
|
+
columns: {
|
|
265
|
+
key: string;
|
|
266
|
+
title: string;
|
|
267
|
+
}[];
|
|
268
|
+
rows: GridExportCell[][];
|
|
269
|
+
};
|
|
256
270
|
export type GridColumnState = {
|
|
257
271
|
key: string;
|
|
258
272
|
visible?: boolean;
|
|
@@ -293,6 +307,7 @@ export type SpreadsheetGridHandle<T> = {
|
|
|
293
307
|
getSelectedRows: () => T[];
|
|
294
308
|
exportCsv: (options?: CsvExportOptions) => string;
|
|
295
309
|
downloadCsv: (filename?: string, options?: CsvExportOptions) => void;
|
|
310
|
+
getExportData: (options?: GridExportOptions) => GridExportData;
|
|
296
311
|
getState: () => GridState;
|
|
297
312
|
applyState: (state: GridState) => void;
|
|
298
313
|
};
|