@kanunilabs/pivotgrid-react 1.8.1 → 1.8.3
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 +281 -89
- package/dist/index.d.ts +281 -89
- package/dist/index.js +2 -2
- package/dist/styles.css +256 -56
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,88 @@
|
|
|
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,
|
|
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, 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
|
-
import { DragMoveEvent, DragEndEvent } from '@dnd-kit/core';
|
|
7
|
+
import { UniqueIdentifier, DroppableContainer, ClientRect, Announcements, DragStartEvent, DragMoveEvent, DragOverEvent, DragEndEvent } from '@dnd-kit/core';
|
|
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;
|
|
8
86
|
|
|
9
87
|
/** The imperative handle a `ref` on the grid receives. */
|
|
10
88
|
interface PivotGridRef extends PivotGridRef$1 {
|
|
@@ -58,6 +136,36 @@ 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
|
+
/**
|
|
148
|
+
* Take back the last layout change — areas, order, shown or hidden,
|
|
149
|
+
* caption, group; not filters (B.43). False when there is none. The grid
|
|
150
|
+
* has no shortcut for it: bind your own keys or buttons.
|
|
151
|
+
*/
|
|
152
|
+
undoLayout: () => boolean;
|
|
153
|
+
/** Put back the last change `undoLayout` took back. False when there is none. */
|
|
154
|
+
redoLayout: () => boolean;
|
|
155
|
+
/** Whether `undoLayout` / `redoLayout` has a step; also `getState().canUndoLayout` / `canRedoLayout`. */
|
|
156
|
+
canUndoLayout: () => boolean;
|
|
157
|
+
canRedoLayout: () => boolean;
|
|
158
|
+
/** Forget every undo and redo step. */
|
|
159
|
+
clearLayoutHistory: () => void;
|
|
160
|
+
/** Open or close the field chooser from the app (B.28). */
|
|
161
|
+
openFieldChooser: () => void;
|
|
162
|
+
closeFieldChooser: () => void;
|
|
163
|
+
/**
|
|
164
|
+
* The source rows behind the selected cells, filters applied, each row once
|
|
165
|
+
* — a subtotal and a cell under it do not list the cell's rows twice
|
|
166
|
+
* (Enterprise, B.25; throws on a Community grid).
|
|
167
|
+
*/
|
|
168
|
+
getRecordsForSelection: () => any[];
|
|
61
169
|
}
|
|
62
170
|
type PivotCellTemplate = (props: Parameters<PivotCellTemplate$1>[0]) => React$1.ReactNode;
|
|
63
171
|
type PivotConditionRule = PivotConditionRule$1<React$1.CSSProperties>;
|
|
@@ -113,6 +221,9 @@ interface ChartSyncResult {
|
|
|
113
221
|
}
|
|
114
222
|
declare function usePivotChartSync(engineResult: PivotEngineResult | null, fields: PivotField[], expandedPaths: Set<string>, options?: PivotChartIntegrationOptions): ChartSyncResult;
|
|
115
223
|
|
|
224
|
+
/** What a short tap on a field chip does on a touch screen (Tekax B.35). */
|
|
225
|
+
type PivotTouchChipTap = 'sort' | 'menu' | 'none';
|
|
226
|
+
|
|
116
227
|
/**
|
|
117
228
|
* Props for the BasePivotGrid component.
|
|
118
229
|
* This is the enterprise-grade data orchestration layer for analytics.
|
|
@@ -142,6 +253,13 @@ interface BasePivotGridProps<TRow> {
|
|
|
142
253
|
rowKey?: PivotControllerOptions<TRow>['rowKey'];
|
|
143
254
|
/** How long `ref.applyTransactionAsync` collects transactions before applying them together. Default 50 ms. */
|
|
144
255
|
asyncTransactionWait?: number;
|
|
256
|
+
/**
|
|
257
|
+
* The rows are still being fetched: while true, a grid with no result shows
|
|
258
|
+
* its loader instead of the "no data" text (mount with `data={[]}`, fill it
|
|
259
|
+
* with `applyTransactionAsync`, then set it to false). A result already on
|
|
260
|
+
* screen stays. Exports do not wait for it.
|
|
261
|
+
*/
|
|
262
|
+
loading?: boolean;
|
|
145
263
|
/** Initial field configuration (Uncontrolled mode). */
|
|
146
264
|
initialFields?: PivotField<TRow>[];
|
|
147
265
|
/** Controlled field configuration. If provided, component acts as controlled. */
|
|
@@ -161,10 +279,6 @@ interface BasePivotGridProps<TRow> {
|
|
|
161
279
|
dark?: boolean;
|
|
162
280
|
/** Callback fired when the refresh button is clicked. */
|
|
163
281
|
onRefresh?: () => void;
|
|
164
|
-
/** Callback fired when data is imported via the UI. */
|
|
165
|
-
onImportData?: (data: TRow[]) => void;
|
|
166
|
-
/** When true, UI imports open a preview + column-mapping step before applying. */
|
|
167
|
-
previewImport?: boolean;
|
|
168
282
|
/** Configuration for state storing (localStorage, sessionStorage, etc). */
|
|
169
283
|
stateStoring?: PivotStateStoringConfig;
|
|
170
284
|
/** Configuration for keyboard navigation and accessibility. */
|
|
@@ -190,7 +304,7 @@ interface BasePivotGridProps<TRow> {
|
|
|
190
304
|
striped?: boolean;
|
|
191
305
|
/**
|
|
192
306
|
* Row rhythm: `'compact'` (24px rows, one size smaller type), `'normal'`
|
|
193
|
-
* (28px, the default)
|
|
307
|
+
* (28px, the default), `'comfortable'` (36px) or `'touch'` (45px rows and headers, every target 44px, for a touch screen). Changing it repaints in
|
|
194
308
|
* place, without re-running the pivot engine.
|
|
195
309
|
*/
|
|
196
310
|
density?: PivotDensity;
|
|
@@ -213,12 +327,56 @@ interface BasePivotGridProps<TRow> {
|
|
|
213
327
|
* the component awaits validation before committing the DND state.
|
|
214
328
|
*/
|
|
215
329
|
onFieldMove?: (e: FieldMoveEvent) => void | Promise<void>;
|
|
330
|
+
/**
|
|
331
|
+
* How long (ms) a finger holds still on a field chip before it drags (Tekax
|
|
332
|
+
* B.35). Moving sooner scrolls the page instead. Default 200. Holding still
|
|
333
|
+
* a further 350 ms opens the chip's menu. A mouse or a pen drags after 8 px.
|
|
334
|
+
*/
|
|
335
|
+
touchDragDelay?: number;
|
|
336
|
+
/**
|
|
337
|
+
* What a short tap on a field chip does on a touch screen: `'sort'` (the
|
|
338
|
+
* default, as a click does), `'menu'` (opens the chip's menu) or `'none'`.
|
|
339
|
+
*/
|
|
340
|
+
touchChipTap?: PivotTouchChipTap;
|
|
341
|
+
/**
|
|
342
|
+
* How the field chooser opens (Tekax B.37). `'modal'` (the default): a
|
|
343
|
+
* floating window over a backdrop that covers the pivot. `'panel'`: a panel
|
|
344
|
+
* beside the pivot, at its end side, with no backdrop: the pivot stays
|
|
345
|
+
* usable, and a field drags both ways between the two — from the list to
|
|
346
|
+
* any strip or row header, from a pivot chip back to the list (which hides
|
|
347
|
+
* it). The footer button, `openFieldChooser` and `closeFieldChooser` open
|
|
348
|
+
* and close it either way. On a screen 768px wide or narrower the panel
|
|
349
|
+
* falls back to the full-screen chooser. Its width is the CSS variable
|
|
350
|
+
* `--pivot-chooser-panel-width` (default 320px).
|
|
351
|
+
*/
|
|
352
|
+
fieldChooserMode?: 'modal' | 'panel';
|
|
216
353
|
/** Fired immediately before the Pivot matrix compute cycle begins. */
|
|
217
354
|
onBeforePivotCalculate?: () => void;
|
|
218
355
|
/** Fired after the Pivot matrix compute cycle completes successfully. */
|
|
219
356
|
onAfterPivotCalculate?: (result: PivotEngineResult) => void;
|
|
220
357
|
/** Fired when an export action is initiated. Can be canceled. */
|
|
221
358
|
onExporting?: (e: ExportingEvent) => void;
|
|
359
|
+
/**
|
|
360
|
+
* Every change of the selected data cells (B.25): `count`, and `cells`
|
|
361
|
+
* (paths, data field, value, kind) built when read. On Enterprise, Shift
|
|
362
|
+
* extends the selection, Ctrl/Cmd adds a rectangle, and on a touch screen a
|
|
363
|
+
* long press adds one and a drag grows it.
|
|
364
|
+
*/
|
|
365
|
+
onSelectionChange?: (event: PivotSelectionChangeEvent) => void;
|
|
366
|
+
/**
|
|
367
|
+
* Asked before a styled Excel export gives way to the plain .xls one (over
|
|
368
|
+
* 100,000 list rows or 150,000 pivot cells); return `false` to cancel (B.23).
|
|
369
|
+
*/
|
|
370
|
+
onLargeExport?: ExportOptions['onLargeExport'];
|
|
371
|
+
/**
|
|
372
|
+
* The pivot started (`true`) or finished (`false`) computing a change — data,
|
|
373
|
+
* fields, a filter, an expand. While it is `true` the table on screen is the
|
|
374
|
+
* previous result; `exportData` waits for `false` by itself (B.31).
|
|
375
|
+
* The export waits without a time limit, a slow `serverSource.compute`
|
|
376
|
+
* included. Print and clipboard run after the wait, so a browser may refuse
|
|
377
|
+
* them once the click that asked for them has expired.
|
|
378
|
+
*/
|
|
379
|
+
onComputingChange?: (computing: boolean) => void;
|
|
222
380
|
/** Fired after a cell is prepared to allow modifications. */
|
|
223
381
|
onCellPrepared?: (e: CellPreparedEvent<TRow>) => void;
|
|
224
382
|
/** Fired when fields configuration changes. */
|
|
@@ -288,69 +446,11 @@ declare const BasePivotGrid: <TRow>(props: BasePivotGridProps<TRow> & {
|
|
|
288
446
|
ref?: React__default.ForwardedRef<PivotGridRef>;
|
|
289
447
|
}) => ReturnType<typeof BasePivotGridInner>;
|
|
290
448
|
|
|
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
449
|
interface PivotFooterProps {
|
|
345
450
|
onToggleFieldChooser: () => void;
|
|
346
451
|
fieldChooserOpen: boolean;
|
|
347
452
|
onRefresh?: () => void;
|
|
348
453
|
onExport: (format: ExportFormat | string) => void;
|
|
349
|
-
onImportFile?: (file: File) => void;
|
|
350
|
-
/** Multi-file import (drag-drop / file picker with multiple selection). */
|
|
351
|
-
onImportFiles?: (files: File[]) => void;
|
|
352
|
-
/** Import delimited text from the clipboard. */
|
|
353
|
-
onPasteImport?: () => void;
|
|
354
454
|
onExpandAll: () => void;
|
|
355
455
|
onCollapseAll: () => void;
|
|
356
456
|
onAddCalculatedField?: () => void;
|
|
@@ -391,7 +491,7 @@ interface PivotFooterProps {
|
|
|
391
491
|
/** The search in effect, so one set through `ref.setSearchText` shows in the box. */
|
|
392
492
|
searchText?: string;
|
|
393
493
|
}
|
|
394
|
-
declare function PivotFooter({ onToggleFieldChooser, fieldChooserOpen, onRefresh, onExport,
|
|
494
|
+
declare function PivotFooter({ onToggleFieldChooser, fieldChooserOpen, onRefresh, onExport, onExpandAll, onCollapseAll, onAddCalculatedField, onOpenPrefilter, onToggleChart, isFullscreen, onToggleFullscreen, reports, activeReportId, onSaveNewReport, onUpdateCurrentReport, onSaveAsReport, onLoadReport, onDeleteReport, onSetDefaultReport, onGlobalContextMenu, selectionStats, toolbarConfig, registry, advancedExport, upgradeUrl, onSearch, searchText }: PivotFooterProps): React$1.JSX.Element;
|
|
395
495
|
|
|
396
496
|
type MoveDirection = 'start' | 'end' | 'left' | 'right';
|
|
397
497
|
interface PivotAreaStripsProps {
|
|
@@ -403,8 +503,14 @@ interface PivotAreaStripsProps {
|
|
|
403
503
|
onGlobalContextMenu?: (x: number, y: number) => void;
|
|
404
504
|
/** Reorder within the area — the Order submenu's verbs, on keys (#207). */
|
|
405
505
|
onMoveField?: (id: string, direction: MoveDirection) => void;
|
|
506
|
+
/** `layout.filterAreaMaxRows` (B.38). */
|
|
507
|
+
maxRows?: number;
|
|
508
|
+
/** `layout.filterAreaCollapsed` (B.38). */
|
|
509
|
+
collapsed?: boolean;
|
|
510
|
+
/** The strip's collapse button; without it there is no button. */
|
|
511
|
+
onToggleCollapsed?: () => void;
|
|
406
512
|
}
|
|
407
|
-
declare function PivotAreaStrips({ filterFields, onRemoveField, onFilterClick, onContextMenu, onSort, onGlobalContextMenu, onMoveField, }: PivotAreaStripsProps): React__default.JSX.Element;
|
|
513
|
+
declare function PivotAreaStrips({ filterFields, onRemoveField, onFilterClick, onContextMenu, onSort, onGlobalContextMenu, onMoveField, maxRows, collapsed, onToggleCollapsed, }: PivotAreaStripsProps): React__default.JSX.Element;
|
|
408
514
|
|
|
409
515
|
interface PivotFieldListProps {
|
|
410
516
|
area: string;
|
|
@@ -459,6 +565,12 @@ interface PivotContextMenuProps {
|
|
|
459
565
|
onMoveField?: (direction: 'start' | 'end' | 'left' | 'right') => void;
|
|
460
566
|
/** Move the field to another area — the only pointer-free way between areas (#207). */
|
|
461
567
|
onMoveToArea?: (area: PivotArea) => void;
|
|
568
|
+
/**
|
|
569
|
+
* May the field go to `area`? The grid passes `controller.canMoveFieldTo`,
|
|
570
|
+
* which also knows the other members of a field group (B.40). Without it the
|
|
571
|
+
* field's own `allowedAreas` decide.
|
|
572
|
+
*/
|
|
573
|
+
canMoveToArea?: (area: PivotArea) => boolean;
|
|
462
574
|
onShowFieldChooser?: () => void;
|
|
463
575
|
colPath?: string;
|
|
464
576
|
rowFields?: PivotField[];
|
|
@@ -472,8 +584,13 @@ interface PivotContextMenuProps {
|
|
|
472
584
|
onEditCalculatedField?: () => void;
|
|
473
585
|
/** The value / label filter dialog (G-PIV-03); the item shows for row and column fields. */
|
|
474
586
|
onConditionFilter?: () => void;
|
|
587
|
+
/**
|
|
588
|
+
* The member filter — on a touch screen the chip's own filter button is not
|
|
589
|
+
* shown (B.48), so the menu carries it. Not shown for data fields.
|
|
590
|
+
*/
|
|
591
|
+
onFilter?: () => void;
|
|
475
592
|
}
|
|
476
|
-
declare function PivotContextMenu({ x, y, field, colPath, rowFields, onClose, onSort, onSortBySummary, onClearAllSorting, onHide, onSettings, onMoveField, onMoveToArea, onShowFieldChooser, customContextMenuItems, onEditCalculatedField, onConditionFilter }: PivotContextMenuProps): React$1.JSX.Element;
|
|
593
|
+
declare function PivotContextMenu({ x, y, field, colPath, rowFields, onClose, onSort, onSortBySummary, canMoveToArea, onClearAllSorting, onHide, onSettings, onMoveField, onMoveToArea, onShowFieldChooser, customContextMenuItems, onEditCalculatedField, onConditionFilter, onFilter }: PivotContextMenuProps): React$1.JSX.Element;
|
|
477
594
|
|
|
478
595
|
interface NodeContextMenuState {
|
|
479
596
|
x: number;
|
|
@@ -503,23 +620,6 @@ interface PivotPortalProps {
|
|
|
503
620
|
}
|
|
504
621
|
declare function PivotPortal({ children }: PivotPortalProps): React__default.ReactPortal | null;
|
|
505
622
|
|
|
506
|
-
interface PivotImportStatusModalProps {
|
|
507
|
-
isOpen: boolean;
|
|
508
|
-
onClose: () => void;
|
|
509
|
-
status: 'loading' | 'success' | 'error' | 'warning';
|
|
510
|
-
title: string;
|
|
511
|
-
messages: string[];
|
|
512
|
-
/** Overall parse progress 0..100 while a large file streams in. */
|
|
513
|
-
progress?: number;
|
|
514
|
-
/** Coarse pipeline stage label (reading | parsing | typing | finalizing). */
|
|
515
|
-
phase?: string;
|
|
516
|
-
/** Whether the in-flight import can be cancelled. */
|
|
517
|
-
cancellable?: boolean;
|
|
518
|
-
/** Invoked when the user clicks Cancel during a loading import. */
|
|
519
|
-
onCancel?: () => void;
|
|
520
|
-
}
|
|
521
|
-
declare function PivotImportStatusModal({ isOpen, onClose, status, title, messages, progress, phase, cancellable, onCancel, }: PivotImportStatusModalProps): React$1.JSX.Element | null;
|
|
522
|
-
|
|
523
623
|
interface PivotReportMenuProps {
|
|
524
624
|
reports: PivotReport[];
|
|
525
625
|
activeReportId: string | null;
|
|
@@ -564,20 +664,112 @@ declare function usePivotController<TRow>(options: PivotControllerOptions<TRow>)
|
|
|
564
664
|
|
|
565
665
|
declare function usePivotControllerStore<TRow, TSelected>(controller: PivotController<TRow>, selector: (state: PivotControllerState<TRow>) => TSelected, isEqual?: (previous: TSelected, next: TSelected) => boolean): TSelected;
|
|
566
666
|
|
|
667
|
+
/** Which surface a droppable belongs to: the pivot itself, or the field chooser. */
|
|
668
|
+
type PivotDropScope = 'pivot' | 'chooser';
|
|
669
|
+
type PivotDropTarget =
|
|
670
|
+
/** A field's chip: the drop goes before or after it. */
|
|
671
|
+
{
|
|
672
|
+
kind: 'field';
|
|
673
|
+
fieldId: string;
|
|
674
|
+
area: PivotArea;
|
|
675
|
+
scope: PivotDropScope;
|
|
676
|
+
orientation: 'horizontal' | 'vertical';
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* An area. `end`: always the end of the area (the space after the chips,
|
|
680
|
+
* a row header cell, the chooser list). Otherwise a hit in the gap between
|
|
681
|
+
* chips goes to the closest chip.
|
|
682
|
+
*/
|
|
683
|
+
| {
|
|
684
|
+
kind: 'area';
|
|
685
|
+
area: PivotArea;
|
|
686
|
+
scope: PivotDropScope;
|
|
687
|
+
end?: boolean;
|
|
688
|
+
};
|
|
689
|
+
interface PivotHit {
|
|
690
|
+
id: UniqueIdentifier;
|
|
691
|
+
target: PivotDropTarget;
|
|
692
|
+
/** The droppable's rect NOW (not the one measured when the drag began). */
|
|
693
|
+
rect: {
|
|
694
|
+
left: number;
|
|
695
|
+
top: number;
|
|
696
|
+
width: number;
|
|
697
|
+
height: number;
|
|
698
|
+
};
|
|
699
|
+
pointer: {
|
|
700
|
+
x: number;
|
|
701
|
+
y: number;
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
interface PivotCollisionMemory {
|
|
705
|
+
/** The hit of the latest collision run, the one the indicator and the drop read. */
|
|
706
|
+
hit: PivotHit | null;
|
|
707
|
+
/** The latest pointer and droppables, to hit-test again at the drop. */
|
|
708
|
+
pointer: {
|
|
709
|
+
x: number;
|
|
710
|
+
y: number;
|
|
711
|
+
} | null;
|
|
712
|
+
containers: DroppableContainer[];
|
|
713
|
+
rects?: Map<UniqueIdentifier, ClientRect>;
|
|
714
|
+
/**
|
|
715
|
+
* Where the pointer (or finger) last WAS, from the browser's own events —
|
|
716
|
+
* not from the last collision run, which dnd-kit does in a render that can
|
|
717
|
+
* still be pending when the button goes up. A drag that jumps to its target
|
|
718
|
+
* and is released there (one move, no settling move) had no collision run
|
|
719
|
+
* at all, so the drop saw no pointer and moved nothing (B.51 addendum).
|
|
720
|
+
*/
|
|
721
|
+
live: {
|
|
722
|
+
x: number;
|
|
723
|
+
y: number;
|
|
724
|
+
} | null;
|
|
725
|
+
/** The enabled droppables NOW (a probe inside the DndContext keeps this); `containers` is only what a collision run saw. */
|
|
726
|
+
registry: (() => DroppableContainer[]) | null;
|
|
727
|
+
}
|
|
728
|
+
|
|
567
729
|
interface UsePivotDnDProps<TRow> {
|
|
568
730
|
fields: PivotField<TRow>[];
|
|
569
731
|
controller: PivotController<TRow>;
|
|
732
|
+
/** Hold time (ms) before a finger drags a chip. Default 200. */
|
|
733
|
+
touchDragDelay?: number;
|
|
734
|
+
/** The grid's text, for the screen-reader announcements. Without it dnd-kit's English is used. */
|
|
735
|
+
t?: (key: string) => string;
|
|
736
|
+
locale?: string;
|
|
737
|
+
rtl?: boolean;
|
|
738
|
+
/** Opens a pivot chip's menu at (x, y): a long press on touch does it (B.35). */
|
|
739
|
+
onChipLongPress?: (fieldId: string, x: number, y: number) => void;
|
|
740
|
+
/** The grid's own element: only scroll containers inside it scroll by themselves while dragging (B.36). */
|
|
741
|
+
scrollRoot?: {
|
|
742
|
+
current: HTMLElement | null;
|
|
743
|
+
};
|
|
570
744
|
}
|
|
571
|
-
declare function usePivotDnD<TRow>({ fields, controller }: UsePivotDnDProps<TRow>): {
|
|
745
|
+
declare function usePivotDnD<TRow>({ fields, controller, touchDragDelay, t, locale, rtl, onChipLongPress, scrollRoot, }: UsePivotDnDProps<TRow>): {
|
|
572
746
|
activeDragId: string | null;
|
|
747
|
+
/** The field being dragged (`activeDragId` is the chip's id, prefixed in the field chooser). */
|
|
748
|
+
activeFieldId: string | null;
|
|
573
749
|
sensors: _dnd_kit_core.SensorDescriptor<_dnd_kit_core.SensorOptions>[];
|
|
574
|
-
|
|
750
|
+
collisionDetection: _dnd_kit_core.CollisionDetection;
|
|
751
|
+
announcements: Announcements | undefined;
|
|
752
|
+
handleDragStart: (event: DragStartEvent) => void;
|
|
575
753
|
handleDragMove: (event: DragMoveEvent) => void;
|
|
754
|
+
handleDragOver: (event: DragOverEvent) => void;
|
|
576
755
|
handleDragEnd: (event: DragEndEvent) => Promise<void>;
|
|
756
|
+
handleDragCancel: () => void;
|
|
757
|
+
/** The collision memory, for the probe inside the DndContext. */
|
|
758
|
+
memory: PivotCollisionMemory;
|
|
577
759
|
handleRemoveField: (id: string) => void;
|
|
578
760
|
handleMoveField: (fieldId: string, direction: "start" | "end" | "left" | "right") => void;
|
|
579
761
|
};
|
|
580
762
|
|
|
763
|
+
/**
|
|
764
|
+
* Full screen for the pivot's own container. Native first; a CSS look
|
|
765
|
+
* (`emulated`) where the API is missing or refuses.
|
|
766
|
+
*
|
|
767
|
+
* Tekax B.33: any `fullscreenchange` used to count as the pivot's own, so a
|
|
768
|
+
* video, a chart or the page itself going full screen flipped the pivot into
|
|
769
|
+
* its fullscreen look (fixed, z-index 99999) over that element. Now the pivot
|
|
770
|
+
* is full screen only when the browser's full-screen element IS its container
|
|
771
|
+
* — the plain JS twin (fullscreen.ts) has compared it that way all along.
|
|
772
|
+
*/
|
|
581
773
|
declare function usePivotFullscreen(): {
|
|
582
774
|
isFullscreen: boolean;
|
|
583
775
|
containerRef: React$1.RefObject<HTMLDivElement | null>;
|
|
@@ -652,4 +844,4 @@ interface PivotThemeProviderProps {
|
|
|
652
844
|
}
|
|
653
845
|
declare function PivotThemeProvider({ theme, className, style, children }: PivotThemeProviderProps): React__default.JSX.Element;
|
|
654
846
|
|
|
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,
|
|
847
|
+
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, PivotNodeContextMenu, type PivotNodeContextMenuProps, PivotPortal, PivotPortalContext, PivotReportMenu, PivotReportSaveModal, type PivotSelectedCell, type PivotSelectionChangeEvent, PivotThemeProvider, usePivotChartSync, usePivotConfig, usePivotContextMenu, usePivotController, usePivotControllerStore, usePivotDnD, usePivotFullscreen };
|