@kanunilabs/pivotgrid-react 1.4.2 → 1.6.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.
Files changed (44) hide show
  1. package/README.md +1 -1
  2. package/dist/index.cjs +2 -2
  3. package/dist/index.d.cts +36 -5
  4. package/dist/index.d.ts +36 -5
  5. package/dist/index.js +2 -2
  6. package/dist/styles.css +199 -15
  7. package/dist/themes/all.css +1064 -0
  8. package/dist/themes/amber.css +28 -0
  9. package/dist/themes/aubergine.css +32 -0
  10. package/dist/themes/azure.css +28 -0
  11. package/dist/themes/burgundy.css +32 -0
  12. package/dist/themes/charcoal.css +32 -0
  13. package/dist/themes/contrast-dark.css +32 -0
  14. package/dist/themes/contrast-light.css +28 -0
  15. package/dist/themes/coral.css +28 -0
  16. package/dist/themes/corporate.css +28 -0
  17. package/dist/themes/deep-sea.css +32 -0
  18. package/dist/themes/editorial.css +28 -0
  19. package/dist/themes/ember.css +32 -0
  20. package/dist/themes/emerald.css +28 -0
  21. package/dist/themes/forest.css +32 -0
  22. package/dist/themes/glacier.css +28 -0
  23. package/dist/themes/graphite.css +32 -0
  24. package/dist/themes/indigo-night.css +32 -0
  25. package/dist/themes/indigo.css +28 -0
  26. package/dist/themes/ivory.css +28 -0
  27. package/dist/themes/lagoon.css +28 -0
  28. package/dist/themes/linen.css +28 -0
  29. package/dist/themes/midnight.css +32 -0
  30. package/dist/themes/mist.css +28 -0
  31. package/dist/themes/monochrome.css +28 -0
  32. package/dist/themes/onyx.css +32 -0
  33. package/dist/themes/orchid.css +28 -0
  34. package/dist/themes/porcelain.css +28 -0
  35. package/dist/themes/rose.css +28 -0
  36. package/dist/themes/sandstone.css +28 -0
  37. package/dist/themes/slate-night.css +32 -0
  38. package/dist/themes/slate.css +28 -0
  39. package/dist/themes/steel.css +32 -0
  40. package/dist/themes/stone.css +28 -0
  41. package/dist/themes/taupe.css +28 -0
  42. package/dist/themes/teal.css +28 -0
  43. package/dist/themes/terminal.css +32 -0
  44. package/package.json +6 -4
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, 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, PivotDictionary, PivotDragIntentState, PivotGroupInterval, PivotImportStatus, PivotLayoutProfile, PivotLayoutState, PivotLocale, PivotNode, PivotPrefilter, PivotRowKey, PivotRowKeyResolver, PivotRowTransaction, PivotSelectionMode, PivotSelectionRange, PivotSelectionState, PivotSelectionStats, PivotStateStoringConfig, PivotSummaryDisplayMode, PivotSummaryType, PivotTheme, PivotToolbarConfig, PivotTransactionResult, 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, 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';
6
6
  import * as _dnd_kit_core from '@dnd-kit/core';
7
7
  import { DragMoveEvent, DragEndEvent } from '@dnd-kit/core';
8
8
 
@@ -24,6 +24,14 @@ interface PivotGridRef extends PivotGridRef$1 {
24
24
  * pivot follows asynchronously.
25
25
  */
26
26
  applyTransaction: (transaction: PivotRowTransaction<any>) => PivotTransactionResult;
27
+ /**
28
+ * Queue a transaction; queued ones are merged and applied together after
29
+ * the `asyncTransactionWait` prop's milliseconds (default 50) — for a feed
30
+ * that ticks many times a second. The callback runs when its batch landed.
31
+ */
32
+ applyTransactionAsync: (transaction: PivotRowTransaction<any>, callback?: () => void) => void;
33
+ /** Apply the queued transactions now. */
34
+ flushAsyncTransactions: () => void;
27
35
  /**
28
36
  * The controller behind the grid — for the calls that take one, such as the
29
37
  * Enterprise AI layout functions (`getPivotAiSchema(ref.current.getController())`).
@@ -112,6 +120,8 @@ interface BasePivotGridProps<TRow> {
112
120
  * object identity.
113
121
  */
114
122
  rowKey?: PivotControllerOptions<TRow>['rowKey'];
123
+ /** How long `ref.applyTransactionAsync` collects transactions before applying them together. Default 50 ms. */
124
+ asyncTransactionWait?: number;
115
125
  /** Initial field configuration (Uncontrolled mode). */
116
126
  initialFields?: PivotField<TRow>[];
117
127
  /** Controlled field configuration. If provided, component acts as controlled. */
@@ -138,7 +148,10 @@ interface BasePivotGridProps<TRow> {
138
148
  serverSource?: PivotControllerOptions<TRow>['serverSource'];
139
149
  /** The plugin registry containing custom functions and formatters. */
140
150
  registry?: PivotEngineRegistry;
141
- /** Locale for the grid (tr, en, ar). Defaults to tr. */
151
+ /**
152
+ * Interface language: 'en', 'tr', 'ar', 'de', 'fr', 'es', 'it', 'pt', 'ru', 'zh-CN', 'ja' or 'ko'.
153
+ * Defaults to 'en'. Also sets the number formatting, and right-to-left for 'ar' (see `rtl`).
154
+ */
142
155
  locale?: PivotLocale;
143
156
  /** Right-to-Left (RTL) mode. Defaults to false (except for 'ar'). */
144
157
  rtl?: boolean;
@@ -146,6 +159,12 @@ interface BasePivotGridProps<TRow> {
146
159
  dictionary?: Partial<PivotDictionary>;
147
160
  /** Apply zebra striping to the data rows. */
148
161
  striped?: boolean;
162
+ /**
163
+ * Row rhythm: `'compact'` (24px rows, one size smaller type), `'normal'`
164
+ * (28px, the default) or `'comfortable'` (36px). Changing it repaints in
165
+ * place, without re-running the pivot engine.
166
+ */
167
+ density?: PivotDensity;
149
168
  /**
150
169
  * Starting widths in pixels: `{ rowHeader, data }` for every row-header
151
170
  * column and every data column. Defaults 150 and 95. A width the user drags
@@ -273,8 +292,14 @@ interface PivotGridBodyProps {
273
292
  onCellPrepared?: (e: CellPreparedEvent<any>) => void;
274
293
  disabled?: boolean;
275
294
  renderNodeContextMenu?: (props: any) => React.ReactNode;
295
+ /**
296
+ * Body row height in px — the grid's `density` resolved (`pivotRowHeight`).
297
+ * The virtualizer, spacers and keyboard scrolling all run on it; the
298
+ * stylesheet's density class sets the matching line heights. Default 28.
299
+ */
300
+ rowHeight?: number;
276
301
  }
277
- declare function PivotGridBody({ engineResult, isBuilding, buildProgress, rowFields, colFields: _colFields, dataFields, layout, expandedPaths, allExpanded, onToggleExpand, onExpandPaths, onCollapsePaths, expandedColPaths, allColExpanded, onToggleColExpand, onExpandColPaths, onCollapseColPaths, onCellClick, onContextMenu, onFilterClick, onRemoveField, onSort, onMoveField, onGlobalContextMenu, columnWidths, defaultColumnWidths, onColumnWidthsChange, onSelectionStatsChange, registry, keyboardNavigation, onCellPrepared, renderNodeContextMenu }: PivotGridBodyProps): React$1.JSX.Element;
302
+ declare function PivotGridBody({ engineResult, isBuilding, buildProgress, rowFields, colFields: _colFields, dataFields, layout, expandedPaths, allExpanded, onToggleExpand, onExpandPaths, onCollapsePaths, expandedColPaths, allColExpanded, onToggleColExpand, onExpandColPaths, onCollapseColPaths, onCellClick, onContextMenu, onFilterClick, onRemoveField, onSort, onMoveField, onGlobalContextMenu, columnWidths, defaultColumnWidths, onColumnWidthsChange, onSelectionStatsChange, registry, keyboardNavigation, onCellPrepared, renderNodeContextMenu, rowHeight }: PivotGridBodyProps): React$1.JSX.Element;
278
303
 
279
304
  interface PivotFooterProps {
280
305
  onToggleFieldChooser: () => void;
@@ -374,6 +399,8 @@ interface PivotHeaderFilterPopupProps {
374
399
  * existing direct consumer keeps compiling; BasePivotGrid always passes it.
375
400
  */
376
401
  gridId?: string;
402
+ /** The value / label filter dialog (G-PIV-03): a footer button for row and column fields. */
403
+ onConditionFilter?: () => void;
377
404
  }
378
405
  declare const PivotHeaderFilterPopup: React__default.FC<PivotHeaderFilterPopupProps>;
379
406
 
@@ -399,8 +426,10 @@ interface PivotContextMenuProps {
399
426
  icon?: any;
400
427
  }[];
401
428
  onEditCalculatedField?: () => void;
429
+ /** The value / label filter dialog (G-PIV-03); the item shows for row and column fields. */
430
+ onConditionFilter?: () => void;
402
431
  }
403
- declare function PivotContextMenu({ x, y, field, colPath, rowFields, onClose, onSort, onSortBySummary, onClearAllSorting, onHide, onSettings, onMoveField, onMoveToArea, onShowFieldChooser, customContextMenuItems, onEditCalculatedField }: PivotContextMenuProps): React$1.JSX.Element;
432
+ 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;
404
433
 
405
434
  interface NodeContextMenuState {
406
435
  x: number;
@@ -516,6 +545,8 @@ declare function usePivotContextMenu(): {
516
545
  setChooserOpen: React$1.Dispatch<React$1.SetStateAction<boolean>>;
517
546
  settingsFieldId: string | null;
518
547
  setSettingsFieldId: React$1.Dispatch<React$1.SetStateAction<string | null>>;
548
+ conditionFieldId: string | null;
549
+ setConditionFieldId: React$1.Dispatch<React$1.SetStateAction<string | null>>;
519
550
  contextMenu: {
520
551
  x: number;
521
552
  y: number;
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, 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, PivotDictionary, PivotDragIntentState, PivotGroupInterval, PivotImportStatus, PivotLayoutProfile, PivotLayoutState, PivotLocale, PivotNode, PivotPrefilter, PivotRowKey, PivotRowKeyResolver, PivotRowTransaction, PivotSelectionMode, PivotSelectionRange, PivotSelectionState, PivotSelectionStats, PivotStateStoringConfig, PivotSummaryDisplayMode, PivotSummaryType, PivotTheme, PivotToolbarConfig, PivotTransactionResult, 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, 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';
6
6
  import * as _dnd_kit_core from '@dnd-kit/core';
7
7
  import { DragMoveEvent, DragEndEvent } from '@dnd-kit/core';
8
8
 
@@ -24,6 +24,14 @@ interface PivotGridRef extends PivotGridRef$1 {
24
24
  * pivot follows asynchronously.
25
25
  */
26
26
  applyTransaction: (transaction: PivotRowTransaction<any>) => PivotTransactionResult;
27
+ /**
28
+ * Queue a transaction; queued ones are merged and applied together after
29
+ * the `asyncTransactionWait` prop's milliseconds (default 50) — for a feed
30
+ * that ticks many times a second. The callback runs when its batch landed.
31
+ */
32
+ applyTransactionAsync: (transaction: PivotRowTransaction<any>, callback?: () => void) => void;
33
+ /** Apply the queued transactions now. */
34
+ flushAsyncTransactions: () => void;
27
35
  /**
28
36
  * The controller behind the grid — for the calls that take one, such as the
29
37
  * Enterprise AI layout functions (`getPivotAiSchema(ref.current.getController())`).
@@ -112,6 +120,8 @@ interface BasePivotGridProps<TRow> {
112
120
  * object identity.
113
121
  */
114
122
  rowKey?: PivotControllerOptions<TRow>['rowKey'];
123
+ /** How long `ref.applyTransactionAsync` collects transactions before applying them together. Default 50 ms. */
124
+ asyncTransactionWait?: number;
115
125
  /** Initial field configuration (Uncontrolled mode). */
116
126
  initialFields?: PivotField<TRow>[];
117
127
  /** Controlled field configuration. If provided, component acts as controlled. */
@@ -138,7 +148,10 @@ interface BasePivotGridProps<TRow> {
138
148
  serverSource?: PivotControllerOptions<TRow>['serverSource'];
139
149
  /** The plugin registry containing custom functions and formatters. */
140
150
  registry?: PivotEngineRegistry;
141
- /** Locale for the grid (tr, en, ar). Defaults to tr. */
151
+ /**
152
+ * Interface language: 'en', 'tr', 'ar', 'de', 'fr', 'es', 'it', 'pt', 'ru', 'zh-CN', 'ja' or 'ko'.
153
+ * Defaults to 'en'. Also sets the number formatting, and right-to-left for 'ar' (see `rtl`).
154
+ */
142
155
  locale?: PivotLocale;
143
156
  /** Right-to-Left (RTL) mode. Defaults to false (except for 'ar'). */
144
157
  rtl?: boolean;
@@ -146,6 +159,12 @@ interface BasePivotGridProps<TRow> {
146
159
  dictionary?: Partial<PivotDictionary>;
147
160
  /** Apply zebra striping to the data rows. */
148
161
  striped?: boolean;
162
+ /**
163
+ * Row rhythm: `'compact'` (24px rows, one size smaller type), `'normal'`
164
+ * (28px, the default) or `'comfortable'` (36px). Changing it repaints in
165
+ * place, without re-running the pivot engine.
166
+ */
167
+ density?: PivotDensity;
149
168
  /**
150
169
  * Starting widths in pixels: `{ rowHeader, data }` for every row-header
151
170
  * column and every data column. Defaults 150 and 95. A width the user drags
@@ -273,8 +292,14 @@ interface PivotGridBodyProps {
273
292
  onCellPrepared?: (e: CellPreparedEvent<any>) => void;
274
293
  disabled?: boolean;
275
294
  renderNodeContextMenu?: (props: any) => React.ReactNode;
295
+ /**
296
+ * Body row height in px — the grid's `density` resolved (`pivotRowHeight`).
297
+ * The virtualizer, spacers and keyboard scrolling all run on it; the
298
+ * stylesheet's density class sets the matching line heights. Default 28.
299
+ */
300
+ rowHeight?: number;
276
301
  }
277
- declare function PivotGridBody({ engineResult, isBuilding, buildProgress, rowFields, colFields: _colFields, dataFields, layout, expandedPaths, allExpanded, onToggleExpand, onExpandPaths, onCollapsePaths, expandedColPaths, allColExpanded, onToggleColExpand, onExpandColPaths, onCollapseColPaths, onCellClick, onContextMenu, onFilterClick, onRemoveField, onSort, onMoveField, onGlobalContextMenu, columnWidths, defaultColumnWidths, onColumnWidthsChange, onSelectionStatsChange, registry, keyboardNavigation, onCellPrepared, renderNodeContextMenu }: PivotGridBodyProps): React$1.JSX.Element;
302
+ declare function PivotGridBody({ engineResult, isBuilding, buildProgress, rowFields, colFields: _colFields, dataFields, layout, expandedPaths, allExpanded, onToggleExpand, onExpandPaths, onCollapsePaths, expandedColPaths, allColExpanded, onToggleColExpand, onExpandColPaths, onCollapseColPaths, onCellClick, onContextMenu, onFilterClick, onRemoveField, onSort, onMoveField, onGlobalContextMenu, columnWidths, defaultColumnWidths, onColumnWidthsChange, onSelectionStatsChange, registry, keyboardNavigation, onCellPrepared, renderNodeContextMenu, rowHeight }: PivotGridBodyProps): React$1.JSX.Element;
278
303
 
279
304
  interface PivotFooterProps {
280
305
  onToggleFieldChooser: () => void;
@@ -374,6 +399,8 @@ interface PivotHeaderFilterPopupProps {
374
399
  * existing direct consumer keeps compiling; BasePivotGrid always passes it.
375
400
  */
376
401
  gridId?: string;
402
+ /** The value / label filter dialog (G-PIV-03): a footer button for row and column fields. */
403
+ onConditionFilter?: () => void;
377
404
  }
378
405
  declare const PivotHeaderFilterPopup: React__default.FC<PivotHeaderFilterPopupProps>;
379
406
 
@@ -399,8 +426,10 @@ interface PivotContextMenuProps {
399
426
  icon?: any;
400
427
  }[];
401
428
  onEditCalculatedField?: () => void;
429
+ /** The value / label filter dialog (G-PIV-03); the item shows for row and column fields. */
430
+ onConditionFilter?: () => void;
402
431
  }
403
- declare function PivotContextMenu({ x, y, field, colPath, rowFields, onClose, onSort, onSortBySummary, onClearAllSorting, onHide, onSettings, onMoveField, onMoveToArea, onShowFieldChooser, customContextMenuItems, onEditCalculatedField }: PivotContextMenuProps): React$1.JSX.Element;
432
+ 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;
404
433
 
405
434
  interface NodeContextMenuState {
406
435
  x: number;
@@ -516,6 +545,8 @@ declare function usePivotContextMenu(): {
516
545
  setChooserOpen: React$1.Dispatch<React$1.SetStateAction<boolean>>;
517
546
  settingsFieldId: string | null;
518
547
  setSettingsFieldId: React$1.Dispatch<React$1.SetStateAction<string | null>>;
548
+ conditionFieldId: string | null;
549
+ setConditionFieldId: React$1.Dispatch<React$1.SetStateAction<string | null>>;
519
550
  contextMenu: {
520
551
  x: number;
521
552
  y: number;