@kanunilabs/pivotgrid-react 1.6.0 → 1.8.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/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
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, PivotConditionRule as PivotConditionRule$1, PivotCell, PivotEngineResult, PivotControllerOptions, PivotLayoutState, PivotTheme, PivotStateStoringConfig, PivotToolbarConfig, PivotEngineRegistry, PivotLocale, PivotDictionary, PivotDensity, PivotColumnWidthDefaults, FieldMoveEvent, ExportingEvent, ExportFormat, PivotReport, PivotArea, PivotNode, PivotControllerState } from '@kanunilabs/pivotgrid-core';
5
- export { CustomSummaryOptions, DropIntent, ExportingEvent, FieldMoveEvent, FilterCondition, FilterGroup, FilterOperator, PivotArea, PivotCell, PivotCellTextAccessor, PivotCellValueAccessor, PivotColumnWidthDefaults, PivotControllerCallbacks, PivotControllerOptions, PivotControllerState, PivotDataSource, PivotDensity, PivotDictionary, PivotDragIntentState, PivotGroupInterval, PivotImportStatus, PivotLabelFilter, PivotLayoutProfile, PivotLayoutState, PivotLocale, PivotNode, PivotPrefilter, PivotRowKey, PivotRowKeyResolver, PivotRowTransaction, PivotSelectionMode, PivotSelectionRange, PivotSelectionState, PivotSelectionStats, PivotStateStoringConfig, PivotSummaryDisplayMode, PivotSummaryType, PivotTheme, PivotToolbarConfig, PivotTransactionResult, PivotValueFilter, defaultPivotLayout } from '@kanunilabs/pivotgrid-core';
4
+ import { 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, PivotEngineResult, PivotControllerOptions, PivotLayoutState, PivotTheme, PivotStateStoringConfig, PivotToolbarConfig, PivotEngineRegistry, PivotLocale, PivotDictionary, PivotDensity, PivotColumnWidthDefaults, FieldMoveEvent, ExportingEvent, ExportFormat, PivotReport, PivotArea, PivotNode, PivotControllerState } from '@kanunilabs/pivotgrid-core';
5
+ export { CustomSummaryOptions, DropIntent, ExportingEvent, FieldMoveEvent, FilterCondition, FilterGroup, FilterOperator, PersistedPivotState, PivotArea, PivotCell, PivotCellTextAccessor, PivotCellValueAccessor, PivotColumnWidthDefaults, PivotControllerCallbacks, PivotControllerOptions, PivotControllerState, PivotDataSource, PivotDensity, PivotDictionary, PivotDragIntentState, PivotGroupInterval, PivotImportStatus, PivotLabelFilter, PivotLayoutProfile, PivotLayoutState, PivotLocale, PivotNode, PivotPrefilter, PivotRowKey, PivotRowKeyResolver, PivotRowTransaction, PivotSelectionMode, PivotSelectionRange, PivotSelectionState, PivotSelectionStats, PivotStateStoringConfig, PivotSummaryDisplayMode, PivotSummaryType, PivotTheme, PivotToolbarConfig, PivotTransactionResult, PivotValueFilter, defaultPivotLayout } from '@kanunilabs/pivotgrid-core';
6
6
  import * as _dnd_kit_core from '@dnd-kit/core';
7
7
  import { DragMoveEvent, DragEndEvent } from '@dnd-kit/core';
8
8
 
@@ -16,6 +16,12 @@ interface PivotGridRef extends PivotGridRef$1 {
16
16
  * one column and keep the rest.
17
17
  */
18
18
  setColumnWidths: (widths: Record<string, number>) => void;
19
+ /**
20
+ * Quick search: show only the row members whose caption contains `text`
21
+ * (ignoring case and accents), with the members above them. `''` clears it.
22
+ * Works with or without the `search` box.
23
+ */
24
+ setSearchText: (text: string) => void;
19
25
  /**
20
26
  * Add, update and remove rows without rebuilding the pivot (live updates).
21
27
  * Rows are matched by the `rowKey` prop (by object identity without it); an
@@ -38,6 +44,20 @@ interface PivotGridRef extends PivotGridRef$1 {
38
44
  * The vanilla grid hands out the same object as `api.controller`.
39
45
  */
40
46
  getController: () => PivotController<any>;
47
+ /**
48
+ * Everything the reader arranged, as versioned plain JSON — what
49
+ * `stateStoring` saves. Keep it anywhere (a tab cache, IndexedDB, a server)
50
+ * and hand it back to `applyPersistedState`.
51
+ */
52
+ getPersistedState: (options?: {
53
+ include?: readonly 'scroll'[];
54
+ }) => PersistedPivotState;
55
+ /**
56
+ * Put a `getPersistedState` snapshot back: fields, areas, sorting, filters,
57
+ * open members, totals, calculated fields, chart type, column widths. False,
58
+ * and nothing changed, when it cannot be read (another `version`).
59
+ */
60
+ applyPersistedState: (state: unknown) => boolean;
41
61
  }
42
62
  type PivotCellTemplate = (props: Parameters<PivotCellTemplate$1>[0]) => React$1.ReactNode;
43
63
  type PivotConditionRule = PivotConditionRule$1<React$1.CSSProperties>;
@@ -226,6 +246,17 @@ interface BasePivotGridProps<TRow> {
226
246
  onError?: (error: Error) => void;
227
247
  /** Disables all interactive features (drag & drop, expand/collapse, context menu, filtering, etc.) */
228
248
  disabled?: boolean;
249
+ /**
250
+ * A search box in the footer: shows only the row members whose caption
251
+ * contains the text, on top of the reader's own filters. Default false.
252
+ * `ref.setSearchText(text)` works either way.
253
+ */
254
+ search?: boolean;
255
+ /**
256
+ * Most column members drawn (default 1000); past it the grid says so and
257
+ * totals still count all the data. `0` or `Infinity` turns the cap off.
258
+ */
259
+ maxColumns?: number;
229
260
  /** Slot for injecting Enterprise Calculated Field Modal */
230
261
  renderCalculatedFieldModal?: (props: any) => React__default.ReactNode;
231
262
  /** Slot for injecting Enterprise Prefilter Builder */
@@ -346,8 +377,12 @@ interface PivotFooterProps {
346
377
  * item — e.g. your pricing / Enterprise sales page.
347
378
  */
348
379
  upgradeUrl?: string;
380
+ /** Present → the quick-search box is drawn; called with the typed text. */
381
+ onSearch?: (text: string) => void;
382
+ /** The search in effect, so one set through `ref.setSearchText` shows in the box. */
383
+ searchText?: string;
349
384
  }
350
- 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;
385
+ 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, onSearch, searchText }: PivotFooterProps): React$1.JSX.Element;
351
386
 
352
387
  type MoveDirection = 'start' | 'end' | 'left' | 'right';
353
388
  interface PivotAreaStripsProps {
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
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, PivotConditionRule as PivotConditionRule$1, PivotCell, PivotEngineResult, PivotControllerOptions, PivotLayoutState, PivotTheme, PivotStateStoringConfig, PivotToolbarConfig, PivotEngineRegistry, PivotLocale, PivotDictionary, PivotDensity, PivotColumnWidthDefaults, FieldMoveEvent, ExportingEvent, ExportFormat, PivotReport, PivotArea, PivotNode, PivotControllerState } from '@kanunilabs/pivotgrid-core';
5
- export { CustomSummaryOptions, DropIntent, ExportingEvent, FieldMoveEvent, FilterCondition, FilterGroup, FilterOperator, PivotArea, PivotCell, PivotCellTextAccessor, PivotCellValueAccessor, PivotColumnWidthDefaults, PivotControllerCallbacks, PivotControllerOptions, PivotControllerState, PivotDataSource, PivotDensity, PivotDictionary, PivotDragIntentState, PivotGroupInterval, PivotImportStatus, PivotLabelFilter, PivotLayoutProfile, PivotLayoutState, PivotLocale, PivotNode, PivotPrefilter, PivotRowKey, PivotRowKeyResolver, PivotRowTransaction, PivotSelectionMode, PivotSelectionRange, PivotSelectionState, PivotSelectionStats, PivotStateStoringConfig, PivotSummaryDisplayMode, PivotSummaryType, PivotTheme, PivotToolbarConfig, PivotTransactionResult, PivotValueFilter, defaultPivotLayout } from '@kanunilabs/pivotgrid-core';
4
+ import { 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, PivotEngineResult, PivotControllerOptions, PivotLayoutState, PivotTheme, PivotStateStoringConfig, PivotToolbarConfig, PivotEngineRegistry, PivotLocale, PivotDictionary, PivotDensity, PivotColumnWidthDefaults, FieldMoveEvent, ExportingEvent, ExportFormat, PivotReport, PivotArea, PivotNode, PivotControllerState } from '@kanunilabs/pivotgrid-core';
5
+ export { CustomSummaryOptions, DropIntent, ExportingEvent, FieldMoveEvent, FilterCondition, FilterGroup, FilterOperator, PersistedPivotState, PivotArea, PivotCell, PivotCellTextAccessor, PivotCellValueAccessor, PivotColumnWidthDefaults, PivotControllerCallbacks, PivotControllerOptions, PivotControllerState, PivotDataSource, PivotDensity, PivotDictionary, PivotDragIntentState, PivotGroupInterval, PivotImportStatus, PivotLabelFilter, PivotLayoutProfile, PivotLayoutState, PivotLocale, PivotNode, PivotPrefilter, PivotRowKey, PivotRowKeyResolver, PivotRowTransaction, PivotSelectionMode, PivotSelectionRange, PivotSelectionState, PivotSelectionStats, PivotStateStoringConfig, PivotSummaryDisplayMode, PivotSummaryType, PivotTheme, PivotToolbarConfig, PivotTransactionResult, PivotValueFilter, defaultPivotLayout } from '@kanunilabs/pivotgrid-core';
6
6
  import * as _dnd_kit_core from '@dnd-kit/core';
7
7
  import { DragMoveEvent, DragEndEvent } from '@dnd-kit/core';
8
8
 
@@ -16,6 +16,12 @@ interface PivotGridRef extends PivotGridRef$1 {
16
16
  * one column and keep the rest.
17
17
  */
18
18
  setColumnWidths: (widths: Record<string, number>) => void;
19
+ /**
20
+ * Quick search: show only the row members whose caption contains `text`
21
+ * (ignoring case and accents), with the members above them. `''` clears it.
22
+ * Works with or without the `search` box.
23
+ */
24
+ setSearchText: (text: string) => void;
19
25
  /**
20
26
  * Add, update and remove rows without rebuilding the pivot (live updates).
21
27
  * Rows are matched by the `rowKey` prop (by object identity without it); an
@@ -38,6 +44,20 @@ interface PivotGridRef extends PivotGridRef$1 {
38
44
  * The vanilla grid hands out the same object as `api.controller`.
39
45
  */
40
46
  getController: () => PivotController<any>;
47
+ /**
48
+ * Everything the reader arranged, as versioned plain JSON — what
49
+ * `stateStoring` saves. Keep it anywhere (a tab cache, IndexedDB, a server)
50
+ * and hand it back to `applyPersistedState`.
51
+ */
52
+ getPersistedState: (options?: {
53
+ include?: readonly 'scroll'[];
54
+ }) => PersistedPivotState;
55
+ /**
56
+ * Put a `getPersistedState` snapshot back: fields, areas, sorting, filters,
57
+ * open members, totals, calculated fields, chart type, column widths. False,
58
+ * and nothing changed, when it cannot be read (another `version`).
59
+ */
60
+ applyPersistedState: (state: unknown) => boolean;
41
61
  }
42
62
  type PivotCellTemplate = (props: Parameters<PivotCellTemplate$1>[0]) => React$1.ReactNode;
43
63
  type PivotConditionRule = PivotConditionRule$1<React$1.CSSProperties>;
@@ -226,6 +246,17 @@ interface BasePivotGridProps<TRow> {
226
246
  onError?: (error: Error) => void;
227
247
  /** Disables all interactive features (drag & drop, expand/collapse, context menu, filtering, etc.) */
228
248
  disabled?: boolean;
249
+ /**
250
+ * A search box in the footer: shows only the row members whose caption
251
+ * contains the text, on top of the reader's own filters. Default false.
252
+ * `ref.setSearchText(text)` works either way.
253
+ */
254
+ search?: boolean;
255
+ /**
256
+ * Most column members drawn (default 1000); past it the grid says so and
257
+ * totals still count all the data. `0` or `Infinity` turns the cap off.
258
+ */
259
+ maxColumns?: number;
229
260
  /** Slot for injecting Enterprise Calculated Field Modal */
230
261
  renderCalculatedFieldModal?: (props: any) => React__default.ReactNode;
231
262
  /** Slot for injecting Enterprise Prefilter Builder */
@@ -346,8 +377,12 @@ interface PivotFooterProps {
346
377
  * item — e.g. your pricing / Enterprise sales page.
347
378
  */
348
379
  upgradeUrl?: string;
380
+ /** Present → the quick-search box is drawn; called with the typed text. */
381
+ onSearch?: (text: string) => void;
382
+ /** The search in effect, so one set through `ref.setSearchText` shows in the box. */
383
+ searchText?: string;
349
384
  }
350
- 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;
385
+ 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, onSearch, searchText }: PivotFooterProps): React$1.JSX.Element;
351
386
 
352
387
  type MoveDirection = 'start' | 'end' | 'left' | 'right';
353
388
  interface PivotAreaStripsProps {