@kanunilabs/pivotgrid-react 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +55 -0
- package/README.md +54 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +465 -0
- package/dist/index.d.ts +465 -0
- package/dist/index.js +2 -0
- package/dist/styles.css +2203 -0
- package/package.json +58 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default, { Component, ErrorInfo } from 'react';
|
|
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, PivotConditionRule as PivotConditionRule$1, PivotCell, PivotEngineResult, PivotLayoutState, PivotTheme, PivotStateStoringConfig, PivotToolbarConfig, PivotEngineRegistry, PivotLocale, PivotDictionary, FieldMoveEvent, ExportingEvent, PivotGridRef, ExportFormat, PivotReport, PivotControllerOptions, PivotController, PivotControllerState } from '@kanunilabs/pivotgrid-core';
|
|
5
|
+
export { CustomSummaryOptions, DropIntent, ExportingEvent, FieldMoveEvent, FilterCondition, FilterGroup, FilterOperator, PivotArea, PivotCell, PivotCellTextAccessor, PivotCellValueAccessor, PivotControllerCallbacks, PivotControllerOptions, PivotControllerState, PivotDataSource, PivotDictionary, PivotDragIntentState, PivotGridRef, PivotGroupInterval, PivotImportStatus, PivotLayoutProfile, PivotLayoutState, PivotLocale, PivotNode, PivotPrefilter, PivotSelectionMode, PivotSelectionRange, PivotSelectionState, PivotSelectionStats, PivotStateStoringConfig, PivotSummaryDisplayMode, PivotSummaryType, PivotTheme, PivotToolbarConfig, defaultPivotLayout } from '@kanunilabs/pivotgrid-core';
|
|
6
|
+
import * as _dnd_kit_core from '@dnd-kit/core';
|
|
7
|
+
import { DragMoveEvent, DragEndEvent } from '@dnd-kit/core';
|
|
8
|
+
|
|
9
|
+
type PivotCellTemplate = (props: Parameters<PivotCellTemplate$1>[0]) => React$1.ReactNode;
|
|
10
|
+
type PivotConditionRule = PivotConditionRule$1<React$1.CSSProperties>;
|
|
11
|
+
type PivotField<TRow = any> = PivotField$1<TRow, PivotCellTemplate, React$1.CSSProperties>;
|
|
12
|
+
type CellClickEvent<TRow = any> = CellClickEvent$1<TRow, React$1.MouseEvent | React$1.KeyboardEvent>;
|
|
13
|
+
type CellPreparedEvent<TRow = any> = CellPreparedEvent$1<TRow, React$1.ReactNode, React$1.CSSProperties>;
|
|
14
|
+
|
|
15
|
+
interface PivotChartIntegrationOptions {
|
|
16
|
+
inverted?: boolean;
|
|
17
|
+
hideTotals?: boolean;
|
|
18
|
+
maxPoints?: number;
|
|
19
|
+
dataFieldsDisplayMode?: 'singleAxis' | 'splitAxes';
|
|
20
|
+
processCell?: (cell: PivotCell) => boolean;
|
|
21
|
+
transformer?: (engineResult: PivotEngineResult, fields: PivotField[], expandedPaths: Set<string>, locale: string, options: any) => ChartSyncResult;
|
|
22
|
+
}
|
|
23
|
+
interface ChartSeriesDef {
|
|
24
|
+
dataKey: string;
|
|
25
|
+
name: string;
|
|
26
|
+
color: string;
|
|
27
|
+
yAxisId?: string;
|
|
28
|
+
}
|
|
29
|
+
interface ChartSyncResult {
|
|
30
|
+
chartData: any[];
|
|
31
|
+
chartSeries: ChartSeriesDef[];
|
|
32
|
+
}
|
|
33
|
+
declare function usePivotChartSync(engineResult: PivotEngineResult | null, fields: PivotField[], expandedPaths: Set<string>, options?: PivotChartIntegrationOptions): ChartSyncResult;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Props for the BasePivotGrid component.
|
|
37
|
+
* This is the enterprise-grade data orchestration layer for analytics.
|
|
38
|
+
*/
|
|
39
|
+
interface BasePivotGridProps<TRow> {
|
|
40
|
+
/** Optional identifier for the grid instance. Used for report storing and caching. */
|
|
41
|
+
gridId?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Explicit URL for the engine Web Worker script. Required in bundlers that
|
|
44
|
+
* cannot statically resolve the default `new URL('./pivot.worker.js',
|
|
45
|
+
* import.meta.url)` (e.g. Next.js). Copy the worker from
|
|
46
|
+
* `@kanunilabs/pivotgrid-core/dist/pivot.worker.js` into a served path and
|
|
47
|
+
* point this at it, e.g. `/kanunilabs/pivot.worker.js`.
|
|
48
|
+
*/
|
|
49
|
+
workerUrl?: string | URL;
|
|
50
|
+
/** The raw tabular data array. */
|
|
51
|
+
data: TRow[];
|
|
52
|
+
/** Initial field configuration (Uncontrolled mode). */
|
|
53
|
+
initialFields?: PivotField<TRow>[];
|
|
54
|
+
/** Controlled field configuration. If provided, component acts as controlled. */
|
|
55
|
+
fields?: PivotField<TRow>[];
|
|
56
|
+
/** Controlled layout configuration. */
|
|
57
|
+
layout?: PivotLayoutState;
|
|
58
|
+
/** Custom theme configuration. */
|
|
59
|
+
theme?: PivotTheme;
|
|
60
|
+
/** Callback fired when the refresh button is clicked. */
|
|
61
|
+
onRefresh?: () => void;
|
|
62
|
+
/** Callback fired when data is imported via the UI. */
|
|
63
|
+
onImportData?: (data: TRow[]) => void;
|
|
64
|
+
/** When true, UI imports open a preview + column-mapping step before applying. */
|
|
65
|
+
previewImport?: boolean;
|
|
66
|
+
/** Configuration for state storing (localStorage, sessionStorage, etc). */
|
|
67
|
+
stateStoring?: PivotStateStoringConfig;
|
|
68
|
+
/** Configuration for keyboard navigation and accessibility. */
|
|
69
|
+
keyboardNavigation?: {
|
|
70
|
+
enabled: boolean;
|
|
71
|
+
};
|
|
72
|
+
/** Configuration for the toolbar visibility and features. */
|
|
73
|
+
toolbar?: PivotToolbarConfig;
|
|
74
|
+
/** The plugin registry containing custom functions and formatters. */
|
|
75
|
+
registry?: PivotEngineRegistry;
|
|
76
|
+
/** Locale for the grid (tr, en, ar). Defaults to tr. */
|
|
77
|
+
locale?: PivotLocale;
|
|
78
|
+
/** Right-to-Left (RTL) mode. Defaults to false (except for 'ar'). */
|
|
79
|
+
rtl?: boolean;
|
|
80
|
+
/** Dictionary for localized strings (i18n). */
|
|
81
|
+
dictionary?: Partial<PivotDictionary>;
|
|
82
|
+
/** Apply zebra striping to the data rows. */
|
|
83
|
+
striped?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Fired when any cell is clicked (data cells, row headers, grand totals).
|
|
86
|
+
* Replaces the deprecated onDrillDown handler.
|
|
87
|
+
* This is the single source of truth for cell interactions.
|
|
88
|
+
*/
|
|
89
|
+
onCellClick?: (e: CellClickEvent<TRow>) => void;
|
|
90
|
+
/**
|
|
91
|
+
* Fired when a field is moved within the PivotGrid (drag & drop).
|
|
92
|
+
* Provides a validate/cancel hybrid model. If it returns a Promise,
|
|
93
|
+
* the component awaits validation before committing the DND state.
|
|
94
|
+
*/
|
|
95
|
+
onFieldMove?: (e: FieldMoveEvent) => void | Promise<void>;
|
|
96
|
+
/** Fired immediately before the Pivot matrix compute cycle begins. */
|
|
97
|
+
onBeforePivotCalculate?: () => void;
|
|
98
|
+
/** Fired after the Pivot matrix compute cycle completes successfully. */
|
|
99
|
+
onAfterPivotCalculate?: (result: PivotEngineResult) => void;
|
|
100
|
+
/** Fired when an export action is initiated. Can be canceled. */
|
|
101
|
+
onExporting?: (e: ExportingEvent) => void;
|
|
102
|
+
/** Fired after a cell is prepared to allow modifications. */
|
|
103
|
+
onCellPrepared?: (e: CellPreparedEvent<TRow>) => void;
|
|
104
|
+
/** Fired when fields configuration changes. */
|
|
105
|
+
onFieldsChange?: (fields: PivotField<TRow>[]) => void;
|
|
106
|
+
/** Fired when layout options change. */
|
|
107
|
+
onLayoutChange?: (layout: PivotLayoutState) => void;
|
|
108
|
+
/** Customize the context menu items for a specific field. */
|
|
109
|
+
customContextMenuItems?: (field: PivotField<TRow>) => {
|
|
110
|
+
label: string;
|
|
111
|
+
action: () => void;
|
|
112
|
+
icon?: React__default.ReactNode;
|
|
113
|
+
}[];
|
|
114
|
+
/** Configuration for chart synchronization. */
|
|
115
|
+
chartIntegrationOptions?: PivotChartIntegrationOptions & {
|
|
116
|
+
chartType?: string;
|
|
117
|
+
};
|
|
118
|
+
/** Callback to receive chart integration payload. */
|
|
119
|
+
onChartSync?: (syncResult: ChartSyncResult) => void;
|
|
120
|
+
/** Callback fired when chart toggle is clicked. */
|
|
121
|
+
onToggleChart?: () => void;
|
|
122
|
+
/**
|
|
123
|
+
* Callback fired when full screen chart icon is clicked.
|
|
124
|
+
* @deprecated This prop will be removed in a future major version. Use chartIntegrationOptions instead.
|
|
125
|
+
*/
|
|
126
|
+
onOpenFullScreenChart?: () => void;
|
|
127
|
+
/** Callback to receive loaded chart state. */
|
|
128
|
+
onChartStateLoaded?: (chartState: PivotChartIntegrationOptions & {
|
|
129
|
+
chartType?: string;
|
|
130
|
+
}) => void;
|
|
131
|
+
/** Fired when a critical engine error occurs. */
|
|
132
|
+
onError?: (error: Error) => void;
|
|
133
|
+
/** Disables all interactive features (drag & drop, expand/collapse, context menu, filtering, etc.) */
|
|
134
|
+
disabled?: boolean;
|
|
135
|
+
/** Slot for injecting Enterprise Calculated Field Modal */
|
|
136
|
+
renderCalculatedFieldModal?: (props: any) => React__default.ReactNode;
|
|
137
|
+
/** Slot for injecting Enterprise Prefilter Builder */
|
|
138
|
+
renderPrefilterBuilder?: (props: any) => React__default.ReactNode;
|
|
139
|
+
/** Slot for injecting Enterprise Node Context Menu */
|
|
140
|
+
renderNodeContextMenu?: (props: any) => React__default.ReactNode;
|
|
141
|
+
/**
|
|
142
|
+
* Enables the Enterprise-only styled Excel & PDF export items in the footer.
|
|
143
|
+
* Set by `EnterprisePivotGrid`; in the Community build those items render locked.
|
|
144
|
+
*/
|
|
145
|
+
advancedExport?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* URL opened when a Community user clicks a locked Enterprise export item
|
|
148
|
+
* (e.g. your pricing / Enterprise sales page).
|
|
149
|
+
*/
|
|
150
|
+
upgradeUrl?: string;
|
|
151
|
+
}
|
|
152
|
+
declare const BasePivotGridInner: <TRow>(props: BasePivotGridProps<TRow>, ref: React__default.ForwardedRef<PivotGridRef>) => React__default.JSX.Element;
|
|
153
|
+
declare const BasePivotGrid: <TRow>(props: BasePivotGridProps<TRow> & {
|
|
154
|
+
ref?: React__default.ForwardedRef<PivotGridRef>;
|
|
155
|
+
}) => ReturnType<typeof BasePivotGridInner>;
|
|
156
|
+
|
|
157
|
+
interface PivotGridBodyProps {
|
|
158
|
+
engineResult: PivotEngineResult;
|
|
159
|
+
isBuilding: boolean;
|
|
160
|
+
buildProgress?: number;
|
|
161
|
+
rowFields: PivotField[];
|
|
162
|
+
colFields: PivotField[];
|
|
163
|
+
dataFields: PivotField[];
|
|
164
|
+
layout: PivotLayoutState;
|
|
165
|
+
expandedPaths: Set<string>;
|
|
166
|
+
allExpanded: boolean;
|
|
167
|
+
onToggleExpand: (path: string) => void;
|
|
168
|
+
onExpandPaths: (paths: string[]) => void;
|
|
169
|
+
onCollapsePaths: (paths: string[]) => void;
|
|
170
|
+
expandedColPaths: Set<string>;
|
|
171
|
+
allColExpanded: boolean;
|
|
172
|
+
onToggleColExpand: (path: string) => void;
|
|
173
|
+
onExpandColPaths: (paths: string[]) => void;
|
|
174
|
+
onCollapseColPaths: (paths: string[]) => void;
|
|
175
|
+
onCellClick?: (e: CellClickEvent) => void;
|
|
176
|
+
onContextMenu?: (x: number, y: number, fieldId: string, colPath?: string) => void;
|
|
177
|
+
onFilterClick?: (x: number, y: number, fieldId: string) => void;
|
|
178
|
+
onRemoveField: (id: string) => void;
|
|
179
|
+
onSort?: (id: string, dir: 'asc' | 'desc' | undefined) => void;
|
|
180
|
+
onGlobalContextMenu?: (x: number, y: number) => void;
|
|
181
|
+
columnWidths?: Record<string, number>;
|
|
182
|
+
onColumnWidthsChange?: (widths: Record<string, number>) => void;
|
|
183
|
+
onSelectionStatsChange?: (stats: {
|
|
184
|
+
count: number;
|
|
185
|
+
sum: number;
|
|
186
|
+
avg: number;
|
|
187
|
+
min: number;
|
|
188
|
+
max: number;
|
|
189
|
+
} | null) => void;
|
|
190
|
+
registry?: _kanunilabs_pivotgrid_core.PivotEngineRegistry;
|
|
191
|
+
keyboardNavigation?: {
|
|
192
|
+
enabled: boolean;
|
|
193
|
+
};
|
|
194
|
+
onCellPrepared?: (e: CellPreparedEvent<any>) => void;
|
|
195
|
+
disabled?: boolean;
|
|
196
|
+
renderNodeContextMenu?: (props: any) => React.ReactNode;
|
|
197
|
+
}
|
|
198
|
+
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, onGlobalContextMenu, columnWidths, onColumnWidthsChange, onSelectionStatsChange, registry, keyboardNavigation, onCellPrepared, renderNodeContextMenu }: PivotGridBodyProps): React$1.JSX.Element;
|
|
199
|
+
|
|
200
|
+
interface PivotFooterProps {
|
|
201
|
+
onToggleFieldChooser: () => void;
|
|
202
|
+
fieldChooserOpen: boolean;
|
|
203
|
+
onRefresh?: () => void;
|
|
204
|
+
onExport: (format: ExportFormat | string) => void;
|
|
205
|
+
onImportFile?: (file: File) => void;
|
|
206
|
+
/** Multi-file import (drag-drop / file picker with multiple selection). */
|
|
207
|
+
onImportFiles?: (files: File[]) => void;
|
|
208
|
+
/** Import delimited text from the clipboard. */
|
|
209
|
+
onPasteImport?: () => void;
|
|
210
|
+
onExpandAll: () => void;
|
|
211
|
+
onCollapseAll: () => void;
|
|
212
|
+
onAddCalculatedField?: () => void;
|
|
213
|
+
onOpenPrefilter?: () => void;
|
|
214
|
+
onToggleChart?: () => void;
|
|
215
|
+
isFullscreen?: boolean;
|
|
216
|
+
onToggleFullscreen?: () => void;
|
|
217
|
+
reports?: PivotReport[];
|
|
218
|
+
activeReportId?: string | null;
|
|
219
|
+
onSaveNewReport?: () => void;
|
|
220
|
+
onUpdateCurrentReport?: () => void;
|
|
221
|
+
onSaveAsReport?: () => void;
|
|
222
|
+
onLoadReport?: (id: string) => void;
|
|
223
|
+
onDeleteReport?: (id: string) => void;
|
|
224
|
+
onSetDefaultReport?: (id: string) => void;
|
|
225
|
+
onGlobalContextMenu?: (x: number, y: number) => void;
|
|
226
|
+
selectionStats?: {
|
|
227
|
+
count: number;
|
|
228
|
+
sum: number;
|
|
229
|
+
avg: number;
|
|
230
|
+
min: number;
|
|
231
|
+
max: number;
|
|
232
|
+
} | null;
|
|
233
|
+
toolbarConfig?: PivotToolbarConfig;
|
|
234
|
+
registry?: _kanunilabs_pivotgrid_core.PivotEngineRegistry;
|
|
235
|
+
/**
|
|
236
|
+
* Enables the Enterprise-only styled Excel & PDF export items. Set by
|
|
237
|
+
* `EnterprisePivotGrid`; in the Community build they render locked.
|
|
238
|
+
*/
|
|
239
|
+
advancedExport?: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* URL opened (new tab) when a Community user clicks a locked Enterprise export
|
|
242
|
+
* item — e.g. your pricing / Enterprise sales page.
|
|
243
|
+
*/
|
|
244
|
+
upgradeUrl?: string;
|
|
245
|
+
}
|
|
246
|
+
declare function PivotFooter({ onToggleFieldChooser, fieldChooserOpen, onRefresh, onExport, onImportFile, onImportFiles, onPasteImport, onExpandAll, onCollapseAll, onAddCalculatedField, onOpenPrefilter, onToggleChart, isFullscreen, onToggleFullscreen, reports, activeReportId, onSaveNewReport, onUpdateCurrentReport, onSaveAsReport, onLoadReport, onDeleteReport, onSetDefaultReport, onGlobalContextMenu, selectionStats, toolbarConfig, registry, advancedExport, upgradeUrl }: PivotFooterProps): React$1.JSX.Element;
|
|
247
|
+
|
|
248
|
+
interface PivotAreaStripsProps {
|
|
249
|
+
filterFields: PivotField[];
|
|
250
|
+
onRemoveField: (id: string) => void;
|
|
251
|
+
onFilterClick: (x: number, y: number, fieldId: string) => void;
|
|
252
|
+
onContextMenu?: (x: number, y: number, fieldId: string, colPath?: string) => void;
|
|
253
|
+
onSort?: (id: string, dir: 'asc' | 'desc' | undefined) => void;
|
|
254
|
+
onGlobalContextMenu?: (x: number, y: number) => void;
|
|
255
|
+
}
|
|
256
|
+
declare function PivotAreaStrips({ filterFields, onRemoveField, onFilterClick, onContextMenu, onSort, onGlobalContextMenu }: PivotAreaStripsProps): React__default.JSX.Element;
|
|
257
|
+
|
|
258
|
+
interface PivotFieldListProps {
|
|
259
|
+
area: string;
|
|
260
|
+
fields: PivotField[];
|
|
261
|
+
title?: string;
|
|
262
|
+
emptyText?: string;
|
|
263
|
+
onRemoveField: (id: string) => void;
|
|
264
|
+
onDeleteField?: (id: string) => void;
|
|
265
|
+
maxHeight?: number | string;
|
|
266
|
+
showCheckboxes?: boolean;
|
|
267
|
+
onToggleCheckbox?: (field: PivotField, checked: boolean) => void;
|
|
268
|
+
onFilterClick?: (e: React.MouseEvent, field: PivotField) => void;
|
|
269
|
+
}
|
|
270
|
+
declare function PivotFieldList({ area, fields, title, emptyText, onRemoveField, onDeleteField, maxHeight, showCheckboxes, onToggleCheckbox, onFilterClick }: PivotFieldListProps): React$1.JSX.Element;
|
|
271
|
+
|
|
272
|
+
interface PivotFieldSettingsDialogProps {
|
|
273
|
+
field: PivotField;
|
|
274
|
+
onClose: () => void;
|
|
275
|
+
onSave: (field: PivotField) => void;
|
|
276
|
+
}
|
|
277
|
+
declare function PivotFieldSettingsDialog({ field, onClose, onSave }: PivotFieldSettingsDialogProps): React$1.JSX.Element;
|
|
278
|
+
|
|
279
|
+
interface PivotHeaderFilterPopupProps {
|
|
280
|
+
field: PivotField;
|
|
281
|
+
data: any[];
|
|
282
|
+
onApply: (fieldId: string, selectedValues: Set<any>, filterType: 'include' | 'exclude') => void;
|
|
283
|
+
onClear: (fieldId: string) => void;
|
|
284
|
+
onClose: () => void;
|
|
285
|
+
x: number;
|
|
286
|
+
y: number;
|
|
287
|
+
}
|
|
288
|
+
declare const PivotHeaderFilterPopup: React__default.FC<PivotHeaderFilterPopupProps>;
|
|
289
|
+
|
|
290
|
+
interface PivotContextMenuProps {
|
|
291
|
+
x: number;
|
|
292
|
+
y: number;
|
|
293
|
+
field: PivotField;
|
|
294
|
+
onClose: () => void;
|
|
295
|
+
onSort: (direction: 'asc' | 'desc' | undefined) => void;
|
|
296
|
+
onHide: () => void;
|
|
297
|
+
onSettings: () => void;
|
|
298
|
+
onMoveField?: (direction: 'start' | 'end' | 'left' | 'right') => void;
|
|
299
|
+
onShowFieldChooser?: () => void;
|
|
300
|
+
colPath?: string;
|
|
301
|
+
rowFields?: PivotField[];
|
|
302
|
+
onSortBySummary?: (rowFieldId: string, colPath: string) => void;
|
|
303
|
+
onClearAllSorting?: () => void;
|
|
304
|
+
customContextMenuItems?: {
|
|
305
|
+
label: string;
|
|
306
|
+
action: () => void;
|
|
307
|
+
icon?: any;
|
|
308
|
+
}[];
|
|
309
|
+
onEditCalculatedField?: () => void;
|
|
310
|
+
}
|
|
311
|
+
declare function PivotContextMenu({ x, y, field, colPath, rowFields, onClose, onSort, onSortBySummary, onClearAllSorting, onHide, onSettings, onMoveField, onShowFieldChooser, customContextMenuItems, onEditCalculatedField }: PivotContextMenuProps): React$1.JSX.Element;
|
|
312
|
+
|
|
313
|
+
interface PivotPortalProps {
|
|
314
|
+
children: React__default.ReactNode;
|
|
315
|
+
}
|
|
316
|
+
declare function PivotPortal({ children }: PivotPortalProps): React__default.ReactPortal | null;
|
|
317
|
+
|
|
318
|
+
interface PivotImportStatusModalProps {
|
|
319
|
+
isOpen: boolean;
|
|
320
|
+
onClose: () => void;
|
|
321
|
+
status: 'loading' | 'success' | 'error' | 'warning';
|
|
322
|
+
title: string;
|
|
323
|
+
messages: string[];
|
|
324
|
+
/** Overall parse progress 0..100 while a large file streams in. */
|
|
325
|
+
progress?: number;
|
|
326
|
+
/** Coarse pipeline stage label (reading | parsing | typing | finalizing). */
|
|
327
|
+
phase?: string;
|
|
328
|
+
/** Whether the in-flight import can be cancelled. */
|
|
329
|
+
cancellable?: boolean;
|
|
330
|
+
/** Invoked when the user clicks Cancel during a loading import. */
|
|
331
|
+
onCancel?: () => void;
|
|
332
|
+
}
|
|
333
|
+
declare function PivotImportStatusModal({ isOpen, onClose, status, title, messages, progress, phase, cancellable, onCancel, }: PivotImportStatusModalProps): React$1.JSX.Element | null;
|
|
334
|
+
|
|
335
|
+
interface PivotReportMenuProps {
|
|
336
|
+
reports: PivotReport[];
|
|
337
|
+
activeReportId: string | null;
|
|
338
|
+
onSaveNew: () => void;
|
|
339
|
+
onUpdateCurrent: () => void;
|
|
340
|
+
onSaveAs: () => void;
|
|
341
|
+
onLoadReport: (id: string) => void;
|
|
342
|
+
onDeleteReport: (id: string) => void;
|
|
343
|
+
onSetDefault: (id: string) => void;
|
|
344
|
+
}
|
|
345
|
+
declare function PivotReportMenu({ reports, activeReportId, onSaveNew, onUpdateCurrent, onSaveAs, onLoadReport, onDeleteReport, onSetDefault }: PivotReportMenuProps): React$1.JSX.Element;
|
|
346
|
+
|
|
347
|
+
interface PivotReportSaveModalProps {
|
|
348
|
+
isOpen: boolean;
|
|
349
|
+
onClose: () => void;
|
|
350
|
+
onSave: (name: string, isDefault: boolean) => void;
|
|
351
|
+
defaultName?: string;
|
|
352
|
+
title?: string;
|
|
353
|
+
}
|
|
354
|
+
declare function PivotReportSaveModal({ isOpen, onClose, onSave, defaultName, title }: PivotReportSaveModalProps): React$1.JSX.Element | null;
|
|
355
|
+
|
|
356
|
+
interface Props {
|
|
357
|
+
children: React__default.ReactNode;
|
|
358
|
+
fallback?: React__default.ReactNode;
|
|
359
|
+
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
360
|
+
}
|
|
361
|
+
interface State {
|
|
362
|
+
hasError: boolean;
|
|
363
|
+
error: Error | null;
|
|
364
|
+
}
|
|
365
|
+
declare class PivotErrorBoundary extends Component<Props, State> {
|
|
366
|
+
state: State;
|
|
367
|
+
static getDerivedStateFromError(error: Error): State;
|
|
368
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
369
|
+
private handleReset;
|
|
370
|
+
render(): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | React__default.JSX.Element | null | undefined;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
declare const PivotPortalContext: React$1.Context<HTMLElement | null>;
|
|
374
|
+
|
|
375
|
+
declare function usePivotController<TRow>(options: PivotControllerOptions<TRow>): PivotController<TRow>;
|
|
376
|
+
|
|
377
|
+
declare function usePivotControllerStore<TRow, TSelected>(controller: PivotController<TRow>, selector: (state: PivotControllerState<TRow>) => TSelected, isEqual?: (previous: TSelected, next: TSelected) => boolean): TSelected;
|
|
378
|
+
|
|
379
|
+
interface UsePivotDnDProps<TRow> {
|
|
380
|
+
fields: PivotField<TRow>[];
|
|
381
|
+
controller: PivotController<TRow>;
|
|
382
|
+
}
|
|
383
|
+
declare function usePivotDnD<TRow>({ fields, controller }: UsePivotDnDProps<TRow>): {
|
|
384
|
+
activeDragId: string | null;
|
|
385
|
+
sensors: _dnd_kit_core.SensorDescriptor<_dnd_kit_core.SensorOptions>[];
|
|
386
|
+
handleDragStart: (event: any) => void;
|
|
387
|
+
handleDragMove: (event: DragMoveEvent) => void;
|
|
388
|
+
handleDragEnd: (event: DragEndEvent) => Promise<void>;
|
|
389
|
+
handleRemoveField: (id: string) => void;
|
|
390
|
+
handleMoveField: (fieldId: string, direction: "start" | "end" | "left" | "right") => void;
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
declare function usePivotFullscreen(): {
|
|
394
|
+
isFullscreen: boolean;
|
|
395
|
+
containerRef: React$1.RefObject<HTMLDivElement | null>;
|
|
396
|
+
toggleFullscreen: () => void;
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
declare function usePivotContextMenu(): {
|
|
400
|
+
chooserOpen: boolean;
|
|
401
|
+
setChooserOpen: React$1.Dispatch<React$1.SetStateAction<boolean>>;
|
|
402
|
+
settingsFieldId: string | null;
|
|
403
|
+
setSettingsFieldId: React$1.Dispatch<React$1.SetStateAction<string | null>>;
|
|
404
|
+
contextMenu: {
|
|
405
|
+
x: number;
|
|
406
|
+
y: number;
|
|
407
|
+
fieldId: string;
|
|
408
|
+
colPath?: string;
|
|
409
|
+
} | null;
|
|
410
|
+
setContextMenu: React$1.Dispatch<React$1.SetStateAction<{
|
|
411
|
+
x: number;
|
|
412
|
+
y: number;
|
|
413
|
+
fieldId: string;
|
|
414
|
+
colPath?: string;
|
|
415
|
+
} | null>>;
|
|
416
|
+
filterPopup: {
|
|
417
|
+
x: number;
|
|
418
|
+
y: number;
|
|
419
|
+
fieldId: string;
|
|
420
|
+
} | null;
|
|
421
|
+
setFilterPopup: React$1.Dispatch<React$1.SetStateAction<{
|
|
422
|
+
x: number;
|
|
423
|
+
y: number;
|
|
424
|
+
fieldId: string;
|
|
425
|
+
} | null>>;
|
|
426
|
+
isPrefilterOpen: boolean;
|
|
427
|
+
setIsPrefilterOpen: React$1.Dispatch<React$1.SetStateAction<boolean>>;
|
|
428
|
+
globalContextMenu: {
|
|
429
|
+
x: number;
|
|
430
|
+
y: number;
|
|
431
|
+
} | null;
|
|
432
|
+
setGlobalContextMenu: React$1.Dispatch<React$1.SetStateAction<{
|
|
433
|
+
x: number;
|
|
434
|
+
y: number;
|
|
435
|
+
} | null>>;
|
|
436
|
+
isCalcModalOpen: boolean;
|
|
437
|
+
setIsCalcModalOpen: React$1.Dispatch<React$1.SetStateAction<boolean>>;
|
|
438
|
+
editingCalcField: PivotField | undefined;
|
|
439
|
+
setEditingCalcField: React$1.Dispatch<React$1.SetStateAction<PivotField | undefined>>;
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
interface PivotLocalizationContextProps {
|
|
443
|
+
locale: PivotLocale;
|
|
444
|
+
dictionary: PivotDictionary;
|
|
445
|
+
t: (key: keyof PivotDictionary | string) => string;
|
|
446
|
+
rtl: boolean;
|
|
447
|
+
}
|
|
448
|
+
interface PivotConfigProviderProps {
|
|
449
|
+
children: React__default.ReactNode;
|
|
450
|
+
locale?: PivotLocale;
|
|
451
|
+
dictionary?: Partial<PivotDictionary>;
|
|
452
|
+
rtl?: boolean;
|
|
453
|
+
}
|
|
454
|
+
declare const PivotConfigProvider: React__default.FC<PivotConfigProviderProps>;
|
|
455
|
+
declare const usePivotConfig: () => PivotLocalizationContextProps;
|
|
456
|
+
|
|
457
|
+
interface PivotThemeProviderProps {
|
|
458
|
+
theme?: PivotTheme;
|
|
459
|
+
className?: string;
|
|
460
|
+
style?: React__default.CSSProperties;
|
|
461
|
+
children: React__default.ReactNode;
|
|
462
|
+
}
|
|
463
|
+
declare function PivotThemeProvider({ theme, className, style, children }: PivotThemeProviderProps): React__default.JSX.Element;
|
|
464
|
+
|
|
465
|
+
export { BasePivotGrid, type BasePivotGridProps, type CellClickEvent, type CellPreparedEvent, type ChartSeriesDef, type ChartSyncResult, PivotAreaStrips, type PivotCellTemplate, type PivotChartIntegrationOptions, type PivotConditionRule, PivotConfigProvider, PivotContextMenu, PivotErrorBoundary, type PivotField, PivotFieldList, PivotFieldSettingsDialog, PivotFooter, PivotGridBody, PivotHeaderFilterPopup, PivotImportStatusModal, PivotPortal, PivotPortalContext, PivotReportMenu, PivotReportSaveModal, PivotThemeProvider, usePivotChartSync, usePivotConfig, usePivotContextMenu, usePivotController, usePivotControllerStore, usePivotDnD, usePivotFullscreen };
|