@kanunilabs/pivotgrid-react 1.8.1 → 1.8.2
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/dist/index.cjs +2 -2
- package/dist/index.d.cts +111 -57
- package/dist/index.d.ts +111 -57
- package/dist/index.js +2 -2
- package/dist/styles.css +59 -15
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,89 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { Component, ErrorInfo } from 'react';
|
|
3
3
|
import * as _kanunilabs_pivotgrid_core from '@kanunilabs/pivotgrid-core';
|
|
4
|
-
import { PivotField as PivotField$1, PivotCellTemplate as PivotCellTemplate$1, CellClickEvent as CellClickEvent$1, CellPreparedEvent as CellPreparedEvent$1, PivotGridRef as PivotGridRef$1, PivotRowTransaction, PivotTransactionResult, PivotController, PersistedPivotState, PivotConditionRule as PivotConditionRule$1, PivotCell,
|
|
5
|
-
export { CustomSummaryOptions, DropIntent, ExportingEvent, FieldMoveEvent, FilterCondition, FilterGroup, FilterOperator, PersistedPivotState, PivotArea, PivotCell, PivotCellTextAccessor, PivotCellValueAccessor, PivotColumnWidthDefaults, PivotControllerCallbacks, PivotControllerOptions, PivotControllerState, PivotDataSource, PivotDensity, PivotDictionary, PivotDragIntentState, PivotGroupInterval, PivotImportStatus, PivotLabelFilter, PivotLayoutProfile, PivotLayoutState, PivotLocale, PivotNode, PivotPrefilter, PivotRowKey, PivotRowKeyResolver, PivotRowTransaction, PivotSelectionMode, PivotSelectionRange, PivotSelectionState, PivotSelectionStats, PivotStateStoringConfig, PivotSummaryDisplayMode, PivotSummaryType, PivotTheme, PivotToolbarConfig, PivotTransactionResult, PivotValueFilter, defaultPivotLayout } from '@kanunilabs/pivotgrid-core';
|
|
4
|
+
import { PivotEngineResult, PivotLayoutState, PivotColumnWidthDefaults, PivotField as PivotField$1, PivotCellTemplate as PivotCellTemplate$1, CellClickEvent as CellClickEvent$1, CellPreparedEvent as CellPreparedEvent$1, PivotGridRef as PivotGridRef$1, PivotRowTransaction, PivotTransactionResult, PivotController, PersistedPivotState, PivotConditionRule as PivotConditionRule$1, PivotCell, PivotControllerOptions, PivotTheme, PivotStateStoringConfig, PivotToolbarConfig, PivotEngineRegistry, PivotLocale, PivotDictionary, PivotDensity, FieldMoveEvent, ExportingEvent, ExportOptions, ExportFormat, PivotReport, PivotArea, PivotNode, PivotControllerState } from '@kanunilabs/pivotgrid-core';
|
|
5
|
+
export { CustomSummaryOptions, DropIntent, ExportingEvent, FieldMoveEvent, FilterCondition, FilterGroup, FilterOperator, PersistedPivotFilters, PersistedPivotState, PivotArea, PivotCell, PivotCellTextAccessor, PivotCellValueAccessor, PivotColumnWidthDefaults, PivotControllerCallbacks, PivotControllerOptions, PivotControllerState, PivotDataSource, PivotDensity, PivotDictionary, PivotDragIntentState, PivotGroupInterval, PivotImportStatus, PivotLabelFilter, PivotLayoutProfile, PivotLayoutState, PivotLocale, PivotNode, PivotPrefilter, PivotRowKey, PivotRowKeyResolver, PivotRowTransaction, PivotSelectionMode, PivotSelectionRange, PivotSelectionState, PivotSelectionStats, PivotStateStoringConfig, PivotSummaryDisplayMode, PivotSummaryType, PivotTheme, PivotToolbarConfig, PivotTransactionResult, PivotValueFilter, defaultPivotLayout, mergePersistedState, splitPersistedState } from '@kanunilabs/pivotgrid-core';
|
|
6
6
|
import * as _dnd_kit_core from '@dnd-kit/core';
|
|
7
7
|
import { DragMoveEvent, DragEndEvent } from '@dnd-kit/core';
|
|
8
8
|
|
|
9
|
+
/** A selected data cell (B.25). */
|
|
10
|
+
interface PivotSelectedCell {
|
|
11
|
+
rowPath: string[];
|
|
12
|
+
colPath: string[];
|
|
13
|
+
/** The data field of the cell; null for a row-header selection. */
|
|
14
|
+
dataFieldId: string | null;
|
|
15
|
+
/** The value as drawn (a display mode's, when one is set); a blank summary is null. */
|
|
16
|
+
value: number | null;
|
|
17
|
+
/** A grand total (row or column), a subtotal, or a plain cell. */
|
|
18
|
+
kind: 'data' | 'subtotal' | 'grandTotal';
|
|
19
|
+
}
|
|
20
|
+
/** `onSelectionChange` (B.25): how many cells, and the cells on request. */
|
|
21
|
+
interface PivotSelectionChangeEvent {
|
|
22
|
+
count: number;
|
|
23
|
+
/** Built when read: a drag does not pay for it on every cell it crosses. */
|
|
24
|
+
readonly cells: PivotSelectedCell[];
|
|
25
|
+
}
|
|
26
|
+
interface PivotGridBodyProps {
|
|
27
|
+
engineResult: PivotEngineResult;
|
|
28
|
+
isBuilding: boolean;
|
|
29
|
+
buildProgress?: number;
|
|
30
|
+
rowFields: PivotField[];
|
|
31
|
+
colFields: PivotField[];
|
|
32
|
+
dataFields: PivotField[];
|
|
33
|
+
layout: PivotLayoutState;
|
|
34
|
+
expandedPaths: Set<string>;
|
|
35
|
+
allExpanded: boolean;
|
|
36
|
+
onToggleExpand: (path: string) => void;
|
|
37
|
+
onExpandPaths: (paths: string[]) => void;
|
|
38
|
+
onCollapsePaths: (paths: string[]) => void;
|
|
39
|
+
expandedColPaths: Set<string>;
|
|
40
|
+
allColExpanded: boolean;
|
|
41
|
+
onToggleColExpand: (path: string) => void;
|
|
42
|
+
onExpandColPaths: (paths: string[]) => void;
|
|
43
|
+
onCollapseColPaths: (paths: string[]) => void;
|
|
44
|
+
onCellClick?: (e: CellClickEvent) => void;
|
|
45
|
+
onContextMenu?: (x: number, y: number, fieldId: string, colPath?: string) => void;
|
|
46
|
+
onFilterClick?: (x: number, y: number, fieldId: string) => void;
|
|
47
|
+
onRemoveField: (id: string) => void;
|
|
48
|
+
onSort?: (id: string, dir: 'asc' | 'desc' | undefined) => void;
|
|
49
|
+
/** Keyboard reorder for the header chips (#207). */
|
|
50
|
+
onMoveField?: (id: string, direction: 'start' | 'end' | 'left' | 'right') => void;
|
|
51
|
+
onGlobalContextMenu?: (x: number, y: number) => void;
|
|
52
|
+
columnWidths?: Record<string, number>;
|
|
53
|
+
/** What a column with no `columnWidths` entry is painted at. Defaults 150 / 95. */
|
|
54
|
+
defaultColumnWidths?: PivotColumnWidthDefaults;
|
|
55
|
+
onColumnWidthsChange?: (widths: Record<string, number>) => void;
|
|
56
|
+
onSelectionStatsChange?: (stats: {
|
|
57
|
+
count: number;
|
|
58
|
+
sum: number;
|
|
59
|
+
avg: number;
|
|
60
|
+
min: number;
|
|
61
|
+
max: number;
|
|
62
|
+
} | null) => void;
|
|
63
|
+
/** Shift extends, Ctrl/Cmd and a touch long press add a rectangle (Enterprise, B.25). */
|
|
64
|
+
multiSelect?: boolean;
|
|
65
|
+
/** Every change of the selected data cells (B.25). */
|
|
66
|
+
onSelectionChange?: (event: PivotSelectionChangeEvent) => void;
|
|
67
|
+
/** Filled by the body: the selected cells on request (B.25). */
|
|
68
|
+
selectionApiRef?: React.MutableRefObject<{
|
|
69
|
+
getSelectedCells(): PivotSelectedCell[];
|
|
70
|
+
} | null>;
|
|
71
|
+
registry?: _kanunilabs_pivotgrid_core.PivotEngineRegistry;
|
|
72
|
+
keyboardNavigation?: {
|
|
73
|
+
enabled: boolean;
|
|
74
|
+
};
|
|
75
|
+
onCellPrepared?: (e: CellPreparedEvent<any>) => void;
|
|
76
|
+
disabled?: boolean;
|
|
77
|
+
renderNodeContextMenu?: (props: any) => React.ReactNode;
|
|
78
|
+
/**
|
|
79
|
+
* Body row height in px — the grid's `density` resolved (`pivotRowHeight`).
|
|
80
|
+
* The virtualizer, spacers and keyboard scrolling all run on it; the
|
|
81
|
+
* stylesheet's density class sets the matching line heights. Default 28.
|
|
82
|
+
*/
|
|
83
|
+
rowHeight?: number;
|
|
84
|
+
}
|
|
85
|
+
declare function PivotGridBody({ engineResult, isBuilding, buildProgress, rowFields, colFields: _colFields, dataFields, layout, expandedPaths, allExpanded, onToggleExpand, onExpandPaths, onCollapsePaths, expandedColPaths, allColExpanded, onToggleColExpand, onExpandColPaths, onCollapseColPaths, onCellClick, onContextMenu, onFilterClick, onRemoveField, onSort, onMoveField, onGlobalContextMenu, columnWidths, defaultColumnWidths, onColumnWidthsChange, onSelectionStatsChange, multiSelect, onSelectionChange, selectionApiRef, registry, keyboardNavigation, onCellPrepared, renderNodeContextMenu, rowHeight }: PivotGridBodyProps): React$1.JSX.Element;
|
|
86
|
+
|
|
9
87
|
/** The imperative handle a `ref` on the grid receives. */
|
|
10
88
|
interface PivotGridRef extends PivotGridRef$1 {
|
|
11
89
|
/**
|
|
@@ -58,6 +136,23 @@ interface PivotGridRef extends PivotGridRef$1 {
|
|
|
58
136
|
* and nothing changed, when it cannot be read (another `version`).
|
|
59
137
|
*/
|
|
60
138
|
applyPersistedState: (state: unknown) => boolean;
|
|
139
|
+
/**
|
|
140
|
+
* The selected data cells: paths, data field, value as drawn, and whether
|
|
141
|
+
* each is a plain cell, a subtotal or a grand total (B.25). Empty when
|
|
142
|
+
* nothing, or only row headers, is selected.
|
|
143
|
+
*/
|
|
144
|
+
getSelectedCells: () => PivotSelectedCell[];
|
|
145
|
+
/** Every field's filter off in one change; the prefilter stays (B.28). */
|
|
146
|
+
clearAllFilters: () => void;
|
|
147
|
+
/** Open or close the field chooser from the app (B.28). */
|
|
148
|
+
openFieldChooser: () => void;
|
|
149
|
+
closeFieldChooser: () => void;
|
|
150
|
+
/**
|
|
151
|
+
* The source rows behind the selected cells, filters applied, each row once
|
|
152
|
+
* — a subtotal and a cell under it do not list the cell's rows twice
|
|
153
|
+
* (Enterprise, B.25; throws on a Community grid).
|
|
154
|
+
*/
|
|
155
|
+
getRecordsForSelection: () => any[];
|
|
61
156
|
}
|
|
62
157
|
type PivotCellTemplate = (props: Parameters<PivotCellTemplate$1>[0]) => React$1.ReactNode;
|
|
63
158
|
type PivotConditionRule = PivotConditionRule$1<React$1.CSSProperties>;
|
|
@@ -190,7 +285,7 @@ interface BasePivotGridProps<TRow> {
|
|
|
190
285
|
striped?: boolean;
|
|
191
286
|
/**
|
|
192
287
|
* Row rhythm: `'compact'` (24px rows, one size smaller type), `'normal'`
|
|
193
|
-
* (28px, the default)
|
|
288
|
+
* (28px, the default), `'comfortable'` (36px) or `'touch'` (45px rows and headers, every target 44px, for a touch screen). Changing it repaints in
|
|
194
289
|
* place, without re-running the pivot engine.
|
|
195
290
|
*/
|
|
196
291
|
density?: PivotDensity;
|
|
@@ -219,6 +314,18 @@ interface BasePivotGridProps<TRow> {
|
|
|
219
314
|
onAfterPivotCalculate?: (result: PivotEngineResult) => void;
|
|
220
315
|
/** Fired when an export action is initiated. Can be canceled. */
|
|
221
316
|
onExporting?: (e: ExportingEvent) => void;
|
|
317
|
+
/**
|
|
318
|
+
* Every change of the selected data cells (B.25): `count`, and `cells`
|
|
319
|
+
* (paths, data field, value, kind) built when read. On Enterprise, Shift
|
|
320
|
+
* extends the selection, Ctrl/Cmd adds a rectangle, and on a touch screen a
|
|
321
|
+
* long press adds one and a drag grows it.
|
|
322
|
+
*/
|
|
323
|
+
onSelectionChange?: (event: PivotSelectionChangeEvent) => void;
|
|
324
|
+
/**
|
|
325
|
+
* Asked before a styled Excel export gives way to the plain .xls one (over
|
|
326
|
+
* 100,000 list rows or 150,000 pivot cells); return `false` to cancel (B.23).
|
|
327
|
+
*/
|
|
328
|
+
onLargeExport?: ExportOptions['onLargeExport'];
|
|
222
329
|
/** Fired after a cell is prepared to allow modifications. */
|
|
223
330
|
onCellPrepared?: (e: CellPreparedEvent<TRow>) => void;
|
|
224
331
|
/** Fired when fields configuration changes. */
|
|
@@ -288,59 +395,6 @@ declare const BasePivotGrid: <TRow>(props: BasePivotGridProps<TRow> & {
|
|
|
288
395
|
ref?: React__default.ForwardedRef<PivotGridRef>;
|
|
289
396
|
}) => ReturnType<typeof BasePivotGridInner>;
|
|
290
397
|
|
|
291
|
-
interface PivotGridBodyProps {
|
|
292
|
-
engineResult: PivotEngineResult;
|
|
293
|
-
isBuilding: boolean;
|
|
294
|
-
buildProgress?: number;
|
|
295
|
-
rowFields: PivotField[];
|
|
296
|
-
colFields: PivotField[];
|
|
297
|
-
dataFields: PivotField[];
|
|
298
|
-
layout: PivotLayoutState;
|
|
299
|
-
expandedPaths: Set<string>;
|
|
300
|
-
allExpanded: boolean;
|
|
301
|
-
onToggleExpand: (path: string) => void;
|
|
302
|
-
onExpandPaths: (paths: string[]) => void;
|
|
303
|
-
onCollapsePaths: (paths: string[]) => void;
|
|
304
|
-
expandedColPaths: Set<string>;
|
|
305
|
-
allColExpanded: boolean;
|
|
306
|
-
onToggleColExpand: (path: string) => void;
|
|
307
|
-
onExpandColPaths: (paths: string[]) => void;
|
|
308
|
-
onCollapseColPaths: (paths: string[]) => void;
|
|
309
|
-
onCellClick?: (e: CellClickEvent) => void;
|
|
310
|
-
onContextMenu?: (x: number, y: number, fieldId: string, colPath?: string) => void;
|
|
311
|
-
onFilterClick?: (x: number, y: number, fieldId: string) => void;
|
|
312
|
-
onRemoveField: (id: string) => void;
|
|
313
|
-
onSort?: (id: string, dir: 'asc' | 'desc' | undefined) => void;
|
|
314
|
-
/** Keyboard reorder for the header chips (#207). */
|
|
315
|
-
onMoveField?: (id: string, direction: 'start' | 'end' | 'left' | 'right') => void;
|
|
316
|
-
onGlobalContextMenu?: (x: number, y: number) => void;
|
|
317
|
-
columnWidths?: Record<string, number>;
|
|
318
|
-
/** What a column with no `columnWidths` entry is painted at. Defaults 150 / 95. */
|
|
319
|
-
defaultColumnWidths?: PivotColumnWidthDefaults;
|
|
320
|
-
onColumnWidthsChange?: (widths: Record<string, number>) => void;
|
|
321
|
-
onSelectionStatsChange?: (stats: {
|
|
322
|
-
count: number;
|
|
323
|
-
sum: number;
|
|
324
|
-
avg: number;
|
|
325
|
-
min: number;
|
|
326
|
-
max: number;
|
|
327
|
-
} | null) => void;
|
|
328
|
-
registry?: _kanunilabs_pivotgrid_core.PivotEngineRegistry;
|
|
329
|
-
keyboardNavigation?: {
|
|
330
|
-
enabled: boolean;
|
|
331
|
-
};
|
|
332
|
-
onCellPrepared?: (e: CellPreparedEvent<any>) => void;
|
|
333
|
-
disabled?: boolean;
|
|
334
|
-
renderNodeContextMenu?: (props: any) => React.ReactNode;
|
|
335
|
-
/**
|
|
336
|
-
* Body row height in px — the grid's `density` resolved (`pivotRowHeight`).
|
|
337
|
-
* The virtualizer, spacers and keyboard scrolling all run on it; the
|
|
338
|
-
* stylesheet's density class sets the matching line heights. Default 28.
|
|
339
|
-
*/
|
|
340
|
-
rowHeight?: number;
|
|
341
|
-
}
|
|
342
|
-
declare function PivotGridBody({ engineResult, isBuilding, buildProgress, rowFields, colFields: _colFields, dataFields, layout, expandedPaths, allExpanded, onToggleExpand, onExpandPaths, onCollapsePaths, expandedColPaths, allColExpanded, onToggleColExpand, onExpandColPaths, onCollapseColPaths, onCellClick, onContextMenu, onFilterClick, onRemoveField, onSort, onMoveField, onGlobalContextMenu, columnWidths, defaultColumnWidths, onColumnWidthsChange, onSelectionStatsChange, registry, keyboardNavigation, onCellPrepared, renderNodeContextMenu, rowHeight }: PivotGridBodyProps): React$1.JSX.Element;
|
|
343
|
-
|
|
344
398
|
interface PivotFooterProps {
|
|
345
399
|
onToggleFieldChooser: () => void;
|
|
346
400
|
fieldChooserOpen: boolean;
|
|
@@ -652,4 +706,4 @@ interface PivotThemeProviderProps {
|
|
|
652
706
|
}
|
|
653
707
|
declare function PivotThemeProvider({ theme, className, style, children }: PivotThemeProviderProps): React__default.JSX.Element;
|
|
654
708
|
|
|
655
|
-
export { BasePivotGrid, type BasePivotGridProps, type CellClickEvent, type CellPreparedEvent, type ChartSeriesDef, type ChartSyncResult, type NodeContextMenuState, PivotAreaStrips, type PivotCellTemplate, type PivotChartIntegrationOptions, type PivotConditionRule, PivotConfigProvider, PivotContextMenu, PivotErrorBoundary, type PivotField, PivotFieldList, PivotFieldSettingsDialog, PivotFooter, PivotGridBody, type PivotGridRef, PivotHeaderFilterPopup, PivotImportStatusModal, PivotNodeContextMenu, type PivotNodeContextMenuProps, PivotPortal, PivotPortalContext, PivotReportMenu, PivotReportSaveModal, PivotThemeProvider, usePivotChartSync, usePivotConfig, usePivotContextMenu, usePivotController, usePivotControllerStore, usePivotDnD, usePivotFullscreen };
|
|
709
|
+
export { BasePivotGrid, type BasePivotGridProps, type CellClickEvent, type CellPreparedEvent, type ChartSeriesDef, type ChartSyncResult, type NodeContextMenuState, PivotAreaStrips, type PivotCellTemplate, type PivotChartIntegrationOptions, type PivotConditionRule, PivotConfigProvider, PivotContextMenu, PivotErrorBoundary, type PivotField, PivotFieldList, PivotFieldSettingsDialog, PivotFooter, PivotGridBody, type PivotGridRef, PivotHeaderFilterPopup, PivotImportStatusModal, PivotNodeContextMenu, type PivotNodeContextMenuProps, PivotPortal, PivotPortalContext, PivotReportMenu, PivotReportSaveModal, type PivotSelectedCell, type PivotSelectionChangeEvent, PivotThemeProvider, usePivotChartSync, usePivotConfig, usePivotContextMenu, usePivotController, usePivotControllerStore, usePivotDnD, usePivotFullscreen };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,89 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { Component, ErrorInfo } from 'react';
|
|
3
3
|
import * as _kanunilabs_pivotgrid_core from '@kanunilabs/pivotgrid-core';
|
|
4
|
-
import { PivotField as PivotField$1, PivotCellTemplate as PivotCellTemplate$1, CellClickEvent as CellClickEvent$1, CellPreparedEvent as CellPreparedEvent$1, PivotGridRef as PivotGridRef$1, PivotRowTransaction, PivotTransactionResult, PivotController, PersistedPivotState, PivotConditionRule as PivotConditionRule$1, PivotCell,
|
|
5
|
-
export { CustomSummaryOptions, DropIntent, ExportingEvent, FieldMoveEvent, FilterCondition, FilterGroup, FilterOperator, PersistedPivotState, PivotArea, PivotCell, PivotCellTextAccessor, PivotCellValueAccessor, PivotColumnWidthDefaults, PivotControllerCallbacks, PivotControllerOptions, PivotControllerState, PivotDataSource, PivotDensity, PivotDictionary, PivotDragIntentState, PivotGroupInterval, PivotImportStatus, PivotLabelFilter, PivotLayoutProfile, PivotLayoutState, PivotLocale, PivotNode, PivotPrefilter, PivotRowKey, PivotRowKeyResolver, PivotRowTransaction, PivotSelectionMode, PivotSelectionRange, PivotSelectionState, PivotSelectionStats, PivotStateStoringConfig, PivotSummaryDisplayMode, PivotSummaryType, PivotTheme, PivotToolbarConfig, PivotTransactionResult, PivotValueFilter, defaultPivotLayout } from '@kanunilabs/pivotgrid-core';
|
|
4
|
+
import { PivotEngineResult, PivotLayoutState, PivotColumnWidthDefaults, PivotField as PivotField$1, PivotCellTemplate as PivotCellTemplate$1, CellClickEvent as CellClickEvent$1, CellPreparedEvent as CellPreparedEvent$1, PivotGridRef as PivotGridRef$1, PivotRowTransaction, PivotTransactionResult, PivotController, PersistedPivotState, PivotConditionRule as PivotConditionRule$1, PivotCell, PivotControllerOptions, PivotTheme, PivotStateStoringConfig, PivotToolbarConfig, PivotEngineRegistry, PivotLocale, PivotDictionary, PivotDensity, FieldMoveEvent, ExportingEvent, ExportOptions, ExportFormat, PivotReport, PivotArea, PivotNode, PivotControllerState } from '@kanunilabs/pivotgrid-core';
|
|
5
|
+
export { CustomSummaryOptions, DropIntent, ExportingEvent, FieldMoveEvent, FilterCondition, FilterGroup, FilterOperator, PersistedPivotFilters, PersistedPivotState, PivotArea, PivotCell, PivotCellTextAccessor, PivotCellValueAccessor, PivotColumnWidthDefaults, PivotControllerCallbacks, PivotControllerOptions, PivotControllerState, PivotDataSource, PivotDensity, PivotDictionary, PivotDragIntentState, PivotGroupInterval, PivotImportStatus, PivotLabelFilter, PivotLayoutProfile, PivotLayoutState, PivotLocale, PivotNode, PivotPrefilter, PivotRowKey, PivotRowKeyResolver, PivotRowTransaction, PivotSelectionMode, PivotSelectionRange, PivotSelectionState, PivotSelectionStats, PivotStateStoringConfig, PivotSummaryDisplayMode, PivotSummaryType, PivotTheme, PivotToolbarConfig, PivotTransactionResult, PivotValueFilter, defaultPivotLayout, mergePersistedState, splitPersistedState } from '@kanunilabs/pivotgrid-core';
|
|
6
6
|
import * as _dnd_kit_core from '@dnd-kit/core';
|
|
7
7
|
import { DragMoveEvent, DragEndEvent } from '@dnd-kit/core';
|
|
8
8
|
|
|
9
|
+
/** A selected data cell (B.25). */
|
|
10
|
+
interface PivotSelectedCell {
|
|
11
|
+
rowPath: string[];
|
|
12
|
+
colPath: string[];
|
|
13
|
+
/** The data field of the cell; null for a row-header selection. */
|
|
14
|
+
dataFieldId: string | null;
|
|
15
|
+
/** The value as drawn (a display mode's, when one is set); a blank summary is null. */
|
|
16
|
+
value: number | null;
|
|
17
|
+
/** A grand total (row or column), a subtotal, or a plain cell. */
|
|
18
|
+
kind: 'data' | 'subtotal' | 'grandTotal';
|
|
19
|
+
}
|
|
20
|
+
/** `onSelectionChange` (B.25): how many cells, and the cells on request. */
|
|
21
|
+
interface PivotSelectionChangeEvent {
|
|
22
|
+
count: number;
|
|
23
|
+
/** Built when read: a drag does not pay for it on every cell it crosses. */
|
|
24
|
+
readonly cells: PivotSelectedCell[];
|
|
25
|
+
}
|
|
26
|
+
interface PivotGridBodyProps {
|
|
27
|
+
engineResult: PivotEngineResult;
|
|
28
|
+
isBuilding: boolean;
|
|
29
|
+
buildProgress?: number;
|
|
30
|
+
rowFields: PivotField[];
|
|
31
|
+
colFields: PivotField[];
|
|
32
|
+
dataFields: PivotField[];
|
|
33
|
+
layout: PivotLayoutState;
|
|
34
|
+
expandedPaths: Set<string>;
|
|
35
|
+
allExpanded: boolean;
|
|
36
|
+
onToggleExpand: (path: string) => void;
|
|
37
|
+
onExpandPaths: (paths: string[]) => void;
|
|
38
|
+
onCollapsePaths: (paths: string[]) => void;
|
|
39
|
+
expandedColPaths: Set<string>;
|
|
40
|
+
allColExpanded: boolean;
|
|
41
|
+
onToggleColExpand: (path: string) => void;
|
|
42
|
+
onExpandColPaths: (paths: string[]) => void;
|
|
43
|
+
onCollapseColPaths: (paths: string[]) => void;
|
|
44
|
+
onCellClick?: (e: CellClickEvent) => void;
|
|
45
|
+
onContextMenu?: (x: number, y: number, fieldId: string, colPath?: string) => void;
|
|
46
|
+
onFilterClick?: (x: number, y: number, fieldId: string) => void;
|
|
47
|
+
onRemoveField: (id: string) => void;
|
|
48
|
+
onSort?: (id: string, dir: 'asc' | 'desc' | undefined) => void;
|
|
49
|
+
/** Keyboard reorder for the header chips (#207). */
|
|
50
|
+
onMoveField?: (id: string, direction: 'start' | 'end' | 'left' | 'right') => void;
|
|
51
|
+
onGlobalContextMenu?: (x: number, y: number) => void;
|
|
52
|
+
columnWidths?: Record<string, number>;
|
|
53
|
+
/** What a column with no `columnWidths` entry is painted at. Defaults 150 / 95. */
|
|
54
|
+
defaultColumnWidths?: PivotColumnWidthDefaults;
|
|
55
|
+
onColumnWidthsChange?: (widths: Record<string, number>) => void;
|
|
56
|
+
onSelectionStatsChange?: (stats: {
|
|
57
|
+
count: number;
|
|
58
|
+
sum: number;
|
|
59
|
+
avg: number;
|
|
60
|
+
min: number;
|
|
61
|
+
max: number;
|
|
62
|
+
} | null) => void;
|
|
63
|
+
/** Shift extends, Ctrl/Cmd and a touch long press add a rectangle (Enterprise, B.25). */
|
|
64
|
+
multiSelect?: boolean;
|
|
65
|
+
/** Every change of the selected data cells (B.25). */
|
|
66
|
+
onSelectionChange?: (event: PivotSelectionChangeEvent) => void;
|
|
67
|
+
/** Filled by the body: the selected cells on request (B.25). */
|
|
68
|
+
selectionApiRef?: React.MutableRefObject<{
|
|
69
|
+
getSelectedCells(): PivotSelectedCell[];
|
|
70
|
+
} | null>;
|
|
71
|
+
registry?: _kanunilabs_pivotgrid_core.PivotEngineRegistry;
|
|
72
|
+
keyboardNavigation?: {
|
|
73
|
+
enabled: boolean;
|
|
74
|
+
};
|
|
75
|
+
onCellPrepared?: (e: CellPreparedEvent<any>) => void;
|
|
76
|
+
disabled?: boolean;
|
|
77
|
+
renderNodeContextMenu?: (props: any) => React.ReactNode;
|
|
78
|
+
/**
|
|
79
|
+
* Body row height in px — the grid's `density` resolved (`pivotRowHeight`).
|
|
80
|
+
* The virtualizer, spacers and keyboard scrolling all run on it; the
|
|
81
|
+
* stylesheet's density class sets the matching line heights. Default 28.
|
|
82
|
+
*/
|
|
83
|
+
rowHeight?: number;
|
|
84
|
+
}
|
|
85
|
+
declare function PivotGridBody({ engineResult, isBuilding, buildProgress, rowFields, colFields: _colFields, dataFields, layout, expandedPaths, allExpanded, onToggleExpand, onExpandPaths, onCollapsePaths, expandedColPaths, allColExpanded, onToggleColExpand, onExpandColPaths, onCollapseColPaths, onCellClick, onContextMenu, onFilterClick, onRemoveField, onSort, onMoveField, onGlobalContextMenu, columnWidths, defaultColumnWidths, onColumnWidthsChange, onSelectionStatsChange, multiSelect, onSelectionChange, selectionApiRef, registry, keyboardNavigation, onCellPrepared, renderNodeContextMenu, rowHeight }: PivotGridBodyProps): React$1.JSX.Element;
|
|
86
|
+
|
|
9
87
|
/** The imperative handle a `ref` on the grid receives. */
|
|
10
88
|
interface PivotGridRef extends PivotGridRef$1 {
|
|
11
89
|
/**
|
|
@@ -58,6 +136,23 @@ interface PivotGridRef extends PivotGridRef$1 {
|
|
|
58
136
|
* and nothing changed, when it cannot be read (another `version`).
|
|
59
137
|
*/
|
|
60
138
|
applyPersistedState: (state: unknown) => boolean;
|
|
139
|
+
/**
|
|
140
|
+
* The selected data cells: paths, data field, value as drawn, and whether
|
|
141
|
+
* each is a plain cell, a subtotal or a grand total (B.25). Empty when
|
|
142
|
+
* nothing, or only row headers, is selected.
|
|
143
|
+
*/
|
|
144
|
+
getSelectedCells: () => PivotSelectedCell[];
|
|
145
|
+
/** Every field's filter off in one change; the prefilter stays (B.28). */
|
|
146
|
+
clearAllFilters: () => void;
|
|
147
|
+
/** Open or close the field chooser from the app (B.28). */
|
|
148
|
+
openFieldChooser: () => void;
|
|
149
|
+
closeFieldChooser: () => void;
|
|
150
|
+
/**
|
|
151
|
+
* The source rows behind the selected cells, filters applied, each row once
|
|
152
|
+
* — a subtotal and a cell under it do not list the cell's rows twice
|
|
153
|
+
* (Enterprise, B.25; throws on a Community grid).
|
|
154
|
+
*/
|
|
155
|
+
getRecordsForSelection: () => any[];
|
|
61
156
|
}
|
|
62
157
|
type PivotCellTemplate = (props: Parameters<PivotCellTemplate$1>[0]) => React$1.ReactNode;
|
|
63
158
|
type PivotConditionRule = PivotConditionRule$1<React$1.CSSProperties>;
|
|
@@ -190,7 +285,7 @@ interface BasePivotGridProps<TRow> {
|
|
|
190
285
|
striped?: boolean;
|
|
191
286
|
/**
|
|
192
287
|
* Row rhythm: `'compact'` (24px rows, one size smaller type), `'normal'`
|
|
193
|
-
* (28px, the default)
|
|
288
|
+
* (28px, the default), `'comfortable'` (36px) or `'touch'` (45px rows and headers, every target 44px, for a touch screen). Changing it repaints in
|
|
194
289
|
* place, without re-running the pivot engine.
|
|
195
290
|
*/
|
|
196
291
|
density?: PivotDensity;
|
|
@@ -219,6 +314,18 @@ interface BasePivotGridProps<TRow> {
|
|
|
219
314
|
onAfterPivotCalculate?: (result: PivotEngineResult) => void;
|
|
220
315
|
/** Fired when an export action is initiated. Can be canceled. */
|
|
221
316
|
onExporting?: (e: ExportingEvent) => void;
|
|
317
|
+
/**
|
|
318
|
+
* Every change of the selected data cells (B.25): `count`, and `cells`
|
|
319
|
+
* (paths, data field, value, kind) built when read. On Enterprise, Shift
|
|
320
|
+
* extends the selection, Ctrl/Cmd adds a rectangle, and on a touch screen a
|
|
321
|
+
* long press adds one and a drag grows it.
|
|
322
|
+
*/
|
|
323
|
+
onSelectionChange?: (event: PivotSelectionChangeEvent) => void;
|
|
324
|
+
/**
|
|
325
|
+
* Asked before a styled Excel export gives way to the plain .xls one (over
|
|
326
|
+
* 100,000 list rows or 150,000 pivot cells); return `false` to cancel (B.23).
|
|
327
|
+
*/
|
|
328
|
+
onLargeExport?: ExportOptions['onLargeExport'];
|
|
222
329
|
/** Fired after a cell is prepared to allow modifications. */
|
|
223
330
|
onCellPrepared?: (e: CellPreparedEvent<TRow>) => void;
|
|
224
331
|
/** Fired when fields configuration changes. */
|
|
@@ -288,59 +395,6 @@ declare const BasePivotGrid: <TRow>(props: BasePivotGridProps<TRow> & {
|
|
|
288
395
|
ref?: React__default.ForwardedRef<PivotGridRef>;
|
|
289
396
|
}) => ReturnType<typeof BasePivotGridInner>;
|
|
290
397
|
|
|
291
|
-
interface PivotGridBodyProps {
|
|
292
|
-
engineResult: PivotEngineResult;
|
|
293
|
-
isBuilding: boolean;
|
|
294
|
-
buildProgress?: number;
|
|
295
|
-
rowFields: PivotField[];
|
|
296
|
-
colFields: PivotField[];
|
|
297
|
-
dataFields: PivotField[];
|
|
298
|
-
layout: PivotLayoutState;
|
|
299
|
-
expandedPaths: Set<string>;
|
|
300
|
-
allExpanded: boolean;
|
|
301
|
-
onToggleExpand: (path: string) => void;
|
|
302
|
-
onExpandPaths: (paths: string[]) => void;
|
|
303
|
-
onCollapsePaths: (paths: string[]) => void;
|
|
304
|
-
expandedColPaths: Set<string>;
|
|
305
|
-
allColExpanded: boolean;
|
|
306
|
-
onToggleColExpand: (path: string) => void;
|
|
307
|
-
onExpandColPaths: (paths: string[]) => void;
|
|
308
|
-
onCollapseColPaths: (paths: string[]) => void;
|
|
309
|
-
onCellClick?: (e: CellClickEvent) => void;
|
|
310
|
-
onContextMenu?: (x: number, y: number, fieldId: string, colPath?: string) => void;
|
|
311
|
-
onFilterClick?: (x: number, y: number, fieldId: string) => void;
|
|
312
|
-
onRemoveField: (id: string) => void;
|
|
313
|
-
onSort?: (id: string, dir: 'asc' | 'desc' | undefined) => void;
|
|
314
|
-
/** Keyboard reorder for the header chips (#207). */
|
|
315
|
-
onMoveField?: (id: string, direction: 'start' | 'end' | 'left' | 'right') => void;
|
|
316
|
-
onGlobalContextMenu?: (x: number, y: number) => void;
|
|
317
|
-
columnWidths?: Record<string, number>;
|
|
318
|
-
/** What a column with no `columnWidths` entry is painted at. Defaults 150 / 95. */
|
|
319
|
-
defaultColumnWidths?: PivotColumnWidthDefaults;
|
|
320
|
-
onColumnWidthsChange?: (widths: Record<string, number>) => void;
|
|
321
|
-
onSelectionStatsChange?: (stats: {
|
|
322
|
-
count: number;
|
|
323
|
-
sum: number;
|
|
324
|
-
avg: number;
|
|
325
|
-
min: number;
|
|
326
|
-
max: number;
|
|
327
|
-
} | null) => void;
|
|
328
|
-
registry?: _kanunilabs_pivotgrid_core.PivotEngineRegistry;
|
|
329
|
-
keyboardNavigation?: {
|
|
330
|
-
enabled: boolean;
|
|
331
|
-
};
|
|
332
|
-
onCellPrepared?: (e: CellPreparedEvent<any>) => void;
|
|
333
|
-
disabled?: boolean;
|
|
334
|
-
renderNodeContextMenu?: (props: any) => React.ReactNode;
|
|
335
|
-
/**
|
|
336
|
-
* Body row height in px — the grid's `density` resolved (`pivotRowHeight`).
|
|
337
|
-
* The virtualizer, spacers and keyboard scrolling all run on it; the
|
|
338
|
-
* stylesheet's density class sets the matching line heights. Default 28.
|
|
339
|
-
*/
|
|
340
|
-
rowHeight?: number;
|
|
341
|
-
}
|
|
342
|
-
declare function PivotGridBody({ engineResult, isBuilding, buildProgress, rowFields, colFields: _colFields, dataFields, layout, expandedPaths, allExpanded, onToggleExpand, onExpandPaths, onCollapsePaths, expandedColPaths, allColExpanded, onToggleColExpand, onExpandColPaths, onCollapseColPaths, onCellClick, onContextMenu, onFilterClick, onRemoveField, onSort, onMoveField, onGlobalContextMenu, columnWidths, defaultColumnWidths, onColumnWidthsChange, onSelectionStatsChange, registry, keyboardNavigation, onCellPrepared, renderNodeContextMenu, rowHeight }: PivotGridBodyProps): React$1.JSX.Element;
|
|
343
|
-
|
|
344
398
|
interface PivotFooterProps {
|
|
345
399
|
onToggleFieldChooser: () => void;
|
|
346
400
|
fieldChooserOpen: boolean;
|
|
@@ -652,4 +706,4 @@ interface PivotThemeProviderProps {
|
|
|
652
706
|
}
|
|
653
707
|
declare function PivotThemeProvider({ theme, className, style, children }: PivotThemeProviderProps): React__default.JSX.Element;
|
|
654
708
|
|
|
655
|
-
export { BasePivotGrid, type BasePivotGridProps, type CellClickEvent, type CellPreparedEvent, type ChartSeriesDef, type ChartSyncResult, type NodeContextMenuState, PivotAreaStrips, type PivotCellTemplate, type PivotChartIntegrationOptions, type PivotConditionRule, PivotConfigProvider, PivotContextMenu, PivotErrorBoundary, type PivotField, PivotFieldList, PivotFieldSettingsDialog, PivotFooter, PivotGridBody, type PivotGridRef, PivotHeaderFilterPopup, PivotImportStatusModal, PivotNodeContextMenu, type PivotNodeContextMenuProps, PivotPortal, PivotPortalContext, PivotReportMenu, PivotReportSaveModal, PivotThemeProvider, usePivotChartSync, usePivotConfig, usePivotContextMenu, usePivotController, usePivotControllerStore, usePivotDnD, usePivotFullscreen };
|
|
709
|
+
export { BasePivotGrid, type BasePivotGridProps, type CellClickEvent, type CellPreparedEvent, type ChartSeriesDef, type ChartSyncResult, type NodeContextMenuState, PivotAreaStrips, type PivotCellTemplate, type PivotChartIntegrationOptions, type PivotConditionRule, PivotConfigProvider, PivotContextMenu, PivotErrorBoundary, type PivotField, PivotFieldList, PivotFieldSettingsDialog, PivotFooter, PivotGridBody, type PivotGridRef, PivotHeaderFilterPopup, PivotImportStatusModal, PivotNodeContextMenu, type PivotNodeContextMenuProps, PivotPortal, PivotPortalContext, PivotReportMenu, PivotReportSaveModal, type PivotSelectedCell, type PivotSelectionChangeEvent, PivotThemeProvider, usePivotChartSync, usePivotConfig, usePivotContextMenu, usePivotController, usePivotControllerStore, usePivotDnD, usePivotFullscreen };
|