@kanunilabs/pivotgrid-react 1.8.2 → 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 +172 -34
- package/dist/index.d.ts +172 -34
- package/dist/index.js +2 -2
- package/dist/styles.css +197 -41
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -2,9 +2,9 @@ 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
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,
|
|
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
8
|
|
|
9
9
|
/** A selected data cell (B.25). */
|
|
10
10
|
interface PivotSelectedCell {
|
|
@@ -144,6 +144,19 @@ interface PivotGridRef extends PivotGridRef$1 {
|
|
|
144
144
|
getSelectedCells: () => PivotSelectedCell[];
|
|
145
145
|
/** Every field's filter off in one change; the prefilter stays (B.28). */
|
|
146
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;
|
|
147
160
|
/** Open or close the field chooser from the app (B.28). */
|
|
148
161
|
openFieldChooser: () => void;
|
|
149
162
|
closeFieldChooser: () => void;
|
|
@@ -208,6 +221,9 @@ interface ChartSyncResult {
|
|
|
208
221
|
}
|
|
209
222
|
declare function usePivotChartSync(engineResult: PivotEngineResult | null, fields: PivotField[], expandedPaths: Set<string>, options?: PivotChartIntegrationOptions): ChartSyncResult;
|
|
210
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
|
+
|
|
211
227
|
/**
|
|
212
228
|
* Props for the BasePivotGrid component.
|
|
213
229
|
* This is the enterprise-grade data orchestration layer for analytics.
|
|
@@ -237,6 +253,13 @@ interface BasePivotGridProps<TRow> {
|
|
|
237
253
|
rowKey?: PivotControllerOptions<TRow>['rowKey'];
|
|
238
254
|
/** How long `ref.applyTransactionAsync` collects transactions before applying them together. Default 50 ms. */
|
|
239
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;
|
|
240
263
|
/** Initial field configuration (Uncontrolled mode). */
|
|
241
264
|
initialFields?: PivotField<TRow>[];
|
|
242
265
|
/** Controlled field configuration. If provided, component acts as controlled. */
|
|
@@ -256,10 +279,6 @@ interface BasePivotGridProps<TRow> {
|
|
|
256
279
|
dark?: boolean;
|
|
257
280
|
/** Callback fired when the refresh button is clicked. */
|
|
258
281
|
onRefresh?: () => void;
|
|
259
|
-
/** Callback fired when data is imported via the UI. */
|
|
260
|
-
onImportData?: (data: TRow[]) => void;
|
|
261
|
-
/** When true, UI imports open a preview + column-mapping step before applying. */
|
|
262
|
-
previewImport?: boolean;
|
|
263
282
|
/** Configuration for state storing (localStorage, sessionStorage, etc). */
|
|
264
283
|
stateStoring?: PivotStateStoringConfig;
|
|
265
284
|
/** Configuration for keyboard navigation and accessibility. */
|
|
@@ -308,6 +327,29 @@ interface BasePivotGridProps<TRow> {
|
|
|
308
327
|
* the component awaits validation before committing the DND state.
|
|
309
328
|
*/
|
|
310
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';
|
|
311
353
|
/** Fired immediately before the Pivot matrix compute cycle begins. */
|
|
312
354
|
onBeforePivotCalculate?: () => void;
|
|
313
355
|
/** Fired after the Pivot matrix compute cycle completes successfully. */
|
|
@@ -326,6 +368,15 @@ interface BasePivotGridProps<TRow> {
|
|
|
326
368
|
* 100,000 list rows or 150,000 pivot cells); return `false` to cancel (B.23).
|
|
327
369
|
*/
|
|
328
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;
|
|
329
380
|
/** Fired after a cell is prepared to allow modifications. */
|
|
330
381
|
onCellPrepared?: (e: CellPreparedEvent<TRow>) => void;
|
|
331
382
|
/** Fired when fields configuration changes. */
|
|
@@ -400,11 +451,6 @@ interface PivotFooterProps {
|
|
|
400
451
|
fieldChooserOpen: boolean;
|
|
401
452
|
onRefresh?: () => void;
|
|
402
453
|
onExport: (format: ExportFormat | string) => void;
|
|
403
|
-
onImportFile?: (file: File) => void;
|
|
404
|
-
/** Multi-file import (drag-drop / file picker with multiple selection). */
|
|
405
|
-
onImportFiles?: (files: File[]) => void;
|
|
406
|
-
/** Import delimited text from the clipboard. */
|
|
407
|
-
onPasteImport?: () => void;
|
|
408
454
|
onExpandAll: () => void;
|
|
409
455
|
onCollapseAll: () => void;
|
|
410
456
|
onAddCalculatedField?: () => void;
|
|
@@ -445,7 +491,7 @@ interface PivotFooterProps {
|
|
|
445
491
|
/** The search in effect, so one set through `ref.setSearchText` shows in the box. */
|
|
446
492
|
searchText?: string;
|
|
447
493
|
}
|
|
448
|
-
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;
|
|
449
495
|
|
|
450
496
|
type MoveDirection = 'start' | 'end' | 'left' | 'right';
|
|
451
497
|
interface PivotAreaStripsProps {
|
|
@@ -457,8 +503,14 @@ interface PivotAreaStripsProps {
|
|
|
457
503
|
onGlobalContextMenu?: (x: number, y: number) => void;
|
|
458
504
|
/** Reorder within the area — the Order submenu's verbs, on keys (#207). */
|
|
459
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;
|
|
460
512
|
}
|
|
461
|
-
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;
|
|
462
514
|
|
|
463
515
|
interface PivotFieldListProps {
|
|
464
516
|
area: string;
|
|
@@ -513,6 +565,12 @@ interface PivotContextMenuProps {
|
|
|
513
565
|
onMoveField?: (direction: 'start' | 'end' | 'left' | 'right') => void;
|
|
514
566
|
/** Move the field to another area — the only pointer-free way between areas (#207). */
|
|
515
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;
|
|
516
574
|
onShowFieldChooser?: () => void;
|
|
517
575
|
colPath?: string;
|
|
518
576
|
rowFields?: PivotField[];
|
|
@@ -526,8 +584,13 @@ interface PivotContextMenuProps {
|
|
|
526
584
|
onEditCalculatedField?: () => void;
|
|
527
585
|
/** The value / label filter dialog (G-PIV-03); the item shows for row and column fields. */
|
|
528
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;
|
|
529
592
|
}
|
|
530
|
-
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;
|
|
531
594
|
|
|
532
595
|
interface NodeContextMenuState {
|
|
533
596
|
x: number;
|
|
@@ -557,23 +620,6 @@ interface PivotPortalProps {
|
|
|
557
620
|
}
|
|
558
621
|
declare function PivotPortal({ children }: PivotPortalProps): React__default.ReactPortal | null;
|
|
559
622
|
|
|
560
|
-
interface PivotImportStatusModalProps {
|
|
561
|
-
isOpen: boolean;
|
|
562
|
-
onClose: () => void;
|
|
563
|
-
status: 'loading' | 'success' | 'error' | 'warning';
|
|
564
|
-
title: string;
|
|
565
|
-
messages: string[];
|
|
566
|
-
/** Overall parse progress 0..100 while a large file streams in. */
|
|
567
|
-
progress?: number;
|
|
568
|
-
/** Coarse pipeline stage label (reading | parsing | typing | finalizing). */
|
|
569
|
-
phase?: string;
|
|
570
|
-
/** Whether the in-flight import can be cancelled. */
|
|
571
|
-
cancellable?: boolean;
|
|
572
|
-
/** Invoked when the user clicks Cancel during a loading import. */
|
|
573
|
-
onCancel?: () => void;
|
|
574
|
-
}
|
|
575
|
-
declare function PivotImportStatusModal({ isOpen, onClose, status, title, messages, progress, phase, cancellable, onCancel, }: PivotImportStatusModalProps): React$1.JSX.Element | null;
|
|
576
|
-
|
|
577
623
|
interface PivotReportMenuProps {
|
|
578
624
|
reports: PivotReport[];
|
|
579
625
|
activeReportId: string | null;
|
|
@@ -618,20 +664,112 @@ declare function usePivotController<TRow>(options: PivotControllerOptions<TRow>)
|
|
|
618
664
|
|
|
619
665
|
declare function usePivotControllerStore<TRow, TSelected>(controller: PivotController<TRow>, selector: (state: PivotControllerState<TRow>) => TSelected, isEqual?: (previous: TSelected, next: TSelected) => boolean): TSelected;
|
|
620
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
|
+
|
|
621
729
|
interface UsePivotDnDProps<TRow> {
|
|
622
730
|
fields: PivotField<TRow>[];
|
|
623
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
|
+
};
|
|
624
744
|
}
|
|
625
|
-
declare function usePivotDnD<TRow>({ fields, controller }: UsePivotDnDProps<TRow>): {
|
|
745
|
+
declare function usePivotDnD<TRow>({ fields, controller, touchDragDelay, t, locale, rtl, onChipLongPress, scrollRoot, }: UsePivotDnDProps<TRow>): {
|
|
626
746
|
activeDragId: string | null;
|
|
747
|
+
/** The field being dragged (`activeDragId` is the chip's id, prefixed in the field chooser). */
|
|
748
|
+
activeFieldId: string | null;
|
|
627
749
|
sensors: _dnd_kit_core.SensorDescriptor<_dnd_kit_core.SensorOptions>[];
|
|
628
|
-
|
|
750
|
+
collisionDetection: _dnd_kit_core.CollisionDetection;
|
|
751
|
+
announcements: Announcements | undefined;
|
|
752
|
+
handleDragStart: (event: DragStartEvent) => void;
|
|
629
753
|
handleDragMove: (event: DragMoveEvent) => void;
|
|
754
|
+
handleDragOver: (event: DragOverEvent) => void;
|
|
630
755
|
handleDragEnd: (event: DragEndEvent) => Promise<void>;
|
|
756
|
+
handleDragCancel: () => void;
|
|
757
|
+
/** The collision memory, for the probe inside the DndContext. */
|
|
758
|
+
memory: PivotCollisionMemory;
|
|
631
759
|
handleRemoveField: (id: string) => void;
|
|
632
760
|
handleMoveField: (fieldId: string, direction: "start" | "end" | "left" | "right") => void;
|
|
633
761
|
};
|
|
634
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
|
+
*/
|
|
635
773
|
declare function usePivotFullscreen(): {
|
|
636
774
|
isFullscreen: boolean;
|
|
637
775
|
containerRef: React$1.RefObject<HTMLDivElement | null>;
|
|
@@ -706,4 +844,4 @@ interface PivotThemeProviderProps {
|
|
|
706
844
|
}
|
|
707
845
|
declare function PivotThemeProvider({ theme, className, style, children }: PivotThemeProviderProps): React__default.JSX.Element;
|
|
708
846
|
|
|
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,
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ 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
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,
|
|
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
8
|
|
|
9
9
|
/** A selected data cell (B.25). */
|
|
10
10
|
interface PivotSelectedCell {
|
|
@@ -144,6 +144,19 @@ interface PivotGridRef extends PivotGridRef$1 {
|
|
|
144
144
|
getSelectedCells: () => PivotSelectedCell[];
|
|
145
145
|
/** Every field's filter off in one change; the prefilter stays (B.28). */
|
|
146
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;
|
|
147
160
|
/** Open or close the field chooser from the app (B.28). */
|
|
148
161
|
openFieldChooser: () => void;
|
|
149
162
|
closeFieldChooser: () => void;
|
|
@@ -208,6 +221,9 @@ interface ChartSyncResult {
|
|
|
208
221
|
}
|
|
209
222
|
declare function usePivotChartSync(engineResult: PivotEngineResult | null, fields: PivotField[], expandedPaths: Set<string>, options?: PivotChartIntegrationOptions): ChartSyncResult;
|
|
210
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
|
+
|
|
211
227
|
/**
|
|
212
228
|
* Props for the BasePivotGrid component.
|
|
213
229
|
* This is the enterprise-grade data orchestration layer for analytics.
|
|
@@ -237,6 +253,13 @@ interface BasePivotGridProps<TRow> {
|
|
|
237
253
|
rowKey?: PivotControllerOptions<TRow>['rowKey'];
|
|
238
254
|
/** How long `ref.applyTransactionAsync` collects transactions before applying them together. Default 50 ms. */
|
|
239
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;
|
|
240
263
|
/** Initial field configuration (Uncontrolled mode). */
|
|
241
264
|
initialFields?: PivotField<TRow>[];
|
|
242
265
|
/** Controlled field configuration. If provided, component acts as controlled. */
|
|
@@ -256,10 +279,6 @@ interface BasePivotGridProps<TRow> {
|
|
|
256
279
|
dark?: boolean;
|
|
257
280
|
/** Callback fired when the refresh button is clicked. */
|
|
258
281
|
onRefresh?: () => void;
|
|
259
|
-
/** Callback fired when data is imported via the UI. */
|
|
260
|
-
onImportData?: (data: TRow[]) => void;
|
|
261
|
-
/** When true, UI imports open a preview + column-mapping step before applying. */
|
|
262
|
-
previewImport?: boolean;
|
|
263
282
|
/** Configuration for state storing (localStorage, sessionStorage, etc). */
|
|
264
283
|
stateStoring?: PivotStateStoringConfig;
|
|
265
284
|
/** Configuration for keyboard navigation and accessibility. */
|
|
@@ -308,6 +327,29 @@ interface BasePivotGridProps<TRow> {
|
|
|
308
327
|
* the component awaits validation before committing the DND state.
|
|
309
328
|
*/
|
|
310
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';
|
|
311
353
|
/** Fired immediately before the Pivot matrix compute cycle begins. */
|
|
312
354
|
onBeforePivotCalculate?: () => void;
|
|
313
355
|
/** Fired after the Pivot matrix compute cycle completes successfully. */
|
|
@@ -326,6 +368,15 @@ interface BasePivotGridProps<TRow> {
|
|
|
326
368
|
* 100,000 list rows or 150,000 pivot cells); return `false` to cancel (B.23).
|
|
327
369
|
*/
|
|
328
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;
|
|
329
380
|
/** Fired after a cell is prepared to allow modifications. */
|
|
330
381
|
onCellPrepared?: (e: CellPreparedEvent<TRow>) => void;
|
|
331
382
|
/** Fired when fields configuration changes. */
|
|
@@ -400,11 +451,6 @@ interface PivotFooterProps {
|
|
|
400
451
|
fieldChooserOpen: boolean;
|
|
401
452
|
onRefresh?: () => void;
|
|
402
453
|
onExport: (format: ExportFormat | string) => void;
|
|
403
|
-
onImportFile?: (file: File) => void;
|
|
404
|
-
/** Multi-file import (drag-drop / file picker with multiple selection). */
|
|
405
|
-
onImportFiles?: (files: File[]) => void;
|
|
406
|
-
/** Import delimited text from the clipboard. */
|
|
407
|
-
onPasteImport?: () => void;
|
|
408
454
|
onExpandAll: () => void;
|
|
409
455
|
onCollapseAll: () => void;
|
|
410
456
|
onAddCalculatedField?: () => void;
|
|
@@ -445,7 +491,7 @@ interface PivotFooterProps {
|
|
|
445
491
|
/** The search in effect, so one set through `ref.setSearchText` shows in the box. */
|
|
446
492
|
searchText?: string;
|
|
447
493
|
}
|
|
448
|
-
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;
|
|
449
495
|
|
|
450
496
|
type MoveDirection = 'start' | 'end' | 'left' | 'right';
|
|
451
497
|
interface PivotAreaStripsProps {
|
|
@@ -457,8 +503,14 @@ interface PivotAreaStripsProps {
|
|
|
457
503
|
onGlobalContextMenu?: (x: number, y: number) => void;
|
|
458
504
|
/** Reorder within the area — the Order submenu's verbs, on keys (#207). */
|
|
459
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;
|
|
460
512
|
}
|
|
461
|
-
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;
|
|
462
514
|
|
|
463
515
|
interface PivotFieldListProps {
|
|
464
516
|
area: string;
|
|
@@ -513,6 +565,12 @@ interface PivotContextMenuProps {
|
|
|
513
565
|
onMoveField?: (direction: 'start' | 'end' | 'left' | 'right') => void;
|
|
514
566
|
/** Move the field to another area — the only pointer-free way between areas (#207). */
|
|
515
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;
|
|
516
574
|
onShowFieldChooser?: () => void;
|
|
517
575
|
colPath?: string;
|
|
518
576
|
rowFields?: PivotField[];
|
|
@@ -526,8 +584,13 @@ interface PivotContextMenuProps {
|
|
|
526
584
|
onEditCalculatedField?: () => void;
|
|
527
585
|
/** The value / label filter dialog (G-PIV-03); the item shows for row and column fields. */
|
|
528
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;
|
|
529
592
|
}
|
|
530
|
-
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;
|
|
531
594
|
|
|
532
595
|
interface NodeContextMenuState {
|
|
533
596
|
x: number;
|
|
@@ -557,23 +620,6 @@ interface PivotPortalProps {
|
|
|
557
620
|
}
|
|
558
621
|
declare function PivotPortal({ children }: PivotPortalProps): React__default.ReactPortal | null;
|
|
559
622
|
|
|
560
|
-
interface PivotImportStatusModalProps {
|
|
561
|
-
isOpen: boolean;
|
|
562
|
-
onClose: () => void;
|
|
563
|
-
status: 'loading' | 'success' | 'error' | 'warning';
|
|
564
|
-
title: string;
|
|
565
|
-
messages: string[];
|
|
566
|
-
/** Overall parse progress 0..100 while a large file streams in. */
|
|
567
|
-
progress?: number;
|
|
568
|
-
/** Coarse pipeline stage label (reading | parsing | typing | finalizing). */
|
|
569
|
-
phase?: string;
|
|
570
|
-
/** Whether the in-flight import can be cancelled. */
|
|
571
|
-
cancellable?: boolean;
|
|
572
|
-
/** Invoked when the user clicks Cancel during a loading import. */
|
|
573
|
-
onCancel?: () => void;
|
|
574
|
-
}
|
|
575
|
-
declare function PivotImportStatusModal({ isOpen, onClose, status, title, messages, progress, phase, cancellable, onCancel, }: PivotImportStatusModalProps): React$1.JSX.Element | null;
|
|
576
|
-
|
|
577
623
|
interface PivotReportMenuProps {
|
|
578
624
|
reports: PivotReport[];
|
|
579
625
|
activeReportId: string | null;
|
|
@@ -618,20 +664,112 @@ declare function usePivotController<TRow>(options: PivotControllerOptions<TRow>)
|
|
|
618
664
|
|
|
619
665
|
declare function usePivotControllerStore<TRow, TSelected>(controller: PivotController<TRow>, selector: (state: PivotControllerState<TRow>) => TSelected, isEqual?: (previous: TSelected, next: TSelected) => boolean): TSelected;
|
|
620
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
|
+
|
|
621
729
|
interface UsePivotDnDProps<TRow> {
|
|
622
730
|
fields: PivotField<TRow>[];
|
|
623
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
|
+
};
|
|
624
744
|
}
|
|
625
|
-
declare function usePivotDnD<TRow>({ fields, controller }: UsePivotDnDProps<TRow>): {
|
|
745
|
+
declare function usePivotDnD<TRow>({ fields, controller, touchDragDelay, t, locale, rtl, onChipLongPress, scrollRoot, }: UsePivotDnDProps<TRow>): {
|
|
626
746
|
activeDragId: string | null;
|
|
747
|
+
/** The field being dragged (`activeDragId` is the chip's id, prefixed in the field chooser). */
|
|
748
|
+
activeFieldId: string | null;
|
|
627
749
|
sensors: _dnd_kit_core.SensorDescriptor<_dnd_kit_core.SensorOptions>[];
|
|
628
|
-
|
|
750
|
+
collisionDetection: _dnd_kit_core.CollisionDetection;
|
|
751
|
+
announcements: Announcements | undefined;
|
|
752
|
+
handleDragStart: (event: DragStartEvent) => void;
|
|
629
753
|
handleDragMove: (event: DragMoveEvent) => void;
|
|
754
|
+
handleDragOver: (event: DragOverEvent) => void;
|
|
630
755
|
handleDragEnd: (event: DragEndEvent) => Promise<void>;
|
|
756
|
+
handleDragCancel: () => void;
|
|
757
|
+
/** The collision memory, for the probe inside the DndContext. */
|
|
758
|
+
memory: PivotCollisionMemory;
|
|
631
759
|
handleRemoveField: (id: string) => void;
|
|
632
760
|
handleMoveField: (fieldId: string, direction: "start" | "end" | "left" | "right") => void;
|
|
633
761
|
};
|
|
634
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
|
+
*/
|
|
635
773
|
declare function usePivotFullscreen(): {
|
|
636
774
|
isFullscreen: boolean;
|
|
637
775
|
containerRef: React$1.RefObject<HTMLDivElement | null>;
|
|
@@ -706,4 +844,4 @@ interface PivotThemeProviderProps {
|
|
|
706
844
|
}
|
|
707
845
|
declare function PivotThemeProvider({ theme, className, style, children }: PivotThemeProviderProps): React__default.JSX.Element;
|
|
708
846
|
|
|
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,
|
|
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 };
|