@kanunilabs/pivotgrid-react 1.8.9 → 1.8.10

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 { 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';
4
+ import { PivotEngineResult, PivotLayoutState, PivotColumnWidthDefaults, PivotCopyInfo, PivotCopyError, PivotCopyErrorReason, 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, PivotVirtualizationOptions, defaultPivotLayout, mergePersistedState, splitPersistedState } from '@kanunilabs/pivotgrid-core';
6
6
  import * as _dnd_kit_core from '@dnd-kit/core';
7
7
  import { UniqueIdentifier, DroppableContainer, ClientRect, Announcements, DragStartEvent, DragMoveEvent, DragOverEvent, DragEndEvent } from '@dnd-kit/core';
8
8
 
@@ -64,6 +64,12 @@ interface PivotGridBodyProps {
64
64
  multiSelect?: boolean;
65
65
  /** Every change of the selected data cells (B.25). */
66
66
  onSelectionChange?: (event: PivotSelectionChangeEvent) => void;
67
+ /** Ctrl/Cmd+C copied the selected cells (B.99). */
68
+ onCopy?: (event: PivotCopyInfo) => void;
69
+ /** A Ctrl/Cmd+C did not reach the clipboard (B.99). */
70
+ onCopyError?: (error: PivotCopyError, info: {
71
+ reason: PivotCopyErrorReason;
72
+ }) => void;
67
73
  /** Filled by the body: the selected cells on request (B.25). */
68
74
  selectionApiRef?: React.MutableRefObject<{
69
75
  getSelectedCells(): PivotSelectedCell[];
@@ -82,7 +88,7 @@ interface PivotGridBodyProps {
82
88
  */
83
89
  rowHeight?: number;
84
90
  }
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;
91
+ 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, onCopy, onCopyError, selectionApiRef, registry, keyboardNavigation, onCellPrepared, renderNodeContextMenu, rowHeight }: PivotGridBodyProps): React$1.JSX.Element;
86
92
 
87
93
  /** The imperative handle a `ref` on the grid receives. */
88
94
  interface PivotGridRef extends PivotGridRef$1 {
@@ -368,6 +374,19 @@ interface BasePivotGridProps<TRow> {
368
374
  * long press adds one and a drag grows it.
369
375
  */
370
376
  onSelectionChange?: (event: PivotSelectionChangeEvent) => void;
377
+ /**
378
+ * Ctrl/Cmd+C copied the selected cells (B.99): the tab-separated `text`, the same cells as an `html` table, and the
379
+ * size. The copy goes through the browser's own copy event, so it works on a plain-HTTP page too.
380
+ */
381
+ onCopy?: (event: PivotCopyInfo) => void;
382
+ /**
383
+ * A Ctrl/Cmd+C did not reach the clipboard (B.99): `reason` is `'insecure-context'` (no clipboard on a plain-HTTP
384
+ * page and no copy event), `'permission-denied'` (the browser refused), `'empty-selection'` (the focus was in the
385
+ * grid with nothing selected) or `'unsupported'`. Show the user something; the grid does not.
386
+ */
387
+ onCopyError?: (error: PivotCopyError, info: {
388
+ reason: PivotCopyErrorReason;
389
+ }) => void;
371
390
  /**
372
391
  * Asked before a styled Excel export gives way to the plain .xls one (over
373
392
  * 100,000 list rows or 150,000 pivot cells); return `false` to cancel (B.23).
@@ -516,8 +535,10 @@ interface PivotAreaStripsProps {
516
535
  collapsed?: boolean;
517
536
  /** The strip's collapse button; without it there is no button. */
518
537
  onToggleCollapsed?: () => void;
538
+ /** `layout.areaHeaders.filter` (B.104): `false` draws no title row. */
539
+ showHeader?: boolean;
519
540
  }
520
- declare function PivotAreaStrips({ filterFields, onRemoveField, onFilterClick, onContextMenu, onSort, onGlobalContextMenu, onMoveField, maxRows, collapsed, collapsedRows, onToggleCollapsed, }: PivotAreaStripsProps): React__default.JSX.Element;
541
+ declare function PivotAreaStrips({ filterFields, onRemoveField, onFilterClick, onContextMenu, onSort, onGlobalContextMenu, onMoveField, maxRows, collapsed, collapsedRows, onToggleCollapsed, showHeader, }: PivotAreaStripsProps): React__default.JSX.Element;
521
542
 
522
543
  interface PivotFieldListProps {
523
544
  area: string;
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 { 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';
4
+ import { PivotEngineResult, PivotLayoutState, PivotColumnWidthDefaults, PivotCopyInfo, PivotCopyError, PivotCopyErrorReason, 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, PivotVirtualizationOptions, defaultPivotLayout, mergePersistedState, splitPersistedState } from '@kanunilabs/pivotgrid-core';
6
6
  import * as _dnd_kit_core from '@dnd-kit/core';
7
7
  import { UniqueIdentifier, DroppableContainer, ClientRect, Announcements, DragStartEvent, DragMoveEvent, DragOverEvent, DragEndEvent } from '@dnd-kit/core';
8
8
 
@@ -64,6 +64,12 @@ interface PivotGridBodyProps {
64
64
  multiSelect?: boolean;
65
65
  /** Every change of the selected data cells (B.25). */
66
66
  onSelectionChange?: (event: PivotSelectionChangeEvent) => void;
67
+ /** Ctrl/Cmd+C copied the selected cells (B.99). */
68
+ onCopy?: (event: PivotCopyInfo) => void;
69
+ /** A Ctrl/Cmd+C did not reach the clipboard (B.99). */
70
+ onCopyError?: (error: PivotCopyError, info: {
71
+ reason: PivotCopyErrorReason;
72
+ }) => void;
67
73
  /** Filled by the body: the selected cells on request (B.25). */
68
74
  selectionApiRef?: React.MutableRefObject<{
69
75
  getSelectedCells(): PivotSelectedCell[];
@@ -82,7 +88,7 @@ interface PivotGridBodyProps {
82
88
  */
83
89
  rowHeight?: number;
84
90
  }
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;
91
+ 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, onCopy, onCopyError, selectionApiRef, registry, keyboardNavigation, onCellPrepared, renderNodeContextMenu, rowHeight }: PivotGridBodyProps): React$1.JSX.Element;
86
92
 
87
93
  /** The imperative handle a `ref` on the grid receives. */
88
94
  interface PivotGridRef extends PivotGridRef$1 {
@@ -368,6 +374,19 @@ interface BasePivotGridProps<TRow> {
368
374
  * long press adds one and a drag grows it.
369
375
  */
370
376
  onSelectionChange?: (event: PivotSelectionChangeEvent) => void;
377
+ /**
378
+ * Ctrl/Cmd+C copied the selected cells (B.99): the tab-separated `text`, the same cells as an `html` table, and the
379
+ * size. The copy goes through the browser's own copy event, so it works on a plain-HTTP page too.
380
+ */
381
+ onCopy?: (event: PivotCopyInfo) => void;
382
+ /**
383
+ * A Ctrl/Cmd+C did not reach the clipboard (B.99): `reason` is `'insecure-context'` (no clipboard on a plain-HTTP
384
+ * page and no copy event), `'permission-denied'` (the browser refused), `'empty-selection'` (the focus was in the
385
+ * grid with nothing selected) or `'unsupported'`. Show the user something; the grid does not.
386
+ */
387
+ onCopyError?: (error: PivotCopyError, info: {
388
+ reason: PivotCopyErrorReason;
389
+ }) => void;
371
390
  /**
372
391
  * Asked before a styled Excel export gives way to the plain .xls one (over
373
392
  * 100,000 list rows or 150,000 pivot cells); return `false` to cancel (B.23).
@@ -516,8 +535,10 @@ interface PivotAreaStripsProps {
516
535
  collapsed?: boolean;
517
536
  /** The strip's collapse button; without it there is no button. */
518
537
  onToggleCollapsed?: () => void;
538
+ /** `layout.areaHeaders.filter` (B.104): `false` draws no title row. */
539
+ showHeader?: boolean;
519
540
  }
520
- declare function PivotAreaStrips({ filterFields, onRemoveField, onFilterClick, onContextMenu, onSort, onGlobalContextMenu, onMoveField, maxRows, collapsed, collapsedRows, onToggleCollapsed, }: PivotAreaStripsProps): React__default.JSX.Element;
541
+ declare function PivotAreaStrips({ filterFields, onRemoveField, onFilterClick, onContextMenu, onSort, onGlobalContextMenu, onMoveField, maxRows, collapsed, collapsedRows, onToggleCollapsed, showHeader, }: PivotAreaStripsProps): React__default.JSX.Element;
521
542
 
522
543
  interface PivotFieldListProps {
523
544
  area: string;